PageSourceSearch

https://www.horecastore.ae/_next/static/chunks/2zd3i8tbhhdcl.js

js horecastore.ae collected 2026-10-01 04:32:39 UTC 329,045 bytes, 99 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,8964,e=>{"use strict";var t=e.i(43476),r=e.i(18566),s=e.i(71645),i=e.i(55487);e.i(47167);var n=e.i(88425),a=e.i(37028),o=e.i(91852),l=e.i(42015),c=e.i(45056),u=e.i(49924),d=e.i(63774),h=e.i(16267);let p="hc_location_updated",g="hc_detect_time";function f(){let e=(0,i.useDispatch)(),t=(0,r.useRouter)();return(0,s.useEffect)(()=>{let t=localStorage.getItem("login_time");if(!t)return;let r=parseInt(t,10);if(isNaN(r))return;let s=Date.now()-r,i=()=>{e((0,o.logoutUser)()).finally(()=>{window.location.href="/login"})};if(s>=864e5)return void i();let n=setTimeout(i,864e5-s);return()=>clearTimeout(n)},[e]),(0,s.useEffect)(()=>{let r=new URLSearchParams(window.location.search).get("cc"),s=(0,d.isManualCountry)()||!!r;(0,d.stripCountryQueryFromUrl)();let i="localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname,a=(0,u.getLocationData)(),o=localStorage.getItem(g),l=document.cookie.split(";").find(e=>e.trim().startsWith("hc_cc="))?.split("=")[1];if(s){a?.country&&e((0,n.fetchCountryByName)(a.country));return}if(!i&&a&&o&&Date.now()-Number(o)<6e5&&a&&l===a.countryCode){a.country&&e((0,n.fetchCountryByName)(a.country));return}fetch("https://api.horecastore.ae/api/frontend/location").then(e=>e.json()).then(r=>{if("success"===r.status&&r.countryCode){let s=l!==r.countryCode;(0,u.setLocationData)(r),localStorage.setItem(g,Date.now().toString()),localStorage.setItem("hc_country_code",r.countryCode),localStorage.setItem("hc_country_code_time",Date.now().toString()),document.cookie=`hc_cc=${r.countryCode}; path=/; max-age=3600; SameSite=Lax`;let i=window.location.hostname.replace(/^www\./,"");i&&"localhost"!==i&&"127.0.0.1"!==i&&(document.cookie=`hc_cc=${r.countryCode}; path=/; max-age=3600; SameSite=Lax; Domain=${i}`),r.country&&e((0,n.fetchCountryByName)(r.country)),s&&t.refresh()}}).catch(()=>{})},[e,t]),(0,s.useEffect)(()=>{let t=()=>{let t=(0,u.getLocationData)();t?.country&&e((0,n.fetchCountryByName)(t.country));let r=localStorage.getItem("token")?.trim(),s=t?.countryCode;!r&&s&&(0,h.syncGuestCartPricesIfNeeded)(s).then(t=>{t&&(e((0,l.hydrateCart)()),e((0,c.hydrateGuestSaveItems)()))}).catch(()=>{})};return window.addEventListener(p,t),()=>window.removeEventListener(p,t)},[e]),(0,s.useEffect)(()=>{if(localStorage.getItem("token")?.trim())return;let t=((0,u.getLocationData)()?.countryCode||(0,d.readCountryCookie)()||new URLSearchParams(window.location.search).get("cc")||"").toUpperCase();if(!t)return;let r=!1;return(0,h.syncGuestCartPricesIfNeeded)(t).then(t=>{!r&&t&&(e((0,l.hydrateCart)()),e((0,c.hydrateGuestSaveItems)()))}).catch(()=>{}),()=>{r=!0}},[e]),(0,s.useEffect)(()=>{let t=localStorage.getItem("token")?.trim(),r="vendor"===localStorage.getItem("account_type");t&&!r?e((0,a.fetchProfile)()):e((0,a.setLoading)(!1))},[e]),null}var v=e.i(78226),m=e.i(64645),_=e.i(4786),x=e.i(28800),b=e.i(64766);(0,m.createAsyncThunk)("blog/like",async(e,{rejectWithValue:t})=>{try{return await (0,x.makeApiRequest)(b.apiUrls.BLOG_LIKE(e),{method:"POST"}),e}catch{return t(e)}}),(0,m.createAsyncThunk)("blog/share",async(e,{rejectWithValue:t})=>{try{return await (0,x.makeApiRequest)(b.apiUrls.BLOG_SHARE(e),{method:"POST"}),e}catch{return t(e)}}),(0,m.createAsyncThunk)("blog/view",async e=>{try{await (0,x.makeApiRequest)(b.apiUrls.BLOG_VIEW(e),{method:"POST"})}catch{}});let y=(0,m.createSlice)({name:"blogInteraction",initialState:{},reducers:{}}).reducer;var w=e.i(35423),S=e.i(60001),k=e.i(48107),j=e.i(89801);let E=(0,m.configureStore)({reducer:{auth:o.default,profile:a.default,vendorProfile:_.default,country:n.default,blogInteraction:y,cart:l.default,tax:w.default,wishlist:S.default,saveForLater:c.default,customerAddress:k.default,customerCounts:j.default}});var C=e.i(83005),N=e.i(63059),P=e.i(78583),F=e.i(37727),$=e.i(22016);let I=["/create-quotation","/checkout","/payment","/login","/register","/cart","/dashboard","/partner"],T="quote-bar-dismissed-ids";function R(){let e=(0,C.useQuoteList)(),i=(0,r.usePathname)(),[n,a]=(0,s.use
1State)(!1),o=!I.some(e=>i?.startsWith(e))&&e.length>0&&!n;if((0,s.useEffect)(()=>{let t=e.map(e=>e.id).join(",");a(sessionStorage.getItem(T)===t)},[e]),(0,s.useEffect)(()=>{if(!o)return;let e=document.body.style.paddingBottom,t=window.matchMedia("(min-width: 768px)"),r=()=>{document.body.style.paddingBottom=t.matches?"80px":e};return r(),t.addEventListener("change",r),()=>{t.removeEventListener("change",r),document.body.style.paddingBottom=e}},[o]),!o)return null;let l=e.slice(0,3),c=e.length-l.length;return(0,t.jsx)("aside",{className:"fixed bottom-4 left-1/2 z-[45] hidden w-[600px] max-w-[92vw] -translate-x-1/2 md:block",children:(0,t.jsxs)("div",{className:"relative rounded-[7px] shadow-[0_18px_50px_rgba(0,0,0,0.32)] transition-transform duration-300 hover:-translate-y-0.5",children:[(0,t.jsx)("div",{className:"relative overflow-hidden rounded-[7px] p-[2px]",children:(0,t.jsxs)("div",{className:"relative z-10 flex items-center justify-between gap-3 rounded-[5px] border-2 border-[#186737] bg-white px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex shrink-0 -space-x-2",children:[l.map(e=>(0,t.jsx)("div",{className:"h-11 w-11 overflow-hidden rounded-full border-2 border-[#186737] bg-white shadow-sm transition-transform duration-200 hover:z-10 hover:scale-110",children:e.image?(0,t.jsx)("img",{src:e.image,alt:"",className:"h-full w-full object-contain p-0.5"}):(0,t.jsx)("div",{className:"h-full w-full bg-emerald-50"})},e.id)),c>0&&(0,t.jsxs)("div",{className:"flex h-11 w-11 items-center justify-center rounded-full border-2 border-[#186737] bg-[#186737] text-[11px] font-bold text-white",children:["+",c]})]}),(0,t.jsxs)($.default,{href:"/create-quotation",className:"group inline-flex shrink-0 items-center gap-1 rounded-[7px] bg-gradient-to-r from-[#ff3b0a] to-[red] px-4 py-3 text-md font-bold text-white transition-colors hover:bg-[#145c30]",children:[(0,t.jsx)(P.FileText,{size:13,strokeWidth:2.4}),"Complete Your Quote",(0,t.jsx)(N.ChevronRight,{size:13,className:"transition-transform group-hover:translate-x-0.5"})]})]})}),(0,t.jsx)("button",{type:"button","aria-label":"Close quote bar",onClick:()=>{sessionStorage.setItem(T,e.map(e=>e.id).join(",")),a(!0)},className:"absolute -top-2 -right-2 z-20 flex h-6 w-6 items-center justify-center rounded-full border border-gray-200 bg-white text-gray-500 shadow-sm hover:bg-gray-100 hover:text-gray-800",children:(0,t.jsx)(F.X,{size:13,strokeWidth:2.4})})]})})}function M(){let e=(0,r.usePathname)();return I.some(t=>e?.startsWith(t))?null:(0,t.jsxs)($.default,{href:"/create-quotation","aria-label":"Create quotation",className:"fixed left-4 z-40 flex h-14 w-14 flex-col items-center justify-center rounded-full bg-[#186737] text-white shadow-[0_8px_24px_rgba(24,103,55,0.45)] active:scale-95 lg:hidden",style:{bottom:"calc(92px + env(safe-area-inset-bottom))"},children:[(0,t.jsx)(P.FileText,{size:22,strokeWidth:2.2}),(0,t.jsx)("span",{className:"mt-0.5 text-[8px] font-bold leading-none tracking-wide",children:"Quote"})]})}var O=e.i(29449);let A=(0,e.i(75254).default)("arrow-up-right",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);var L=e.i(64659),D=e.i(55900),z=e.i(63488),H=e.i(46897),q=e.i(43432),U=e.i(61745),B=e.i(12497),W=e.i(99683),V=e.i(69638);let G=W.object({email:W.string().matches(/^[^\s@]+@[^\s@]+\.[^\s@]+$/,"Please enter a valid email address").required("Email is required")});function Y(){let[e,r]=(0,s.useState)(!1),[i,n]=(0,s.useState)(""),a=(0,B.useFormik)({initialValues:{email:""},validationSchema:G,onSubmit:async(e,{resetForm:t,setSubmitting:s})=>{n("");try{await (0,x.makeApiRequest)("newsletters",{method:"POST",data:{email:e.email,is_active:1}}),r(!0),t()}catch(e){n((e?.response?.data?.message??e?.message??"")||"Something went wrong. Please try again.")}finally{s(!1)}}});return e?(0,t.jsxs)("div",{className:"flex items-center gap-2 bg-[#f0f9f4] border border-[#c3e6d4] rounded-[7px] px-3.5 py-3",children:[(0,t.jsx)(V.CheckCircle,{size:16,className:"text-[#186737] shrink-0"}),(0,t.jsx)("p",{className:"text-[13px] font-semibold text-[#186737]",children:"You've successfully subscribed!"})]}):(0,t.jsxs)("form",{onSubmit:a.handleSubmit,noValidate:!0,className:"flex flex-col gap-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("input",{type:"email",id:"email",name:"email",placeholder:"Your email address",value:a.values.email,onChange:a.handleChange,onBlur:a.handleBlur,className:`w-full border rounded-[7px] px-3.5 py-2.5 text-[13px] text-gray-700 placeholder:text-gray-300 outline-none focus:ring-2 transition-all ${a.touched.email&&a.errors.email?"border-red-400 focus:border-red-400 focus:ring-red-100":"border-gray-200 focus:border-[#186737] focu
1s:ring-[#186737]/10"}`}),a.touched.email&&a.errors.email&&(0,t.jsx)("p",{className:"text-[11px] text-red-500 mt-1",children:a.errors.email}),i&&(0,t.jsx)("p",{className:"text-[11px] text-red-500 mt-1",children:i})]}),(0,t.jsx)("button",{type:"submit",disabled:a.isSubmitting,className:"w-full bg-[#186737] hover:bg-[#145a2f] disabled:bg-gray-400 text-white text-[13px] font-semibold py-2.5 rounded-[7px] transition-colors duration-200",children:a.isSubmitting?"Subscribing…":"Subscribe"})]})}let K=(e,t)=>"string"==typeof e?e:"ar"===t?e.ar||e.en:e.en||e.ar,J=e=>"shop-by-brands"===e.slug?"/brands":`/${e.slug}`,X=[{label:"About Us",href:"/pages/about-us"},{label:"Starting a Restaurant?",href:"/starting-a-restaurant"},{label:"Track Your Order",href:"/track-order"},{label:"Returns & Refunds",href:"/pages/return-policy"},{label:"Warranty Info",href:"/pages/extended-warranty"},{label:"Blog & Resources",href:"/blog"}],Q=[{label:"Help Center",href:"/pages/contact-us"},{label:"Contact Us",href:"/pages/contact-us"},{label:"FAQs",href:"/faq"},{label:"Shipping Policy",href:"/pages/shipping-policy"},{label:"Terms of Service",href:"/pages/cancellation-policy"},{label:"Privacy Policy",href:"/pages/privacy-policy"}],Z=[{label:"True Refrigeration",href:"/brands/true-refrigeration"},{label:"Medal Equipment",href:"/brands/medal-equipment-authorised-dealer"},{label:"Manitowoc",href:"/brands/manitowoc"},{label:"Arctic Air",href:"/brands/arctic-air"}],ee=[{icon:(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,t.jsxs)("g",{clipPath:"url(#clip0_17_24)",children:[(0,t.jsx)("path",{d:"M48 24C48 10.7453 37.2547 0 24 0C10.7453 0 0 10.7453 0 24C0 35.255 7.74912 44.6995 18.2026 47.2934V31.3344H13.2538V24H18.2026V20.8397C18.2026 12.671 21.8995 8.8848 29.9194 8.8848C31.44 8.8848 34.0637 9.18336 35.137 9.48096V16.129C34.5706 16.0694 33.5866 16.0397 32.3645 16.0397C28.4294 16.0397 26.9088 17.5306 26.9088 21.4061V24H34.7482L33.4013 31.3344H26.9088V47.8243C38.7926 46.3891 48.001 36.2707 48.001 24H48Z",fill:"#0866FF"}),(0,t.jsx)("path",{d:"M33.4003 31.3344L34.7472 24H26.9078V21.4061C26.9078 17.5306 28.4285 16.0397 32.3635 16.0397C33.5856 16.0397 34.5696 16.0694 35.136 16.129V9.48096C34.0627 9.1824 31.439 8.8848 29.9184 8.8848C21.8986 8.8848 18.2016 12.671 18.2016 20.8397V24H13.2528V31.3344H18.2016V47.2934C20.0582 47.7542 22.0003 48 23.999 48C24.983 48 25.9536 47.9395 26.9069 47.8243V31.3344H33.3994H33.4003Z",fill:"white"})]}),(0,t.jsx)("defs",{children:(0,t.jsx)("clipPath",{id:"clip0_17_24",children:(0,t.jsx)("rect",{width:"48",height:"48",fill:"white"})})})]})}),href:"https://www.facebook.com/horecastore.ae",label:"Facebook"},{icon:(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,t.jsxs)("g",{clipPath:"url(#clip0_17_27)",children:[(0,t.jsx)("path",{d:"M24 4.32187C30.4125 4.32187 31.1719 4.35 33.6938 4.4625C36.0375 4.56562 37.3031 4.95938 38.1469 5.2875C39.2625 5.71875 40.0688 6.24375 40.9031 7.07812C41.7469 7.92188 42.2625 8.71875 42.6938 9.83438C43.0219 10.6781 43.4156 11.9531 43.5188 14.2875C43.6313 16.8187 43.6594 17.5781 43.6594 23.9813C43.6594 30.3938 43.6313 31.1531 43.5188 33.675C43.4156 36.0188 43.0219 37.2844 42.6938 38.1281C42.2625 39.2438 41.7375 40.05 40.9031 40.8844C40.0594 41.7281 39.2625 42.2438 38.1469 42.675C37.3031 43.0031 36.0281 43.3969 33.6938 43.5C31.1625 43.6125 30.4031 43.6406 24 43.6406C17.5875 43.6406 16.8281 43.6125 14.3063 43.5C11.9625 43.3969 10.6969 43.0031 9.85313 42.675C8.7375 42.2438 7.93125 41.7188 7.09688 40.8844C6.25313 40.0406 5.7375 39.2438 5.30625 38.1281C4.97813 37.2844 4.58438 36.0094 4.48125 33.675C4.36875 31.1438 4.34063 30.3844 4.34063 23.9813C4.34063 17.5688 4.36875 16.8094 4.48125 14.2875C4.58438 11.9437 4.97813 10.6781 5.30625 9.83438C5.7375 8.71875 6.2625 7.9125 7.09688 7.07812C7.94063 6.23438 8.7375 5.71875 9.85313 5.2875C10.6969 4.95938 11.9719 4.56562 14.3063 4.4625C16.8281 4.35 17.5875 4.32187 24 4.32187ZM24 0C17.4844 0 16.6688 0.028125 14.1094 0.140625C11.5594 0.253125 9.80625 0.665625 8.2875 1.25625C6.70312 1.875 5.3625 2.69062 4.03125 4.03125C2.69063 5.3625 1.875 6.70313 1.25625 8.27813C0.665625 9.80625 0.253125 11.55 0.140625 14.1C0.028125 16.6687 0 17.4844 0 24C0 30.51
156 0.028125 31.3312 0.140625 33.8906C0.253125 36.4406 0.665625 38.1938 1.25625 39.7125C1.875 41.2969 2.69063 42.6375 4.03125 43.9688C5.3625 45.3 6.70313 46.125 8.27813 46.7344C9.80625 47.325 11.55 47.7375 14.1 47.85C16.6594 47.9625 17.475 47.9906 23.9906 47.9906C30.5063 47.9906 31.3219 47.9625 33.8813 47.85C36.4313 47.7375 38.1844 47.325 39.7031 46.7344C41.2781 46.125 42.6188 45.3 43.95 43.9688C45.2812 42.6375 46.1063 41.2969 46.7156 39.7219C47.3063 38.1938 47.7188 36.45 47.8313 33.9C47.9438 31.3406 47.9719 30.525 47.9719 24.0094C47.9719 17.4938 47.9438 16.6781 47.8313 14.1188C47.7188 11.5688 47.3063 9.81563 46.7156 8.29688C46.125 6.70312 45.3094 5.3625 43.9688 4.03125C42.6375 2.7 41.2969 1.875 39.7219 1.26562C38.1938 0.675 36.45 0.2625 33.9 0.15C31.3313 0.028125 30.5156 0 24 0Z",fill:"#000100"}),(0,t.jsx)("path",{d:"M24 11.6719C17.1938 11.6719 11.6719 17.1938 11.6719 24C11.6719 30.8062 17.1938 36.3281 24 36.3281C30.8062 36.3281 36.3281 30.8062 36.3281 24C36.3281 17.1938 30.8062 11.6719 24 11.6719ZM24 31.9969C19.5844 31.9969 16.0031 28.4156 16.0031 24C16.0031 19.5844 19.5844 16.0031 24 16.0031C28.4156 16.0031 31.9969 19.5844 31.9969 24C31.9969 28.4156 28.4156 31.9969 24 31.9969Z",fill:"#000100"}),(0,t.jsx)("path",{d:"M39.6937 11.1844C39.6937 12.7782 38.4 14.0625 36.8156 14.0625C35.2219 14.0625 33.9375 12.7688 33.9375 11.1844C33.9375 9.59065 35.2313 8.30627 36.8156 8.30627C38.4 8.30627 39.6937 9.60003 39.6937 11.1844Z",fill:"#000100"})]}),(0,t.jsx)("defs",{children:(0,t.jsx)("clipPath",{id:"clip0_17_27",children:(0,t.jsx)("rect",{width:"48",height:"48",fill:"white"})})})]})}),href:"https://www.instagram.com/horecastore.ae",label:"Instagram"},{icon:(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,t.jsx)("g",{clipPath:"url(#clip0_17_32)",children:(0,t.jsx)("path",{d:"M44.4567 0H3.54333C2.60358 0 1.70232 0.373315 1.03782 1.03782C0.373315 1.70232 0 2.60358 0 3.54333V44.4567C0 45.3964 0.373315 46.2977 1.03782 46.9622C1.70232 47.6267 2.60358 48 3.54333 48H44.4567C45.3964 48 46.2977 47.6267 46.9622 46.9622C47.6267 46.2977 48 45.3964 48 44.4567V3.54333C48 2.60358 47.6267 1.70232 46.9622 1.03782C46.2977 0.373315 45.3964 0 44.4567 0ZM14.3067 40.89H7.09V17.9667H14.3067V40.89ZM10.6933 14.79C9.87473 14.7854 9.07583 14.5384 8.39747 14.0802C7.71911 13.622 7.19168 12.9731 6.88175 12.2154C6.57183 11.4577 6.4933 10.6252 6.65606 9.82291C6.81883 9.02063 7.2156 8.28455 7.79631 7.70756C8.37702 7.13057 9.11563 6.73853 9.91893 6.58092C10.7222 6.42331 11.5542 6.50719 12.3099 6.82197C13.0656 7.13675 13.7111 7.66833 14.1649 8.34962C14.6188 9.03092 14.8606 9.83138 14.86 10.65C14.8677 11.1981 14.765 11.7421 14.558 12.2496C14.351 12.7571 14.044 13.2178 13.6551 13.6041C13.2663 13.9905 12.8037 14.2946 12.2948 14.4983C11.786 14.702 11.2413 14.8012 10.6933 14.79ZM40.9067 40.91H33.6933V28.3867C33.6933 24.6933 32.1233 23.5533 30.0967 23.5533C27.9567 23.5533 25.8567 25.1667 25.8567 28.48V40.91H18.64V17.9833H25.58V21.16H25.6733C26.37 19.75 28.81 17.34 32.5333 17.34C36.56 17.34 40.91 19.73 40.91 26.73L40.9067 40.91Z",fill:"#0A66C2"})}),(0,t.jsx)("defs",{children:(0,t.jsx)("clipPath",{id:"clip0_17_32",children:(0,t.jsx)("rect",{width:"48",height:"48",fill:"white"})})})]})}),href:"https://www.linkedin.com/company/horecastore/",label:"LinkedIn"},{icon:(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,t.jsxs)("g",{clipPath:"url(#clip0_17_47)",children:[(0,t.jsx)("path",{d:"M47.044 12.3709C46.7726 11.3497 46.2378 10.4178 45.493 9.66822C44.7483 8.91869 43.8197 8.37791 42.8003 8.1C39.0476 7.09091 24.0476 7.09091 24.0476 7.09091C24.0476 7.09091 9.04761 7.09091 5.29488 8.1C4.27547 8.37791 3.34693 8.91869 2.60218 9.66822C1.85744 10.4178 1.32262 11.3497 1.05124 12.3709C0.0476075 16.14 0.0476074 24 0.0476074 24C0.0476074 24 0.0476075 31.86 1.05124 35.6291C1.32262 36.6503 1.85744 37.5822 2.60218 38.3318C3.34693 39.0813 4.27547 39.6221 5.29488 39.9C9.04761 40.9091 24.0476 40.9091 24.0476 40.9091C24.0476 40.9091 39.0476 40.9091 42.8003 39.9C43.8197 39.6221 44.7483 39.0813 45.493 38.3318C46.2378 37.5822 46.7726 36.6503 47.044 35.6291C48.0476 31.86 48.0476 24 48.0476 24C48.0476 24 48.0476 16.14 47.044 12.3709Z",fill:"#FF0302"}),(0,t.jsx)("path",{d:"M19.1385 31.1373V16.8628L31.684 24.0001L19.1385 31.1373Z",fill:"#FEFEFE"})]}),(0,t.jsx)("defs",{children:(0,t.jsx)("clipPath",{id:"clip0_17_47",children:(0,t.jsx)("rect",{width:"48",height:"48",fill:"white"})})})]})}),href:"https://www.youtube.com/@horecastoreinternational",label:"YouTube"}],et=({category:e,locale:r})=>
1{let[i,n]=(0,s.useState)(!1);return(0,t.jsxs)("div",{className:"border-b border-gray-100",children:[(0,t.jsxs)("button",{onClick:()=>n(!i),className:"w-full flex items-center justify-between py-3 text-left",children:[(0,t.jsx)("span",{className:"text-sm font-semibold text-gray-800",children:K(e.name,r)}),i?(0,t.jsx)(D.ChevronUp,{className:"w-4 h-4 text-[#186737]"}):(0,t.jsx)(L.ChevronDown,{className:"w-4 h-4 text-gray-400"})]}),i&&(0,t.jsxs)("div",{className:"pb-3 pl-2 flex flex-col gap-1.5",children:["shop-by-brands"===e.slug?Z.map(e=>(0,t.jsx)($.default,{href:e.href,className:"text-[13px] text-gray-500 hover:text-[#186737] transition-colors",children:e.label},e.href)):e.children?.slice(0,4).map(s=>(0,t.jsx)($.default,{href:`/${e.slug}/${s.slug}`,className:"text-[13px] text-gray-500 hover:text-[#186737] transition-colors",children:K(s.name,r)},s.id)),(0,t.jsxs)($.default,{href:J(e),className:"text-[12px] font-semibold text-[#186737] flex items-center gap-1 mt-1",children:["View All ",(0,t.jsx)(A,{className:"w-3 h-3"})]})]})]})},er=({title:e,links:r,onModalOpen:i})=>{let[n,a]=(0,s.useState)(!1);return(0,t.jsxs)("div",{className:"border-b border-gray-100",children:[(0,t.jsxs)("button",{onClick:()=>a(!n),className:"w-full flex items-center justify-between py-3 text-left",children:[(0,t.jsx)("span",{className:"text-sm font-semibold text-gray-800",children:e}),n?(0,t.jsx)(D.ChevronUp,{className:"w-4 h-4 text-[#186737]"}):(0,t.jsx)(L.ChevronDown,{className:"w-4 h-4 text-gray-400"})]}),n&&(0,t.jsx)("div",{className:"pb-3 pl-2 flex flex-col gap-2",children:r.map(e=>e.isModal?(0,t.jsx)("button",{onClick:()=>i?.(e.modalTitle??e.label),className:"text-[13px] text-gray-500 hover:text-[#186737] transition-colors text-left",children:e.label},e.label):(0,t.jsx)($.default,{href:e.href,className:"text-[13px] text-gray-500 hover:text-[#186737] transition-colors",children:e.label},e.href))})]})},es=({navItemData:e})=>{let r,i,n=(0,U.useLocale)(),[a,o]=(0,s.useState)(!1),[l,c]=(0,s.useState)(""),u=(r=e.find(e=>"shop-by-brands"===e.slug),i=e.filter(e=>"tableware"!==e.slug&&"shop-by-brands"!==e.slug).slice(0,r?4:5),r&&i.push(r),i),d=e=>{c(e),o(!0)};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("footer",{className:"bg-white border-t border-gray-100",children:[(0,t.jsx)("div",{className:"bg-[#f3f4f8] ",children:(0,t.jsx)("div",{className:"global-container py-8 sm:py-10",children:(0,t.jsxs)("div",{className:"flex flex-col md:flex-row flex-wrap items-center jmd:ustify-between justify-center md:gap-6",children:[(0,t.jsxs)("div",{className:"text-center sm:text-left",children:[(0,t.jsx)("p",{className:"text-[#7e859b] text-sm font-medium tracking-wide uppercase mb-1 md:flex hidden",children:"Need Help Getting Started?"}),(0,t.jsx)("p",{className:"text-[#7e859b] text-[12px] font-medium tracking-wide uppercase mb-1 md:hidden block",children:"Our team is here to guide you with the best solutions for your restaurant."}),(0,t.jsx)("h2",{className:"text-black text-xl sm:text-2xl font-bold md:hidden block",children:"Need Expert Assistance?"}),(0,t.jsx)("h2",{className:"text-black text-xl sm:text-2xl font-bold md:block hidden",children:"We're Always Here To Help"})]}),(0,t.jsxs)("div",{className:"md:flex hidden flex-col sm:flex-row items-center gap-4 sm:gap-6",children:[(0,t.jsxs)("a",{href:"tel:+971529193205",className:"flex items-center gap-2.5 bg-white/10 hover:bg-white/20 backdrop-blur-sm border border-white/20 text-black px-5 py-3 rounded-[7px] transition-all duration-200",children:[(0,t.jsx)("div",{className:"w-8 h-8 rounded-full bg-white/20 flex items-center justify-center",children:(0,t.jsx)(q.Phone,{className:"w-4 h-4 text-black"})}),(0,t.jsxs)("div",{className:"text-center md:text-left",children:[(0,t.jsx)("p",{className:"text-[#7e859b] text-[15px] font-medium uppercase tracking-wide",children:"Call Us"}),(0,t.jsxs)("p",{className:"text-black font-semibold text-base",children:[" ","+971529193205"]})]})]}),(0,t.jsxs)("a",{href:"mailto:[email protected]",className:"flex items-center gap-2.5 bg-white/10 hover:bg-white/20 backdrop-blur-sm border border-white/20 text-white px-5 py-3 rounded-[7px] transition-all duration-200",children:[(0,t.jsx)("div",{className:"w-8 h-8 rounded-full bg-white/20 flex items-center justify-center",children:(0,t.jsx)(z.Mail,{className:"w-4 h-4 text-black"})}),(0,t.jsxs)("div",{className:"text-center md:text-left",children:[(0,t.jsx)("p",{className:"text-[#7e859b] text-[15px] font-medium uppercase tracking-wide",children:"Email Support"}),(0,t.jsx)("p",{className:"text-black font-semibold text-base",children:"[email protected]"})]})]})]}),(0,t.jsx)("div",{className:"block md:hidden ",children:(0,t.jsx)("a",{href:"tel:+18664467322",className:"bg-[#186737] relative top-2.5 p-2.5 text-white 2xl:px-4 px-2.5 2xl:py-3 py-1.5 rounded  2xl:text-[14px] text-[12px] ",children:"Talk to Our Expert Now"})})]})})}),(0,t.jsx)("div",{className:"global-container py-10 hidden md:block",children:(0,t.jsx)("div",{className:"grid grid-cols-3 lg:grid-cols-5 ga
1p-8",children:u.map((e,r)=>(0,t.jsxs)("div",{className:r>=3?"hidden lg:block":"",children:[(0,t.jsxs)($.default,{href:J(e),className:"group flex items-center gap-1 mb-4",children:[(0,t.jsx)("h3",{className:"text-sm font-bold text-gray-900 group-hover:text-[#186737] transition-colors",children:K(e.name,n)}),(0,t.jsx)(A,{className:"w-3.5 h-3.5 text-gray-300 group-hover:text-[#186737] transition-colors opacity-0 group-hover:opacity-100"})]}),(0,t.jsxs)("ul",{className:"flex flex-col gap-2",children:["shop-by-brands"===e.slug?Z.map(e=>(0,t.jsx)("li",{children:(0,t.jsx)($.default,{href:e.href,className:"text-[13px] text-gray-500 hover:text-[#186737] transition-colors leading-relaxed",children:e.label})},e.href)):e.children?.slice(0,4).map(r=>(0,t.jsx)("li",{children:(0,t.jsx)($.default,{href:`/${e.slug}/${r.slug}`,className:"text-[13px] text-gray-500 hover:text-[#186737] transition-colors leading-relaxed",children:K(r.name,n)})},r.id)),(0,t.jsx)("li",{children:(0,t.jsxs)($.default,{href:J(e),className:"text-[12px] font-semibold text-[#186737] flex items-center gap-1 mt-1 hover:underline",children:["View All ",(0,t.jsx)(A,{className:"w-3 h-3"})]})})]})]},e.id))})}),(0,t.jsxs)("div",{className:"global-container py-4 block md:hidden",children:[(0,t.jsx)("p",{className:"text-[10px] font-bold text-gray-400 uppercase tracking-widest pt-3 pb-1",children:"Browse Categories"}),u.map(e=>(0,t.jsx)(et,{category:e,locale:n},e.id)),(0,t.jsx)("p",{className:"text-[10px] font-bold text-gray-400 uppercase tracking-widest pt-4 pb-1",children:"Company"}),(0,t.jsx)(er,{title:"Quick Links",links:X,onModalOpen:d}),(0,t.jsx)("p",{className:"text-[10px] font-bold text-gray-400 uppercase tracking-widest pt-4 pb-1",children:"Help"}),(0,t.jsx)(er,{title:"Customer Support",links:Q})]}),(0,t.jsx)("div",{className:"global-container",children:(0,t.jsx)("div",{className:"border-t border-gray-100"})}),(0,t.jsx)("div",{className:"global-container py-8",children:(0,t.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-8",children:[(0,t.jsxs)("div",{className:"hidden md:block",children:[(0,t.jsxs)("h4",{className:"text-sm font-bold text-gray-900 mb-4 flex items-center gap-2",children:[(0,t.jsx)("span",{className:"w-1 h-4 bg-[#186737] rounded-full inline-block"}),"Quick Links"]}),(0,t.jsx)("ul",{className:"flex flex-col gap-2",children:X.map(e=>(0,t.jsx)("li",{children:e.isModal?(0,t.jsx)("button",{onClick:()=>d(e.modalTitle??e.label),className:"text-[13px] text-gray-500 hover:text-[#186737] transition-colors text-left",children:e.label}):(0,t.jsx)($.default,{href:e.href,className:"text-[13px] text-gray-500 hover:text-[#186737] transition-colors",children:e.label})},e.label))})]}),(0,t.jsxs)("div",{className:"hidden md:block",children:[(0,t.jsxs)("h4",{className:"text-sm font-bold text-gray-900 mb-4 flex items-center gap-2",children:[(0,t.jsx)("span",{className:"w-1 h-4 bg-[#186737] rounded-full inline-block"}),"Customer Support"]}),(0,t.jsx)("ul",{className:"flex flex-col gap-2",children:Q.map(e=>(0,t.jsx)("li",{children:(0,t.jsx)($.default,{href:e.href,className:"text-[13px] text-gray-500 hover:text-[#186737] transition-colors",children:e.label})},e.href))})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("h4",{className:"text-sm font-bold text-gray-900 mb-4 flex items-center gap-2",children:[(0,t.jsx)("span",{className:"w-1 h-4 bg-[#186737] rounded-full inline-block"}),"Contact Info"]}),(0,t.jsxs)("ul",{className:"flex flex-col gap-3",children:[(0,t.jsxs)("li",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"w-7 h-7 rounded-[7px] bg-green-50 flex items-center justify-center flex-shrink-0 mt-0.5",children:(0,t.jsx)(q.Phone,{className:"w-3.5 h-3.5 text-[#186737]"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-[11px] text-gray-400 font-medium",children:"Phone"}),(0,t.jsx)("a",{href:"tel:+18664467322",className:"text-[13px] text-gray-700 hover:text-[#186737] transition-colors font-medium",children:"800-467-322"})]})]}),(0,t.jsxs)("li",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"w-7 h-7 rounded-[7px] bg-green-50 flex items-center justify-center flex-shrink-0 mt-0.5",children:(0,t.jsx)(z.Mail,{className:"w-3.5 h-3.5 text-[#186737]"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-[11px] text-gray-400 font-medium",children:"Email"}),(0,t.jsx)("a",{href:"mailto:[email protected]",className:"text-[13px] text-gray-700 hover:text-[#186737] transition-colors font-medium",children:"[email protected]"})]})]}),(0,t.jsxs)("li",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"w-7 h-7 rounded-[7px] bg-green-50 flex items-center justify-center flex-shrink-0 mt-0.5",children:(0,t.jsx)(H.MapPin,{className:"w-3.5 h-3.5 text-[#186737]"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-[11px] text-gray-400 font-medium",children:"Address"}),(0,t.jsxs)("p",{className:"text-[13px] text-gray-700 leading-relaxed",children:["FAB Compound, Building 5 - Warehouse Unit 9 A",(0,t.jsx)("span",{className:"block",children:"Dubai Investment Park First - Dubai - United Arab Emirates"})]})]})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("h4",{className:"text-sm font-bold text-gray-900 mb-1 flex items-center gap-2",children:[(0,t.jsx)("span",{className:"w-1 h-4 bg-[#186737] rounded-full inline-block"}),"Newsletter"]}),(0,t.jsx)("p",{className:"text-[12px] text-gray-400 mb-4 leading-relaxed",children:"Get deals, new products & restaurant tips straight to your inbox."}),(0,t.jsx)(Y,{}),(0,t.jsxs)("div",{className:"mt-5 flex flex-col mb-3 justify-center items-center",children:[(0,t.jsx)("p",{className:"text-[11px] text-gray-400 font-medium uppercase tracking-widest mb-3",children:"Follow Us"}),(0,t.jsx)("div",{className:"flex items-center gap-2",children:ee.map(({icon:e,href:r,label:s})=>(0,t.jsx)("a",{href:r,target:"_blank",rel:"noopener noreferrer","aria-label":s,className:"w-8 h-8 rounded-[7px] border border-gray-200 flex items-center justify-center text-gray-400 hover:border-[#186737] hover:text-[#186737] hover:bg-green-50 transition-all duration-200",children:(0,t.jsx)("div",{className:"w-4 h-4",children:e})},s))})]})]})]})}),(0,t.jsx)("div",{className:"global-container",children:(0,t.jsx)("div",{className:"border-t border-gray-100"})}),(0,t.jsx)("div",{className:"global-container py-5",children:(0,t.jsx)("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4",children:(0,t.jsx)("p",{className:"text-[12px] text-gray-400 text-center sm:text-left",children:"© 2026 HorecaStore. All Rights Reserved."})})})]}),(0,t.jsx)(O.default,{isOpen:a,onClose:()=>o(!1),title:l})]})},ei={bolivia:"BO","bosnia and herzegovina":"BA","brunei darussalam":"BN","cape verde":"CV",congo:"CG","congo, the democratic republic of the":"CD","cote d'ivoire":"CI","falkland islands (malvinas)":"FK","heard island and mcdonald islands":"HM","holy see (vatican city state)":"VA","iran, islamic republic of":"IR","korea, democratic people's republic of":"KP","korea, republic of":"KR","lao people's democratic republic":"LA","libyan arab jamahiriya":"LY","macedonia, the former yugoslav republic of":"MK","micronesia, federated states of":"FM","moldova, republic of":"MD","netherlands antilles":"AN","palestinian territory, occupied":"PS",pitcairn:"PN",reunion:"RE","russian federation":"RU","saint helena":"SH","serbia and montenegro":"RS","syrian arab republic":"SY","taiwan, province of china":"TW","tanzania, united republic of":"TZ","united arab emirates":"AE","united kingdom":"GB","united states":"US","united states minor outlying islands":"UM",venezuela:"VE","viet nam":"VN","virgin islands, british":"VG","virgin islands, u.s.":"VI"},en=null;function ea(e){let t=e.trim().toLowerCase();return t?ei[t]?ei[t]:(en||(en=function(){let e=new Intl.DisplayNames(["en"],{type:"region"}),t=new Map;for(let r=65;r<=90;r++)for(let s=65;s<=90;s++){let i=String.fromCharCode(r,s),n=e.of(i);n&&n!==i&&t.set(n.toLowerCase(),i)}return t}()),en.get(t)??null):null}var eo=e.i(43531),el=e.i(55436);let ec="United Arab Emirates";function eu({icon:e,name:r}
1){return e?(0,t.jsx)("img",{src:e,alt:r,className:"h-3 w-4 rounded-[2px] object-cover shrink-0"}):(0,t.jsx)(H.MapPin,{size:12,className:"text-[#186737] shrink-0"})}function ed({className:e="",fullWidth:r=!1,dropUp:i=!1,defaultOpen:n=!1}){let a=(0,u.useLocationData)(),[o,l]=(0,s.useState)([]),[c,p]=(0,s.useState)(!0),[g,f]=(0,s.useState)(""),[v,m]=(0,s.useState)(n),[_,y]=(0,s.useState)(""),[w,S]=(0,s.useState)(!1),k=(0,s.useRef)(null),j=(0,s.useRef)(null),E=(0,s.useMemo)(()=>[...o.filter(e=>e.name===ec),...o.filter(e=>e.name!==ec).sort((e,t)=>e.name.localeCompare(t.name))],[o]),C=E.find(e=>e.name===g),N=(0,s.useMemo)(()=>{let e=_.trim().toLowerCase();return e?E.filter(t=>t.name.toLowerCase().includes(e)):E},[E,_]);(0,s.useEffect)(()=>{let e=!1;return p(!0),(0,x.makeApiRequest)(b.apiUrls.COUNTRIES).then(t=>{e||l(t.data??[])}).catch(()=>{e||l([])}).finally(()=>{e||p(!1)}),()=>{e=!0}},[]),(0,s.useEffect)(()=>{if(!E.length)return;let e=a?.country??"",t=(a?.countryCode||(0,d.readCountryCookie)()||"").toUpperCase(),r=E.find(r=>!!e&&r.name.toLowerCase()===e.toLowerCase()||!!t&&ea(r.name)===t);r&&f(r.name)},[E,a?.country,a?.countryCode]),(0,s.useEffect)(()=>{if(!v)return void y("");let e=e=>{k.current&&!k.current.contains(e.target)&&m(!1)};return document.addEventListener("pointerdown",e),window.matchMedia("(pointer: coarse)").matches||setTimeout(()=>j.current?.focus(),40),()=>document.removeEventListener("pointerdown",e)},[v]);let P=async e=>{let t=ea(e.name);if(!t||e.name===g||w)return;let r=window.location.pathname+window.location.search+window.location.hash;f(e.name),S(!0),(0,d.persistSelectedCountry)(e.name,t);try{await (0,h.refreshGuestCartPrices)(t)}catch{}(0,d.reloadForCountry)(t,r)};return(0,t.jsxs)("div",{ref:k,className:`relative shrink-0 ${e}`,children:[(0,t.jsxs)("button",{type:"button","aria-label":"Select country",disabled:c||w,onClick:()=>!c&&!w&&m(e=>!e),className:r?"flex h-10 w-full items-center justify-between gap-2 rounded-[7px] border border-gray-200 bg-white px-3 text-sm text-gray-700 hover:border-[#186737] disabled:opacity-60 touch-manipulation":"flex h-7 items-center gap-1 rounded-full border border-gray-200 bg-white px-2 text-[12px] text-gray-600 hover:border-[#186737] hover:text-[#186737] disabled:opacity-60 touch-manipulation",children:[(0,t.jsx)(eu,{icon:C?.icon,name:C?.name??"Country"}),(0,t.jsx)("span",{className:"truncate max-w-[120px]",children:c?"Loading…":w?"Updating…":C?.name??"Country"}),(0,t.jsx)(L.ChevronDown,{size:12,className:`shrink-0 text-gray-400 transition-transform ${v?"rotate-180":""}`})]}),v&&(0,t.jsxs)("div",{className:`z-60 rounded-[7px] border border-gray-200 bg-white shadow-lg overflow-hidden ${n?"relative mt-2 w-full":`absolute w-64 ${i?"bottom-full left-0 mb-1":"right-0 top-full mt-1"} ${r?"left-0 right-0 w-full":""}`}`,children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 px-2.5 py-2 border-b border-gray-100",children:[(0,t.jsx)(el.Search,{size:12,className:"text-gray-400 shrink-0"}),(0,t.jsx)("input",{ref:j,type:"text",value:_,onChange:e=>y(e.target.value),placeholder:"Search country",className:"w-full text-[12px] text-gray-700 outline-none placeholder:text-gray-300 bg-transparent"})]}),(0,t.jsx)("div",{className:"max-h-56 overflow-y-auto py-1",children:0===N.length?(0,t.jsx)("p",{className:"text-center text-[11px] text-gray-400 py-5",children:"No results found"}):N.map(e=>{let r=e.name===g;return(0,t.jsxs)("button",{type:"button",onPointerDown:e=>{e.preventDefault(),e.stopPropagation()},onClick:t=>{t.preventDefault(),t.stopPropagation(),P(e)},className:`w-full flex items-center gap-2 px-2.5 py-1.5 text-[12px] text-left touch-manipulation ${r?"bg-green-50 text-[#186737] font-semibold":"text-gray-700 hover:bg-gray-50"}`,children:[(0,t.jsx)(eo.Check,{size:12,className:r?"text-[#186737] shrink-0":"invisible shrink-0"}),(0,t.jsx)(eu,{icon:e.icon,name:e.name}),(0,t.jsx)("span",{className:"truncate",children:e.name})]},e.id)})})]})]})}var eh=e.i(75786),ep=e.i(23352),eg=e.i(48256),ef=e.i(90597),ev=e.i(94351),em=e.i(1928),e_=e.i(84614);let ex=[{label:"Home",href:"/",icon:ev.Home,isCart:!1},{label:"Country",href:"",icon:eg.Globe,isCart:!1,isCountry:!0},{label:"Cart",href:"/cart",icon:em.ShoppingCart,isCart:!0},{label:"Wishlist",href:"/wishlist",icon:ef.Heart,isCart:!1},{label:"Account",href:"/account",icon:e_.User,isCart:!1}];function eb(){let e=(0,r.usePathname)(),i=(0,eh.useAppSelector)(e=>!!e.profile.customer),n=(0,ep.useCartId)(),a=(0,u.useLocationData)(),[o,l]=(0,s.use
1State)(!1),c=(0,eh.useAppSelector)(e=>i?e.customerCounts.cart_quantity_sum:e.cart.items.reduce((e,t)=>e+t.quantity,0)),d=(0,eh.useAppSelector)(e=>i?e.customerCounts.wishlist_count:e.wishlist.guestItems.length),h=i?"/dashboard":"/login",p=a?.country||"Country";return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("nav",{className:"fixed bottom-0 left-0 right-0 z-50 lg:hidden",style:{paddingBottom:"env(safe-area-inset-bottom)"},children:(0,t.jsx)("div",{className:"mx-4 mb-4 rounded-[22px] flex items-stretch",style:{background:"rgba(255,255,255,0.75)",backdropFilter:"blur(24px) saturate(200%)",WebkitBackdropFilter:"blur(24px) saturate(200%)",border:"0.5px solid rgba(255,255,255,0.65)",boxShadow:"0 2px 4px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.10), inset 0 1px 0 rgba(255,255,255,0.85)"},children:ex.map(r=>{let s="Account"===r.label?h:r.isCart&&n?`/cart/${n}`:r.href,i=r.isCountry?o:"/"===s?"/"===e:e.startsWith(s),a=r.icon;return r.isCart?(0,t.jsxs)($.default,{href:s,className:"flex-1 flex flex-col items-center justify-end pb-2.5 gap-1",children:[(0,t.jsxs)("div",{className:"relative",style:{marginTop:"-22px"},children:[(0,t.jsx)("div",{className:"w-[54px] h-[54px] rounded-full flex items-center justify-center active:scale-95 transition-transform duration-150",style:{background:"#186737",border:"3.5px solid rgba(255,255,255,0.95)",boxShadow:"0 4px 14px rgba(24,103,55,0.5), 0 1px 3px rgba(0,0,0,0.1)"},children:(0,t.jsx)(em.ShoppingCart,{size:22,color:"white",strokeWidth:2})}),c>0&&(0,t.jsx)("span",{className:"absolute -top-0.5 -right-0.5 min-w-[18px] h-[18px] bg-red-500 text-white text-[9px] font-bold rounded-full flex items-center justify-center leading-none",style:{border:"2px solid white",padding:"0 3px"},children:c>99?"99+":c})]}),(0,t.jsx)("span",{className:"text-[10px] font-semibold text-[#186737] leading-none",children:"Cart"})]},"cart"):r.isCountry?(0,t.jsxs)("button",{type:"button",onClick:()=>l(!0),className:"flex-1 flex flex-col items-center justify-center gap-[5px] py-3 relative active:scale-95 transition-transform duration-100",children:[i&&(0,t.jsx)("span",{className:"absolute top-[6px] left-1/2 -translate-x-1/2 w-[5px] h-[5px] rounded-full",style:{background:"#186737"}}),(0,t.jsx)("div",{className:"relative mt-1",children:(0,t.jsx)(a,{size:23,strokeWidth:i?2.3:1.7,color:i?"#186737":"#9ca3af",style:{transition:"all 0.18s ease"}})}),(0,t.jsx)("span",{className:"text-[10px] leading-none truncate max-w-[58px] px-0.5",style:{color:i?"#186737":"#9ca3af",fontWeight:i?600:400,transition:"all 0.18s ease"},children:p})]},"country"):(0,t.jsxs)($.default,{href:s,className:"flex-1 flex flex-col items-center justify-center gap-[5px] py-3 relative active:scale-95 transition-transform duration-100",children:[i&&(0,t.jsx)("span",{className:"absolute top-[6px] left-1/2 -translate-x-1/2 w-[5px] h-[5px] rounded-full",style:{background:"#186737"}}),(0,t.jsxs)("div",{className:"relative mt-1",children:[(0,t.jsx)(a,{size:23,strokeWidth:i?2.3:1.7,color:i?"#186737":"#9ca3af",style:{transition:"all 0.18s ease"}}),"Wishlist"===r.label&&d>0&&(0,t.jsx)("span",{className:"absolute -top-[6px] -right-[6px] min-w-[15px] h-[15px] bg-[#186737] text-white text-[8px] font-bold rounded-full flex items-center justify-center leading-none",style:{border:"1.5px solid white",padding:"0 2px"},children:d})]}),(0,t.jsx)("span",{className:"text-[10px] leading-none",style:{color:i?"#186737":"#9ca3af",fontWeight:i?600:400,transition:"all 0.18s ease"},children:r.label})]},s)})})}),o&&(0,t.jsxs)("div",{className:"fixed inset-0 z-60 lg:hidden",onClick:()=>l(!1),children:[(0,t.jsx)("div",{className:"absolute inset-0 bg-black/40"}),(0,t.jsxs)("div",{className:"absolute left-0 right-0 bottom-0 rounded-t-2xl bg-white px-4 pt-3 pb-6",style:{paddingBottom:"calc(24px + env(safe-area-inset-bottom))"},onClick:e=>e.stopPropagation(),children:[(0,t.jsx)("div",{className:"mx-auto mb-3 h-1 w-10 rounded-full bg-gray-200"}),(0,t.jsx)("p",{className:"text-sm font-semibold text-gray-900 mb-3",children:"Select country"}),(0,t.jsx)(ed,{fullWidth:!0,defaultOpen:!0})]})]})]})}var ey=e.i(71528),ew=e.i(92270),eS=e.i(92161),ek=e.i(86311),ej=e.i(57688),eE=e.i(74875),eC=e.i(27516),eN=e.i(50965);let eP=[{icon:e.i(39616).Settings,label:"My Dashboard",href:"/dashboard"},{icon:e_.User,label:"My Profile",href:"/dashboard/my-profile"},{icon:eN.ShoppingBag,label:"My Orders",href:"/dashboard/orders"},{icon:P.FileText,label:"My Quotes",href:"/dashboard/quotes"},{label:"Browsing History",href:"/dashboard/browsing-history",icon:eC.History},{icon:ef.Heart,label:"Saved Items",href:"/wishlist"},{icon:eE.HelpCircle,label:"Help & Support",href:"/dashboard/support"}],eF=function({show:e}
1){let[r,n]=(0,s.useState)(null),a=(0,i.useDispatch)(),l=(0,i.useSelector)(e=>e.profile.customer),c=(0,i.useSelector)(e=>e.auth.loading);if(!e)return null;let u=l?.name??"Guest",d=u.charAt(0).toUpperCase();return(0,t.jsxs)("div",{className:"absolute top-full right-0 bg-white rounded-[7px] overflow-hidden z-50 mt-4 dropdown-enter",style:{width:300,boxShadow:"0 20px 60px rgba(0,0,0,0.15), 0 4px 20px rgba(24,103,55,0.1)"},children:[(0,t.jsx)("div",{className:"absolute top-0 left-0 right-0 h-2 bg-transparent"}),(0,t.jsxs)("div",{className:"header-bg p-4 relative overflow-hidden",children:[(0,t.jsx)("div",{className:"absolute inset-0 opacity-10",style:{backgroundImage:"radial-gradient(circle at 80% 20%, white 1px, transparent 1px)",backgroundSize:"20px 20px"}}),(0,t.jsxs)("div",{className:"relative flex items-center justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-white/75 text-xs font-medium mb-0.5",children:"Welcome back"}),(0,t.jsx)("p",{className:"text-white font-bold text-[17px] tracking-tight",children:u})]}),(0,t.jsx)("div",{className:"w-11 h-11 rounded-full flex items-center justify-center text-[#186737] font-black text-lg",style:{background:"rgba(255,255,255,0.92)",boxShadow:"0 2px 10px rgba(0,0,0,0.15)"},children:d})]})]}),(0,t.jsxs)("div",{className:"profile-scroll overflow-y-auto",style:{maxHeight:420},children:[eP.map((e,s)=>{let i=r===e.label,a=e.icon;return(0,t.jsxs)($.default,{href:e.href,className:"menu-item menu-row flex items-center justify-between px-4 py-[11px] cursor-pointer transition-all duration-150 normal-row hover:bg-gray-50 border-b border-gray-50",style:{animationDelay:`${35*s}ms`},onMouseEnter:()=>n(e.label),onMouseLeave:()=>n(null),children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"w-8 h-8 rounded-[9px] flex items-center justify-center shrink-0 transition-all duration-150",style:{background:i?"#f0faf4":"#f8f9fa"},children:(0,t.jsx)(a,{size:15,color:i?"#186737":"#9ca3af",strokeWidth:2})}),(0,t.jsx)("span",{className:"text-sm font-medium transition-colors duration-150",style:{color:i?"#186737":"#374151"},children:e.label})]}),(0,t.jsx)(N.ChevronRight,{size:15,className:"chevron-icon shrink-0",color:i?"#186737":"#d1d5db",strokeWidth:2.5})]},e.label)}),(0,t.jsxs)("button",{onMouseEnter:()=>n("Sign Out"),onMouseLeave:()=>n(null),disabled:c,onClick:async()=>{await a((0,o.logoutUser)()),window.location.href="/"},className:"w-full flex items-center justify-between px-4 py-2.75 cursor-pointer transition-all duration-150 hover:bg-gray-50 disabled:opacity-70 disabled:cursor-not-allowed",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"w-8 h-8 rounded-[9px] flex items-center justify-center shrink-0 transition-all duration-150",style:{background:"Sign Out"===r?"#fff1f1":"#f8f9fa"},children:(0,t.jsx)(ew.LogOut,{size:15,color:"Sign Out"===r?"#ef4444":"#9ca3af",strokeWidth:2})}),(0,t.jsx)("span",{className:"text-sm font-medium transition-colors duration-150",style:{color:"Sign Out"===r?"#ef4444":"#6b7280"},children:"Sign Out"}),c&&(0,t.jsx)("span",{className:"w-3.5 h-3.5 border-2 border-red-400 border-t-transparent rounded-full animate-spin"})]}),!c&&(0,t.jsx)(N.ChevronRight,{size:15,className:"chevron-icon shrink-0",color:"Sign Out"===r?"#ef4444":"#d1d5db",strokeWidth:2.5})]})]}),(0,t.jsxs)("div",{className:"px-4 py-2.5 bg-gray-50 border-t border-gray-100 flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-[10px] text-gray-300 font-medium",children:"HorecaStore"}),(0,t.jsx)("span",{className:"text-[10px] text-gray-300",children:"v2.4.1"})]})]})};var e$=e.i(41947),e$=e$,eI=e.i(81140),eT=e.i(20783),eR=e.i(30030),eM=e.i(10772),eO=e.i(69340),eA=e.i(26330),eL=e.i(65491),eD=e.i(74606),ez=e.i(96626),eH=e.i(48425),eq=e.i(3536),eU=e.i(85369),eB=e.i(86312),eW=e.i(91918),eV="Dialog",[eG,eY]=(0,eR.createContextScope)(eV),[eK,eJ]=eG(eV),eX=e=>{let{__scopeDialog:r,children:i,open:n,defaultOpen:a,onOpenChange:o,modal:l=!0}=e,c=s.useRef(null),u=s.useRef(null),[d,h]=(0,eO.useControllableState)({prop:n,defaultProp:a??!1,onChange:o,caller:eV});return(0,t.jsx)(eK,{scope:r,triggerRef:c,contentRef:u,contentId:(0,eM.useId)(),titleId:(0,eM.useId)(),descriptionId:(0,eM.useId)(),open:d,onOpenChange:h,onOpenToggle:s.useCallback(()=>h(e=>!e),[h]),modal:l,children:i})};eX.displayName=eV;var eQ="DialogTrigger",eZ=s.forwardRef((e,r)=>{let{__scopeDialog:s,...i}=e,n=eJ(eQ,s),a=(0,eT.useComposedRefs)(r,n.triggerRef);return(0,t.jsx)(eH.Primitive.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":tc(n.open),...i,ref:a,onClick:(0,eI.composeEventHandlers)(e.onClick,n.onOpenToggle)})});eZ.displayName=eQ;var e0="DialogPortal",[e1,e3]=eG(e0,{forceMount:void 0}),e2=e=>{let{__scopeDialog:r,forceMount:i,children:n,container:a}=e,o=eJ(e0,r);return(0,t.jsx)(e1,{scope:r,forceMount:i,children:s.Children.map(n,e=>(0,t.jsx)(ez.Presence,{present:i||o.open,children:(0,t.jsx)(eD.Portal,{asChild:!0,container:a,children:e})}))})};e2.displayName=e0;var e4="DialogOverlay",e5=s.forwardRef((e,r)=>{let s=e3(e4,e.__scopeDialog),{forceMount:i=s.forceMount,...n}=e,a=eJ(e4,e.__scopeDialog);return a.modal?(0,t.jsx)(ez.Presence,{present:i||a.open,children:(0,t.jsx)(e6,{...n,ref:r})}):null});e5.displayName=e4;var e7=(0,eW.createSlot)("DialogOverlay.RemoveScroll"),e6=s.forwardRef((e,r)=>{let{__scopeDialog:s,...i}=e,n=eJ(e4,s);return(0,t.jsx)(eU.RemoveScroll,{as:e7,allowPinchZoom:!0,shards:[n.contentRef],children:(0,t.jsx)(eH.Primitive.div,{"data-state":tc(n.open),...i,ref:r,
1style:{pointerEvents:"auto",...i.style}})})}),e8="DialogContent",e9=s.forwardRef((e,r)=>{let s=e3(e8,e.__scopeDialog),{forceMount:i=s.forceMount,...n}=e,a=eJ(e8,e.__scopeDialog);return(0,t.jsx)(ez.Presence,{present:i||a.open,children:a.modal?(0,t.jsx)(te,{...n,ref:r}):(0,t.jsx)(tt,{...n,ref:r})})});e9.displayName=e8;var te=s.forwardRef((e,r)=>{let i=eJ(e8,e.__scopeDialog),n=s.useRef(null),a=(0,eT.useComposedRefs)(r,i.contentRef,n);return s.useEffect(()=>{let e=n.current;if(e)return(0,eB.hideOthers)(e)},[]),(0,t.jsx)(tr,{...e,ref:a,trapFocus:i.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,eI.composeEventHandlers)(e.onCloseAutoFocus,e=>{e.preventDefault(),i.triggerRef.current?.focus()}),onPointerDownOutside:(0,eI.composeEventHandlers)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;(2===t.button||r)&&e.preventDefault()}),onFocusOutside:(0,eI.composeEventHandlers)(e.onFocusOutside,e=>e.preventDefault())})}),tt=s.forwardRef((e,r)=>{let i=eJ(e8,e.__scopeDialog),n=s.useRef(!1),a=s.useRef(!1);return(0,t.jsx)(tr,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(n.current||i.triggerRef.current?.focus(),t.preventDefault()),n.current=!1,a.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(n.current=!0,"pointerdown"===t.detail.originalEvent.type&&(a.current=!0));let r=t.target;i.triggerRef.current?.contains(r)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&a.current&&t.preventDefault()}})}),tr=s.forwardRef((e,r)=>{let{__scopeDialog:i,trapFocus:n,onOpenAutoFocus:a,onCloseAutoFocus:o,...l}=e,c=eJ(e8,i),u=s.useRef(null),d=(0,eT.useComposedRefs)(r,u);return(0,eq.useFocusGuards)(),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(eL.FocusScope,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:a,onUnmountAutoFocus:o,children:(0,t.jsx)(eA.DismissableLayer,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":tc(c.open),...l,ref:d,onDismiss:()=>c.onOpenChange(!1)})}),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(tp,{titleId:c.titleId}),(0,t.jsx)(tg,{contentRef:u,descriptionId:c.descriptionId})]})]})}),ts="DialogTitle",ti=s.forwardRef((e,r)=>{let{__scopeDialog:s,...i}=e,n=eJ(ts,s);return(0,t.jsx)(eH.Primitive.h2,{id:n.titleId,...i,ref:r})});ti.displayName=ts;var tn="DialogDescription",ta=s.forwardRef((e,r)=>{let{__scopeDialog:s,...i}=e,n=eJ(tn,s);return(0,t.jsx)(eH.Primitive.p,{id:n.descriptionId,...i,ref:r})});ta.displayName=tn;var to="DialogClose",tl=s.forwardRef((e,r)=>{let{__scopeDialog:s,...i}=e,n=eJ(to,s);return(0,t.jsx)(eH.Primitive.button,{type:"button",...i,ref:r,onClick:(0,eI.composeEventHandlers)(e.onClick,()=>n.onOpenChange(!1))})});function tc(e){return e?"open":"closed"}tl.displayName=to;var tu="DialogTitleWarning",[td,th]=(0,eR.createContext)(tu,{contentName:e8,titleName:ts,docsSlug:"dialog"}),tp=({titleId:e})=>{let t=th(tu),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
2
3If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
4
5For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return s.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},tg=({contentRef:e,descriptionId:t})=>{let r=th("DialogDescriptionWarning"),i=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${r.contentName}}.`;return s.useEffect(()=>{let r=e.current?.getAttribute("aria-describedby");t&&r&&(document.getElementById(t)||console.warn(i))},[i,e,t]),null};e.s(["Close",0,tl,"Content",0,e9,"Description",0,ta,"Dialog",0,eX,"DialogClose",0,tl,"DialogContent",0,e9,"DialogDescription",0,ta,"DialogOverlay",0,e5,"DialogPortal",0,e2,"DialogTitle",0,ti,"DialogTrigger",0,eZ,"Overlay",0,e5,"Portal",0,e2,"Root",0,eX,"Title",0,ti,"Trigger",0,eZ,"WarningProvider",0,td,"createDialogScope",0,eY],26999);var tf=e.i(26999),tf=tf,tv=e.i(75157);function tm({...e}){return(0,t.jsx)(tf.Root,{"data-slot":"sheet",...e})}function t_({...e}){return(0,t.jsx)(tf.Close,{"data-slot":"sheet-close",...e})}function tx({...e}){return(0,t.jsx)(tf.Portal,{"data-slot":"sheet-portal",...e})}function tb({className:e,...r}){return(0,t.jsx)(tf.Overlay,{"data-slot":"sheet-overlay",className:(0,tv.cn)("fixed backdrop-blur-xs inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",e),...r})}function ty({className:e,children:r,side:s="right",showCloseButton:i=!0,...n}){return(0,t.jsxs)(tx,{children:[(0,t.jsx)(tb,{}),(0,t.jsxs)(tf.Content,{"data-slot":"sheet-content",className:(0,tv.cn)("fixed z-50 flex flex-col gap-4 bg-background shadow-lg transition ease-in-out data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:animate-in data-[state=open]:duration-500","right"===s&&"inset-y-0 end-0 h-full w-3/4 border-s data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm","left"===s&&"inset-y-0 start-0 h-full w-3/4 border-e data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm","top"===s&&"inset-x-0 top-0 h-auto border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top","bottom"===s&&"inset-x-0 bottom-0 h-auto border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",e),...n,children:[r,i&&(0,t.jsxs)(tf.Close,{className:"absolute hidden top-4 end-4 roun
5ded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-secondary",children:[(0,t.jsx)(e$.default,{className:"size-4"}),(0,t.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}function tw({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"sheet-header",className:(0,tv.cn)("flex flex-col gap-1.5 p-4",e),...r})}function tS({className:e,...r}){return(0,t.jsx)(tf.Title,{"data-slot":"sheet-title",className:(0,tv.cn)("font-semibold text-foreground",e),...r})}var tk=e.i(52947),tj=e.i(17550),tE=e.i(30298),tC=e.i(53144);let tN=e=>e.url?.startsWith("/")?e.url:`/${e.parent_category_url_resolved}/${e.url}`,tP="https://nlpuae-temp.thehorecastore.co/";function tF(){let e=(0,r.useRouter)(),[i,n]=(0,s.useState)(!1),[a,o]=(0,s.useState)(""),[l,c]=(0,s.useState)(null),[u,h]=(0,s.useState)(null),p=(0,s.useRef)(!1),[g,f]=(0,s.useState)(!1),v=(0,s.useRef)(null),m=(0,s.useRef)(null),[_,x]=(0,s.use
5State)(!0);(0,s.useEffect)(()=>{let e=()=>{window.innerWidth>=1920?x(!0):window.innerWidth>=768?x(!1):x(!0)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),(0,s.useEffect)(()=>{let e=()=>{n(!1),m.current?.blur()};return document.addEventListener("nav-hover",e),()=>document.removeEventListener("nav-hover",e)},[]);let b=l??u,y=b?.products??[],w=b?.categories??[],S=b?.brands??[],k=(0,s.useCallback)(async e=>{if(!e.trim()){c(null),f(!1);return}f(!0);try{let t=await (0,d.getCountryCodeClient)(),r=`${tP}search?query=${encodeURIComponent(e.trim())}&page=1&length=5&force_country=${t}`,s=await fetch(r);if(!s.ok)throw Error("search failed");let i=await s.json(),n=(0,tC.toSearchSuggestions)(i);c(n.data??null)}catch{}finally{f(!1)}},[]),j=t=>{let r=(t??a).trim();n(!1),r?e.push(`/search?q=${encodeURIComponent(r)}`):e.push("/search")};return(0,t.jsxs)("div",{className:"flex-1 hidden lg:block relative",children:[(0,t.jsxs)("div",{className:`flex items-center border rounded-full px-4 h-11 gap-2 transition-all duration-200 bg-white ${i?"border-[#186737]":"border-gray-200"}`,children:[(0,t.jsx)(el.Search,{size:16,className:"text-gray-400 shrink-0"}),(0,t.jsx)("input",{ref:m,type:"text","aria-label":"Search products",value:a,onChange:e=>{var t;o(t=e.target.value),v.current&&clearTimeout(v.current),v.current=setTimeout(()=>k(t),300)},onKeyDown:e=>"Enter"===e.key&&j(),placeholder:"Search 100,000+ products trusted by hotels & restaurants...",className:"flex-1 bg-white text-sm text-gray-700 outline-none placeholder:text-gray-400 min-w-0",onFocus:()=>{n(!0),p.current||(p.current=!0,f(!0),(0,d.getCountryCodeClient)().then(e=>fetch(`${tP}search?query=hoshizaki&page=1&length=5&force_country=${e}`)).then(e=>{if(!e.ok)throw Error("search failed");return e.json()}).then(e=>{h((0,tC.toSearchSuggestions)(e).data??null)}).catch(()=>{p.current=!1}).finally(()=>f(!1)))},onBlur:()=>n(!1)}),a&&(g?(0,t.jsx)("span",{className:"shrink-0 w-4 h-4 border-2 border-gray-300 border-t-[#186737] rounded-full animate-spin"}):(0,t.jsx)("button",{onClick:()=>{o(""),c(null)},"aria-label":"Clear search query",className:"shrink-0 text-black hover:text-gray-600 transition-colors",children:(0,t.jsx)(F.X,{size:15})})),(0,t.jsx)("button",{onClick:()=>j(),"aria-label":"Submit search",className:"bg-[#186737] text-white rounded-full w-7 h-7 flex items-center justify-center shrink-0 hover:bg-[#145c2e] transition-colors",disabled:!a,children:(0,t.jsx)(el.Search,{size:13})})]}),i&&(0,t.jsxs)("div",{onMouseDown:e=>e.preventDefault(),className:"absolute top-[calc(100%+8px)] left-0 right-0 bg-white rounded-[7px] shadow-[0_12px_48px_rgba(0,0,0,0.13)] border border-gray-100 z-50 overflow-hidden",children:[g&&(0,t.jsx)("div",{className:"h-0.5 bg-gray-100 overflow-hidden",children:(0,t.jsx)("div",{className:"h-full bg-[#186737] animate-pulse w-1/2"})}),(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsxs)("div",{className:"search-left-col bg-[#f8fafc] flex flex-col",children:[(0,t.jsxs)("div",{className:"px-3.5 pt-3.5 pb-3",children:[(0,t.jsx)("p",{className:"text-[9px] xl:text-[9.5px] 2xl:text-[10.5px] font-bold text-gray-400 uppercase tracking-[0.12em] mb-2",children:"Product Suggestions"}),g?(0,t.jsx)("ul",{className:"space-y-1",children:Array.from({length:5}).map((e,r)=>(0,t.jsx)("li",{className:"h-8 bg-gray-100 animate-pulse rounded-xl"},r))}):y.length>0?(0,t.jsx)("ul",{className:"space-y-0.5",children:y.slice(0,5).map((r,s)=>(0,t.jsx)("li",{children:(0,t.jsxs)($.default,{href:tN(r),onClick:()=>{n(!1),e.push(tN(r))},className:"w-full text-left flex items-center gap-2.5 px-3 py-2 rounded-xl hover:bg-white hover:shadow-sm transition-all group",children:[(0,t.jsx)(el.Search,{size:12,className:"text-gray-300 shrink-0 group-hover:text-[#186737] transition-colors"}),(0,t.jsx)("span",{className:"text-[11px] xl:text-[12px] 2xl:text-[13px] text-gray-700 line-clamp-1 group-hover:text-[#186737] transition-colors",children:r.name.en})]})},s))}):(0,t.jsx)("p",{className:"text-[12px] text-gray-400 px-3 py-2",children:"No suggestions"})]}),(0,t.jsx)("div",{className:"mx-5 border-t border-gray-200"}),(0,t.jsxs)("div",{className:"px-5 py-3",children:[(0,t.jsx)("p",{className:"text-[9px] xl:text-[9.5px] 2xl:text-[10.5px] font-bold text-gray-400 uppercase tracking-[0.12em] mb-2",children:"Categories"}),g?(0,t.jsx)("div",{className:"flex gap-2 flex-wrap",children:Array.from({length:4}).map((e,r)=>(0,t.jsx)("div",{className:"h-7 w-24 bg-gray-100 animate-pulse rounded-full"},r))}):w.length>0?(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:w.slice(0,6).map((r,s)=>(0,t.jsx)($.default,{href:`/${r.super_parent_url}/${r.url}`,onClick:()=>{n(!1),e.push(`/${r.super_parent_url}/${r.url}`)},className:"text-[10.5px] xl:text-[11px] 2xl:text-[12px] text-gray-600 bg-white border border-gray-200 rounded-full px-2.5 py-1 xl:px-3 xl:py-1.5 hover:border-[#186737] hover:text-[#186737] hover:bg-[#186737]/5 transition-all",children:r.name.en},s))}):(0,t.jsx)("p",{className:"text-[12px] text-gray-400",children:"No categories"})]}),(0,t.jsx)("div",{className:"mx-5 border-t border-gray-200"}),(0,t.jsxs)("div",{className:"px-5 py-3",children:[(0,t.jsx)("p",{className:"text-[9px] xl:text-[9.5px] 2xl:text-[10.5px] font-bold text-gray-400 uppercase tracking-[0.12em] mb-2",children:"Brands"}),g?(0,t.jsx)("div",{className:"flex gap-2 flex-wrap",children:Array.from({length:3}).map((e,r)=>(0,t.jsx)("div",{className:"h-7 w-20 bg-gray-100 animate-pulse rounded-full"},r))}):S.length>0?(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:S.slice(0,5).map((r,s)=>(0,t.jsx)($.default,{href:`/brands/${r.slug}`,onClick:()=>{n(!1),e.push(`/brands/${r.slug}`)},className:"text-[10.5px] xl:text-[11px] 2xl:text-[12px] text-gray-600 bg-white border border-gray-200 rounded-full px-2.5 py-1 xl:px-3 xl:py-1.5 hover:border-[#186737] hover:text-[#186737] hover:bg-[#186737]/5 transition-all",children:r.name.en},s))}):(0,t.jsx)("p",{className:"text-[12px] text-gray-400",children:"No brands"})]}),(0,t.jsx)("div",{className:"mx-5 border-t border-gray-200"})]}),(0,t.jsxs)("div",{className:"search-right-col p-3.5 overflow-y-auto max-h-115",children:[(0,t.jsx)("p",{className:"text-[9px] xl:text-[9.5px] 2xl:text-[10.5px] font-bold text-gray-400 uppercase tracking-[0.12em] mb-4",children:"Trending Products"}),g?(0,t.jsx)("ul",{className:"space-y-2.5",children:Array.from({length:4}).map((e,r)=>(0,t.jsxs)("li",{className:"flex gap-3 p-3 rounded-xl border border-gray-100",children:[(0,t.jsx)("div",{className:"w-15.5 h-15.5 rounded-xl bg-gray-100 animate-pulse shrink-0"}),(0,t.jsxs)("div",{className:"flex-1 space-y-2",children:[(0,t.jsx)("div",{className:"h-3 bg-gray-100 animate-pulse rounded w-full"}),(0,t.jsx)("div",{className:"h-3 bg-gray-100 animate-pulse rounded w-3/4"}),(0,t.jsx)("div",{className:"h-7 bg-gray-100 animate-pulse rounded w-full mt-3"})]})]},r))}):(0,t.jsx)("ul",{className:"space-y-2.5",children:y.slice(0,4).map((r,s)=>(0,t.jsxs)("li",{className:"flex gap-3 p-3 rounded-xl border border-gray-100 hover:border-[#186737]/25 hover:bg-[#f8fdf9] transition-all cursor-pointer group",children:[(0,t.jsx)("div",{className:"w-15.5 h-15.5 rounded-xl bg-gray-100 shrink-0 border border-gray-100 overflow-hidden",children:r.images.en?.[0]&&(0,t.jsx)("img",{src:r.images.en[0],alt:r.name.en,width:62,height:62,className:"w-full h-full object-contain",onClick:()=>{n(!1),e.push(tN(r))}})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0 flex flex-col justify-between",children:[(0,t.jsx)("p",{className:"text-[11px] xl:text-[11.5px] 2xl:text-[12px] text-gray-600 line-clamp-2 leading-relaxed group-hover:text-gray-900 transition-colors",onClick:()=>{n(!1),e.push(tN(r))},children:r.name.en}),(0,t.jsx)(tE.default,{product:{...r,original_price:r.price,parent_category_url:r.parent_category_url_resolved,images:{en:r.images.en??[],ar:r.images.ar??[]}},wrapperClassName:"flex items-center flex-row gap-2 mt-2 w-full",isSearchbar:_,inDropdown:!0})]})]},s))})]})]})]})]})}
5let t$=e=>"string"==typeof e?e:e?.en??e?.ar??"";function tI({item:e,depth:r=0,onClose:i,rootSlug:n,parentSlug:a}){let o,[l,c]=(0,s.useState)(!1),u=(e.children?.length??0)>0;o="shop-by-brands"===e.slug?"/brands":0===r?`/${e.slug}`:1===r?`/${n}/${e.slug}`:`/${n}/${e.slug}?parent=${a}`;let d=0===r?"px-5":1===r?"pl-7 pr-5":"pl-10 pr-5",h=0===r?"text-[15px] font-normal":1===r?"text-[13.5px] font-medium":"text-[12.5px] font-normal",p=0===r?"text-gray-900":"text-gray-700";return u?(0,t.jsxs)("div",{children:[(0,t.jsxs)("button",{onClick:()=>c(e=>!e),className:`w-full flex items-center justify-between ${d} py-[13px] border-b border-gray-100 transition-colors hover:bg-gray-50 active:bg-gray-100`,children:[(0,t.jsx)("span",{className:`${h} ${p} text-left`,children:t$(e.name)}),l?(0,t.jsx)(L.ChevronDown,{size:16,className:"text-gray-400 flex-shrink-0"}):(0,t.jsx)(N.ChevronRight,{size:16,className:"text-gray-400 flex-shrink-0"})]}),l&&(0,t.jsxs)("div",{className:"bg-gray-50/70",children:[e.children.map(s=>(0,t.jsx)(tI,{item:s,depth:r+1,onClose:i,rootSlug:0===r?e.slug:n,parentSlug:e.slug},s.id)),(0,t.jsx)($.default,{href:o,onClick:i,className:`flex items-center ${0===r?"pl-7 pr-5":"pl-10 pr-5"} py-[11px] border-b border-gray-100 hover:bg-gray-100`,children:(0,t.jsxs)("span",{className:"text-[12.5px] font-semibold text-[#186737]",children:["View all ",t$(e.name)]})})]})]}):(0,t.jsx)($.default,{href:o,onClick:i,className:`flex items-center ${d} py-[13px] border-b border-gray-100 transition-colors hover:bg-gray-50 active:bg-gray-100`,children:(0,t.jsx)("span",{className:`${h} ${p}`,children:t$(e.name)})})}function tT({navItemData:e=[]}){let n=(0,i.useSelector)(e=>e.profile.customer),a=(0,ep.useCartId)(),l=(0,u.useLocationData)(),c=(0,i.useSelector)(e=>e.profile.loading),d=(0,i.useDispatch)(),h=(0,i.useSelector)(e=>e.customerAddress.loading),p=(0,i.useSelector)(e=>e.customerAddress.cachedDefault),g=(0,i.useSelector)(e=>e.customerAddress.addresses.find(e=>e.is_default)??null);(0,s.useEffect)(()=>{n&&(d((0,k.fetchAddresses)()),d((0,j.fetchCounts)()),d((0,S.fetchWishlist)()))},[n,d]);let f=g??p,v=!!n&&h&&!p&&!l,m=[(f?.city||l?.city||"").trim(),(f?.country||f?.related_country?.name||l?.country||l?.countryCode||"").trim()].filter(Boolean).join(", ")||null;(0,i.useSelector)(e=>e.customerCounts.loaded);let _=(0,i.useSelector)(e=>e.customerCounts.wishlist_count),x=(0,i.useSelector)(e=>e.customerCounts.cart_quantity_sum),b=(0,i.useSelector)(e=>e.wishlist.ids.length),y=(0,i.useSelector)(e=>e.cart.items.reduce((e,t)=>e+t.quantity,0)),w=n?_:b,E=n?x:y,C=E>99?"99+":String(E),N=(0,i.useSelector)(e=>e.auth.loading),I=(0,r.useRouter)(),T=(0,r.usePathname)(),[R,M]=(0,s.useState)(!1),[A,D]=(0,s.use
5State)(!1),[z,U]=(0,s.useState)(!1),B=(0,s.useRef)(null),W=(0,s.useRef)(null);(0,s.useEffect)(()=>{M(!1)},[T]),(0,s.useEffect)(()=>{let e=e=>{B.current&&!B.current.contains(e.target)&&D(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,s.useEffect)(()=>{let e=e=>{W.current&&!W.current.contains(e.target)&&U(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let[V,G]=(0,s.useState)(!1),[Y,K]=(0,s.useState)({modalOne:!1}),J=(0,s.useRef)(null),X=()=>{K({...Y,modalOne:!0})};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"w-full font-sans",children:(0,t.jsx)("div",{className:"md:bg-white bg-gray-50 nav-shadows z-40",children:(0,t.jsx)("div",{className:"global-container mx-auto px-4 lg:px-6",children:(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3 lg:gap-4 xl:gap-3 2xl:gap-5 h-[68px]",children:[(0,t.jsx)("div",{className:"flex-shrink-0",children:(0,t.jsx)($.default,{href:"/",children:(0,t.jsx)(ej.default,{src:ey.default,alt:"HorecaStore",className:"w-28"})})}),(0,t.jsxs)("div",{className:"relative hidden xl:block shrink-0",ref:W,children:[(0,t.jsxs)("button",{onMouseDown:e=>e.stopPropagation(),onClick:()=>U(e=>!e),className:`flex items-center gap-1.5 border rounded-full px-2 xl:px-2.5 2xl:px-3 h-10 transition-colors group min-w-[150px] xl:min-w-[150px] 2xl:min-w-[170px] ${z?"border-[#186737]":"border-gray-200 hover:border-[#186737]"}`,children:[(0,t.jsx)(H.MapPin,{size:15,className:"text-[#186737] shrink-0"}),(0,t.jsxs)("div",{className:"flex flex-col items-start overflow-hidden",children:[(0,t.jsx)("span",{className:"text-[10px] text-gray-400 leading-none",children:"Deliver To"}),v?(0,t.jsx)("span",{className:"w-20 h-3 bg-gray-200 animate-pulse rounded inline-block"}):(0,t.jsx)("span",{suppressHydrationWarning:!0,className:"text-xs text-gray-700 font-semibold leading-tight truncate max-w-27.5",children:m||"Select location"})]}),(0,t.jsx)(L.ChevronDown,{size:13,className:`text-gray-400 shrink-0 transition-transform duration-200 ml-auto ${z?"rotate-180 text-[#186737]":"group-hover:text-[#186737]"}`})]}),z&&(0,t.jsxs)("div",{className:"absolute top-full left-0 mt-3 w-72 bg-white rounded-xl z-50 overflow-hidden",style:{boxShadow:"0 20px 60px rgba(0,0,0,0.13), 0 4px 20px rgba(24,103,55,0.08)"},children:[(0,t.jsx)("div",{className:"h-1 bg-linear-to-r from-[#186737] to-[#22a350]"}),n?(0,t.jsxs)("div",{className:"p-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)("div",{className:"w-7 h-7 rounded-full bg-[#186737]/10 flex items-center justify-center shrink-0",children:(0,t.jsx)(H.MapPin,{size:13,className:"text-[#186737]"})}),(0,t.jsx)("p",{className:"text-sm font-bold text-gray-900",children:"Delivery Address"})]}),f?(0,t.jsxs)("div",{className:"bg-gray-50 rounded-lg p-3 mb-3 text-xs text-gray-600 leading-relaxed space-y-0.5",children:[(0,t.jsxs)("p",{className:"font-medium text-gray-800",children:[[f.address?.replace(/,\s*$/,""),f.city,(0,tj.isUaeAddressCountry)(f.country)?null:f.state].filter(Boolean).join(", "),!(0,tj.isUaeAddressCountry)(f.country)&&f.zip_code?` ${f.zip_code}`:""]}),(0,t.jsx)("p",{className:"text-gray-500",children:f.country})]}):(0,t.jsx)("p",{className:"text-xs text-gray-400 mb-3 italic",children:"No default address saved."}),(0,t.jsxs)($.default,{href:"/dashboard/my-profile#addresses",onClick:()=>U(!1),className:"flex items-center justify-center gap-1.5 w-full py-2 rounded-lg bg-[#186737] hover:bg-[#145c30] text-white text-xs font-semibold transition-colors",children:[(0,t.jsx)(H.MapPin,{size:12}),"Manage Addresses"]})]}):(0,t.jsxs)("div",{className:"p-4 text-center",children:[(0,t.jsx)("div",{className:"w-12 h-12 rounded-full bg-[#186737]/10 flex items-center justify-center mx-auto mb-3",children:(0,t.jsx)(H.MapPin,{size:20,className:"text-[#186737]"})}),(0,t.jsx)("p",{className:"text-sm font-bold text-gray-900 mb-1",children:"Set Delivery Address"}),(0,t.jsx)("p",{className:"text-xs text-gray-500 mb-4 leading-relaxed",children:"Login to view and manage your saved delivery addresses."}),(0,t.jsx)($.default,{href:"/login",onClick:()=>U(!1),className:"flex items-center justify-center gap-1.5 w-full py-2 rounded-lg bg-[#186737] hover:bg-[#145c30] text-white text-xs font-semibold transition-colors",children:"Login to continue"})]})]})]}),(0,t.jsx)(tF,{}),(0,t.jsxs)("div",{className:"relative hidden xl:block shrink-0",ref:B,children:[(0,t.jsxs)("button",{onMouseDown:e=>e.stopPropagation(),onClick:()=>D(e=>!e),className:`flex items-center gap-1 xl:gap-1.5 border rounded-full px-2 xl:px-2.5 2xl:px-3 h-10 transition-colors group   ${A?"border-[#186737]":"border-gray-200 hover:border-[#186737]"}`,children:[(0,t.jsx)("div",{className:"w-6 h-6 rounded-full bg-[#186737]/10 flex items-center justify-center shrink-0",children:(0,t.jsx)(q.Phone,{size:12,className:"text-[#186737]"})}),(0,t.jsxs)("div",{className:"flex flex-col items-start",children:[(0,t.jsx)("span",{className:"text-[10px] text-gray-400 leading-none",children:"Call Us"}),(0,t.jsx)("span",{className:"text-[10px] xl:text-[11px] 2xl:text-xs font-semibold text-green-900 leading-tight group-hover:text-[#186737] transition-colors",children:"800-467-322"})]}),(0,t.jsx)(L.ChevronDown,{size:12,className:`text-gray-400 transition-transform duration-200 ${A?"rotate-180 text-[#186737]":""}`})]}),A&&(0,t.jsxs)("div",{className:"absolute top-full right-0 mt-3 w-70 bg-white rounded-xl z-50 overflow-hidden",style:{boxShadow:"0 20px 60px rgba(0,0,0,0.13), 0 4px 20px rgba(24,103,55,0.08)"},children:[(0,t.jsx)("div",{className:"h-1 bg-linear-to-r from-[#186737] to-[#22a350]"}),(0,t.jsx)("div",{className:"p-4 pb-0",children:(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"w-12 h-12 rounded-full bg-linear-to-br from-gray-200 to-gray-300 shrink-0 flex items-center justify-center border-2 border-white shadow-sm overflow-hidden",children:(0,t.jsx)(e_.User,{size:22,className:"text-gray-400"})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("p",{className:"font-bold text-gray-900 text-[15px] leading-tight",children:"Need Help?"}),(0,t.jsx)("p",{className:"text-[12px] text-gray-500 leading-snug mt-0.5",children:"Opening a Restaurant?"}),(0,t.jsx)("button",{className:"text-[11px] text-[#186737] hover:underline mt-1 text-left",children:"From kitchen equipment to financing, we’ve got you covered."})]})]})}),(0,t.jsxs)("div",{className:"flex  border-gray-100s  w-[80%] mx-auto ",children:[(0,t.jsxs)("a",{href:"tel:+18664467322",className:"flex-1 flex flex-col items-center gap-1.5 py-3 hover:bg-[#f8fdf9] transition-colors group border-gray-100",children:[(0,t.jsx)("div",{className:"w-9 h-9 rounded-full bg-[#186737]/10 flex items-center justify-center group-hover:bg-[#186737] transition-colors",children:(0,t.jsx)(q.Phone,{size:15,className:"text-[#186737] group-hover:text-white transition-colors"})}),(0,t.jsx)("span",{className:"text-[11px] font-semibold text-gray-600 group-hover:text-[#186737] transition-colors",children:"Call"})]}),(0,t.jsxs)($.default,{className:"flex-1 flex flex-col items-center gap-1.5 py-3 hover:bg-[#f8fdf9] transition-colors group  border-gray-100",href:"/create-quotation",children:[(0,t.jsx)("div",{className:"w-9 h-9 rounded-full bg-[#186737]/10 flex items-center justify-center group-hover:bg-[#186737] transition-colors",children:(0,t.jsx)(ek.MessageSquare,{size:15,className:"text-[#186737] group-hover:text-white transition-colors"})}),(0,t.jsx)("span",{className:"text-[11px] font-semibold text-gray-600 group-hover:text-[#186737] transition-colors",children:"Create Quotation"})]})]})]})]}),(0,t.jsxs)("div",{className:"hidden xl:flex items-center gap-1 flex-shrink-0",children:[c?(0,t.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5",children:[(0,t.jsx)("div",{className:"w-8 h-8 rounded-full bg-gray-100 animate-pulse"}),(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("div",{className:"w-16 h-2 rounded bg-gray-100 animate-pulse"}),(0,t.jsx)("div",{className:"w-20 h-2.5 rounded bg-gray-100 animate-pulse"})]})]}):n?(0,t.jsxs)("div",{className:"relative",onMouseEnter:()=>{J.current&&clearTimeout(J.current),M(!0)},onMouseLeave:()=>{J.current=setTimeout(()=>M(!1),120)},children:[(0,t.jsxs)("button",{className:"flex items-center gap-2 px-2 py-1.5 rounded-[7px] hover:bg-gray-50 transition-colors group",children:[(0,t.jsx)("div",{className:"w-8 h-8 rounded-full bg-[#186737]/10 flex items-center justify-center",children:(0,t.jsx)(e_.User,{size:16,className:"text-[#186737]"})}),(0,t.jsxs)("div",{className:"flex flex-col items-start",children:[(0,t.jsx)("span",{className:"text-[10px] text-gray-400 leading-none",children:"My A
5ccount"}),(0,t.jsxs)("span",{className:"text-xs font-semibold text-gray-800 flex items-center gap-0.5 leading-tight",children:[n.name,(0,t.jsx)(L.ChevronDown,{size:11,className:"opacity-60"})]})]})]}),(0,t.jsx)(eF,{show:R})]}):(0,t.jsxs)($.default,{href:"/login",className:"flex items-center gap-2 px-2 py-1.5 rounded-[7px] hover:bg-gray-50 transition-colors group",children:[(0,t.jsx)("div",{className:"w-8 h-8 rounded-full bg-gray-100 flex items-center justify-center group-hover:bg-[#186737]/10 transition-colors",children:(0,t.jsx)(e_.User,{size:16,className:"text-gray-500 group-hover:text-[#186737] transition-colors"})}),(0,t.jsx)("div",{className:"flex flex-col gap-1 items-start",children:(0,t.jsx)("span",{className:"text-[13px] text-black leading-none group-hover:text-[#186737] transition-colors",children:"Sign in"})})]}),(0,t.jsx)("div",{className:"w-px h-6 bg-gray-200 mx-1"}),(0,t.jsxs)($.default,{href:"/wishlist","aria-label":"Wishlist",className:"relative w-10 h-10 flex items-center justify-center rounded-[7px] hover:bg-gray-50 transition-colors group",children:[(0,t.jsx)(ef.Heart,{size:20,className:"text-gray-500 group-hover:text-[#186737] transition-colors"}),w>0&&(0,t.jsx)("span",{className:"absolute -top-0.5 -right-0.5 min-w-4.5 h-4.5 bg-[#186737] text-white text-[10px] font-bold rounded-full flex items-center justify-center px-1 leading-none",children:w>99?"99+":w})]}),(0,t.jsx)($.default,{href:a?`/cart/${a}`:"/cart",children:(0,t.jsxs)("button",{className:"flex items-center gap-2 bg-[#186737] hover:bg-[#145c2e] transition-colors text-white rounded-[7px] pl-3 pr-4 h-10",children:[(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(em.ShoppingCart,{size:18}),E>0&&(0,t.jsx)("span",{className:"absolute -top-2 -right-2 min-w-4.5 h-4.5 bg-white text-[#186737] text-[10px] font-black rounded-full flex items-center justify-center px-1 leading-none border border-[#186737]",children:C})]}),(0,t.jsx)("span",{className:"text-xs font-semibold",children:"Cart"})]})})]}),(0,t.jsxs)("div",{className:"flex xl:hidden items-center gap-1",children:[(0,t.jsx)($.default,{href:"/cart",children:(0,t.jsxs)("button",{"aria-label":"Cart",className:"relative w-9 h-9 sm:flex hidden  items-center justify-center rounded-[7px] text-gray-600 hover:bg-gray-100 transition-colors",children:[(0,t.jsx)(em.ShoppingCart,{size:20}),E>0&&(0,t.jsx)("span",{className:"absolute top-0.5 right-0.5 min-w-4 h-4 bg-[#186737] text-white text-[9px] font-bold rounded-full flex items-center justify-center px-0.5 leading-none",children:C})]})}),(0,t.jsx)($.default,{href:"/wishlist",children:(0,t.jsxs)("button",{"aria-label":"Wishlist",className:"relative w-9 h-9 sm:flex hidden  items-center justify-center rounded-[7px] text-gray-600 hover:bg-gray-100 transition-colors",children:[(0,t.jsx)(ef.Heart,{size:20}),w>0&&(0,t.jsx)("span",{className:"absolute top-0.5 right-0.5 min-w-4 h-4 bg-[#186737] text-white text-[9px] font-bold rounded-full flex items-center justify-center px-0.5 leading-none",children:w>99?"99+":w})]})}),(0,t.jsx)("button",{onClick:()=>I.push("/search"),"aria-label":"Search",className:"relative w-9 h-9 flex lg:hidden items-center justify-center rounded-[7px] text-gray-600 hover:bg-gray-100 transition-colors",children:(0,t.jsx)(el.Search,{size:20})}),(0,t.jsxs)(tm,{open:V,onOpenChange:G,children:[(0,t.jsx)("button",{"aria-label":"Open menu",className:"w-9 h-9 flex items-center justify-center rounded-[7px] text-gray-600 hover:bg-gray-100 transition-colors",onClick:()=>G(!0),children:(0,t.jsx)(eS.Menu,{size:20})}),(0,t.jsxs)(ty,{side:"right",className:"p-0 w-[340px] sm:w-[380px] flex flex-col",children:[(0,t.jsxs)(tw,{className:"flex flex-row items-center justify-between px-5 py-4 border-b border-gray-100",children:[(0,t.jsx)(ej.default,{src:ey.default,alt:"HorecaStore",className:"w-28"}),(0,t.jsx)(t_,{asChild:!0,children:(0,t.jsx)("button",{className:"w-8 h-8 flex items-center justify-center rounded-full hover:bg-gray-100 transition-colors",children:(0,t.jsx)(F.X,{size:18,className:"text-gray-500"})})}),(0,t.jsx)(tS,{className:"sr-only",children:"Navigation Menu"})]}),(0,t.jsxs)("div",{className:"flex-1 overflow-y-auto",children:[c?(0,t.jsxs)("div",{className:"px-5 py-4 border-b border-gray-100 flex items-center gap-3",children:[(0,t.jsx)("div",{className:"w-9 h-9 rounded-full bg-gray-100 animate-pulse flex-shrink-0"}),(0,t.jsxs)("div",{className:"flex flex-col gap-1.5 flex-1",children:[(0,t.jsx)("div",{className:"w-24 h-3 rounded bg-gray-100 animate-pulse"}),(0,t.jsx)("div",{className:"w-16 h-2.5 rounded bg-gray-100 animate-pulse"})]})]}):n?(0,t.jsx)("div",{className:"px-5 py-4 border-b border-gray-100 bg-[#f8fdf9]",children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"w-9 h-9 rounded-full bg-[#186737]/15 flex items-center justify-center",children:(0,t.jsx)(e_.User,{size:17,className:"text-[#186737]"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-[13px] font-semibold text-gray-800",children:n.name}),(0,t.jsx)($.default,{href:"/dashboard",onClick:()=>G(!1),className:"text-[11px] text-[#186737] font-medium",children:"View Profile"})]})]}),(0,t.jsxs)("button",{disabled:N,onClick:async()=>{await d((0,o.logoutUser)()),d((0,S.clearWishlist)()),d((0,j.clearCounts)()),window.location.href="/"},className:"flex items-center gap-1.5 text-[12px] text-red-500 font-medium border border-red-100 rounded-full px-3 py-1.5 hover:bg-red-50 transition-colors disabled:opacity-60 disabled:cursor-not-allowed",children:[N?(0,t.jsx)("span",{className:"w-3 h-3 border-2 border-red-400 border-t-transparent roun
5ded-full animate-spin"}):(0,t.jsx)(ew.LogOut,{size:13}),"Logout"]})]})}):(0,t.jsxs)("div",{className:"px-5 py-4 border-b border-gray-100 flex items-center gap-3",children:[(0,t.jsx)($.default,{href:"/login",onClick:()=>G(!1),className:"flex-1 h-10 rounded-[9px] bg-[#186737] text-white text-sm font-semibold flex items-center justify-center hover:bg-[#145c2e] transition-colors",children:"Sign In"}),(0,t.jsx)($.default,{href:"/register",onClick:()=>G(!1),className:"flex-1 h-10 rounded-[9px] border border-gray-200 text-gray-700 text-sm font-semibold flex items-center justify-center hover:border-[#186737] hover:text-[#186737] transition-colors",children:"Register"})]}),(0,t.jsxs)("div",{className:"px-5 py-3 border-b border-gray-100 xl:hidden relative z-20",onClick:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),children:[(0,t.jsx)("p",{className:"text-[11px] font-semibold text-gray-400 uppercase tracking-wide mb-2",children:"Country"}),(0,t.jsx)(ed,{fullWidth:!0})]}),tk.NAV_LINKS.map(e=>{let r="Request a Quote"===e.label,s="Mega Sale"===e.label,i=r?"flex items-center gap-2.5 px-5 py-[13px] border-b border-gray-100 text-[15px] font-bold bg-[#f0f9f4] text-[#186737] hover:bg-[#e5f4ea] transition-colors":`flex items-center px-5 py-[14px] border-b border-gray-100 text-[15px] font-medium hover:bg-gray-50 transition-colors ${s?"text-red-500":"text-gray-900"}`,n=r?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"w-7 h-7 rounded-full bg-[#186737] flex items-center justify-center shrink-0",children:(0,t.jsx)(P.FileText,{size:13,className:"text-white"})}),(0,t.jsx)("span",{className:"flex-1",children:e.label}),(0,t.jsx)("span",{className:"text-[9px] font-bold uppercase tracking-wide bg-[#186737] text-white px-2 py-0.5 rounded-full shrink-0",children:"Free"})]}):e.label;return e.isModal?(0,t.jsx)("button",{onClick:X,className:i,children:n},e.label):(0,t.jsx)($.default,{href:e.href,className:i,children:n},e.label)}),(0,t.jsx)("div",{className:"px-5 pt-4 pb-2",children:(0,t.jsx)("span",{className:"text-[10px] font-bold tracking-widest uppercase text-gray-400",children:"Categories"})}),e.map(e=>(0,t.jsx)(tI,{item:e,depth:0,onClose:()=>G(!1)},e.id)),(0,t.jsx)("div",{className:"h-6"})]})]})]})]})]})})})}),(0,t.jsx)(O.default,{isOpen:Y.modalOne,onClose:()=>{K({...Y,modalOne:!1})},title:"Get a Financing Quote"})]})}var tR=e.i(73375);let tM=(e,t)=>"string"==typeof e?e:"ar"===t?e?.ar??e?.en??"":e?.en??e?.ar??"",tO=e=>"shop-by-brands"===e.slug||"brands"===e.slug,tA=e=>!tO(e)&&(e.children?.length??0)>0;function tL({category:e,locale:r,setChildCategory:i,setGrandChildCategory:n,onClose:a,onPanelMouseEnter:o,onPanelMouseLeave:l}){let[c,u]=(0,s.useState)(null),d=(0,s.useRef)(null);if((0,s.useEffect)(()=>{let t=e?.children?.[0]??null;u(t),n?.(t?.children??[]),i?.(e?.children??[])},[e]),!e?.children?.length)return null;let h="ar"===r,p=h?tR.ChevronLeft:N.ChevronRight,g=c?.children??[];return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("style",{children:`
6        /* ── Keyframes (same names as original global CSS) ── */
7        @keyframes slideDown {
8          from { opacity: 0; transform: translateY(-10px) scaleY(0.97); }
9          to   { opacity: 1; transform: translateY(0)     scaleY(1);    }
10        }
11        @keyframes fadeIn {
12          from { opacity: 0; transform: translateX(-6px); }
13          to   { opacity: 1; transform: translateX(0);    }
14        }
15        @keyframes fadeInUp {
16          from { opacity: 0; transform: translateY(10px) scale(0.95); }
17          to   { opacity: 1; transform: translateY(0)    scale(1);    }
18        }
19        @keyframes scaleY {
20          from { transform: scaleY(0); }
21          to   { transform: scaleY(1); }
22        }
23        @keyframes ringSpin { to { transform: rotate(360deg); } }
24
25        .animate-slideDown  { animation: slideDown  0.22s cubic-bezier(0.16,1,0.3,1) forwards; }
26        .animate-fadeIn     { animation: fadeIn     0.2s  ease-out              both; }
27        .animate-fadeInUp   { animation: fadeInUp   0.22s cubic-bezier(0.16,1,0.3,1) both; }
28        .animate-scaleY     { animation: scaleY     0.18s ease-out              forwards; transform-origin: top; }
29
30        /* Scrollbar */
31        .custom-scrollbar::-webkit-scrollbar       { width: 3px; }
32        .custom-scrollbar::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }
33
34        /* Hide nav scrollbar */
35        .nav-scroll::-webkit-scrollbar { display: none; }
36        .nav-scroll { -ms-overflow-style: none; scrollbar-width: none; }
37
38        /* Mega sale pill */
39        .mega-sale-pill {
40          position: relative;
41          background: linear-gradient(145deg, #ff3b0a, #ff0000);
42          border-radius: 7px;
43          overflow: hidden;
44          z-index: 1;
45          box-shadow: 0 10px 25px rgba(255,0,0,0.45), inset 0 2px 4px rgba(255,255,255,0.35);
46          transition: all 0.25s ease;
47          display: inline-flex;
48          align-items: center;
49        }
50        .mega-sale-pill:hover {
51          transform: translateY(-2px) scale(1.05);
52          box-shadow: 0 16px 35px rgba(255,0,0,0.6), 0 0 25px rgba(255,0,0,0.45);
53        }
54        .confetti-ring {
55          position: absolute; inset: -3px; border-radius: inherit;
56          background: conic-gradient(from 0deg,#ff0,#ff3b0a,#00e5ff,#ff00c8,#22c55e,#ff0);
57          z-index: 0; filter: blur(6px);
58          animation: ringSpin 4s linear infinite;
59        }
60        .mega-sale-pill::after {
61          content: ""; position: absolute; inset: 3px; border-radius: inherit;
62          background: linear-gradient(145deg, #ff3b0a, #ff0000); z-index: 0;
63        }
64        .sale-label { position: relative; z-index: 10; }
65      `}),(0,t.jsx)("div",{ref:d,className:"absolute left-0 top-full bg-white shadow-xl border border-gray-200 z-50 w-full animate-slideDown",onMouseEnter:()=>{o(),i?.(e.children??[])},onMouseLeave:l,children:(0,t.jsx)("div",{className:"global-container px-6 py-6",children:(0,t.jsxs)("div",{className:"grid grid-cols-12 gap-6",children:[(0,t.jsx)("div",{className:"col-span-3 h-[450px] overflow-y-auto pr-2 custom-scrollbar",children:(0,t.jsx)("div",{className:"space-y-1",children:e.children.map((s,i)=>(0,t.jsxs)($.default,{href:`/${e.slug}/${s.slug}`,onClick:a,onMouseEnter:()=>{u(s),n?.(s?.children??[])},className:`
66                      group relative block w-full px-4 py-2 not-first: rounded-[7px]
67                      transition-all duration-200 ease-in-out animate-fadeIn
68                      ${c?.id===s.id?"bg-green-50 text-green-700  text-[12px] font-normal shadow-sm":"bg-gray-50 text-black hover:bg-green-50  text-[12px] hover:text-green-600"}
69                    `,style:{animationDelay:`${30*i}ms`},children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-[12px] 2xl:text-[14px] leading-tight",children:tM(s.name,r)}),(0,t.jsx)(p,{size:16,className:`transition-all duration-200 flex-shrink-0 ${c?.id===s.id?"opacity-100 translate-x-0":h?"opacity-0 translate-x-2 group-hover:opacity-100 group-hover:translate-x-0":"opacity-0 -translate-x-2 group-hover:opacity-100 group-hover:translate-x-0"}`})]}),c?.id===s.id&&(0,t.jsx)("div",{className:`absolute top-0 bottom-0 w-1 bg-green-600 animate-scaleY ${h?"right-0 rounded-l-full":"left-0 rounded-r-full"}`})]},s.id))})}),(0,t.jsx)("div",{className:"col-span-9 h-[450px] overflow-y-auto pr-2 custom-scrollbar",children:g.length>
690?(0,t.jsx)("div",{className:"grid 2xl:grid-cols-8 grid-cols-7 gap-4 pb-2",children:g.map((s,i)=>(0,t.jsxs)($.default,{href:`/${e.slug}/${s.slug}?parent=${c?.slug}`,onClick:a,className:"   group flex flex-col items-center text-center   p-4 rounded-[7px] bg-gray-50   hover:bg-white hover:shadow-lg hover:-translate-y-1   transition-all duration-300 ease-out   cursor-pointer border border-transparent hover:border-green-100   animate-fadeInUp   ",style:{animationDelay:`${40*i}ms`},children:[(0,t.jsx)("div",{className:"relative w-full aspect-square mb-3 overflow-hidden rounded-[7px] bg-white",children:s.image_url?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("img",{src:s.image_url,alt:tM(s.name,r),className:"w-full h-full object-cover group-hover:scale-110 transition-transform duration-300 ease-out",loading:"lazy",onError:e=>{e.target.style.display="none"}}),(0,t.jsx)("div",{className:"absolute inset-0 bg-green-600/0 group-hover:bg-green-600/5 transition-colors duration-300"})]}):(0,t.jsx)("div",{className:"w-full h-full flex items-center justify-center text-3xl",children:"🍽️"})}),(0,t.jsx)("span",{className:"text-xs font-medium text-gray-700 group-hover:text-green-700 leading-tight break-words line-clamp-2 transition-colors duration-200",children:tM(s.name,r)})]},s.id))}):(0,t.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,t.jsxs)("div",{className:"text-center text-gray-400",children:[(0,t.jsx)("p",{className:"text-4xl mb-3",children:"📂"}),(0,t.jsx)("p",{className:"text-sm",children:"No subcategories available"})]})})})]})})})]})}let tD=({navItemData:e})=>{let r=(0,U.useLocale)(),[i,n]=(0,s.useState)(null),[a,o]=(0,s.useState)(!1),[l,c]=(0,s.useState)([]),[u,d]=(0,s.use
69State)([]),h=(0,s.useRef)(null),p=(0,s.useRef)(null),[g,f]=(0,s.useState)(!1),[v,m]=(0,s.useState)(!1),_=(0,s.useRef)(null);(0,s.useEffect)(()=>{let e=h.current;if(!e)return;let t=()=>{let{scrollWidth:t,clientWidth:r,scrollLeft:s}=e;f(s+r<t-1),m(s>0)};t();let r=new ResizeObserver(t);return r.observe(e),e.addEventListener("scroll",t),window.addEventListener("resize",t),()=>{r.disconnect(),e.removeEventListener("scroll",t),window.removeEventListener("resize",t)}},[]);let x=(0,s.useCallback)(()=>{clearTimeout(_.current),_.current=setTimeout(()=>{o(!1),n(null)},150)},[]),b=(0,s.useCallback)(()=>{clearTimeout(_.current)},[]),y=(0,s.useCallback)(e=>{clearTimeout(_.current),document.dispatchEvent(new CustomEvent("nav-hover"));let t=e.children??e.sub_categories??e.subcategories??[];!t.length||tO(e)?x():(n({...e,children:t}),c(t),d(t[0]?.children??[]),o(!0))},[x]),w=(0,s.useCallback)(()=>{clearTimeout(_.current),o(!1),n(null)},[]);return(0,s.useEffect)(()=>()=>clearTimeout(_.current),[]),(0,s.useEffect)(()=>{let e=e=>{p.current&&!p.current.contains(e.target)&&(o(!1),n(null))};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("style",{children:".nav-scroll::-webkit-scrollbar{display:none}"}),(0,t.jsxs)("div",{ref:p,className:"relative w-full bg-green-700 py-2.5 border-b border-green-800 hidden xl:block",onMouseEnter:b,onMouseLeave:x,children:[(0,t.jsx)("div",{className:"global-container",children:(0,t.jsxs)("div",{className:"grid xl:grid-cols-[80%_20%] 2xl:grid-cols-[80%_20%] md:grid-cols-[80%_20%]",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1 min-w-0",children:[v&&(0,t.jsx)("button",{onClick:()=>h.current?.scrollBy({left:-200,behavior:"smooth"}),className:"flex-shrink-0 z-10 flex items-center justify-center w-6 h-6 bg-green-600 text-white hover:bg-green-500 transition-colors duration-150 rounded-full shadow-md",children:(0,t.jsx)(tR.ChevronLeft,{size:16})}),(0,t.jsx)("div",{ref:h,className:"nav-scroll flex space-x-4 items-center overflow-x-auto scroll-smooth flex-1 min-w-0",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:e.map(e=>(0,t.jsxs)($.default,{href:tO(e)?"/brands":"sale"===e.slug?"/sale":`/${e.slug}`,onMouseEnter:()=>y(e),onClick:w,className:`
70                    text-white transition-colors duration-200
71                    cursor-pointer relative group flex items-center gap-1 shrink-0
72                    md:text-[15px] lg:text-[14px] text-xs whitespace-nowrap
73                    ${(i?.id===e.id,"font-normal")}
74                    hover:font-bold
75                  `,children:[tM(e.name,r),tA(e)&&(0,t.jsx)(L.ChevronDown,{size:15,className:"text-white opacity-80"})]},e.id))}),g&&(0,t.jsx)("button",{onClick:()=>h.current?.scrollBy({left:200,behavior:"smooth"}),className:"flex-shrink-0 z-10 flex items-center justify-center w-6 h-6 bg-green-600 text-white hover:bg-green-500 transition-colors duration-150 rounded-full shadow-md",children:(0,t.jsx)(N.ChevronRight,{size:16})})]}),(0,t.jsxs)("div",{children:[" ",(0,t.jsx)("div",{className:"flex gap-3 items-center justify-end text-white font-normal ",children:(0,t.jsx)($.default,{href:"/dubai-summer-sale",style:{textDecoration:"none"},children:(0,t.jsxs)("button",{className:"mega-sale-pill  relative inline-flex items-center px-4 py-1  font-extrabold text-white  tracking-wider",children:[(0,t.jsx)("span",{className:"relative z-10",children:"Mega Sale"}),(0,t.jsx)("span",{className:"confetti-ring"})]})})})]})]})}),i&&tA(i)&&a&&(0,t.jsx)(tL,{category:i,locale:r,setChildCategory:c,setGrandChildCategory:d,onClose:w,onPanelMouseEnter:b,onPanelMouseLeave:x},i.id)]})]})};var tz=e.i(49685);let tH=[{label:"Track your order",href:"/track-order",isModal:!1,modalTitle:"",highlight:!1},{label:"Contact Us",href:"/pages/contact-us",isModal:!1,modalTitle:"",highlight:!1},{label:"Terms & Conditions",href:"/pages/return-policy",isModal:!1,modalTitle:"",highlight:!1}],tq=`
76  text-[12px] text-gray-500 px-3 py-0.5
77  relative
78  hover:text-[#186737]
79  transition-colors duration-200 ease-in-out
80  after:absolute after:bottom-0 after:left-3 after:right-3
81  after:h-px after:bg-[#186737]
82  after:scale-x-0 after:origin-left
83  after:transition-transform after:duration-200
84  hover:after:scale-x-100
85`,tU={quote:P.FileText,partner:tz.Handshake},tB={quote:`
86    text-[#B4530A] bg-gradient-to-r from-amber-500/10 to-orange-500/10
87    hover:from-amber-500 hover:to-orange-500 hover:text-white
88    ring-1 ring-inset ring-amber-500/20 hover:ring-orange-500
89  `,partner:`
90    text-[#186737] bg-[#186737]/10
91    hover:bg-[#186737] hover:text-white
92    ring-1 ring-inset ring-[#186737]/20 hover:ring-[#186737]
93  `},tW=()=>
93{let[e,r]=(0,s.useState)(""),[i,n]=(0,s.useState)(!1);return(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"bg-gray-50 hidden xl:block",children:(0,t.jsxs)("div",{className:"global-container flex items-center justify-between py-1.5",children:[(0,t.jsx)("p",{className:"text-[12px] text-gray-500 tracking-wide",children:"Discover Exceptional Products and Unmatched Service."}),(0,t.jsxs)("ul",{className:"flex items-center",children:[tH.map((e,s)=>{let i,a=e.variant?tU[e.variant]:void 0,o=e.highlight&&e.variant?(i=e.variant,`
94  flex items-center gap-1
95  text-[12px] font-semibold px-2.5 py-1 mx-1
96  rounded-full
97  transition-all duration-200 ease-in-out
98  ${tB[i]}
99`):tq;return(0,t.jsxs)("li",{className:"flex items-center",children:[e.isModal?(0,t.jsxs)("button",{onClick:()=>{r(e.modalTitle),n(!0)},className:o,children:[a?(0,t.jsx)(a,{size:12}):null,e.label]}):(0,t.jsxs)($.default,{href:e.href,className:o,children:[a?(0,t.jsx)(a,{size:12}):null,e.label]}),s<tH.length-1&&!e.highlight&&(0,t.jsx)("span",{className:"w-px h-3.5 bg-gray-300 rounded-full"})]},e.href+e.label)}),(0,t.jsx)("li",{className:"flex items-center pl-3",children:(0,t.jsx)(ed,{})}),(0,t.jsx)("li",{})]})]})}),(0,t.jsx)(O.default,{isOpen:i,onClose:()=>{n(!1)},title:e})]})},tV=({navItemData:e=[]})=>{let r=(0,s.useRef)(null),[i,n]=(0,s.useState)(0),[a,o]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{let e=r.current;if(!e)return;let t=()=>n(e.offsetHeight);t();let s=new ResizeObserver(t);s.observe(e);let i=()=>{window.scrollY>100?o(!0):o(!1)};return window.addEventListener("scroll",i),()=>{s.disconnect(),window.removeEventListener("scroll",i)}},[]),console.log("Header navItemData:",e),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("header",{ref:r,className:`w-full left-0 right-0 z-50 bg-white transition-all duration-300 ${a?"fixed top-0 shadow-lg":"relative"}`,children:[(0,t.jsx)(tW,{}),(0,t.jsx)(tT,{navItemData:e}),(0,t.jsx)(tD,{navItemData:e}),(0,t.jsx)(eb,{})]}),a&&(0,t.jsx)("div",{style:{height:i}})]})};function tG(){let e=(0,r.usePathname)();return(0,s.useEffect)(()=>{window.scrollTo({top:0,left:0,behavior:"instant"})},[e]),null}e.s(["default",0,({children:e,navItemData:s})=>{let n=(0,r.usePathname)(),a=n?.startsWith("/partner/dashboard");return(0,t.jsxs)(i.Provider,{store:E,children:[(0,t.jsx)(tG,{}),(0,t.jsx)(f,{}),(0,t.jsx)(v.default,{}),a?(0,t.jsx)("div",{className:"flex flex-col min-h-screen",children:e}):(0,t.jsxs)("div",{className:"flex flex-col min-h-screen",children:[(0,t.jsx)(tV,{navItemData:s}),(0,t.jsx)("main",{className:"flex-grow",children:e}),(0,t.jsx)(es,{navItemData:s??[]}),(0,t.jsx)(R,{}),(0,t.jsx)(M,{})]})]})}],8964)},75696,e=>{"use strict";var t=e.i(61745),r=e.i(43476);e.s(["default",0,function({locale:e,...s}){if(!e)throw Error(void 0);return(0,r.jsx)(t.IntlProvider,{locale:e,...s})}])},16915,(e,t,r)=>{!function(s,i){if("function"==typeof define&&define.amd){let s;void 0!==(s=i(e.r,r,t))&&e.v(s)}else t.exports=i()}(e.e,function(){var e,t,r,s={};s.version="0.2.0";var i=s.settings={minimum:.08,easing:"ease",positionUsing:"",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,showSpinner:!0,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:'<div class="bar" role="bar"><div class="peg"></div></div><div class="spinner" role="spinner"><div class="spinner-icon"></div></div>'};function n(e,t,r){return e<t?t:e>r?r:e}s.configure=function(e){var t,r;for(t in e)void 0!==(r=e[t])&&e.hasOwnProperty(t)&&(i[t]=r);return this},s.status=null,s.set=function(e){var t=s.isStarted();s.status=1===(e=n(e,i.minimum,1))?null:e;var r=s.render(!t),l=r.querySelector(i.barSelector),c=i.speed,u=i.easing;return r.offsetWidth,a(function(t){var n,a,d,h;""===i.positionUsing&&(i.positionUsing=s.getPositioningCSS()),o(l,(n=e,a=c,d=u,(h="translate3d"===i.positionUsing?{transform:"translate3d("+(-1+n)*100+"%,0,0)"}:"translate"===i.positionUsing?{transform:"translate("+(-1+n)*100+"%,0)"}:{"margin-left":(-1+n)*100+"%"}).transition="all "+a+"ms "+d,h)),1===e?(o(r,{transition:"none",opacity:1}),r.offsetWidth,setTimeout(function(){o(r,{transition:"all "+c+"ms linear",opacity:0}
99),setTimeout(function(){s.remove(),t()},c)},c)):setTimeout(t,c)}),this},s.isStarted=function(){return"number"==typeof s.status},s.start=function(){s.status||s.set(0);var e=function(){setTimeout(function(){s.status&&(s.trickle(),e())},i.trickleSpeed)};return i.trickle&&e(),this},s.done=function(e){return e||s.status?s.inc(.3+.5*Math.random()).set(1):this},s.inc=function(e){var t=s.status;return t?("number"!=typeof e&&(e=(1-t)*n(Math.random()*t,.1,.95)),t=n(t+e,0,.994),s.set(t)):s.start()},s.trickle=function(){return s.inc(Math.random()*i.trickleRate)},e=0,t=0,s.promise=function(r){return r&&"resolved"!==r.state()&&(0===t&&s.start(),e++,t++,r.always(function(){0==--t?(e=0,s.done()):s.set((e-t)/e)})),this},s.render=function(e){if(s.isRendered())return document.getElementById("nprogress");c(document.documentElement,"nprogress-busy");var t=document.createElement("div");t.id="nprogress",t.innerHTML=i.template;var r,n=t.querySelector(i.barSelector),a=e?"-100":(-1+(s.status||0))*100,l=document.querySelector(i.parent);return o(n,{transition:"all 0 linear",transform:"translate3d("+a+"%,0,0)"}),!i.showSpinner&&(r=t.querySelector(i.spinnerSelector))&&h(r),l!=document.body&&c(l,"nprogress-custom-parent"),l.appendChild(t),t},s.remove=function(){u(document.documentElement,"nprogress-busy"),u(document.querySelector(i.parent),"nprogress-custom-parent");var e=document.getElementById("nprogress");e&&h(e)},s.isRendered=function(){return!!document.getElementById("nprogress")},s.getPositioningCSS=function(){var e=document.body.style,t="WebkitTransform"in e?"Webkit":"MozTransform"in e?"Moz":"msTransform"in e?"ms":"OTransform"in e?"O":"";return t+"Perspective"in e?"translate3d":t+"Transform"in e?"translate":"margin"};var a=(r=[],function(e){r.push(e),1==r.length&&function e(){var t=r.shift();t&&t(e)}()}),o=function(){var e=["Webkit","O","Moz","ms"],t={};function r(r,s,i){var n;s=t[n=(n=s).replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,function(e,t){return t.toUpperCase()})]||(t[n]=function(t){var r=document.body.style;if(t in r)return t;for(var s,i=e.length,n=t.charAt(0).toUpperCase()+t.slice(1);i--;)if((s=e[i]+n)in r)return s;return t}(n)),r.style[s]=i}return function(e,t){var s,i,n=arguments;if(2==n.length)for(s in t)void 0!==(i=t[s])&&t.hasOwnProperty(s)&&r(e,s,i);else r(e,n[1],n[2])}}();function l(e,t){return("string"==typeof e?e:d(e)).indexOf(" "+t+" ")>=0}function c(e,t){var r=d(e),s=r+t;l(r,t)||(e.className=s.substring(1))}function u(e,t){var r,s=d(e);l(e,t)&&(e.className=(r=s.replace(" "+t+" "," ")).substring(1,r.length-1))}function d(e){return(" "+(e.className||"")+" ").replace(/\s+/gi," ")}function h(e){e&&e.parentNode&&e.parentNode.removeChild(e)}return s})},18421,(e,t,r)=>{var s=Object.create,i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,c=(e,t)=>i(e,"name",{value:t,configurable:!0}),u=(e,t,r,s)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let o of a(t))l.call(e,o)||o===r||i(e,o,{get:()=>t[o],enumerable:!(s=n(t,o))||s.enumerable});return e},d=(e,t,r)=>(r=null!=e?s(o(e)):{},u(!t&&e&&e.__esModule?r:i(r,"default",{value:e,enumerable:!0}),e)),h={},p={default:()=>y,useTopLoader:()=>x};for(var g in p)i(h,g,{get:p[g],enumerable:!0});t.exports=u(i({},"__esModule",{value:!0}),h);var f=d(e.r(45009)),v=d(e.r(71645)),m=d(e.r(16915)),_=d(e.r(16915)),x=c(()=>({start:()=>_.start(),done:e=>_.done(e),remove:()=>_.remove(),setProgress:e=>_.set(e),inc:e=>_.inc(e),trickle:()=>_.trickle(),isStarted:()=>_.isStarted(),isRendered:()=>_.isRendered(),getPositioningCSS:()=>_.getPositioningCSS()}),"useTopLoader"),b=c(({color:e,height:t,showSpinner:r,crawl:s,crawlSpeed:i,initialPosition:n,easing:a,speed:o,shadow:l,template:u,zIndex:d=1600,showAtBottom:h=!1,showForHashAnchor:p=!0,nonce:g})=>{let f=null!=e?e:"#29d",_=l||void 0===l?l?`box-shadow:${l}`:`box-shadow:0 0 10px ${f},0 0 5px ${f}`:"",x=v.createElement("style",{nonce:g},`#nprogress{pointer-events:none}#nprogress .bar{background:${f};position:fixed;z-index:${d};${h?"bottom: 0;":"top: 0;"}left:0;width:100%;height:${null!=t?t:3}px}#nprogress .peg{display:block;position:absolute;right:0;width:100px;height:100%;${_};opacity:1;-webkit-transform:rotate(3deg) translate(0px,-4px);
99-ms-transform:rotate(3deg) translate(0px,-4px);transform:rotate(3deg) translate(0px,-4px)}#nprogress .spinner{display:block;position:fixed;z-index:${d};${h?"bottom: 15px;":"top: 15px;"}right:15px}#nprogress .spinner-icon{width:18px;height:18px;box-sizing:border-box;border:2px solid transparent;border-top-color:${f};border-left-color:${f};border-radius:50%;-webkit-animation:nprogress-spinner 400ms linear infinite;animation:nprogress-spinner 400ms linear infinite}.nprogress-custom-parent{overflow:hidden;position:relative}.nprogress-custom-parent #nprogress .bar,.nprogress-custom-parent #nprogress .spinner{position:absolute}@-webkit-keyframes nprogress-spinner{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg)}}@keyframes nprogress-spinner{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}`),b=c(e=>new URL(e,window.location.href).href,"toAbsoluteURL"),y=c((e,t)=>{let r=new URL(b(e)),s=new URL(b(t));return r.href.split("#")[0]===s.href.split("#")[0]},"isHashAnchor"),w=c((e,t)=>{let r=new URL(b(e)),s=new URL(b(t));return r.hostname.replace(/^www\./,"")===s.hostname.replace(/^www\./,"")},"isSameHostName");return v.useEffect(()=>{let e,t;function l(e,t){let r=new URL(e),s=new URL(t);if(r.hostname===s.hostname&&r.pathname===s.pathname&&r.search===s.search){let e=r.hash,t=s.hash;return e!==t&&r.href.replace(e,"")===s.href.replace(t,"")}return!1}m.configure({showSpinner:null==r||r,trickle:null==s||s,trickleSpeed:null!=i?i:200,minimum:null!=n?n:.08,easing:null!=a?a:"ease",speed:null!=o?o:200,template:null!=u?u:'<div class="bar" role="bar"><div class="peg"></div></div><div class="spinner" role="spinner"><div class="spinner-icon"></div></div>'}),c(l,"isAnchorOfCurrentUrl");var d,h,g=document.querySelectorAll("html");let f=c(()=>g.forEach(e=>e.classList.remove("nprogress-busy")),"removeNProgressClass");function v(e){for(;e&&"a"!==e.tagName.toLowerCase();)e=e.parentElement;return e}function _(e){try{let t=e.target,r=v(t),s=null==r?void 0:r.href;if(s){let t=window.location.href,i=""!==r.target,n=["tel:","mailto:","sms:","blob:","download:"].some(e=>s.startsWith(e));if(!w(window.location.href,r.href))return;let a=l(t,s)||y(window.location.href,r.href);if(!p&&a)return;s===t||i||n||a||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey||!b(r.href).startsWith("http")?(m.start(),m.done(),f()):m.start()}}catch(e){m.start(),m.done()}}function x(){m.done(),f()}function S(){m.done()}return c(v,"findClosestAnchor"),c(_,"handleClick"),e=(d=window.history).pushState,d.pushState=(...t)=>(m.done(),f(),e.apply(d,t)),t=(h=window.history).replaceState,h.replaceState=(...e)=>(m.done(),f(),t.apply(h,e)),c(x,"handlePageHide"),c(S,"handleBackAndForth"),window.addEventListener("popstate",S),document.addEventListener("click",_),window.addEventListener("pagehide",x),()=>{document.removeEventListener("click",_),window.removeEventListener("pagehide",x),window.removeEventListener("popstate",S)}},[]),x},"NextTopLoader"),y=b;b.propTypes={color:f.string,height:f.number,showSpinner:f.bool,crawl:f.bool,crawlSpeed:f.number,initialPosition:f.number,easing:f.string,speed:f.number,template:f.string,shadow:f.oneOfType([f.string,f.bool]),zIndex:f.number,showAtBottom:f.bool}},91708,(e,t,r)=>{!function(){"use strict";var e={};e.d=function(t,r){for(var s in r)e.o(r,s)&&!e.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:r[s]})},e.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},e.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},void 0!==e&&(e.ab="/ROOT/node_modules/next/dist/compiled/web-vitals/");var r={};e.r(r),e.d(r,{CLSThresholds:function(){return C},FCPThresholds:function(){return j},FIDThresholds:function(){return ee},INPThresholds:function(){return z},LCPThresholds:function(){return q},TTFBThresholds:function(){return W},onCLS:function(){return N},onFCP:function(){return E},onFID:function(){return et},onINP:function(){return H},onLCP:function(){return B},onTTFB:function(){return G}});var s,i,n,a,o,l=-1,c=function(e){addEventListener("pageshow",function(t){t.persisted&&(l=t.timeStamp,e(t))},!0)},u=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},d=function(){var e=u();return e&&e.activationStart||0},h=function(e,t){var r=u(),s="navigate";return l>=0?s="back-forward-cache":r&&(document.prerendering||d()>0?s="prerender":document.wasDiscarded?s="restore":r.type&&(s=r.type.replace(/_/g,"-"))),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(0x82f79cd8fff*Math.random())+1e12),navigationType:s}},p=function(e,t,r){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var s=new PerformanceObserver(function(e){Promise.resolve().then(function(){t(e.getEntries())})});return s.observe(Object.assign({type:e,buffered:!0},r||{})),s}}catch(e){}},g=function(e,t,r,s){var i,n;return function(a){var o;t.value>=0&&(a||s)&&((n=t.value-(i||0))||void 0===i)&&(i=t.value,t.delta=n,o=t.value,t.rating=o>r[1]?"poor":o>r[0]?"needs-improvement":"good",e(t))}},f=function(e){requestAnimationFrame(function(){return requestAnimationFrame(function(){return e()})})},v=function(e){document.addEventListener("visibilitychange",function(){"hidden"===document.visibilityState&&e()})},m=function(e){var t=!1;return function(){t||(e(),t=!0)}},_=-1,x=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},b=function(e){"hidden"===document.visibilityState&&_>-1&&(_="visibilitychange"===e.type?e.timeStamp:0,w())},y=function(){addEventListener("visibilitychange",b,!0),addEventListener("prerenderingchange",b,!0)},w=function(){removeEventListener("visibilitychange",b,!0),removeEventListener("prerenderingchange",b,!0)},S=function(){return _<0&&(_=x(),y(),c(function(){setTimeout(function(){_=x(),y()},0)})),{get firstHiddenTime(){return _}}},k=function(e){document.prerendering?addEventListener("prerenderingchange",function(){return e()},!0):e()},j=[1800,3e3],E=function(e,t){t=t||{},k(function(){var r,s=S(),i=h("FCP"),n=p("paint",function(e){e.forEach(function(e){"first-contentful-paint"===e.name&&(n.disconnect(),e.startTime<s.firstHiddenTime&&(i.value=Math.max(e.startTime-d(),0),i.entries.push(e),r(!0)))})});n&&(r=g(e,i,j,t.reportAllChanges),c(function(s){r=g(e,i=h("FCP"),j,t.reportAllChanges),f(function(){i.value=performance.now()-s.timeStamp,r(!0)})}))})},C=[.1,.25],N=function(e,t){t=t||{},E(m(function(){var r,s=h("CLS",0),i=0,n=[],a=function(e){e.forEach(function(e){if(!e.hadRecentInput){var t=n[0],r=n[n.length-1];i&&e.startTime-r.startTime<1e3&&e.startTime-t.startTime<5e3?(i+=e.value,n.push(e)):(i=e.value,n=[e])}}),i>s.value&&(s.value=i,s.entries=n,r())},o=p("layout-shift",a);o&&(r=g(e,s,C,t.reportAllChanges),v(function(){a(o.takeRecords()),r(!0)}),c(function(){i=0,r=g(e,s=h("CLS",0),C,t.reportAllChanges),f(function(){return r()})}),setTimeout(r,0))}))},P=0,F=1/0,$=0,I=function(e){e.forEach(function(e){e.interactionId&&(F=Math.min(F,e.interactionId),P=($=
99Math.max($,e.interactionId))?($-F)/7+1:0)})},T=function(){"interactionCount"in performance||s||(s=p("event",I,{type:"event",buffered:!0,durationThreshold:0}))},R=[],M=new Map,O=0,A=[],L=function(e){if(A.forEach(function(t){return t(e)}),e.interactionId||"first-input"===e.entryType){var t=R[R.length-1],r=M.get(e.interactionId);if(r||R.length<10||e.duration>t.latency){if(r)e.duration>r.latency?(r.entries=[e],r.latency=e.duration):e.duration===r.latency&&e.startTime===r.entries[0].startTime&&r.entries.push(e);else{var s={id:e.interactionId,latency:e.duration,entries:[e]};M.set(s.id,s),R.push(s)}R.sort(function(e,t){return t.latency-e.latency}),R.length>10&&R.splice(10).forEach(function(e){return M.delete(e.id)})}}},D=function(e){var t=self.requestIdleCallback||self.setTimeout,r=-1;return e=m(e),"hidden"===document.visibilityState?e():(r=t(e),v(e)),r},z=[200,500],H=function(e,t){"PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&(t=t||{},k(function(){T();var r,i,n=h("INP"),a=function(e){D(function(){e.forEach(L);var t,r=(t=Math.min(R.length-1,Math.floor(((s?P:performance.interactionCount||0)-O)/50)),R[t]);r&&r.latency!==n.value&&(n.value=r.latency,n.entries=r.entries,i())})},o=p("event",a,{durationThreshold:null!=(r=t.durationThreshold)?r:40});i=g(e,n,z,t.reportAllChanges),o&&(o.observe({type:"first-input",buffered:!0}),v(function(){a(o.takeRecords()),i(!0)}),c(function(){O=0,R.length=0,M.clear(),i=g(e,n=h("INP"),z,t.reportAllChanges)}))}))},q=[2500,4e3],U={},B=function(e,t){t=t||{},k(function(){var r,s=S(),i=h("LCP"),n=function(e){t.reportAllChanges||(e=e.slice(-1)),e.forEach(function(e){e.startTime<s.firstHiddenTime&&(i.value=Math.max(e.startTime-d(),0),i.entries=[e],r())})},a=p("largest-contentful-paint",n);if(a){r=g(e,i,q,t.reportAllChanges);var o=m(function(){U[i.id]||(n(a.takeRecords()),a.disconnect(),U[i.id]=!0,r(!0))});["keydown","click"].forEach(function(e){addEventListener(e,function(){return D(o)},!0)}),v(o),c(function(s){r=g(e,i=h("LCP"),q,t.reportAllChanges),f(function(){i.value=performance.now()-s.timeStamp,U[i.id]=!0,r(!0)})})}})},W=[800,1800],V=function e(t){document.prerendering?k(function(){return e(t)}):"complete"!==document.readyState?addEventListener("load",function(){return e(t)},!0):setTimeout(t,0)},G=function(e,t){t=t||{};var r=h("TTFB"),s=g(e,r,W,t.reportAllChanges);V(function(){var i=u();i&&(r.value=Math.max(i.responseStart-d(),0),r.entries=[i],s(!0),c(function(){(s=g(e,r=h("TTFB",0),W,t.reportAllChanges))(!0)}))})},Y={passive:!0,capture:!0},K=new Date,J=function(e,t){i||(i=t,n=e,a=new Date,Z(removeEventListener),X())},X=function(){if(n>=0&&n<a-K){var e={entryType:"first-input",name:i.type,target:i.target,cancelable:i.cancelable,startTime:i.timeStamp,processingStart:i.timeStamp+n};o.forEach(function(t){t(e)}),o=[]}},Q=function(e){if(e.cancelable){var t,r,s,i=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?(t=function(){J(i,e),s()},r=function(){s()},s=function(){removeEventListener("pointerup",t,Y),removeEventListener("pointercancel",r,Y)},addEventListener("pointerup",t,Y),addEventListener("pointercancel",r,Y)):J(i,e)}},Z=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach(function(t){return e(t,Q,Y)})},ee=[100,300],et=function(e,t){t=t||{},k(function(){var r,s=S(),a=h("FID"),l=function(e){e.startTime<s.firstHiddenTime&&(a.value=e.processingStart-e.startTime,a.entries.push(e),r(!0))},u=function(e){e.forEach(l)},d=p("first-input",u);r=g(e,a,ee,t.reportAllChanges),d&&(v(m(function(){u(d.takeRecords()),d.disconnect()})),c(function(){r=g(e,a=h("FID"),ee,t.reportAllChanges),o=[],n=-1,i=null,Z(addEventListener),o.push(l),X()}))})};t.exports=r}()},8619,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useReportWebVitals",{enumerable:!0,get:function(){return n}});let s=e.r(71645),i=e.r(91708);function n(e){(0,s.useEffect)(()=>{(0,i.onCLS)(e),(0,i.onFID)(e),(0,i.onLCP)(e),(0,i.onINP)(e),(0,i.onFCP)(e),(0,i.onTTFB)(e)},[e])}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esMo
99dule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},95816,(e,t,r)=>{t.exports=e.r(8619)},5417,e=>{"use strict";var t=e.i(95816);let r=e=>{console.log(e)};e.s(["WebVitals",0,function(){return(0,t.useReportWebVitals)(r),null}])},80934,e=>{"use strict";var t=e.i(71645),r=e.i(63774);e.s(["default",0,function(){return(0,t.useEffect)(()=>{(0,r.getCountryCodeClient)()},[]),null}])},63955,e=>{"use strict";var t=e.i(18566),r=e.i(71645);e.s(["default",0,function(){let e=(0,t.useRouter)();return(0,r.useEffect)(()=>{let t=new Set,r=r=>{let s=r.target.closest("a[href]");if(s)try{let r=new URL(s.href,window.location.origin);if(r.origin!==window.location.origin||r.pathname===window.location.pathname||t.has(r.pathname))return;t.add(r.pathname),e.prefetch(r.pathname)}catch{}};return document.addEventListener("mouseover",r),()=>document.removeEventListener("mouseover",r)},[e]),null}])},17970,e=>{"use strict";var t=e.i(71645),r=e.i(18566);e.s(["default",0,function({scripts:e}){let s=(0,r.usePathname)();return(0,t.useEffect)(()=>{let t=e=>{"requestIdleCallback"in window?window.requestIdleCallback(e,{timeout:1500}):setTimeout(e,800)},r=()=>{e.forEach(e=>{var t;let r,i;if(!e.is_active)return;let n=(e.script_code||"").toLowerCase();if((n.includes("squarecdn.com")||n.includes("staxpayments.com")||n.includes("staxjs")||n.includes("square.js"))&&!(s.startsWith("/checkout")||s.startsWith("/payment")))return;let a=e.placement?.includes("head")?"head":"body";t=e.script_code,r="head"===a?document.head:document.body,(i=document.createElement("div")).innerHTML=t.trim(),i.querySelectorAll("script").forEach(e=>{let t=document.createElement("script");Array.from(e.attributes).forEach(e=>{t.setAttribute(e.name,e.value)}),e.src?t.async=e.async??!0:t.textContent=e.textContent,r.appendChild(t)})})};"complete"===document.readyState?t(r):window.addEventListener("load",()=>t(r),{once:!0})},[]),null}])},21251,e=>{"use strict";var t=e.i(71645),r=e.i(54808);e.s(["default",0,function(){return(0,t.useLayoutEffect)(()=>{let e=window.location.hostname;if((0,r.isLocalHost)(e))return;let t=(0,r.buildCanonicalUrl)({href:window.location.href,hostname:e,protocol:window.location.protocol.replace(":","")});t&&t.href!==window.location.href&&window.location.replace(t.href)},[]),null}])},5807,e=>{"use strict";var t=e.i(71645),r=e.i(54808);let s="2026-06-26-v1",i="_hc_cleared",n="_hc_cleared";e.s(["default",0,function(){return(0,t.useEffect)(()=>{if(localStorage.getItem(n)===s)return;if(document.cookie.split(";").find(e=>e.trim().startsWith(i+"="))?.split("=")[1]===s||localStorage.getItem("token")||/encResp=|success=|transaction_id=|order_no=|order_number=|response=/.test(window.location.search))return void localStorage.setItem(n,s);localStorage.clear(),sessionStorage.clear();let e=(0,r.getAuthCookieDomain)(window.location.hostname);document.cookie.split(";").forEach(t=>{let r=t.split("=")[0].trim();document.cookie=`${r}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;`,document.cookie=`${r}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/; domain=${window.location.hostname};`,e&&(document.cookie=`${r}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/; domain=${e};`)});let t=new Date(Date.now()+864e5).toUTCString(),a=e?`; domain=${e}`:"";document.cookie=`${i}=${s}; expires=${t}; path=/${a}`,localStorage.setItem(n,s),window.location.reload()},[]),null}])},72362,e=>{"use strict";var t,r,s=e.i(43476),i="u">typeof window?window:void 0,n="u">typeof globalThis?globalThis:i;"u"<typeof self&&(n.self=n),"u"<typeof File&&(n.File=function(){});var a=null==n?void 0:n.navigator,o=null==n?void 0:n.document,l=null==n?void 0:n.location,c=null==n?void 0:n.fetch,u=null!=n&&n.XMLHttpRequest&&"withCredentials"in new n.XMLHttpRequest?n.XMLHttpRequest:void 0,d=null==n?void 0:n.AbortController,h=null==n?void 0:n.CompressionStream,p=null==a?void 0:a.userAgent,g=null!=i?i:{},f="1.396.2",v={DEBUG:!1,LIB_VERSION:f,LIB_NAME:"web",JS_SDK_VERSION:f};function m(e,t,r,s,i,n,a){try{var o=e[n](a),l=o.value}catch(e){return void r(e)}o.done?t(l):Promise.resolve(l).then(s,i)}function _(e){return function(){var t=this,r=arguments;return new Promise(function(s,i){var n=e.apply(t,r);function a(e){m(n,s,i,a,o,"next",e)}function o(e){m(n,s,i,a,o,"throw",e)}a(void 0)})}}function x(){return(x=Object.assign.bind()).apply(null,arguments)}function b(e,t){if(null==e)return{};var r={};for(var s in e)if(({}).hasOwnProperty.call(e,s)){if(-1!==t.indexOf(s))continue;r[s]=e[s]}return r}var y=e=>{if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(t){return e}};function w(e){return"string"==typeof e||e}function S(e){return"string"==typeof e?e:void 0}var k,j,E,C,N=((k={}).AnonymousId="anonymous_id",k.DistinctId="distinct_id",k.Props="props",k.EnablePersonProcessing="enable_person_processing",k.PersonMode="person_mode",k.FeatureFlagDetails="feature_flag_details",k.FeatureFlags="feature_flags",k.FeatureFlagPayloads="feature_flag_payloads",k.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",k.BootstrapFeatureFlags="bootstrap_feature_flags",k.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",k.OverrideFeatureFlags="override_feature_flags",k.Queue="queue",k.LogsQueue="logs_queue",k.OptedOut="opted_out",k.SessionId="session_id",k.SessionStartTimestamp="session_start_timestamp",k.SessionLastTimestamp="session_timestamp",k.PersonProperties="person_properties",k.GroupProperties="group_properties",k.InstalledAppBuild="installed_app_build",k.InstalledAppVersion="installed_app_version",k.SessionReplay="session_replay",k.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",k.SurveyLastSeenDate="survey_last_seen_date",k.SurveysSeen="surveys_seen",k.Surveys="surveys",k.RemoteConfig="remote_config",k.FlagsEndpointWasHit="flags_endpoint_was_hit",k.DeviceId="device_id",k),P=((j={}).GZipJS="gzip-js",j.Base64="base64",j),F=["$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"],$=["token"],I="NativeGzipValidationError",T=e=>e.length>=2&&31===e[0]&&139===e[1],R=(e,t)=>e===P.GZipJS||t===P.GZipJS||"gzip"===t,M=e=>!(!e||"object"!=typeof e)&&"NotReadableError"===("name"in e?String(e.name):""),O=e=>
99{var t=Error("Native gzip produced invalid output: "+e);throw t.name=I,t},A=(E=_(function*(e,t){18>e.size&&O("too-short");var r=new Uint8Array((yield e.slice(0,10).arrayBuffer()));T(r)&&8===r[2]||O("invalid-header");var s=new DataView((yield e.slice(e.size-8).arrayBuffer()));s.getUint32(0,!0)!==(e=>{for(var t=(()=>{if(C)return C;C=[];for(var e=0;256>e;e++){for(var t=e,r=0;8>r;r++)t=1&t?0xedb88320^t>>>1:t>>>1;C[e]=t>>>0}return C})(),r=0xffffffff,s=0;e.length>s;s++)r=t[255&(r^e[s])]^r>>>8;return(0xffffffff^r)>>>0})(t)&&O("invalid-crc");var i=t.length>>>0;s.getUint32(4,!0)!==i&&O("invalid-size")}),function(e,t){return E.apply(this,arguments)});function L(){return(L=_(function*(e,t,r){void 0===t&&(t=!0);try{var s,i=(new TextEncoder).encode(e),n=new CompressionStream("gzip"),a=n.writable.getWriter(),o=a.write(i).then(()=>a.close()).catch((s=_(function*(e){try{yield a.abort(e)}catch(e){}throw e}),function(e){return s.apply(this,arguments)})),l=new Response(n.readable).blob(),[c]=yield Promise.all([l,o]);return yield A(c,i),c}catch(e){if(null!=r&&r.rethrow)throw e;return t&&console.error("Failed to gzip compress data",e),null}})).apply(this,arguments)}var D=["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"],z=function(e,t){if(void 0===t&&(t=[]),!e)return!1;var r=e.toLowerCase();return D.concat(t).some(e=>{var t=e.toLowerCase();return -1!==r.indexOf(t)})};function H(e,t){return -1!==e.indexOf(t)}var q=function(e){return e.trim()},U=function(e){return e.replace(/^\$/,"")},B=Object.prototype,W=B.hasOwnProperty,V=B.toString,G=Array.isArray||function(e){return"[object Array]"===V.call(e)},Y=e=>"function"==typeof e,K=e=>e===Object(e)&&!G(e),J=e=>{if(K(e)){for(var t in e)if(W.call(e,t))return!1;return!0}return!1},X=e=>void 0===e,Q=e=>"[object String]"==V.call(e),Z=e=>Q(e)&&0===e.trim().length,ee=e=>null===e,et=e=>X(e)||ee(e),er=e=>"[object Number]"==V.call(e)&&e==e,es=e=>er(e)&&e>0,ei=e=>"[object Boolean]"===V.call(e),en=e=>H(F,e),ea=e=>H($,e);function eo(e){return null===e||"object"!=typeof e}function el(e,t){return({}).toString.call(e)==="[object "+t+"]"}function ec(e){return"u">typeof Event&&function(e,t){try{return e instanceof t}catch(e){return!1}}(e,Event)}var eu=[!0,"true",1,"1","yes"],ed=[!1,"false",0,"0","no"];function eh(e,t,r,s,i){return t>r&&(s.warn("min cannot be greater than max."),t=r),er(e)?e>r?(s.warn(" cannot be  greater than max: "+r+". Using max value instead."),r):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: "+r+", fallback: "+i),eh(i||r,t,r,s))}class ep{constructor(e){this.Ee={},this.Pe=e.Pe,this.Fe=eh(e.bucketSize,0,100,e.Ae),this.$e=eh(e.refillRate,0,this.Fe,e.Ae),this.De=eh(e.refillInterval,0,864e5,e.Ae)}Ne(e,t){var r=Math.floor((t-e.lastAccess)/this.De);r>0&&(e.tokens=Math.min(e.tokens+r*this.$e,this.Fe),e.lastAccess=e.lastAccess+r*this.De)}consumeRateLimit(e){var t,r=Date.now(),s=String(e),i=this.Ee[s];return i?this.Ne(i,r):this.Ee[s]=i={tokens:this.Fe,lastAccess:r},0===i.tokens||(i.tokens--,0===i.tokens&&(null==(t=this.Pe)||t.call(this,e)),0===i.tokens)}stop(){this.Ee={}}}var eg="Mobile",ef="Android",ev="Tablet",em=ef+" "+ev,e_="iPad",ex="Apple",eb=ex+" Watch",ey="Safari",ew="BlackBerry",eS="Samsung",ek=eS+"Browser",ej=eS+" Internet",eE="Chrome",eC=eE+" OS",eN=eE+" iOS",eP="Internet Explorer",eF=eP+" "+eg,e$="Opera",eI=e$+" Mini",eT="Edge",eR="Microsoft "+eT,eM="Firefox",eO=eM+" iOS",eA="Nintendo",eL="PlayStation",eD="Xbox",ez=ef+" "+eg,eH=eg+" "+ey,eq="Windows",eU=eq+" Phone",eB="Nokia",eW="Ouya",eV="Generic",eG=eV+" "+eg.toLowerCase(),eY=eV+" "+ev.toLowerCase(),eK="Konqueror",eJ="Oculus Browser",eX="Vivaldi",eQ="Yandex",eZ="Whale",e0="DuckDuckGo",e1="Pale Moon",e3="Waterfox",e2="Brave",e4="Google Search App",e5="(\\d+(\\.\\d+)?)",e7=RegExp("Version/"+e5),e6=RegExp(eD,"i"),e8=RegExp(eL+" \\w+","i"),e9=RegExp(eA+" \\w+","i"),te=RegExp(ew+"|PlayBook|BB10","i"),tt={"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"},tr=function(e,t,r,s){var i;return t=t||"",(null!=r&&r.brave?e2:null)||(null!=s&&s.detectGoogleSearchApp&&H(e,"GSA/")?e4:H(e," OPR/")&&H(e,"Mini")?eI:H(e," OPR/")?e$:te.test(e)?ew:H(e,"IE"+eg)||H(e,"WPDesktop")?eF:H(e,"OculusBrowser")?eJ:H(e,ek)?ej:H(e,eT)||H(e,"Edg/")?eR:H(e,eX+"/")?eX:H(e,"YaBrowser/")?eQ:H(e,eZ+"/")?eZ:H(e,e0+"/")||H(e,"Ddg/")?e0:H(e,"FBIOS")?"Facebook "+eg:H(e,"UCWEB")||H(e,"UCBrowser")?"UC Browser":H(e,"CriOS")?eN:H(e,"CrMo")||H(e,eE)?eE:H(e,ef)&&H(e,ey)?ez:H(e,"FxiOS")?eO:H(e.toLowerCase(),eK.toLowerCase())?eK:H(e,e2+"/")?e2:(i=t)&&H(i,ex)||H(e,ey)&&!H(e,eE)&&!H(e,ef)?H(e,eg)?eH:ey:H(e,"PaleMoon/")?e1:H(e,e3+"/")?e3:H(e,eM)?eM:H(e,"MSIE")||H(e,"Trident/")?eP:H(e,"Gecko")?eM:"")},ts={[eF]:[RegExp("rv:"+e5)],[eR]:[RegExp(eT+"?\\/"+e5)],[eE]:[RegExp("("+eE+"|CrMo)\\/"+e5)],[eN]:[RegExp("CriOS\\/"+e5)],"UC Browser":[RegExp("(UCBrowser|UCWEB)\\/"+e5)],[ey]:[e7],[eH]:[e7],[e$]:[RegExp("(Opera|OPR)\\/"+e5)],[eM]:[RegExp(eM+"\\/"+e5)],[eO]:[RegExp("FxiOS\\/"+e5)],[eK]:[RegExp("Konqueror[:/]?"+e5,"i")],[ew]:[RegExp(ew+" "+e5),e7],[ez]:[RegExp("android\\s"+e5,"i")],[ej]:[RegExp(ek+"\\/"+e5)],[eJ]:[RegExp("OculusBrowser\\/"+e5)],[eX]:[RegExp(eX+"\\/"+e5)],[eQ]:[RegExp("YaBrowser\\/"+e5)],[eZ]:[RegExp(eZ+"\\/"+e5)],[e2]:[RegExp(e2+"\\/"+e5)],[e0]:[RegExp("(DuckDuckGo|Ddg)\\/"+e5)],[e1]:[RegExp("PaleMoon\\/"+e5)],[e3]:[RegExp(e3+"\\/"+e5)],[e4]:[RegExp("GSA\\/"+e5)],[eP]:[RegExp("(rv:|MSIE )"+e5)],Mozilla:[RegExp("rv:"+e5)]},ti=function(e,t,r,s){var i=ts[tr(e,t,r,s)];if(X(i))return null;for(var n=0;i.length>n;n++){var a=e.match(i[n]);if(a)return parseFloat(a[a.length-2])}return null},tn=[[RegExp(eD+"; "+eD+" (.*?)[);]","i"),e=>[eD,e&&e[1]||""]],[RegExp(eA,"i"),[eA,""]],[RegExp(eL,"i"),[eL,""]],[te,[ew,""]],[RegExp(eq,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[eU,""];if(new RegExp(eg).test(t)&&!/IEMobile\b/.test(t))return[eq+" "+eg,""];
99var r=/Windows NT ([0-9.]+)/i.exec(t);if(r&&r[1]){var s=tt[r[1]]||"";return/arm/i.test(t)&&(s="RT"),[eq,s]}return[eq,""]}],[/((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=X(e[2])?e[3]:e[2]),["watchOS",t]}],[RegExp("("+ef+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+ef+")","i"),e=>e&&e[2]?[ef,[e[2],e[3],e[4]||"0"].join(".")]:[ef,""]],[/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",""]]],ta=function(e){return e9.test(e)?eA:e8.test(e)?eL:e6.test(e)?eD:RegExp(eW,"i").test(e)?eW:RegExp("("+eU+"|WPDesktop)","i").test(e)?eU:/iPad/.test(e)?e_:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?eb:te.test(e)?ew:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":RegExp(eB,"i").test(e)?eB:/(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(eg).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)?ef:em:RegExp("(pda|"+eg+")","i").test(e)?eG:RegExp(ev,"i").test(e)&&!RegExp(ev+" pc","i").test(e)?eY:""},to=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function tl(e,t){return"string"==typeof e&&to.test(e)?e:t()}function tc(e){return e?e.split("#")[0]:e}function tu(e,t){var r=setTimeout(e,t);return(null==r?void 0:r.unref)&&(null==r||r.unref()),r}var td=e=>e instanceof Error,th={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}},tp=th.info;function tg(e){var t=[];for(var r in e){var s=e[r];ee(s)||X(s)||t.push({key:r,value:function e(t){if(ei(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(G(t))return{arrayValue:{values:t.map(t=>e(t))}};try{return{stringValue:JSON.stringify(t)}}catch(e){return{stringValue:String(t)}}}(s)})}return t}function tf(e,t,r){return x({},e.resourceAttributes,{"service.name":e.serviceName||"unknown_service"},e.environment&&{"deployment.environment":e.environment},e.serviceVersion&&{"service.version":e.serviceVersion},{"telemetry.sdk.name":t,"telemetry.sdk.version":r})}function tv(e,t,r,s){return{resourceLogs:[{resource:{attributes:tg(t)},scopeLogs:[{scope:{name:r,version:s},logRecords:e}]}]}}let tm=class{constructor(e,t,r,s,i,n,a){var o;void 0===n&&(n=()=>Promise.resolve()),this._instance=e,this.Se=t,this.Ae=r,this.qe=s,this.je=i,this.Be=n,this.He=a,this.Ue=null,this.ze=0,this.Ve=0,this.We=0,this.Ge=0,this.Ze=!1,this.Qe=t.maxBufferSize,this.Je=Math.max(null!=(o=t.maxQueueSize)?o:t.maxBufferSize,t.maxBufferSize),this.Ye=t.flushIntervalMs,this.Ke=t.maxBatchRecordsPerPost,this.Xe=t.rateCapWindowMs,this.et=t.maxLogsPerInterval}reset(){this.tt(),this.Ue=null,this.We=0,this.Ge=0,this.Ze=!1,this.ze=0,this.Ve=0,this.Ke=this.Se.maxBatchRecordsPerPost}onReconnect(){this.Ve=0,this.rt()}captureLog(e){if(!this._instance.isDisabled&&!this._instance.optedOut&&null!=e&&e.body){var t=this.it(e);if(null!==t)if(t.body){if(this.nt()){var r={record:function(e,t){var{text:r,number:s}=th[e.level||"info"]||tp,i=String(Date.now())+"000000",n={};t.distinctId&&(n.posthogDistinctId=t.distinctId),t.sessionId&&(n.sessionId=t.sessionId),t.windowId&&(n["window.id"]=t.windowId),et(t.sessionStartTimestamp)||(n.sessionStartTimestamp=String(t.sessionStartTimestamp)),et(t.lastActivityTimestamp)||(n.lastActivityTimestamp=String(t.lastActivityTimestamp)),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=x({},n,e.attributes||{}),o={timeUnixNano:i,observedTimeUnixNano:i,severityNumber:s,severityText:r,body:{stringValue:e.body},attributes:tg(a)};return e.trace_id&&(o.traceId=e.trace_id),e.span_id&&(o.spanId=e.span_id),X(e.trace_flags)||(o.flags=e.trace_flags),o}(t,this.qe())};this.je(()=>this.st(r))}}else this.Ae.info("Log was rejected in beforeSend function")}}it(e){var t=this.Se.beforeSend;if(!t)return e;var r=G(t)?t:[t],s=e;for(var i of r)try{var n=i(s);if(!n)return this.Ae.info("Log was rejected in beforeSend function"),null;s=n}catch(e){return this.Ae.error("Error in beforeSend function for log:",e),null}return s}nt(){if(void 0===this.et)return!0;var e=Date.now(),t=e-this.We;return this.Xe>t&&t>=0||(this.We=e,this.Ge=0,this.Ze=!1),this.et>
99this.Ge?(this.Ge++,!0):(this.Ze||(this.Ae.warn("captureLog dropping logs: exceeded "+this.et+" logs per "+this.Xe+"ms"),this.Ze=!0),!1)}flush(){var e=this;return _(function*(){if(!e._instance.isDisabled)return e.Ue||(e.Ue=e.ot().finally(()=>{e.Ue=null})),e.Ue})()}ot(){var e=this;return _(function*(){e.tt();var t=null!=(i=e._instance.getPersistedProperty(N.LogsQueue))?i:[];if(0!==t.length)for(var r=t.length,s=0;t.length>0&&r>s;){e.ze=0;var i,n,a,o=Math.min(t.length,e.Ke),l=t.slice(0,o),c=tv(l.map(e=>e.record),e.ut(),null!=(n=e.He)?n:e._instance.getLibraryId(),e._instance.getLibraryVersion()),u=yield e._instance.ht(c);if("too-large"===u.kind&&l.length>1)e.Ke=Math.max(1,Math.floor(l.length/2)),e.Ae.warn("Received 413 when sending logs batch of size "+l.length+", reducing batch size to "+e.Ke);else if("retry-later"===u.kind||("too-large"===u.kind?e.Ae.warn("Dropping a single log record after 413 with batch size 1 — the record is larger than the server cap and cannot be split further."):"ok"===u.kind&&e.Se.maxBatchRecordsPerPost>e.Ke&&(e.Ke=Math.min(e.Se.maxBatchRecordsPerPost,e.Ke+1)),yield e.dt(l.length),t=null!=(a=e._instance.getPersistedProperty(N.LogsQueue))?a:[],s+=l.length,"fatal"===u.kind))throw u.error}})()}dt(e){var t=this;return _(function*(){var r,s=Math.max(0,e-t.ze),i=null!=(r=t._instance.getPersistedProperty(N.LogsQueue))?r:[];t._instance.setPersistedProperty(N.LogsQueue,i.slice(s)),yield t.Be()})()}ut(){return tf(this.Se,this._instance.getLibraryId(),this._instance.getLibraryVersion())}st(e){var t;if(!this._instance.optedOut){var r=null!=(t=this._instance.getPersistedProperty(N.LogsQueue))?t:[];this.Je>r.length||(r.shift(),this.ze++,this.Ae.info("Logs queue is full, dropping oldest record.")),r.push(e),this._instance.setPersistedProperty(N.LogsQueue,r),this.Qe>r.length?this.ct():this.rt()}}ct(e){void 0===e&&(e=this.Ye),this.vt||(this.vt=tu(()=>{this.vt=void 0,this.rt()},e))}ft(){var e=Math.min(Math.max(0,this.Ve-1),6);return this.Ye*Math.pow(2,e)}yt(){var e=this._instance.getPersistedProperty(N.LogsQueue);return!!e&&e.length>0}shutdown(e){var t=this;return _(function*(){t.tt();var r=t.flush().catch(()=>{});void 0!==e?yield Promise.race([r,new Promise(t=>tu(t,e))]):yield r})()}flushWithTimeout(e){var t=this;return _(function*(){var r=!1,s=t.flush(),i=new Promise(t=>tu(()=>{r=!0,t()},e));try{yield Promise.race([s,i])}finally{r&&s.catch(()=>{})}})()}rt(){this.flush().then(()=>{this.Ve=0},e=>{this.Ve++,this.Ae.error("PostHog logs flush failed:",e)}).finally(()=>{!this._instance.isDisabled&&this.yt()&&this.ct(this.ft())})}tt(){this.vt&&(clearTimeout(this.vt),this.vt=void 0)}};class t_{constructor(e,t,r){void 0===r&&(r=[]),this.coercers=e,this.stackParser=t,this.modifiers=r}buildFromUnknown(e,t){void 0===t&&(t={});var r=t&&t.mechanism||{handled:!0,type:"generic"},s=this.buildCoercingContext(r,t,0).apply(e),i=this.buildParsingContext(t),n=this.parseStacktrace(s,i);return{$exception_list:this.convertToExceptionList(n,r),$exception_level:"error"}}modifyFrames(e){var t=this;return _(function*(){for(var r of e)r.stacktrace&&r.stacktrace.frames&&G(r.stacktrace.frames)&&(r.stacktrace.frames=yield t.applyModifiers(r.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 r,s;return null!=e.cause&&(r=this.parseStacktrace(e.cause,t)),""!=e.stack&&null!=e.stack&&(s=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.skipFirstLines:0),t.chunkIdMap)),x({},e,{cause:r,stack:s})}applyChunkIds(e,t){return e.map(e=>(e.filename&&t&&(e.chunk_id=t[e.filename]),e))}applyCoercers(e,t){for(var r of this.coercers)if(r.match(e))return r.coerce(e,t);return this.coerceFallback(t)}applyModifiers(e){var t=this;return _(function*(){var r=e;for(var s of t.modifiers)r=yield s(r);return r})()}convertToExceptionList(e,t){var r,s,i,n={type:e.type,value:e.value,mechanism:{type:null!=(r=t.type)?r:"generic",handled:null==(s=t.handled)||s,synthetic:null!=(i=e.synthetic)&&i}};e.stack&&(n.stacktrace={type:"raw",frames:e.stack});var a=[n];return null!=e.cause&&a.push(...this.convertToExceptionList(e.cause,x({},t,{handled:!0}))),a}buildParsingContext(e){var t;return{chunkIdMap:function(e){var t=globalThis._posthogChunkIds;if(t){var r=Object.keys(t);return st&&r.length===se||(se=r.length,st=r.reduce((r,s)=>{r9||(r9={});var i=r9[s];if(i)r[i[0]]=i[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,c=t[s];if(l&&c){r[l]=c,r9[s]=[l,c];break}}return r},{})),st}}(this.stackParser),skipFirstLines:null!=(t=e.skipFirstLines)?t:1}}buildCoercingContext(e,t,r){void 0===r&&(r=0);var s=(r,s)=>{if(4>
99=s){var i=this.buildCoercingContext(e,t,s);return this.applyCoercers(r,i)}};return x({},t,{syntheticException:0==r?t.syntheticException:void 0,mechanism:e,apply:e=>s(e,r),next:e=>s(e,r+1)})}}function tx(e,t,r,s,i){var n={platform:e,filename:t,function:"<anonymous>"===r?"?":r,in_app:!0};return X(s)||(n.lineno=s),X(i)||(n.colno=i),n}var tb=(e,t)=>{var r=-1!==e.indexOf("safari-extension"),s=-1!==e.indexOf("safari-web-extension");return r||s?[-1!==e.indexOf("@")?e.split("@")[0]:"?",r?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},ty=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,tw=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,tS=/\((\S*)(?::(\d+))(?::(\d+))\)/,tk=(e,t)=>{var r=ty.exec(e);if(r){var[,s,i,n]=r;return tx(t,s,"?",+i,+n)}var a=tw.exec(e);if(a){if(a[2]&&0===a[2].indexOf("eval")){var o=tS.exec(a[2]);o&&(a[2]=o[1],a[3]=o[2],a[4]=o[3])}var[l,c]=tb(a[1]||"?",a[2]);return tx(t,c,l,a[3]?+a[3]:void 0,a[4]?+a[4]:void 0)}},tj=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,tE=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,tC=(e,t)=>{var r=tj.exec(e);if(r){if(r[3]&&r[3].indexOf(" > eval")>-1){var s=tE.exec(r[3]);s&&(r[1]=r[1]||"eval",r[3]=s[1],r[4]=s[2],r[5]="")}var i=r[3],n=r[1]||"?";return[n,i]=tb(n,i),tx(t,i,n,r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}},tN=/\(error: (.*)\)/;class tP{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var r=Q(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:r?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 el(e,"DOMException")}isDOMError(e){return el(e,"DOMError")}}class tF{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 r=e.message;return String(r.error&&"string"==typeof r.error.message?r.error.message:r)}getStack(e){return e.stacktrace||e.stack||void 0}}class t${match(e){return el(e,"ErrorEvent")&&null!=e.error}coerce(e,t){var r;return t.apply(e.error)||{type:"ErrorEvent",value:e.message,stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}}var tI=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class tT{match(e){return"string"==typeof e}coerce(e,t){var r,[s,i]=this.getInfos(e);return{type:null!=s?s:"Error",value:null!=i?i:e,stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}getInfos(e){var t="Error",r=e,s=e.match(tI);return s&&(t=s[1],r=s[2]),[t,r]}}var tR=["fatal","error","warning","log","info","debug"];function tM(e,t){void 0===t&&(t=40);var r=Object.keys(e);if(r.sort(),!r.length)return"[object has no keys]";for(var s=r.length;s>0;s--){var i=r.slice(0,s).join(", ");if(t>=i.length)return s===r.length?i:i.length>t?i.slice(0,t)+"...":i}return""}class tO{match(e){return"object"==typeof e&&null!==e}coerce(e,t){var r,s=this.getErrorPropertyFromObject(e);return s?t.apply(s):{type:this.getType(e),value:this.getValue(e),stack:null==(r=t.syntheticException)?void 0:r.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return ec(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 r=this.getObjectClassName(e);return(r&&"Object"!==r?"'"+r+"'":"Object")+" captured as exception with keys: "+tM(e)}isSeverityLevel(e){return Q(e)&&!Z(e)&&tR.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var t in e)if(({}).hasOwnProperty.call(e,t)){var r=e[t];if(td(r))return r}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}}}class tA{match(e){return ec(e)}coerce(e,t){var r,s=e.constructor.name;return{type:s,value:s+" captured as exception with keys: "+tM(e),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}}class tL{match(e){return eo(e)}coerce(e,t){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}}class tD{match(e){return el(e,"PromiseRejectionEvent")||this.isCu
99stomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!ec(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 r,s=this.getUnhandledRejectionReason(e);return eo(s)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(s),stack:null==(r=t.syntheticException)?void 0:r.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 tz="$message",tH="$timestamp",tq=new Set([tz,tH]),tU={enabled:!0,max_bytes:32768};function tB(e){var t;return e?{enabled:null!=(t=e.enabled)?t:tU.enabled,max_bytes:function(e,t){if(!er(e)||e===1/0||e===-1/0)return t;var r=Math.floor(e);return 0>r?t:r}(e.max_bytes,tU.max_bytes)}:x({},tU)}class tW{constructor(e){this.bt=[],this._t=0,this.Se=tB(e)}setConfig(e){this.Se=tB(e),this.wt()}add(e){var t=function(e){var t=function(e){var t=new WeakSet;try{return JSON.stringify(e,(e,r)=>{if("bigint"==typeof r)return r.toString();if("function"!=typeof r&&"symbol"!=typeof r){if(r instanceof Date)return r.toISOString();if(r instanceof Error)return{name:r.name,message:r.message,stack:r.stack};if(r&&"object"==typeof r){if(t.has(r))return"[Circular]";t.add(r)}return r}})}catch(e){return}}(e);if(t)try{var r=JSON.parse(t);if(!K(r))return;var s=r[tz],i=r[tH];if(!Q(s)||0===s.trim().length||!Q(i)&&!er(i))return;return{step:r,json:t}}catch(e){return}}(e);if(t){var r=function(e){if("u">typeof TextEncoder)return(new TextEncoder).encode(e).length;for(var t=encodeURIComponent(e),r=0,s=0;t.length>s;s++)"%"===t[s]?(r+=1,s+=2):r+=1;return r}(t.json);r>this.Se.max_bytes||(this.bt.push({step:t.step,bytes:r}),this._t+=r,this.wt())}}getAttachable(){return this.bt.map(e=>e.step)}clear(){this.bt=[],this._t=0}size(){return this.bt.length}wt(){for(;this._t>this.Se.max_bytes&&this.bt.length>0;){var e=this.bt.shift();e&&(this._t-=e.bytes)}}}var tV=function(e,t){var{debugEnabled:r}=void 0===t?{}:t,s={k(t){if(i&&(v.DEBUG||g.POSTHOG_DEBUG||r)&&!X(i.console)&&i.console){for(var s=("__rrweb_original__"in i.console[t])?i.console[t].__rrweb_original__:i.console[t],n=arguments.length,a=Array(n>1?n-1:0),o=1;n>o;o++)a[o-1]=arguments[o];s(e,...a)}},debug(){for(var e=arguments.length,t=Array(e),r=0;e>r;r++)t[r]=arguments[r];s.k("debug",...t)},info(){for(var e=arguments.length,t=Array(e),r=0;e>r;r++)t[r]=arguments[r];s.k("log",...t)},warn(){for(var e=arguments.length,t=Array(e),r=0;e>r;r++)t[r]=arguments[r];s.k("warn",...t)},error(){for(var e=arguments.length,t=Array(e),r=0;e>r;r++)t[r]=arguments[r];s.k("error",...t)},critical(){for(var t=arguments.length,r=Array(t),s=0;t>s;s++)r[s]=arguments[s];console.error(e,...r)},uninitializedWarning(e){s.error("You must initialize PostHog before calling "+e)},createLogger:(t,r)=>tV(e+" "+t,r)};return s},tG=tV("[PostHog.js]"),tY=tG.createLogger,tK=tY("[ExternalScriptsLoader]"),tJ=(e,t,r)=>{if(e.config.disable_external_dependency_loading)return tK.warn(t+" was requested but loading of external scripts is disabled."),r("Loading of external scripts is disabled");var s=null==o?void 0:o.querySelectorAll("script");if(s){for(var i,n=0;s.length>n;n++)if(i=function(){if(s[n].src===t){var e=s[n];return e.__posthog_loading_callback_fired?{v:r()}:(e.addEventListener("load",t=>{e.__posthog_loading_callback_fired=!0,r(void 0,t)}),e.onerror=e=>r(e),{v:void 0})}}())return i.v}var a=()=>{if(!o)return r("document not found");var s=o.createElement("script");if(s.type="text/javascript",s.crossOrigin="anonymous",s.src=t,s.onload=e=>{s.__posthog_loading_callback_fired=!0,r(void 0,e)},s.onerror=e=>r(e),e.config.prepare_external_dependency_script&&(s=e.config.prepare_external_dependency_script(s)),!s)return r("prepare_external_dependency_script returned null");if("head"===e.config.external_scripts_inject_target)o.head.appendChild(s);else{var i,n=o.querySelectorAll("body > script");n.length>0?null==(i=n[0].parentNode)||i.insertBefore(s,n[0]):o.body.appendChild(s)}};null!=o&&o.body?a():null==o||o.addEventListener("DOMContentLoaded",a)};g.__PosthogExtensions__=g.__PosthogExtensions__||{},g.__PosthogExtensions__.loadExternalDependency=(e,t,r)=>{if("remote-config"!==t){var s;if(e.config.strict_script_versioning)s=e.requestRouter.endpointFor("assets","/static/"+e.version+"/"+t+".js");else{var i="/static/"+t+".js?v="+e.version;"toolbar"===t&&(i=i+"&t="+3e5*Math.floor(Date.now()/3e5)),s=e.requestRouter.endpointFor("assets",
99i)}tJ(e,s,r)}else{var n=e.requestRouter.endpointFor("assets","/array/"+e.config.token+"/config.js");tJ(e,n,r)}},g.__PosthogExtensions__.loadSiteApp=(e,t,r)=>{var s=e.requestRouter.endpointFor("api",t);tJ(e,s,r)};var tX="$people_distinct_id",tQ="$device_id",tZ="$device_model",t0="__alias",t1="__timers",t3="$autocapture_disabled_server_side",t2="$heatmaps_enabled_server_side",t4="$exception_capture_enabled_server_side",t5="$error_tracking_suppression_rules",t7="$error_tracking_capture_extension_exceptions",t6="$web_vitals_enabled_server_side",t8="$dead_clicks_enabled_server_side",t9="$product_tours_enabled_server_side",re="$web_vitals_allowed_metrics",rt="$session_recording_remote_config",rr="$replay_sample_rate",rs="$replay_override_sampling",ri="$replay_override_linked_flag",rn="$replay_override_url_trigger",ra="$replay_override_event_trigger",ro="$sesid",rl="$session_is_sampled",rc="$enabled_feature_flags",ru="$active_feature_flags",rd="$early_access_features",rh="$feature_flag_details",rp="$feature_flag_payloads",rg="$feature_flag_request_id",rf="$override_feature_flags",rv="$override_feature_flag_payloads",rm="$stored_person_properties",r_="$stored_group_properties",rx="$surveys",rb="$surveys_loaded_at",ry="$surveys_activated",rw="ph_product_tours",rS="$flag_call_reported",rk="$flag_call_reported_session_id",rj="$feature_flag_errors",rE="$feature_flag_evaluated_at",rC="$user_state",rN="$client_session_props",rP="$capture_rate_limit",rF="$initial_campaign_params",r$="$initial_referrer_info",rI="$initial_person_info",rT="$epp",rR="__POSTHOG_TOOLBAR__",rM="$posthog_cookieless",rO="$sdk_debug_extensions_init_method",rA="$sdk_debug_extensions_init_time_ms",rL="$sdk_debug_recording_script_not_loaded",rD="PostHog loadExternalDependency extension not found.",rz="on_reject",rH="always",rq="anonymous",rU="identified",rB="identified_only",rW="visibilitychange",rV="beforeunload",rG="$pageview",rY="$pageleave",rK="$identify",rJ="$groupidentify";function rX(e,t){G(e)&&e.forEach(t)}function rQ(e,t){if(!et(e))if(G(e))e.forEach(t);else if(e instanceof FormData)e.forEach((e,r)=>t(e,r));else for(var r in e)W.call(e,r)&&t(e[r],r)}var rZ=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),s=1;t>s;s++)r[s-1]=arguments[s];for(var i of r)for(var n in i)void 0!==i[n]&&(e[n]=i[n]);return e};function r0(e){for(var t=Object.keys(e),r=t.length,s=Array(r);r--;)s[r]=[t[r],e[t[r]]];return s}var r1=function(e){try{return e()}catch(e){return}},r3=function(e){return function(){try{for(var t=arguments.length,r=Array(t),s=0;t>s;s++)r[s]=arguments[s];return e.apply(this,r)}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)}}},r2=function(e){var t={};return rQ(e,function(e,r){(Q(e)&&e.length>0||er(e))&&(t[r]=e)}),t},r4=["herokuapp.com","vercel.app","netlify.app"];function r5(e,t,r,s){var{capture:i=!1,passive:n=!0}=null!=s?s:{};null==e||e.addEventListener(t,r,{capture:i,passive:n})}function r7(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 er(e)&&isFinite(e)&&Math.floor(e)===e});class r6{constructor(e){if(this.bytes=e,16!==e.length)throw TypeError("not 128-bit length")}static fromFieldsV7(e,t,r,s){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(r)||!Number.isInteger(s)||0>e||0>t||0>r||0>s||e>0xffffffffffff||t>4095||r>0x3fffffff||s>0xffffffff)throw RangeError("invalid field value");var i=new Uint8Array(16);return i[0]=e/0x10000000000,i[1]=e/0x100000000,i[2]=e/0x1000000,i[3]=e/65536,i[4]=e/256,i[5]=e,i[6]=112|t>>>8,i[7]=t,i[8]=128|r>>>24,i[9]=r>>>16,i[10]=r>>>8,i[11]=r,i[12]=s>>>24,i[13]=s>>>16,i[14]=s>>>8,i[15]=s,new r6(i)}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 r6(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var t=0;16>t;t++){var r=this.bytes[t]-e.bytes[t];if(0!==r)return Math.sign(r)}return 0}}class r8{constructor(){this.S=0,this.C=0,this.I=new si}generate(){var e=this.generateOrAbort();if(X(e)){this.S=0;var t=this.generateOrAbort();if(X(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.M();else{if(this.S>=e+1e4)return;this.C++,this.C>0x3ffffffffff&&(this.S++,this.M())}return r6.fromFieldsV7(this.S,Math.trunc(this.C/0x40000000),0x3fffffff&this.C,this.I.nextUint32())}M(){this.C=1024*this.I.nextUint32()+(1023&this.I.nextUint32())}}
99var r9,se,st,sr,ss=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};i&&!X(i.crypto)&&crypto.getRandomValues&&(ss=e=>crypto.getRandomValues(e));class si{constructor(){this.R=new Uint32Array(8),this.O=1/0}nextUint32(){return this.R.length>this.O||(ss(this.R),this.O=0),this.R[this.O++]}}var sn=()=>sa().toString(),sa=()=>(sr||(sr=new r8)).generate(),so="",sl=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,sc={N:()=>!!o,D(e){tG.error("cookieStore error: "+e)},P(e){if(o){try{for(var t=e+"=",r=o.cookie.split(";").filter(e=>e.length),s=0;r.length>s;s++){for(var i=r[s];" "==i.charAt(0);)i=i.substring(1,i.length);if(0===i.indexOf(t))return decodeURIComponent(i.substring(t.length,i.length))}}catch(e){}return null}},F(e){var t;try{t=JSON.parse(sc.P(e))||{}}catch(e){}return t},q(e,t,r,s,i){if(!o)return!1;try{var n="",a="",l=function(e,t){if(t){var r=function(e,t){if(void 0===t&&(t=o),so)return so;if(!t||["localhost","127.0.0.1"].includes(e))return"";for(var r=e.split("."),s=Math.min(r.length,8),i="dmn_chk_"+sn();!so&&s--;){var n=r.slice(s).join("."),a=i+"=1;domain=."+n+";path=/";t.cookie=a+";max-age=3",t.cookie.includes(i)&&(t.cookie=a+";max-age=0",so=n)}return so}(e);if(!r){var s,i=(s=e.match(sl))?s[0]:"";i!==r&&tG.info("Warning: cookie subdomain discovery mismatch",i,r),r=i}return r?"; domain=."+r:""}return""}(o.location.hostname,s);if(r){var c=new Date;c.setTime(c.getTime()+864e5*r),n="; expires="+c.toUTCString()}i&&(a="; secure");var u=e+"="+encodeURIComponent(JSON.stringify(t))+n+"; SameSite=Lax; path=/"+l+a;return u.length>3686.4&&tG.warn("cookieStore warning: large cookie, len="+u.length),o.cookie=u,!0}catch(e){return!1}},A(e,t){if(null!=o&&o.cookie)try{sc.q(e,"",-1,t)}catch(e){return}}},su=null,sd={N(){if(!ee(su))return su;var e=!0;if(X(i))e=!1;else try{var t="__mplssupport__";sd.q(t,"xyz"),'"xyz"'!==sd.P(t)&&(e=!1),sd.A(t)}catch(t){e=!1}return e||tG.error("localStorage unsupported; falling back to cookie store"),su=e,e},D(e){tG.error("localStorage error: "+e)},P(e){try{return null==i?void 0:i.localStorage.getItem(e)}catch(e){sd.D(e)}return null},F(e){try{return JSON.parse(sd.P(e))||{}}catch(e){}return null},q(e,t){try{return null==i||i.localStorage.setItem(e,JSON.stringify(t)),!0}catch(e){sd.D(e)}return!1},A(e){try{null==i||i.localStorage.removeItem(e)}catch(e){sd.D(e)}}},sh=[tQ,"distinct_id",ro,rl,rT,rI,rC],sp={},sg={N:()=>!0,D(e){tG.error("memoryStorage error: "+e)},P:e=>sp[e]||null,F:e=>sp[e]||null,q:(e,t)=>(sp[e]=t,!0),A(e){delete sp[e]}},sf=null,sv={N(){if(!ee(sf))return sf;if(sf=!0,X(i))sf=!1;else try{var e="__support__";sv.q(e,"xyz"),'"xyz"'!==sv.P(e)&&(sf=!1),sv.A(e)}catch(e){sf=!1}return sf},D(e){tG.error("sessionStorage error: ",e)},P(e){try{return null==i?void 0:i.sessionStorage.getItem(e)}catch(e){sv.D(e)}return null},F(e){try{return JSON.parse(sv.P(e))||null}catch(e){}return null},q(e,t){try{return null==i||i.sessionStorage.setItem(e,JSON.stringify(t)),!0}catch(e){sv.D(e)}return!1},A(e){try{null==i||i.sessionStorage.removeItem(e)}catch(e){sv.D(e)}}};class sm{constructor(e){this._instance=e}get Se(){return this._instance.config}get consent(){return this.kt()?0:this.St}
99isOptedOut(){return this.Se.cookieless_mode===rH||this.isRejected()||-1===this.consent&&this.Se.cookieless_mode===rz}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.Se.opt_out_capturing_by_default}optInOut(e){this.Ct.q(this.It,+!!e,this.Se.cookie_expiration,this.Se.cross_subdomain_cookie,this.Se.secure_cookie)}reset(){this.Ct.A(this.It,this.Se.cross_subdomain_cookie)}get It(){var{token:e,opt_out_capturing_cookie_prefix:t,consent_persistence_name:r}=this._instance.config;return r||(t?t+e:"__ph_opt_in_out_"+e)}get St(){var e=this.Ct.P(this.It);return H(eu,e)?1:H(ed,e)?0:-1}get Ct(){var e=this.Se.opt_out_capturing_persistence_type,t="localStorage"===e?sd:sc;if(!this.Tt||this.Tt!==t){this.Tt=t;var r="localStorage"===e?sc:sd;r.P(this.It)&&(this.Tt.P(this.It)||this.optInOut(H(eu,r.P(this.It))),r.A(this.It,this.Se.cross_subdomain_cookie))}return this.Tt}kt(){return!!this.Se.respect_dnt&&[null==a?void 0:a.doNotTrack,null==a?void 0:a.msDoNotTrack,g.doNotTrack].some(e=>H(eu,e))}}function s_(e,t){var r,s=null==e||null==(r=e.config)?void 0:r.get_current_url;if(!Y(s))return t;try{var i=s(t);return Q(i)&&i?i:t}catch(e){return tG.error("Error in get_current_url, falling back to window.location.href",e),t}}function sx(e){return e instanceof Element&&(e.id===rR||!(null==e.closest||!e.closest(".toolbar-global-fade-container")))}function sb(e){return!!e&&1===e.nodeType}function sy(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function sw(e){return!!e&&3===e.nodeType}function sS(e){return!!e&&11===e.nodeType&&sb(e.host)}function sk(e){return e?q(e).split(/\s+/):[]}function sj(e,t){var r,s,n=X(s=null==i||null==(r=i.location)?void 0:r.href)?void 0:s_(t,s);return!!(n&&e&&e.some(e=>n.match(e)))}function sE(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 sk(t)}function sC(e){return et(e)?null:q(e).split(/(\s+)/).filter(e=>sJ(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function sN(e){var t="";return sq(e)&&!sU(e)&&e.childNodes&&e.childNodes.length&&rQ(e.childNodes,function(e){var r;sw(e)&&e.textContent&&(t+=null!=(r=sC(e.textContent))?r:"")}),q(t)}function sP(e){var t;return X(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null}var sF=["a","button","form","input","select","textarea","label"];function s$(e,t){if(X(t))return!0;var r,s=function(e){if(t.some(t=>(function(e,t){var r=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector;try{return!!r&&r.call(e,t)}catch(e){return!1}})(e,t)))return{v:!0}};for(var i of e)if(r=s(i))return r.v;return!1}function sI(e){var t=e.parentNode;return!(!t||!sb(t))&&t}var sT=[".ph-no-autocapture","[data-ph-no-autocapture]"],sR=["next","previous","prev",">","<"],sM=[...sR,"+","-","−","–"],sO=(e,t)=>/[a-z0-9]/i.test(t)?e.includes(t):e===t,sA=[".ph-no-rageclick",".ph-no-capture"],sL=["","text","search","email","password","url","tel","number"];function sD(e,t){if(!i||sz(e)||(ei(t)?(s=!!t&&sA,n=void 0,a=!1):(s=null!=(o=null==t?void 0:t.css_selector_ignorelist)?o:sA,n=null==t?void 0:t.content_ignorelist,a=null!=(l=null==t?void 0:t.ignore_text_selection)&&l),!1===s)||a&&!(!(r=e)||!sb(r))&&(sy(r,"textarea")||(sy(r,"input")?H(sL,(r.getAttribute("type")||"").toLowerCase()):function(e){if(e.isContentEditable)return!0;var t=null==e.getAttribute?void 0:e.getAttribute("contenteditable");return"true"===t||""===t}(r))))return!1;var r,s,n,a,o,l,{targetElementList:c}=sH(e,!1);return!function(e,t){var r;if(!1===e||X(e))return!1;if(!0===e)r=sR;else{if(!G(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;r=e.map(e=>e.toLowerCase())}return t.some(e=>{var{safeText:t,ariaLabel:s}=e;return r.some(e=>sO(t,e)||sO(s,e))})}(n,c.map(e=>{var t;return{safeText:sN(e).toLowerCase(),ariaLabel:(null==(t=e.getAttribute("aria-label"))?void 0:t.toLowerCase().trim())||""}}))&&!s$(c,s)}var sz=e=>!e||sy(e,"html")||!sb(e),sH=(e,t)=>{if(!i||sz(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,s=[e],n=e;n.parentNode&&!sy(n,"body");)if(sS(n.parentNode))s.push(n.parentNode.host),n=n.parentNode.host;else{var a=sI(n);if(!a)break;if(t||sF.indexOf(a.tagName.toLowerCase())>-1)r=!0;else{var o=i.getComputedStyle(a);o&&"pointer"===o.getPropertyValue("cursor")&&(r=!0)}s.push(a),n=a}return{parentIsUsefulElement:r,targetElementList:s}};function sq(e){for(var t=e;t.parentNode&&!sy(t,"body");t=t.parentNode){var r=sE(t);if(H(r,"ph-sensitive")||H(r,"ph-no-capture"))return!1}if(H(sE(e),"ph-include"))return!0;var s=e.type||"";if(Q(s))switch(s.toLowerCase()){case"hidden":case"password":return!1}
99var i=e.name||e.id||"";return!Q(i)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(i.replace(/[^a-zA-Z0-9]/g,""))}function sU(e){return!!(sy(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||sy(e,"select")||sy(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var sB="(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})",sW=RegExp("^(?:"+sB+")$"),sV=new RegExp(sB),sG="\\d{3}-?\\d{2}-?\\d{4}",sY=RegExp("^("+sG+")$"),sK=RegExp("("+sG+")");function sJ(e,t){return void 0===t&&(t=!0),!(et(e)||Q(e)&&(e=q(e),(t?sW:sV).test((e||"").replace(/[- ]/g,""))||(t?sY:sK).test(e)))&&!0}function sX(e){var t=sN(e);return sJ(t=(t+" "+function e(t){var r="";return t&&t.childNodes&&t.childNodes.length&&rQ(t.childNodes,function(t){var s;if(t&&"span"===(null==(s=t.tagName)?void 0:s.toLowerCase()))try{var i=sN(t);r=(r+" "+i).trim(),t.childNodes&&t.childNodes.length&&(r=(r+" "+e(t)).trim())}catch(e){tG.error("[AutoCapture]",e)}}),r}(e)).trim())?t:""}function sQ(e){return e.replace(/"|\\"/g,'\\"')}var sZ=tY("[Dead Clicks]"),s0=()=>!0,s1=e=>{var t,r=!(null==(t=e.instance.persistence)||!t.get_property(t8)),s=e.instance.config.capture_dead_clicks;return ei(s)?s:!!K(s)||r};class s3{get lazyLoadedDeadClicksAutocapture(){return this.Et}constructor(e,t,r){this.instance=e,this.isEnabled=t,this.onCapture=r,this.startIfEnabledOrStop()}onRemoteConfig(e){"captureDeadClicks"in e&&(this.instance.persistence&&this.instance.persistence.register({[t8]:e.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.Mt(()=>{this.Pt()}):this.stop()}Mt(e){var t,r;null!=(t=g.__PosthogExtensions__)&&t.initDeadClicksAutocapture?e():null==(r=g.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",t=>{t?sZ.error("failed to load script",t):e()})}Pt(){var e;if(o){if(!this.Et&&null!=(e=g.__PosthogExtensions__)&&e.initDeadClicksAutocapture){var t=K(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this.Et=g.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.Et.start(o),sZ.info("starting...")}}else sZ.error("`document` not found. Cannot start.")}stop(){this.Et&&(this.Et.stop(),this.Et=void 0,sZ.info("stopping..."))}}var s2=tY("[SegmentIntegration]"),s4="posthog-js";function s5(e,t){var{organization:r,projectId:s,prefix:i,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,c,u,d,h,p,g=(null==(l=t.exception)?void 0:l.values)||[],f=g.map(e=>x({},e,{stacktrace:e.stacktrace?x({},e.stacktrace,{type:"raw",frames:(e.stacktrace.frames||[]).map(e=>x({},e,{platform:"web:javascript"}))}):void 0})),v={$exception_message:(null==(c=g[0])?void 0:c.value)||t.message,$exception_type:null==(u=g[0])?void 0:u.type,$exception_level:t.level,$exception_list:f,$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 r&&s&&(v.$sentry_url=(i||"https://sentry.io/organizations/")+r+"/issues/?project="+s+"&query="+t.event_id),a&&(null==(p=e.exceptions)||p.sendExceptionEvent(v)),t}}class s7{constructor(e,t,r,s,i,n){this.name=s4,this.setupOnce=function(a){a(s5(e,{organization:t,projectId:r,prefix:s,severityAllowList:i,sendExceptionsToPostHog:null==n||n}))}}}class s6{constructor(e){this.Rt=(e,t,r)=>{r&&(r.noSessionId||r.activityTimeout||r.sessionPastMaximumLength||r.crossTabAdoption)&&(tG.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:e,changeReason:r}),this.Ot=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.Lt()}Lt(){var e;this.Ft=null==(e=this._instance.sessionManager)?void 0:e.onSessionId(this.Rt)}destroy(){var e;null==(e=this.Ft)||e.call(this),this.Ft=void 0}doPageView(e,t){var r,s=this.At(e,t);return this.Ot={pathname:null!=(r=null==i?void 0:i.location.pathname)?r:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),s}doPageLeave(e){var t;return this.At(e,null==(t=this.Ot)?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:null==(e=this.Ot)?void 0:e.pageViewId}}At(e,t){var r=this.Ot;if(!r)return{$pageview_id:t};var s={$pageview_id:t,$prev_pageview_id:r.pageViewId},i=this._instance.scrollManager.getContext();if(i&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:n,lastScrollY:a,maxScrollY:o,maxContentHeight:l,lastContentY:c,maxContentY:u}=i;if(!(X(n)||X(a)||X(o)||X(l)||X(c)||X(u))){n=Math.ceil(n),a=Math.ceil(a),o=Math.ceil(o),l=Math.ceil(l),c=Math.ceil(c),u=Math.ceil(u);var d=n>1?eh(a/n,0,1,tG):1,h=n>1?eh(o/n,0,1,tG):1,p=l>1?eh(c/l,0,1,tG):1,g=l>1?eh(u/l,0,1,tG):1;s=rZ(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:c,$prev_pageview_last_content_percentage:p,$prev_pageview_max_content:u,$prev_pageview_max_content_percentage:g})}}return r.pathname&&(s.$prev_pageview_pathname=r.pathname),r.timestamp&&(s.$prev_pageview_duration=(e.getTime()-r.timestamp.getTime())/1e3),s}}
99var s8=["flags","surveys"],s9={[tX]:{exposure:"hidden"},[t0]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[t1]:{exposure:"hidden"},[t3]:{exposure:"event"},[t2]:{exposure:"hidden"},[t4]:{exposure:"event"},[t5]:{exposure:"hidden"},[t7]:{exposure:"event"},[t6]:{exposure:"event"},[t8]:{exposure:"event"},[t9]:{exposure:"hidden"},[re]:{exposure:"event"},[rt]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[ro]:{exposure:"hidden"},[rl]:{exposure:"event"},[rr]:{exposure:"event",shouldSkipFromEventProperties:e=>ee(e)},$session_past_minimum_duration:{exposure:"event"},$session_recording_url_trigger_activated_session:{exposure:"event"},$session_recording_event_trigger_activated_session:{exposure:"event"},$debug_first_full_snapshot_timestamp:{exposure:"event"},$sess_rec_flush_size:{exposure:"hidden"},[rc]:{exposure:"derived",storageGroup:"flags",shouldSkipFromEventProperties:(e,t)=>t(),transformToEventProperties(e){if(!K(e))return{};for(var t={},r=Object.keys(e),s=0;r.length>s;s++)t["$feature/"+r[s]]=e[r[s]];return t}},[ru]:{exposure:"event",storageGroup:"flags"},[rd]:{exposure:"hidden"},[rh]:{exposure:"hidden",storageGroup:"flags"},[rp]:{exposure:"event",storageGroup:"flags"},[rg]:{exposure:"event",storageGroup:"flags",volatile:!0},[rf]:{exposure:"event"},[rv]:{exposure:"hidden"},[rm]:{exposure:"hidden"},[r_]:{exposure:"hidden"},[rx]:{exposure:"hidden",storageGroup:"surveys"},[rb]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[ry]:{exposure:"event"},[rw]:{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"},[rS]:{exposure:"hidden"},[rk]:{exposure:"hidden"},[rj]:{exposure:"hidden"},[rE]:{exposure:"hidden",storageGroup:"flags",volatile:!0}
99,[rC]:{exposure:"hidden"},[rN]:{exposure:"hidden"},[rP]:{exposure:"hidden"},[rF]:{exposure:"hidden"},[r$]:{exposure:"hidden"},[rI]:{exposure:"hidden"},[rT]:{exposure:"hidden"},[rs]:{exposure:"event"},[ri]:{exposure:"event"},[rn]:{exposure:"event"},[ra]:{exposure:"event"},[rO]:{exposure:"event"},[rA]:{exposure:"event"},[rL]:{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"}},ie=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],it=e=>{var t=s9[e];if(t)return t;for(var[r,s]of ie)if(0===e.indexOf(r))return s},ir=e=>{var t=null==o?void 0:o.createElement("a");return X(t)?null:(t.href=e,t)},is=function(e,t){for(var r,s=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),i=0;s.length>i;i++){var n=s[i].split("=");if(n[0]===t){r=n;break}}if(!G(r)||2>r.length)return"";var a=r[1];try{a=decodeURIComponent(a)}catch(e){tG.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},ii=function(e,t,r){if(!e||!t||!t.length)return e;for(var s=e.split("#"),i=s[1],n=(s[0]||"").split("?"),a=n[1],o=n[0],l=(a||"").split("&"),c=[],u=0;l.length>u;u++){var d=l[u].split("=");G(d)&&(t.includes(d[0])?c.push(d[0]+"="+r):c.push(l[u]))}var h=o;return null!=a&&(h+="?"+c.join("&")),null!=i&&(h+="#"+i),h},ia=function(e,t){var r=e.match(RegExp(t+"=([^&]*)"));return r?r[1]:null},io="https?://(.*)",il=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],ic=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...il],iu="<masked>",id=["li_fat_id"];function ih(e,t,r){if(!o)return{};var s,i=t?[...il,...r||[]]:[],n=ip(ii(o.URL,i,iu),e);return rZ((s={},rQ(id,function(e){var t=sc.P(e);s[e]=t||null}),s),n)}function ip(e,t){var r=ic.concat(t||[]),s={};return rQ(r,function(t){var r=is(e,t);s[t]=r||null}),s}function ig(e){var t=e?0===e.search(io+"google.([^/?]*)")?"google":0===e.search(io+"bing.com")?"bing":0===e.search(io+"yahoo.com")?"yahoo":0===e.search(io+"duckduckgo.com")?"duckduckgo":null:null,r={};if(!ee(t)){r.$search_engine=t;var s=o?is(o.referrer,"yahoo"!=t?"q":"p"):"";s.length&&(r.ph_keyword=s)}return r}function iv(){return navigator.language||navigator.userLanguage}var im="$direct";function i_(){return(null==o?void 0:o.referrer)||im}function ix(e,t,r){void 0===r&&(r=!1);var s=e?[...il,...t||[]]:[],i=r?tc(null==l?void 0:l.href):null==l?void 0:l.href,n=null==i?void 0:i.substring(0,1e3);return{r:i_().substring(0,1e3),u:n?ii(n,s,iu):void 0}}function ib(e,t){void 0===t&&(t=!1);var r,{r:s,u:i}=e,n=t?tc(i):i,a={$referrer:s,$referring_domain:null==s?void 0:s==im?im:null==(r=ir(s))?void 0:r.host};if(n){a.$current_url=n;var o=ir(n);a.$host=null==o?void 0:o.host,a.$pathname=null==o?void 0:o.pathname,rZ(a,ip(n))}return s&&rZ(a,ig(s)),a}function iy(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}var iw={flags:rE,surveys:rb},iS=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],ik="main";class ij{constructor(e,t,r){if(void 0===r&&(r=!0),this.$t={},this.Dt=!1,this.Nt=!1,this.Se=e,this.qt=r,this.props={},this.jt=!1,this.Bt=(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.Ct=this.Ht(e),this.Nt=this.Ut(e),this.load(),e.debug&&tG.info("Persistence loaded",e.persistence,x({},this.props)),this.update_config(e,e,t),this.save(),i){var s=()=>this.flush();r5(i,"beforeunload",s,{capture:!1}),r5(i,"pagehide",s,{capture:!1})}}zt(){var e,t=null==(e=this.Se)?void 0:e.persistence_save_debounce_ms;return er(t)&&t>0?t:0}isDisabled(){return!!this.Vt}Ht(e){-1===iS.indexOf(e.persistence.toLowerCase())&&(tG.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");
99var t,r,s,n,a=(t=e.cookie_persisted_properties||[],r=e.__preview_cookie_wins_on_conflict||!1,void 0===t&&(t=[]),void 0===r&&(r=!1),s=[...sh,...t],x({},sd,{F(e){try{var t={};try{t=sc.F(e)||{}}catch(e){}var s,i=JSON.parse(sd.P(e)||"{}");if(r){var n={};for(var a in t){var o=t[a];ee(o)||""===o||(n[a]=o)}s=rZ(i,n)}else s=rZ(t,i);return sd.q(e,s),s}catch(e){}return null},q(e,t,r,i,n,a){var o=sd.q(e,t,void 0,void 0,a);try{var l={};s.forEach(e=>{t[e]&&(l[e]=t[e])}),Object.keys(l).length&&sc.q(e,l,r,i,n,a)}catch(e){sd.D(e)}return o},A(e,t){try{null==i||i.localStorage.removeItem(e),sc.A(e,t)}catch(e){sd.D(e)}}})),o=!1,l=e.persistence.toLowerCase();return"localstorage"===l&&sd.N()?(n=sd,o=!0):"localstorage+cookie"===l&&a.N()?(n=a,o=!0):"sessionstorage"===l&&sv.N()?n=sv:"memory"===l?n=sg:"cookie"===l?n=sc:a.N()?(n=a,o=!0):n=sc,this.Dt=o,n}Wt(e){return this.Bt+"__"+e}Ut(e){return this.Dt&&!!e.split_storage}Gt(e){var t=null!=e?e:this.Se.feature_flag_cache_ttl_ms;if(!t||0>=t)return!1;var r=this.props[rE];return!r||"number"!=typeof r||Date.now()-r>t}properties(){var e={};return rQ(this.props,(t,r)=>{var s=it(r);if("derived"===(null==s?void 0:s.exposure)){if(null!=s.shouldSkipFromEventProperties&&s.shouldSkipFromEventProperties(t,r===rc?()=>this.Gt():()=>!1))return;s.transformToEventProperties&&rZ(e,s.transformToEventProperties(t))}else if(!s||"event"===s.exposure){if(null!=s&&null!=s.shouldSkipFromEventProperties&&s.shouldSkipFromEventProperties(t,()=>!1))return;e[r]=t}}),e}load(){if(!this.Vt){var e=this.Ct.F(this.Bt);e&&(this.props=rZ({},e)),this.Nt&&this.Zt()}}Zt(){for(var e of s8){var t=sd.F(this.Wt(e));if(t&&!J(t)){var r=this.Qt(e);r.persisted=!0,this.Jt(e)||(r.fingerprint=this.Yt(t,e)),this.Kt(e,t)||rZ(this.props,t)}}}Jt(e){return Object.keys(this.props).some(t=>{var r;return(null==(r=it(t))?void 0:r.storageGroup)===e})}Kt(e,t){var r=iw[e];if(!r)return!1;var s=t[r],i=this.props[r];return er(s)&&er(i)&&i>s}refreshKey(e){var t;if(!this.Vt){var r=this.Nt?null==(t=it(e))?void 0:t.storageGroup:void 0,s=r?sd.F(this.Wt(r)):this.Ct.F(this.Bt);if(s&&e in s)this.Xt(e,s[e]);else{if(r){var i=this.Ct.F(this.Bt);if(i&&e in i)return void this.Xt(e,i[e])}this.er(e)}}}save(){if(!this.Vt){var e=this.zt();e>0?X(this.tr)&&(this.tr=setTimeout(()=>{this.tr=void 0,this.rr()},e)):this.rr()}}flush(){X(this.tr)||(clearTimeout(this.tr),this.tr=void 0,this.rr())}rr(){this.Vt||(this.Nt?this.ir():this.nr(this.Ct,this.Bt,this.props,ik))}ir(){var{main:e,groups:t}=this.sr();for(var r of(this.nr(this.Ct,this.Bt,e,ik),s8)){var s,i=t[r];(!J(i)||null!=(s=this.$t[r])&&s.persisted)&&this.nr(sd,this.Wt(r),i,r)}}sr(){var e={},t={};for(var r of s8)t[r]={};return rQ(this.props,(r,s)=>{var i,n=null==(i=it(s))?void 0:i.storageGroup;n?t[n][s]=r:e[s]=r}),{main:e,groups:t}}Yt(e,t){if(t===ik)return JSON.stringify(e)+"|"+this.ar+"|"+this.lr+"|"+this.ur;var r={};return rQ(e,(e,t)=>{var s;r[t]=null!=(s=it(t))&&s.volatile?"__volatile__":e}),JSON.stringify(r)}nr(e,t,r,s){var i,n=this.Qt(s);if(s===ik||n.dirty||X(n.fingerprint)){try{if((i=this.Yt(r,s))===n.fingerprint)return void(n.dirty=!1)}catch(e){i=void 0}e.q(t,r,this.ar,this.lr,this.ur,this.Se.debug)?(n.dirty=!1,s!==ik&&(n.persisted=!0),X(i)||(n.fingerprint=i)):this.Se.debug&&tG.warn('failed to persist storage entry "'+t+'"; will retry on next save')}}remove(e){var{keepGroupEntries:t=!1}=void 0===e?{}:e;if(X(this.tr)||(clearTimeout(this.tr),this.tr=void 0),this.Ct.A(this.Bt,!1),this.Ct.A(this.Bt,!0),!t&&this.qt)for(var r of s8)sd.A(this.Wt(r));
99t?delete this.$t[ik]:this.$t={}}clear(){this.remove(),this.props={}}register_once(e,t,r){if(K(e)){X(t)&&(t="None"),this.ar=X(r)?this.hr:r;var s=!1;if(rQ(e,(e,r)=>{this.props.hasOwnProperty(r)&&this.props[r]!==t||(this.Xt(r,e),s=!0)}),s)return this.save(),!0}return!1}register(e,t){if(K(e)){this.ar=X(t)?this.hr:t;var r=!1;if(rQ(e,(t,s)=>{e.hasOwnProperty(s)&&this.props[s]!==t&&(this.Xt(s,t),r=!0)}),r)return this.save(),!0}return!1}unregister(e){e in this.props&&(this.er(e),this.save())}update_campaign_params(){if(!this.jt){var e=ih(this.Se.custom_campaign_params,this.Se.mask_personal_data_properties,this.Se.custom_personal_data_properties);J(r2(e))||this.register(e),this.jt=!0}}update_search_keyword(){var e;this.register((e=null==o?void 0:o.referrer)?ig(e):{})}update_referrer_info(){var e;this.register_once({$referrer:i_(),$referring_domain:null!=o&&o.referrer&&(null==(e=ir(o.referrer))?void 0:e.host)||im},void 0)}set_initial_person_info(){this.props[rF]||this.props[r$]||this.register_once({[rI]:ix(this.Se.mask_personal_data_properties,this.Se.custom_personal_data_properties,this.Se.disable_capture_url_hashes)},void 0)}get_initial_props(){var e,t,r,s={};rQ([r$,rF],e=>{var t=this.props[e];t&&rQ(t,function(e,t){s["$initial_"+U(t)]=e})});var i=this.props[rI];return i&&rZ(s,(void 0===(e=this.Se.disable_capture_url_hashes)&&(e=!1),t=ib(i,e),r={},rQ(t,function(e,t){r["$initial_"+U(t)]=e}),r)),s}safe_merge(e){return rQ(this.props,function(t,r){r in e||(e[r]=t)}),e}update_config(e,t,r){this.hr=this.ar=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!r),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie);var s=e.persistence!==t.persistence||!((e,t)=>{if(e.length!==t.length)return!1;var r=[...e].sort(),s=[...t].sort();return r.every((e,t)=>e===s[t])})(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[]),i=s?this.Ht(e):this.Ct,n=this.Ut(e);if(s||n!==this.Nt){var a=this.props;this.clear(),this.Ct=i,this.Nt=n,this.props=a,this.save()}}set_disabled(e){this.Vt=e,this.Vt?this.remove():this.save()}set_cross_subdomain(e){e!==this.lr&&(this.lr=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this.ur&&(this.ur=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,t){var r=this.props[t1]||{};r[e]=t,this.Xt(t1,r),this.save()}remove_event_timer(e){var t=this.props[t1]||{},r=t[e];return X(r)||(delete t[e],this.Xt(t1,t),this.save()),r}get_property(e){return this.props[e]}set_property(e,t){this.Xt(e,t),this.save()}Xt(e,t){var r;this.props[e]=t,null!=(r=it(e))&&r.volatile||this.dr(e)}er(e){delete this.props[e],this.dr(e)}dr(e){var t,r=null==(t=it(e))?void 0:t.storageGroup;r&&(this.Qt(r).dirty=!0)}Qt(e){return this.$t[e]||(this.$t[e]={})}}var iE="events",iC="cancelEvents",iN="survey shown",iP="survey dismissed",iF="survey sent",i$="popover",iI=tY("[RateLimiter]");class iT{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=>{iI.info((e||"events")+" is quota limited."),this.serverLimits[e]=(new Date).getTime()+6e4})}catch(e){return void iI.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,r,s,{captureEventsBurstLimit:i,captureEventsPerSecond:n}=this,a=(new Date).getTime(),o=null!=(t=null==(r=this.instance.persistence)?void 0:r.get_property(rP))?t:{tokens:i,last:a};o.tokens+=(a-o.last)/1e3*n,o.last=a,o.tokens>i&&(o.tokens=i);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 "+i+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=l,null==(s=this.instance.persistence)||s.set_property(rP,o),{isRateLimited:l,remainingTokens:o.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}var iR=tY("[RemoteConfig]");class iM{constructor(e){this._instance=e}get remoteConfig(){var e;return null==(e=g._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}cr(e){var t,r;null!=(t=g.__PosthogExtensions__)&&t.loadExternalDependency?null==(r=g.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"remote-config",()=>e(this.remoteConfig)):e()}vr(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 iR.info("Using preloaded remote config",this.remoteConfig),this.pr(this.remoteConfig),void this.gr();if(this._instance.mr())return void iR.warn("Remote config is disabled. Falling back to local config.");this.cr(e=>{e?(this.pr(e),this.gr()):(iR.info("No config found after loading remote JS config. Falling back to JSON."),this.vr(e=>{this.pr(e),this.gr()}))})}catch(e){iR.error("Error loading remote config",e)}}stop(){this.yr&&(clearInterval(this.yr),this.yr=void 0)}
vendor: 4,495 bytes, line 99
99refresh(){!this._instance.mr()&&o&&"hidden"!==o.visibilityState&&this._instance.reloadFeatureFlags()}gr(){var e;if(!this.yr){var t=null!=(e=this._instance.config.remote_config_refresh_interval_ms)?e:3e5;0!==t&&(this.yr=setInterval(()=>{this.refresh()},t))}}pr(e){var t;e||iR.error("Failed to fetch remote config from PostHog."),this._instance.pr(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 iO="gzip-js",iA="base64",iL=Uint8Array,iD=Uint16Array,iz=Uint32Array,iH=new iL([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]),iq=new iL([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]),iU=new iL([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),iB=function(e,t){for(var r=new iD(31),s=0;31>s;++s)r[s]=t+=1<<e[s-1];var i=new iz(r[30]);for(s=1;30>s;++s)for(var n=r[s];r[s+1]>n;++n)i[n]=n-r[s]<<5|s;return[r,i]},iW=iB(iH,2),iV=iW[1];iW[0][28]=258,iV[258]=28;for(var iG=iB(iq,0)[1],iY=new iD(32768),iK=0;32768>iK;++iK){var iJ=(43690&iK)>>>1|(21845&iK)<<1;iY[iK]=((65280&(iJ=(61680&(iJ=(52428&iJ)>>>2|(13107&iJ)<<2))>>>4|(3855&iJ)<<4))>>>8|(255&iJ)<<8)>>>1}var iX=function(e,t,r){for(var s=e.length,i=0,n=new iD(t);s>i;++i)++n[e[i]-1];var a,o=new iD(t);for(i=0;t>i;++i)o[i]=o[i-1]+n[i-1]<<1;if(r){a=new iD(1<<t);var l=15-t;for(i=0;s>i;++i)if(e[i])for(var c=i<<4|e[i],u=t-e[i],d=o[e[i]-1]++<<u,h=d|(1<<u)-1;h>=d;++d)a[iY[d]>>>l]=c}else for(a=new iD(s),i=0;s>i;++i)a[i]=iY[o[e[i]-1]++]>>>15-e[i];return a},iQ=new iL(288);for(iK=0;144>iK;++iK)iQ[iK]=8;for(iK=144;256>iK;++iK)iQ[iK]=9;for(iK=256;280>iK;++iK)iQ[iK]=7;for(iK=280;288>iK;++iK)iQ[iK]=8;var iZ=new iL(32);for(iK=0;32>iK;++iK)iZ[iK]=5;var i0=iX(iQ,9,0),i1=iX(iZ,5,0),i3=function(e){return(e/8|0)+(7&e&&1)},i2=function(e,t,r){(null==r||r>e.length)&&(r=e.length);var s=new(e instanceof iD?iD:e instanceof iz?iz:iL)(r-t);return s.set(e.subarray(t,r)),s},i4=function(e,t,r){var s=t/8|0;e[s]|=r<<=7&t,e[s+1]|=r>>>8},i5=function(e,t,r){var s=t/8|0;e[s]|=r<<=7&t,e[s+1]|=r>>>8,e[s+2]|=r>>>16},i7=function(e,t){for(var r=[],s=0;e.length>s;++s)e[s]&&r.push({s:s,f:e[s]});var i=r.length,n=r.slice();if(!i)return[new iL(0),0];if(1==i){var a=new iL(r[0].s+1);return a[r[0].s]=1,[a,1]}r.sort(function(e,t){return e.f-t.f}),r.push({s:-1,f:25001});var o=r[0],l=r[1],c=0,u=1,d=2;for(r[0]={s:-1,f:o.f+l.f,l:o,r:l};u!=i-1;)o=r[r[d].f>r[c].f?c++:d++],l=r[c!=u&&r[d].f>r[c].f?c++:d++],r[u++]={s:-1,f:o.f+l.f,l:o,r:l};var h=n[0].s;for(s=1;i>s;++s)n[s].s>h&&(h=n[s].s);var p=new iD(h+1),g=i6(r[u-1],p,0);if(g>t){s=0;var f=0,v=g-t,m=1<<v;for(n.sort(function(e,t){return p[t.s]-p[e.s]||e.f-t.f});i>s;++s){var _=n[s].s;if(t>=p[_])break;f+=m-(1<<g-p[_]),p[_]=t}for(f>>>=v;f>0;){var x=n[s].s;t>p[x]?f-=1<<t-p[x]++-1:++s}for(;s>=0&&f;--s){var b=n[s].s;p[b]==t&&(--p[b],++f)}g=t}return[new iL(p),g]},i6=function(e,t,r){return -1==e.s?Math.max(i6(e.l,t,r+1),i6(e.r,t,r+1)):t[e.s]=r},i8=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new iD(++t),s=0,i=e[0],n=1,a=function(e){r[s++]=e},o=1;t>=o;++o)if(e[o]==i&&o!=t)++n;else{if(!i&&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(i),--n;n>6;n-=6)a(8304);n>2&&(a(n-3<<5|8208),n=0)}for(;n--;)a(i);n=1,i=e[o]}return[r.subarray(0,s),t]},i9=function(e,t){for(var r=0,s=0;t.length>s;++s)r+=e[s]*t[s];return r},ne=function(e,t,r){var s=r.length,i=i3(t+2);e[i]=255&s,e[i+1]=s>>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var n=0;s>n;++n)e[i+n+4]=r[n];return 8*(i+4+s)},nt=function(e,t,r,s,i,n,a,o,l,c,u){i4(t,u++,r),++i[256];for(var d=i7(i,15),h=d[0],p=d[1],g=i7(n,15),f=g[0],v=g[1],m=i8(h),_=m[0],x=m[1],b=i8(f),y=b[0],w=b[1],S=new iD(19),k=0;_.length>k;++k)S[31&_[k]]++;for(k=0;y.length>k;++k)S[31&y[k]]++;for(var j=i7(S,7),E=j[0],C=j[1],N=19;N>4&&!E[iU[N-1]];--N);var P,F,$,I,T=c+5<<3,R=i9(i,iQ)+i9(n,iZ)+a,M=i9(i,h)+i9(n,f)+a+14+3*N+i9(S,E)+(2*S[16]+3*S[17]+7*S[18]);if(R>=T&&M>=T)return ne(t,u,e.subarray(l,l+c));if(i4(t,u,1+(R>M)),u+=2,R>M){P=iX(h,p,0),F=h,$=iX(f,v,0),I=f;var O=iX(E,C,0);for(i4(t,u,x-257),i4(t,u+5,w-1),i4(t,u+10,N-4),u+=14,k=0;N>k;++k)i4(t,u+3*k,E[iU[k]]);u+=3*N;for(var A=[_,y],L=0;2>L;++L){var D=A[L];for(k=0;D.length>k;++k)i4(t,u,O[z=31&D[k]]),u+=E[z],z>15&&(i4(t,u,D[k]>>>5&127),u+=D[k]>>>12)}}else P=i0,F=iQ,$=i1,I=iZ;for(k=0;o>k;++k)if(s[k]>255){i5(t,u,P[257+(z=s[k]>>>18&31)]),u+=F[z+257],z>7&&(i4(t,u,s[k]>>>23&31),u+=iH[z]);var z,H=31&s[k];i5(t,u,$[H]),u+=I[H],H>
993&&(i5(t,u,s[k]>>>5&8191),u+=iq[H])}else i5(t,u,P[s[k]]),u+=F[s[k]];return i5(t,u,P[256]),u+F[256]},nr=new iz([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),ns=function(){for(var e=new iz(256),t=0;256>t;++t){for(var r=t,s=9;--s;)r=(1&r&&0xedb88320)^r>>>1;e[t]=r}return e}(),ni=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8},nn=!!u||!!c,na="text/plain",no=!1,nl=function(e,t,r){void 0===r&&(r=!0);var s,i,n,a,o,[l,c]=e.split("?"),u=x({},t),d=null!=(o=null==c?void 0:c.split("&").map(e=>{var t,[s,i]=e.split("="),n=r&&null!=(t=u[s])?t:i;return delete u[s],s+"="+n}))?o:[],h=(void 0===s&&(s="&"),a=[],rQ(u,function(e,t){X(e)||X(t)||"undefined"===t||(i=encodeURIComponent(e instanceof File?e.name:e.toString()),n=encodeURIComponent(t),a[a.length]=n+"="+i)}),a.join(s));return h&&d.push(h),l+"?"+d.join("&")},nc=(e,t)=>JSON.stringify(e,(e,t)=>"bigint"==typeof t?t.toString():t,t),nu=e=>{if(e.xt)return e.xt;var{data:t,compression:r}=e;if(t){if(r===iO){var s,i,n,a,o,l,c,u,d=(s=function(e){var t=e.length;if("u">typeof TextEncoder)return(new TextEncoder).encode(e);for(var r=new iL(e.length+(e.length>>>1)),s=0,i=function(e){r[s++]=e},n=0;t>n;++n){if(s+5>r.length){var a=new iL(s+8+(t-n<<1));a.set(r),r=a}var o=e.charCodeAt(n);128>o?i(o):(2048>o?i(192|o>>>6):(o>55295&&57344>o?(i(240|(o=65536+(1047552&o)|1023&e.charCodeAt(++n))>>>18),i(128|o>>>12&63)):i(224|o>>>12),i(128|o>>>6&63)),i(128|63&o))}return i2(r,0,s)}(nc(t)),i={mtime:0},n=0xffffffff,a={p(e){for(var t=n,r=0;e.length>r;++r)t=ns[255&t^e[r]]^t>>>8;n=t},d:()=>0xffffffff^n},o=s.length,a.p(s),u=(l=10+(i.filename&&i.filename.length+1||0),c=function(e,t,r,s){var i=e.length,n=new iL(s+i+5*(1+Math.floor(i/7e3))+8),a=n.subarray(s,n.length-8),o=0;if(!t||8>i)for(var l=0;i>=l;l+=65535){var c=l+65535;i>c?o=ne(a,o,e.subarray(l,c)):(a[l]=!0,o=ne(a,o,e.subarray(l,i)))}else{for(var u=nr[t-1],d=u>>>13,h=8191&u,p=(1<<r)-1,g=new iD(32768),f=new iD(p+1),v=Math.ceil(r/3),m=2*v,_=function(t){return(e[t]^e[t+1]<<v^e[t+2]<<m)&p},x=new iz(25e3),b=new iD(288),y=new iD(32),w=0,S=0,k=(l=0,0),j=0,E=0;i>l;++l){var C=_(l),N=32767&l,P=f[C];if(g[N]=P,f[C]=N,l>=j){var F=i-l;if((w>7e3||k>24576)&&F>423){o=nt(e,a,0,x,b,y,S,k,E,l-E,o),k=w=S=0,E=l;for(var $=0;286>$;++$)b[$]=0;for($=0;30>$;++$)y[$]=0}var I=2,T=0,R=h,M=N-P&32767;if(F>2&&C==_(l-M))for(var O=Math.min(d,F)-1,A=Math.min(32767,l),L=Math.min(258,F);A>=M&&--R&&N!=P;){if(e[l+I]==e[l+I-M]){for(var D=0;L>D&&e[l+D]==e[l+D-M];++D);if(D>I){if(I=D,T=M,D>O)break;var z=Math.min(M,D-2),H=0;for($=0;z>$;++$){var q=l-M+$+32768&32767,U=q-g[q]+32768&32767;U>H&&(H=U,P=q)}}}M+=(N=P)-(P=g[N])+32768&32767}if(T){x[k++]=0x10000000|iV[I]<<18|iG[T];var B=31&iV[I],W=31&iG[T];S+=iH[B]+iq[W],++b[257+B],++y[W],j=l+I,++w}else x[k++]=e[l],++b[e[l]]}}o=nt(e,a,!0,x,b,y,S,k,E,l-E,o)}return i2(n,0,s+i3(o)+8)}(s,null==i.level?6:i.level,null==i.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(s.length)))):12+i.mem,l)).length,function(e,t){var r=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&&ni(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),r){e[3]=8;for(var s=0;r.length>=s;++s)e[s+10]=r.charCodeAt(s)}}(c,i),ni(c,u-8,a.d()),ni(c,u-4,o),c);return{contentType:na,body:d.buffer.slice(d.byteOffset,d.byteOffset+d.byteLength),estimatedSize:d.byteLength}}if(r===iA){let e;var h,p="data="+encodeURIComponent("string"==typeof(e=(h=nc(t))?btoa(encodeURIComponent(h).replace(/%([0-9A-F]{2})/g,(e,t)=>String.fromCharCode(parseInt(t,16)))):h)?e:nc(e));return{contentType:"application/x-www-form-urlencoded",body:p,estimatedSize:new Blob([p]).size}}var g=nc(t);return{contentType:"application/json",body:g,estimatedSize:new Blob([g]).size}}},nd=e=>{var t,r,s=()=>({url:((e,t)=>{var[r,s]=e.split("#"),[i,n]=r.split("?");if(!n)return e;var a=n.split("&").filter(e=>e.split("=")[0]!==t).join("&");return i+(a?"?"+a:"")+(s?"#"+s:"")})(e.url,"compression"),encodedBody:nu(x({},e,{compression:void 0,xt:void 0}))});try{t=nu(e)}catch(t){if(R(e.compression,is(e.url,"compression")))return tG.error("Failed to gzip request body, sending uncompressed payload",t),s();throw t}return!(t&&R(e.compression,is(e.url,"compression")))||((r=t.body)instanceof ArrayBuffer?T(new Uint8Array(r)):ArrayBuffer.isView(r)&&T(new Uint8Array(r.buffer,r.byteOffset,r.byteLength)))?{url:e.url,encodedBody:t}:(no=!0,s())},nh=e=>{try{return nd(e)}catch(t){return tG.error(t),void(null==e.callback||e.callback({statusCode:0,error:t}))}},np=(nU=_(function*(e){var t=nc(e.data),r=yield function(e,t,r){return L.apply(this,arguments)}(t,v.DEBUG,{rethrow:!0});if(!r)return e;var s=yield r.arrayBuffer();return x({},e,{xt:{contentType:na,body:s,estimatedSize:s.byteLength}})}),function(e){return nU.apply(this,arguments)}),ng=(e,t)=>
99nl(e,{_:(new Date).getTime().toString(),ver:v.JS_SDK_VERSION,compression:t}),nf=[];c&&nf.push({transport:"fetch",method(e){var t,r=nh(e);if(r){var{url:s,encodedBody:i}=r,{contentType:n,body:a,estimatedSize:o}=null!=i?i:{},l=new Headers;rQ(e.headers,function(e,t){l.append(t,e)}),n&&l.append("Content-Type",n);var u=null,h=null;if(d){var p=new d;u={signal:p.signal,timeout:setTimeout(()=>{var t,r;(r=Error("PostHog request timed out"+((t=e.timeout)?" after "+t+"ms":""))).name="AbortError",p.abort(h=r)},e.timeout)}}c(s,x({method:(null==e?void 0:e.method)||"GET",headers:l,keepalive:"POST"===e.method&&52428.8>(o||0),body:a,signal:null==(t=u)?void 0:t.signal},e.fetchOptions)).then(t=>t.text().then(r=>{var s={statusCode:t.status,text:r};if(200===t.status)try{s.json=JSON.parse(r)}catch(e){tG.error(e)}null==e.callback||e.callback(s)})).catch(t=>{t===h?tG.warn(t):tG.error(t),null==e.callback||e.callback({statusCode:0,error:t})}).finally(()=>u?clearTimeout(u.timeout):null)}}}),u&&nf.push({transport:"XHR",method(e){var t=nh(e);if(t){var r=new u,{url:s,encodedBody:i}=t;r.open(e.method||"GET",s,!0);var{contentType:n,body:a}=null!=i?i:{};rQ(e.headers,function(e,t){r.setRequestHeader(t,e)}),n&&r.setRequestHeader("Content-Type",n),e.timeout&&(r.timeout=e.timeout),r.onreadystatechange=()=>{if(4===r.readyState){var t={statusCode:r.status,text:r.responseText};if(200===r.status)try{t.json=JSON.parse(r.responseText)}catch(e){}null==e.callback||e.callback(t)}},r.send(a)}}}),null!=a&&a.sendBeacon&&nf.push({transport:"sendBeacon",method(e){try{var{url:t,encodedBody:r}=nd(e),{contentType:s,body:i}=null!=r?r:{};if(!i)return;var n=i instanceof Blob?i:new Blob([i],{type:s});a.sendBeacon(t,n)}catch(e){}}});
99class nv{constructor(e,t){this.br=!0,this._r=[],this.wr=eh((null==t?void 0:t.flush_interval_ms)||3e3,250,5e3,tG.createLogger("flush interval"),3e3),this.kr=e}enqueue(e){this._r.push(e),this.Sr||this.Cr()}unload(){this.Ir();var e=Object.values(this._r.length>0?this.Tr():{});[...e.filter(e=>0===e.url.indexOf("/e")),...e.filter(e=>0!==e.url.indexOf("/e"))].map(e=>{this.Er(x({},e,{transport:"sendBeacon"}))})}enable(){this.br=!1,this.Cr()}Cr(){var e=this;this.br||(this.Sr=setTimeout(()=>{if(this.Ir(),this._r.length>0){var t=this.Tr();for(var r in t)!function(){var s=t[r],i=(new Date).getTime();s.data&&G(s.data)&&rQ(s.data,e=>{e.offset=Math.abs(e.timestamp-i),delete e.timestamp}),e.Er(s)}()}},this.wr))}Er(e){try{this.kr(e)}catch(e){tG.error(e)}}Ir(){clearTimeout(this.Sr),this.Sr=void 0}Tr(){var e={};return rQ(this._r,t=>{var r,s=(t?t.batchKey:null)||t.url;X(e[s])&&(e[s]=x({},t,{data:[]})),null==(r=e[s].data)||r.push(t.data)}),this._r=[],e}}var nm=["retriesPerformedSoFar"];class n_{constructor(e){this.Mr=!1,this.Pr=3e3,this._r=[],this._instance=e,this._r=[],this.Rr=!0,!X(i)&&"onLine"in i.navigator&&(this.Rr=i.navigator.onLine,this.Or=()=>{this.Rr=!0,this.Lr()},this.Fr=()=>{this.Rr=!1},r5(i,"online",this.Or),r5(i,"offline",this.Fr))}get length(){return this._r.length}retriableRequest(e){var{retriesPerformedSoFar:t}=e,r=b(e,nm);es(t)&&(r.url=nl(r.url,{retry_count:t})),this._instance._send_request(x({},r,{callback:e=>{if(200!==e.statusCode&&(400>e.statusCode||e.statusCode>=500)){if((0===e.statusCode?3:10)>(null!=t?t:0))return void this.st(x({retriesPerformedSoFar:t},r));0===e.statusCode&&tG.warn("Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after "+(null!=t?t:0)+" retries.")}null==r.callback||r.callback(e)}}))}st(e){var t,r,s=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=s+1;var i=Math.ceil((r=Math.min(18e5,t=3e3*Math.pow(2,s)))+(Math.random()-.5)*(r-t/2)),n=Date.now()+i;this._r.push({retryAt:n,requestOptions:e});var a="Enqueued failed request for retry in "+i;navigator.onLine||(a+=" (Browser is offline)"),tG.warn(a),this.Mr||(this.Mr=!0,this.Ar())}Ar(){(this.$r&&clearTimeout(this.$r),0===this._r.length)?(this.Mr=!1,this.$r=void 0):this.$r=setTimeout(()=>{this.Rr&&this._r.length>0&&this.Lr(),this.Ar()},this.Pr)}Lr(){var e=Date.now(),t=[],r=this._r.filter(r=>e>r.retryAt||(t.push(r),!1));if(this._r=t,r.length>0)for(var{requestOptions:s}of r)this.retriableRequest(s)}unload(){for(var{requestOptions:e}of(this.$r&&(clearTimeout(this.$r),this.$r=void 0),this.Mr=!1,X(i)||(this.Or&&(i.removeEventListener("online",this.Or),this.Or=void 0),this.Fr&&(i.removeEventListener("offline",this.Fr),this.Fr=void 0)),this._r))try{this._instance._send_request(x({},e,{transport:"sendBeacon"}))}catch(e){tG.error(e)}this._r=[]}}class nx{constructor(e){this.Dr=()=>{this.Nr||(this.Nr={});var e,t,r,s,i=this.scrollElement(),n=this.scrollY(),a=i?Math.max(0,i.scrollHeight-i.clientHeight):0,o=n+((null==i?void 0:i.clientHeight)||0),l=(null==i?void 0:i.scrollHeight)||0;this.Nr.lastScrollY=Math.ceil(n),this.Nr.maxScrollY=Math.max(n,null!=(e=this.Nr.maxScrollY)?e:0),this.Nr.maxScrollHeight=Math.max(a,null!=(t=this.Nr.maxScrollHeight)?t:0),this.Nr.lastContentY=o,this.Nr.maxContentY=Math.max(o,null!=(r=this.Nr.maxContentY)?r:0),this.Nr.maxContentHeight=Math.max(l,null!=(s=this.Nr.maxContentHeight)?s:0)},this._instance=e}get qr(){return this._instance.config.scroll_root_selector}getContext(){return this.Nr}resetContext(){var e=this.Nr;return setTimeout(this.Dr,0),e}startMeasuringScrollPosition(){r5(i,"scroll",this.Dr,{capture:!0}),r5(i,"scrollend",this.Dr,{capture:!0}),r5(i,"resize",this.Dr)}scrollElement(){if(!this.qr)return null==i?void 0:i.document.documentElement;for(var e of G(this.qr)?this.qr:[this.qr]){var t=null==i?void 0:i.document.querySelector(e);if(t)return t}}jr(e){if(this.qr){var t=this.scrollElement();return t&&t["y"===e?"scrollTop":"scrollLeft"]||0}return i?"y"===e?i.scrollY||i.pageYOffset||i.document.documentElement.scrollTop||0:i.scrollX||i.pageXOffset||i.document.documentElement.scrollLeft||0:0}scrollY(){return this.jr("y")}scrollX(){return this.jr("x")}}var nb=e=>ix(null==e?void 0:e.config.mask_personal_data_properties,null==e?void 0:e.config.custom_personal_data_properties,null==e?void 0:e.config.disable_capture_url_hashes
99);class ny{constructor(e,t,r,s){this.Br=e=>{var t=this.Hr();if(!t||t.sessionId!==e){var r={sessionId:e,props:this.Ur(this._instance)};this.zr.register({[rN]:r})}},this._instance=e,this.Vr=t,this.zr=r,this.Ur=s||nb,this.Vr.onSessionId(this.Br)}Hr(){return this.zr.props[rN]}getSetOnceProps(){var e,t=null==(e=this.Hr())?void 0:e.props;return t?"r"in t?ib(t,this._instance.config.disable_capture_url_hashes):{$referring_domain:t.referringDomain,$pathname:t.initialPathName,utm_source:t.utm_source,utm_campaign:t.utm_campaign,utm_medium:t.utm_medium,utm_content:t.utm_content,utm_term:t.utm_term}:{}}getSessionProps(){var e={};return rQ(r2(this.getSetOnceProps()),(t,r)=>{"$current_url"===r&&(r="url"),e["$session_entry_"+U(r)]=t}),e}}class nw{constructor(){this.Wr={}}on(e,t){return this.Wr[e]||(this.Wr[e]=[]),this.Wr[e].push(t),()=>{this.Wr[e]=this.Wr[e].filter(e=>e!==t)}}emit(e,t){for(var r of this.Wr[e]||[])r(t);for(var s of this.Wr["*"]||[])s(e,t)}}var nS=tY("[SessionId]");class nk{on(e,t){return this.Gr.on(e,t)}constructor(e,t,r){if(this.Zr=null,this.Qr=[],this.Jr=void 0,this.Yr=!1,this.Gr=new nw,this.Kr=(e,t)=>
99!(!es(e)||!es(t))&&Math.abs(e-t)>this.sessionTimeoutMs,!e.persistence)throw Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode===rH)throw Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Se=e.config,this.zr=e.persistence,this.Xr=void 0,this.ei=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.ti=t||sn,this.ri=r||sn;var s,i=this.Se.persistence_name||this.Se.token;if(this._sessionTimeoutMs=1e3*eh(this.Se.session_idle_timeout_seconds||1800,60,36e3,nS.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.ii(),this.ni="ph_"+i+"_window_id",this.si="ph_"+i+"_primary_window_exists",this.oi()){var n=sv.F(this.ni),a=sv.F(this.si);n&&!a?this.Xr=n:sv.A(this.ni),sv.q(this.si,!0)}if(null!=(s=this.Se.bootstrap)&&s.sessionID)try{var o=(e=>{var t=this.Se.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.ai(this.Se.bootstrap.sessionID,(new Date).getTime(),o)}catch(e){nS.error("Invalid sessionID in bootstrap",e)}this.li()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return X(this.Qr)&&(this.Qr=[]),this.Qr.push(e),this.ei&&e(this.ei,this.Xr),()=>{this.Qr=this.Qr.filter(t=>t!==e)}}oi(){return"memory"!==this.Se.persistence&&!this.zr.Vt&&sv.N()}ui(e){e!==this.Xr&&(this.Xr=e,this.oi()&&sv.q(this.ni,e))}hi(){return this.Xr?this.Xr:this.oi()?sv.F(this.ni):null}di(e){var t=this.Zr;return!ee(t)&&!ee(e)&&5e3>Math.abs(e-t)}ai(e,t,r){var s=t!==this._sessionActivityTimestamp,i=e===this.ei&&r===this._sessionStartTimestamp;this._sessionStartTimestamp=r,this._sessionActivityTimestamp=t,this.ei=e,i&&!s||i&&this.di(t)||(this.Zr=t,this.zr.register({[ro]:[t,e,r]}))}ci(){var e,t=null==(e=this.Se)?void 0:e.persistence_save_debounce_ms;return es(t)&&t>0}vi(){this.ci()?this.zr.refreshKey(ro):(this.zr.flush(),this.zr.load())}fi(){var e;if(!ee(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.Zr){this.vi();var[,t,r]=this.pi();t===this.ei&&r===this._sessionStartTimestamp&&(this.Zr=this._sessionActivityTimestamp,this.zr.register({[ro]:[this._sessionActivityTimestamp,null!=(e=this.ei)?e:null,this._sessionStartTimestamp]}),this.zr.flush())}}gi(){var[e]=this.pi();return Math.max(es(e)?e:0,es(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0)}mi(e){return this.vi(),this.Kr(e,this.gi())}pi(){var e=this.zr.props[ro];return G(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Zr=null,clearTimeout(this.yi),this.yi=void 0,this.ai(null,null,null)}destroy(){this.Yr=!0,this.fi(),clearTimeout(this.yi),this.yi=void 0,this.Jr&&i&&(i.removeEventListener(rV,this.Jr,{capture:!1}),this.Jr=void 0),this.Qr=[]}li(){this.Jr=()=>{this.fi(),this.oi()&&sv.A(this.si)},r5(i,rV,this.Jr,{capture:!1})}checkAndGetSessionAndWindowId(e,t){if(void 0===e&&(e=!1),void 0===t&&(t=null),this.Se.cookieless_mode===rH)throw Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=t||(new Date).getTime(),[,s,i]=this.pi(),n=this.gi(),a=this.hi(),o=es(i)&&Math.abs(r-i)>864e5,l=!1,c=!1,u=!s,d=s,h=!u&&!e&&this.Kr(r,n);h&&((h=this.mi(r))||nS.info("cross-tab refresh kept the session alive",{sessionId:s}),[,s,i]=this.pi()),u||h||o?(s=this.ti(),a=this.ri(),nS.info("new session ID generated",{sessionId:s,windowId:a,changeReason:{noSessionId:u,activityTimeout:h,sessionPastMaximumLength:o}}),i=r,l=!0):(a||(a=this.ri(),l=!0),(c=s!==d)&&(nS.info("adopted cross-tab session id",{sessionId:s,windowId:a}),l=!0));var p=es(n)&&e&&!o?n:r,g=es(i)?i:(new Date).getTime();this.ui(a),this.ai(s,p,g),e||this.ii();var f={noSessionId:u,activityTimeout:h,sessionPastMaximumLength:o,crossTabAdoption:c};return l&&this.Qr.forEach(e=>e(s,a,f)),{sessionId:s,windowId:a,sessionStartTimestamp:g,changeReason:l?f:void 0,lastActivityTimestamp:n}}ii(){this.Yr||(clearTimeout(this.yi),this.yi=setTimeout(()=>{if(!this.Yr)if(this.mi((new Date).getTime())){var e=this.ei;this.resetSessionId(),this.Gr.emit("forcedIdleReset",{idleSessionId:e})}else this.ii()},1.1*this.sessionTimeoutMs))}}var nj=function(e,t){if(!e)return!1;var r=e.userAgent;if(r&&z(r,t))return!0;try{var s=null==e?void 0:e.userAgentData;if(null!=s&&s.brands&&s.brands.some(e=>z(null==e?void 0:e.brand,t)))return!0}catch(e){}return!!e.webdriver};function nE(){return(nE=_(function*(){var e=null==a?void 0:a.userAgentData;if(null!=e&&e.getHighEntropyValues)try{var t=yield e.getHighEntropyValues(["model"]),r=null==t?void 0:t.model;return Q(r)&&r.length>0?r:void 0}catch(e){return void tG.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",e)}})).apply(this,arguments)}var nC=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 nN(e,t,r){return nc({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:r})}var nP={exact:(e,t)=>
99t.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=>nC(t,e))),not_regex:(e,t)=>t.every(t=>e.every(e=>!nC(t,e))),icontains:(e,t)=>t.map(nF).some(t=>e.map(nF).some(e=>t.includes(e))),not_icontains:(e,t)=>t.map(nF).every(t=>e.map(nF).every(e=>!t.includes(e))),gt:(e,t)=>t.some(t=>{var r=parseFloat(t);return!isNaN(r)&&e.some(e=>r>parseFloat(e))}),lt:(e,t)=>t.some(t=>{var r=parseFloat(t);return!isNaN(r)&&e.some(e=>r<parseFloat(e))})},nF=e=>e.toLowerCase();function n$(e,t){return!e||Object.entries(e).every(e=>{var[r,s]=e,i=null==t?void 0:t[r];if(X(i)||ee(i))return!1;var n=[String(i)],a=nP[s.operator];return!!a&&a(s.values,n)})}var nI="custom",nT="i.posthog.com",nR=/^\/static\//;class nM{constructor(e){this.bi={},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("."+nT,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this.bi[this.apiHost]||(this.bi[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":nI),this.bi[this.apiHost]}wi(e){if(nR.test(e)){var t=this.instance.config.asset_host;if("string"==typeof t)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 r=this.wi(t);if(r)return""+r+t}if(this.region===nI)return this.apiHost+t;var s=nT+t;switch(e){case"assets":return"https://"+this.region+"-assets."+s;case"api":return"https://"+this.region+"."+s}}}var nO=tY("[Surveys]"),nA="seenSurvey_",nL=["popover","widget","api"],nD={ignoreConditions:!1,ignoreDelay:!1,displayType:i$},nz=tY("[PostHog ExternalIntegrations]"),nH={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class nq{constructor(e){this._instance=e}Mt(e,t){var r;null==(r=g.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,e,e=>{if(e)return nz.error("failed to load script",e);t()})}startIfEnabledOrStop(){var e,t=this,r=function(e){var r,s,n;!i||null!=(r=g.__PosthogExtensions__)&&null!=(r=r.integrations)&&r[e]||t.Mt(nH[e],()=>{var r;null==(r=g.__PosthogExtensions__)||null==(r=r.integrations)||null==(r=r[e])||r.start(t._instance)}),!i&&null!=(s=g.__PosthogExtensions__)&&null!=(s=s.integrations)&&s[e]&&(null==(n=g.__PosthogExtensions__)||null==(n=n.integrations)||null==(n=n[e])||n.stop())};for(var[s,i]of Object.entries(null!=(e=this._instance.config.integrations)?e:{}))r(s)}}var nU,nB,nW={},nV=0,nG=()=>{},nY='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',nK="Surveys module not available",nJ="sanitize_properties is deprecated. Use before_send instead",nX="Invalid value for property_denylist config: ",nQ="posthog",nZ=!nn&&-1===(null==p?void 0:p.indexOf("MSIE"))&&-1===(null==p?void 0:p.indexOf("Mozilla")),n0=e=>{var t;return x({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:function(e){var t=null==e?void 0:e.hostname;if(!Q(t))return!1;var r=t.split(".").slice(-2).join(".");for(var s of r4)if(r===s)return!1;return!0}(null==o?void 0:o.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:nG,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=e?e:"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:l&&Q(null==l?void 0:l.search)&&-1!==l.search.indexOf("__posthog_debug=true")||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,disable_external_dependency_loading:!1,strict_script_versioning:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==i||null==(t=i.location)?void 0:t.protocol),ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error(e){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:rB,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:nG},{rageclick:e&&e>="2026-05-30"?{content_ignorelist:sM,ignore_text_selection:!0}
99:!e||"2025-11-30">e||{content_ignorelist:!0},capture_pageview:!e||"2025-05-24">e||"history_change",session_recording:e&&e>="2026-06-25"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6},streamNetworkBody:!0}:e&&e>="2026-05-30"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6}}:e&&e>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:e&&e>="2026-01-30"?"head":"body",internal_or_test_user_hostname:e&&e>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:e&&e>="2026-05-30"?250:0,split_storage:!(!e||"2026-05-30">e),detect_google_search_app:!(!e||"2026-05-30">e),disable_capture_url_hashes:!(!e||"2026-06-25">e)})},n1=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["__preview_disable_beacon","disable_beacon"],["store_google","save_campaign_params"],["verbose","debug"]],n3=e=>{var t={};for(var[r,s]of n1)X(e[r])||(t[s]=e[r]);var i=rZ({},t,e),n=e.__preview_external_dependency_versioned_paths;return X(n)||(X(e.strict_script_versioning)&&(i.strict_script_versioning=!!n),Q(n)&&X(e.asset_host)&&(i.asset_host=n)),G(e.property_blacklist)&&(X(e.property_denylist)?i.property_denylist=e.property_blacklist:G(e.property_denylist)?i.property_denylist=[...e.property_blacklist,...e.property_denylist]:tG.error(nX+e.property_denylist)),i};class n2{constructor(){this.__forceAllowLocalhost=!1}get xi(){return this.__forceAllowLocalhost}set xi(e){tG.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class n4{ki(e,t){if(e){var r=this.Si.indexOf(e);-1!==r&&this.Si.splice(r,1)}return this.Si.push(t),null==t.initialize||t.initialize(),t}Ci(){return this.config.cookieless_mode===rH||this.config.cookieless_mode===rz&&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 n2,this.Ii=!1,this.version=v.LIB_VERSION,this.Ti=new nw,this.Si=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=n0(),this.SentryIntegration=s7,this.sentryIntegration=e=>{var t;return t=s5(this,e),{name:s4,processEvent:e=>t(e)}},this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Ei=!1,this.Mi=null,this.Pi=null,this.Ri=null,this.scrollManager=new nx(this),this.pageViewManager=new s6(this),this.rateLimiter=new iT(this),this.requestRouter=new nM(this),this.consent=new sm(this),this.externalIntegrations=new nq(this);var e,t=null!=(e=n4.__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,r)=>{var s=Q(e)?{[e]:t}:e;this.setPersonProperties(s),null==r||r({})},set_once:(e,t,r)=>{var s=Q(e)?{[e]:t}:e;this.setPersonProperties(void 0,s),null==r||r({})}},this.on("eventCaptured",e=>tG.info('send "'+(null==e?void 0:e.event)+'"',e))}init(e,t,r){if(r&&r!==nQ){var s,i=null!=(s=nW[r])?s:new n4;return i._init(e,t,r),nW[r]=i,nW[nQ][r]=i,i}return this._init(e,t,r)}_init(e,t,r){void 0===t&&(t={});var s,n,a=Q(e)?e.trim():"";if(!a)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={},t.debug=this.Oi(t.debug),this.Li=t,this.Fi=[],t.person_profiles?this.Pi=t.person_profiles:t.process_person&&(this.Pi=t.process_person);var o=n0(t.defaults),l=n3(t),c=rZ({},o,l,{name:r,token:a});K(o.rageclick)&&K(l.rageclick)&&(c.rageclick=rZ({},o.rageclick,l.rageclick)),K(o.session_recording)&&K(l.session_recording)&&(c.session_recording=rZ({},o.session_recording,l.session_recording)),this.set_config(c),this.config.on_xhr_error&&tG.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:iO;var u=this.Ai();this.persistence=new ij(this.config,u),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new ij(x({},this.config,{persistence:"sessionStorage"}),u,!1);var d=x({},this.persistence.props),h=x({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.$i=new nv(e=>this.Di(e),this.config.request_queue_config),this.Ni=new n_(this),this.__request_queue=[];var p=this.Ci();if(p||(this.sessionManager=new nk(this),this.sessionPropsManager=new ny(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(tG.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.qi(p)},0)):(tG.info("Initializing extensions synchronously"),this.qi(p)),v.DEBUG=v.DEBUG||this.config.debug,v.DEBUG&&tG.info("Starting in debug mode",{this:this,config:t,thisC:x({},this.config),p:d,s:h}),!this.config.identity_distinct_id||null!=(s=t.bootstrap)&&s.distinctID||(t.bootstrap=x({},t.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0}
99)),void 0!==(null==(n=t.bootstrap)?void 0:n.distinctID)){var g=t.bootstrap.distinctID,f=this.get_distinct_id(),m=this.persistence.get_property(rC);if(t.bootstrap.isIdentifiedID&&null!=f&&f!==g&&m===rq)this.identify(g);else if(t.bootstrap.isIdentifiedID&&null!=f&&f!==g&&m===rU)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 _=this.config.get_device_id(sn()),b=t.bootstrap.isIdentifiedID?_:g;this.persistence.set_property(rC,t.bootstrap.isIdentifiedID?rU:rq),this.register({distinct_id:g,$device_id:b})}}if(p)this.register_once({distinct_id:rM,$device_id:null},"");else if(!this.get_distinct_id()){var y=this.config.get_device_id(sn());this.register_once({distinct_id:y,$device_id:y},""),this.persistence.set_property(rC,rq)}return r5(i,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),t.segment?function(e,t){var r=e.config.segment;if(!r)return t();!function(e,t){var r=e.config.segment;if(!r)return t();var s=r=>{var s=()=>r.anonymousId()||sn();e.config.get_device_id=s,r.id()&&(e.register({distinct_id:r.id(),$device_id:s()}),e.persistence.set_property(rC,rU)),t()},i=r.user();"then"in i&&Y(i.then)?i.then(s):s(i)}(e,()=>{var s;r.register(("u">typeof Promise&&Promise.resolve||s2.warn("This browser does not have Promise support, and can not use the segment integration"),s=(t,r)=>{if(!r)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(s2.info("No userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(s2.info("UserId set, identifying with PostHog"),e.identify(t.event.userId));var s=e.calculateEventProperties(r,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,rG),identify:e=>s(e,rK),screen:e=>s(e,"$screen")})).then(()=>{t()})})}(this,()=>this.ji()):this.ji(),Y(this.config._onCapture)&&this.config._onCapture!==nG&&(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.config.disableDeviceModel||(function(){return nE.apply(this,arguments)})().then(e=>{e&&this.register({[tZ]:e})}).catch(nG),this}qi(e){var t,r,s,i,n,a,o,l=performance.now(),c=x({},n4.__defaultExtensionClasses,this.config.__extensionClasses),u=[];c.featureFlags&&this.Si.push(this.featureFlags=null!=(t=this.featureFlags)?t:new c.featureFlags(this)),c.exceptions&&this.Si.push(this.exceptions=null!=(r=this.exceptions)?r:new c.exceptions(this)),c.historyAutocapture&&this.Si.push(this.historyAutocapture=new c.historyAutocapture(this)),c.tracingHeaders&&this.Si.push(this.tracingHeaders=new c.tracingHeaders(this)),c.siteApps&&this.Si.push(this.siteApps=new c.siteApps(this)),c.sessionRecording&&!e&&this.Si.push(this.sessionRecording=new c.sessionRecording(this)),this.config.disable_scroll_properties||u.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),c.autocapture&&this.Si.push(this.autocapture=new c.autocapture(this)),c.surveys&&this.Si.push(this.surveys=null!=(s=this.surveys)?s:new c.surveys(this)),c.logs&&this.Si.push(this.logs=null!=(i=this.logs)?i:new c.logs(this)),c.conversations&&this.Si.push(this.conversations=null!=(n=this.conversations)?n:new c.conversations(this)),c.productTours&&this.Si.push(this.productTours=new c.productTours(this)),c.heatmaps&&this.Si.push(this.heatmaps=new c.heatmaps(this)),c.webVitalsAutocapture&&this.Si.push(this.webVitalsAutocapture=new c.webVitalsAutocapture(this)),c.exceptionObserver&&this.Si.push(this.exceptionObserver=new c.exceptionObserver(this)),c.deadClicksAutocapture&&this.Si.push(this.deadClicksAutocapture=new c.deadClicksAutocapture(this,s1)),c.toolbar&&this.Si.push(this.toolbar=null!=(a=this.toolbar)?a:new c.toolbar(this)),c.experiments&&this.Si.push(this.experiments=null!=(o=this.experiments)?o:new c.experiments(this)),this.Si.forEach(e
99=>{e.initialize&&u.push(()=>{null==e.initialize||e.initialize()})}),u.push(()=>{if(this.Bi){var e=this.Bi;this.Bi=void 0,this.pr(e)}}),this.Hi(u,l)}Hi(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout(()=>{this.Hi(e,t)},0);var r=e.shift();if(r)try{r()}catch(e){tG.error("Error initializing extension:",e)}}var s=Math.round(performance.now()-t);this.register_for_session({[rO]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[rA]:s}),this.config.__preview_deferred_init_extensions&&tG.info("PostHog extensions initialized ("+s+"ms)")}pr(e){var t;o&&o.body?(this.config.__preview_deferred_init_extensions&&(this.Bi=e),this.Ui=e,this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=H(e.supportedCompression,iO)?iO:H(e.supportedCompression,iA)?iA:void 0),null!=(t=e.analytics)&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.Pi?this.Pi:rB}),this.Si.forEach(t=>null==t.onRemoteConfig?void 0:t.onRemoteConfig(e))):(tG.info("document not ready yet, trying again in 500 milliseconds..."),setTimeout(()=>{this.pr(e)},500))}ji(){try{this.config.loaded(this)}catch(e){tG.critical("`loaded` function failed",e)}if(this.zi(),this.config.internal_or_test_user_hostname&&null!=l&&l.hostname){var e=l.hostname,t=this.config.internal_or_test_user_hostname;("string"==typeof t?e===t:t.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||this.Ci())&&this.Vi()},1),this.Wi=new iM(this),this.Wi.load()}zi(){var e;this.is_capturing()&&this.config.request_batching&&(null==(e=this.$i)||e.enable())}_dom_loaded(){this.is_capturing()&&rX(this.__request_queue,e=>this.Di(e)),this.__request_queue=[],this.zi()}_handle_unload(){var e,t,r,s;null==(e=this.surveys)||null==e.handlePageUnload||e.handlePageUnload(),this.config.request_batching?(this.Gi()&&this.capture(rY),null==(t=this.logs)||t.flushLogs("sendBeacon"),null==(r=this.$i)||r.unload(),null==(s=this.Ni)||s.unload()):this.Gi()&&this.capture(rY,null,{transport:"sendBeacon"})}_send_request(e){this.__loaded?nZ?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)?e.fireCallbackOnDrop&&(null==e.callback||e.callback({statusCode:429})):(e.transport=e.transport||this.config.api_transport,e.headers=x({},this.config.request_headers,e.headers),e.compression="best-available"===e.compression?this.compression:e.compression,(X(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(e=>{var t,r,s,i=x({},e);i.timeout=i.timeout||6e4,i.url=ng(i.url,i.compression);var n=null!=(t=i.transport)?t:"fetch",a=nf.filter(e=>!i.disableTransport||!e.transport||!i.disableTransport.includes(e.transport)),o=null!=(r=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)?r:a[0].method;if(!o)throw Error("No available transport method");"sendBeacon"!==n&&i.data&&i.compression===iO&&h&&"u">typeof Promise&&!no?np(i).then(e=>{o(e)}).catch(t=>{M(t)?(no=!0,o(x({},i,{compression:void 0,url:ng(e.url,void 0)}))):((e=>{if(!e||"object"!=typeof e)return!1;var t="name"in e?String(e.name):"";return M(e)||t===I})(t)&&(no=!0),o(i))}):o(i)})(x({},e,{callback:t=>{var r,s;this.rateLimiter.checkForLimiting(t),400>t.statusCode||null==(r=(s=this.config).on_request_error)||r.call(s,t),null==e.callback||e.callback(t)}}))):e.fireCallbackOnDrop&&(null==e.callback||e.callback({statusCode:0}))}Di(e){this.Ni?this.Ni.retriableRequest(e):this._send_request(e)}_execute_array(e){nV++;try{var t,r=[],s=[],i=[];rX(e,e=>{if(e)if(G(t=e[0]))i.push(e);else if(Y(e))try{e.call(this)}catch(t){tG.error("Error executing queued PostHog call",e,t)}else G(e)&&"alias"===t?r.push(e):G(e)&&-1!==t.indexOf("capture")&&Y(this[t])?i.push(e):s.push(e)});var n=function(e,t){rX(e,function(e){try{if(G(e[0])){var r=t;
99rQ(e,function(e){r=r[e[0]].apply(r,e.slice(1))})}else t[e[0]].apply(t,e.slice(1))}catch(t){tG.error("Error executing queued PostHog call",e,t)}})};n(r,this),n(s,this),n(i,this)}finally{nV--}}push(e){if(nV>0&&G(e)&&Q(e[0])){var t=n4.prototype[e[0]];Y(t)&&t.apply(this,e.slice(1))}else this._execute_array([e])}capture(e,t,r){var s,i,n,a,o;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.$i){if(this.is_capturing())if(!X(e)&&Q(e)){var l=!this.config.opt_out_useragent_filter&&this._is_bot();if(!l||this.config.__preview_capture_bot_pageviews){var c=null!=r&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==c||!c.isRateLimited){null!=t&&t.$current_url&&!Q(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!=r&&r.Zi||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 u=new Date,d=(null==r?void 0:r.timestamp)||u,h=tl(null==r?void 0:r.uuid,sn),p={uuid:h,event:e,properties:this.calculateEventProperties(e,t||{},d,h)};e===rG&&this.config.__preview_capture_bot_pageviews&&l&&(p.event="$bot_pageview",p.properties.$browser_type="bot"),c&&(p.properties.$lib_rate_limit_remaining_tokens=c.remainingTokens),(null==r?void 0:r.$set)&&(p.$set=null==r?void 0:r.$set);var g=null==r?void 0:r.$unset;g&&(p.$unset=g);var f,v,m,_=this.Qi(null==r?void 0:r.$set_once,e!==rJ,e===rK);if(_&&(p.$set_once=_),null!=r&&r._noTruncate||(i=this.config.properties_string_max_length,n=p,a=e=>Q(e)?e.slice(0,i):e,o=new Set,p=function e(t,r){var s;return t!==Object(t)?a?a(t):t:o.has(t)?void 0:(o.add(t),G(t)?(s=[],rX(t,t=>{s.push(e(t))})):(s={},rQ(t,(t,r)=>{o.has(t)||(s[r]=e(t,r))})),s)}(n)),p.timestamp=d,X(null==r?void 0:r.timestamp)||(p.properties.$event_time_override_provided=!0,p.properties.$event_time_override_system_time=u),e===iP||e===iF){var b=null==t?void 0:t.$survey_id,y=null==t?void 0:t.$survey_iteration;(e=>{try{var t,r=(t=""+nA+e.id,e.current_iteration&&e.current_iteration>0&&(t=""+nA+e.id+"_"+e.current_iteration),t);
99if(localStorage.getItem(r))return;localStorage.setItem(r,"true")}catch(e){nO.error("Failed to persist survey seen state",e)}})({id:b,current_iteration:y}),p.$set=x({},p.$set,{[(f={id:b,current_iteration:y},m="$survey_"+(v=e===iF?"responded":"dismissed")+"/"+f.id,f.current_iteration&&f.current_iteration>0&&(m="$survey_"+v+"/"+f.id+"/"+f.current_iteration),m)]:!0})}else e===iN&&(p.$set=x({},p.$set,{$survey_last_seen_date:(new Date).toISOString()}));if("product tour shown"===e){var w=null==t?void 0:t.$product_tour_type;w&&(p.$set=x({},p.$set,{["$product_tour_last_seen_date/"+w]:(new Date).toISOString()}))}var S=x({},p.properties.$set,p.$set);if(J(S)||this.setPersonPropertiesForFlags(S),!et(this.config.before_send)){var k=this.it(p);if(!k)return;(p=k).uuid=tl(p.uuid,sn)}this.Ti.emit("eventCaptured",p);var j={method:"POST",url:null!=(s=null==r?void 0:r._url)?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:p,compression:"best-available",batchKey:null==r?void 0:r._batchKey,transport:null==r?void 0:r.transport};return!this.config.request_batching||r&&(null==r||!r._batchKey)||null!=r&&r.send_instantly?this.Di(j):this.$i.enqueue(j),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,t,r,s,n){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return t;var a,c=n?void 0:this.persistence.remove_event_timer(e),u=x({},t);if(u.token=this.config.token,u.$config_defaults=this.config.defaults,this.Ci()&&(u.$cookieless_mode=!0),"$snapshot"===e){var d=x({},this.persistence.properties(),this.sessionPersistence.properties());return u.distinct_id=d.distinct_id,(!Q(u.distinct_id)&&!er(u.distinct_id)||Z(u.distinct_id))&&tG.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),u}var h,g=function(e,t,r,s){if(void 0===s&&(s=!1),!p)return{};var n,a,o,c,u,d,h,g,f,m,_,x,b=e?[...il,...t||[]]:[],[y,w]=function(e){for(var t=0;tn.length>t;t++){var[r,s]=tn[t],i=r.exec(e),n=i&&(Y(s)?s(i,e):s);if(n)return n}return["",""]}(p),S=null!=(u="u">typeof navigator?navigator:void 0)&&u.brave?{brave:!0}:{},k={detectGoogleSearchApp:r},j=rZ(r2({$os:y,$os_version:w,$browser:tr(p,navigator.vendor,S,k),$device:ta(p),$device_type:(h={userAgentDataPlatform:null==(n=navigator)||null==(n=n.userAgentData)?void 0:n.platform,maxTouchPoints:null==(a=navigator)?void 0:a.maxTouchPoints,screenWidth:null==i||null==(o=i.screen)?void 0:o.width,screenHeight:null==i||null==(c=i.screen)?void 0:c.height,devicePixelRatio:null==i?void 0:i.devicePixelRatio},(x=ta(p))===e_||x===em||"Kobo"===x||"Kindle Fire"===x||x===eY?ev:x===eA||x===eD||x===eL||x===eW?"Console":x===eb?"Wearable":x?eg:"Android"===(null==h?void 0:h.userAgentDataPlatform)&&(null!=(g=null==h?void 0:h.maxTouchPoints)?g:0)>0?600>Math.min(null!=(f=null==h?void 0:h.screenWidth)?f:0,null!=(m=null==h?void 0:h.screenHeight)?m:0)/(null!=(_=null==h?void 0:h.devicePixelRatio)?_:1)?eg:ev:"Desktop"),$timezone:iy(),$timezone_offset:function(){try{return(new Date).getTimezoneOffset()}catch(e){return}}()}),{$current_url:ii(s?tc(null==l?void 0:l.href):null==l?void 0:l.href,b,iu),$host:null==l?void 0:l.host,$pathname:null==l?void 0:l.pathname,$raw_user_agent:p.length>1e3?p.substring(0,997)+"...":p,$browser_version:ti(p,navigator.vendor,S,k),$browser_language:iv(),$browser_language_prefix:"string"==typeof(d=iv())?d.split("-")[0]:void 0,$screen_height:null==i?void 0:i.screen.height,$screen_width:null==i?void 0:i.screen.width,$viewport_height:null==i?void 0:i.innerHeight,$viewport_width:null==i?void 0:i.innerWidth,$lib:v.LIB_NAME,$lib_version:v.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return v.SDK_DIST_CHANNEL&&(j.$sdk_dist_channel=v.SDK_DIST_CHANNEL),j}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes
99);if(this.sessionManager){var{sessionId:f,windowId:m}=this.sessionManager.checkAndGetSessionAndWindowId(n,r.getTime());u.$session_id=f,u.$window_id=m}this.sessionPropsManager&&rZ(u,this.sessionPropsManager.getSessionProps());try{this.sessionRecording&&rZ(u,this.sessionRecording.sdkDebugProperties),u.$sdk_debug_retry_queue_size=null==(a=this.Ni)?void 0:a.length}catch(e){u.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===nI&&(u.$lib_custom_api_host=this.config.api_host),h=e!==rG||n?e!==rY||n?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,s),u=rZ(u,h),e===rG&&o&&(u.title=o.title),!X(c)){var _=r.getTime()-c;u.$duration=parseFloat((_/1e3).toFixed(3))}p&&this.config.opt_out_useragent_filter&&(u.$browser_type=this._is_bot()?"bot":"browser"),(u=rZ({},g,this.persistence.properties(),this.sessionPersistence.properties(),u)).$is_identified=this._isIdentified(),G(this.config.property_denylist)?rQ(this.config.property_denylist,function(e){delete u[e]}):tG.error(nX+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var b=this.config.sanitize_properties;b&&(tG.error(nJ),u=b(u,e));var y=this.Ji();return u.$process_person_profile=y,y&&!n&&this.Yi("_calculate_event_properties"),u}Qi(e,t,r){if(void 0===t&&(t=!0),void 0===r&&(r=!1),!this.persistence||!this.Ji()||this.Ii&&!r)return e;var s,i=rZ({},this.persistence.get_initial_props(),(null==(s=this.sessionPropsManager)?void 0:s.getSetOnceProps())||{},e||{}),n=this.config.sanitize_properties;return n&&(tG.error(nJ),i=n(i,"$set_once")),t&&(this.Ii=!0),J(i)?void 0:i}register(e,t){var r;null==(r=this.persistence)||r.register(e,t)}register_once(e,t,r){var s;null==(s=this.persistence)||s.register_once(e,t,r)}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)}Ki(e,t){this.register({[e]:t})}getFeatureFlag(e,t){var r;return null==(r=this.featureFlags)?void 0:r.getFeatureFlag(e,t)}getFeatureFlagPayload(e){var t;return null==(t=this.featureFlags)?void 0:t.getFeatureFlagPayload(e)}getFeatureFlagResult(e,t){var r;return null==(r=this.featureFlags)?void 0:r.getFeatureFlagResult(e,t)}getAllFeatureFlags(){var e,t;return null!=(e=null==(t=this.featureFlags)?void 0:t.getAllFeatureFlags())?e:[]}isFeatureEnabled(e,t){var r;return null==(r=this.featureFlags)?void 0:r.isFeatureEnabled(e,t)}reloadFeatureFlags(){var e;null==(e=this.featureFlags)||e.reloadFeatureFlags()}updateFlags(e,t,r){var s;null==(s=this.featureFlags)||s.updateFlags(e,t,r)}updateEarlyAccessFeatureEnrollment(e,t,r){var s;null==(s=this.featureFlags)||s.updateEarlyAccessFeatureEnrollment(e,t,r)}getEarlyAccessFeatures(e,t,r){var s;return void 0===t&&(t=!1),null==(s=this.featureFlags)?void 0:s.getEarlyAccessFeatures(e,t,r)}on(e,t){return this.Ti.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:nK}),()=>{})}onSessionId(e){var t,r;return null!=(t=null==(r=this.sessionManager)?void 0:r.onSessionId(e))?t:()=>{}}getSurveys(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getSurveys(e,t):e([],{isLoaded:!1,error:nK})}getActiveMatchingSurveys(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,t):e([],{isLoaded:!1,error:nK})}renderSurvey(e,t){var r;null==(r=this.surveys)||r.renderSurvey(e,t)}displaySurvey(e,t){var r;void 0===t&&(t=nD),null==(r=this.surveys)||r.displaySurvey(e,t)}cancelPendingSurvey(e){var t;null==(t=this.surveys)||t.cancelPendingSurvey(e)}canRenderSurvey(e){var t,r;return null!=(t=null==(r=this.surveys)?void 0:r.canRenderSurvey(e))?t:{visible:!1,disabledReason:nK}}canRenderSurveyAsync(e,t){var r,s;return void 0===t&&(t=!1),null!=(r=null==(s=this.surveys)?void 0:s.canRenderSurveyAsync(e,t))?r:Promise.resolve({visible:!1,disabledReason:nK})}Xi(e){return!e||Z(e)?(tG.critical("Unique user id has not been set in posthog.identify"),!1):e===rM?(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 n
99ot a hardcoded string.'),!1)}identify(e,t,r){if(!this.__loaded||!this.persistence)return tG.uninitializedWarning("posthog.identify");if(er(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.Xi(e)&&this.Yi("posthog.identify")){var s=this.get_distinct_id();this.register({$user_id:e}),this.get_property(tQ)||this.register_once({$had_persisted_distinct_id:!0,$device_id:s},""),e!==s&&e!==this.get_property(t0)&&(this.unregister(t0),this.register({distinct_id:e}));var i,n=(this.persistence.get_property(rC)||rq)===rq;e!==s&&n?(this.persistence.set_property(rC,rU),this.setPersonPropertiesForFlags({$set:t||{},$set_once:r||{}},!1),this.capture(rK,{distinct_id:e,$anon_distinct_id:s},{$set:t||{},$set_once:r||{}}),this.Ri=nN(e,t,r),null==(i=this.featureFlags)||i.setAnonymousDistinctId(s)):(t||r)&&this.setPersonProperties(t,r),e!==s&&(this.reloadFeatureFlags(),this.unregister(rS))}}setPersonProperties(e,t){if((e||t)&&this.Yi("posthog.setPersonProperties")){var r=nN(this.get_distinct_id(),e,t);this.Ri!==r?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:t||{}},!0),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.Ri=r):tG.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(e){var t,r=(G(e)?e:[e]).filter(e=>Q(e)&&e.length>0);0!==r.length&&this.Yi("posthog.unsetPersonProperties")&&(null==(t=this.featureFlags)||t.unsetPersonPropertiesForFlags(r,!0),this.capture("$set",{$unset:r}),this.Ri=null)}group(e,t,r){if(e&&t){var s=this.getGroups(),i=s[e]!==t;if(i&&this.resetGroupPropertiesForFlags(e),this.register({$groups:x({},s,{[e]:t})}),i||r){var n={$group_type:e,$group_key:t};r&&(n.$group_set=r),this.capture(rJ,n)}r&&this.setGroupPropertiesForFlags({[e]:r}),i&&!r&&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 r;void 0===t&&(t=!0),null==(r=this.featureFlags)||r.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(e){var t;void 0===e&&(e=!0),null==(t=this.featureFlags)||t.resetPersonPropertiesForFlags(e)}setGroupPropertiesForFlags(e,t){var r;void 0===t&&(t=!0),this.Yi("posthog.setGroupPropertiesForFlags")&&(null==(r=this.featureFlags)||r.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,r,s,i,n,a,o,l,c,u,d=this.get_property(tQ),h=this.get_property(tZ),p=this.get_property(rt);if(this.consent.reset(),null==(t=this.persistence)||t.clear(),null==(r=this.sessionPersistence)||r.clear(),X(p)||null==(u=this.persistence)||u.register({[rt]:p}),null==(s=this.surveys)||s.reset(),null==(i=this.Wi)||i.stop(),null==(n=this.featureFlags)||n.reset(),null==(a=this.conversations)||a.reset(),null==(o=this.logs)||o.reset(),null==(l=this.persistence)||l.set_property(rC,rq),null==(c=this.sessionManager)||c.resetSessionId(),this.Ri=null,this.config.cookieless_mode===rH)this.register_once({distinct_id:rM,$device_id:null},"");else{var g=this.config.get_device_id(sn());this.register_once({distinct_id:g,$device_id:e?g:d},""),e||X(h)||this.register({[tZ]:h})}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 r;this.config.identity_distinct_id=e,this.config.identity_hash=t,this.alias(e),null==(r=this.conversations)||r.en()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,null==(e=this.conversations)||e.tn()}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:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0),s=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t);if(null!=e&&e.withTimestamp&&r){var i,n=null!=(i=e.timestampLookBack)?i:10;if(!r)return s;s+="?t="+Math.max(Math.floor(((new Date).getTime()-r)/1e3)-n,0)}return s}alias(e,t){return e===this.get_property(tX)?(tG.critical("Attempting to create alias for existing People user - aborting."),-2):this.Yi("posthog.alias")?(X(t)&&(t=this.get_distinct_id()),e!==t?(this.Ki(t0,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=x({},this.config);if(K(e)){rZ(this.config,n3(e));var r,s,i,n,a,o,l,c,u,d,h,p=this.Ai();null==(r=this.persistence)||r.update_config(this.config,t,p),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new ij(x({},this.config,{persistence:"sessionStorage"}),p,!1);var g=this.Oi(this.config.debug);ei(g)&&(this.config.debug=g),ei(this.config.debug)&&(this.config.debug?(v.DEBUG=!0,sd.N()&&sd.q("ph_debug",!0),tG.info("set_config",{config:e,oldConfig:t,newConfig:x({},this.config)})):(v.DEBUG=!1,sd.N()&&sd.A("ph_debug"))),null==(s=this.exceptionObserver)||s.onConfigChange(),null==(i=this.exceptions)||i.onConfigChange(),null==(n=this.sessionRecording)||n.startIfEnabledOrStop(),null==(a=this.tracingHeaders)||a.startIfEnabledOrStop(),null==(o=this.autocapture)||o.startIfEnabled(),null==(l=this.heatmaps)||l.startIfEnabled(),null==(c=this.exceptionObserver)||c.startIfEnabledOrStop(),null==(u=this.deadClicksAutocapture)||u.startIfEnabledOrStop(),null==(d=this.surveys)||d.loadIfEnabled(),this.rn(),null==(h=this.externalIntegrations)||h.startIfEnabledOrStop()}}_overrideSDKInfo(e,t){v.LIB_NAME=e,v.LIB_VERSION=t}startSessionRecording(e){var t,r,s,i,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==(r=this.sessionRecording)||r.overrideSampling()),o.linked_flag&&(null==(s=this.sessionRecording)||s.overrideLinkedFlag()),o.url_trigger&&(null==(i=this.sessionRecording)||i.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 r=Error("PostHog syntheticException"),s=this.exceptions.buildProperties(e,{handled:!0,syntheticException:r});return this.exceptions.sendExceptionEvent(x({},s,t))}}addExceptionStep(e,t){var r;null==(r=this.exceptions)||r.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:n4.nn}startExceptionAutocapture(e){this.set_config({capture_exceptions:null==e||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){var t,r;return null!=(t=null==(r=this.toolbar)?void 0:r.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:nQ;return t!==nQ&&(t=nQ+"."+t),t}_isIdentified(){var e,t;return(null==(e=this.persistence)?void 0:e.get_property(rC))===rU||(null==(t=this.sessionPersistence)?void 0:t.get_property(rC))===rU}Ji(){var e,t;return!("never"===this.config.person_profiles||this.config.person_profiles===rB&&!this._isIdentified()&&J(this.getGroups())&&(null==(e=this.persistence)||null==(e=e.props)||!e[t0])&&(null==(t=this.persistence)||null==(t=t.props)||!t[rT]))}Gi(){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.Ji()||this.Yi("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.Yi("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}Yi(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.Ki(rT,!0),!0)}Ai(){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!==rz)}rn(){var e,t,r,s,i=this.Ai();return(null==(e=this.persistence)?void 0:e.Vt)!==i&&(null==(r=this.persistence)||r.set_disabled(i)),(null==(t=this.sessionPersistence)?void 0:t.Vt)!==i&&(null==(s=this.sessionPersistence)||s.set_disabled(i)),i}opt_in_capturing(e){var t;if(this.config.cookieless_mode!==rH){if(this.Ci()){this.reset(!0),null==(i=this.sessionManager)||i.destroy(),null==(n=this.pageViewM
99anager)||n.destroy(),this.sessionManager=new nk(this),this.pageViewManager=new s6(this),this.persistence&&(this.sessionPropsManager=new ny(this,this.sessionManager,this.persistence));var r,s,i,n,a,o,l,c,u=null!=(a=null==(o=this.config.__extensionClasses)?void 0:o.sessionRecording)?a:null==(l=n4.__defaultExtensionClasses)?void 0:l.sessionRecording;u&&(this.sessionRecording=this.ki(this.sessionRecording,new u(this)),this.Ui&&(null==(c=this.sessionRecording)||null==c.onRemoteConfig||c.onRemoteConfig(this.Ui)))}this.consent.optInOut(!0),this.rn(),this.zi(),null==(t=this.sessionRecording)||t.startIfEnabledOrStop(),this.config.cookieless_mode==rz&&(null==(r=this.surveys)||r.loadIfEnabled()),(X(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.Vi()}else tG.warn(nY)}opt_out_capturing(){var e,t,r;this.config.cookieless_mode!==rH?(this.config.cookieless_mode===rz&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.rn(),this.config.cookieless_mode===rz&&(this.register({distinct_id:rM,$device_id:null}),null==(e=this.sessionRecording)||e.stopRecording(),this.sessionRecording=void 0,null==(t=this.sessionManager)||t.destroy(),null==(r=this.pageViewManager)||r.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.Vi(),this.zi())):tG.warn(nY)}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===rH||(this.config.cookieless_mode===rz?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.rn()}_is_bot(){return a?nj(a,this.config.custom_blocked_useragents):void 0}Vi(){o&&("visible"===o.visibilityState?this.Ei||(this.Ei=!0,this.capture(rG,{title:o.title},{send_instantly:!0}),this.Mi&&(o.removeEventListener(rW,this.Mi),this.Mi=null)):this.Mi||(this.Mi=this.Vi.bind(this),r5(o,rW,this.Mi)))}debug(e){!1===e?(null==i||i.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==i||i.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}))}mr(){var e,t,r,s,i=this.Li||{};return"advanced_disable_flags"in i?!!i.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",r=(e="advanced_disable_flags")in i&&!et(i[e]),s=t in i&&!et(i[t]),r?i[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."),i[t]))}it(e){if(et(this.config.before_send))return e;var t,r=Object.keys(null!=(t=e.properties)?t:{}).filter(ea),s=G(this.config.before_send)?this.config.before_send:[this.config.before_send],i=e;for(var n of s){if(et(i=n(i))){var a="Event '"+e.event+"' was rejected in beforeSend function";return en(e.event)?tG.warn(a+". This can cause unexpected behavior."):tG.info(a),null}i.properties&&!J(i.properties)||tG.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}for(var o of r)if(i.properties&&et(i.properties[o]))return tG.warn("Event '"+e.event+"' had its '"+o+"' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped."),null;return i}getPageViewId(){var e;return null==(e=this.pageViewManager.Ot)?void 0:e.pageViewId}captureTraceFeedback(e,t){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:t})}captureTraceMetric(e,t,r){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:t,$ai_metric_value:String(r)})}Oi(e){var t=ei(e)&&!e,r=sd.N()&&"true"===sd.P("ph_debug");return!t&&(!!r||e)}}n4.__defaultExtensionClasses={},n4.nn={trace:nB=()=>{},debug:nB,info:nB,warn:nB,error:nB,fatal:nB},function(e,t){for(var r=0;t.length>r;r++)e.prototype[t[r]]=r3(e.prototype[t[r]])}(n4,["identify"]);
99class n5{constructor(e){this.disabled=!1===e;var t=K(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,r){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>r-s.timestamp){if(this.clicks.push({x:e,y:t,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:t,timestamp:r}];return!1}}var n7="$copy_autocapture",n6=tY("[AutoCapture]");function n8(e,t){return t.length>e?t.slice(0,e)+"...":t}var n9=tY("[ExceptionAutocapture]"),ae=tY("[TracingHeaders]"),at=tY("[Web Vitals]"),ar="disabled",as="lazy_loading",ai="awaiting_config",an="missing_config";tY("[SessionRecording]"),tY("[SessionRecording]");var aa="[SessionRecording]",ao=tY(aa),al=tY("[Heatmaps]");function ac(e){return K(e)&&"clientX"in e&&"clientY"in e&&er(e.clientX)&&er(e.clientY)}var au=tY("[Product Tours]"),ad=e=>{var t;return!e.config.disable_product_tours&&!(null==(t=e.persistence)||!t.get_property(t9))},ah=["$set_once","$set"],ap=tY("[SiteApps]"),ag="Error while initializing PostHog app with config id ";function af(e,t,r){if(et(e))return!1;switch(r){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 av{constructor(e){this.sn=new nw,this.an=(e,t)=>this.ln(e,t)&&this.un(e,t)&&this.hn(e,t)&&this.dn(e,t),this.ln=(e,t)=>null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event),this._instance=e,this.cn=new Set,this.vn=new Set}init(){var e,t;X(null==(e=this._instance)?void 0:e._addCaptureHook)||null==(t=this._instance)||t._addCaptureHook((e,t)=>{this.on(e,t)})}register(e){var t,r;if(!X(null==(t=this._instance)?void 0:t._addCaptureHook)&&(e.forEach(e=>{var t,r;null==(t=this.vn)||t.add(e),null==(r=e.steps)||r.forEach(e=>{var t;null==(t=this.cn)||t.add((null==e?void 0:e.event)||"")})}),null!=(r=this._instance)&&r.autocapture)){var s,i=new Set;e.forEach(e=>{var t;null==(t=e.steps)||t.forEach(e=>{null!=e&&e.selector&&i.add(null==e?void 0:e.selector)})}),null==(s=this._instance)||s.autocapture.setElementSelectors(i)}}on(e,t){var r;null!=t&&0!=e.length&&(this.cn.has(e)||this.cn.has(null==t?void 0:t.event))&&this.vn&&(null==(r=this.vn)?void 0:r.size)>0&&this.vn.forEach(e=>{this.fn(t,e)&&this.sn.emit("actionCaptured",e.name)})}pn(e){this.onAction("actionCaptured",t=>e(t))}fn(e,t){if(null==(null==t?void 0:t.steps))return!1;for(var r of t.steps)if(this.an(e,r))return!0;return!1}onAction(e,t){return this.sn.on(e,t)}un(e,t){if(null!=t&&t.url){var r,s=null==e||null==(r=e.properties)?void 0:r.$current_url;if(!s||"string"!=typeof s||!af(s,t.url,t.url_matching||"contains"))return!1}return!0}hn(e,t){return!!this.gn(e,t)&&!!this.mn(e,t)&&!!this.yn(e,t)}gn(e,t){if(null==t||!t.href)return!0;var r=this.bn(e);if(r.length>0)return r.some(e=>af(e.href,t.href,t.href_matching||"exact"));var s,i,n=(null==e||null==(s=e.properties)?void 0:s.$elements_chain)||"";return!!n&&af((i=n.match(/(?::|")href="(.*?)"/))?i[1]:"",t.href,t.href_matching||"exact")}mn(e,t){if(null==t||!t.text)return!0;var r=this.bn(e);if(r.length>0)return r.some(e=>af(e.text,t.text,t.text_matching||"exact")||af(e.$el_text,t.text,t.text_matching||"exact"));var s,i,n,a,o=(null==e||null==(s=e.properties)?void 0:s.$elements_chain)||"";return!!o&&(i=function(e){for(var t,r=[],s=/(?::|")text="(.*?)"/g;!et(t=s.exec(e));)r.includes(t[1])||r.push(t[1]);return r}(o),n=t.text,a=t.text_matching||"exact",i.some(e=>af(e,n,a)))}yn(e,t){if(null==t||!t.selector)return!0;var r,s,i=null==e||null==(r=e.properties)?void 0:r.$element_selectors;if(null!=i&&i.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}bn(e){var t;return null==(null==e||null==(t=e.properties)?void 0:t.$elements)?[]:null==e?void 0:e.properties.$elements}dn(e,t){return null==t||!t.properties||0===t.properties.length||n$(t.properties.reduce((e,t)=>
99{var r=G(t.value)?t.value.map(String):null!=t.value?[String(t.value)]:[];return e[t.key]={values:r,operator:t.operator||"exact"},e},{}),null==e?void 0:e.properties)}}class am{constructor(e){this._n=[],this._instance=e,this.wn=new Map,this.xn=new Map,this.kn=new Map}Sn(e,t){return!!e&&n$(e.propertyFilters,null==t?void 0:t.properties)}Cn(e,t){var r=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=r.get(t.name)||[];s.push(e.id),r.set(t.name,s)}})}),r}In(e,t,r){var s=(r===iE?this.wn:this.xn).get(e),i=[];return this.Tn(e=>{i=e.filter(e=>null==s?void 0:s.includes(e.id))}),i.filter(s=>{var i,n=null==(i=s.conditions)||null==(i=i[r])||null==(i=i.values)?void 0:i.find(t=>t.name===e);return this.Sn(n,t)})}register(e){var t;X(null==(t=this._instance)?void 0:t._addCaptureHook)||(this.En(e),this.Mn(e))}Mn(e){var t=e.filter(e=>{var t,r;return(null==(t=e.conditions)?void 0:t.actions)&&(null==(r=e.conditions)||null==(r=r.actions)||null==(r=r.values)?void 0:r.length)>0});0!==t.length&&(null==this.Pn&&(this.Pn=new av(this._instance),this.Pn.init(),this.Pn.pn(e=>{this.onAction(e)})),t.forEach(e=>{var t,r,s,i,n;e.conditions&&null!=(t=e.conditions)&&t.actions&&null!=(r=e.conditions)&&null!=(r=r.actions)&&r.values&&(null==(s=e.conditions)||null==(s=s.actions)||null==(s=s.values)?void 0:s.length)>0&&(null==(i=this.Pn)||i.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 r=this.kn.get(t.name);r&&r.push(e.id),this.kn.set(t.name,r||[e.id])}}))}))}En(e){var t,r=e.filter(e=>{var t,r;return(null==(t=e.conditions)?void 0:t.events)&&(null==(r=e.conditions)||null==(r=r.events)||null==(r=r.values)?void 0:r.length)>0}),s=e.filter(e=>{var t,r;return(null==(t=e.conditions)?void 0:t.cancelEvents)&&(null==(r=e.conditions)||null==(r=r.cancelEvents)||null==(r=r.values)?void 0:r.length)>0});0===r.length&&0===s.length||(null==(t=this._instance)||t._addCaptureHook((e,t)=>{this.onEvent(e,t)}),this.wn=this.Cn(e,iE),this.xn=this.Cn(e,iC))}onEvent(e,t){var r,s,i=this.Rn(),n=(null==t||null==(r=t.properties)?void 0:r.$survey_id)||(null==t||null==(s=t.properties)?void 0:s.$product_tour_id);if(n&&this.getActivatedIds().includes(n)){var a=this.On(e,n);if("consume"===a)return i.info("event consumed activated item, removing it",{event:e,itemId:n}),void this.Ln([n]);if("persist"===a)return i.info("shown item promoted to persisted activation",{event:e,itemId:n}),void this.Fn(n)}if(this.xn.has(e)){var o=this.In(e,t,iC);o.length>0&&(i.info("cancel event matched, cancelling items",{event:e,itemsToCancel:o.map(e=>e.id)}),this.Ln(o.map(e=>e.id)),o.forEach(e=>this.An(e.id)))}if(this.wn.has(e)){i.info("event name matched",{event:e,eventPayload:t,items:this.wn.get(e)});var l=this.In(e,t,iE);this.$n(l.map(e=>e.id))}}onAction(e){this.kn.has(e)&&this.$n(this.kn.get(e)||[])}$n(e){0!==e.length&&(this._n=[...new Set([...this._n,...e])],this.Rn().info("updating activated items",{activatedItems:this.getActivatedIds()}))}Fn(e){this._n=this._n.filter(t=>t!==e);var t=this.Dn();t.includes(e)||this.Nn([...t,e])}Ln(e){var t=new Set(e);this._n=this._n.filter(e=>!t.has(e));var r=this.Dn(),s=r.filter(e=>!t.has(e));s.length!==r.length&&this.Nn(s)}Dn(){var e,t=this.qn();return(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t])||[]}getActivatedIds(){return[...new Set([...this.Dn(),...this._n])].filter(e=>!this.jn(e))}reset(){this._n=[],this.Dn().length>0&&this.Nn([])}getEventToItemsMap(){return this.wn}Bn(){return this.Pn}}class a_ extends am{constructor(e){super(e)}qn(){return ry}Hn(){return iN}Tn(e){var t;null==(t=this._instance)||t.getSurveys(e)}An(e){var t;null==(t=this._instance)||t.cancelPendingSurvey(e)}Rn(){return nO}Nn(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({[ry]:e})}jn(){return!1}On(e,t){var r,s,i,n,a,o;return this.Tn(e=>{o=e.find(e=>e.id===t)}),!o||(a=(null!=(s=null==(i=(r=o).conditions)||null==(i=i.events)||null==(i=i.values)?void 0:i.length)?s:0)>0,"always"===r.schedule||null!=(n=r.conditions)&&null!=(n=n.events)&&n.repeatedActivation&&a)?e===iN?"consume":"ignore":e===iN?"persist":e===iP||e===iF?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}
99getEventToSurveys(){return this.getEventToItemsMap()}}var ax="SDK is not enabled or survey functionality is not yet loaded",ab="Disabled. Not loading surveys.",ay=null!=i&&i.location?ia(i.location.hash,"__posthog")||ia(location.hash,"state"):null,aw="_postHogToolbarParams",aS=tY("[Toolbar]"),ak=tY("[FeatureFlags]"),aj=tY("[FeatureFlags]",{debugEnabled:!0}),aE="\" failed. Feature flags didn't load in time.",aC=e=>{for(var t={},r=0;e.length>r;r++)t[e[r]]=!0;return t},aN=e=>{var t={};for(var[r,s]of r0(e||{}))s&&(t[r]=s);return t},aP=tY("[Error tracking]"),aF="Refusing to render web experiment since the viewer is a likely bot",a$={icontains:(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>-1===t.toLowerCase().indexOf(e.toLowerCase()),regex:(e,t)=>nC(t,e),not_regex:(e,t)=>!nC(t,e),exact:(e,t)=>t===e,is_not:(e,t)=>t!==e};class aI{get Se(){return this._instance.config}constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getWebExperiments(e=>{aI.Un("retrieved web experiments from the server"),t.zn=new Map,e.forEach(e=>{if(e.feature_flag_key){t.zn&&(aI.Un("setting flag key ",e.feature_flag_key," to web experiment ",e),null==(r=t.zn)||r.set(e.feature_flag_key,e));var r,s=t._instance.getFeatureFlag(e.feature_flag_key);Q(s)&&e.variants[s]&&t.Vn(e.name,s,e.variants[s].transforms)}else if(e.variants)for(var i in e.variants){var n=e.variants[i];aI.Wn(n,t._instance)&&t.Vn(e.name,i,n.transforms)}})},e)},this._instance=e,this._instance.onFeatureFlags(e=>{this.onFeatureFlags(e)})}initialize(){}onFeatureFlags(e){if(this._is_bot())aI.Un(aF);else if(!this.Se.disable_web_experiments){if(et(this.zn))return this.zn=new Map,this.loadIfEnabled(),void this.previewWebExperiment();aI.Un("applying feature flags",e),e.forEach(e=>{var t;if(this.zn&&null!=(t=this.zn)&&t.has(e)){var r,s=this._instance.getFeatureFlag(e),i=null==(r=this.zn)?void 0:r.get(e);s&&null!=i&&i.variants[s]&&this.Vn(i.name,s,i.variants[s].transforms)}})}}previewWebExperiment(){var e=aI.getWindowLocation();if(null!=e&&e.search){var t=is(null==e?void 0:e.search,"__experiment_id"),r=is(null==e?void 0:e.search,"__experiment_variant");t&&r&&(aI.Un("previewing web experiments "+t+" && "+r),this.getWebExperiments(e=>{this.Gn(parseInt(t),r,e)},!1,!0))}}loadIfEnabled(){this.Se.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,r){if(this.Se.disable_web_experiments&&!r)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.Se.token),method:"GET",callback:t=>e(200===t.statusCode&&t.json&&t.json.experiments||[])})}Gn(e,t,r){var s=r.filter(t=>t.id===e);s&&s.length>0&&(aI.Un("Previewing web experiment ["+s[0].name+"] with variant ["+t+"]"),this.Vn(s[0].name,t,s[0].variants[t].transforms))}static Wn(e,t){return!et(e.conditions)&&aI.Zn(e,t)&&aI.Qn(e)}static Zn(e,t){if(et(e.conditions)||et(null==(s=e.conditions)?void 0:s.url))return!0;var r=aI.getWindowLocation();if(r){var s,i,n,a,o=s_(t,r.href);return null==(i=e.conditions)||!i.url||a$[null!=(n=null==(a=e.conditions)?void 0:a.urlMatchType)?n:"icontains"](e.conditions.url,o)}return!1}
99static getWindowLocation(){return null==i?void 0:i.location}static Qn(e){if(et(e.conditions)||et(null==(r=e.conditions)?void 0:r.utm))return!0;var t=ih();if(t.utm_source){var r,s,i,n,a,o,l,c,u,d=null==(s=e.conditions)||null==(s=s.utm)||!s.utm_campaign||(null==(i=e.conditions)||null==(i=i.utm)?void 0:i.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==(c=e.conditions)||null==(c=c.utm)||!c.utm_term||(null==(u=e.conditions)||null==(u=u.utm)?void 0:u.utm_term)==t.utm_term;return d&&p&&g&&h}return!1}static Un(e){for(var t=arguments.length,r=Array(t>1?t-1:0),s=1;t>s;s++)r[s-1]=arguments[s];tG.info("[WebExperiments] "+e,r)}Vn(e,t,r){this._is_bot()?aI.Un(aF):"control"!==t?r.forEach(r=>{if(r.selector){aI.Un("applying transform of variant "+t+" for experiment "+e+" ",r);var s,i=null==(s=document)?void 0:s.querySelectorAll(r.selector);null==i||i.forEach(e=>{r.html&&(e.innerHTML=r.html),r.css&&e.setAttribute("style",r.css)})}}):aI.Un("Control variants leave the page unmodified.")}_is_bot(){return a&&this._instance?nj(a,this.Se.custom_blocked_useragents):void 0}}var aT=tY("[Conversations]"),aR="Conversations not available yet.",aM="console",aO={featureFlags:class{constructor(e){this.Jn=!1,this.Yn=!1,this.Kn=!1,this.Xn=!1,this.es=!1,this.ts=!1,this.rs=!1,this.ns=!1,this._instance=e,this.featureFlagEventHandlers=[]}get Se(){return this._instance.config}get zr(){return this._instance.persistence}ss(e){return this._instance.get_property(e)}os(){var e,t;return null!=(e=null==(t=this.zr)?void 0:t.Gt(this.Se.feature_flag_cache_ttl_ms))&&e}ls(){return!!this.os()&&(this.ns||this.Kn||(this.ns=!0,ak.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}us(){var e,t=null!=(e=this.Se.evaluation_contexts)?e:this.Se.evaluation_environments;return!this.Se.evaluation_environments||this.Se.evaluation_contexts||this.rs||(ak.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.rs=!0),null!=t&&t.length?t.filter(e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||ak.error("Invalid evaluation context found:",e,"Expected non-empty string"),t}):[]}hs(){return this.us().length>0}ds(){var e=this.Se.flag_keys;if(!X(e)){if(G(e))return e.filter(e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||ak.error("Invalid flag key found:",e,"Expected non-empty string"),t});ak.error("Invalid flag_keys found:",e,"Expected array of non-empty strings")}}initialize(){var e,t,{config:r}=this._instance,s=null!=(e=null==(t=r.bootstrap)?void 0:t.featureFlags)?e:{};if(Object.keys(s).length){var i,n,a=null!=(i=null==(n=r.bootstrap)?void 0:n.featureFlagPayloads)?i:{},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,r){var s,i,n=null!=r&&r.merge&&null!=(s=this.ss(rc))?s:{},a=null!=r&&r.merge&&null!=(i=this.ss(rp))?i:{},o=x({},n,e),l=x({},a,t),c={};for(var[u,d]of Object.entries(o))c[u]={key:u,enabled:w(d),variant:S(d),reason:void 0,metadata:X(null==l?void 0:l[u])?void 0:{id:0,version:void 0,description:void 0,payload:l[u]}};this.receivedFeatureFlags({flags:c})}get hasLoadedFlags(){return this.Yn}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this.ss(rh),t=this.ss(rf),r=this.ss(rv);if(!r&&!t)return e||{};var s=rZ({},e||{});for(var i of[...new Set([...Object.keys(r||{}),...Object.keys(t||{})])]){var n,a,o=s[i],l=null==t?void 0:t[i],c=X(l)?null!=(n=null==o?void 0:o.enabled)&&n:!!l,u=X(l)?o.variant:"string"==typeof l?l:void 0,d=null==r?void 0:r[i],h=x({},o,{enabled:c,variant:c?null!=u?u:null==o?void 0:o.variant:void 0});c!==(null==o?void 0:o.enabled)&&(h.original_enabled=null==o?void 0:o.enabled),u!==(null==o?void 0:o.variant)&&(h.original_variant=null==o?void 0:o.variant),d&&(h.metadata=x({},null==o?void 0:o.metadata,{payload:d,original_payload:null==o||null==(a=o.metadata)?void 0:a.payload})),s[i]=h}return this.Jn||(ak.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:r,finalDetails:s}),this.Jn=!0),s}getAllFeatureFlags(){var e=this.getFlagVariants(),t=this.getFlagPayloads();return Object.keys(e).map(r=>{var s=e[r];return{key:r,enabled:w(s),variant:S(s),payload:y(t[r])}})}getFlagVariants(){var e=this.ss(rc),t=this.ss(rf);if(!t)return e||{};for(var r=rZ({},e),s=Object.keys(t),i=0;s.length>i;i++)r[s[i]]=t[s[i]];return this.Jn||(ak.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:r}),this.Jn=!0),r}getFlagPayloads(){var e=this.ss(rp),t=this.ss(rv);if(!t)return e||{};for(var r=rZ({},e||{}),s=Object.keys(t),i=0;s.length>i;i++)r[s[i]]=t[s[i]];return this.Jn||(ak.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:r}),this.Jn=!0),r}reloadFeatureFlags(){this.Xn||this.Se.advanced_disable_feature_flags||this.cs||(this._instance.Ti.emit("featureFlagsReloading",!0),this.cs=setTimeout(()=>{this.vs()},5))}fs(){clearTimeout(this.cs),this.cs=void 0}ensureFlagsLoaded(){this.Yn||this.Kn||this.cs||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.Xn=e}vs(e){var t;if(this.fs(),!this._instance.mr())if(this.Kn)this.es=!0;else{var r=this.Se.token,s=this.ss(tQ),i={token:r,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:x({},(null==(t=this.zr)?void 0:t.get_initial_props())||{},this.ss(rm)||{}),group_properties:this.ss(r_),timezone:iy()};ee(s)||X(s)||(i.$device_id=s),(null!=e&&e.disableFlags||this.Se.advanced_disable_feature_flags)&&(i.disable_flags=!0),this.hs()&&(i.evaluation_contexts=this.us());var n=this.ds();X(n)||(i.flag_keys=n);var a=!!this.Se.advanced_only_evaluate_survey_feature_flags,o=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+(this.Se.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":""));this.Kn=!0,this._instance._send_request({method:"POST",url:o,data:i,compression:this.Se.disable_compression?void 0:iA,timeout:this.Se.feature_flag_request_timeout_ms,callback:e=>{var t,r,s,n=!0;if(200===e.statusCode&&(this.es||(this.$anon_distinct_id=void 0),n=!1),this.Kn=!1,!i.disable_flags||this.es){this.ts=!n;var o=[];e.error?e.error instanceof Error?o.push("AbortError"===e.error.name?"timeout":"connection_error"):o.push("unknown_error"):200!==e.statusCode&&o.push("api_error_"+e.statusCode),null!=(t=e.json)&&t.errorsWhileComputingFlags&&o.push("errors_while_computing_flags");var l,c=!(null==(r=e.json)||null==(r=r.quotaLimited)||!r.includes("feature_flags"));(c&&o.push("quota_limited"),null==(s=this.zr)||s.register({[rj]:o}),c)?ak.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset.  Please visit https://posthog.com/docs/billing/limits-alerts to learn more."):(i.disable_flags||this.receivedFeatureFlags(null!=(l=e.json)?l:{},n,{partialResponse:a}
99),this.es&&(this.es=!1,this.vs()))}}})}}getFeatureFlag(e,t){var r;if(void 0===t&&(t={}),!t.fresh||this.ts)if(this.Yn||this.getFlags()&&this.getFlags().length>0){if(!this.ls()){var s=this.getFeatureFlagResult(e,t);return null!=(r=null==s?void 0:s.variant)?r:null==s?void 0:s.enabled}}else ak.warn('getFeatureFlag for key "'+e+aE)}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.ts)if(this.Yn||this.getFlags()&&this.getFlags().length>0){if(!this.ls()){var r=this.getFlagVariants(),s=e in r,i=r[e],n=this.getFlagPayloads()[e],a=String(i),o=this.ss(rg)||void 0,l=this.ss(rE)||void 0,c=this.ss(rS)||{};if(this.Se.advanced_feature_flags_dedup_per_session){var u,d=this._instance.get_session_id(),h=this.ss(rk);d&&d!==h&&(c={},null==(u=this.zr)||u.register({[rS]:c,[rk]:d}))}if((t.send_event||!("send_event"in t))&&(!(e in c)||!c[e].includes(a))){G(c[e])?c[e].push(a):c[e]=[a],null==(v=this.zr)||v.register({[rS]:c});var p=this.getFeatureFlagDetails(e),g=[...null!=(m=this.ss(rj))?m:[]];X(i)&&g.push("flag_missing");var f={$feature_flag:e,$feature_flag_response:i,$feature_flag_payload:n||null,$feature_flag_request_id:o,$feature_flag_evaluated_at:l,$feature_flag_bootstrapped_response:(null==(_=this.Se.bootstrap)||null==(_=_.featureFlags)?void 0:_[e])||null,$feature_flag_bootstrapped_payload:(null==(x=this.Se.bootstrap)||null==(x=x.featureFlagPayloads)?void 0:x[e])||null,$used_bootstrap_value:!this.ts};X(null==p||null==(b=p.metadata)?void 0:b.version)||(f.$feature_flag_version=p.metadata.version);var v,m,_,x,b,w,S,k,j,E,C,N=null!=(w=null==p||null==(S=p.reason)?void 0:S.description)?w:null==p||null==(k=p.reason)?void 0:k.code;N&&(f.$feature_flag_reason=N),null!=p&&null!=(j=p.metadata)&&j.id&&(f.$feature_flag_id=p.metadata.id),X(null==p?void 0:p.original_variant)&&X(null==p?void 0:p.original_enabled)||(f.$feature_flag_original_response=X(p.original_variant)?p.original_enabled:p.original_variant),null!=p&&null!=(E=p.metadata)&&E.original_payload&&(f.$feature_flag_original_payload=null==p||null==(C=p.metadata)?void 0:C.original_payload),g.length&&(f.$feature_flag_error=g.join(",")),this._instance.capture("$feature_flag_called",f)}if(s)return{key:e,enabled:!!i,variant:"string"==typeof i?i:void 0,payload:y(n)}}}else ak.warn('getFeatureFlagResult for key "'+e+aE)}getRemoteConfigPayload(e,t){var r=this.Se.token,s={distinct_id:this._instance.get_distinct_id(),token:r};this.hs()&&(s.evaluation_contexts=this.us());var i=this.ds();X(i)||(s.flag_keys=i),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:s,compression:this.Se.disable_compression?void 0:iA,timeout:this.Se.feature_flag_request_timeout_ms,callback(r){var s,i=null==(s=r.json)?void 0:s.featureFlagPayloads;t((null==i?void 0:i[e])||void 0)}})}isFeatureEnabled(e,t){if(void 0===t&&(t={}),!t.fresh||this.ts){if(this.Yn||this.getFlags()&&this.getFlags().length>0){var r=this.getFeatureFlag(e,t);return X(r)?void 0:!!r}ak.warn('isFeatureEnabled for key "'+e+aE)}}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(t=>t!==e)}receivedFeatureFlags(e,t,r){if(this.zr){this.Yn=!0;var s=this.getFlagVariants(),i=this.getFlagPayloads(),n=this.getFlagsWithDetails();!function(e,t,r,s,i,n){void 0===r&&(r={}),void 0===s&&(s={}),void 0===i&&(i={});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]}))):e.featureFlags&&ak.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e),l=o.flags,c=o.featureFlags,u=o.featureFlagPayloads;if(c){var d=e.requestId,h=e.evaluatedAt;if(G(c)){ak.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var p={};if(c)for(var g=0;c.length>g;g++)p[c[g]]=!0;t&&t.register({[ru]:c,[rc]:p})}else{var f=c,v=u,m=l;if(null!=n&&n.partialResponse)f=x({},r,f),v=x({},s,v),m=x({},i,m);else if(e.errorsWhileComputingFlags)if(l){var _=new Set(Object.keys(l).filter(e=>{var t;return!(null!=(t=l[e])&&t.failed)}));f=x({},r,Object.fromEntries(Object.entries(f).filter(e=>{var[t]=e;return _.has(t)}))),v=x({},s,Object.fromEntries(Object.entries(v||{}).filter(e=>{var[t]=e;return _.has(t)}))),m=x({},i,Object.fromEntries(Object.entries(m||{}).filter(e=>{var[t]=e;return _.has(t)})))}else f=x({},r,f),v=x({},s,v),m=x({},i,m);t&&t.register(x({[ru]:Object.keys(aN(f)),[rc]:f||{},[rp]:v||{},[rh]:m||{}},d?{[rg]:d}:{},h?{[rE]:h}:{}))}}}(e,this.zr,s,i,n,r),t||(this.ns=!1),this.ps(t)}}override(e,t){void 0===t&&(t=!1),ak.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this.zr)return ak.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===e)return this.zr.unregister(rf),this.zr.unregister(rv),this.ps(),aj.info("All overrides cleared");if(G(e)){var t,r=aC(e);return this.zr.register({[rf]:r}),this.ps(),aj.info("Flag overrides set",{flags:e})}if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){if(this.Jn=!!(null!=(t=e.suppressWarning)&&t),"flags"in e){if(!1===e.flags)this.zr.unregister(rf),aj.info("Flag overrides cleared");else if(e.flags){if(G(e.flags)){var s=aC(e.flags);this.zr.register({[rf]:s})}else this.zr.register({[rf]:e.flags});aj.info("Flag overrides set",{flags:e.flags})}}return"payloads"in e&&(!1===e.payloads?(this.zr.unregister(rv),aj.info("Payload overrides cleared")):e.payloads&&(this.zr.register({[rv]:e.payloads}),aj.info("Payload overrides set",{payloads:e.payloads}))),void this.ps()}if(e&&"object"==typeof e)return this.zr.register({[rf]:e}),this.ps(),aj.info("Flag overrides set",{flags:e});ak.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:e})}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.Yn){var{flags:t,flagVariants:r}=this.gs();e(t,r)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,r){var s,i=(this.ss(rd)||[]).find(t=>t.flagKey===e),n={["$feature_enrollment/"+e]:t},a={$feature_flag:e,$feature_enrollment:t,$set:n};i&&(a.$early_access_feature_name=i.name),r&&(a.$feature_enrollment_stage=r),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(n,!1);var o=x({},this.getFlagVariants(),{[e]:t});null==(s=this.zr)||s.register({[ru]:Object.keys(aN(o)),[rc]:o}),this.ps()}getEarlyAccessFeatures(e,t,r){void 0===t&&(t=!1);var s=this.ss(rd),i=r?"&"+r.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.Se.token+i),method:"GET",callback:t=>{var r,s;if(t.json){var i=t.json.earlyAccessFeatures;return null==(r=this.zr)||r.unregister(rd),null==(s=this.zr)||s.register({[rd]:i}),e(i)}}})}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,r)=>(e[r]=t[r],e),{})}}ps(e){var{flags:t,flagVariants:r}=this.gs();
99this.featureFlagEventHandlers.forEach(s=>s(t,r,{errorsLoading:e}))}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var r=this.ss(rm)||{},s=(null==e?void 0:e.$set)||(null!=e&&e.$set_once?{}:e),i=null==e?void 0:e.$set_once,n={};if(i)for(var a in i)({}).hasOwnProperty.call(i,a)&&(a in r||(n[a]=i[a]));this._instance.register({[rm]:x({},r,n,s)}),t&&this._instance.reloadFeatureFlags()}unsetPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var r=x({},this.ss(rm)||{});e.forEach(e=>{delete r[e]}),this._instance.register({[rm]:r}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(e){void 0===e&&(e=!0),this._instance.unregister(rm),e&&this._instance.reloadFeatureFlags()}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0);var r=this.ss(r_)||{};0!==Object.keys(r).length&&Object.keys(r).forEach(t=>{r[t]=x({},r[t],e[t]),delete e[t]}),this._instance.register({[r_]:x({},r,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this.ss(r_)||{};this._instance.register({[r_]:x({},t,{[e]:{}})})}else this._instance.unregister(r_)}reset(){this.Yn=!1,this.Kn=!1,this.Xn=!1,this.es=!1,this.ts=!1,this.$anon_distinct_id=void 0,this.fs(),this.Jn=!1}}},aA=x({productTours:class{get zr(){return this._instance.persistence}constructor(e){this.Po=null,this.Ro=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if("productTours"in e){var t,r;if(this.zr&&this.zr.register({[t9]:!!e.productTours}),!ad(this._instance))return!this.Po&&et(null==(t=this.zr)?void 0:t.props[rw])||au.info("product tours disabled; stopping and clearing cached tours"),null==(r=this.Po)||r.stop(),this.Po=null,void this.clearCache();this.loadIfEnabled()}}loadIfEnabled(){!this.Po&&ad(this._instance)&&this.Mt(()=>this.Oo())}Mt(e){var t,r;null!=(t=g.__PosthogExtensions__)&&t.generateProductTours?e():null==(r=g.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"product-tours",t=>{t?au.error("Could not load product tours script",t):e()})}Oo(){var e;!this.Po&&null!=(e=g.__PosthogExtensions__)&&e.generateProductTours&&(this.Po=g.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(void 0===t&&(t=!1),!G(this.Ro)||t){var r=this.zr;if(r){var s=r.props[rw];if(G(s)&&!t)return this.Ro=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=>{if(ad(this._instance)){var s=t.statusCode;if(200!==s||!t.json){var i="Product Tours API could not be loaded, status: "+s;return au.error(i),void e([],{isLoaded:!1,error:i})}var n=G(t.json.product_tours)?t.json.product_tours:[];this.Ro=n,r&&r.register({[rw]:n}),e(n,{isLoaded:!0})}else e([],{isLoaded:!0})}})}else e(this.Ro,{isLoaded:!0})}getActiveProductTours(e){et(this.Po)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.Po.getActiveProductTours(e)}showProductTour(e){var t;null==(t=this.Po)||t.showTourById(e)}previewTour(e){this.Po?this.Po.previewTour(e):this.Mt(()=>{var t;this.Oo(),null==(t=this.Po)||t.previewTour(e)})}dismissProductTour(){var e;null==(e=this.Po)||e.dismissTour("user_clicked_skip")}nextStep(){var e;null==(e=this.Po)||e.nextStep()}previousStep(){var e;null==(e=this.Po)||e.previousStep()}clearCache(){var e;this.Ro=null,null==(e=this.zr)||e.unregister(rw)}resetTour(e){var t;null==(t=this.Po)||t.resetTour(e)}resetAllTours(){var e;null==(e=this.Po)||e.resetAllTours()}cancelPendingTour(e){var t;null==(t=this.Po)||t.cancelPendingTour(e)}}},aO),aL=x({surveys:class{get Se(){return this._instance.config}constructor(e){this.Qo=void 0,this._surveyManager=null,this.Jo=!1,this.Yo=[],this.Ko=null,this._instance=e,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this.Se.disable_surveys){var t=e.surveys;if(et(t))return nO.warn("Flags not loaded yet. Not loading surveys.");var r=G(t);this.Qo=r?t.length>0:t,nO.info("flags response received, isSurveysEnabled: "+this.Qo),this.loadIfEnabled()}}reset(){try{var e;null==(e=this._surveyEventReceiver)||e.reset(),localStorage.removeItem("lastSeenSurveyDate");for(var t=[],r=0;r<localStorage.length;r++){var s=localStorage.key(r);(null!=s&&s.startsWith(nA)||null!=s&&s.startsWith("inProgressSurvey_"))&&t.push(s)}
99t.forEach(e=>localStorage.removeItem(e))}catch(e){}}loadIfEnabled(){if(!this._surveyManager)if(this.Jo)nO.info("Already initializing surveys, skipping...");else if(this.Se.disable_surveys)nO.info(ab);else if(this.Se.cookieless_mode&&this._instance.consent.isOptedOut())nO.info("Not loading surveys in cookieless mode without consent.");else{var e=null==g?void 0:g.__PosthogExtensions__;if(e){if(!X(this.Qo)||this.Se.advanced_enable_surveys){var t=this.Qo||this.Se.advanced_enable_surveys;this.Jo=!0;try{var r=e.generateSurveys;if(r)return void this.Xo(r,t);var s=e.loadExternalDependency;if(!s)return void this.ea(rD);s(this._instance,"surveys",r=>{r||!e.generateSurveys?this.ea("Could not load surveys script",r):this.Xo(e.generateSurveys,t)})}catch(e){throw this.ea("Error initializing surveys",e),e}finally{this.Jo=!1}}}else nO.error("PostHog Extensions not found.")}}Xo(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new a_(this._instance),nO.info("Surveys loaded successfully"),this.ta({isLoaded:!0})}ea(e,t){nO.error(e,t),this.ta({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.Yo.push(e),this._surveyManager&&this.ta({isLoaded:!0}),()=>{this.Yo=this.Yo.filter(t=>t!==e)}}getSurveys(e,t){if(void 0===t&&(t=!1),this.Se.disable_surveys)return nO.info(ab),e([]);var r,s=this._instance.get_property(rx);if(s&&!t)return e(s,{isLoaded:!0});"u">typeof Promise&&this.Ko?this.Ko.then(t=>{var{surveys:r,context:s}=t;return e(r,s)}):("u">typeof Promise&&(this.Ko=new Promise(e=>{r=e})),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this.Se.token),method:"GET",timeout:this.Se.surveys_request_timeout_ms,callback:t=>{this.Ko=null;var s=t.statusCode;if(200!==s||!t.json){var i="Surveys API could not be loaded, status: "+s;nO.error(i);var n={isLoaded:!1,error:i};return e([],n),void(null==r||r({surveys:[],context:n}))}var a,o,l=t.json.surveys||[],c=l.filter(e=>{var t,r;return!(!e.start_date||e.end_date)&&(!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)||!(null==(r=e.conditions)||null==(r=r.actions)||null==(r=r.values)||!r.length))});c.length>0&&(null==(o=this._surveyEventReceiver)||o.register(c)),null==(a=this._instance.persistence)||a.register({[rx]:l,[rb]:Date.now()});var u={isLoaded:!0};e(l,u),null==r||r({surveys:l,context:u})}}))}ta(e){for(var t of this.Yo)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(e){nO.error("Error in survey callback",e)}}getActiveMatchingSurveys(e,t){if(void 0===t&&(t=!1),!et(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);nO.warn("init was not called")}ra(e){var t=null;return this.getSurveys(r=>{var s;t=null!=(s=r.find(t=>t.id===e))?s:null}),t}ia(e){if(et(this._surveyManager))return{eligible:!1,reason:ax};var t="string"==typeof e?this.ra(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(et(this._surveyManager))return nO.warn("init was not called"),{visible:!1,disabledReason:ax};var t=this.ia(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return et(this._surveyManager)?(nO.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:ax})):new Promise(r=>{this.getSurveys(t=>{var s,i=null!=(s=t.find(t=>t.id===e))?s:null;if(i){var n=this.ia(i);r({visible:n.eligible,disabledReason:n.reason})}else r({visible:!1,disabledReason:"Survey not found"})},t)})}renderSurvey(e,t,r){var s;if(et(this._surveyManager))nO.warn("init was not called");else{var i="string"==typeof e?this.ra(e):e;if(null!=i&&i.id)if(nL.includes(i.type)){var n=null==o?void 0:o.querySelector(t);if(n)return null!=(s=i.appearance)&&s.surveyPopupDelaySeconds?(nO.info("Rendering survey "+i.id+" with delay of "+i.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout(()=>{var e,t;nO.info("Rendering survey "+i.id+" with delay of "+(null==(e=i.appearance)?void 0:e.surveyPopupDelaySeconds)+" seconds"),null==(t=this._surveyManager)||t.renderSurvey(i,n,r),nO.info("Survey "+i.id+" rendered")},1e3*i.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(i,n,r);nO.warn("Survey element not found")}else nO.warn("Surveys of type "+i.type+" cannot be rendered in the app");else nO.warn("Survey not found")}}displaySurvey(e,t){var r;if(et(this._surveyManager))nO.warn("init was not called");else{var s=this.ra(e);if(s){var i=s;
99if(null!=(r=s.appearance)&&r.surveyPopupDelaySeconds&&t.ignoreDelay&&(i=x({},s,{appearance:x({},s.appearance,{surveyPopupDelaySeconds:0})})),t.displayType!==i$&&t.initialResponses&&nO.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 nO.warn("Survey is not eligible to be displayed: ",n.disabledReason)}"inline"!==t.displayType?this._surveyManager.handlePopoverSurvey(i,t):this.renderSurvey(i,t.selector,t.properties)}else nO.warn("Survey not found")}}cancelPendingSurvey(e){et(this._surveyManager)?nO.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;null==(e=this._surveyManager)||e.handlePageUnload()}}},aO),aD=x({experiments:aI},aO),az=x({},aO,{sessionRecording:class{get Se(){return this._instance.config}get zr(){return this._instance.persistence}get started(){var e;return!(null==(e=this.ys)||!e.isStarted)}get status(){var e,t;return this.bs===ai||this.bs===an?this.bs:null!=(e=null==(t=this.ys)?void 0:t.status)?e:this.bs}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.bs=ar,this._s=void 0,this._instance=e,!this._instance.sessionManager)throw ao.error("started without valid sessionManager"),Error(aa+" started without valid sessionManager. This is a bug.");if(this.Se.cookieless_mode===rH)throw Error(aa+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get ws(){var e,t=!(null==(e=this._instance.get_property(rt))||!e.enabled),r=!this.Se.disable_session_recording,s=this.Se.disable_session_recording||this._instance.consent.isOptedOut();return i&&t&&r&&!s}startIfEnabledOrStop(e){var t;if(!this.ws||null==(t=this.ys)||!t.isStarted){var r=!X(Object.assign)&&!X(Array.from);this.ws&&r?(this.xs(e),ao.info("starting")):(this.bs=ar,this.stopRecording())}}xs(e){var t,r,s;this.ws&&(this.bs!==ai&&this.bs!==an&&(this.bs=as),null!=g&&null!=(t=g.__PosthogExtensions__)&&null!=(t=t.rrweb)&&t.record&&null!=(r=g.__PosthogExtensions__)&&r.initSessionRecording?this.ks(e):null==(s=g.__PosthogExtensions__)||null==s.loadExternalDependency||s.loadExternalDependency(this._instance,this.Ss,t=>{if(t)return ao.error("could not load recorder",t);this.ks(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,t;null==(e=this.zr)||e.unregister(rl),null==(t=this.zr)||t.unregister(rr)}Ts(e,t){if(et(e))return null;var r=er(e)?e:parseFloat(e);return"number"!=typeof r||!Number.isFinite(r)||0>r||r>1?(ao.warn(t+" must be between 0 and 1. Ignoring invalid value:",e),null):r}Es(e){if(this.zr){var t,r,s=this.zr,i=()=>{var t,r=!1===e.sessionRecording?void 0:e.sessionRecording,i=this.Ts(null==(t=this.Se.session_recording)?void 0:t.sampleRate,"session_recording.sampleRate"),n=this.Ts(null==r?void 0:r.sampleRate,"remote config sampleRate"),a=null!=i?i:n;et(a)&&this.Is();var o=null==r?void 0:r.minimumDurationMilliseconds;s.register({[rt]:x({cache_timestamp:Date.now(),enabled:!!r},r,{networkPayloadCapture:x({capturePerformance:e.capturePerformance},null==r?void 0:r.networkPayloadCapture),canvasRecording:{enabled:null==r?void 0:r.recordCanvas,fps:null==r?void 0:r.canvasFps,quality:null==r?void 0:r.canvasQuality},sampleRate:a,minimumDurationMilliseconds:X(o)?null:o,endpoint:null==r?void 0:r.endpoint,triggerMatchType:null==r?void 0:r.triggerMatchType,masking:null==r?void 0:r.masking,urlTriggers:null==r?void 0:r.urlTriggers,version:null==r?void 0:r.version,triggerGroups:null==r?void 0:r.triggerGroups})})};i(),null==(t=this._s)||t.call(this),this._s=null==(r=this._instance.sessionManager)?void 0:r.onSessionId(i)}}onRemoteConfig(e){return"sessionRecording"in e?!1===e.sessionRecording?(this.Es(e),void this.Cs()):(this.Es(e),void this.startIfEnabledOrStop()):(this.bs===ai&&(this.bs=an,ao.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(e,t){var r;void 0===t&&(t="log"),null!=(r=this.ys)&&r.log?this.ys.log(e,t):ao.warn("log called before recorder was ready")}get Ss(){var e,t,r=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.get_property(rt);return(null==r||null==(t=r.scriptConfig)?void 0:t.script)||"lazy-recorder"}Ms(){var e,t,r=this._instance.get_property(rt);if(!r)return!1;try{t="object"==typeof r?r:JSON.parse(r)}catch(e){return ao.warn("persisted remote config for session recording is invali
99d and will be ignored",e),!1}var s=null!=(e=t.cache_timestamp)?e:Date.now();return 36e5>=Date.now()-s}ks(e){var t,r;if(null==(t=g.__PosthogExtensions__)||!t.initSessionRecording)return ao.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[rL]:!0});if(this.ys||(this.ys=null==(r=g.__PosthogExtensions__)?void 0:r.initSessionRecording(this._instance),this.ys._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.Ms()){if(this.bs===an||this.bs===ai)return;return this.bs=ai,ao.info("persisted remote config is stale, requesting fresh config before starting"),void new iM(this._instance).load()}this.bs=as,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.zr)||t.register({[ri]:!0}),null==(e=this.ys)||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.ys||null==(t=this.zr)||t.register({[rs]:!0}),null==(e=this.ys)||e.overrideSampling()}overrideTrigger(e){var t,r;this.ys||null==(r=this.zr)||r.register({["url"===e?rn:ra]:!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 r;return!(null==(r=this.ys)||!r.tryAddCustomEvent(e,t))}}},{autocapture:class{constructor(e){this.Ps=!1,this.Rs=null,this.Os=!1,this.instance=e,this.rageclicks=new n5(e.config.rageclick),this.Ls=null}initialize(){this.startIfEnabled()}get Se(){var e,t,r=K(this.instance.config.autocapture)?this.instance.config.autocapture:{};return r.url_allowlist=null==(e=r.url_allowlist)?void 0:e.map(e=>new RegExp(e)),r.url_ignorelist=null==(t=r.url_ignorelist)?void 0:t.map(e=>new RegExp(e)),r}Fs(){if(this.isBrowserSupported()){if(i&&o){var e=e=>{e=e||(null==i?void 0:i.event);try{this.As(e)}catch(e){n6.error("Failed to capture event",e)}};if(r5(o,"submit",e,{capture:!0}),r5(o,"change",e,{capture:!0}),r5(o,"click",e,{capture:!0}),this.Se.capture_copied_text){var t=e=>{e=e||(null==i?void 0:i.event);try{this.As(e,n7)}catch(e){n6.error("Failed to capture copy/cut event",e)}};r5(o,"copy",t,{capture:!0}),r5(o,"cut",t,{capture:!0})}}}else n6.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({[t3]:!!e.autocapture_opt_out}),this.Rs=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.Ls=e}getElementSelectors(e){var t,r=[];return null==(t=this.Ls)||t.forEach(t=>{var s=null==o?void 0:o.querySelectorAll(t);null==s||s.forEach(s=>{e===s&&r.push(t)})}),r}get isEnabled(){var e,t,r=null==(e=this.instance.persistence)?void 0:e.props[t3];if(ee(this.Rs)&&!ei(r)&&!this.instance.mr())return!1;var s=null!=(t=this.Rs)?t:!!r;return!!this.instance.config.autocapture&&!s}As(e,t){if(void 0===t&&(t="$autocapture"),this.isEnabled){var r,s=sP(e);sw(s)&&(s=s.parentNode||null),"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent&&this.instance.config.rageclick&&null!=(r=this.rageclicks)&&r.isRageClick(e.clientX,e.clientY,e.timeStamp||(new Date).getTime())&&sD(s,this.instance.config.rageclick)&&this.As(e,"$rageclick");var n=t===n7;if(s&&function(e,t,r,s,n,a){if(void 0===r&&(r=void 0),!i||sz(e)||null!=(o=r)&&o.url_allowlist&&!sj(r.url_allowlist,a)||null!=(l=r)&&l.url_ignorelist&&sj(r.url_ignorelist,a))return!1;if(null!=(c=r)&&c.dom_event_allowlist){var o,l,c,u,d,h,p=r.dom_event_allowlist;if(p&&!p.some(e=>t.type===e))return!1}var{parentIsUsefulElement:g,targetElementList:f}=sH(e,s);if(!function(e,t){var r=null==t?void 0:t.element_allowlist;if(X(r))return!0;var s,i=function(e){if(r.some(t=>e.tagName.toLowerCase()===t))return{v:!0}};for(var n of e)if(s=i(n))return s.v;return!1}(f,r)||!s$(f,null==(u=r)?void 0:u.css_selector_allowlist)||s$(f,null!=(d=null==(h=r)?void 0:h.css_selector_ignorelist)?d:sT))return!1;var v=i.getComputedStyle(e);
99if(v&&"pointer"===v.getPropertyValue("cursor")&&"click"===t.type)return!0;var m=e.tagName.toLowerCase();switch(m){case"html":return!1;case"form":return(n||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(t.type)>=0;default:return g?(n||["click"]).indexOf(t.type)>=0:(n||["click"]).indexOf(t.type)>=0&&(sF.indexOf(m)>-1||"true"===e.getAttribute("contenteditable"))}}(s,e,this.Se,n,n?["copy","cut"]:void 0,this.instance)){var{props:a,explicitNoCapture:o}=function(e,t){var r,s,{e:n,maskAllElementAttributes:a,maskAllText:o,elementAttributeIgnoreList:l,elementsChainAsString:c,disableCaptureUrlHashes:u}=t;if(!sb(e))return{props:{}};for(var d=[e],h=e;h.parentNode&&!sy(h,"body");)if(sS(h.parentNode))d.push(h.parentNode.host),h=h.parentNode.host;else{if(!sb(h.parentNode))break;d.push(h.parentNode),h=h.parentNode}var p,g=[],f={},v=!1,m=!1;if(rQ(d,e=>{var t=sq(e);if(sy(e,"a")){var r=e.getAttribute("href");v=!!(t&&r&&sJ(r))&&(u?tc(r):r)}H(sE(e),"ph-no-capture")&&(m=!0),g.push(function(e,t,r,s,i){void 0===i&&(i=!1);var n=e.tagName.toLowerCase(),a={tag_name:n};sF.indexOf(n)>-1&&!r&&(a.$el_text="a"===n.toLowerCase()||"button"===n.toLowerCase()?n8(1024,sX(e)):n8(1024,sN(e)));var o=sE(e);o.length>0&&(a.classes=o.filter(function(e){return""!==e})),rQ(e.attributes,function(r){var n;if((!sU(e)||-1!==["name","id","class","aria-label"].indexOf(r.name))&&(null==s||!s.includes(r.name))&&!t&&sJ(r.value)&&(!Q(n=r.name)||"_ngcontent"!==n.substring(0,10)&&"_nghost"!==n.substring(0,7))){var o=r.value;"class"===r.name&&(o=sk(o).join(" ")),a["attr__"+r.name]=n8(1024,"href"===r.name&&i?tc(o):o)}});for(var l=1,c=1,u=e;u=function(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!sb(t))return t}(u);)l++,u.tagName===e.tagName&&c++;return a.nth_child=l,a.nth_of_type=c,a}(e,a,o,l,u)),rZ(f,function(e){if(!sq(e))return{};var t={};return rQ(e.attributes,function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){var r=e.name.replace("data-ph-capture-attribute-",""),s=e.value;r&&s&&sJ(s)&&(t[r]=s)}}),t}(e))}),m)return{props:{},explicitNoCapture:m};if(o||(g[0].$el_text=sy(e,"a")||sy(e,"button")?sX(e):sN(e)),v){g[0].attr__href=v;var _,b,y=null==(_=ir(v))?void 0:_.host,w=null==i||null==(b=i.location)?void 0:b.host;y&&w&&y!==w&&(p=v)}return{props:rZ({$event_type:n.type,$ce_version:1},c?{}:{$elements:g},{$elements_chain:g.map(e=>{var t,r,s,i={text:null==(r=e.$el_text)?void 0:r.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)?G(t)?t:sk(t):void 0,attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return r0(e).filter(e=>{var[t]=e;return 0===t.indexOf("attr__")}).forEach(e=>{var[t,r]=e;return i.attributes[t]=r}),i}).map(e=>{var t,r,s="";if(e.tag_name&&(s+=e.tag_name),e.attr_class)for(var i of(e.attr_class.sort(),e.attr_class))s+="."+i.replace(/"/g,"");var n=x({},e.text?{text:e.text}:{},{"nth-child":null!=(t=e.nth_child)?t:0,"nth-of-type":null!=(r=e.nth_of_type)?r:0},e.href?{href:e.href}:{},e.attr_id?{attr_id:e.attr_id}:{},e.attributes),a={};return r0(n).sort((e,t)=>{var[r]=e,[s]=t;return r.localeCompare(s)}).forEach(e=>{var[t,r]=e;return a[sQ(t.toString())]=sQ(r.toString())}),(s+=":")+r0(a).map(e=>{var[t,r]=e;return t+'="'+r+'"'}).join("")}).join(";")},null!=(r=g[0])&&r.$el_text?{$el_text:null==(s=g[0])?void 0:s.$el_text}:{},p&&"click"===n.type?{$external_click_url:p}:{},f)}}(s,{e:e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Se.element_attribute_ignorelist,elementsChainAsString:this.Os,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes});if(o)return!1;var l=this.getElementSelectors(s);if(l&&l.length>0&&(a.$element_selectors=l),t===n7){var c,u=sC(null==i||null==(c=i.getSelection())?void 0:c.toString()),d=e.type||"clipboard";if(!u)return!1;a.$selected_content=u,a.$copy_type=d}return this.instance.capture(t,a),!0}}}isBrowserSupported(){return Y(null==o?void 0:o.querySelectorAll)}},historyAutocapture:class{constructor(e){var t;this._instance=e,this.$s=(null==i||null==(t=i.location)?void 0:t.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.Ds&&this.Ds(),this.Ds=void 0,tG.info("History API monitoring stopped")}monitorHistoryChanges(){i&&i.history&&(this.Ns("pushState"),this.Ns("replaceState"),this.qs())}Ns(e){var t;if(i&&(null==(t=i.history[e])||!t.__posthog_wrapped__)){var r=this;!function(e,t,r){try{if(!(t in e))return()=>{};var s=e[t],i=r(s);Y(i)&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=i}catch(e){return()=>{}}}(i.history,e,t=>function(s,i,n){t.call(this,s,i,n),r.js(e)})}}js(e){try{var t,r=null==i||null==(t=i.location)?void 0:t.pathname;if(!r)return;r!==this.$s&&this.isEnabled&&this._instance.capture(rG,{navigation_type:e}),this.$s=r}catch(t){tG.error("Error capturing "+e+" pageview",t)}}qs(){if(!this.Ds){var e=()=>{this.js("popstate")};r5(i,"popstate",e),this.Ds=()=>{i&&i.removeEventListener("popstate",e)}}}},heatmaps:class{get Se(){return this.instance.config}constructor(e){var t;this.Bs=!1,this.Ps=!1,this.Hs=null,this.instance=e,this.Bs=!(null==(t=this.instance.persistence)||!t.props[t2]),this.rageclicks=new n5(e.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var e=5e3;return K(this.Se.capture_heatmaps)&&this.Se.capture_heatmaps.flush_interval_milliseconds&&(e=this.Se.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return et(this.Se.capture_heatmaps)?et(this.Se.enable_heatmaps)?this.Bs:this.Se.enable_heatmaps:!1!==this.Se.capture_heatmaps}
99startIfEnabled(){if(this.isEnabled)this.Ps||(al.info("starting..."),this.Us(),this.ke());else{var e;clearInterval(null!=(e=this.Hs)?e:void 0),this.zs(),this.getAndClearBuffer()}}onRemoteConfig(e){if("heatmaps"in e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[t2]:t}),this.Bs=t,this.startIfEnabled()}}getAndClearBuffer(){var e=this.R;return this.R=void 0,e}Vs(e){this.fe(e.originalEvent,"deadclick")}ke(){this.Hs&&clearInterval(this.Hs),this.Hs="visible"===(null==o?void 0:o.visibilityState)?setInterval(this.Lr.bind(this),this.flushIntervalMilliseconds):null}Us(){i&&o&&(this.Ws=this.Lr.bind(this),r5(i,rV,this.Ws),this.Gs=e=>this.fe(e||(null==i?void 0:i.event)),r5(o,"click",this.Gs,{capture:!0}),this.Zs=e=>this.Qs(e||(null==i?void 0:i.event)),r5(o,"mousemove",this.Zs,{capture:!0}),this.Js=new s3(this.instance,s0,this.Vs.bind(this)),this.Js.startIfEnabledOrStop(),this.Ys=this.ke.bind(this),r5(o,rW,this.Ys),this.Ps=!0)}zs(){var e;i&&o&&(this.Ws&&i.removeEventListener(rV,this.Ws),this.Gs&&o.removeEventListener("click",this.Gs,{capture:!0}),this.Zs&&o.removeEventListener("mousemove",this.Zs,{capture:!0}),this.Ys&&o.removeEventListener(rW,this.Ys),clearTimeout(this.Ks),null==(e=this.Js)||e.stop(),this.Ps=!1)}Xs(e,t){var r=this.instance.scrollManager.scrollY(),s=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),a=function(e,t,r){for(var s=e;
99s&&sb(s)&&!sy(s,"body")&&s!==r;){if(H(t,null==i?void 0:i.getComputedStyle(s).position))return!0;s=sI(s)}return!1}(sP(e),["fixed","sticky"],n);return{x:e.clientX+(a?0:s),y:e.clientY+(a?0:r),target_fixed:a,type:t}}fe(e,t){var r;if(void 0===t&&(t="click"),!sx(e.target)&&ac(e)){var s=this.Xs(e,t);null!=(r=this.rageclicks)&&r.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&sD(sP(e),this.instance.config.rageclick)&&this.eo(x({},s,{type:"rageclick"})),this.eo(s)}}Qs(e){!sx(e.target)&&ac(e)&&(clearTimeout(this.Ks),this.Ks=setTimeout(()=>{this.eo(this.Xs(e,"mousemove"))},500))}eo(e){if(i){var t=this.Se.disable_capture_url_hashes?tc(i.location.href):i.location.href,r=this.Se.custom_personal_data_properties,s=ii(t,this.Se.mask_personal_data_properties?[...il,...r||[]]:[],iu);this.R=this.R||{},this.R[s]||(this.R[s]=[]),this.R[s].push(e)}}Lr(){this.R&&!J(this.R)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:s3,webVitalsAutocapture:class{constructor(e){var t;this.Bs=!1,this.Ps=!1,this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.ro=()=>{clearTimeout(this.io),0!==this.R.metrics.length&&(this._instance.capture("$web_vitals",this.R.metrics.reduce((e,t)=>x({},e,{["$web_vitals_"+t.name+"_event"]:x({},t),["$web_vitals_"+t.name+"_value"]:t.value}),{})),this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.no=e=>{this.R=this.R||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var t,r=this.so();if(!X(r))if(et(null==e?void 0:e.name)||et(null==e?void 0:e.value))at.error("Invalid metric received",e);else if(!this.oo||this.oo>e.value){this.R.url!==r&&(this.ro(),this.io=setTimeout(this.ro,this.flushToCaptureTimeoutMs)),X(this.R.url)&&(this.R.url=r),this.R.firstMetricTimestamp=X(this.R.firstMetricTimestamp)?Date.now():this.R.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0);var s=null==(t=this._instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0),i=x({},e,{$current_url:r,timestamp:Date.now()});X(s)||(i.$session_id=s.sessionId,i.$window_id=s.windowId),this.R.metrics.push(i),this.R.metrics.length===this.allowedMetrics.length&&this.ro()}else at.error("Ignoring metric with value >= "+this.oo,e)},this.ao=()=>{if(!this.Ps){var e,t,r,s,i=g.__PosthogExtensions__;X(i)||X(i.postHogWebVitalsCallbacks)||({onLCP:e,onCLS:t,onFCP:r,onINP:s}=i.postHogWebVitalsCallbacks),e&&t&&r&&s?(this.allowedMetrics.indexOf("LCP")>-1&&e(this.no.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&t(this.no.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&r(this.no.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&s(this.no.bind(this)),this.Ps=!0):at.error("web vitals callbacks not loaded - not starting")}},this._instance=e,this.Bs=!(null==(t=this._instance.persistence)||!t.props[t6]),this.startIfEnabled()}get lo(){return this._instance.config.capture_performance}get allowedMetrics(){var e,t,r=K(this.lo)?null==(e=this.lo)?void 0:e.web_vitals_allowed_metrics:void 0;return et(r)?(null==(t=this._instance.persistence)?void 0:t.props[re])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(K(this.lo)?this.lo.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var e=K(this.lo)?this.lo.web_vitals_attribution:void 0;return null!=e&&e}get oo(){var e=K(this.lo)&&er(this.lo.__web_vitals_max_value)?this.lo.__web_vitals_max_value:9e5;return e>0&&6e4>=e?9e5:e}get isEnabled(){var e=null==l?void 0:l.protocol;if("http:"!==e&&"https:"!==e)return at.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=K(this.lo)?this.lo.web_vitals:ei(this.lo)?this.lo:void 0;return ei(t)?t:this.Bs}startIfEnabled(){this.isEnabled&&!this.Ps&&(at.info("enabled, starting..."),this.Mt(this.ao))}onRemoteConfig(e){if("capturePerformance"in e){var t=K(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=K(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[t6]:t}),this._instance.persistence.register({[re]:r})),this.Bs=t,this.startIfEnabled()}}Mt(e){var t,r;null!=(t=g.__PosthogExtensions__)&&t.postHogWebVitalsCallbacks?e():null==(r=g.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,this.useAttribution?"web-vitals-with-attribution":"web-vitals",t=>{t?at.error("failed to load script",t):e()})}so(){var e=i?this._instance.config.disable_capture_url_hashes?tc(i.location.href):i.location.href:void 0;if(e){var t=this._instance.config.custom_personal_data_properties;return ii(e,this._instance.config.mask_personal_data_properties?[...il,...t||[]]:[],iu)}at.error("Could not determine current URL")}}},{exceptionObserver:class{constructor(e){var t,r,s;this.ao=()=>{var e;if(i&&this.isEnabled&&null!=(e=g.__PosthogExtensions__)&&e.errorWrappingFunctions){var t=g.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=g.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,s=g.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.uo&&this.Se.capture_unhandled_errors&&(this.uo=t(this.captureException.bind(this))),!this.ho&&this.Se.capture_unhandled_rejections&&(this.ho=r(this.captureException.bind(this))),!this.do&&this.Se.capture_console_errors&&(this.do=s(this.captureException.bind(this)))}catch(e){n9.error("failed to start",e),this.co()}}},this._instance=e,this.vo=!(null==(t=this._instance.persistence)||!t.props[t4]),this.fo=new ep({refillRate:null!=(r=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)?r:1,bucketSize:null!=(s=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)?s:10,refillInterval:1e4,Ae:n9}),this.Se=this.po(),this.startIfEnabledOrStop()}po(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return K(e)?t=x({},t,e):(X(e)?this.vo:e)&&(t=x({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.Se.capture_console_errors||this.Se.capture_unhandled_errors||this.Se.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(n9.info("enabled"),this.co(),this.Mt(this.ao)):this.co()}Mt(e){var t,r;null!=(t=g.__PosthogExtensions__)&&t.errorWrappingFunctions?e():null==(r=g.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"exception-autocapture",t=>{if(t)return n9.error("failed to load script",t);e()})}co(){var e,t,r;null==(e=this.uo)||e.call(this),this.uo=void 0,null==(t=this.ho)||t.call(this),this.ho=void 0,null==(r=this.do)||r.call(this),this.do=void 0}onRemoteConfig(e){"autocaptureExceptions"in e&&(this.vo=!!e.autocaptureExceptions,this._instance.persistence&&this._instance.persistence.register({[t4]:this.vo}),this.Se=this.po(),this.startIfEnabledOrStop())}onConfigChange(){this.Se=this.po()}captureException(e){var t,r,s,i=null!=(t=null==e||null==(r=e.$exception_list)||null==(r=r[0])?void 0:r.type)?t:"Exception";this.fo.consumeRateLimit(i)?n9.info("Skipping exception capture because of client rate limiting.",{exception:i}):null==(s=this._instance.exceptions)||s.sendExceptionEvent(e)}},exceptions:class{constructor(e){var t,r;this.mo=[],this.yo=new t_([new tP,new tD,new t$,new tF,new tA,new tO,new tT,new tL],function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),s=1;t>s;s++)r[s-1]=arguments[s];return function(t,s){void 0===s&&(s=0);for(var i=[],n=t.split("\n"),a=s;n.length>a;a++){var o=n[a];if(1024>=o.length){var l=tN.test(o)?o.replace(tN,"$1"):o;if(!l.match(/\S*Error: /)){for(var c of r){var u=c(l,e);if(u){i.push(u);break}}if(i.length>=50)break}}}if(!i.length)return[];var d=Array.from(i);return d.reverse(),d.slice(0,50).map(e=>x({},e,{filename:e.filename||(d[d.length-1]||{}).filename,function:e.function||"?"}))}}
99("web:javascript",tk,tC)),this._instance=e,this.mo=null!=(t=null==(r=this._instance.persistence)?void 0:r.get_property(t5))?t:[],this.bo=tB(this._o()),this.wo=new tW(this.bo)}onConfigChange(){this.bo=tB(this._o()),this.wo.setConfig(this.bo)}onRemoteConfig(e){var t,r,s;if("errorTracking"in e){var i=null!=(t=null==(r=e.errorTracking)?void 0:r.suppressionRules)?t:[],n=null==(s=e.errorTracking)?void 0:s.captureExtensionExceptions;this.mo=i,this._instance.persistence&&this._instance.persistence.register({[t5]:this.mo,[t7]:n})}}get xo(){var e,t=!!this._instance.get_property(t7),r=this._instance.config.error_tracking.captureExtensionExceptions;return null!=(e=null!=r?r:t)&&e}buildProperties(e,t){return this.yo.buildFromUnknown(e,{syntheticException:null==t?void 0:t.syntheticException,mechanism:{handled:null==t?void 0:t.handled}})}addExceptionStep(e,t){if(this.bo.enabled)try{if(!Q(e)||0===e.trim().length)return void aP.warn("Ignoring exception step because message must be a non-empty string");var r=this.ko(t),{sanitizedProperties:s,droppedKeys:i}=function(e){if(!e)return{sanitizedProperties:{},droppedKeys:[]};var t=[];return{sanitizedProperties:Object.keys(e).reduce((r,s)=>(tq.has(s)?t.push(s):r[s]=e[s],r),{}),droppedKeys:t}}(r);i.length>0&&aP.warn("Ignoring reserved exception step fields",{droppedKeys:i}),this.wo.add(x({[tz]:e,[tH]:(new Date).toISOString()},s))}catch(e){aP.error("Failed to add exception step. Ignoring breadcrumb.",e)}}sendExceptionEvent(e){try{var t=e.$exception_list;if(this.So(t)){if(this.Co(t))return this.Io("Exception dropped: matched a suppression rule"),void aP.info("Skipping exception capture because a suppression rule matched");if(!this.xo&&this.To(t))return this.Io("Exception dropped: thrown by a browser extension"),void aP.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Eo(t))return this.Io("Exception dropped: thrown by the PostHog SDK"),void aP.info("Skipping exception capture because it was thrown by the PostHog SDK")}var r=this.bo.enabled&&et(e.$exception_steps)?this.Mo(e):e;try{var s=this._instance.capture("$exception",r,{_noTruncate:!0,_batchKey:"exceptionEvent",Zi:!0});return s&&this.wo.clear(),s}catch(e){return aP.error("Failed to capture exception event. Dropping this exception.",e),void this.wo.clear()}}catch(e){return void aP.error("Failed to process exception event. Ignoring this exception.",e)}}Mo(e){try{var t=this.wo.getAttachable();return 0===t.length?e:x({},e,{$exception_steps:t})}catch(t){return aP.error("Failed to read buffered exception steps. Capturing exception without steps.",t),e}}Io(e){this.bo.enabled&&this.wo.add({[tz]:e,[tH]:(new Date).toISOString()})}ko(e){return K(e)?x({},e):{}}_o(){var e,t;return null!=(e=null==(t=this._instance.config.error_tracking)?void 0:t.exception_steps)?e:{}}Co(e){if(0===e.length)return!1;var t=e.reduce((e,t)=>{var{type:r,value:s}=t;return Q(r)&&r.length>0&&e.$exception_types.push(r),Q(s)&&s.length>0&&e.$exception_values.push(s),e},{$exception_types:[],$exception_values:[]});return this.mo.some(e=>{var r=e.values.map(e=>{var r,s=nP[e.operator],i=G(e.value)?e.value:[e.value],n=null!=(r=t[e.key])?r:[];return i.length>0&&s(i,n)});return"OR"===e.type?r.some(Boolean):r.every(Boolean)})}To(e){return e.flatMap(e=>{var t,r;return null!=(t=null==(r=e.stacktrace)?void 0:r.frames)?t:[]}).some(e=>e.filename&&e.filename.startsWith("chrome-extension://"))}Eo(e){if(e.length>0){var t,r,s,i,n=null!=(t=null==(r=e[0].stacktrace)?void 0:r.frames)?t:[],a=n[n.length-1];return null!=(s=null==a||null==(i=a.filename)?void 0:i.includes("posthog.com/static"))&&s}return!1}So(e){return!et(e)&&G(e)}}},aA,{siteApps:class{constructor(e){this.Lo=0,this._instance=e,this.Fo=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Ao(e,t){if(t){var r=this.globalsForEvent(t);this.Fo.push(r),this.Fo.length>1e3&&(this.Fo=this.Fo.slice(10))}}get siteAppLoaders(){var e;return null==(e=g._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.siteApps}initialize(){if(this.isEnabled){var e=this._instance._addCaptureHook(this.Ao.bind(this));this.$o=()=>{e(),this.Fo=[],this.$o=void 0}}}globalsForEvent(e){if(!e)throw Error("Event payload is required");var t,r,s,i,n,a,o,l={},c=this._instance.get_property("$groups")||[];for(var[u,d]of Object.entries(this._instance.get_property("$stored_group_properties")||{}))l[u]={id:c[u],type:u,properties:d};var{$set_once:h,$set:p}=e;return{event:x({},b(e,ah),{properties:x({},e.properties,p?{$set:x({},null!=(t=null==(r=e.properties)?void 0:r.$set)?t:{},p)}:{},h?{$set_once:x({},null!=(s=null==(i=e.properties)?void 0:i.$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}}Do(e){var t,r=null==(t=e.tagName)?void 0:t.toLowerCase();return"style"===r&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(e)||(ap.error("prepare_external_dependency_stylesheet returned null"),null):"script"===r&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(e)||(ap.error("prepare_external_dependency_script returned null"),null):e}No(){if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};var e,t,r,s,i,n,a,l,c=null==o?void 0:o.defaultView,u=null==c||null==(e=c.Node)?void 0:e.prototype;if(!c||!u)return()=>{};if(this.Lo++,this.qo)return this.jo();var d=[],h=this,p=new WeakSet,g=(e,t,r)=>{if(null!=e&&e[t]){var s=e[t];e[t]=r(s),d.push(()=>{e[t]=s})}},f=e=>{if(p.has(e))return e;var t=h.Do(e);return t&&p.add(t),t},v=e=>e.map(e=>"string"==typeof e?e:f(e)).filter(e=>!ee(e));return g(u,"appendChild",e=>function(t){var r=f(t);return r?e.call(this,r):t}),g(u,"insertBefore",e=>function(t,r){var s=f(t);return s?e.call(this,s,r):t}),g(u,"replaceChild",e=>function(t,r){var s=f(t);return s?e.call(this,s,r):r}),[null==(t=c.Element)?void 0:t.prototype,null==(r=c.Document)?void 0:r.prototype,null==(s=c.DocumentFragment)?void 0:s.prototype].forEach(e
99=>{g(e,"append",e=>function(){for(var t=arguments.length,r=Array(t),s=0;t>s;s++)r[s]=arguments[s];return e.apply(this,v(r))}),g(e,"prepend",e=>function(){for(var t=arguments.length,r=Array(t),s=0;t>s;s++)r[s]=arguments[s];return e.apply(this,v(r))})}),[null==(i=c.Element)?void 0:i.prototype,null==(n=c.CharacterData)?void 0:n.prototype,null==(a=c.DocumentType)?void 0:a.prototype].forEach(e=>{g(e,"before",e=>function(){for(var t=arguments.length,r=Array(t),s=0;t>s;s++)r[s]=arguments[s];return e.apply(this,v(r))}),g(e,"after",e=>function(){for(var t=arguments.length,r=Array(t),s=0;t>s;s++)r[s]=arguments[s];return e.apply(this,v(r))}),g(e,"replaceWith",e=>function(){for(var t=arguments.length,r=Array(t),s=0;t>s;s++)r[s]=arguments[s];var i=v(r);return r.length&&!i.length?void 0:e.apply(this,i)})}),g(null==(l=c.Element)?void 0:l.prototype,"insertAdjacentElement",e=>function(t,r){var s=f(r);return s?e.call(this,t,s):null}),this.qo=()=>{d.forEach(e=>e()),this.qo=void 0},this.jo()}jo(){var e=!1;return()=>{var t;e||(e=!0,this.Lo--,0===this.Lo&&(null==(t=this.qo)||t.call(this)))}}Bo(e,t){void 0===t&&(t=!0);var r=this.No();try{var s=e(r);return t&&r(),s}catch(e){throw r(),e}}setupSiteApp(e){var t=this.apps[e.id],r=()=>{var r;!t.errored&&this.Fo.length&&(ap.info("Processing "+this.Fo.length+" events for site app with id "+e.id),this.Fo.forEach(e=>this.Bo(()=>null==t.processEvent?void 0:t.processEvent(e))),t.processedBuffer=!0),Object.values(this.apps).every(e=>e.processedBuffer||e.errored)&&(null==(r=this.$o)||r.call(this))},s=!1,i=i=>{t.errored=!i,t.loaded=!0,ap.info("Site app with id "+e.id+" "+(i?"loaded":"errored")),s&&r()};try{var{processEvent:n}=this.Bo(t=>e.init({posthog:this._instance,callback(e){t(),i(e)}}),!1);n&&(t.processEvent=n),s=!0}catch(t){ap.error(ag+e.id,t),i(!1)}if(s&&t.loaded)try{r()}catch(r){ap.error("Error while processing buffered events PostHog app with config id "+e.id,r),t.errored=!0}}Ho(){var e=this.siteAppLoaders||[];for(var t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(var r of e)this.setupSiteApp(r)}Uo(e){var t=this;if(0!==Object.keys(this.apps).length){var r=this.globalsForEvent(e),s=function(s){try{t.Bo(()=>null==s.processEvent?void 0:s.processEvent(r))}catch(t){ap.error("Error while processing event "+e.event+" for site app "+s.id,t)}};for(var i of Object.values(this.apps))s(i)}}onRemoteConfig(e){var t,r,s,i=this;if(null!=(t=this.siteAppLoaders)&&t.length)return this.isEnabled?(this.Ho(),void this._instance.on("eventCaptured",e=>this.Uo(e))):void ap.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(r=this.$o)||r.call(this),null!=(s=e.siteApps)&&s.length)if(this.isEnabled){var n=function(e){var t;g["__$$ph_site_app_"+e]=i._instance,null==(t=g.__PosthogExtensions__)||null==t.loadSiteApp||t.loadSiteApp(i._instance,o,t=>{if(t)return ap.error(ag+e,t)})};for(var{id:a,url:o}of e.siteApps)n(a)}else ap.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},aL,{tracingHeaders:class{constructor(e){this.zo=void 0,this.Vo=void 0,this.Wo=void 0,this.ao=()=>{var e,t,r=this.Go();r?(X(this.zo)&&(this.zo=null==(e=g.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchXHR(r,()=>this._instance.get_distinct_id(),this._instance.sessionManager)),X(this.Vo)&&(this.Vo=null==(t=g.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)?void 0:t._patchFetch(r,()=>this._instance.get_distinct_id(),this._instance.sessionManager))):this.co()},this._instance=e}initialize(){this.startIfEnabledOrStop()}Mt(e){var t,r;null!=(t=g.__PosthogExtensions__)&&t.tracingHeadersPatchFns?e():null==(r=g.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"tracing-headers",t=>{if(t)return ae.error("failed to load script",t);e()})}Zo(){var e,t;return null!=(e=null!=(t=this._instance.config.tracing_headers)?t:this._instance.config.addTracingHeaders)?e:this._instance.config.__add_tracing_headers}Go(){var e=this.Zo();return G(e)?(G(this.Wo)?this.Wo.splice(0,this.Wo.length,...e):this.Wo=[...e],e.length>0?this.Wo:void 0):(G(this.Wo)&&this.Wo.splice(0),this.Wo=e||void 0,this.Wo)}co(){var e,t;null==(e=this.zo)||e.call(this),null==(t=this.Vo)||t.call(this),this.zo=void 0,this.Vo=void 0}startIfEnabledOrStop(){this.Go()?this.Mt(this.ao):this.co()}}},{toolbar:class{constructor(e){this.instance=e}na(e){g.ph_toolbar_state=e}sa(){var e;return null!=(e=g.ph_toolbar_state)?e:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(e,t,r){if(void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===r&&(r=void 0),r7(this.instance.config)||!i||!o)return!1;e=null!=e?e:i.location,r=null!=r?r:i.history;try{if(!t){try{i.localStorage.setItem("test","test"),i.localStorage.removeItem("test")}catch(e){return!1}t=null==i?void 0:i.localStorage}var s,n=ay||ia(e.hash,"__posthog")||ia(e.hash,"state"),a=n?r1(()=>JSON.parse(atob(decodeURIComponent(n))))||r1(()=>JSON.parse(decodeURIComponent(n))):null;return a&&"ph_authorize"===a.action?((s=a).source="url",s&&Object.keys(s).length>0&&(a.desiredHash?e.hash=a.desiredHash:r?r.replaceState(r.state,"",e.pathname+e.search):e.hash="")):((s=JSON.parse(t.getItem(aw)||"{}")).source="localstorage",delete s.userIntent),!(!s.token||this.instance.config.token!==s.token||(this.loadToolbar(s),0))}catch(e){return!1}}oa(e){var t=g.ph_load_toolbar||g.ph_load_editor;!et(t)&&Y(t)?t(e,this.instance):aS.warn("No toolbar load function found")}loadToolbar(e){var t,r=!(null==o||!o.getElementById(rR));if(!i||r)return!1;var s="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,n=x({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},s?{instrument:!1}:{});return(i.localStorage.setItem(aw,JSON.stringify(x({},n,{source:void 0}))),2===this.sa())?this.oa(n):0===this.sa()&&(this.na(1),null==(t=g.__PosthogExtensions__)||null==t.loadExternalDependency||t.loadExternalDependency(this.instance,"toolbar",e=>{e?(aS.error("[Toolbar] Failed to load",e),this.na(0)):(this.na(2),this.oa(n))}),r5(i,"turbolinks:load",()=>{this.na(0),this.loadToolbar(n)})),!0}aa(e){return this.loadToolbar(e)}maybeLoadEditor(e,t,r){return void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===r&&(r=void 0),this.maybeLoadToolbar(e,t,r)}}},aD,{conversations:class{constructor(e){this.la=void 0,this._conversationsManager=null,this.ua=!1,this.ha=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this._instance.config.disable_conversations){var t=e.conversations;et(t)||(ei(t)?this.la=t:(this.la=t.enabled,this.ha=t),this.loadIfEnabled())}}reset(){var e;null==(e=this._conversationsManager)||e.reset(),this._conversationsManager=null,this.la=void 0,this.ha=null}loadIfEnabled(){if(!(this._conversationsManager||this.ua||this._instance.config.disable_conversations||r7(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=null==g?void 0:g.__PosthogExtensions__;if(e&&!X(this.la)&&this.la)if(this.ha&&this.ha.token){this.ua=!0;try{var t=e.initConversations;if(t)return this.da(t),void(this.ua=!1);var r=e.loadExternalDependency;if(!r)return void this.ca(rD);r(this._instance,"conversations",t=>{t||!e.initConversations?this.ca("Could not load conversations script",t):this.da(e.initConversations),this.ua=!1})}catch(e){this.ca("Error initializing conversations",e),this.ua=!1}}else aT.error("Conversations enabled but missing token in remote config.")}}da(e){if(this.ha)try{this._conversationsManager=e(this.ha,this._instance),aT.info("Conversations loaded successfully")}catch(e){this.ca("Error completing conversations initialization",e)}else aT.error("Cannot complete initialization: remote config is null")}ca(e,t){aT.error(e,t),this._conversationsManager=null,this.ua=!1}show(){this._conversationsManager?this._conversationsManager.show():aT.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.la&&!ee(this._conversationsManager)}isVisible(){var e,t;return null!=(e=null==(t=this._conversationsManager)?void 0:t.isVisible())&&e}sendMessage(e,t,r){var s=this;return _(function*(){return s._conversationsManager?s._conversationsManager.sendMessage(e,t,r):(aT.warn(aR),null)})()}getMessages(e,t){var r=this;return _(function*(){return r._conversationsManager?r._conversationsManager.getMessages(e,t):(aT.warn(aR),null)})()}markAsRead(e){var t=this;return _(function*(){return t._conversationsManager?t._conversationsManager.markAsRead(e):(aT.warn(aR),null)})()}getTickets(e){var t=this;return _(function*(){return t._conversationsManager?t._conversationsManager.getTickets(e):(aT.warn(aR),null)})()}requestRestoreLink(e){var t=this;return _(function*(){return t._conversationsManager?t._conversationsManager.requestRestoreLink(e):(aT.warn(aR),null)})()}restoreFromToken(e){var t=this;return _(function*(){return t._conversationsManager?t._conversationsManager.restoreFromToken(e):(aT.warn(aR),null)})()}restoreFromUrlToken(){var e=this;return _(function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(aT.warn(aR),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}en(){var e;null==(e=this._conversationsManager)||e.setIdentity()}tn(){var e;null==(e=this._conversationsManager)||e.clearIdentity()}}},{logs:class{constructor(e){var t;this.va=!1,this.fa=!1,this.Ae=tY("[logs]"),this._r=[],this.pa=[],this.ga=()=>{var e,t;null==(e=this.ma)||e.onReconnect(),null==(t=this.ya)||t.onReconnect()},this._instance=e,this._instance&&null!=(t=this._instance.config.logs)&&t.captureConsoleLogs&&(this.va=!0),i&&r5(i,"online",this.ga)}ba(e,t,r,s){var i,n,a,o,l,c,u,d,h,p,g,f,v,m,_=(i=null==(m=this._instance)||null==(m
99=m.config)?void 0:m.logs,h=null!=(n=null==i?void 0:i.flushIntervalMs)?n:3e3,p=null!=(a=null==i?void 0:i.maxBufferSize)?a:100,f=X(g=null!=r&&r.consoleCapture?void 0:null!=(o=null==i?void 0:i.maxLogsPerInterval)?o:1e3)?Math.max(p,2048):Math.max(p,g),{serviceName:null!=(l=null!=(c=null==(v=null==i?void 0:i.resourceAttributes)?void 0:v["service.name"])?c:null==i?void 0:i.serviceName)?l:null==r?void 0:r.serviceNameDefault,serviceVersion:null!=(u=null==v?void 0:v["service.version"])?u:null==i?void 0:i.serviceVersion,environment:null!=(d=null==v?void 0:v["deployment.environment"])?d:null==i?void 0:i.environment,resourceAttributes:v,beforeSend:null==i?void 0:i.beforeSend,flushIntervalMs:h,maxBufferSize:p,maxQueueSize:f,maxBatchRecordsPerPost:100,rateCapWindowMs:h,maxLogsPerInterval:g,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0});return[new tm(this._a(e,t),_,this.Ae,()=>this.wa(),e=>e(),void 0,s),_]}xa(){var e,t,r=null==(e=this._instance)||null==(e=e.config)?void 0:e.logs;return this.ma&&this.ka===r||(null==(t=this.ma)||t.reset(),this.ka=r,[this.ma,this.Sa]=this.ba(()=>this._r,e=>{this._r=e})),this.ma}Ca(){var e,t,r=null==(e=this._instance)||null==(e=e.config)?void 0:e.logs;return this.ya&&this.Ia===r||(null==(t=this.ya)||t.reset(),this.Ia=r,[this.ya,this.Ta]=this.ba(()=>this.pa,e=>{this.pa=e},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},aM)),this.ya}initialize(){this.loadIfEnabled()}onRemoteConfig(e){var t,r=null==(t=e.logs)?void 0:t.captureConsoleLogs;!et(r)&&r&&(this.va=!0,this.loadIfEnabled())}reset(){var e,t;this._r=[],null==(e=this.ma)||e.reset(),this.pa=[],null==(t=this.ya)||t.reset()}captureLog(e){this.xa().captureLog(e)}le(e){this.Ca().captureLog(e)}get logger(){return this.Ea||(this.Ea={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)=>this.captureLog({body:e,level:"error",attributes:t}),fatal:(e,t)=>this.captureLog({body:e,level:"fatal",attributes:t})}),this.Ea}flushLogs(e){e?this.Ma(e):(this.ma&&this.ma.flush().catch(e=>this.Ae.error("PostHog logs flush failed:",e)),this.ya&&this.ya.flush().catch(e=>this.Ae.error("PostHog logs flush failed:",e)))}loadIfEnabled(){if(this.va&&!this.fa){var e=null==g?void 0:g.__PosthogExtensions__;if(e){var t=e.loadExternalDependency;t?t(this._instance,"logs",t=>{var r;t||null==(r=e.logs)||!r.initializeLogs?this.Ae.error("Could not load logs script",t):(e.logs.initializeLogs(this._instance),this.fa=!0)}):this.Ae.error(rD)}else this.Ae.error("PostHog Extensions not found.")}}_a(e,t){var r=this._instance;return{get isDisabled(){return!1},get optedOut(){return!r.is_capturing()},getPersistedProperty:t=>t===N.LogsQueue?e():void 0,setPersistedProperty(e,r){e===N.LogsQueue&&t(null!=r?r:[])},ht:e=>this.ht(e),getLibraryId:()=>v.LIB_NAME,getLibraryVersion:()=>v.LIB_VERSION}}ht(e){return new Promise(t=>{var r=!1,s=e=>{r||(r=!0,clearTimeout(i),t(e))},i=setTimeout(()=>s({kind:"retry-later",error:Error("logs request timed out")}),9e4);this._instance._send_request({method:"POST",url:this.Pa(),data:e,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback(e){var t,r=e.statusCode;r>=200&&300>r?s({kind:"ok"}):413===r?s({kind:"too-large"}):0!==r&&429!==r&&500>r?s({kind:"fatal",error:Error("logs request failed with status "+r)}):s({kind:"retry-later",error:null!=(t=e.error)?t:Error("logs request failed with status "+r)})}})})}Ma(e){this._r.length>0&&this.Ra(e,this._r,this.Sa,v.LIB_NAME,e=>{this._r=e}),this.pa.length>0&&this.Ra(e,this.pa,this.Ta,aM,e=>{this.pa=e})}Ra(e,t,r,s,i){if(0!==t.length){var n=t.map(e=>e.record);i([]);var a=tv(n,tf(r,v.LIB_NAME,v.LIB_VERSION),s,v.LIB_VERSION);this._instance._send_request({method:"POST",url:this.Pa(),data:a,compression:"best-available",batchKey:"logs",transport:e})}}Pa(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}wa(){var e,t={};if(t.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var{sessionId:r,windowId:s,sessionStartTimestamp:i,lastActivityTimestamp:n}=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0);t.sessionId=r,t.windowId=s,et(i)||(t.sessionStartTimestamp=i),et(n)||(t.lastActivityTimestamp=n)}if(null!=g&&null!=(e=g.location)&&e.href&&(t.currentUrl=this._instance.config.disable_capture_url_hashes?tc(g.location.href):g.location.href),this._instance.featureFlags){var a=this._instance.featureFlags.getFlags();a&&a.length>0&&(t.activeFeatureFlags=a)}return t}}});n4.__defaultExtensionClasses=x({},az);var aH=(v.SDK_DIST_CHANNEL="npm",t=nW[nQ]=new n4,function(){function e(){e.done||(e.done=!0,nZ=!1,rQ(nW,function(e){e._dom_loaded()}))}null!=o&&o.addEventListener?"complete"===o.readyState?e():r5(o,"DOMContentLoaded",e,{capture:!1}):i&&tG.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),t),aq=e.i(71645),aU=(0,aq.createContext)({get client(){return r},bootstrap:void 0});function aB(e){var t,s,i=e.children,n=e.client,a=e.apiKey,o=e.options,l=(0,aq.useRef)(null),c=(0,aq.useMemo)(function(){if(n)return a&&console.warn("[PostHog.js] You have provided both `client` and `apiKey` to `PostHogProvider`. `apiKey` will be ignored in favour of `client`."),o&&console.warn("[PostHog.js] You have provided both `client` and `options` to `PostHogProvider`. `options` will be ignored in favour of `client`."),n;var e=r;return a||console.warn("[PostHog.js] No `apiKey` or `client` were provided to `PostHogProvider`. Using default global `window.posthog` instance. You must initialize it manually. This is not recommended behavior."),e},[n,a,JSON.stringify(o)]);return(0,aq.useEffect)(function(){if(!n&&a){var e=r,t=l.current;t?(a!==t.apiKey&&console.warn("[PostHog.js] You have provided a different `apiKey` to `PostHogProvider` than the one that was already initialized. This is not supported by our provider and we'll keep using the previous key. If you need to toggle between API Keys you need to control the `client` yourself and pass it in as a prop rather than an `apiKey` prop."),o&&!function e(t,r,s){if(void 0===s&&(s=new WeakMap),t===r)return!0;
99if("object"!=typeof t||null===t||"object"!=typeof r||null===r)return!1;if(s.has(t)&&s.get(t)===r)return!0;s.set(t,r);var i=Object.keys(t),n=Object.keys(r);if(i.length!==n.length)return!1;for(var a=0;a<i.length;a++){var o=i[a];if(!n.includes(o)||!e(t[o],r[o],s))return!1}return!0}(o,t.options)&&e.set_config(o)):(e.__loaded&&console.warn("[PostHog.js] `posthog` was already loaded elsewhere. This may cause issues."),e.init(a,o)),l.current={apiKey:a,options:null!=o?o:{}}}},[n,a,JSON.stringify(o)]),aq.default.createElement(aU.Provider,{value:{client:c,bootstrap:null!=(t=null==o?void 0:o.bootstrap)?t:null==(s=null==n?void 0:n.config)?void 0:s.bootstrap}},i)}var aW=function(e){return"function"==typeof e},aV=function(e,t){return(aV=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};"function"==typeof SuppressedError&&SuppressedError;var aG={componentStack:null,exceptionEvent:null,error:null};!function(e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function t(){this.constructor=r}function r(t){var r=e.call(this,t)||this;return r.state=aG,r}aV(r,e),r.prototype=null===e?Object.create(e):(t.prototype=e.prototype,new t),r.prototype.componentDidCatch=function(e,t){var r,s=this.props.additionalProperties;aW(s)?r=s(e):"object"==typeof s&&(r=s);var i=this.context.client.captureException(e,r),n=t.componentStack;this.setState({error:e,componentStack:null!=n?n:null,exceptionEvent:i})},r.prototype.render=function(){var e=this.props,t=e.children,r=e.fallback,s=this.state;if(null==s.componentStack)return aW(t)?t():t;var i=aW(r)?aq.default.createElement(r,{error:s.error,componentStack:s.componentStack,exceptionEvent:s.exceptionEvent}):r;return aq.default.isValidElement(i)?i:(console.warn("[PostHog.js][PostHogErrorBoundary] Invalid fallback prop, provide a valid React element or a function that returns a valid React element."),aq.default.createElement(aq.default.Fragment,null))},r.contextType=aU}(aq.default.Component),r=aH;var aY=e.i(18566);function aK(){let e=(0,aY.usePathname)(),t=(0,aY.useSearchParams)(),r=(0,aq.useContext)(aU).client;return(0,aq.useEffect)(()=>{t.toString()&&t.toString(),r.capture("$pageview",{$current_url:window.location.href})},[e,t,r]),null}aH.init("phc_DnY5qqJkLgz2xgVBAtJQcsNygyHn6FgJXFnzgerUfJ97",{api_host:"https://us.i.posthog.com",person_profiles:"identified_only",capture_pageview:!1,capture_pageleave:!0,session_recording:{maskAllInputs:!1}}),e.s(["default",0,function({children:e}){return(0,s.jsxs)(aB,{client:aH,children:[(0,s.jsx)(aq.Suspense,{fallback:null,children:(0,s.jsx)(aK,{})}),e]})}],72362)}]);

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.