const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/StoriesPage-BqoiYBLd.js","assets/query-vendor-CZu0EHPe.js","assets/react-vendor-0bvDbF03.js","assets/StoryCard-Cn6727xi.js","assets/card-DFcXRNsY.js","assets/AccessLevelBadge-DAhSt_nI.js","assets/i18n-vendor-Cl4-lKeC.js","assets/globe-lF8bnafb.js","assets/dialog-5aG_7GFF.js","assets/UpgradeButton-DJ-TfnvW.js","assets/AnimatedBadge-C3drgX6d.js","assets/sesl-badge-utils-ehMeVD2e.js","assets/clock-N659jKdH.js","assets/book-check-mgk8-w14.js","assets/bookmark-hpgRA_OR.js","assets/slider-DZaKbOJb.js","assets/input-DK0u5ce_.js","assets/select-CQYUwuJ1.js","assets/index-mXG3wuIW.js","assets/chevron-down-C3isUo5T.js","assets/chevron-up-ChP58_Dk.js","assets/collapsible-CCly7qWf.js","assets/index-Cldz7KlY.js","assets/BreadcrumbNavigation-C4q2SlEN.js","assets/skeleton-QQN0M1lE.js","assets/search-Cr8b4GtO.js","assets/rotate-ccw-SpTZ37kU.js","assets/supabase-vendor-CNV44oIa.js","assets/helmet-vendor-NlTFkN97.js","assets/ResearchPage-BTDlGCdT.js","assets/table-DvpNzt39.js","assets/ShareCard-B50g7AJI.js","assets/download-DCWGaQmW.js","assets/sparkles-CXhyeTz6.js","assets/chart-column-7r31sseM.js","assets/book-open-DNtM4KeH.js","assets/ProfessionalNarrationSection-C8R1WCEI.js","assets/SyncedHighlightsSection-C0I-fUaU.js","assets/useIOSAudioContext-DtqQj9l7.js","assets/InteractiveWordsSection-_QpeWfdr.js","assets/VocabularySection-a68dOsrU.js","assets/ChooseYourPaceSection-DnHU4oUS.js","assets/turtle-Bfun877W.js","assets/DyslexiaSection-CQoixqAV.js","assets/CheckTextSection-BJYNAHLg.js","assets/chevron-left-Bvnh0s_S.js","assets/ThemesSection-C6JxdD8i.js","assets/ExploreThemesButton-Z2GpeVYI.js","assets/StoryMakerSection-DmBtWQnX.js","assets/AchievementsSection-BCE-2KAd.js","assets/HotAirBalloon-DxSIhaJ2.js","assets/QuillWipe-mOdOGsm9.js","assets/index.es-C3Wz79fL.js","assets/StoryReaderPage-GEqZ4sDg.js","assets/arrow-left-BCmxh35R.js","assets/useStoryData-BrWx-_vn.js","assets/vocabulary-service-DBjKeGti.js","assets/circle-question-mark-B2ZGUpBB.js","assets/volume-2-BAS6PRLn.js","assets/xp-service-BPKdUXUk.js","assets/progress-uOy1KOTR.js","assets/refresh-cw-ejqdEali.js","assets/AboutPage-sQFXyS6d.js","assets/CreateFreeAccountButton-Dx5lQ5W9.js","assets/ContactPage-DU69VSQ9.js","assets/textarea-BL90pVUg.js","assets/tabs-BWlnIfEE.js","assets/SocialIcons-DWGIwkB0.js","assets/mail-D1VVHHuU.js","assets/circle-check-big-DruUvNSj.js","assets/ImproveReadingPage-C7pPn_wz.js","assets/eye-BOygbjMR.js","assets/users-CeKwzcM9.js","assets/AuthPages-xtOGdjiU.js","assets/checkbox-BxinzVj1.js","assets/eye-off-Dej1hJ3M.js","assets/ResetPasswordPage-DiPPDoiI.js","assets/VerifyEmailPage-w4AnYzEq.js","assets/NotFound-CIzVx4FF.js","assets/ProgressPage-CF5eL6AK.js","assets/format-B9FvFmC1.js","assets/trending-up-D53FvIp5.js","assets/zap-DtvgnDDO.js","assets/generateCategoricalChart-ChUCpcF5.js","assets/YAxis-DiypEEkW.js","assets/calendar-D1r7qBIo.js","assets/ReadingCartPage-C9Py8y98.js","assets/VocabularyNotebookPage-BmK3tsDY.js","assets/alert-dialog-CltDIpfS.js","assets/trash-2-DTW8Xwq9.js","assets/AdminPage-BWCIY7-q.js","assets/separator-SlhAoCLX.js","assets/CurrencySelector-Bs6DhcFB.js","assets/sitemap-generator-KHDpYX28.js","assets/refresh-ccw-u60P0pw6.js","assets/sesl-algorithm-Dlofxis2.js","assets/circle-alert-Dv7i-UQm.js","assets/circle-x-wvUPHB8J.js","assets/useBlogData-D_miZmhL.js","assets/settings-DvzYLjiJ.js","assets/alert-4iVg_CWn.js","assets/image-D9cgkty9.js","assets/FontManagementPage-I_yLLEHu.js","assets/TermsPage-Dww7AT1l.js","assets/PrivacyPage-BUttGnu8.js","assets/RefundPage-Cq7N36Tr.js","assets/SubscriptionPage-0CZ1RA-S.js","assets/story-generation-service-BBv-tQcK.js","assets/PaymentStatusPage-KQyaDPRJ.js","assets/ThemeInfoPage-CKs6tGkh.js","assets/BlogPage-DH8cBDRN.js","assets/BlogCard-BVobFmxY.js","assets/BlogPostPage-CGVheEF0.js","assets/NewsletterPage-DF1frZkU.js","assets/StoryMakerPage-D_AS2NGd.js","assets/story-maker-CJAnJm6t.js","assets/TextCheckerPage-CvRawyH7.js","assets/SitemapRoute-BLZu2rtc.js"])))=>i.map(i=>d[i]);
import{j as c,Q as L_,a as F_}from"./query-vendor-CZu0EHPe.js";import{b as Di,R as D,r as p,d as wp,e as $_,u as gc,f as io,L as se,B as V_,h as B_,i as C}from"./react-vendor-0bvDbF03.js";import{c as z_,_ as S}from"./supabase-vendor-CNV44oIa.js";import{H as U_,a as H_}from"./helmet-vendor-NlTFkN97.js";import{i as Ep,a as W_,u as Ue}from"./i18n-vendor-Cl4-lKeC.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();var Sp,Zu=Di;Sp=Zu.createRoot,Zu.hydrateRoot;class Tp extends D.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,n){console.error("ErrorBoundary caught an error:",e,n)}render(){return this.state.hasError?this.props.fallback||c.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-50",children:c.jsxs("div",{className:"text-center p-8",children:[c.jsx("h1",{className:"text-2xl font-bold text-gray-900 mb-4",children:"Something went wrong"}),c.jsx("p",{className:"text-gray-600 mb-4",children:this.state.error?.message||"An unexpected error occurred"}),c.jsx("button",{onClick:()=>window.location.reload(),className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700",children:"Reload Page"})]})}):this.props.children}}const G_=1,K_=1e6;let ca=0;function q_(){return ca=(ca+1)%Number.MAX_SAFE_INTEGER,ca.toString()}const ua=new Map,Ju=t=>{if(ua.has(t))return;const e=setTimeout(()=>{ua.delete(t),js({type:"REMOVE_TOAST",toastId:t})},K_);ua.set(t,e)},Y_=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,G_)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(n=>n.id===e.toast.id?{...n,...e.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=e;return n?Ju(n):t.toasts.forEach(r=>{Ju(r.id)}),{...t,toasts:t.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return e.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(n=>n.id!==e.toastId)}}},Uo=[];let Ho={toasts:[]};function js(t){Ho=Y_(Ho,t),Uo.forEach(e=>{e(Ho)})}function X_({...t}){const e=q_(),n=s=>js({type:"UPDATE_TOAST",toast:{...s,id:e}}),r=()=>js({type:"DISMISS_TOAST",toastId:e});return js({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:s=>{s||r()}}}),{id:e,dismiss:r,update:n}}function kp(){const[t,e]=p.useState(Ho);return p.useEffect(()=>(Uo.push(e),()=>{const n=Uo.indexOf(e);n>-1&&Uo.splice(n,1)}),[t]),{...t,toast:X_,dismiss:n=>js({type:"DISMISS_TOAST",toastId:n})}}function W(t,e,{checkForDefaultPrevented:n=!0}={}){return function(s){if(t?.(s),n===!1||!s.defaultPrevented)return e?.(s)}}function Z_(t,e){typeof t=="function"?t(e):t!=null&&(t.current=e)}function Ni(...t){return e=>t.forEach(n=>Z_(n,e))}function Pe(...t){return p.useCallback(Ni(...t),t)}function J_(t,e=[]){let n=[];function r(o,i){const a=p.createContext(i),l=n.length;n=[...n,i];function u(h){const{scope:f,children:m,...v}=h,g=f?.[t][l]||a,y=p.useMemo(()=>v,Object.values(v));return c.jsx(g.Provider,{value:y,children:m})}function d(h,f){const m=f?.[t][l]||a,v=p.useContext(m);if(v)return v;if(i!==void 0)return i;throw new Error(`\`${h}\` must be used within \`${o}\``)}return u.displayName=o+"Provider",[u,d]}const s=()=>{const o=n.map(i=>p.createContext(i));return function(a){const l=a?.[t]||o;return p.useMemo(()=>({[`__scope${t}`]:{...a,[t]:l}}),[a,l])}};return s.scopeName=t,[r,Q_(s,...e)]}function Q_(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const i=r.reduce((a,{useScope:l,scopeName:u})=>{const h=l(o)[`__scope${u}`];return{...a,...h}},{});return p.useMemo(()=>({[`__scope${e.scopeName}`]:i}),[i])}};return n.scopeName=e.scopeName,n}var jn=p.forwardRef((t,e)=>{const{children:n,...r}=t,s=p.Children.toArray(n),o=s.find(ex);if(o){const i=o.props.children,a=s.map(l=>l===o?p.Children.count(i)>1?p.Children.only(null):p.isValidElement(i)?i.props.children:null:l);return c.jsx(rl,{...r,ref:e,children:p.isValidElement(i)?p.cloneElement(i,void 0,a):null})}return c.jsx(rl,{...r,ref:e,children:n})});jn.displayName="Slot";var rl=p.forwardRef((t,e)=>{const{children:n,...r}=t;if(p.isValidElement(n)){const s=nx(n);return p.cloneElement(n,{...tx(r,n.props),ref:e?Ni(e,s):s})}return p.Children.count(n)>1?p.Children.only(null):null});rl.displayName="SlotClone";var Pp=({children:t})=>c.jsx(c.Fragment,{children:t});function ex(t){return p.isValidElement(t)&&t.type===Pp}function tx(t,e){const n={...e};for(const r in e){const s=t[r],o=e[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...a)=>{o(...a),s(...a)}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...t,...n}}function nx(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}function vc(t){const e=t+"CollectionProvider",[n,r]=J_(e),[s,o]=n(e,{collectionRef:{current:null},itemMap:new Map}),i=m=>{const{scope:v,children:g}=m,y=D.useRef(null),_=D.useRef(new Map).current;return c.jsx(s,{scope:v,itemMap:_,collectionRef:y,children:g})};i.displayName=e;const a=t+"CollectionSlot",l=D.forwardRef((m,v)=>{const{scope:g,children:y}=m,_=o(a,g),x=Pe(v,_.collectionRef);return c.jsx(jn,{ref:x,children:y})});l.displayName=a;const u=t+"CollectionItemSlot",d="data-radix-collection-item",h=D.forwardRef((m,v)=>{const{scope:g,children:y,..._}=m,x=D.useRef(null),w=Pe(v,x),E=o(u,g);return D.useEffect(()=>(E.itemMap.set(x,{ref:x,..._}),()=>void E.itemMap.delete(x))),c.jsx(jn,{[d]:"",ref:w,children:y})});h.displayName=u;function f(m){const v=o(t+"CollectionConsumer",m);return D.useCallback(()=>{const y=v.collectionRef.current;if(!y)return[];const _=Array.from(y.querySelectorAll(`[${d}]`));return Array.from(v.itemMap.values()).sort((E,b)=>_.indexOf(E.ref.current)-_.indexOf(b.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:i,Slot:l,ItemSlot:h},f,r]}function rx(t,e){const n=p.createContext(e),r=o=>{const{children:i,...a}=o,l=p.useMemo(()=>a,Object.values(a));return c.jsx(n.Provider,{value:l,children:i})};r.displayName=t+"Provider";function s(o){const i=p.useContext(n);if(i)return i;if(e!==void 0)return e;throw new Error(`\`${o}\` must be used within \`${t}\``)}return[r,s]}function br(t,e=[]){let n=[];function r(o,i){const a=p.createContext(i),l=n.length;n=[...n,i];const u=h=>{const{scope:f,children:m,...v}=h,g=f?.[t]?.[l]||a,y=p.useMemo(()=>v,Object.values(v));return c.jsx(g.Provider,{value:y,children:m})};u.displayName=o+"Provider";function d(h,f){const m=f?.[t]?.[l]||a,v=p.useContext(m);if(v)return v;if(i!==void 0)return i;throw new Error(`\`${h}\` must be used within \`${o}\``)}return[u,d]}const s=()=>{const o=n.map(i=>p.createContext(i));return function(a){const l=a?.[t]||o;return p.useMemo(()=>({[`__scope${t}`]:{...a,[t]:l}}),[a,l])}};return s.scopeName=t,[r,sx(s,...e)]}function sx(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const i=r.reduce((a,{useScope:l,scopeName:u})=>{const h=l(o)[`__scope${u}`];return{...a,...h}},{});return p.useMemo(()=>({[`__scope${e.scopeName}`]:i}),[i])}};return n.scopeName=e.scopeName,n}var ox=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],le=ox.reduce((t,e)=>{const n=p.forwardRef((r,s)=>{const{asChild:o,...i}=r,a=o?jn:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(a,{...i,ref:s})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function yc(t,e){t&&Di.flushSync(()=>t.dispatchEvent(e))}function Ve(t){const e=p.useRef(t);return p.useEffect(()=>{e.current=t}),p.useMemo(()=>(...n)=>e.current?.(...n),[])}function ix(t,e=globalThis?.document){const n=Ve(t);p.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[n,e])}var ax="DismissableLayer",sl="dismissableLayer.update",lx="dismissableLayer.pointerDownOutside",cx="dismissableLayer.focusOutside",Qu,Cp=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ao=p.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:i,onDismiss:a,...l}=t,u=p.useContext(Cp),[d,h]=p.useState(null),f=d?.ownerDocument??globalThis?.document,[,m]=p.useState({}),v=Pe(e,k=>h(k)),g=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),_=g.indexOf(y),x=d?g.indexOf(d):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,E=x>=_,b=dx(k=>{const P=k.target,O=[...u.branches].some(R=>R.contains(P));!E||O||(s?.(k),i?.(k),k.defaultPrevented||a?.())},f),T=hx(k=>{const P=k.target;[...u.branches].some(R=>R.contains(P))||(o?.(k),i?.(k),k.defaultPrevented||a?.())},f);return ix(k=>{x===u.layers.size-1&&(r?.(k),!k.defaultPrevented&&a&&(k.preventDefault(),a()))},f),p.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Qu=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),ed(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=Qu)}},[d,f,n,u]),p.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),ed())},[d,u]),p.useEffect(()=>{const k=()=>m({});return document.addEventListener(sl,k),()=>document.removeEventListener(sl,k)},[]),c.jsx(le.div,{...l,ref:v,style:{pointerEvents:w?E?"auto":"none":void 0,...t.style},onFocusCapture:W(t.onFocusCapture,T.onFocusCapture),onBlurCapture:W(t.onBlurCapture,T.onBlurCapture),onPointerDownCapture:W(t.onPointerDownCapture,b.onPointerDownCapture)})});ao.displayName=ax;var ux="DismissableLayerBranch",jp=p.forwardRef((t,e)=>{const n=p.useContext(Cp),r=p.useRef(null),s=Pe(e,r);return p.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),c.jsx(le.div,{...t,ref:s})});jp.displayName=ux;function dx(t,e=globalThis?.document){const n=Ve(t),r=p.useRef(!1),s=p.useRef(()=>{});return p.useEffect(()=>{const o=a=>{if(a.target&&!r.current){let l=function(){Rp(lx,n,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",s.current),s.current=l,e.addEventListener("click",s.current,{once:!0})):l()}else e.removeEventListener("click",s.current);r.current=!1},i=window.setTimeout(()=>{e.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(i),e.removeEventListener("pointerdown",o),e.removeEventListener("click",s.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function hx(t,e=globalThis?.document){const n=Ve(t),r=p.useRef(!1);return p.useEffect(()=>{const s=o=>{o.target&&!r.current&&Rp(cx,n,{originalEvent:o},{discrete:!1})};return e.addEventListener("focusin",s),()=>e.removeEventListener("focusin",s)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function ed(){const t=new CustomEvent(sl);document.dispatchEvent(t)}function Rp(t,e,n,{discrete:r}){const s=n.originalEvent.target,o=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&s.addEventListener(t,e,{once:!0}),r?yc(s,o):s.dispatchEvent(o)}var fx=ao,px=jp,Dt=globalThis?.document?p.useLayoutEffect:()=>{},mx="Portal",lo=p.forwardRef((t,e)=>{const{container:n,...r}=t,[s,o]=p.useState(!1);Dt(()=>o(!0),[]);const i=n||s&&globalThis?.document?.body;return i?wp.createPortal(c.jsx(le.div,{...r,ref:e}),i):null});lo.displayName=mx;function gx(t,e){return p.useReducer((n,r)=>e[n][r]??n,t)}var pt=t=>{const{present:e,children:n}=t,r=vx(e),s=typeof n=="function"?n({present:r.isPresent}):p.Children.only(n),o=Pe(r.ref,yx(s));return typeof n=="function"||r.isPresent?p.cloneElement(s,{ref:o}):null};pt.displayName="Presence";function vx(t){const[e,n]=p.useState(),r=p.useRef({}),s=p.useRef(t),o=p.useRef("none"),i=t?"mounted":"unmounted",[a,l]=gx(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{const u=So(r.current);o.current=a==="mounted"?u:"none"},[a]),Dt(()=>{const u=r.current,d=s.current;if(d!==t){const f=o.current,m=So(u);t?l("MOUNT"):m==="none"||u?.display==="none"?l("UNMOUNT"):l(d&&f!==m?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,l]),Dt(()=>{if(e){let u;const d=e.ownerDocument.defaultView??window,h=m=>{const g=So(r.current).includes(m.animationName);if(m.target===e&&g&&(l("ANIMATION_END"),!s.current)){const y=e.style.animationFillMode;e.style.animationFillMode="forwards",u=d.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=y)})}},f=m=>{m.target===e&&(o.current=So(r.current))};return e.addEventListener("animationstart",f),e.addEventListener("animationcancel",h),e.addEventListener("animationend",h),()=>{d.clearTimeout(u),e.removeEventListener("animationstart",f),e.removeEventListener("animationcancel",h),e.removeEventListener("animationend",h)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:p.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function So(t){return t?.animationName||"none"}function yx(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}function co({prop:t,defaultProp:e,onChange:n=()=>{}}){const[r,s]=_x({defaultProp:e,onChange:n}),o=t!==void 0,i=o?t:r,a=Ve(n),l=p.useCallback(u=>{if(o){const h=typeof u=="function"?u(t):u;h!==t&&a(h)}else s(u)},[o,t,s,a]);return[i,l]}function _x({defaultProp:t,onChange:e}){const n=p.useState(t),[r]=n,s=p.useRef(r),o=Ve(e);return p.useEffect(()=>{s.current!==r&&(o(r),s.current=r)},[r,s,o]),n}var xx="VisuallyHidden",Li=p.forwardRef((t,e)=>c.jsx(le.span,{...t,ref:e,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...t.style}}));Li.displayName=xx;var bx=Li,_c="ToastProvider",[xc,wx,Ex]=vc("Toast"),[Ap,qO]=br("Toast",[Ex]),[Sx,Fi]=Ap(_c),Ip=t=>{const{__scopeToast:e,label:n="Notification",duration:r=5e3,swipeDirection:s="right",swipeThreshold:o=50,children:i}=t,[a,l]=p.useState(null),[u,d]=p.useState(0),h=p.useRef(!1),f=p.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${_c}\`. Expected non-empty \`string\`.`),c.jsx(xc.Provider,{scope:e,children:c.jsx(Sx,{scope:e,label:n,duration:r,swipeDirection:s,swipeThreshold:o,toastCount:u,viewport:a,onViewportChange:l,onToastAdd:p.useCallback(()=>d(m=>m+1),[]),onToastRemove:p.useCallback(()=>d(m=>m-1),[]),isFocusedToastEscapeKeyDownRef:h,isClosePausedRef:f,children:i})})};Ip.displayName=_c;var Mp="ToastViewport",Tx=["F8"],ol="toast.viewportPause",il="toast.viewportResume",Op=p.forwardRef((t,e)=>{const{__scopeToast:n,hotkey:r=Tx,label:s="Notifications ({hotkey})",...o}=t,i=Fi(Mp,n),a=wx(n),l=p.useRef(null),u=p.useRef(null),d=p.useRef(null),h=p.useRef(null),f=Pe(e,h,i.onViewportChange),m=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),v=i.toastCount>0;p.useEffect(()=>{const y=_=>{r.length!==0&&r.every(w=>_[w]||_.code===w)&&h.current?.focus()};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[r]),p.useEffect(()=>{const y=l.current,_=h.current;if(v&&y&&_){const x=()=>{if(!i.isClosePausedRef.current){const T=new CustomEvent(ol);_.dispatchEvent(T),i.isClosePausedRef.current=!0}},w=()=>{if(i.isClosePausedRef.current){const T=new CustomEvent(il);_.dispatchEvent(T),i.isClosePausedRef.current=!1}},E=T=>{!y.contains(T.relatedTarget)&&w()},b=()=>{y.contains(document.activeElement)||w()};return y.addEventListener("focusin",x),y.addEventListener("focusout",E),y.addEventListener("pointermove",x),y.addEventListener("pointerleave",b),window.addEventListener("blur",x),window.addEventListener("focus",w),()=>{y.removeEventListener("focusin",x),y.removeEventListener("focusout",E),y.removeEventListener("pointermove",x),y.removeEventListener("pointerleave",b),window.removeEventListener("blur",x),window.removeEventListener("focus",w)}}},[v,i.isClosePausedRef]);const g=p.useCallback(({tabbingDirection:y})=>{const x=a().map(w=>{const E=w.ref.current,b=[E,...Fx(E)];return y==="forwards"?b:b.reverse()});return(y==="forwards"?x.reverse():x).flat()},[a]);return p.useEffect(()=>{const y=h.current;if(y){const _=x=>{const w=x.altKey||x.ctrlKey||x.metaKey;if(x.key==="Tab"&&!w){const b=document.activeElement,T=x.shiftKey;if(x.target===y&&T){u.current?.focus();return}const O=g({tabbingDirection:T?"backwards":"forwards"}),R=O.findIndex(B=>B===b);da(O.slice(R+1))?x.preventDefault():T?u.current?.focus():d.current?.focus()}};return y.addEventListener("keydown",_),()=>y.removeEventListener("keydown",_)}},[a,g]),c.jsxs(px,{ref:l,role:"region","aria-label":s.replace("{hotkey}",m),tabIndex:-1,style:{pointerEvents:v?void 0:"none"},children:[v&&c.jsx(al,{ref:u,onFocusFromOutsideViewport:()=>{const y=g({tabbingDirection:"forwards"});da(y)}}),c.jsx(xc.Slot,{scope:n,children:c.jsx(le.ol,{tabIndex:-1,...o,ref:f})}),v&&c.jsx(al,{ref:d,onFocusFromOutsideViewport:()=>{const y=g({tabbingDirection:"backwards"});da(y)}})]})});Op.displayName=Mp;var Dp="ToastFocusProxy",al=p.forwardRef((t,e)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...s}=t,o=Fi(Dp,n);return c.jsx(Li,{"aria-hidden":!0,tabIndex:0,...s,ref:e,style:{position:"fixed"},onFocus:i=>{const a=i.relatedTarget;!o.viewport?.contains(a)&&r()}})});al.displayName=Dp;var $i="Toast",kx="toast.swipeStart",Px="toast.swipeMove",Cx="toast.swipeCancel",jx="toast.swipeEnd",Np=p.forwardRef((t,e)=>{const{forceMount:n,open:r,defaultOpen:s,onOpenChange:o,...i}=t,[a=!0,l]=co({prop:r,defaultProp:s,onChange:o});return c.jsx(pt,{present:n||a,children:c.jsx(Ix,{open:a,...i,ref:e,onClose:()=>l(!1),onPause:Ve(t.onPause),onResume:Ve(t.onResume),onSwipeStart:W(t.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:W(t.onSwipeMove,u=>{const{x:d,y:h}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${h}px`)}),onSwipeCancel:W(t.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:W(t.onSwipeEnd,u=>{const{x:d,y:h}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${h}px`),l(!1)})})})});Np.displayName=$i;var[Rx,Ax]=Ap($i,{onClose(){}}),Ix=p.forwardRef((t,e)=>{const{__scopeToast:n,type:r="foreground",duration:s,open:o,onClose:i,onEscapeKeyDown:a,onPause:l,onResume:u,onSwipeStart:d,onSwipeMove:h,onSwipeCancel:f,onSwipeEnd:m,...v}=t,g=Fi($i,n),[y,_]=p.useState(null),x=Pe(e,M=>_(M)),w=p.useRef(null),E=p.useRef(null),b=s||g.duration,T=p.useRef(0),k=p.useRef(b),P=p.useRef(0),{onToastAdd:O,onToastRemove:R}=g,B=Ve(()=>{y?.contains(document.activeElement)&&g.viewport?.focus(),i()}),N=p.useCallback(M=>{!M||M===1/0||(window.clearTimeout(P.current),T.current=new Date().getTime(),P.current=window.setTimeout(B,M))},[B]);p.useEffect(()=>{const M=g.viewport;if(M){const q=()=>{N(k.current),u?.()},z=()=>{const U=new Date().getTime()-T.current;k.current=k.current-U,window.clearTimeout(P.current),l?.()};return M.addEventListener(ol,z),M.addEventListener(il,q),()=>{M.removeEventListener(ol,z),M.removeEventListener(il,q)}}},[g.viewport,b,l,u,N]),p.useEffect(()=>{o&&!g.isClosePausedRef.current&&N(b)},[o,b,g.isClosePausedRef,N]),p.useEffect(()=>(O(),()=>R()),[O,R]);const K=p.useMemo(()=>y?Up(y):null,[y]);return g.viewport?c.jsxs(c.Fragment,{children:[K&&c.jsx(Mx,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:K}),c.jsx(Rx,{scope:n,onClose:B,children:Di.createPortal(c.jsx(xc.ItemSlot,{scope:n,children:c.jsx(fx,{asChild:!0,onEscapeKeyDown:W(a,()=>{g.isFocusedToastEscapeKeyDownRef.current||B(),g.isFocusedToastEscapeKeyDownRef.current=!1}),children:c.jsx(le.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":o?"open":"closed","data-swipe-direction":g.swipeDirection,...v,ref:x,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:W(t.onKeyDown,M=>{M.key==="Escape"&&(a?.(M.nativeEvent),M.nativeEvent.defaultPrevented||(g.isFocusedToastEscapeKeyDownRef.current=!0,B()))}),onPointerDown:W(t.onPointerDown,M=>{M.button===0&&(w.current={x:M.clientX,y:M.clientY})}),onPointerMove:W(t.onPointerMove,M=>{if(!w.current)return;const q=M.clientX-w.current.x,z=M.clientY-w.current.y,U=!!E.current,A=["left","right"].includes(g.swipeDirection),I=["left","up"].includes(g.swipeDirection)?Math.min:Math.max,ee=A?I(0,q):0,H=A?0:I(0,z),Y=M.pointerType==="touch"?10:2,Z={x:ee,y:H},oe={originalEvent:M,delta:Z};U?(E.current=Z,To(Px,h,oe,{discrete:!1})):td(Z,g.swipeDirection,Y)?(E.current=Z,To(kx,d,oe,{discrete:!1}),M.target.setPointerCapture(M.pointerId)):(Math.abs(q)>Y||Math.abs(z)>Y)&&(w.current=null)}),onPointerUp:W(t.onPointerUp,M=>{const q=E.current,z=M.target;if(z.hasPointerCapture(M.pointerId)&&z.releasePointerCapture(M.pointerId),E.current=null,w.current=null,q){const U=M.currentTarget,A={originalEvent:M,delta:q};td(q,g.swipeDirection,g.swipeThreshold)?To(jx,m,A,{discrete:!0}):To(Cx,f,A,{discrete:!0}),U.addEventListener("click",I=>I.preventDefault(),{once:!0})}})})})}),g.viewport)})]}):null}),Mx=t=>{const{__scopeToast:e,children:n,...r}=t,s=Fi($i,e),[o,i]=p.useState(!1),[a,l]=p.useState(!1);return Nx(()=>i(!0)),p.useEffect(()=>{const u=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(u)},[]),a?null:c.jsx(lo,{asChild:!0,children:c.jsx(Li,{...r,children:o&&c.jsxs(c.Fragment,{children:[s.label," ",n]})})})},Ox="ToastTitle",Lp=p.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return c.jsx(le.div,{...r,ref:e})});Lp.displayName=Ox;var Dx="ToastDescription",Fp=p.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return c.jsx(le.div,{...r,ref:e})});Fp.displayName=Dx;var $p="ToastAction",Vp=p.forwardRef((t,e)=>{const{altText:n,...r}=t;return n.trim()?c.jsx(zp,{altText:n,asChild:!0,children:c.jsx(bc,{...r,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${$p}\`. Expected non-empty \`string\`.`),null)});Vp.displayName=$p;var Bp="ToastClose",bc=p.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t,s=Ax(Bp,n);return c.jsx(zp,{asChild:!0,children:c.jsx(le.button,{type:"button",...r,ref:e,onClick:W(t.onClick,s.onClose)})})});bc.displayName=Bp;var zp=p.forwardRef((t,e)=>{const{__scopeToast:n,altText:r,...s}=t;return c.jsx(le.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...s,ref:e})});function Up(t){const e=[];return Array.from(t.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&e.push(r.textContent),Lx(r)){const s=r.ariaHidden||r.hidden||r.style.display==="none",o=r.dataset.radixToastAnnounceExclude==="";if(!s)if(o){const i=r.dataset.radixToastAnnounceAlt;i&&e.push(i)}else e.push(...Up(r))}}),e}function To(t,e,n,{discrete:r}){const s=n.originalEvent.currentTarget,o=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n});e&&s.addEventListener(t,e,{once:!0}),r?yc(s,o):s.dispatchEvent(o)}var td=(t,e,n=0)=>{const r=Math.abs(t.x),s=Math.abs(t.y),o=r>s;return e==="left"||e==="right"?o&&r>n:!o&&s>n};function Nx(t=()=>{}){const e=Ve(t);Dt(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[e])}function Lx(t){return t.nodeType===t.ELEMENT_NODE}function Fx(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function da(t){const e=document.activeElement;return t.some(n=>n===e?!0:(n.focus(),document.activeElement!==e))}var $x=Ip,Hp=Op,Wp=Np,Gp=Lp,Kp=Fp,qp=Vp,Yp=bc;function Xp(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(e=0;e<s;e++)t[e]&&(n=Xp(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function wc(){for(var t,e,n=0,r="",s=arguments.length;n<s;n++)(t=arguments[n])&&(e=Xp(t))&&(r&&(r+=" "),r+=e);return r}const nd=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,rd=wc,Vi=(t,e)=>n=>{var r;if(e?.variants==null)return rd(t,n?.class,n?.className);const{variants:s,defaultVariants:o}=e,i=Object.keys(s).map(u=>{const d=n?.[u],h=o?.[u];if(d===null)return null;const f=nd(d)||nd(h);return s[u][f]}),a=n&&Object.entries(n).reduce((u,d)=>{let[h,f]=d;return f===void 0||(u[h]=f),u},{}),l=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:h,className:f,...m}=d;return Object.entries(m).every(v=>{let[g,y]=v;return Array.isArray(y)?y.includes({...o,...a}[g]):{...o,...a}[g]===y})?[...u,h,f]:u},[]);return rd(t,i,l,n?.class,n?.className)};/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Vx=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Bx=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,r)=>r?r.toUpperCase():n.toLowerCase()),sd=t=>{const e=Bx(t);return e.charAt(0).toUpperCase()+e.slice(1)},Zp=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim(),zx=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/var Ux={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Hx=p.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:o,iconNode:i,...a},l)=>p.createElement("svg",{ref:l,...Ux,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:Zp("lucide",s),...!o&&!zx(a)&&{"aria-hidden":"true"},...a},[...i.map(([u,d])=>p.createElement(u,d)),...Array.isArray(o)?o:[o]]));/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const pe=(t,e)=>{const n=p.forwardRef(({className:r,...s},o)=>p.createElement(Hx,{ref:o,iconNode:e,className:Zp(`lucide-${Vx(sd(t))}`,`lucide-${t}`,r),...s}));return n.displayName=sd(t),n};/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Wx=[["path",{d:"M10 16c.5.3 1.2.5 2 .5s1.5-.2 2-.5",key:"1u7htd"}],["path",{d:"M15 12h.01",key:"1k8ypt"}],["path",{d:"M19.38 6.813A9 9 0 0 1 20.8 10.2a2 2 0 0 1 0 3.6 9 9 0 0 1-17.6 0 2 2 0 0 1 0-3.6A9 9 0 0 1 12 3c2 0 3.5 1.1 3.5 2.5s-.9 2.5-2 2.5c-.8 0-1.5-.4-1.5-1",key:"11xh7x"}],["path",{d:"M9 12h.01",key:"157uk2"}]],Gx=pe("baby",Wx);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Kx=[["path",{d:"M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2",key:"1ah6g2"}],["rect",{x:"14",y:"2",width:"8",height:"8",rx:"1",key:"88lufb"}]],qx=pe("blocks",Kx);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Yx=[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]],od=pe("camera",Yx);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Xx=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Zx=pe("check",Xx);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Jx=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Qx=pe("chevron-right",Jx);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const eb=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],tb=pe("circle",eb);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const nb=[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]],Ir=pe("crown",nb);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const rb=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m9 15 2 2 4-4",key:"1grp1n"}]],sb=pe("file-check",rb);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ob=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]],Jp=pe("heart",ob);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ib=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],ab=pe("house",ib);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const lb=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],cb=pe("info",lb);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ub=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],id=pe("key-round",ub);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const db=[["rect",{width:"8",height:"18",x:"3",y:"3",rx:"1",key:"oynpb5"}],["path",{d:"M7 3v18",key:"bbkbws"}],["path",{d:"M20.4 18.9c.2.5-.1 1.1-.6 1.3l-1.9.7c-.5.2-1.1-.1-1.3-.6L11.1 5.1c-.2-.5.1-1.1.6-1.3l1.9-.7c.5-.2 1.1.1 1.3.6Z",key:"1qboyk"}]],hb=pe("library-big",db);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const fb=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],pb=pe("lightbulb",fb);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const mb=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],ad=pe("loader-circle",mb);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const gb=[["path",{d:"m10 17 5-5-5-5",key:"1bsop3"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}]],ld=pe("log-in",gb);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const vb=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],cd=pe("log-out",vb);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const yb=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],_b=pe("menu",yb);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const xb=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],bb=pe("message-circle-question-mark",xb);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const wb=[["path",{d:"M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4",key:"re6nr2"}],["path",{d:"M2 6h4",key:"aawbzj"}],["path",{d:"M2 10h4",key:"l0bgd4"}],["path",{d:"M2 14h4",key:"1gsvsf"}],["path",{d:"M2 18h4",key:"1bu2t1"}],["path",{d:"M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"pqwjuv"}]],Eb=pe("notebook-pen",wb);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Sb=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],Tb=pe("palette",Sb);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const kb=[["path",{d:"M10 14.66v1.626a2 2 0 0 1-.976 1.696A5 5 0 0 0 7 21.978",key:"1n3hpd"}],["path",{d:"M14 14.66v1.626a2 2 0 0 0 .976 1.696A5 5 0 0 1 17 21.978",key:"rfe1zi"}],["path",{d:"M18 9h1.5a1 1 0 0 0 0-5H18",key:"7xy6bh"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z",key:"1mhfuq"}],["path",{d:"M6 9H4.5a1 1 0 0 1 0-5H6",key:"tex48p"}]],Pb=pe("trophy",kb);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Cb=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],ud=pe("upload",Cb);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const jb=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],Rb=pe("user",jb);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Ab=[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]],Ib=pe("wand-sparkles",Ab);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Mb=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Qp=pe("x",Mb),Ec="-",Ob=t=>{const e=Nb(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:i=>{const a=i.split(Ec);return a[0]===""&&a.length!==1&&a.shift(),em(a,e)||Db(i)},getConflictingClassGroupIds:(i,a)=>{const l=n[i]||[];return a&&r[i]?[...l,...r[i]]:l}}},em=(t,e)=>{if(t.length===0)return e.classGroupId;const n=t[0],r=e.nextPart.get(n),s=r?em(t.slice(1),r):void 0;if(s)return s;if(e.validators.length===0)return;const o=t.join(Ec);return e.validators.find(({validator:i})=>i(o))?.classGroupId},dd=/^\[(.+)\]$/,Db=t=>{if(dd.test(t)){const e=dd.exec(t)[1],n=e?.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}},Nb=t=>{const{theme:e,prefix:n}=t,r={nextPart:new Map,validators:[]};return Fb(Object.entries(t.classGroups),n).forEach(([o,i])=>{ll(i,r,o,e)}),r},ll=(t,e,n,r)=>{t.forEach(s=>{if(typeof s=="string"){const o=s===""?e:hd(e,s);o.classGroupId=n;return}if(typeof s=="function"){if(Lb(s)){ll(s(r),e,n,r);return}e.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([o,i])=>{ll(i,hd(e,o),n,r)})})},hd=(t,e)=>{let n=t;return e.split(Ec).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Lb=t=>t.isThemeGetter,Fb=(t,e)=>e?t.map(([n,r])=>{const s=r.map(o=>typeof o=="string"?e+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([i,a])=>[e+i,a])):o);return[n,s]}):t,$b=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=new Map,r=new Map;const s=(o,i)=>{n.set(o,i),e++,e>t&&(e=0,r=n,n=new Map)};return{get(o){let i=n.get(o);if(i!==void 0)return i;if((i=r.get(o))!==void 0)return s(o,i),i},set(o,i){n.has(o)?n.set(o,i):s(o,i)}}},tm="!",Vb=t=>{const{separator:e,experimentalParseClassName:n}=t,r=e.length===1,s=e[0],o=e.length,i=a=>{const l=[];let u=0,d=0,h;for(let y=0;y<a.length;y++){let _=a[y];if(u===0){if(_===s&&(r||a.slice(y,y+o)===e)){l.push(a.slice(d,y)),d=y+o;continue}if(_==="/"){h=y;continue}}_==="["?u++:_==="]"&&u--}const f=l.length===0?a:a.substring(d),m=f.startsWith(tm),v=m?f.substring(1):f,g=h&&h>d?h-d:void 0;return{modifiers:l,hasImportantModifier:m,baseClassName:v,maybePostfixModifierPosition:g}};return n?a=>n({className:a,parseClassName:i}):i},Bb=t=>{if(t.length<=1)return t;const e=[];let n=[];return t.forEach(r=>{r[0]==="["?(e.push(...n.sort(),r),n=[]):n.push(r)}),e.push(...n.sort()),e},zb=t=>({cache:$b(t.cacheSize),parseClassName:Vb(t),...Ob(t)}),Ub=/\s+/,Hb=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=e,o=[],i=t.trim().split(Ub);let a="";for(let l=i.length-1;l>=0;l-=1){const u=i[l],{modifiers:d,hasImportantModifier:h,baseClassName:f,maybePostfixModifierPosition:m}=n(u);let v=!!m,g=r(v?f.substring(0,m):f);if(!g){if(!v){a=u+(a.length>0?" "+a:a);continue}if(g=r(f),!g){a=u+(a.length>0?" "+a:a);continue}v=!1}const y=Bb(d).join(":"),_=h?y+tm:y,x=_+g;if(o.includes(x))continue;o.push(x);const w=s(g,v);for(let E=0;E<w.length;++E){const b=w[E];o.push(_+b)}a=u+(a.length>0?" "+a:a)}return a};function Wb(){let t=0,e,n,r="";for(;t<arguments.length;)(e=arguments[t++])&&(n=nm(e))&&(r&&(r+=" "),r+=n);return r}const nm=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=nm(t[r]))&&(n&&(n+=" "),n+=e);return n};function Gb(t,...e){let n,r,s,o=i;function i(l){const u=e.reduce((d,h)=>h(d),t());return n=zb(u),r=n.cache.get,s=n.cache.set,o=a,a(l)}function a(l){const u=r(l);if(u)return u;const d=Hb(l,n);return s(l,d),d}return function(){return o(Wb.apply(null,arguments))}}const ve=t=>{const e=n=>n[t]||[];return e.isThemeGetter=!0,e},rm=/^\[(?:([a-z-]+):)?(.+)\]$/i,Kb=/^\d+\/\d+$/,qb=new Set(["px","full","screen"]),Yb=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Xb=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Zb=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Jb=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Qb=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Bt=t=>or(t)||qb.has(t)||Kb.test(t),en=t=>wr(t,"length",aw),or=t=>!!t&&!Number.isNaN(Number(t)),ha=t=>wr(t,"number",or),Mr=t=>!!t&&Number.isInteger(Number(t)),ew=t=>t.endsWith("%")&&or(t.slice(0,-1)),Q=t=>rm.test(t),tn=t=>Yb.test(t),tw=new Set(["length","size","percentage"]),nw=t=>wr(t,tw,sm),rw=t=>wr(t,"position",sm),sw=new Set(["image","url"]),ow=t=>wr(t,sw,cw),iw=t=>wr(t,"",lw),Or=()=>!0,wr=(t,e,n)=>{const r=rm.exec(t);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):n(r[2]):!1},aw=t=>Xb.test(t)&&!Zb.test(t),sm=()=>!1,lw=t=>Jb.test(t),cw=t=>Qb.test(t),uw=()=>{const t=ve("colors"),e=ve("spacing"),n=ve("blur"),r=ve("brightness"),s=ve("borderColor"),o=ve("borderRadius"),i=ve("borderSpacing"),a=ve("borderWidth"),l=ve("contrast"),u=ve("grayscale"),d=ve("hueRotate"),h=ve("invert"),f=ve("gap"),m=ve("gradientColorStops"),v=ve("gradientColorStopPositions"),g=ve("inset"),y=ve("margin"),_=ve("opacity"),x=ve("padding"),w=ve("saturate"),E=ve("scale"),b=ve("sepia"),T=ve("skew"),k=ve("space"),P=ve("translate"),O=()=>["auto","contain","none"],R=()=>["auto","hidden","clip","visible","scroll"],B=()=>["auto",Q,e],N=()=>[Q,e],K=()=>["",Bt,en],M=()=>["auto",or,Q],q=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],z=()=>["solid","dashed","dotted","double","none"],U=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],A=()=>["start","end","center","between","around","evenly","stretch"],I=()=>["","0",Q],ee=()=>["auto","avoid","all","avoid-page","page","left","right","column"],H=()=>[or,Q];return{cacheSize:500,separator:":",theme:{colors:[Or],spacing:[Bt,en],blur:["none","",tn,Q],brightness:H(),borderColor:[t],borderRadius:["none","","full",tn,Q],borderSpacing:N(),borderWidth:K(),contrast:H(),grayscale:I(),hueRotate:H(),invert:I(),gap:N(),gradientColorStops:[t],gradientColorStopPositions:[ew,en],inset:B(),margin:B(),opacity:H(),padding:N(),saturate:H(),scale:H(),sepia:I(),skew:H(),space:N(),translate:N()},classGroups:{aspect:[{aspect:["auto","square","video",Q]}],container:["container"],columns:[{columns:[tn]}],"break-after":[{"break-after":ee()}],"break-before":[{"break-before":ee()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...q(),Q]}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Mr,Q]}],basis:[{basis:B()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Q]}],grow:[{grow:I()}],shrink:[{shrink:I()}],order:[{order:["first","last","none",Mr,Q]}],"grid-cols":[{"grid-cols":[Or]}],"col-start-end":[{col:["auto",{span:["full",Mr,Q]},Q]}],"col-start":[{"col-start":M()}],"col-end":[{"col-end":M()}],"grid-rows":[{"grid-rows":[Or]}],"row-start-end":[{row:["auto",{span:[Mr,Q]},Q]}],"row-start":[{"row-start":M()}],"row-end":[{"row-end":M()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Q]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Q]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...A()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...A(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...A(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[x]}],px:[{px:[x]}],py:[{py:[x]}],ps:[{ps:[x]}],pe:[{pe:[x]}],pt:[{pt:[x]}],pr:[{pr:[x]}],pb:[{pb:[x]}],pl:[{pl:[x]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[k]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[k]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Q,e]}],"min-w":[{"min-w":[Q,e,"min","max","fit"]}],"max-w":[{"max-w":[Q,e,"none","full","min","max","fit","prose",{screen:[tn]},tn]}],h:[{h:[Q,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Q,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Q,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Q,e,"auto","min","max","fit"]}],"font-size":[{text:["base",tn,en]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ha]}],"font-family":[{font:[Or]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Q]}],"line-clamp":[{"line-clamp":["none",or,ha]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Bt,Q]}],"list-image":[{"list-image":["none",Q]}],"list-style-type":[{list:["none","disc","decimal",Q]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[_]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[_]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...z(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Bt,en]}],"underline-offset":[{"underline-offset":["auto",Bt,Q]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:N()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Q]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Q]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[_]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...q(),rw]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",nw]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},ow]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[_]}],"border-style":[{border:[...z(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[_]}],"divide-style":[{divide:z()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...z()]}],"outline-offset":[{"outline-offset":[Bt,Q]}],"outline-w":[{outline:[Bt,en]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:K()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[_]}],"ring-offset-w":[{"ring-offset":[Bt,en]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",tn,iw]}],"shadow-color":[{shadow:[Or]}],opacity:[{opacity:[_]}],"mix-blend":[{"mix-blend":[...U(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":U()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",tn,Q]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[h]}],saturate:[{saturate:[w]}],sepia:[{sepia:[b]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[h]}],"backdrop-opacity":[{"backdrop-opacity":[_]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[b]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Q]}],duration:[{duration:H()}],ease:[{ease:["linear","in","out","in-out",Q]}],delay:[{delay:H()}],animate:[{animate:["none","spin","ping","pulse","bounce",Q]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[E]}],"scale-x":[{"scale-x":[E]}],"scale-y":[{"scale-y":[E]}],rotate:[{rotate:[Mr,Q]}],"translate-x":[{"translate-x":[P]}],"translate-y":[{"translate-y":[P]}],"skew-x":[{"skew-x":[T]}],"skew-y":[{"skew-y":[T]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Q]}],accent:[{accent:["auto",t]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Q]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":N()}],"scroll-mx":[{"scroll-mx":N()}],"scroll-my":[{"scroll-my":N()}],"scroll-ms":[{"scroll-ms":N()}],"scroll-me":[{"scroll-me":N()}],"scroll-mt":[{"scroll-mt":N()}],"scroll-mr":[{"scroll-mr":N()}],"scroll-mb":[{"scroll-mb":N()}],"scroll-ml":[{"scroll-ml":N()}],"scroll-p":[{"scroll-p":N()}],"scroll-px":[{"scroll-px":N()}],"scroll-py":[{"scroll-py":N()}],"scroll-ps":[{"scroll-ps":N()}],"scroll-pe":[{"scroll-pe":N()}],"scroll-pt":[{"scroll-pt":N()}],"scroll-pr":[{"scroll-pr":N()}],"scroll-pb":[{"scroll-pb":N()}],"scroll-pl":[{"scroll-pl":N()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Q]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[Bt,en,ha]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},dw=Gb(uw);function _e(...t){return dw(wc(t))}const hw=$x,om=p.forwardRef(({className:t,...e},n)=>c.jsx(Hp,{ref:n,className:_e("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",t),...e}));om.displayName=Hp.displayName;const fw=Vi("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),im=p.forwardRef(({className:t,variant:e,...n},r)=>c.jsx(Wp,{ref:r,className:_e(fw({variant:e}),t),...n}));im.displayName=Wp.displayName;const pw=p.forwardRef(({className:t,...e},n)=>c.jsx(qp,{ref:n,className:_e("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",t),...e}));pw.displayName=qp.displayName;const am=p.forwardRef(({className:t,...e},n)=>c.jsx(Yp,{ref:n,className:_e("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",t),"toast-close":"",...e,children:c.jsx(Qp,{className:"h-4 w-4"})}));am.displayName=Yp.displayName;const lm=p.forwardRef(({className:t,...e},n)=>c.jsx(Gp,{ref:n,className:_e("text-sm font-semibold",t),...e}));lm.displayName=Gp.displayName;const cm=p.forwardRef(({className:t,...e},n)=>c.jsx(Kp,{ref:n,className:_e("text-sm opacity-90",t),...e}));cm.displayName=Kp.displayName;function mw(){const{toasts:t}=kp();return c.jsxs(hw,{children:[t.map(function({id:e,title:n,description:r,action:s,...o}){return c.jsxs(im,{...o,children:[c.jsxs("div",{className:"grid gap-1",children:[n&&c.jsx(lm,{children:n}),r&&c.jsx(cm,{children:r})]}),s,c.jsx(am,{})]},e)}),c.jsx(om,{})]})}var fd=["light","dark"],gw="(prefers-color-scheme: dark)",vw=p.createContext(void 0),yw={setTheme:t=>{},themes:[]},_w=()=>{var t;return(t=p.useContext(vw))!=null?t:yw};p.memo(({forcedTheme:t,storageKey:e,attribute:n,enableSystem:r,enableColorScheme:s,defaultTheme:o,value:i,attrs:a,nonce:l})=>{let u=o==="system",d=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${a.map(v=>`'${v}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,h=s?fd.includes(o)&&o?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${o}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",f=(v,g=!1,y=!0)=>{let _=i?i[v]:v,x=g?v+"|| ''":`'${_}'`,w="";return s&&y&&!g&&fd.includes(v)&&(w+=`d.style.colorScheme = '${v}';`),n==="class"?g||_?w+=`c.add(${x})`:w+="null":_&&(w+=`d[s](n,${x})`),w},m=t?`!function(){${d}${f(t)}}()`:r?`!function(){try{${d}var e=localStorage.getItem('${e}');if('system'===e||(!e&&${u})){var t='${gw}',m=window.matchMedia(t);if(m.media!==t||m.matches){${f("dark")}}else{${f("light")}}}else if(e){${i?`var x=${JSON.stringify(i)};`:""}${f(i?"x[e]":"e",!0)}}${u?"":"else{"+f(o,!1,!1)+"}"}${h}}catch(e){}}()`:`!function(){try{${d}var e=localStorage.getItem('${e}');if(e){${i?`var x=${JSON.stringify(i)};`:""}${f(i?"x[e]":"e",!0)}}else{${f(o,!1,!1)};}${h}}catch(t){}}();`;return p.createElement("script",{nonce:l,dangerouslySetInnerHTML:{__html:m}})});var xw=t=>{switch(t){case"success":return Ew;case"info":return Tw;case"warning":return Sw;case"error":return kw;default:return null}},bw=Array(12).fill(0),ww=({visible:t})=>D.createElement("div",{className:"sonner-loading-wrapper","data-visible":t},D.createElement("div",{className:"sonner-spinner"},bw.map((e,n)=>D.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),Ew=D.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},D.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),Sw=D.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},D.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Tw=D.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},D.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),kw=D.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},D.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Pw=()=>{let[t,e]=D.useState(document.hidden);return D.useEffect(()=>{let n=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),t},cl=1,Cw=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let n=this.subscribers.indexOf(e);this.subscribers.splice(n,1)}),this.publish=e=>{this.subscribers.forEach(n=>n(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var n;let{message:r,...s}=e,o=typeof e?.id=="number"||((n=e.id)==null?void 0:n.length)>0?e.id:cl++,i=this.toasts.find(l=>l.id===o),a=e.dismissible===void 0?!0:e.dismissible;return i?this.toasts=this.toasts.map(l=>l.id===o?(this.publish({...l,...e,id:o,title:r}),{...l,...e,id:o,dismissible:a,title:r}):l):this.addToast({title:r,...s,dismissible:a,id:o}),o},this.dismiss=e=>(e||this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),this.subscribers.forEach(n=>n({id:e,dismiss:!0})),e),this.message=(e,n)=>this.create({...n,message:e}),this.error=(e,n)=>this.create({...n,message:e,type:"error"}),this.success=(e,n)=>this.create({...n,type:"success",message:e}),this.info=(e,n)=>this.create({...n,type:"info",message:e}),this.warning=(e,n)=>this.create({...n,type:"warning",message:e}),this.loading=(e,n)=>this.create({...n,type:"loading",message:e}),this.promise=(e,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:e,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));let s=e instanceof Promise?e:e(),o=r!==void 0;return s.then(async i=>{if(Rw(i)&&!i.ok){o=!1;let a=typeof n.error=="function"?await n.error(`HTTP error! status: ${i.status}`):n.error,l=typeof n.description=="function"?await n.description(`HTTP error! status: ${i.status}`):n.description;this.create({id:r,type:"error",message:a,description:l})}else if(n.success!==void 0){o=!1;let a=typeof n.success=="function"?await n.success(i):n.success,l=typeof n.description=="function"?await n.description(i):n.description;this.create({id:r,type:"success",message:a,description:l})}}).catch(async i=>{if(n.error!==void 0){o=!1;let a=typeof n.error=="function"?await n.error(i):n.error,l=typeof n.description=="function"?await n.description(i):n.description;this.create({id:r,type:"error",message:a,description:l})}}).finally(()=>{var i;o&&(this.dismiss(r),r=void 0),(i=n.finally)==null||i.call(n)}),r},this.custom=(e,n)=>{let r=n?.id||cl++;return this.create({jsx:e(r),id:r,...n}),r},this.subscribers=[],this.toasts=[]}},Xe=new Cw,jw=(t,e)=>{let n=e?.id||cl++;return Xe.addToast({title:t,...e,id:n}),n},Rw=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",Aw=jw,Iw=()=>Xe.toasts,Pt=Object.assign(Aw,{success:Xe.success,info:Xe.info,warning:Xe.warning,error:Xe.error,custom:Xe.custom,message:Xe.message,promise:Xe.promise,dismiss:Xe.dismiss,loading:Xe.loading},{getHistory:Iw});function Mw(t,{insertAt:e}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",e==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}Mw(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999}:where([data-sonner-toaster][data-x-position="right"]){right:max(var(--offset),env(safe-area-inset-right))}:where([data-sonner-toaster][data-x-position="left"]){left:max(var(--offset),env(safe-area-inset-left))}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:max(var(--offset),env(safe-area-inset-top))}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:max(var(--offset),env(safe-area-inset-bottom))}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;background:var(--gray1);color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:0;right:0;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount, 0px));transition:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation:swipe-out .2s ease-out forwards}@keyframes swipe-out{0%{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount)));opacity:1}to{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount) + var(--lift) * -100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;--mobile-offset: 16px;right:var(--mobile-offset);left:var(--mobile-offset);width:100%}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset)}[data-sonner-toaster][data-y-position=bottom]{bottom:20px}[data-sonner-toaster][data-y-position=top]{top:20px}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset);right:var(--mobile-offset);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
`);function ko(t){return t.label!==void 0}var Ow=3,Dw="32px",Nw=4e3,Lw=356,Fw=14,$w=20,Vw=200;function Bw(...t){return t.filter(Boolean).join(" ")}var zw=t=>{var e,n,r,s,o,i,a,l,u,d;let{invert:h,toast:f,unstyled:m,interacting:v,setHeights:g,visibleToasts:y,heights:_,index:x,toasts:w,expanded:E,removeToast:b,defaultRichColors:T,closeButton:k,style:P,cancelButtonStyle:O,actionButtonStyle:R,className:B="",descriptionClassName:N="",duration:K,position:M,gap:q,loadingIcon:z,expandByDefault:U,classNames:A,icons:I,closeButtonAriaLabel:ee="Close toast",pauseWhenPageIsHidden:H,cn:Y}=t,[Z,oe]=D.useState(!1),[Re,ne]=D.useState(!1),[me,qe]=D.useState(!1),[$t,Le]=D.useState(!1),[Cr,Jt]=D.useState(0),[vt,jr]=D.useState(0),Rr=D.useRef(null),Vt=D.useRef(null),Ar=x===0,j_=x+1<=y,et=f.type,$n=f.dismissible!==!1,R_=f.className||"",A_=f.descriptionClassName||"",wo=D.useMemo(()=>_.findIndex(J=>J.toastId===f.id)||0,[_,f.id]),I_=D.useMemo(()=>{var J;return(J=f.closeButton)!=null?J:k},[f.closeButton,k]),Gu=D.useMemo(()=>f.duration||K||Nw,[f.duration,K]),aa=D.useRef(0),Vn=D.useRef(0),Ku=D.useRef(0),Bn=D.useRef(null),[qu,M_]=M.split("-"),Yu=D.useMemo(()=>_.reduce((J,ge,de)=>de>=wo?J:J+ge.height,0),[_,wo]),Xu=Pw(),O_=f.invert||h,la=et==="loading";Vn.current=D.useMemo(()=>wo*q+Yu,[wo,Yu]),D.useEffect(()=>{oe(!0)},[]),D.useLayoutEffect(()=>{if(!Z)return;let J=Vt.current,ge=J.style.height;J.style.height="auto";let de=J.getBoundingClientRect().height;J.style.height=ge,jr(de),g(yt=>yt.find(_t=>_t.toastId===f.id)?yt.map(_t=>_t.toastId===f.id?{..._t,height:de}:_t):[{toastId:f.id,height:de,position:f.position},...yt])},[Z,f.title,f.description,g,f.id]);let Qt=D.useCallback(()=>{ne(!0),Jt(Vn.current),g(J=>J.filter(ge=>ge.toastId!==f.id)),setTimeout(()=>{b(f)},Vw)},[f,b,g,Vn]);D.useEffect(()=>{if(f.promise&&et==="loading"||f.duration===1/0||f.type==="loading")return;let J,ge=Gu;return E||v||H&&Xu?(()=>{if(Ku.current<aa.current){let de=new Date().getTime()-aa.current;ge=ge-de}Ku.current=new Date().getTime()})():ge!==1/0&&(aa.current=new Date().getTime(),J=setTimeout(()=>{var de;(de=f.onAutoClose)==null||de.call(f,f),Qt()},ge)),()=>clearTimeout(J)},[E,v,U,f,Gu,Qt,f.promise,et,H,Xu]),D.useEffect(()=>{let J=Vt.current;if(J){let ge=J.getBoundingClientRect().height;return jr(ge),g(de=>[{toastId:f.id,height:ge,position:f.position},...de]),()=>g(de=>de.filter(yt=>yt.toastId!==f.id))}},[g,f.id]),D.useEffect(()=>{f.delete&&Qt()},[Qt,f.delete]);function D_(){return I!=null&&I.loading?D.createElement("div",{className:"sonner-loader","data-visible":et==="loading"},I.loading):z?D.createElement("div",{className:"sonner-loader","data-visible":et==="loading"},z):D.createElement(ww,{visible:et==="loading"})}return D.createElement("li",{"aria-live":f.important?"assertive":"polite","aria-atomic":"true",role:"status",tabIndex:0,ref:Vt,className:Y(B,R_,A?.toast,(e=f?.classNames)==null?void 0:e.toast,A?.default,A?.[et],(n=f?.classNames)==null?void 0:n[et]),"data-sonner-toast":"","data-rich-colors":(r=f.richColors)!=null?r:T,"data-styled":!(f.jsx||f.unstyled||m),"data-mounted":Z,"data-promise":!!f.promise,"data-removed":Re,"data-visible":j_,"data-y-position":qu,"data-x-position":M_,"data-index":x,"data-front":Ar,"data-swiping":me,"data-dismissible":$n,"data-type":et,"data-invert":O_,"data-swipe-out":$t,"data-expanded":!!(E||U&&Z),style:{"--index":x,"--toasts-before":x,"--z-index":w.length-x,"--offset":`${Re?Cr:Vn.current}px`,"--initial-height":U?"auto":`${vt}px`,...P,...f.style},onPointerDown:J=>{la||!$n||(Rr.current=new Date,Jt(Vn.current),J.target.setPointerCapture(J.pointerId),J.target.tagName!=="BUTTON"&&(qe(!0),Bn.current={x:J.clientX,y:J.clientY}))},onPointerUp:()=>{var J,ge,de,yt;if($t||!$n)return;Bn.current=null;let _t=Number(((J=Vt.current)==null?void 0:J.style.getPropertyValue("--swipe-amount").replace("px",""))||0),Eo=new Date().getTime()-((ge=Rr.current)==null?void 0:ge.getTime()),N_=Math.abs(_t)/Eo;if(Math.abs(_t)>=$w||N_>.11){Jt(Vn.current),(de=f.onDismiss)==null||de.call(f,f),Qt(),Le(!0);return}(yt=Vt.current)==null||yt.style.setProperty("--swipe-amount","0px"),qe(!1)},onPointerMove:J=>{var ge;if(!Bn.current||!$n)return;let de=J.clientY-Bn.current.y,yt=J.clientX-Bn.current.x,_t=(qu==="top"?Math.min:Math.max)(0,de),Eo=J.pointerType==="touch"?10:2;Math.abs(_t)>Eo?(ge=Vt.current)==null||ge.style.setProperty("--swipe-amount",`${de}px`):Math.abs(yt)>Eo&&(Bn.current=null)}},I_&&!f.jsx?D.createElement("button",{"aria-label":ee,"data-disabled":la,"data-close-button":!0,onClick:la||!$n?()=>{}:()=>{var J;Qt(),(J=f.onDismiss)==null||J.call(f,f)},className:Y(A?.closeButton,(s=f?.classNames)==null?void 0:s.closeButton)},D.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},D.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),D.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))):null,f.jsx||D.isValidElement(f.title)?f.jsx||f.title:D.createElement(D.Fragment,null,et||f.icon||f.promise?D.createElement("div",{"data-icon":"",className:Y(A?.icon,(o=f?.classNames)==null?void 0:o.icon)},f.promise||f.type==="loading"&&!f.icon?f.icon||D_():null,f.type!=="loading"?f.icon||I?.[et]||xw(et):null):null,D.createElement("div",{"data-content":"",className:Y(A?.content,(i=f?.classNames)==null?void 0:i.content)},D.createElement("div",{"data-title":"",className:Y(A?.title,(a=f?.classNames)==null?void 0:a.title)},f.title),f.description?D.createElement("div",{"data-description":"",className:Y(N,A_,A?.description,(l=f?.classNames)==null?void 0:l.description)},f.description):null),D.isValidElement(f.cancel)?f.cancel:f.cancel&&ko(f.cancel)?D.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||O,onClick:J=>{var ge,de;ko(f.cancel)&&$n&&((de=(ge=f.cancel).onClick)==null||de.call(ge,J),Qt())},className:Y(A?.cancelButton,(u=f?.classNames)==null?void 0:u.cancelButton)},f.cancel.label):null,D.isValidElement(f.action)?f.action:f.action&&ko(f.action)?D.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||R,onClick:J=>{var ge,de;ko(f.action)&&(J.defaultPrevented||((de=(ge=f.action).onClick)==null||de.call(ge,J),Qt()))},className:Y(A?.actionButton,(d=f?.classNames)==null?void 0:d.actionButton)},f.action.label):null))};function pd(){if(typeof window>"u"||typeof document>"u")return"ltr";let t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}var Uw=t=>{let{invert:e,position:n="bottom-right",hotkey:r=["altKey","KeyT"],expand:s,closeButton:o,className:i,offset:a,theme:l="light",richColors:u,duration:d,style:h,visibleToasts:f=Ow,toastOptions:m,dir:v=pd(),gap:g=Fw,loadingIcon:y,icons:_,containerAriaLabel:x="Notifications",pauseWhenPageIsHidden:w,cn:E=Bw}=t,[b,T]=D.useState([]),k=D.useMemo(()=>Array.from(new Set([n].concat(b.filter(H=>H.position).map(H=>H.position)))),[b,n]),[P,O]=D.useState([]),[R,B]=D.useState(!1),[N,K]=D.useState(!1),[M,q]=D.useState(l!=="system"?l:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),z=D.useRef(null),U=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),A=D.useRef(null),I=D.useRef(!1),ee=D.useCallback(H=>{var Y;(Y=b.find(Z=>Z.id===H.id))!=null&&Y.delete||Xe.dismiss(H.id),T(Z=>Z.filter(({id:oe})=>oe!==H.id))},[b]);return D.useEffect(()=>Xe.subscribe(H=>{if(H.dismiss){T(Y=>Y.map(Z=>Z.id===H.id?{...Z,delete:!0}:Z));return}setTimeout(()=>{wp.flushSync(()=>{T(Y=>{let Z=Y.findIndex(oe=>oe.id===H.id);return Z!==-1?[...Y.slice(0,Z),{...Y[Z],...H},...Y.slice(Z+1)]:[H,...Y]})})})}),[]),D.useEffect(()=>{if(l!=="system"){q(l);return}l==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?q("dark"):q("light")),typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",({matches:H})=>{q(H?"dark":"light")})},[l]),D.useEffect(()=>{b.length<=1&&B(!1)},[b]),D.useEffect(()=>{let H=Y=>{var Z,oe;r.every(Re=>Y[Re]||Y.code===Re)&&(B(!0),(Z=z.current)==null||Z.focus()),Y.code==="Escape"&&(document.activeElement===z.current||(oe=z.current)!=null&&oe.contains(document.activeElement))&&B(!1)};return document.addEventListener("keydown",H),()=>document.removeEventListener("keydown",H)},[r]),D.useEffect(()=>{if(z.current)return()=>{A.current&&(A.current.focus({preventScroll:!0}),A.current=null,I.current=!1)}},[z.current]),b.length?D.createElement("section",{"aria-label":`${x} ${U}`,tabIndex:-1},k.map((H,Y)=>{var Z;let[oe,Re]=H.split("-");return D.createElement("ol",{key:H,dir:v==="auto"?pd():v,tabIndex:-1,ref:z,className:i,"data-sonner-toaster":!0,"data-theme":M,"data-y-position":oe,"data-x-position":Re,style:{"--front-toast-height":`${((Z=P[0])==null?void 0:Z.height)||0}px`,"--offset":typeof a=="number"?`${a}px`:a||Dw,"--width":`${Lw}px`,"--gap":`${g}px`,...h},onBlur:ne=>{I.current&&!ne.currentTarget.contains(ne.relatedTarget)&&(I.current=!1,A.current&&(A.current.focus({preventScroll:!0}),A.current=null))},onFocus:ne=>{ne.target instanceof HTMLElement&&ne.target.dataset.dismissible==="false"||I.current||(I.current=!0,A.current=ne.relatedTarget)},onMouseEnter:()=>B(!0),onMouseMove:()=>B(!0),onMouseLeave:()=>{N||B(!1)},onPointerDown:ne=>{ne.target instanceof HTMLElement&&ne.target.dataset.dismissible==="false"||K(!0)},onPointerUp:()=>K(!1)},b.filter(ne=>!ne.position&&Y===0||ne.position===H).map((ne,me)=>{var qe,$t;return D.createElement(zw,{key:ne.id,icons:_,index:me,toast:ne,defaultRichColors:u,duration:(qe=m?.duration)!=null?qe:d,className:m?.className,descriptionClassName:m?.descriptionClassName,invert:e,visibleToasts:f,closeButton:($t=m?.closeButton)!=null?$t:o,interacting:N,position:H,style:m?.style,unstyled:m?.unstyled,classNames:m?.classNames,cancelButtonStyle:m?.cancelButtonStyle,actionButtonStyle:m?.actionButtonStyle,removeToast:ee,toasts:b.filter(Le=>Le.position==ne.position),heights:P.filter(Le=>Le.position==ne.position),setHeights:O,expandByDefault:s,gap:g,loadingIcon:y,expanded:R,pauseWhenPageIsHidden:w,cn:E})}))})):null};const Hw=({...t})=>{const{theme:e="system"}=_w();return c.jsx(Uw,{theme:e,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...t})};var Ww=$_.useId||(()=>{}),Gw=0;function Pn(t){const[e,n]=p.useState(Ww());return Dt(()=>{n(r=>r??String(Gw++))},[t]),e?`radix-${e}`:""}const Kw=["top","right","bottom","left"],fn=Math.min,Ze=Math.max,si=Math.round,Po=Math.floor,pn=t=>({x:t,y:t}),qw={left:"right",right:"left",bottom:"top",top:"bottom"},Yw={start:"end",end:"start"};function ul(t,e,n){return Ze(t,fn(e,n))}function Yt(t,e){return typeof t=="function"?t(e):t}function Xt(t){return t.split("-")[0]}function Er(t){return t.split("-")[1]}function Sc(t){return t==="x"?"y":"x"}function Tc(t){return t==="y"?"height":"width"}function mn(t){return["top","bottom"].includes(Xt(t))?"y":"x"}function kc(t){return Sc(mn(t))}function Xw(t,e,n){n===void 0&&(n=!1);const r=Er(t),s=kc(t),o=Tc(s);let i=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(i=oi(i)),[i,oi(i)]}function Zw(t){const e=oi(t);return[dl(t),e,dl(e)]}function dl(t){return t.replace(/start|end/g,e=>Yw[e])}function Jw(t,e,n){const r=["left","right"],s=["right","left"],o=["top","bottom"],i=["bottom","top"];switch(t){case"top":case"bottom":return n?e?s:r:e?r:s;case"left":case"right":return e?o:i;default:return[]}}function Qw(t,e,n,r){const s=Er(t);let o=Jw(Xt(t),n==="start",r);return s&&(o=o.map(i=>i+"-"+s),e&&(o=o.concat(o.map(dl)))),o}function oi(t){return t.replace(/left|right|bottom|top/g,e=>qw[e])}function e1(t){return{top:0,right:0,bottom:0,left:0,...t}}function um(t){return typeof t!="number"?e1(t):{top:t,right:t,bottom:t,left:t}}function ii(t){const{x:e,y:n,width:r,height:s}=t;return{width:r,height:s,top:n,left:e,right:e+r,bottom:n+s,x:e,y:n}}function md(t,e,n){let{reference:r,floating:s}=t;const o=mn(e),i=kc(e),a=Tc(i),l=Xt(e),u=o==="y",d=r.x+r.width/2-s.width/2,h=r.y+r.height/2-s.height/2,f=r[a]/2-s[a]/2;let m;switch(l){case"top":m={x:d,y:r.y-s.height};break;case"bottom":m={x:d,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:h};break;case"left":m={x:r.x-s.width,y:h};break;default:m={x:r.x,y:r.y}}switch(Er(e)){case"start":m[i]-=f*(n&&u?-1:1);break;case"end":m[i]+=f*(n&&u?-1:1);break}return m}const t1=async(t,e,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:o=[],platform:i}=n,a=o.filter(Boolean),l=await(i.isRTL==null?void 0:i.isRTL(e));let u=await i.getElementRects({reference:t,floating:e,strategy:s}),{x:d,y:h}=md(u,r,l),f=r,m={},v=0;for(let g=0;g<a.length;g++){const{name:y,fn:_}=a[g],{x,y:w,data:E,reset:b}=await _({x:d,y:h,initialPlacement:r,placement:f,strategy:s,middlewareData:m,rects:u,platform:i,elements:{reference:t,floating:e}});d=x??d,h=w??h,m={...m,[y]:{...m[y],...E}},b&&v<=50&&(v++,typeof b=="object"&&(b.placement&&(f=b.placement),b.rects&&(u=b.rects===!0?await i.getElementRects({reference:t,floating:e,strategy:s}):b.rects),{x:d,y:h}=md(u,f,l)),g=-1)}return{x:d,y:h,placement:f,strategy:s,middlewareData:m}};async function Vs(t,e){var n;e===void 0&&(e={});const{x:r,y:s,platform:o,rects:i,elements:a,strategy:l}=t,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:f=!1,padding:m=0}=Yt(e,t),v=um(m),y=a[f?h==="floating"?"reference":"floating":h],_=ii(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(y)))==null||n?y:y.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:u,rootBoundary:d,strategy:l})),x=h==="floating"?{x:r,y:s,width:i.floating.width,height:i.floating.height}:i.reference,w=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),E=await(o.isElement==null?void 0:o.isElement(w))?await(o.getScale==null?void 0:o.getScale(w))||{x:1,y:1}:{x:1,y:1},b=ii(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:x,offsetParent:w,strategy:l}):x);return{top:(_.top-b.top+v.top)/E.y,bottom:(b.bottom-_.bottom+v.bottom)/E.y,left:(_.left-b.left+v.left)/E.x,right:(b.right-_.right+v.right)/E.x}}const n1=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:s,rects:o,platform:i,elements:a,middlewareData:l}=e,{element:u,padding:d=0}=Yt(t,e)||{};if(u==null)return{};const h=um(d),f={x:n,y:r},m=kc(s),v=Tc(m),g=await i.getDimensions(u),y=m==="y",_=y?"top":"left",x=y?"bottom":"right",w=y?"clientHeight":"clientWidth",E=o.reference[v]+o.reference[m]-f[m]-o.floating[v],b=f[m]-o.reference[m],T=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u));let k=T?T[w]:0;(!k||!await(i.isElement==null?void 0:i.isElement(T)))&&(k=a.floating[w]||o.floating[v]);const P=E/2-b/2,O=k/2-g[v]/2-1,R=fn(h[_],O),B=fn(h[x],O),N=R,K=k-g[v]-B,M=k/2-g[v]/2+P,q=ul(N,M,K),z=!l.arrow&&Er(s)!=null&&M!==q&&o.reference[v]/2-(M<N?R:B)-g[v]/2<0,U=z?M<N?M-N:M-K:0;return{[m]:f[m]+U,data:{[m]:q,centerOffset:M-q-U,...z&&{alignmentOffset:U}},reset:z}}}),r1=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:s,middlewareData:o,rects:i,initialPlacement:a,platform:l,elements:u}=e,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:f,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:g=!0,...y}=Yt(t,e);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const _=Xt(s),x=mn(a),w=Xt(a)===a,E=await(l.isRTL==null?void 0:l.isRTL(u.floating)),b=f||(w||!g?[oi(a)]:Zw(a)),T=v!=="none";!f&&T&&b.push(...Qw(a,g,v,E));const k=[a,...b],P=await Vs(e,y),O=[];let R=((r=o.flip)==null?void 0:r.overflows)||[];if(d&&O.push(P[_]),h){const M=Xw(s,i,E);O.push(P[M[0]],P[M[1]])}if(R=[...R,{placement:s,overflows:O}],!O.every(M=>M<=0)){var B,N;const M=(((B=o.flip)==null?void 0:B.index)||0)+1,q=k[M];if(q)return{data:{index:M,overflows:R},reset:{placement:q}};let z=(N=R.filter(U=>U.overflows[0]<=0).sort((U,A)=>U.overflows[1]-A.overflows[1])[0])==null?void 0:N.placement;if(!z)switch(m){case"bestFit":{var K;const U=(K=R.filter(A=>{if(T){const I=mn(A.placement);return I===x||I==="y"}return!0}).map(A=>[A.placement,A.overflows.filter(I=>I>0).reduce((I,ee)=>I+ee,0)]).sort((A,I)=>A[1]-I[1])[0])==null?void 0:K[0];U&&(z=U);break}case"initialPlacement":z=a;break}if(s!==z)return{reset:{placement:z}}}return{}}}};function gd(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function vd(t){return Kw.some(e=>t[e]>=0)}const s1=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:r="referenceHidden",...s}=Yt(t,e);switch(r){case"referenceHidden":{const o=await Vs(e,{...s,elementContext:"reference"}),i=gd(o,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:vd(i)}}}case"escaped":{const o=await Vs(e,{...s,altBoundary:!0}),i=gd(o,n.floating);return{data:{escapedOffsets:i,escaped:vd(i)}}}default:return{}}}}};async function o1(t,e){const{placement:n,platform:r,elements:s}=t,o=await(r.isRTL==null?void 0:r.isRTL(s.floating)),i=Xt(n),a=Er(n),l=mn(n)==="y",u=["left","top"].includes(i)?-1:1,d=o&&l?-1:1,h=Yt(e,t);let{mainAxis:f,crossAxis:m,alignmentAxis:v}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&typeof v=="number"&&(m=a==="end"?v*-1:v),l?{x:m*d,y:f*u}:{x:f*u,y:m*d}}const i1=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:s,y:o,placement:i,middlewareData:a}=e,l=await o1(e,t);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:s+l.x,y:o+l.y,data:{...l,placement:i}}}}},a1=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:s}=e,{mainAxis:o=!0,crossAxis:i=!1,limiter:a={fn:y=>{let{x:_,y:x}=y;return{x:_,y:x}}},...l}=Yt(t,e),u={x:n,y:r},d=await Vs(e,l),h=mn(Xt(s)),f=Sc(h);let m=u[f],v=u[h];if(o){const y=f==="y"?"top":"left",_=f==="y"?"bottom":"right",x=m+d[y],w=m-d[_];m=ul(x,m,w)}if(i){const y=h==="y"?"top":"left",_=h==="y"?"bottom":"right",x=v+d[y],w=v-d[_];v=ul(x,v,w)}const g=a.fn({...e,[f]:m,[h]:v});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[f]:o,[h]:i}}}}}},l1=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:s,rects:o,middlewareData:i}=e,{offset:a=0,mainAxis:l=!0,crossAxis:u=!0}=Yt(t,e),d={x:n,y:r},h=mn(s),f=Sc(h);let m=d[f],v=d[h];const g=Yt(a,e),y=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){const w=f==="y"?"height":"width",E=o.reference[f]-o.floating[w]+y.mainAxis,b=o.reference[f]+o.reference[w]-y.mainAxis;m<E?m=E:m>b&&(m=b)}if(u){var _,x;const w=f==="y"?"width":"height",E=["top","left"].includes(Xt(s)),b=o.reference[h]-o.floating[w]+(E&&((_=i.offset)==null?void 0:_[h])||0)+(E?0:y.crossAxis),T=o.reference[h]+o.reference[w]+(E?0:((x=i.offset)==null?void 0:x[h])||0)-(E?y.crossAxis:0);v<b?v=b:v>T&&(v=T)}return{[f]:m,[h]:v}}}},c1=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:s,rects:o,platform:i,elements:a}=e,{apply:l=()=>{},...u}=Yt(t,e),d=await Vs(e,u),h=Xt(s),f=Er(s),m=mn(s)==="y",{width:v,height:g}=o.floating;let y,_;h==="top"||h==="bottom"?(y=h,_=f===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(_=h,y=f==="end"?"top":"bottom");const x=g-d.top-d.bottom,w=v-d.left-d.right,E=fn(g-d[y],x),b=fn(v-d[_],w),T=!e.middlewareData.shift;let k=E,P=b;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(P=w),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(k=x),T&&!f){const R=Ze(d.left,0),B=Ze(d.right,0),N=Ze(d.top,0),K=Ze(d.bottom,0);m?P=v-2*(R!==0||B!==0?R+B:Ze(d.left,d.right)):k=g-2*(N!==0||K!==0?N+K:Ze(d.top,d.bottom))}await l({...e,availableWidth:P,availableHeight:k});const O=await i.getDimensions(a.floating);return v!==O.width||g!==O.height?{reset:{rects:!0}}:{}}}};function Bi(){return typeof window<"u"}function Sr(t){return dm(t)?(t.nodeName||"").toLowerCase():"#document"}function Qe(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Ft(t){var e;return(e=(dm(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function dm(t){return Bi()?t instanceof Node||t instanceof Qe(t).Node:!1}function dt(t){return Bi()?t instanceof Element||t instanceof Qe(t).Element:!1}function Nt(t){return Bi()?t instanceof HTMLElement||t instanceof Qe(t).HTMLElement:!1}function yd(t){return!Bi()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Qe(t).ShadowRoot}function uo(t){const{overflow:e,overflowX:n,overflowY:r,display:s}=ht(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(s)}function u1(t){return["table","td","th"].includes(Sr(t))}function zi(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function Pc(t){const e=Cc(),n=dt(t)?ht(t):t;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function d1(t){let e=gn(t);for(;Nt(e)&&!ur(e);){if(Pc(e))return e;if(zi(e))return null;e=gn(e)}return null}function Cc(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ur(t){return["html","body","#document"].includes(Sr(t))}function ht(t){return Qe(t).getComputedStyle(t)}function Ui(t){return dt(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function gn(t){if(Sr(t)==="html")return t;const e=t.assignedSlot||t.parentNode||yd(t)&&t.host||Ft(t);return yd(e)?e.host:e}function hm(t){const e=gn(t);return ur(e)?t.ownerDocument?t.ownerDocument.body:t.body:Nt(e)&&uo(e)?e:hm(e)}function Bs(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const s=hm(t),o=s===((r=t.ownerDocument)==null?void 0:r.body),i=Qe(s);if(o){const a=hl(i);return e.concat(i,i.visualViewport||[],uo(s)?s:[],a&&n?Bs(a):[])}return e.concat(s,Bs(s,[],n))}function hl(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function fm(t){const e=ht(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const s=Nt(t),o=s?t.offsetWidth:n,i=s?t.offsetHeight:r,a=si(n)!==o||si(r)!==i;return a&&(n=o,r=i),{width:n,height:r,$:a}}function jc(t){return dt(t)?t:t.contextElement}function ir(t){const e=jc(t);if(!Nt(e))return pn(1);const n=e.getBoundingClientRect(),{width:r,height:s,$:o}=fm(e);let i=(o?si(n.width):n.width)/r,a=(o?si(n.height):n.height)/s;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const h1=pn(0);function pm(t){const e=Qe(t);return!Cc()||!e.visualViewport?h1:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function f1(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Qe(t)?!1:e}function Rn(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const s=t.getBoundingClientRect(),o=jc(t);let i=pn(1);e&&(r?dt(r)&&(i=ir(r)):i=ir(t));const a=f1(o,n,r)?pm(o):pn(0);let l=(s.left+a.x)/i.x,u=(s.top+a.y)/i.y,d=s.width/i.x,h=s.height/i.y;if(o){const f=Qe(o),m=r&&dt(r)?Qe(r):r;let v=f,g=hl(v);for(;g&&r&&m!==v;){const y=ir(g),_=g.getBoundingClientRect(),x=ht(g),w=_.left+(g.clientLeft+parseFloat(x.paddingLeft))*y.x,E=_.top+(g.clientTop+parseFloat(x.paddingTop))*y.y;l*=y.x,u*=y.y,d*=y.x,h*=y.y,l+=w,u+=E,v=Qe(g),g=hl(v)}}return ii({width:d,height:h,x:l,y:u})}function p1(t){let{elements:e,rect:n,offsetParent:r,strategy:s}=t;const o=s==="fixed",i=Ft(r),a=e?zi(e.floating):!1;if(r===i||a&&o)return n;let l={scrollLeft:0,scrollTop:0},u=pn(1);const d=pn(0),h=Nt(r);if((h||!h&&!o)&&((Sr(r)!=="body"||uo(i))&&(l=Ui(r)),Nt(r))){const f=Rn(r);u=ir(r),d.x=f.x+r.clientLeft,d.y=f.y+r.clientTop}return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+d.x,y:n.y*u.y-l.scrollTop*u.y+d.y}}function m1(t){return Array.from(t.getClientRects())}function fl(t,e){const n=Ui(t).scrollLeft;return e?e.left+n:Rn(Ft(t)).left+n}function g1(t){const e=Ft(t),n=Ui(t),r=t.ownerDocument.body,s=Ze(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=Ze(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+fl(t);const a=-n.scrollTop;return ht(r).direction==="rtl"&&(i+=Ze(e.clientWidth,r.clientWidth)-s),{width:s,height:o,x:i,y:a}}function v1(t,e){const n=Qe(t),r=Ft(t),s=n.visualViewport;let o=r.clientWidth,i=r.clientHeight,a=0,l=0;if(s){o=s.width,i=s.height;const u=Cc();(!u||u&&e==="fixed")&&(a=s.offsetLeft,l=s.offsetTop)}return{width:o,height:i,x:a,y:l}}function y1(t,e){const n=Rn(t,!0,e==="fixed"),r=n.top+t.clientTop,s=n.left+t.clientLeft,o=Nt(t)?ir(t):pn(1),i=t.clientWidth*o.x,a=t.clientHeight*o.y,l=s*o.x,u=r*o.y;return{width:i,height:a,x:l,y:u}}function _d(t,e,n){let r;if(e==="viewport")r=v1(t,n);else if(e==="document")r=g1(Ft(t));else if(dt(e))r=y1(e,n);else{const s=pm(t);r={...e,x:e.x-s.x,y:e.y-s.y}}return ii(r)}function mm(t,e){const n=gn(t);return n===e||!dt(n)||ur(n)?!1:ht(n).position==="fixed"||mm(n,e)}function _1(t,e){const n=e.get(t);if(n)return n;let r=Bs(t,[],!1).filter(a=>dt(a)&&Sr(a)!=="body"),s=null;const o=ht(t).position==="fixed";let i=o?gn(t):t;for(;dt(i)&&!ur(i);){const a=ht(i),l=Pc(i);!l&&a.position==="fixed"&&(s=null),(o?!l&&!s:!l&&a.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||uo(i)&&!l&&mm(t,i))?r=r.filter(d=>d!==i):s=a,i=gn(i)}return e.set(t,r),r}function x1(t){let{element:e,boundary:n,rootBoundary:r,strategy:s}=t;const i=[...n==="clippingAncestors"?zi(e)?[]:_1(e,this._c):[].concat(n),r],a=i[0],l=i.reduce((u,d)=>{const h=_d(e,d,s);return u.top=Ze(h.top,u.top),u.right=fn(h.right,u.right),u.bottom=fn(h.bottom,u.bottom),u.left=Ze(h.left,u.left),u},_d(e,a,s));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function b1(t){const{width:e,height:n}=fm(t);return{width:e,height:n}}function w1(t,e,n){const r=Nt(e),s=Ft(e),o=n==="fixed",i=Rn(t,!0,o,e);let a={scrollLeft:0,scrollTop:0};const l=pn(0);if(r||!r&&!o)if((Sr(e)!=="body"||uo(s))&&(a=Ui(e)),r){const m=Rn(e,!0,o,e);l.x=m.x+e.clientLeft,l.y=m.y+e.clientTop}else s&&(l.x=fl(s));let u=0,d=0;if(s&&!r&&!o){const m=s.getBoundingClientRect();d=m.top+a.scrollTop,u=m.left+a.scrollLeft-fl(s,m)}const h=i.left+a.scrollLeft-l.x-u,f=i.top+a.scrollTop-l.y-d;return{x:h,y:f,width:i.width,height:i.height}}function fa(t){return ht(t).position==="static"}function xd(t,e){if(!Nt(t)||ht(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Ft(t)===n&&(n=n.ownerDocument.body),n}function gm(t,e){const n=Qe(t);if(zi(t))return n;if(!Nt(t)){let s=gn(t);for(;s&&!ur(s);){if(dt(s)&&!fa(s))return s;s=gn(s)}return n}let r=xd(t,e);for(;r&&u1(r)&&fa(r);)r=xd(r,e);return r&&ur(r)&&fa(r)&&!Pc(r)?n:r||d1(t)||n}const E1=async function(t){const e=this.getOffsetParent||gm,n=this.getDimensions,r=await n(t.floating);return{reference:w1(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function S1(t){return ht(t).direction==="rtl"}const T1={convertOffsetParentRelativeRectToViewportRelativeRect:p1,getDocumentElement:Ft,getClippingRect:x1,getOffsetParent:gm,getElementRects:E1,getClientRects:m1,getDimensions:b1,getScale:ir,isElement:dt,isRTL:S1};function k1(t,e){let n=null,r;const s=Ft(t);function o(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();const{left:u,top:d,width:h,height:f}=t.getBoundingClientRect();if(a||e(),!h||!f)return;const m=Po(d),v=Po(s.clientWidth-(u+h)),g=Po(s.clientHeight-(d+f)),y=Po(u),x={rootMargin:-m+"px "+-v+"px "+-g+"px "+-y+"px",threshold:Ze(0,fn(1,l))||1};let w=!0;function E(b){const T=b[0].intersectionRatio;if(T!==l){if(!w)return i();T?i(!1,T):r=setTimeout(()=>{i(!1,1e-7)},1e3)}w=!1}try{n=new IntersectionObserver(E,{...x,root:s.ownerDocument})}catch{n=new IntersectionObserver(E,x)}n.observe(t)}return i(!0),o}function P1(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=jc(t),d=s||o?[...u?Bs(u):[],...Bs(e)]:[];d.forEach(_=>{s&&_.addEventListener("scroll",n,{passive:!0}),o&&_.addEventListener("resize",n)});const h=u&&a?k1(u,n):null;let f=-1,m=null;i&&(m=new ResizeObserver(_=>{let[x]=_;x&&x.target===u&&m&&(m.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var w;(w=m)==null||w.observe(e)})),n()}),u&&!l&&m.observe(u),m.observe(e));let v,g=l?Rn(t):null;l&&y();function y(){const _=Rn(t);g&&(_.x!==g.x||_.y!==g.y||_.width!==g.width||_.height!==g.height)&&n(),g=_,v=requestAnimationFrame(y)}return n(),()=>{var _;d.forEach(x=>{s&&x.removeEventListener("scroll",n),o&&x.removeEventListener("resize",n)}),h?.(),(_=m)==null||_.disconnect(),m=null,l&&cancelAnimationFrame(v)}}const C1=i1,j1=a1,R1=r1,A1=c1,I1=s1,bd=n1,M1=l1,O1=(t,e,n)=>{const r=new Map,s={platform:T1,...n},o={...s.platform,_c:r};return t1(t,e,{...s,platform:o})};var Wo=typeof document<"u"?p.useLayoutEffect:p.useEffect;function ai(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,s;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!ai(t[r],e[r]))return!1;return!0}if(s=Object.keys(t),n=s.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,s[r]))return!1;for(r=n;r--!==0;){const o=s[r];if(!(o==="_owner"&&t.$$typeof)&&!ai(t[o],e[o]))return!1}return!0}return t!==t&&e!==e}function vm(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function wd(t,e){const n=vm(t);return Math.round(e*n)/n}function pa(t){const e=p.useRef(t);return Wo(()=>{e.current=t}),e}function D1(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:o,floating:i}={},transform:a=!0,whileElementsMounted:l,open:u}=t,[d,h]=p.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[f,m]=p.useState(r);ai(f,r)||m(r);const[v,g]=p.useState(null),[y,_]=p.useState(null),x=p.useCallback(A=>{A!==T.current&&(T.current=A,g(A))},[]),w=p.useCallback(A=>{A!==k.current&&(k.current=A,_(A))},[]),E=o||v,b=i||y,T=p.useRef(null),k=p.useRef(null),P=p.useRef(d),O=l!=null,R=pa(l),B=pa(s),N=pa(u),K=p.useCallback(()=>{if(!T.current||!k.current)return;const A={placement:e,strategy:n,middleware:f};B.current&&(A.platform=B.current),O1(T.current,k.current,A).then(I=>{const ee={...I,isPositioned:N.current!==!1};M.current&&!ai(P.current,ee)&&(P.current=ee,Di.flushSync(()=>{h(ee)}))})},[f,e,n,B,N]);Wo(()=>{u===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,h(A=>({...A,isPositioned:!1})))},[u]);const M=p.useRef(!1);Wo(()=>(M.current=!0,()=>{M.current=!1}),[]),Wo(()=>{if(E&&(T.current=E),b&&(k.current=b),E&&b){if(R.current)return R.current(E,b,K);K()}},[E,b,K,R,O]);const q=p.useMemo(()=>({reference:T,floating:k,setReference:x,setFloating:w}),[x,w]),z=p.useMemo(()=>({reference:E,floating:b}),[E,b]),U=p.useMemo(()=>{const A={position:n,left:0,top:0};if(!z.floating)return A;const I=wd(z.floating,d.x),ee=wd(z.floating,d.y);return a?{...A,transform:"translate("+I+"px, "+ee+"px)",...vm(z.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:I,top:ee}},[n,a,z.floating,d.x,d.y]);return p.useMemo(()=>({...d,update:K,refs:q,elements:z,floatingStyles:U}),[d,K,q,z,U])}const N1=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:s}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?bd({element:r.current,padding:s}).fn(n):{}:r?bd({element:r,padding:s}).fn(n):{}}}},L1=(t,e)=>({...C1(t),options:[t,e]}),F1=(t,e)=>({...j1(t),options:[t,e]}),$1=(t,e)=>({...M1(t),options:[t,e]}),V1=(t,e)=>({...R1(t),options:[t,e]}),B1=(t,e)=>({...A1(t),options:[t,e]}),z1=(t,e)=>({...I1(t),options:[t,e]}),U1=(t,e)=>({...N1(t),options:[t,e]});var H1="Arrow",ym=p.forwardRef((t,e)=>{const{children:n,width:r=10,height:s=5,...o}=t;return c.jsx(le.svg,{...o,ref:e,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:c.jsx("polygon",{points:"0,0 30,0 15,10"})})});ym.displayName=H1;var W1=ym;function G1(t,e=[]){let n=[];function r(o,i){const a=p.createContext(i),l=n.length;n=[...n,i];function u(h){const{scope:f,children:m,...v}=h,g=f?.[t][l]||a,y=p.useMemo(()=>v,Object.values(v));return c.jsx(g.Provider,{value:y,children:m})}function d(h,f){const m=f?.[t][l]||a,v=p.useContext(m);if(v)return v;if(i!==void 0)return i;throw new Error(`\`${h}\` must be used within \`${o}\``)}return u.displayName=o+"Provider",[u,d]}const s=()=>{const o=n.map(i=>p.createContext(i));return function(a){const l=a?.[t]||o;return p.useMemo(()=>({[`__scope${t}`]:{...a,[t]:l}}),[a,l])}};return s.scopeName=t,[r,K1(s,...e)]}function K1(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const i=r.reduce((a,{useScope:l,scopeName:u})=>{const h=l(o)[`__scope${u}`];return{...a,...h}},{});return p.useMemo(()=>({[`__scope${e.scopeName}`]:i}),[i])}};return n.scopeName=e.scopeName,n}function q1(t){const[e,n]=p.useState(void 0);return Dt(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const o=s[0];let i,a;if("borderBoxSize"in o){const l=o.borderBoxSize,u=Array.isArray(l)?l[0]:l;i=u.inlineSize,a=u.blockSize}else i=t.offsetWidth,a=t.offsetHeight;n({width:i,height:a})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}var Rc="Popper",[_m,Hi]=G1(Rc),[Y1,xm]=_m(Rc),bm=t=>{const{__scopePopper:e,children:n}=t,[r,s]=p.useState(null);return c.jsx(Y1,{scope:e,anchor:r,onAnchorChange:s,children:n})};bm.displayName=Rc;var wm="PopperAnchor",Em=p.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...s}=t,o=xm(wm,n),i=p.useRef(null),a=Pe(e,i);return p.useEffect(()=>{o.onAnchorChange(r?.current||i.current)}),r?null:c.jsx(le.div,{...s,ref:a})});Em.displayName=wm;var Ac="PopperContent",[X1,Z1]=_m(Ac),Sm=p.forwardRef((t,e)=>{const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:o="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:h="partial",hideWhenDetached:f=!1,updatePositionStrategy:m="optimized",onPlaced:v,...g}=t,y=xm(Ac,n),[_,x]=p.useState(null),w=Pe(e,me=>x(me)),[E,b]=p.useState(null),T=q1(E),k=T?.width??0,P=T?.height??0,O=r+(o!=="center"?"-"+o:""),R=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},B=Array.isArray(u)?u:[u],N=B.length>0,K={padding:R,boundary:B.filter(Q1),altBoundary:N},{refs:M,floatingStyles:q,placement:z,isPositioned:U,middlewareData:A}=D1({strategy:"fixed",placement:O,whileElementsMounted:(...me)=>P1(...me,{animationFrame:m==="always"}),elements:{reference:y.anchor},middleware:[L1({mainAxis:s+P,alignmentAxis:i}),l&&F1({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?$1():void 0,...K}),l&&V1({...K}),B1({...K,apply:({elements:me,rects:qe,availableWidth:$t,availableHeight:Le})=>{const{width:Cr,height:Jt}=qe.reference,vt=me.floating.style;vt.setProperty("--radix-popper-available-width",`${$t}px`),vt.setProperty("--radix-popper-available-height",`${Le}px`),vt.setProperty("--radix-popper-anchor-width",`${Cr}px`),vt.setProperty("--radix-popper-anchor-height",`${Jt}px`)}}),E&&U1({element:E,padding:a}),eE({arrowWidth:k,arrowHeight:P}),f&&z1({strategy:"referenceHidden",...K})]}),[I,ee]=Pm(z),H=Ve(v);Dt(()=>{U&&H?.()},[U,H]);const Y=A.arrow?.x,Z=A.arrow?.y,oe=A.arrow?.centerOffset!==0,[Re,ne]=p.useState();return Dt(()=>{_&&ne(window.getComputedStyle(_).zIndex)},[_]),c.jsx("div",{ref:M.setFloating,"data-radix-popper-content-wrapper":"",style:{...q,transform:U?q.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Re,"--radix-popper-transform-origin":[A.transformOrigin?.x,A.transformOrigin?.y].join(" "),...A.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:c.jsx(X1,{scope:n,placedSide:I,onArrowChange:b,arrowX:Y,arrowY:Z,shouldHideArrow:oe,children:c.jsx(le.div,{"data-side":I,"data-align":ee,...g,ref:w,style:{...g.style,animation:U?void 0:"none"}})})})});Sm.displayName=Ac;var Tm="PopperArrow",J1={top:"bottom",right:"left",bottom:"top",left:"right"},km=p.forwardRef(function(e,n){const{__scopePopper:r,...s}=e,o=Z1(Tm,r),i=J1[o.placedSide];return c.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:c.jsx(W1,{...s,ref:n,style:{...s.style,display:"block"}})})});km.displayName=Tm;function Q1(t){return t!==null}var eE=t=>({name:"transformOrigin",options:t,fn(e){const{placement:n,rects:r,middlewareData:s}=e,i=s.arrow?.centerOffset!==0,a=i?0:t.arrowWidth,l=i?0:t.arrowHeight,[u,d]=Pm(n),h={start:"0%",center:"50%",end:"100%"}[d],f=(s.arrow?.x??0)+a/2,m=(s.arrow?.y??0)+l/2;let v="",g="";return u==="bottom"?(v=i?h:`${f}px`,g=`${-l}px`):u==="top"?(v=i?h:`${f}px`,g=`${r.floating.height+l}px`):u==="right"?(v=`${-l}px`,g=i?h:`${m}px`):u==="left"&&(v=`${r.floating.width+l}px`,g=i?h:`${m}px`),{data:{x:v,y:g}}}});function Pm(t){const[e,n="center"]=t.split("-");return[e,n]}var Cm=bm,jm=Em,Rm=Sm,Am=km,[Wi,XO]=br("Tooltip",[Hi]),Gi=Hi(),Im="TooltipProvider",tE=700,pl="tooltip.open",[nE,Ic]=Wi(Im),Mm=t=>{const{__scopeTooltip:e,delayDuration:n=tE,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:o}=t,[i,a]=p.useState(!0),l=p.useRef(!1),u=p.useRef(0);return p.useEffect(()=>{const d=u.current;return()=>window.clearTimeout(d)},[]),c.jsx(nE,{scope:e,isOpenDelayed:i,delayDuration:n,onOpen:p.useCallback(()=>{window.clearTimeout(u.current),a(!1)},[]),onClose:p.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>a(!0),r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:p.useCallback(d=>{l.current=d},[]),disableHoverableContent:s,children:o})};Mm.displayName=Im;var Ki="Tooltip",[rE,ho]=Wi(Ki),Om=t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:s=!1,onOpenChange:o,disableHoverableContent:i,delayDuration:a}=t,l=Ic(Ki,t.__scopeTooltip),u=Gi(e),[d,h]=p.useState(null),f=Pn(),m=p.useRef(0),v=i??l.disableHoverableContent,g=a??l.delayDuration,y=p.useRef(!1),[_=!1,x]=co({prop:r,defaultProp:s,onChange:k=>{k?(l.onOpen(),document.dispatchEvent(new CustomEvent(pl))):l.onClose(),o?.(k)}}),w=p.useMemo(()=>_?y.current?"delayed-open":"instant-open":"closed",[_]),E=p.useCallback(()=>{window.clearTimeout(m.current),m.current=0,y.current=!1,x(!0)},[x]),b=p.useCallback(()=>{window.clearTimeout(m.current),m.current=0,x(!1)},[x]),T=p.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{y.current=!0,x(!0),m.current=0},g)},[g,x]);return p.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),c.jsx(Cm,{...u,children:c.jsx(rE,{scope:e,contentId:f,open:_,stateAttribute:w,trigger:d,onTriggerChange:h,onTriggerEnter:p.useCallback(()=>{l.isOpenDelayed?T():E()},[l.isOpenDelayed,T,E]),onTriggerLeave:p.useCallback(()=>{v?b():(window.clearTimeout(m.current),m.current=0)},[b,v]),onOpen:E,onClose:b,disableHoverableContent:v,children:n})})};Om.displayName=Ki;var ml="TooltipTrigger",Dm=p.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,s=ho(ml,n),o=Ic(ml,n),i=Gi(n),a=p.useRef(null),l=Pe(e,a,s.onTriggerChange),u=p.useRef(!1),d=p.useRef(!1),h=p.useCallback(()=>u.current=!1,[]);return p.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),c.jsx(jm,{asChild:!0,...i,children:c.jsx(le.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:l,onPointerMove:W(t.onPointerMove,f=>{f.pointerType!=="touch"&&!d.current&&!o.isPointerInTransitRef.current&&(s.onTriggerEnter(),d.current=!0)}),onPointerLeave:W(t.onPointerLeave,()=>{s.onTriggerLeave(),d.current=!1}),onPointerDown:W(t.onPointerDown,()=>{u.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:W(t.onFocus,()=>{u.current||s.onOpen()}),onBlur:W(t.onBlur,s.onClose),onClick:W(t.onClick,s.onClose)})})});Dm.displayName=ml;var Mc="TooltipPortal",[sE,oE]=Wi(Mc,{forceMount:void 0}),Nm=t=>{const{__scopeTooltip:e,forceMount:n,children:r,container:s}=t,o=ho(Mc,e);return c.jsx(sE,{scope:e,forceMount:n,children:c.jsx(pt,{present:n||o.open,children:c.jsx(lo,{asChild:!0,container:s,children:r})})})};Nm.displayName=Mc;var dr="TooltipContent",Lm=p.forwardRef((t,e)=>{const n=oE(dr,t.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...o}=t,i=ho(dr,t.__scopeTooltip);return c.jsx(pt,{present:r||i.open,children:i.disableHoverableContent?c.jsx(Fm,{side:s,...o,ref:e}):c.jsx(iE,{side:s,...o,ref:e})})}),iE=p.forwardRef((t,e)=>{const n=ho(dr,t.__scopeTooltip),r=Ic(dr,t.__scopeTooltip),s=p.useRef(null),o=Pe(e,s),[i,a]=p.useState(null),{trigger:l,onClose:u}=n,d=s.current,{onPointerInTransitChange:h}=r,f=p.useCallback(()=>{a(null),h(!1)},[h]),m=p.useCallback((v,g)=>{const y=v.currentTarget,_={x:v.clientX,y:v.clientY},x=uE(_,y.getBoundingClientRect()),w=dE(_,x),E=hE(g.getBoundingClientRect()),b=pE([...w,...E]);a(b),h(!0)},[h]);return p.useEffect(()=>()=>f(),[f]),p.useEffect(()=>{if(l&&d){const v=y=>m(y,d),g=y=>m(y,l);return l.addEventListener("pointerleave",v),d.addEventListener("pointerleave",g),()=>{l.removeEventListener("pointerleave",v),d.removeEventListener("pointerleave",g)}}},[l,d,m,f]),p.useEffect(()=>{if(i){const v=g=>{const y=g.target,_={x:g.clientX,y:g.clientY},x=l?.contains(y)||d?.contains(y),w=!fE(_,i);x?f():w&&(f(),u())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[l,d,i,u,f]),c.jsx(Fm,{...t,ref:o})}),[aE,lE]=Wi(Ki,{isInside:!1}),Fm=p.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:o,onPointerDownOutside:i,...a}=t,l=ho(dr,n),u=Gi(n),{onClose:d}=l;return p.useEffect(()=>(document.addEventListener(pl,d),()=>document.removeEventListener(pl,d)),[d]),p.useEffect(()=>{if(l.trigger){const h=f=>{f.target?.contains(l.trigger)&&d()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[l.trigger,d]),c.jsx(ao,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:h=>h.preventDefault(),onDismiss:d,children:c.jsxs(Rm,{"data-state":l.stateAttribute,...u,...a,ref:e,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[c.jsx(Pp,{children:r}),c.jsx(aE,{scope:n,isInside:!0,children:c.jsx(bx,{id:l.contentId,role:"tooltip",children:s||r})})]})})});Lm.displayName=dr;var $m="TooltipArrow",cE=p.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,s=Gi(n);return lE($m,n).isInside?null:c.jsx(Am,{...s,...r,ref:e})});cE.displayName=$m;function uE(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),s=Math.abs(e.right-t.x),o=Math.abs(e.left-t.x);switch(Math.min(n,r,s,o)){case o:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function dE(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}function hE(t){const{top:e,right:n,bottom:r,left:s}=t;return[{x:s,y:e},{x:n,y:e},{x:n,y:r},{x:s,y:r}]}function fE(t,e){const{x:n,y:r}=t;let s=!1;for(let o=0,i=e.length-1;o<e.length;i=o++){const a=e[o].x,l=e[o].y,u=e[i].x,d=e[i].y;l>r!=d>r&&n<(u-a)*(r-l)/(d-l)+a&&(s=!s)}return s}function pE(t){const e=t.slice();return e.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),mE(e)}function mE(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const s=t[r];for(;e.length>=2;){const o=e[e.length-1],i=e[e.length-2];if((o.x-i.x)*(s.y-i.y)>=(o.y-i.y)*(s.x-i.x))e.pop();else break}e.push(s)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const s=t[r];for(;n.length>=2;){const o=n[n.length-1],i=n[n.length-2];if((o.x-i.x)*(s.y-i.y)>=(o.y-i.y)*(s.x-i.x))n.pop();else break}n.push(s)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var gE=Mm,vE=Om,yE=Dm,_E=Nm,Vm=Lm;const xE=gE,ZO=vE,JO=yE,bE=p.forwardRef(({className:t,sideOffset:e=4,...n},r)=>c.jsx(_E,{children:c.jsx(Vm,{ref:r,sideOffset:e,className:_e("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...n})}));bE.displayName=Vm.displayName;const wE="https://pldrgdplxacehsmcyjnx.supabase.co",EE="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InBsZHJnZHBseGFjZWhzbWN5am54Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NDM0MzU5MzEsImV4cCI6MjA1OTAxMTkzMX0.YnKo7pfbjg52NF6TL2pNilHkND5ZgkhbDuAtC_-IQL4",ce=z_(wE,EE),QO=async()=>{try{const{data:t,error:e}=await ce.functions.invoke("get-stripe-prices");if(e)throw console.error("Error fetching Stripe prices:",e),e;return{prices:t?.prices||[],stripeMode:t?.stripeMode||"test"}}catch(t){throw console.error("Error in getActivePricingTiers:",t),t}},eD=async(t,e,n)=>{try{console.log("Creating Stripe subscription for plan:",t,"currency:",n);const{data:r,error:s}=await ce.functions.invoke("create-checkout",{body:{planType:t,currentLanguage:e||"en",currency:n||"GBP"}});if(s)throw console.error("Error creating Stripe subscription:",s),new Error(s.message||"Failed to create Stripe subscription");if(!r||!r.url)throw console.error("No URL returned from Stripe subscription:",r),new Error("Invalid response from server");return console.log("Stripe subscription created successfully:",r),r}catch(r){const s=r instanceof Error?r.message:String(r);throw console.error("Error in Stripe subscription service:",s),r}},tD=async()=>{try{console.log("Creating customer portal session");const{data:t,error:e}=await ce.functions.invoke("customer-portal");if(e)throw console.error("Error creating customer portal session:",e),new Error(e.message||"Failed to create customer portal session");if(!t||!t.url)throw console.error("No URL returned from customer portal session:",t),new Error("Invalid response from server");return console.log("Customer portal session created successfully:",t),t}catch(t){const e=t instanceof Error?t.message:String(t);throw console.error("Error in subscription service:",e),t}},SE=async(t=!1)=>{try{console.log("Checking subscription status",t?"(force refresh)":"");const{data:e,error:n}=await ce.functions.invoke("check-subscription",{body:t?{forceRefresh:!0,timestamp:new Date().getTime()}:void 0});if(n){const r=n.message||"";if(r.includes("401")||r.includes("Invalid user token")||r.includes("Unauthorized"))return console.warn("Session expired during subscription check, returning null"),null;throw console.error("Error checking subscription status:",n),new Error(r||"Failed to check subscription status")}return console.log("Subscription status checked successfully:",e),e}catch(e){const n=e instanceof Error?e.message:String(e);throw console.error("Error in subscription service:",n),e}};var j=typeof window<"u"?window:void 0,Ne=typeof globalThis<"u"?globalThis:j;typeof self>"u"&&(Ne.self=Ne),typeof File>"u"&&(Ne.File=function(){});var Bm=Array.prototype,Ed=Bm.forEach,Sd=Bm.indexOf,Je=Ne?.navigator,L=Ne?.document,De=Ne?.location,gl=Ne?.fetch,vl=Ne!=null&&Ne.XMLHttpRequest&&"withCredentials"in new Ne.XMLHttpRequest?Ne.XMLHttpRequest:void 0,Td=Ne?.AbortController,We=Je?.userAgent,G=j??{},Ut={DEBUG:!1,LIB_VERSION:"1.354.0"};function kd(t,e,n,r,s,o,i){try{var a=t[o](i),l=a.value}catch(u){return void n(u)}a.done?e(l):Promise.resolve(l).then(r,s)}function Ht(t){return function(){var e=this,n=arguments;return new Promise(function(r,s){var o=t.apply(e,n);function i(l){kd(o,r,s,i,a,"next",l)}function a(l){kd(o,r,s,i,a,"throw",l)}i(void 0)})}}function F(){return F=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},F.apply(null,arguments)}function zm(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;n[r]=t[r]}return n}var TE=["$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"],kE=["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"],Pd=function(t,e){if(e===void 0&&(e=[]),!t)return!1;var n=t.toLowerCase();return kE.concat(e).some(r=>{var s=r.toLowerCase();return n.indexOf(s)!==-1})};function te(t,e){return t.indexOf(e)!==-1}var qi=function(t){return t.trim()},yl=function(t){return t.replace(/^\$/,"")},PE=Array.isArray,Um=Object.prototype,Hm=Um.hasOwnProperty,Yi=Um.toString,ae=PE||function(t){return Yi.call(t)==="[object Array]"},Gt=t=>typeof t=="function",Ae=t=>t===Object(t)&&!ae(t),Zn=t=>{if(Ae(t)){for(var e in t)if(Hm.call(t,e))return!1;return!0}return!1},$=t=>t===void 0,je=t=>Yi.call(t)=="[object String]",_l=t=>je(t)&&t.trim().length===0,mt=t=>t===null,re=t=>$(t)||mt(t),Zt=t=>Yi.call(t)=="[object Number]"&&t==t,qn=t=>Zt(t)&&t>0,qt=t=>Yi.call(t)==="[object Boolean]",CE=t=>t instanceof FormData,jE=t=>te(TE,t);function xl(t){return t===null||typeof t!="object"}function li(t,e){return Object.prototype.toString.call(t)==="[object "+e+"]"}function Wm(t){return!$(Event)&&function(e,n){try{return e instanceof n}catch{return!1}}(t,Event)}var RE=[!0,"true",1,"1","yes"],ma=t=>te(RE,t),AE=[!1,"false",0,"0","no"];function Ct(t,e,n,r,s){return e>n&&(r.warn("min cannot be greater than max."),e=n),Zt(t)?t>n?(r.warn(" cannot be greater than max: "+n+". Using max value instead."),n):t<e?(r.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(r.warn(" must be a number. using max or fallback. max: "+n+", fallback: "+s),Ct(s||n,e,n,r))}class IE{constructor(e){this.t={},this.i=e.i,this.o=Ct(e.bucketSize,0,100,e.h),this.m=Ct(e.refillRate,0,this.o,e.h),this.$=Ct(e.refillInterval,0,864e5,e.h)}S(e,n){var r=n-e.lastAccess,s=Math.floor(r/this.$);if(s>0){var o=s*this.m;e.tokens=Math.min(e.tokens+o,this.o),e.lastAccess=e.lastAccess+s*this.$}}consumeRateLimit(e){var n,r=Date.now(),s=String(e),o=this.t[s];return o?this.S(o,r):(o={tokens:this.o,lastAccess:r},this.t[s]=o),o.tokens===0||(o.tokens--,o.tokens===0&&((n=this.i)==null||n.call(this,e)),o.tokens===0)}stop(){this.t={}}}var it="Mobile",ci="iOS",Kt="Android",zs="Tablet",Gm=Kt+" "+zs,Km="iPad",qm="Apple",Ym=qm+" Watch",Us="Safari",hr="BlackBerry",Xm="Samsung",Zm=Xm+"Browser",Jm=Xm+" Internet",An="Chrome",ME=An+" OS",Qm=An+" "+ci,Oc="Internet Explorer",eg=Oc+" "+it,Dc="Opera",OE=Dc+" Mini",Nc="Edge",tg="Microsoft "+Nc,ar="Firefox",ng=ar+" "+ci,Hs="Nintendo",Ws="PlayStation",lr="Xbox",rg=Kt+" "+it,sg=it+" "+Us,vs="Windows",bl=vs+" Phone",Cd="Nokia",wl="Ouya",og="Generic",DE=og+" "+it.toLowerCase(),ig=og+" "+zs.toLowerCase(),El="Konqueror",Be="(\\d+(\\.\\d+)?)",ga=new RegExp("Version/"+Be),NE=new RegExp(lr,"i"),LE=new RegExp(Ws+" \\w+","i"),FE=new RegExp(Hs+" \\w+","i"),Lc=new RegExp(hr+"|PlayBook|BB10","i"),$E={"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"},Co,jd,va,VE=(t,e)=>e&&te(e,qm)||function(n){return te(n,Us)&&!te(n,An)&&!te(n,Kt)}(t),ag=function(t,e){return e=e||"",te(t," OPR/")&&te(t,"Mini")?OE:te(t," OPR/")?Dc:Lc.test(t)?hr:te(t,"IE"+it)||te(t,"WPDesktop")?eg:te(t,Zm)?Jm:te(t,Nc)||te(t,"Edg/")?tg:te(t,"FBIOS")?"Facebook "+it:te(t,"UCWEB")||te(t,"UCBrowser")?"UC Browser":te(t,"CriOS")?Qm:te(t,"CrMo")||te(t,An)?An:te(t,Kt)&&te(t,Us)?rg:te(t,"FxiOS")?ng:te(t.toLowerCase(),El.toLowerCase())?El:VE(t,e)?te(t,it)?sg:Us:te(t,ar)?ar:te(t,"MSIE")||te(t,"Trident/")?Oc:te(t,"Gecko")?ar:""},BE={[eg]:[new RegExp("rv:"+Be)],[tg]:[new RegExp(Nc+"?\\/"+Be)],[An]:[new RegExp("("+An+"|CrMo)\\/"+Be)],[Qm]:[new RegExp("CriOS\\/"+Be)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Be)],[Us]:[ga],[sg]:[ga],[Dc]:[new RegExp("(Opera|OPR)\\/"+Be)],[ar]:[new RegExp(ar+"\\/"+Be)],[ng]:[new RegExp("FxiOS\\/"+Be)],[El]:[new RegExp("Konqueror[:/]?"+Be,"i")],[hr]:[new RegExp(hr+" "+Be),ga],[rg]:[new RegExp("android\\s"+Be,"i")],[Jm]:[new RegExp(Zm+"\\/"+Be)],[Oc]:[new RegExp("(rv:|MSIE )"+Be)],Mozilla:[new RegExp("rv:"+Be)]},zE=function(t,e){var n=ag(t,e),r=BE[n];if($(r))return null;for(var s=0;s<r.length;s++){var o=r[s],i=t.match(o);if(i)return parseFloat(i[i.length-2])}return null},Rd=[[new RegExp(lr+"; "+lr+" (.*?)[);]","i"),t=>[lr,t&&t[1]||""]],[new RegExp(Hs,"i"),[Hs,""]],[new RegExp(Ws,"i"),[Ws,""]],[Lc,[hr,""]],[new RegExp(vs,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[bl,""];if(new RegExp(it).test(e)&&!/IEMobile\b/.test(e))return[vs+" "+it,""];var n=/Windows NT ([0-9.]+)/i.exec(e);if(n&&n[1]){var r=n[1],s=$E[r]||"";return/arm/i.test(e)&&(s="RT"),[vs,s]}return[vs,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>{if(t&&t[3]){var e=[t[3],t[4],t[5]||"0"];return[ci,e.join(".")]}return[ci,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=$(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+Kt+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Kt+")","i"),t=>{if(t&&t[2]){var e=[t[2],t[3],t[4]||"0"];return[Kt,e.join(".")]}return[Kt,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];if(t&&t[1]){var n=[t[1],t[2],t[3]||"0"];e[1]=n.join(".")}return e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[ME,""]],[/Linux|debian/i,["Linux",""]]],Ad=function(t){return FE.test(t)?Hs:LE.test(t)?Ws:NE.test(t)?lr:new RegExp(wl,"i").test(t)?wl:new RegExp("("+bl+"|WPDesktop)","i").test(t)?bl:/iPad/.test(t)?Km:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?Ym:Lc.test(t)?hr:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(Cd,"i").test(t)?Cd:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?new RegExp(it).test(t)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)||/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?Kt:Gm:new RegExp("(pda|"+it+")","i").test(t)?DE:new RegExp(zs,"i").test(t)&&!new RegExp(zs+" pc","i").test(t)?ig:""},UE=t=>t instanceof Error;function HE(t){var e=globalThis._posthogChunkIds;if(e){var n=Object.keys(e);return va&&n.length===jd||(jd=n.length,va=n.reduce((r,s)=>{Co||(Co={});var o=Co[s];if(o)r[o[0]]=o[1];else for(var i=t(s),a=i.length-1;a>=0;a--){var l=i[a],u=l?.filename,d=e[s];if(u&&d){r[u]=d,Co[s]=[u,d];break}}return r},{})),va}}class WE{constructor(e,n,r){r===void 0&&(r=[]),this.coercers=e,this.stackParser=n,this.modifiers=r}buildFromUnknown(e,n){n===void 0&&(n={});var r=n&&n.mechanism||{handled:!0,type:"generic"},s=this.buildCoercingContext(r,n,0).apply(e),o=this.buildParsingContext(n),i=this.parseStacktrace(s,o);return{$exception_list:this.convertToExceptionList(i,r),$exception_level:"error"}}modifyFrames(e){var n=this;return Ht(function*(){for(var r of e)r.stacktrace&&r.stacktrace.frames&&ae(r.stacktrace.frames)&&(r.stacktrace.frames=yield n.applyModifiers(r.stacktrace.frames));return e})()}coerceFallback(e){var n;return{type:"Error",value:"Unknown error",stack:(n=e.syntheticException)==null?void 0:n.stack,synthetic:!0}}parseStacktrace(e,n){var r,s;return e.cause!=null&&(r=this.parseStacktrace(e.cause,n)),e.stack!=""&&e.stack!=null&&(s=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?n.skipFirstLines:0),n.chunkIdMap)),F({},e,{cause:r,stack:s})}applyChunkIds(e,n){return e.map(r=>(r.filename&&n&&(r.chunk_id=n[r.filename]),r))}applyCoercers(e,n){for(var r of this.coercers)if(r.match(e))return r.coerce(e,n);return this.coerceFallback(n)}applyModifiers(e){var n=this;return Ht(function*(){var r=e;for(var s of n.modifiers)r=yield s(r);return r})()}convertToExceptionList(e,n){var r,s,o,i={type:e.type,value:e.value,mechanism:{type:(r=n.type)!==null&&r!==void 0?r:"generic",handled:(s=n.handled)===null||s===void 0||s,synthetic:(o=e.synthetic)!==null&&o!==void 0&&o}};e.stack&&(i.stacktrace={type:"raw",frames:e.stack});var a=[i];return e.cause!=null&&a.push(...this.convertToExceptionList(e.cause,F({},n,{handled:!0}))),a}buildParsingContext(e){var n;return{chunkIdMap:HE(this.stackParser),skipFirstLines:(n=e.skipFirstLines)!==null&&n!==void 0?n:1}}buildCoercingContext(e,n,r){r===void 0&&(r=0);var s=(o,i)=>{if(i<=4){var a=this.buildCoercingContext(e,n,i);return this.applyCoercers(o,a)}};return F({},n,{syntheticException:r==0?n.syntheticException:void 0,mechanism:e,apply:o=>s(o,r),next:o=>s(o,r+1)})}}var fr="?";function Sl(t,e,n,r,s){var o={platform:t,filename:e,function:n==="<anonymous>"?fr:n,in_app:!0};return $(r)||(o.lineno=r),$(s)||(o.colno=s),o}var lg=(t,e)=>{var n=t.indexOf("safari-extension")!==-1,r=t.indexOf("safari-web-extension")!==-1;return n||r?[t.indexOf("@")!==-1?t.split("@")[0]:fr,n?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},GE=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,KE=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,qE=/\((\S*)(?::(\d+))(?::(\d+))\)/,YE=(t,e)=>{var n=GE.exec(t);if(n){var[,r,s,o]=n;return Sl(e,r,fr,+s,+o)}var i=KE.exec(t);if(i){if(i[2]&&i[2].indexOf("eval")===0){var a=qE.exec(i[2]);a&&(i[2]=a[1],i[3]=a[2],i[4]=a[3])}var[l,u]=lg(i[1]||fr,i[2]);return Sl(e,u,l,i[3]?+i[3]:void 0,i[4]?+i[4]:void 0)}},XE=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,ZE=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,JE=(t,e)=>{var n=XE.exec(t);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){var r=ZE.exec(n[3]);r&&(n[1]=n[1]||"eval",n[3]=r[1],n[4]=r[2],n[5]="")}var s=n[3],o=n[1]||fr;return[o,s]=lg(o,s),Sl(e,s,o,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},Id=/\(error: (.*)\)/,Md=50;function QE(){return function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return function(s,o){o===void 0&&(o=0);for(var i=[],a=s.split(`
`),l=o;l<a.length;l++){var u=a[l];if(!(u.length>1024)){var d=Id.test(u)?u.replace(Id,"$1"):u;if(!d.match(/\S*Error: /)){for(var h of n){var f=h(d,t);if(f){i.push(f);break}}if(i.length>=Md)break}}}return function(m){if(!m.length)return[];var v=Array.from(m);return v.reverse(),v.slice(0,Md).map(g=>{return F({},g,{filename:g.filename||(y=v,y[y.length-1]||{}).filename,function:g.function||fr});var y})}(i)}}("web:javascript",YE,JE)}class eS{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,n){var r=je(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:r?e.stack:void 0,cause:e.cause?n.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var n=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?n+": "+e.message:n}isDOMException(e){return li(e,"DOMException")}isDOMError(e){return li(e,"DOMError")}}class tS{match(e){return(n=>n instanceof Error)(e)}coerce(e,n){return{type:this.getType(e),value:this.getMessage(e,n),stack:this.getStack(e),cause:e.cause?n.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,n){var r=e.message;return r.error&&typeof r.error.message=="string"?String(r.error.message):String(r)}getStack(e){return e.stacktrace||e.stack||void 0}}class nS{constructor(){}match(e){return li(e,"ErrorEvent")&&e.error!=null}coerce(e,n){var r,s=n.apply(e.error);return s||{type:"ErrorEvent",value:e.message,stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}var rS=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class sS{match(e){return typeof e=="string"}coerce(e,n){var r,[s,o]=this.getInfos(e);return{type:s??"Error",value:o??e,stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}getInfos(e){var n="Error",r=e,s=e.match(rS);return s&&(n=s[1],r=s[2]),[n,r]}}var oS=["fatal","error","warning","log","info","debug"];function cg(t,e){e===void 0&&(e=40);var n=Object.keys(t);if(n.sort(),!n.length)return"[object has no keys]";for(var r=n.length;r>0;r--){var s=n.slice(0,r).join(", ");if(!(s.length>e))return r===n.length||s.length<=e?s:s.slice(0,e)+"..."}return""}class iS{match(e){return typeof e=="object"&&e!==null}coerce(e,n){var r,s=this.getErrorPropertyFromObject(e);return s?n.apply(s):{type:this.getType(e),value:this.getValue(e),stack:(r=n.syntheticException)==null?void 0:r.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return Wm(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&typeof e.name=="string"){var n="'"+e.name+"' captured as exception";return"message"in e&&typeof e.message=="string"&&(n+=" with message: '"+e.message+"'"),n}if("message"in e&&typeof e.message=="string")return e.message;var r=this.getObjectClassName(e);return(r&&r!=="Object"?"'"+r+"'":"Object")+" captured as exception with keys: "+cg(e)}isSeverityLevel(e){return je(e)&&!_l(e)&&oS.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=e[n];if(UE(r))return r}}getObjectClassName(e){try{var n=Object.getPrototypeOf(e);return n?n.constructor.name:void 0}catch{return}}}class aS{match(e){return Wm(e)}coerce(e,n){var r,s=e.constructor.name;return{type:s,value:s+" captured as exception with keys: "+cg(e),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}class lS{match(e){return xl(e)}coerce(e,n){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}class cS{match(e){return li(e,"PromiseRejectionEvent")}coerce(e,n){var r,s=this.getUnhandledRejectionReason(e);return xl(s)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(s),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}:n.apply(s)}getUnhandledRejectionReason(e){if(xl(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}}var ug=function(t,e){var{debugEnabled:n}=e===void 0?{}:e,r={k:function(s){if(j&&(Ut.DEBUG||G.POSTHOG_DEBUG||n)&&!$(j.console)&&j.console){for(var o=("__rrweb_original__"in j.console[s])?j.console[s].__rrweb_original__:j.console[s],i=arguments.length,a=new Array(i>1?i-1:0),l=1;l<i;l++)a[l-1]=arguments[l];o(t,...a)}},info:function(){for(var s=arguments.length,o=new Array(s),i=0;i<s;i++)o[i]=arguments[i];r.k("log",...o)},warn:function(){for(var s=arguments.length,o=new Array(s),i=0;i<s;i++)o[i]=arguments[i];r.k("warn",...o)},error:function(){for(var s=arguments.length,o=new Array(s),i=0;i<s;i++)o[i]=arguments[i];r.k("error",...o)},critical:function(){for(var s=arguments.length,o=new Array(s),i=0;i<s;i++)o[i]=arguments[i];console.error(t,...o)},uninitializedWarning:s=>{r.error("You must initialize PostHog before calling "+s)},createLogger:(s,o)=>ug(t+" "+s,o)};return r},V=ug("[PostHog.js]"),we=V.createLogger,uS=we("[ExternalScriptsLoader]"),Od=(t,e,n)=>{if(t.config.disable_external_dependency_loading)return uS.warn(e+" was requested but loading of external scripts is disabled."),n("Loading of external scripts is disabled");var r=L?.querySelectorAll("script");if(r){for(var s,o=function(){if(r[i].src===e){var l=r[i];return l.__posthog_loading_callback_fired?{v:n()}:(l.addEventListener("load",u=>{l.__posthog_loading_callback_fired=!0,n(void 0,u)}),l.onerror=u=>n(u),{v:void 0})}},i=0;i<r.length;i++)if(s=o())return s.v}var a=()=>{if(!L)return n("document not found");var l=L.createElement("script");if(l.type="text/javascript",l.crossOrigin="anonymous",l.src=e,l.onload=h=>{l.__posthog_loading_callback_fired=!0,n(void 0,h)},l.onerror=h=>n(h),t.config.prepare_external_dependency_script&&(l=t.config.prepare_external_dependency_script(l)),!l)return n("prepare_external_dependency_script returned null");if(t.config.external_scripts_inject_target==="head")L.head.appendChild(l);else{var u,d=L.querySelectorAll("body > script");d.length>0?(u=d[0].parentNode)==null||u.insertBefore(l,d[0]):L.body.appendChild(l)}};L!=null&&L.body?a():L?.addEventListener("DOMContentLoaded",a)};G.__PosthogExtensions__=G.__PosthogExtensions__||{},G.__PosthogExtensions__.loadExternalDependency=(t,e,n)=>{var r="/static/"+e+".js?v="+t.version;if(e==="remote-config"&&(r="/array/"+t.config.token+"/config.js"),e==="toolbar"){var s=3e5;r=r+"&t="+Math.floor(Date.now()/s)*s}var o=t.requestRouter.endpointFor("assets",r);Od(t,o,n)},G.__PosthogExtensions__.loadSiteApp=(t,e,n)=>{var r=t.requestRouter.endpointFor("api",e);Od(t,r,n)};var ui={};function dn(t,e,n){if(ae(t)){if(Ed&&t.forEach===Ed)t.forEach(e,n);else if("length"in t&&t.length===+t.length){for(var r=0,s=t.length;r<s;r++)if(r in t&&e.call(n,t[r],r)===ui)return}}}function he(t,e,n){if(!re(t)){if(ae(t))return dn(t,e,n);if(CE(t)){for(var r of t.entries())if(e.call(n,r[1],r[0])===ui)return}else for(var s in t)if(Hm.call(t,s)&&e.call(n,t[s],s)===ui)return}}var ke=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return dn(n,function(s){for(var o in s)s[o]!==void 0&&(t[o]=s[o])}),t},pr=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return dn(n,function(s){dn(s,function(o){t.push(o)})}),t};function Go(t){for(var e=Object.keys(t),n=e.length,r=new Array(n);n--;)r[n]=[e[n],t[e[n]]];return r}var Dd=function(t){try{return t()}catch{return}},dS=function(t){return function(){try{for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.apply(this,n)}catch(s){V.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),V.critical(s)}}},Fc=function(t){var e={};return he(t,function(n,r){(je(n)&&n.length>0||Zt(n))&&(e[r]=n)}),e};function hS(t,e){return n=t,r=o=>je(o)&&!mt(e)?o.slice(0,e):o,s=new Set,function o(i,a){return i!==Object(i)?r?r(i,a):i:s.has(i)?void 0:(s.add(i),ae(i)?(l=[],dn(i,u=>{l.push(o(u))})):(l={},he(i,(u,d)=>{s.has(u)||(l[d]=o(u,d))})),l);var l}(n);var n,r,s}var fS=["herokuapp.com","vercel.app","netlify.app"];function pS(t){var e=t?.hostname;if(!je(e))return!1;var n=e.split(".").slice(-2).join(".");for(var r of fS)if(n===r)return!1;return!0}function dg(t,e){for(var n=0;n<t.length;n++)if(e(t[n]))return t[n]}function Ce(t,e,n,r){var{capture:s=!1,passive:o=!0}=r??{};t?.addEventListener(e,n,{capture:s,passive:o})}function hg(t){return t.name==="ph_toolbar_internal"}var fg="$people_distinct_id",ys="__alias",_s="__timers",Nd="$autocapture_disabled_server_side",Tl="$heatmaps_enabled_server_side",Ld="$exception_capture_enabled_server_side",kl="$error_tracking_suppression_rules",Fd="$error_tracking_capture_extension_exceptions",$d="$web_vitals_enabled_server_side",pg="$dead_clicks_enabled_server_side",Vd="$product_tours_enabled_server_side",Bd="$web_vitals_allowed_metrics",jo="$session_recording_remote_config",di="$sesid",mg="$session_is_sampled",Jn="$enabled_feature_flags",xs="$early_access_features",Pl="$feature_flag_details",bs="$stored_person_properties",En="$stored_group_properties",Cl="$surveys",hi="$flag_call_reported",jl="$feature_flag_errors",Et="$user_state",Rl="$client_session_props",Al="$capture_rate_limit",Il="$initial_campaign_params",Ml="$initial_referrer_info",fi="$initial_person_info",pi="$epp",gg="__POSTHOG_TOOLBAR__",Dr="$posthog_cookieless",mS=[fg,ys,"__cmpns",_s,"$session_recording_enabled_server_side",Tl,di,Jn,kl,Et,xs,Pl,En,bs,Cl,hi,jl,Rl,Al,Il,Ml,pi,fi];Math.trunc||(Math.trunc=function(t){return t<0?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return Zt(t)&&isFinite(t)&&Math.floor(t)===t});var zd="0123456789abcdef";class mi{constructor(e){if(this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,n,r,s){if(!Number.isInteger(e)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(s)||e<0||n<0||r<0||s<0||e>0xffffffffffff||n>4095||r>1073741823||s>4294967295)throw new RangeError("invalid field value");var o=new Uint8Array(16);return o[0]=e/Math.pow(2,40),o[1]=e/Math.pow(2,32),o[2]=e/Math.pow(2,24),o[3]=e/Math.pow(2,16),o[4]=e/Math.pow(2,8),o[5]=e,o[6]=112|n>>>8,o[7]=n,o[8]=128|r>>>24,o[9]=r>>>16,o[10]=r>>>8,o[11]=r,o[12]=s>>>24,o[13]=s>>>16,o[14]=s>>>8,o[15]=s,new mi(o)}toString(){for(var e="",n=0;n<this.bytes.length;n++)e=e+zd.charAt(this.bytes[n]>>>4)+zd.charAt(15&this.bytes[n]),n!==3&&n!==5&&n!==7&&n!==9||(e+="-");if(e.length!==36)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new mi(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(var n=0;n<16;n++){var r=this.bytes[n]-e.bytes[n];if(r!==0)return Math.sign(r)}return 0}}class gS{constructor(){this.P=0,this.T=0,this.I=new vS}generate(){var e=this.generateOrAbort();if($(e)){this.P=0;var n=this.generateOrAbort();if($(n))throw new Error("Could not generate UUID after timestamp reset");return n}return e}generateOrAbort(){var e=Date.now();if(e>this.P)this.P=e,this.C();else{if(!(e+1e4>this.P))return;this.T++,this.T>4398046511103&&(this.P++,this.C())}return mi.fromFieldsV7(this.P,Math.trunc(this.T/Math.pow(2,30)),this.T&Math.pow(2,30)-1,this.I.nextUint32())}C(){this.T=1024*this.I.nextUint32()+(1023&this.I.nextUint32())}}var Ud,vg=t=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;e<t.length;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};j&&!$(j.crypto)&&crypto.getRandomValues&&(vg=t=>crypto.getRandomValues(t));class vS{constructor(){this.R=new Uint32Array(8),this.F=1/0}nextUint32(){return this.F>=this.R.length&&(vg(this.R),this.F=0),this.R[this.F++]}}var cn=()=>yS().toString(),yS=()=>(Ud||(Ud=new gS)).generate(),Nr="",_S=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function xS(t,e){if(e){var n=function(s,o){if(o===void 0&&(o=L),Nr)return Nr;if(!o||["localhost","127.0.0.1"].includes(s))return"";for(var i=s.split("."),a=Math.min(i.length,8),l="dmn_chk_"+cn();!Nr&&a--;){var u=i.slice(a).join("."),d=l+"=1;domain=."+u+";path=/";o.cookie=d+";max-age=3",o.cookie.includes(l)&&(o.cookie=d+";max-age=0",Nr=u)}return Nr}(t);if(!n){var r=(s=>{var o=s.match(_S);return o?o[0]:""})(t);r!==n&&V.info("Warning: cookie subdomain discovery mismatch",r,n),n=r}return n?"; domain=."+n:""}return""}var St={O:()=>!!L,M:function(t){V.error("cookieStore error: "+t)},A:function(t){if(L){try{for(var e=t+"=",n=L.cookie.split(";").filter(o=>o.length),r=0;r<n.length;r++){for(var s=n[r];s.charAt(0)==" ";)s=s.substring(1,s.length);if(s.indexOf(e)===0)return decodeURIComponent(s.substring(e.length,s.length))}}catch{}return null}},j:function(t){var e;try{e=JSON.parse(St.A(t))||{}}catch{}return e},D:function(t,e,n,r,s){if(L)try{var o="",i="",a=xS(L.location.hostname,r);if(n){var l=new Date;l.setTime(l.getTime()+24*n*60*60*1e3),o="; expires="+l.toUTCString()}s&&(i="; secure");var u=t+"="+encodeURIComponent(JSON.stringify(e))+o+"; SameSite=Lax; path=/"+a+i;return u.length>3686.4&&V.warn("cookieStore warning: large cookie, len="+u.length),L.cookie=u,u}catch{return}},L:function(t,e){if(L!=null&&L.cookie)try{St.D(t,"",-1,e)}catch{return}}},ya=null,xe={O:function(){if(!mt(ya))return ya;var t=!0;if($(j))t=!1;else try{var e="__mplssupport__";xe.D(e,"xyz"),xe.A(e)!=='"xyz"'&&(t=!1),xe.L(e)}catch{t=!1}return t||V.error("localStorage unsupported; falling back to cookie store"),ya=t,t},M:function(t){V.error("localStorage error: "+t)},A:function(t){try{return j?.localStorage.getItem(t)}catch(e){xe.M(e)}return null},j:function(t){try{return JSON.parse(xe.A(t))||{}}catch{}return null},D:function(t,e){try{j?.localStorage.setItem(t,JSON.stringify(e))}catch(n){xe.M(n)}},L:function(t){try{j?.localStorage.removeItem(t)}catch(e){xe.M(e)}}},bS=["$device_id","distinct_id",di,mg,pi,fi,Et],Ro={},wS={O:function(){return!0},M:function(t){V.error("memoryStorage error: "+t)},A:function(t){return Ro[t]||null},j:function(t){return Ro[t]||null},D:function(t,e){Ro[t]=e},L:function(t){delete Ro[t]}},xn=null,Oe={O:function(){if(!mt(xn))return xn;if(xn=!0,$(j))xn=!1;else try{var t="__support__";Oe.D(t,"xyz"),Oe.A(t)!=='"xyz"'&&(xn=!1),Oe.L(t)}catch{xn=!1}return xn},M:function(t){V.error("sessionStorage error: ",t)},A:function(t){try{return j?.sessionStorage.getItem(t)}catch(e){Oe.M(e)}return null},j:function(t){try{return JSON.parse(Oe.A(t))||null}catch{}return null},D:function(t,e){try{j?.sessionStorage.setItem(t,JSON.stringify(e))}catch(n){Oe.M(n)}},L:function(t){try{j?.sessionStorage.removeItem(t)}catch(e){Oe.M(e)}}},Wt=function(t){return t[t.PENDING=-1]="PENDING",t[t.DENIED=0]="DENIED",t[t.GRANTED=1]="GRANTED",t}({});class ES{constructor(e){this._instance=e}get N(){return this._instance.config}get consent(){return this.U()?Wt.DENIED:this.H}isOptedOut(){return this.N.cookieless_mode==="always"||this.consent===Wt.DENIED||this.consent===Wt.PENDING&&(this.N.opt_out_capturing_by_default||this.N.cookieless_mode==="on_reject")}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===Wt.DENIED}optInOut(e){this.B.D(this.q,e?1:0,this.N.cookie_expiration,this.N.cross_subdomain_cookie,this.N.secure_cookie)}reset(){this.B.L(this.q,this.N.cross_subdomain_cookie)}get q(){var{token:e,opt_out_capturing_cookie_prefix:n,consent_persistence_name:r}=this._instance.config;return r||(n?n+e:"__ph_opt_in_out_"+e)}get H(){var e=this.B.A(this.q);return ma(e)?Wt.GRANTED:te(AE,e)?Wt.DENIED:Wt.PENDING}get B(){if(!this.W){var e=this.N.opt_out_capturing_persistence_type;this.W=e==="localStorage"?xe:St;var n=e==="localStorage"?St:xe;n.A(this.q)&&(this.W.A(this.q)||this.optInOut(ma(n.A(this.q))),n.L(this.q,this.N.cross_subdomain_cookie))}return this.W}U(){return!!this.N.respect_dnt&&!!dg([Je?.doNotTrack,Je?.msDoNotTrack,G.doNotTrack],e=>ma(e))}}var Ao=we("[Dead Clicks]"),SS=()=>!0,TS=t=>{var e,n=!((e=t.instance.persistence)==null||!e.get_property(pg)),r=t.instance.config.capture_dead_clicks;return qt(r)?r:!!Ae(r)||n};class Hd{get lazyLoadedDeadClicksAutocapture(){return this.G}constructor(e,n,r){this.instance=e,this.isEnabled=n,this.onCapture=r,this.startIfEnabledOrStop()}onRemoteConfig(e){"captureDeadClicks"in e&&(this.instance.persistence&&this.instance.persistence.register({[pg]:e.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.V(()=>{this.J()}):this.stop()}V(e){var n,r;(n=G.__PosthogExtensions__)!=null&&n.initDeadClicksAutocapture&&e(),(r=G.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",s=>{s?Ao.error("failed to load script",s):e()})}J(){var e;if(L){if(!this.G&&(e=G.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var n=Ae(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};n.__onCapture=this.onCapture,this.G=G.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,n),this.G.start(L),Ao.info("starting...")}}else Ao.error("`document` not found. Cannot start.")}stop(){this.G&&(this.G.stop(),this.G=void 0,Ao.info("stopping..."))}}var _a=we("[SegmentIntegration]");function kS(t,e){var n=t.config.segment;if(!n)return e();(function(r,s){var o=r.config.segment;if(!o)return s();var i=l=>{var u=()=>l.anonymousId()||cn();r.config.get_device_id=u,l.id()&&(r.register({distinct_id:l.id(),$device_id:u()}),r.persistence.set_property(Et,"identified")),s()},a=o.user();"then"in a&&Gt(a.then)?a.then(i):i(a)})(t,()=>{n.register((r=>{Promise&&Promise.resolve||_a.warn("This browser does not have Promise support, and can not use the segment integration");var s=(o,i)=>{if(!i)return o;o.event.userId||o.event.anonymousId===r.get_distinct_id()||(_a.info("No userId set, resetting PostHog"),r.reset()),o.event.userId&&o.event.userId!==r.get_distinct_id()&&(_a.info("UserId set, identifying with PostHog"),r.identify(o.event.userId));var a=r.calculateEventProperties(i,o.event.properties);return o.event.properties=Object.assign({},a,o.event.properties),o};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:o=>s(o,o.event.event),page:o=>s(o,"$pageview"),identify:o=>s(o,"$identify"),screen:o=>s(o,"$screen")}})(t)).then(()=>{e()})})}var yg="posthog-js";function _g(t,e){var{organization:n,projectId:r,prefix:s,severityAllowList:o=["error"],sendExceptionsToPostHog:i=!0}=e===void 0?{}:e;return a=>{var l,u,d,h,f;if(!(o==="*"||o.includes(a.level))||!t.__loaded)return a;a.tags||(a.tags={});var m=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());a.tags["PostHog Person URL"]=m,t.sessionRecordingStarted()&&(a.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var v=((l=a.exception)==null?void 0:l.values)||[],g=v.map(_=>F({},_,{stacktrace:_.stacktrace?F({},_.stacktrace,{type:"raw",frames:(_.stacktrace.frames||[]).map(x=>F({},x,{platform:"web:javascript"}))}):void 0})),y={$exception_message:((u=v[0])==null?void 0:u.value)||a.message,$exception_type:(d=v[0])==null?void 0:d.type,$exception_level:a.level,$exception_list:g,$sentry_event_id:a.event_id,$sentry_exception:a.exception,$sentry_exception_message:((h=v[0])==null?void 0:h.value)||a.message,$sentry_exception_type:(f=v[0])==null?void 0:f.type,$sentry_tags:a.tags};return n&&r&&(y.$sentry_url=(s||"https://sentry.io/organizations/")+n+"/issues/?project="+r+"&query="+a.event_id),i&&t.exceptions.sendExceptionEvent(y),a}}class PS{constructor(e,n,r,s,o,i){this.name=yg,this.setupOnce=function(a){a(_g(e,{organization:n,projectId:r,prefix:s,severityAllowList:o,sendExceptionsToPostHog:i==null||i}))}}}var gi=t=>{var e=L?.createElement("a");return $(e)?null:(e.href=t,e)},CS=function(t,e){var n,r;e===void 0&&(e="&");var s=[];return he(t,function(o,i){$(o)||$(i)||i==="undefined"||(n=encodeURIComponent((a=>a instanceof File)(o)?o.name:o.toString()),r=encodeURIComponent(i),s[s.length]=r+"="+n)}),s.join(e)},vi=function(t,e){for(var n,r=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),s=0;s<r.length;s++){var o=r[s].split("=");if(o[0]===e){n=o;break}}if(!ae(n)||n.length<2)return"";var i=n[1];try{i=decodeURIComponent(i)}catch{V.error("Skipping decoding for malformed query param: "+i)}return i.replace(/\+/g," ")},Gs=function(t,e,n){if(!t||!e||!e.length)return t;for(var r=t.split("#"),s=r[0]||"",o=r[1],i=s.split("?"),a=i[1],l=i[0],u=(a||"").split("&"),d=[],h=0;h<u.length;h++){var f=u[h].split("=");ae(f)&&(e.includes(f[0])?d.push(f[0]+"="+n):d.push(u[h]))}var m=l;return a!=null&&(m+="?"+d.join("&")),o!=null&&(m+="#"+o),m},yi=function(t,e){var n=t.match(new RegExp(e+"=([^&]*)"));return n?n[1]:null},jS=j!=null&&j.location?yi(j.location.hash,"__posthog")||yi(location.hash,"state"):null,Wd="_postHogToolbarParams",Gd=we("[Toolbar]"),sn=function(t){return t[t.UNINITIALIZED=0]="UNINITIALIZED",t[t.LOADING=1]="LOADING",t[t.LOADED=2]="LOADED",t}(sn||{});class RS{constructor(e){this.instance=e}K(e){G.ph_toolbar_state=e}Y(){var e;return(e=G.ph_toolbar_state)!==null&&e!==void 0?e:sn.UNINITIALIZED}maybeLoadToolbar(e,n,r){if(e===void 0&&(e=void 0),n===void 0&&(n=void 0),r===void 0&&(r=void 0),hg(this.instance.config)||!j||!L)return!1;e=e??j.location,r=r??j.history;try{if(!n){try{j.localStorage.setItem("test","test"),j.localStorage.removeItem("test")}catch{return!1}n=j?.localStorage}var s,o=jS||yi(e.hash,"__posthog")||yi(e.hash,"state"),i=o?Dd(()=>JSON.parse(atob(decodeURIComponent(o))))||Dd(()=>JSON.parse(decodeURIComponent(o))):null;return i&&i.action==="ph_authorize"?((s=i).source="url",s&&Object.keys(s).length>0&&(i.desiredHash?e.hash=i.desiredHash:r?r.replaceState(r.state,"",e.pathname+e.search):e.hash="")):((s=JSON.parse(n.getItem(Wd)||"{}")).source="localstorage",delete s.userIntent),!(!s.token||this.instance.config.token!==s.token)&&(this.loadToolbar(s),!0)}catch{return!1}}X(e){var n=G.ph_load_toolbar||G.ph_load_editor;!re(n)&&Gt(n)?n(e,this.instance):Gd.warn("No toolbar load function found")}loadToolbar(e){var n=!(L==null||!L.getElementById(gg));if(!j||n)return!1;var r=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,s=F({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(j.localStorage.setItem(Wd,JSON.stringify(F({},s,{source:void 0}))),this.Y()===sn.LOADED)this.X(s);else if(this.Y()===sn.UNINITIALIZED){var o;this.K(sn.LOADING),(o=G.__PosthogExtensions__)==null||o.loadExternalDependency==null||o.loadExternalDependency(this.instance,"toolbar",i=>{if(i)return Gd.error("[Toolbar] Failed to load",i),void this.K(sn.UNINITIALIZED);this.K(sn.LOADED),this.X(s)}),Ce(j,"turbolinks:load",()=>{this.K(sn.UNINITIALIZED),this.loadToolbar(s)})}return!0}Z(e){return this.loadToolbar(e)}maybeLoadEditor(e,n,r){return e===void 0&&(e=void 0),n===void 0&&(n=void 0),r===void 0&&(r=void 0),this.maybeLoadToolbar(e,n,r)}}class Kd{constructor(e){this.tt=(n,r,s)=>{s&&(s.noSessionId||s.activityTimeout||s.sessionPastMaximumLength)&&(V.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:n,changeReason:s}),this.it=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.et()}et(){var e;this.rt=(e=this._instance.sessionManager)==null?void 0:e.onSessionId(this.tt)}destroy(){var e;(e=this.rt)==null||e.call(this),this.rt=void 0}doPageView(e,n){var r,s=this.st(e,n);return this.it={pathname:(r=j?.location.pathname)!==null&&r!==void 0?r:"",pageViewId:n,timestamp:e},this._instance.scrollManager.resetContext(),s}doPageLeave(e){var n;return this.st(e,(n=this.it)==null?void 0:n.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.it)==null?void 0:e.pageViewId}}st(e,n){var r=this.it;if(!r)return{$pageview_id:n};var s={$pageview_id:n,$prev_pageview_id:r.pageViewId},o=this._instance.scrollManager.getContext();if(o&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:i,lastScrollY:a,maxScrollY:l,maxContentHeight:u,lastContentY:d,maxContentY:h}=o;if(!($(i)||$(a)||$(l)||$(u)||$(d)||$(h))){i=Math.ceil(i),a=Math.ceil(a),l=Math.ceil(l),u=Math.ceil(u),d=Math.ceil(d),h=Math.ceil(h);var f=i<=1?1:Ct(a/i,0,1,V),m=i<=1?1:Ct(l/i,0,1,V),v=u<=1?1:Ct(d/u,0,1,V),g=u<=1?1:Ct(h/u,0,1,V);s=ke(s,{$prev_pageview_last_scroll:a,$prev_pageview_last_scroll_percentage:f,$prev_pageview_max_scroll:l,$prev_pageview_max_scroll_percentage:m,$prev_pageview_last_content:d,$prev_pageview_last_content_percentage:v,$prev_pageview_max_content:h,$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}}var Tt=function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({}),at=Uint8Array,Ge=Uint16Array,mr=Uint32Array,$c=new at([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]),Vc=new at([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]),qd=new at([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),xg=function(t,e){for(var n=new Ge(31),r=0;r<31;++r)n[r]=e+=1<<t[r-1];var s=new mr(n[30]);for(r=1;r<30;++r)for(var o=n[r];o<n[r+1];++o)s[o]=o-n[r]<<5|r;return[n,s]},bg=xg($c,2),AS=bg[0],Ol=bg[1];AS[28]=258,Ol[258]=28;for(var Yd=xg(Vc,0)[1],wg=new Ge(32768),ye=0;ye<32768;++ye){var bn=(43690&ye)>>>1|(21845&ye)<<1;bn=(61680&(bn=(52428&bn)>>>2|(13107&bn)<<2))>>>4|(3855&bn)<<4,wg[ye]=((65280&bn)>>>8|(255&bn)<<8)>>>1}var Rs=function(t,e,n){for(var r=t.length,s=0,o=new Ge(e);s<r;++s)++o[t[s]-1];var i,a=new Ge(e);for(s=0;s<e;++s)a[s]=a[s-1]+o[s-1]<<1;for(i=new Ge(r),s=0;s<r;++s)i[s]=wg[a[t[s]-1]++]>>>15-t[s];return i},In=new at(288);for(ye=0;ye<144;++ye)In[ye]=8;for(ye=144;ye<256;++ye)In[ye]=9;for(ye=256;ye<280;++ye)In[ye]=7;for(ye=280;ye<288;++ye)In[ye]=8;var _i=new at(32);for(ye=0;ye<32;++ye)_i[ye]=5;var IS=Rs(In,9),MS=Rs(_i,5),Eg=function(t){return(t/8>>0)+(7&t&&1)},Sg=function(t,e,n){(n==null||n>t.length)&&(n=t.length);var r=new(t instanceof Ge?Ge:t instanceof mr?mr:at)(n-e);return r.set(t.subarray(e,n)),r},zt=function(t,e,n){n<<=7&e;var r=e/8>>0;t[r]|=n,t[r+1]|=n>>>8},Lr=function(t,e,n){n<<=7&e;var r=e/8>>0;t[r]|=n,t[r+1]|=n>>>8,t[r+2]|=n>>>16},xa=function(t,e){for(var n=[],r=0;r<t.length;++r)t[r]&&n.push({s:r,f:t[r]});var s=n.length,o=n.slice();if(!s)return[new at(0),0];if(s==1){var i=new at(n[0].s+1);return i[n[0].s]=1,[i,1]}n.sort(function(b,T){return b.f-T.f}),n.push({s:-1,f:25001});var a=n[0],l=n[1],u=0,d=1,h=2;for(n[0]={s:-1,f:a.f+l.f,l:a,r:l};d!=s-1;)a=n[n[u].f<n[h].f?u++:h++],l=n[u!=d&&n[u].f<n[h].f?u++:h++],n[d++]={s:-1,f:a.f+l.f,l:a,r:l};var f=o[0].s;for(r=1;r<s;++r)o[r].s>f&&(f=o[r].s);var m=new Ge(f+1),v=Dl(n[d-1],m,0);if(v>e){r=0;var g=0,y=v-e,_=1<<y;for(o.sort(function(b,T){return m[T.s]-m[b.s]||b.f-T.f});r<s;++r){var x=o[r].s;if(!(m[x]>e))break;g+=_-(1<<v-m[x]),m[x]=e}for(g>>>=y;g>0;){var w=o[r].s;m[w]<e?g-=1<<e-m[w]++-1:++r}for(;r>=0&&g;--r){var E=o[r].s;m[E]==e&&(--m[E],++g)}v=e}return[new at(m),v]},Dl=function(t,e,n){return t.s==-1?Math.max(Dl(t.l,e,n+1),Dl(t.r,e,n+1)):e[t.s]=n},Xd=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new Ge(++e),r=0,s=t[0],o=1,i=function(l){n[r++]=l},a=1;a<=e;++a)if(t[a]==s&&a!=e)++o;else{if(!s&&o>2){for(;o>138;o-=138)i(32754);o>2&&(i(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(i(s),--o;o>6;o-=6)i(8304);o>2&&(i(o-3<<5|8208),o=0)}for(;o--;)i(s);o=1,s=t[a]}return[n.subarray(0,r),e]},Fr=function(t,e){for(var n=0,r=0;r<e.length;++r)n+=t[r]*e[r];return n},Nl=function(t,e,n){var r=n.length,s=Eg(e+2);t[s]=255&r,t[s+1]=r>>>8,t[s+2]=255^t[s],t[s+3]=255^t[s+1];for(var o=0;o<r;++o)t[s+o+4]=n[o];return 8*(s+4+r)},Zd=function(t,e,n,r,s,o,i,a,l,u,d){zt(e,d++,n),++s[256];for(var h=xa(s,15),f=h[0],m=h[1],v=xa(o,15),g=v[0],y=v[1],_=Xd(f),x=_[0],w=_[1],E=Xd(g),b=E[0],T=E[1],k=new Ge(19),P=0;P<x.length;++P)k[31&x[P]]++;for(P=0;P<b.length;++P)k[31&b[P]]++;for(var O=xa(k,7),R=O[0],B=O[1],N=19;N>4&&!R[qd[N-1]];--N);var K,M,q,z,U=u+5<<3,A=Fr(s,In)+Fr(o,_i)+i,I=Fr(s,f)+Fr(o,g)+i+14+3*N+Fr(k,R)+(2*k[16]+3*k[17]+7*k[18]);if(U<=A&&U<=I)return Nl(e,d,t.subarray(l,l+u));if(zt(e,d,1+(I<A)),d+=2,I<A){K=Rs(f,m),M=f,q=Rs(g,y),z=g;var ee=Rs(R,B);for(zt(e,d,w-257),zt(e,d+5,T-1),zt(e,d+10,N-4),d+=14,P=0;P<N;++P)zt(e,d+3*P,R[qd[P]]);d+=3*N;for(var H=[x,b],Y=0;Y<2;++Y){var Z=H[Y];for(P=0;P<Z.length;++P){var oe=31&Z[P];zt(e,d,ee[oe]),d+=R[oe],oe>15&&(zt(e,d,Z[P]>>>5&127),d+=Z[P]>>>12)}}}else K=IS,M=In,q=MS,z=_i;for(P=0;P<a;++P)if(r[P]>255){oe=r[P]>>>18&31,Lr(e,d,K[oe+257]),d+=M[oe+257],oe>7&&(zt(e,d,r[P]>>>23&31),d+=$c[oe]);var Re=31&r[P];Lr(e,d,q[Re]),d+=z[Re],Re>3&&(Lr(e,d,r[P]>>>5&8191),d+=Vc[Re])}else Lr(e,d,K[r[P]]),d+=M[r[P]];return Lr(e,d,K[256]),d+M[256]},OS=new mr([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),DS=function(){for(var t=new mr(256),e=0;e<256;++e){for(var n=e,r=9;--r;)n=(1&n&&3988292384)^n>>>1;t[e]=n}return t}(),NS=function(t,e,n,r,s){return function(o,i,a,l,u,d){var h=o.length,f=new at(l+h+5*(1+Math.floor(h/7e3))+u),m=f.subarray(l,f.length-u),v=0;if(!i||h<8)for(var g=0;g<=h;g+=65535){var y=g+65535;y<h?v=Nl(m,v,o.subarray(g,y)):(m[g]=d,v=Nl(m,v,o.subarray(g,h)))}else{for(var _=OS[i-1],x=_>>>13,w=8191&_,E=(1<<a)-1,b=new Ge(32768),T=new Ge(E+1),k=Math.ceil(a/3),P=2*k,O=function(Ar){return(o[Ar]^o[Ar+1]<<k^o[Ar+2]<<P)&E},R=new mr(25e3),B=new Ge(288),N=new Ge(32),K=0,M=0,q=(g=0,0),z=0,U=0;g<h;++g){var A=O(g),I=32767&g,ee=T[A];if(b[I]=ee,T[A]=I,z<=g){var H=h-g;if((K>7e3||q>24576)&&H>423){v=Zd(o,m,0,R,B,N,M,q,U,g-U,v),q=K=M=0,U=g;for(var Y=0;Y<286;++Y)B[Y]=0;for(Y=0;Y<30;++Y)N[Y]=0}var Z=2,oe=0,Re=w,ne=I-ee&32767;if(H>2&&A==O(g-ne))for(var me=Math.min(x,H)-1,qe=Math.min(32767,g),$t=Math.min(258,H);ne<=qe&&--Re&&I!=ee;){if(o[g+Z]==o[g+Z-ne]){for(var Le=0;Le<$t&&o[g+Le]==o[g+Le-ne];++Le);if(Le>Z){if(Z=Le,oe=ne,Le>me)break;var Cr=Math.min(ne,Le-2),Jt=0;for(Y=0;Y<Cr;++Y){var vt=g-ne+Y+32768&32767,jr=vt-b[vt]+32768&32767;jr>Jt&&(Jt=jr,ee=vt)}}}ne+=(I=ee)-(ee=b[I])+32768&32767}if(oe){R[q++]=268435456|Ol[Z]<<18|Yd[oe];var Rr=31&Ol[Z],Vt=31&Yd[oe];M+=$c[Rr]+Vc[Vt],++B[257+Rr],++N[Vt],z=g+Z,++K}else R[q++]=o[g],++B[o[g]]}}v=Zd(o,m,d,R,B,N,M,q,U,g-U,v)}return Sg(f,0,l+Eg(v)+u)}(t,e.level==null?6:e.level,e.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+e.mem,n,r,!0)},ba=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8};function LS(t,e){e===void 0&&(e={});var n=function(){var a=4294967295;return{p:function(l){for(var u=a,d=0;d<l.length;++d)u=DS[255&u^l[d]]^u>>>8;a=u},d:function(){return 4294967295^a}}}(),r=t.length;n.p(t);var s,o=NS(t,e,10+((s=e).filename&&s.filename.length+1||0),8),i=o.length;return function(a,l){var u=l.filename;if(a[0]=31,a[1]=139,a[2]=8,a[8]=l.level<2?4:l.level==9?2:0,a[9]=3,l.mtime!=0&&ba(a,4,Math.floor(new Date(l.mtime||Date.now())/1e3)),u){a[3]=8;for(var d=0;d<=u.length;++d)a[d+10]=u.charCodeAt(d)}}(o,e),ba(o,i-8,n.d()),ba(o,i-4,r),o}var FS=function(t){var e,n,r,s,o="";for(e=n=0,r=(t=(t+"").replace(/\r\n/g,`
`).replace(/\r/g,`
`)).length,s=0;s<r;s++){var i=t.charCodeAt(s),a=null;i<128?n++:a=i>127&&i<2048?String.fromCharCode(i>>6|192,63&i|128):String.fromCharCode(i>>12|224,i>>6&63|128,63&i|128),mt(a)||(n>e&&(o+=t.substring(e,n)),o+=a,e=n=s+1)}return n>e&&(o+=t.substring(e,t.length)),o},$S=!!vl||!!gl,Jd="text/plain",xi=function(t,e,n){var r;n===void 0&&(n=!0);var[s,o]=t.split("?"),i=F({},e),a=(r=o?.split("&").map(u=>{var d,[h,f]=u.split("="),m=n&&(d=i[h])!==null&&d!==void 0?d:f;return delete i[h],h+"="+m}))!==null&&r!==void 0?r:[],l=CS(i);return l&&a.push(l),s+"?"+a.join("&")},ws=(t,e)=>JSON.stringify(t,(n,r)=>typeof r=="bigint"?r.toString():r,e),wa=t=>{var{data:e,compression:n}=t;if(e){if(n===Tt.GZipJS){var r=LS(function(l,u){var d=l.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(l);for(var h=new at(l.length+(l.length>>>1)),f=0,m=function(_){h[f++]=_},v=0;v<d;++v){if(f+5>h.length){var g=new at(f+8+(d-v<<1));g.set(h),h=g}var y=l.charCodeAt(v);y<128||u?m(y):y<2048?(m(192|y>>>6),m(128|63&y)):y>55295&&y<57344?(m(240|(y=65536+(1047552&y)|1023&l.charCodeAt(++v))>>>18),m(128|y>>>12&63),m(128|y>>>6&63),m(128|63&y)):(m(224|y>>>12),m(128|y>>>6&63),m(128|63&y))}return Sg(h,0,f)}(ws(e)),{mtime:0}),s=new Blob([r],{type:Jd});return{contentType:Jd,body:s,estimatedSize:s.size}}if(n===Tt.Base64){var o=function(l){var u,d,h,f,m,v="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",g=0,y=0,_="",x=[];if(!l)return l;l=FS(l);do u=(m=l.charCodeAt(g++)<<16|l.charCodeAt(g++)<<8|l.charCodeAt(g++))>>18&63,d=m>>12&63,h=m>>6&63,f=63&m,x[y++]=v.charAt(u)+v.charAt(d)+v.charAt(h)+v.charAt(f);while(g<l.length);switch(_=x.join(""),l.length%3){case 1:_=_.slice(0,-2)+"==";break;case 2:_=_.slice(0,-1)+"="}return _}(ws(e)),i=(l=>"data="+encodeURIComponent(typeof l=="string"?l:ws(l)))(o);return{contentType:"application/x-www-form-urlencoded",body:i,estimatedSize:new Blob([i]).size}}var a=ws(e);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},Ko=[];gl&&Ko.push({transport:"fetch",method:t=>{var e,n,{contentType:r,body:s,estimatedSize:o}=(e=wa(t))!==null&&e!==void 0?e:{},i=new Headers;he(t.headers,function(d,h){i.append(h,d)}),r&&i.append("Content-Type",r);var a=t.url,l=null;if(Td){var u=new Td;l={signal:u.signal,timeout:setTimeout(()=>u.abort(),t.timeout)}}gl(a,F({method:t?.method||"GET",headers:i,keepalive:t.method==="POST"&&(o||0)<52428.8,body:s,signal:(n=l)==null?void 0:n.signal},t.fetchOptions)).then(d=>d.text().then(h=>{var f={statusCode:d.status,text:h};if(d.status===200)try{f.json=JSON.parse(h)}catch(m){V.error(m)}t.callback==null||t.callback(f)})).catch(d=>{V.error(d),t.callback==null||t.callback({statusCode:0,error:d})}).finally(()=>l?clearTimeout(l.timeout):null)}}),vl&&Ko.push({transport:"XHR",method:t=>{var e,n=new vl;n.open(t.method||"GET",t.url,!0);var{contentType:r,body:s}=(e=wa(t))!==null&&e!==void 0?e:{};he(t.headers,function(o,i){n.setRequestHeader(i,o)}),r&&n.setRequestHeader("Content-Type",r),t.timeout&&(n.timeout=t.timeout),t.disableXHRCredentials||(n.withCredentials=!0),n.onreadystatechange=()=>{if(n.readyState===4){var o={statusCode:n.status,text:n.responseText};if(n.status===200)try{o.json=JSON.parse(n.responseText)}catch{}t.callback==null||t.callback(o)}},n.send(s)}}),Je!=null&&Je.sendBeacon&&Ko.push({transport:"sendBeacon",method:t=>{var e=xi(t.url,{beacon:"1"});try{var n,{contentType:r,body:s}=(n=wa(t))!==null&&n!==void 0?n:{},o=typeof s=="string"?new Blob([s],{type:r}):s;Je.sendBeacon(e,o)}catch{}}});var bi=function(t,e){if(!function(n){try{new RegExp(n)}catch{return!1}return!0}(e))return!1;try{return new RegExp(e).test(t)}catch{return!1}};function Qd(t,e,n){return ws({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:n})}var Tg={exact:(t,e)=>e.some(n=>t.some(r=>n===r)),is_not:(t,e)=>e.every(n=>t.every(r=>n!==r)),regex:(t,e)=>e.some(n=>t.some(r=>bi(n,r))),not_regex:(t,e)=>e.every(n=>t.every(r=>!bi(n,r))),icontains:(t,e)=>e.map(Io).some(n=>t.map(Io).some(r=>n.includes(r))),not_icontains:(t,e)=>e.map(Io).every(n=>t.map(Io).every(r=>!n.includes(r))),gt:(t,e)=>e.some(n=>{var r=parseFloat(n);return!isNaN(r)&&t.some(s=>r>parseFloat(s))}),lt:(t,e)=>e.some(n=>{var r=parseFloat(n);return!isNaN(r)&&t.some(s=>r<parseFloat(s))})},Io=t=>t.toLowerCase();function kg(t,e){return!t||Object.entries(t).every(n=>{var[r,s]=n,o=e?.[r];if($(o)||mt(o))return!1;var i=[String(o)],a=Tg[s.operator];return!!a&&a(s.values,i)})}var Ea=we("[Error tracking]");class VS{constructor(e){var n,r;this.nt=[],this.ot=new WE([new eS,new cS,new nS,new tS,new aS,new iS,new sS,new lS],QE()),this._instance=e,this.nt=(n=(r=this._instance.persistence)==null?void 0:r.get_property(kl))!==null&&n!==void 0?n:[]}onRemoteConfig(e){var n,r,s;if("errorTracking"in e){var o=(n=(r=e.errorTracking)==null?void 0:r.suppressionRules)!==null&&n!==void 0?n:[],i=(s=e.errorTracking)==null?void 0:s.captureExtensionExceptions;this.nt=o,this._instance.persistence&&this._instance.persistence.register({[kl]:this.nt,[Fd]:i})}}get ut(){var e,n=!!this._instance.get_property(Fd),r=this._instance.config.error_tracking.captureExtensionExceptions;return(e=r??n)!==null&&e!==void 0&&e}buildProperties(e,n){return this.ot.buildFromUnknown(e,{syntheticException:n?.syntheticException,mechanism:{handled:n?.handled}})}sendExceptionEvent(e){var n=e.$exception_list;if(this.ht(n)){if(this.dt(n))return void Ea.info("Skipping exception capture because a suppression rule matched");if(!this.ut&&this.vt(n))return void Ea.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ct(n))return void Ea.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent",ft:!0})}dt(e){if(e.length===0)return!1;var n=e.reduce((r,s)=>{var{type:o,value:i}=s;return je(o)&&o.length>0&&r.$exception_types.push(o),je(i)&&i.length>0&&r.$exception_values.push(i),r},{$exception_types:[],$exception_values:[]});return this.nt.some(r=>{var s=r.values.map(o=>{var i,a=Tg[o.operator],l=ae(o.value)?o.value:[o.value],u=(i=n[o.key])!==null&&i!==void 0?i:[];return l.length>0&&a(l,u)});return r.type==="OR"?s.some(Boolean):s.every(Boolean)})}vt(e){return e.flatMap(n=>{var r,s;return(r=(s=n.stacktrace)==null?void 0:s.frames)!==null&&r!==void 0?r:[]}).some(n=>n.filename&&n.filename.startsWith("chrome-extension://"))}ct(e){if(e.length>0){var n,r,s,o,i=(n=(r=e[0].stacktrace)==null?void 0:r.frames)!==null&&n!==void 0?n:[],a=i[i.length-1];return(s=a==null||(o=a.filename)==null?void 0:o.includes("posthog.com/static"))!==null&&s!==void 0&&s}return!1}ht(e){return!re(e)&&ae(e)}}var Mo="https?://(.*)",gr=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],BS=pr(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],gr),Ks="<masked>",zS=["li_fat_id"];function Pg(t,e,n){if(!L)return{};var r,s=e?pr([],gr,n||[]):[],o=Cg(Gs(L.URL,s,Ks),t),i=(r={},he(zS,function(a){var l=St.A(a);r[a]=l||null}),r);return ke(i,o)}function Cg(t,e){var n=BS.concat(e||[]),r={};return he(n,function(s){var o=vi(t,s);r[s]=o||null}),r}function jg(t){var e=function(o){return o?o.search(Mo+"google.([^/?]*)")===0?"google":o.search(Mo+"bing.com")===0?"bing":o.search(Mo+"yahoo.com")===0?"yahoo":o.search(Mo+"duckduckgo.com")===0?"duckduckgo":null:null}(t),n=e!="yahoo"?"q":"p",r={};if(!mt(e)){r.$search_engine=e;var s=L?vi(L.referrer,n):"";s.length&&(r.ph_keyword=s)}return r}function eh(){return navigator.language||navigator.userLanguage}function Rg(){return L?.referrer||"$direct"}function Ag(t,e){var n=t?pr([],gr,e||[]):[],r=De?.href.substring(0,1e3);return{r:Rg().substring(0,1e3),u:r?Gs(r,n,Ks):void 0}}function Ig(t){var e,{r:n,u:r}=t,s={$referrer:n,$referring_domain:n==null?void 0:n=="$direct"?"$direct":(e=gi(n))==null?void 0:e.host};if(r){s.$current_url=r;var o=gi(r);s.$host=o?.host,s.$pathname=o?.pathname;var i=Cg(r);ke(s,i)}if(n){var a=jg(n);ke(s,a)}return s}function Mg(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function US(){try{return new Date().getTimezoneOffset()}catch{return}}function HS(t,e){if(!We)return{};var n,r,s,o=t?pr([],gr,e||[]):[],[i,a]=function(l){for(var u=0;u<Rd.length;u++){var[d,h]=Rd[u],f=d.exec(l),m=f&&(Gt(h)?h(f,l):h);if(m)return m}return["",""]}(We);return ke(Fc({$os:i,$os_version:a,$browser:ag(We,navigator.vendor),$device:Ad(We),$device_type:(r=We,s=Ad(r),s===Km||s===Gm||s==="Kobo"||s==="Kindle Fire"||s===ig?zs:s===Hs||s===lr||s===Ws||s===wl?"Console":s===Ym?"Wearable":s?it:"Desktop"),$timezone:Mg(),$timezone_offset:US()}),{$current_url:Gs(De?.href,o,Ks),$host:De?.host,$pathname:De?.pathname,$raw_user_agent:We.length>1e3?We.substring(0,997)+"...":We,$browser_version:zE(We,navigator.vendor),$browser_language:eh(),$browser_language_prefix:(n=eh(),typeof n=="string"?n.split("-")[0]:void 0),$screen_height:j?.screen.height,$screen_width:j?.screen.width,$viewport_height:j?.innerHeight,$viewport_width:j?.innerWidth,$lib:"web",$lib_version:Ut.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var Ye=we("[FeatureFlags]"),$r=we("[FeatureFlags]",{debugEnabled:!0}),WS="errors_while_computing_flags",GS="flag_missing",KS="quota_limited",qS="timeout",YS="connection_error",XS="unknown_error",ZS=t=>"api_error_"+t,Sa="$active_feature_flags",zn="$override_feature_flags",th="$feature_flag_payloads",Vr="$override_feature_flag_payloads",nh="$feature_flag_request_id",rh="$feature_flag_evaluated_at",sh=t=>{var e={};for(var[n,r]of Go(t||{}))r&&(e[n]=r);return e},JS=t=>{var e=t.flags;return e?(t.featureFlags=Object.fromEntries(Object.keys(e).map(n=>{var r;return[n,(r=e[n].variant)!==null&&r!==void 0?r:e[n].enabled]})),t.featureFlagPayloads=Object.fromEntries(Object.keys(e).filter(n=>e[n].enabled).filter(n=>{var r;return(r=e[n].metadata)==null?void 0:r.payload}).map(n=>{var r;return[n,(r=e[n].metadata)==null?void 0:r.payload]}))):Ye.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),t},QS=function(t){return t.FeatureFlags="feature_flags",t.Recordings="recordings",t}({});class eT{constructor(e){this._t=!1,this.bt=!1,this.yt=!1,this.wt=!1,this.xt=!1,this.$t=!1,this.Et=!1,this._instance=e,this.featureFlagEventHandlers=[]}St(){var e,n=(e=this._instance.config.evaluation_contexts)!==null&&e!==void 0?e:this._instance.config.evaluation_environments;return!this._instance.config.evaluation_environments||this._instance.config.evaluation_contexts||this.Et||(Ye.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.Et=!0),n!=null&&n.length?n.filter(r=>{var s=r&&typeof r=="string"&&r.trim().length>0;return s||Ye.error("Invalid evaluation context found:",r,"Expected non-empty string"),s}):[]}kt(){return this.St().length>0}get hasLoadedFlags(){return this.bt}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this._instance.get_property(Pl),n=this._instance.get_property(zn),r=this._instance.get_property(Vr);if(!r&&!n)return e||{};var s=ke({},e||{}),o=[...new Set([...Object.keys(r||{}),...Object.keys(n||{})])];for(var i of o){var a,l,u=s[i],d=n?.[i],h=$(d)?(a=u?.enabled)!==null&&a!==void 0&&a:!!d,f=$(d)?u.variant:typeof d=="string"?d:void 0,m=r?.[i],v=F({},u,{enabled:h,variant:h?f??u?.variant:void 0});h!==u?.enabled&&(v.original_enabled=u?.enabled),f!==u?.variant&&(v.original_variant=u?.variant),m&&(v.metadata=F({},u?.metadata,{payload:m,original_payload:u==null||(l=u.metadata)==null?void 0:l.payload})),s[i]=v}return this._t||(Ye.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:r,finalDetails:s}),this._t=!0),s}getFlagVariants(){var e=this._instance.get_property(Jn),n=this._instance.get_property(zn);if(!n)return e||{};for(var r=ke({},e),s=Object.keys(n),o=0;o<s.length;o++)r[s[o]]=n[s[o]];return this._t||(Ye.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:n,finalFlags:r}),this._t=!0),r}getFlagPayloads(){var e=this._instance.get_property(th),n=this._instance.get_property(Vr);if(!n)return e||{};for(var r=ke({},e||{}),s=Object.keys(n),o=0;o<s.length;o++)r[s[o]]=n[s[o]];return this._t||(Ye.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:n,finalPayloads:r}),this._t=!0),r}reloadFeatureFlags(){this.wt||this._instance.config.advanced_disable_feature_flags||this.Pt||(this._instance.Tt.emit("featureFlagsReloading",!0),this.Pt=setTimeout(()=>{this.It()},5))}Ct(){clearTimeout(this.Pt),this.Pt=void 0}ensureFlagsLoaded(){this.bt||this.yt||this.Pt||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.wt=e}It(e){var n;if(this.Ct(),!this._instance.Rt())if(this.yt)this.xt=!0;else{var r=this._instance.config.token,s=this._instance.get_property("$device_id"),o={token:r,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:F({},((n=this._instance.persistence)==null?void 0:n.get_initial_props())||{},this._instance.get_property(bs)||{}),group_properties:this._instance.get_property(En),timezone:Mg()};mt(s)||$(s)||(o.$device_id=s),(e!=null&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(o.disable_flags=!0),this.kt()&&(o.evaluation_contexts=this.St());var i=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",a=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+i);this.yt=!0,this._instance._send_request({method:"POST",url:a,data:o,compression:this._instance.config.disable_compression?void 0:Tt.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:l=>{var u,d,h,f=!0;if(l.statusCode===200&&(this.xt||(this.$anon_distinct_id=void 0),f=!1),this.yt=!1,!o.disable_flags||this.xt){this.$t=!f;var m=[];l.error?l.error instanceof Error?m.push(l.error.name==="AbortError"?qS:YS):m.push(XS):l.statusCode!==200&&m.push(ZS(l.statusCode)),(u=l.json)!=null&&u.errorsWhileComputingFlags&&m.push(WS);var v=!((d=l.json)==null||(d=d.quotaLimited)==null||!d.includes(QS.FeatureFlags));if(v&&m.push(KS),(h=this._instance.persistence)==null||h.register({[jl]:m}),v)Ye.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.");else{var g;o.disable_flags||this.receivedFeatureFlags((g=l.json)!==null&&g!==void 0?g:{},f),this.xt&&(this.xt=!1,this.It())}}}})}}getFeatureFlag(e,n){var r;if(n===void 0&&(n={}),!n.fresh||this.$t){if(this.bt||this.getFlags()&&this.getFlags().length>0){var s=this.getFeatureFlagResult(e,n);return(r=s?.variant)!==null&&r!==void 0?r:s?.enabled}Ye.warn('getFeatureFlag for key "'+e+`" failed. Feature flags didn't load in time.`)}}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){var n=this.getFeatureFlagResult(e,{send_event:!1});return n?.payload}getFeatureFlagResult(e,n){if(n===void 0&&(n={}),!n.fresh||this.$t)if(this.bt||this.getFlags()&&this.getFlags().length>0){var r=this.getFlagVariants(),s=e in r,o=r[e],i=this.getFlagPayloads()[e],a=String(o),l=this._instance.get_property(nh)||void 0,u=this._instance.get_property(rh)||void 0,d=this._instance.get_property(hi)||{};if((n.send_event||!("send_event"in n))&&(!(e in d)||!d[e].includes(a))){var h,f,m,v,g,y,_,x,w,E;ae(d[e])?d[e].push(a):d[e]=[a],(h=this._instance.persistence)==null||h.register({[hi]:d});var b=this.getFeatureFlagDetails(e),T=[...(f=this._instance.get_property(jl))!==null&&f!==void 0?f:[]];$(o)&&T.push(GS);var k={$feature_flag:e,$feature_flag_response:o,$feature_flag_payload:i||null,$feature_flag_request_id:l,$feature_flag_evaluated_at:u,$feature_flag_bootstrapped_response:((m=this._instance.config.bootstrap)==null||(m=m.featureFlags)==null?void 0:m[e])||null,$feature_flag_bootstrapped_payload:((v=this._instance.config.bootstrap)==null||(v=v.featureFlagPayloads)==null?void 0:v[e])||null,$used_bootstrap_value:!this.$t};$(b==null||(g=b.metadata)==null?void 0:g.version)||(k.$feature_flag_version=b.metadata.version);var P,O=(y=b==null||(_=b.reason)==null?void 0:_.description)!==null&&y!==void 0?y:b==null||(x=b.reason)==null?void 0:x.code;O&&(k.$feature_flag_reason=O),b!=null&&(w=b.metadata)!=null&&w.id&&(k.$feature_flag_id=b.metadata.id),$(b?.original_variant)&&$(b?.original_enabled)||(k.$feature_flag_original_response=$(b.original_variant)?b.original_enabled:b.original_variant),b!=null&&(E=b.metadata)!=null&&E.original_payload&&(k.$feature_flag_original_payload=b==null||(P=b.metadata)==null?void 0:P.original_payload),T.length&&(k.$feature_flag_error=T.join(",")),this._instance.capture("$feature_flag_called",k)}if(s){var R=i;if(!$(i))try{R=JSON.parse(i)}catch{}return{key:e,enabled:!!o,variant:typeof o=="string"?o:void 0,payload:R}}}else Ye.warn('getFeatureFlagResult for key "'+e+`" failed. Feature flags didn't load in time.`)}getRemoteConfigPayload(e,n){var r=this._instance.config.token,s={distinct_id:this._instance.get_distinct_id(),token:r};this.kt()&&(s.evaluation_contexts=this.St()),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:s,compression:this._instance.config.disable_compression?void 0:Tt.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:o=>{var i,a=(i=o.json)==null?void 0:i.featureFlagPayloads;n(a?.[e]||void 0)}})}isFeatureEnabled(e,n){if(n===void 0&&(n={}),!n.fresh||this.$t){if(this.bt||this.getFlags()&&this.getFlags().length>0){var r=this.getFeatureFlag(e,n);return $(r)?void 0:!!r}Ye.warn('isFeatureEnabled for key "'+e+`" failed. Feature flags didn't load in time.`)}}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(n=>n!==e)}receivedFeatureFlags(e,n){if(this._instance.persistence){this.bt=!0;var r=this.getFlagVariants(),s=this.getFlagPayloads(),o=this.getFlagsWithDetails();(function(i,a,l,u,d){l===void 0&&(l={}),u===void 0&&(u={}),d===void 0&&(d={});var h=JS(i),f=h.flags,m=h.featureFlags,v=h.featureFlagPayloads;if(m){var g=i.requestId,y=i.evaluatedAt;if(ae(m)){Ye.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var _={};if(m)for(var x=0;x<m.length;x++)_[m[x]]=!0;a&&a.register({[Sa]:m,[Jn]:_})}else{var w=m,E=v,b=f;if(i.errorsWhileComputingFlags)if(f){var T=new Set(Object.keys(f).filter(k=>{var P;return!((P=f[k])!=null&&P.failed)}));w=F({},l,Object.fromEntries(Object.entries(w).filter(k=>{var[P]=k;return T.has(P)}))),E=F({},u,Object.fromEntries(Object.entries(E||{}).filter(k=>{var[P]=k;return T.has(P)}))),b=F({},d,Object.fromEntries(Object.entries(b||{}).filter(k=>{var[P]=k;return T.has(P)})))}else w=F({},l,w),E=F({},u,E),b=F({},d,b);a&&a.register(F({[Sa]:Object.keys(sh(w)),[Jn]:w||{},[th]:E||{},[Pl]:b||{}},g?{[nh]:g}:{},y?{[rh]:y}:{}))}}})(e,this._instance.persistence,r,s,o),this.Ft(n)}}override(e,n){n===void 0&&(n=!1),Ye.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:n})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return Ye.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(e===!1)return this._instance.persistence.unregister(zn),this._instance.persistence.unregister(Vr),this.Ft(),$r.info("All overrides cleared");if(e&&typeof e=="object"&&("flags"in e||"payloads"in e)){var n,r=e;if(this._t=!!((n=r.suppressWarning)!==null&&n!==void 0&&n),"flags"in r){if(r.flags===!1)this._instance.persistence.unregister(zn),$r.info("Flag overrides cleared");else if(r.flags){if(ae(r.flags)){for(var s={},o=0;o<r.flags.length;o++)s[r.flags[o]]=!0;this._instance.persistence.register({[zn]:s})}else this._instance.persistence.register({[zn]:r.flags});$r.info("Flag overrides set",{flags:r.flags})}}return"payloads"in r&&(r.payloads===!1?(this._instance.persistence.unregister(Vr),$r.info("Payload overrides cleared")):r.payloads&&(this._instance.persistence.register({[Vr]:r.payloads}),$r.info("Payload overrides set",{payloads:r.payloads}))),void this.Ft()}this.Ft()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.bt){var{flags:n,flagVariants:r}=this.Ot();e(n,r)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,n,r){var s,o=(this._instance.get_property(xs)||[]).find(u=>u.flagKey===e),i={["$feature_enrollment/"+e]:n},a={$feature_flag:e,$feature_enrollment:n,$set:i};o&&(a.$early_access_feature_name=o.name),r&&(a.$feature_enrollment_stage=r),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(i,!1);var l=F({},this.getFlagVariants(),{[e]:n});(s=this._instance.persistence)==null||s.register({[Sa]:Object.keys(sh(l)),[Jn]:l}),this.Ft()}getEarlyAccessFeatures(e,n,r){n===void 0&&(n=!1);var s=this._instance.get_property(xs),o=r?"&"+r.map(i=>"stage="+i).join("&"):"";if(s&&!n)return e(s);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+o),method:"GET",callback:i=>{var a,l;if(i.json){var u=i.json.earlyAccessFeatures;return(a=this._instance.persistence)==null||a.unregister(xs),(l=this._instance.persistence)==null||l.register({[xs]:u}),e(u)}}})}Ot(){var e=this.getFlags(),n=this.getFlagVariants();return{flags:e.filter(r=>n[r]),flagVariants:Object.keys(n).filter(r=>n[r]).reduce((r,s)=>(r[s]=n[s],r),{})}}Ft(e){var{flags:n,flagVariants:r}=this.Ot();this.featureFlagEventHandlers.forEach(s=>s(n,r,{errorsLoading:e}))}setPersonPropertiesForFlags(e,n){n===void 0&&(n=!0);var r=this._instance.get_property(bs)||{};this._instance.register({[bs]:F({},r,e)}),n&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(bs)}setGroupPropertiesForFlags(e,n){n===void 0&&(n=!0);var r=this._instance.get_property(En)||{};Object.keys(r).length!==0&&Object.keys(r).forEach(s=>{r[s]=F({},r[s],e[s]),delete e[s]}),this._instance.register({[En]:F({},r,e)}),n&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var n=this._instance.get_property(En)||{};this._instance.register({[En]:F({},n,{[e]:{}})})}else this._instance.unregister(En)}reset(){this.bt=!1,this.yt=!1,this.wt=!1,this.xt=!1,this.$t=!1,this.$anon_distinct_id=void 0,this.Ct(),this._t=!1}}var tT=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class Ta{constructor(e,n){this.N=e,this.props={},this.Mt=!1,this.At=(r=>{var s="";return r.token&&(s=r.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),r.persistence_name?"ph_"+r.persistence_name:"ph_"+s+"_posthog"})(e),this.B=this.jt(e),this.load(),e.debug&&V.info("Persistence loaded",e.persistence,F({},this.props)),this.update_config(e,e,n),this.save()}isDisabled(){return!!this.Dt}jt(e){tT.indexOf(e.persistence.toLowerCase())===-1&&(V.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var n=function(s){s===void 0&&(s=[]);var o=[...bS,...s];return F({},xe,{j:function(i){try{var a={};try{a=St.j(i)||{}}catch{}var l=ke(a,JSON.parse(xe.A(i)||"{}"));return xe.D(i,l),l}catch{}return null},D:function(i,a,l,u,d,h){try{xe.D(i,a,void 0,void 0,h);var f={};o.forEach(m=>{a[m]&&(f[m]=a[m])}),Object.keys(f).length&&St.D(i,f,l,u,d,h)}catch(m){xe.M(m)}},L:function(i,a){try{j?.localStorage.removeItem(i),St.L(i,a)}catch(l){xe.M(l)}}})}(e.cookie_persisted_properties||[]),r=e.persistence.toLowerCase();return r==="localstorage"&&xe.O()?xe:r==="localstorage+cookie"&&n.O()?n:r==="sessionstorage"&&Oe.O()?Oe:r==="memory"?wS:r==="cookie"?St:n.O()?n:St}properties(){var e={};return he(this.props,function(n,r){if(r===Jn&&Ae(n))for(var s=Object.keys(n),o=0;o<s.length;o++)e["$feature/"+s[o]]=n[s[o]];else a=r,l=!1,(mt(i=mS)?l:Sd&&i.indexOf===Sd?i.indexOf(a)!=-1:(he(i,function(u){if(l||(l=u===a))return ui}),l))||(e[r]=n);var i,a,l}),e}load(){if(!this.Dt){var e=this.B.j(this.At);e&&(this.props=ke({},e))}}save(){this.Dt||this.B.D(this.At,this.props,this.Lt,this.Nt,this.Ut,this.N.debug)}remove(){this.B.L(this.At,!1),this.B.L(this.At,!0)}clear(){this.remove(),this.props={}}register_once(e,n,r){if(Ae(e)){$(n)&&(n="None"),this.Lt=$(r)?this.zt:r;var s=!1;if(he(e,(o,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==n||(this.props[i]=o,s=!0)}),s)return this.save(),!0}return!1}register(e,n){if(Ae(e)){this.Lt=$(n)?this.zt:n;var r=!1;if(he(e,(s,o)=>{e.hasOwnProperty(o)&&this.props[o]!==s&&(this.props[o]=s,r=!0)}),r)return this.save(),!0}return!1}unregister(e){e in this.props&&(delete this.props[e],this.save())}update_campaign_params(){if(!this.Mt){var e=Pg(this.N.custom_campaign_params,this.N.mask_personal_data_properties,this.N.custom_personal_data_properties);Zn(Fc(e))||this.register(e),this.Mt=!0}}update_search_keyword(){var e;this.register((e=L?.referrer)?jg(e):{})}update_referrer_info(){var e;this.register_once({$referrer:Rg(),$referring_domain:L!=null&&L.referrer&&((e=gi(L.referrer))==null?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[Il]||this.props[Ml]||this.register_once({[fi]:Ag(this.N.mask_personal_data_properties,this.N.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};he([Ml,Il],i=>{var a=this.props[i];a&&he(a,function(l,u){e["$initial_"+yl(u)]=l})});var n,r,s=this.props[fi];if(s){var o=(n=Ig(s),r={},he(n,function(i,a){r["$initial_"+yl(a)]=i}),r);ke(e,o)}return e}safe_merge(e){return he(this.props,function(n,r){r in e||(e[r]=n)}),e}update_config(e,n,r){if(this.zt=this.Lt=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!r),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==n.persistence||!((i,a)=>{if(i.length!==a.length)return!1;var l=[...i].sort(),u=[...a].sort();return l.every((d,h)=>d===u[h])})(e.cookie_persisted_properties||[],n.cookie_persisted_properties||[])){var s=this.jt(e),o=this.props;this.clear(),this.B=s,this.props=o,this.save()}}set_disabled(e){this.Dt=e,this.Dt?this.remove():this.save()}set_cross_subdomain(e){e!==this.Nt&&(this.Nt=e,this.remove(),this.save())}set_secure(e){e!==this.Ut&&(this.Ut=e,this.remove(),this.save())}set_event_timer(e,n){var r=this.props[_s]||{};r[e]=n,this.props[_s]=r,this.save()}remove_event_timer(e){var n=(this.props[_s]||{})[e];return $(n)||(delete this.props[_s][e],this.save()),n}get_property(e){return this.props[e]}set_property(e,n){this.props[e]=n,this.save()}}var Yn=function(t){return t.Activation="events",t.Cancellation="cancelEvents",t}({});(function(t){return t.Button="button",t.Tab="tab",t.Selector="selector",t})({});(function(t){return t.TopLeft="top_left",t.TopRight="top_right",t.TopCenter="top_center",t.MiddleLeft="middle_left",t.MiddleRight="middle_right",t.MiddleCenter="middle_center",t.Left="left",t.Center="center",t.Right="right",t.NextToTrigger="next_to_trigger",t})({});(function(t){return t.Top="top",t.Left="left",t.Right="right",t.Bottom="bottom",t})({});var qo=function(t){return t.Popover="popover",t.API="api",t.Widget="widget",t.ExternalSurvey="external_survey",t}({});(function(t){return t.Open="open",t.MultipleChoice="multiple_choice",t.SingleChoice="single_choice",t.Rating="rating",t.Link="link",t})({});(function(t){return t.NextQuestion="next_question",t.End="end",t.ResponseBased="response_based",t.SpecificQuestion="specific_question",t})({});(function(t){return t.Once="once",t.Recurring="recurring",t.Always="always",t})({});var Qn=function(t){return t.SHOWN="survey shown",t.DISMISSED="survey dismissed",t.SENT="survey sent",t.ABANDONED="survey abandoned",t}({}),Yo=function(t){return t.SURVEY_ID="$survey_id",t.SURVEY_NAME="$survey_name",t.SURVEY_RESPONSE="$survey_response",t.SURVEY_ITERATION="$survey_iteration",t.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",t.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",t.SURVEY_SUBMISSION_ID="$survey_submission_id",t.SURVEY_QUESTIONS="$survey_questions",t.SURVEY_COMPLETED="$survey_completed",t.PRODUCT_TOUR_ID="$product_tour_id",t.SURVEY_LAST_SEEN_DATE="$survey_last_seen_date",t}({}),wi=function(t){return t.Popover="popover",t.Inline="inline",t}({}),ue=we("[Surveys]"),Og="seenSurvey_",nT=(t,e)=>{var n="$survey_"+e+"/"+t.id;return t.current_iteration&&t.current_iteration>0&&(n="$survey_"+e+"/"+t.id+"/"+t.current_iteration),n},oh=t=>((e,n)=>{var r=""+e+n.id;return n.current_iteration&&n.current_iteration>0&&(r=""+e+n.id+"_"+n.current_iteration),r})(Og,t),rT=[qo.Popover,qo.Widget,qo.API],sT={ignoreConditions:!1,ignoreDelay:!1,displayType:wi.Popover};class Bc{constructor(){this.Ht={},this.Ht={}}on(e,n){return this.Ht[e]||(this.Ht[e]=[]),this.Ht[e].push(n),()=>{this.Ht[e]=this.Ht[e].filter(r=>r!==n)}}emit(e,n){for(var r of this.Ht[e]||[])r(n);for(var s of this.Ht["*"]||[])s(e,n)}}function Un(t,e,n){if(re(t))return!1;switch(n){case"exact":return t===e;case"contains":var r=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(r,"i").test(t);case"regex":try{return new RegExp(e).test(t)}catch{return!1}default:return!1}}class oT{constructor(e){this.Bt=new Bc,this.qt=(n,r)=>this.Wt(n,r)&&this.Gt(n,r)&&this.Vt(n,r)&&this.Jt(n,r),this.Wt=(n,r)=>r==null||!r.event||n?.event===r?.event,this._instance=e,this.Kt=new Set,this.Yt=new Set}init(){var e;if(!$((e=this._instance)==null?void 0:e._addCaptureHook)){var n;(n=this._instance)==null||n._addCaptureHook((r,s)=>{this.on(r,s)})}}register(e){var n,r;if(!$((n=this._instance)==null?void 0:n._addCaptureHook)&&(e.forEach(i=>{var a,l;(a=this.Yt)==null||a.add(i),(l=i.steps)==null||l.forEach(u=>{var d;(d=this.Kt)==null||d.add(u?.event||"")})}),(r=this._instance)!=null&&r.autocapture)){var s,o=new Set;e.forEach(i=>{var a;(a=i.steps)==null||a.forEach(l=>{l!=null&&l.selector&&o.add(l?.selector)})}),(s=this._instance)==null||s.autocapture.setElementSelectors(o)}}on(e,n){var r;n!=null&&e.length!=0&&(this.Kt.has(e)||this.Kt.has(n?.event))&&this.Yt&&((r=this.Yt)==null?void 0:r.size)>0&&this.Yt.forEach(s=>{this.Xt(n,s)&&this.Bt.emit("actionCaptured",s.name)})}Qt(e){this.onAction("actionCaptured",n=>e(n))}Xt(e,n){if(n?.steps==null)return!1;for(var r of n.steps)if(this.qt(e,r))return!0;return!1}onAction(e,n){return this.Bt.on(e,n)}Gt(e,n){if(n!=null&&n.url){var r,s=e==null||(r=e.properties)==null?void 0:r.$current_url;if(!s||typeof s!="string"||!Un(s,n.url,n.url_matching||"contains"))return!1}return!0}Vt(e,n){return!!this.Zt(e,n)&&!!this.ti(e,n)&&!!this.ii(e,n)}Zt(e,n){var r;if(n==null||!n.href)return!0;var s=this.ei(e);if(s.length>0)return s.some(a=>Un(a.href,n.href,n.href_matching||"exact"));var o,i=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";return!!i&&Un((o=i.match(/(?::|")href="(.*?)"/))?o[1]:"",n.href,n.href_matching||"exact")}ti(e,n){var r;if(n==null||!n.text)return!0;var s=this.ei(e);if(s.length>0)return s.some(u=>Un(u.text,n.text,n.text_matching||"exact")||Un(u.$el_text,n.text,n.text_matching||"exact"));var o,i,a,l=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";return!!l&&(o=function(u){for(var d,h=[],f=/(?::|")text="(.*?)"/g;!re(d=f.exec(u));)h.includes(d[1])||h.push(d[1]);return h}(l),i=n.text,a=n.text_matching||"exact",o.some(u=>Un(u,i,a)))}ii(e,n){var r,s;if(n==null||!n.selector)return!0;var o=e==null||(r=e.properties)==null?void 0:r.$element_selectors;if(o!=null&&o.includes(n.selector))return!0;var i=(e==null||(s=e.properties)==null?void 0:s.$elements_chain)||"";if(n.selector_regex&&i)try{return new RegExp(n.selector_regex).test(i)}catch{return!1}return!1}ei(e){var n;return(e==null||(n=e.properties)==null?void 0:n.$elements)==null?[]:e?.properties.$elements}Jt(e,n){return n==null||!n.properties||n.properties.length===0||kg(n.properties.reduce((r,s)=>{var o=ae(s.value)?s.value.map(String):s.value!=null?[String(s.value)]:[];return r[s.key]={values:o,operator:s.operator||"exact"},r},{}),e?.properties)}}class iT{constructor(e){this._instance=e,this.ri=new Map,this.si=new Map,this.ni=new Map}oi(e,n){return!!e&&kg(e.propertyFilters,n?.properties)}ai(e,n){var r=new Map;return e.forEach(s=>{var o;(o=s.conditions)==null||(o=o[n])==null||(o=o.values)==null||o.forEach(i=>{if(i!=null&&i.name){var a=r.get(i.name)||[];a.push(s.id),r.set(i.name,a)}})}),r}li(e,n,r){var s=(r===Yn.Activation?this.ri:this.si).get(e),o=[];return this.ui(i=>{o=i.filter(a=>s?.includes(a.id))}),o.filter(i=>{var a,l=(a=i.conditions)==null||(a=a[r])==null||(a=a.values)==null?void 0:a.find(u=>u.name===e);return this.oi(l,n)})}register(e){var n;$((n=this._instance)==null?void 0:n._addCaptureHook)||(this.hi(e),this.di(e))}di(e){var n=e.filter(r=>{var s,o;return((s=r.conditions)==null?void 0:s.actions)&&((o=r.conditions)==null||(o=o.actions)==null||(o=o.values)==null?void 0:o.length)>0});n.length!==0&&(this.vi==null&&(this.vi=new oT(this._instance),this.vi.init(),this.vi.Qt(r=>{this.onAction(r)})),n.forEach(r=>{var s,o,i,a,l;r.conditions&&(s=r.conditions)!=null&&s.actions&&(o=r.conditions)!=null&&(o=o.actions)!=null&&o.values&&((i=r.conditions)==null||(i=i.actions)==null||(i=i.values)==null?void 0:i.length)>0&&((a=this.vi)==null||a.register(r.conditions.actions.values),(l=r.conditions)==null||(l=l.actions)==null||(l=l.values)==null||l.forEach(u=>{if(u&&u.name){var d=this.ni.get(u.name);d&&d.push(r.id),this.ni.set(u.name,d||[r.id])}}))}))}hi(e){var n,r=e.filter(o=>{var i,a;return((i=o.conditions)==null?void 0:i.events)&&((a=o.conditions)==null||(a=a.events)==null||(a=a.values)==null?void 0:a.length)>0}),s=e.filter(o=>{var i,a;return((i=o.conditions)==null?void 0:i.cancelEvents)&&((a=o.conditions)==null||(a=a.cancelEvents)==null||(a=a.values)==null?void 0:a.length)>0});(r.length!==0||s.length!==0)&&((n=this._instance)==null||n._addCaptureHook((o,i)=>{this.onEvent(o,i)}),this.ri=this.ai(e,Yn.Activation),this.si=this.ai(e,Yn.Cancellation))}onEvent(e,n){var r,s=this.ci(),o=this.fi(),i=this.pi(),a=((r=this._instance)==null||(r=r.persistence)==null?void 0:r.props[o])||[];if(i===e&&n&&a.length>0){var l,u;s.info("event matched, removing item from activated items",{event:e,eventPayload:n,existingActivatedItems:a});var d=(n==null||(l=n.properties)==null?void 0:l.$survey_id)||(n==null||(u=n.properties)==null?void 0:u.$product_tour_id);if(d){var h=a.indexOf(d);h>=0&&(a.splice(h,1),this.gi(a))}}else{if(this.si.has(e)){var f=this.li(e,n,Yn.Cancellation);f.length>0&&(s.info("cancel event matched, cancelling items",{event:e,itemsToCancel:f.map(v=>v.id)}),f.forEach(v=>{var g=a.indexOf(v.id);g>=0&&a.splice(g,1),this.mi(v.id)}),this.gi(a))}if(this.ri.has(e)){s.info("event name matched",{event:e,eventPayload:n,items:this.ri.get(e)});var m=this.li(e,n,Yn.Activation);this.gi(a.concat(m.map(v=>v.id)||[]))}}}onAction(e){var n,r=this.fi(),s=((n=this._instance)==null||(n=n.persistence)==null?void 0:n.props[r])||[];this.ni.has(e)&&this.gi(s.concat(this.ni.get(e)||[]))}gi(e){var n,r=this.ci(),s=this.fi(),o=[...new Set(e)].filter(i=>!this.bi(i));r.info("updating activated items",{activatedItems:o}),(n=this._instance)==null||(n=n.persistence)==null||n.register({[s]:o})}getActivatedIds(){var e,n=this.fi(),r=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[n];return r||[]}getEventToItemsMap(){return this.ri}yi(){return this.vi}}class aT extends iT{constructor(e){super(e)}fi(){return"$surveys_activated"}pi(){return Qn.SHOWN}ui(e){var n;(n=this._instance)==null||n.getSurveys(e)}mi(e){var n;(n=this._instance)==null||n.cancelPendingSurvey(e)}ci(){return ue}bi(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}class lT{constructor(e){this.wi=void 0,this._surveyManager=null,this.xi=!1,this.$i=[],this.Ei=null,this._instance=e,this._surveyEventReceiver=null}onRemoteConfig(e){if(!this._instance.config.disable_surveys){var n=e.surveys;if(re(n))return ue.warn("Flags not loaded yet. Not loading surveys.");var r=ae(n);this.wi=r?n.length>0:n,ue.info("flags response received, isSurveysEnabled: "+this.wi),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],n=0;n<localStorage.length;n++){var r=localStorage.key(n);(r!=null&&r.startsWith(Og)||r!=null&&r.startsWith("inProgressSurvey_"))&&e.push(r)}e.forEach(s=>localStorage.removeItem(s))}loadIfEnabled(){if(!this._surveyManager)if(this.xi)ue.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)ue.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())ue.info("Not loading surveys in cookieless mode without consent.");else{var e=G?.__PosthogExtensions__;if(e){if(!$(this.wi)||this._instance.config.advanced_enable_surveys){var n=this.wi||this._instance.config.advanced_enable_surveys;this.xi=!0;try{var r=e.generateSurveys;if(r)return void this.Si(r,n);var s=e.loadExternalDependency;if(!s)return void this.ki("PostHog loadExternalDependency extension not found.");s(this._instance,"surveys",o=>{o||!e.generateSurveys?this.ki("Could not load surveys script",o):this.Si(e.generateSurveys,n)})}catch(o){throw this.ki("Error initializing surveys",o),o}finally{this.xi=!1}}}else ue.error("PostHog Extensions not found.")}}Si(e,n){this._surveyManager=e(this._instance,n),this._surveyEventReceiver=new aT(this._instance),ue.info("Surveys loaded successfully"),this.Pi({isLoaded:!0})}ki(e,n){ue.error(e,n),this.Pi({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.$i.push(e),this._surveyManager&&this.Pi({isLoaded:!0}),()=>{this.$i=this.$i.filter(n=>n!==e)}}getSurveys(e,n){if(n===void 0&&(n=!1),this._instance.config.disable_surveys)return ue.info("Disabled. Not loading surveys."),e([]);var r,s=this._instance.get_property(Cl);if(s&&!n)return e(s,{isLoaded:!0});typeof Promise<"u"&&this.Ei?this.Ei.then(o=>{var{surveys:i,context:a}=o;return e(i,a)}):(typeof Promise<"u"&&(this.Ei=new Promise(o=>{r=o})),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:o=>{var i;this.Ei=null;var a=o.statusCode;if(a!==200||!o.json){var l="Surveys API could not be loaded, status: "+a;ue.error(l);var u={isLoaded:!1,error:l};return e([],u),void(r==null||r({surveys:[],context:u}))}var d,h=o.json.surveys||[],f=h.filter(v=>function(g){return!(!g.start_date||g.end_date)}(v)&&(function(g){var y;return!((y=g.conditions)==null||(y=y.events)==null||(y=y.values)==null||!y.length)}(v)||function(g){var y;return!((y=g.conditions)==null||(y=y.actions)==null||(y=y.values)==null||!y.length)}(v)));f.length>0&&((d=this._surveyEventReceiver)==null||d.register(f)),(i=this._instance.persistence)==null||i.register({[Cl]:h});var m={isLoaded:!0};e(h,m),r?.({surveys:h,context:m})}}))}Pi(e){for(var n of this.$i)try{if(!e.isLoaded)return n([],e);this.getSurveys(n)}catch(r){ue.error("Error in survey callback",r)}}getActiveMatchingSurveys(e,n){if(n===void 0&&(n=!1),!re(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,n);ue.warn("init was not called")}Ti(e){var n=null;return this.getSurveys(r=>{var s;n=(s=r.find(o=>o.id===e))!==null&&s!==void 0?s:null}),n}Ii(e){if(re(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var n=typeof e=="string"?this.Ti(e):e;return n?this._surveyManager.checkSurveyEligibility(n):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(re(this._surveyManager))return ue.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var n=this.Ii(e);return{visible:n.eligible,disabledReason:n.reason}}canRenderSurveyAsync(e,n){return re(this._surveyManager)?(ue.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise(r=>{this.getSurveys(s=>{var o,i=(o=s.find(l=>l.id===e))!==null&&o!==void 0?o:null;if(i){var a=this.Ii(i);r({visible:a.eligible,disabledReason:a.reason})}else r({visible:!1,disabledReason:"Survey not found"})},n)})}renderSurvey(e,n,r){var s;if(re(this._surveyManager))ue.warn("init was not called");else{var o=typeof e=="string"?this.Ti(e):e;if(o!=null&&o.id)if(rT.includes(o.type)){var i=L?.querySelector(n);if(i)return(s=o.appearance)!=null&&s.surveyPopupDelaySeconds?(ue.info("Rendering survey "+o.id+" with delay of "+o.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout(()=>{var a,l;ue.info("Rendering survey "+o.id+" with delay of "+((a=o.appearance)==null?void 0:a.surveyPopupDelaySeconds)+" seconds"),(l=this._surveyManager)==null||l.renderSurvey(o,i,r),ue.info("Survey "+o.id+" rendered")},1e3*o.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(o,i,r);ue.warn("Survey element not found")}else ue.warn("Surveys of type "+o.type+" cannot be rendered in the app");else ue.warn("Survey not found")}}displaySurvey(e,n){var r;if(re(this._surveyManager))ue.warn("init was not called");else{var s=this.Ti(e);if(s){var o=s;if((r=s.appearance)!=null&&r.surveyPopupDelaySeconds&&n.ignoreDelay&&(o=F({},s,{appearance:F({},s.appearance,{surveyPopupDelaySeconds:0})})),n.displayType!==wi.Popover&&n.initialResponses&&ue.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),n.ignoreConditions===!1){var i=this.canRenderSurvey(s);if(!i.visible)return void ue.warn("Survey is not eligible to be displayed: ",i.disabledReason)}n.displayType!==wi.Inline?this._surveyManager.handlePopoverSurvey(o,n):this.renderSurvey(o,n.selector,n.properties)}else ue.warn("Survey not found")}}cancelPendingSurvey(e){re(this._surveyManager)?ue.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;(e=this._surveyManager)==null||e.handlePageUnload()}}var tt=we("[Conversations]");class cT{constructor(e){this.Ci=void 0,this._conversationsManager=null,this.Ri=!1,this.Fi=null,this._instance=e}onRemoteConfig(e){if(!this._instance.config.disable_conversations){var n=e.conversations;re(n)||(qt(n)?this.Ci=n:(this.Ci=n.enabled,this.Fi=n),this.loadIfEnabled())}}reset(){var e;(e=this._conversationsManager)==null||e.reset(),this._conversationsManager=null,this.Ci=void 0,this.Fi=null}loadIfEnabled(){if(!(this._conversationsManager||this.Ri||this._instance.config.disable_conversations||hg(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=G?.__PosthogExtensions__;if(e&&!$(this.Ci)&&this.Ci)if(this.Fi&&this.Fi.token){this.Ri=!0;try{var n=e.initConversations;if(n)return this.Oi(n),void(this.Ri=!1);var r=e.loadExternalDependency;if(!r)return void this.Mi("PostHog loadExternalDependency extension not found.");r(this._instance,"conversations",s=>{s||!e.initConversations?this.Mi("Could not load conversations script",s):this.Oi(e.initConversations),this.Ri=!1})}catch(s){this.Mi("Error initializing conversations",s),this.Ri=!1}}else tt.error("Conversations enabled but missing token in remote config.")}}Oi(e){if(this.Fi)try{this._conversationsManager=e(this.Fi,this._instance),tt.info("Conversations loaded successfully")}catch(n){this.Mi("Error completing conversations initialization",n)}else tt.error("Cannot complete initialization: remote config is null")}Mi(e,n){tt.error(e,n),this._conversationsManager=null,this.Ri=!1}show(){this._conversationsManager?this._conversationsManager.show():tt.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.Ci===!0&&!mt(this._conversationsManager)}isVisible(){var e,n;return(e=(n=this._conversationsManager)==null?void 0:n.isVisible())!==null&&e!==void 0&&e}sendMessage(e,n,r){var s=this;return Ht(function*(){return s._conversationsManager?s._conversationsManager.sendMessage(e,n,r):(tt.warn("Conversations not available yet."),null)})()}getMessages(e,n){var r=this;return Ht(function*(){return r._conversationsManager?r._conversationsManager.getMessages(e,n):(tt.warn("Conversations not available yet."),null)})()}markAsRead(e){var n=this;return Ht(function*(){return n._conversationsManager?n._conversationsManager.markAsRead(e):(tt.warn("Conversations not available yet."),null)})()}getTickets(e){var n=this;return Ht(function*(){return n._conversationsManager?n._conversationsManager.getTickets(e):(tt.warn("Conversations not available yet."),null)})()}requestRestoreLink(e){var n=this;return Ht(function*(){return n._conversationsManager?n._conversationsManager.requestRestoreLink(e):(tt.warn("Conversations not available yet."),null)})()}restoreFromToken(e){var n=this;return Ht(function*(){return n._conversationsManager?n._conversationsManager.restoreFromToken(e):(tt.warn("Conversations not available yet."),null)})()}restoreFromUrlToken(){var e=this;return Ht(function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(tt.warn("Conversations not available yet."),null)})()}getCurrentTicketId(){var e,n;return(e=(n=this._conversationsManager)==null?void 0:n.getCurrentTicketId())!==null&&e!==void 0?e:null}getWidgetSessionId(){var e,n;return(e=(n=this._conversationsManager)==null?void 0:n.getWidgetSessionId())!==null&&e!==void 0?e:null}}class uT{constructor(e){var n;this.Ai=!1,this.ji=!1,this._instance=e,this._instance&&(n=this._instance.config.logs)!=null&&n.captureConsoleLogs&&(this.Ai=!0)}onRemoteConfig(e){var n,r=(n=e.logs)==null?void 0:n.captureConsoleLogs;!re(r)&&r&&(this.Ai=!0,this.loadIfEnabled())}reset(){}loadIfEnabled(){if(this.Ai&&!this.ji){var e=we("[logs]"),n=G?.__PosthogExtensions__;if(n){var r=n.loadExternalDependency;r?r(this._instance,"logs",s=>{var o;s||(o=n.logs)==null||!o.initializeLogs?e.error("Could not load logs script",s):(n.logs.initializeLogs(this._instance),this.ji=!0)}):e.error("PostHog loadExternalDependency extension not found.")}else e.error("PostHog Extensions not found.")}}}var ih=we("[RateLimiter]");class dT{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=n=>{var r=n.text;if(r&&r.length)try{(JSON.parse(r).quota_limited||[]).forEach(s=>{ih.info((s||"events")+" is quota limited."),this.serverLimits[s]=new Date().getTime()+6e4})}catch(s){return void ih.warn('could not rate limit - continuing. Error: "'+s?.message+'"',{text:r})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return((e=this.instance.config.rate_limiting)==null?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max(((e=this.instance.config.rate_limiting)==null?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){var n,r,s;e===void 0&&(e=!1);var{captureEventsBurstLimit:o,captureEventsPerSecond:i}=this,a=new Date().getTime(),l=(n=(r=this.instance.persistence)==null?void 0:r.get_property(Al))!==null&&n!==void 0?n:{tokens:o,last:a};l.tokens+=(a-l.last)/1e3*i,l.last=a,l.tokens>o&&(l.tokens=o);var u=l.tokens<1;return u||e||(l.tokens=Math.max(0,l.tokens-1)),!u||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+i+" events per second and "+o+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=u,(s=this.instance.persistence)==null||s.set_property(Al,l),{isRateLimited:u,remainingTokens:l.tokens}}isServerRateLimited(e){var n=this.serverLimits[e||"events"]||!1;return n!==!1&&new Date().getTime()<n}}var Br=we("[RemoteConfig]");class Dg{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=G._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}Di(e){var n,r;(n=G.__PosthogExtensions__)!=null&&n.loadExternalDependency?(r=G.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"remote-config",()=>e(this.remoteConfig)):e()}Li(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:n=>{e(n.json)}})}load(){try{if(this.remoteConfig)return Br.info("Using preloaded remote config",this.remoteConfig),this.Ni(this.remoteConfig),void this.Ui();if(this._instance.Rt())return void Br.warn("Remote config is disabled. Falling back to local config.");this.Di(e=>{if(!e)return Br.info("No config found after loading remote JS config. Falling back to JSON."),void this.Li(n=>{this.Ni(n),this.Ui()});this.Ni(e),this.Ui()})}catch(e){Br.error("Error loading remote config",e)}}stop(){this.zi&&(clearInterval(this.zi),this.zi=void 0)}refresh(){this._instance.Rt()||L?.visibilityState==="hidden"||this._instance.featureFlags.reloadFeatureFlags()}Ui(){this.zi||(this.zi=setInterval(()=>{this.refresh()},3e5))}Ni(e){e||Br.error("Failed to fetch remote config from PostHog."),this._instance.Ni(e??{}),e?.hasFeatureFlags!==!1&&(this._instance.config.advanced_disable_feature_flags_on_first_load||this._instance.featureFlags.ensureFlagsLoaded())}}var Ll=3e3;class hT{constructor(e,n){this.Hi=!0,this.Bi=[],this.qi=Ct(n?.flush_interval_ms||Ll,250,5e3,V.createLogger("flush interval"),Ll),this.Wi=e}enqueue(e){this.Bi.push(e),this.Gi||this.Vi()}unload(){this.Ji();var e=this.Bi.length>0?this.Ki():{},n=Object.values(e);[...n.filter(r=>r.url.indexOf("/e")===0),...n.filter(r=>r.url.indexOf("/e")!==0)].map(r=>{this.Wi(F({},r,{transport:"sendBeacon"}))})}enable(){this.Hi=!1,this.Vi()}Vi(){var e=this;this.Hi||(this.Gi=setTimeout(()=>{if(this.Ji(),this.Bi.length>0){var n=this.Ki(),r=function(){var o=n[s],i=new Date().getTime();o.data&&ae(o.data)&&he(o.data,a=>{a.offset=Math.abs(a.timestamp-i),delete a.timestamp}),e.Wi(o)};for(var s in n)r()}},this.qi))}Ji(){clearTimeout(this.Gi),this.Gi=void 0}Ki(){var e={};return he(this.Bi,n=>{var r,s=n,o=(s?s.batchKey:null)||s.url;$(e[o])&&(e[o]=F({},s,{data:[]})),(r=e[o].data)==null||r.push(s.data)}),this.Bi=[],e}}var fT=["retriesPerformedSoFar"];class pT{constructor(e){this.Yi=!1,this.Xi=3e3,this.Bi=[],this._instance=e,this.Bi=[],this.Qi=!0,!$(j)&&"onLine"in j.navigator&&(this.Qi=j.navigator.onLine,this.Zi=()=>{this.Qi=!0,this.te()},this.ie=()=>{this.Qi=!1},Ce(j,"online",this.Zi),Ce(j,"offline",this.ie))}get length(){return this.Bi.length}retriableRequest(e){var{retriesPerformedSoFar:n}=e,r=zm(e,fT);qn(n)&&(r.url=xi(r.url,{retry_count:n})),this._instance._send_request(F({},r,{callback:s=>{s.statusCode!==200&&(s.statusCode<400||s.statusCode>=500)&&(n??0)<10?this.ee(F({retriesPerformedSoFar:n},r)):r.callback==null||r.callback(s)}}))}ee(e){var n=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=n+1;var r=function(i){var a=3e3*Math.pow(2,i),l=a/2,u=Math.min(18e5,a),d=(Math.random()-.5)*(u-l);return Math.ceil(u+d)}(n),s=Date.now()+r;this.Bi.push({retryAt:s,requestOptions:e});var o="Enqueued failed request for retry in "+r;navigator.onLine||(o+=" (Browser is offline)"),V.warn(o),this.Yi||(this.Yi=!0,this.re())}re(){if(this.se&&clearTimeout(this.se),this.Bi.length===0)return this.Yi=!1,void(this.se=void 0);this.se=setTimeout(()=>{this.Qi&&this.Bi.length>0&&this.te(),this.re()},this.Xi)}te(){var e=Date.now(),n=[],r=this.Bi.filter(o=>o.retryAt<e||(n.push(o),!1));if(this.Bi=n,r.length>0)for(var{requestOptions:s}of r)this.retriableRequest(s)}unload(){for(var{requestOptions:e}of(this.se&&(clearTimeout(this.se),this.se=void 0),this.Yi=!1,$(j)||(this.Zi&&(j.removeEventListener("online",this.Zi),this.Zi=void 0),this.ie&&(j.removeEventListener("offline",this.ie),this.ie=void 0)),this.Bi))try{this._instance._send_request(F({},e,{transport:"sendBeacon"}))}catch(n){V.error(n)}this.Bi=[]}}class mT{constructor(e){this.ne=()=>{var n,r,s,o;this.oe||(this.oe={});var i=this.scrollElement(),a=this.scrollY(),l=i?Math.max(0,i.scrollHeight-i.clientHeight):0,u=a+(i?.clientHeight||0),d=i?.scrollHeight||0;this.oe.lastScrollY=Math.ceil(a),this.oe.maxScrollY=Math.max(a,(n=this.oe.maxScrollY)!==null&&n!==void 0?n:0),this.oe.maxScrollHeight=Math.max(l,(r=this.oe.maxScrollHeight)!==null&&r!==void 0?r:0),this.oe.lastContentY=u,this.oe.maxContentY=Math.max(u,(s=this.oe.maxContentY)!==null&&s!==void 0?s:0),this.oe.maxContentHeight=Math.max(d,(o=this.oe.maxContentHeight)!==null&&o!==void 0?o:0)},this._instance=e}getContext(){return this.oe}resetContext(){var e=this.oe;return setTimeout(this.ne,0),e}startMeasuringScrollPosition(){Ce(j,"scroll",this.ne,{capture:!0}),Ce(j,"scrollend",this.ne,{capture:!0}),Ce(j,"resize",this.ne)}scrollElement(){if(!this._instance.config.scroll_root_selector)return j?.document.documentElement;var e=ae(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var n of e){var r=j?.document.querySelector(n);if(r)return r}}scrollY(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return j&&(j.scrollY||j.pageYOffset||j.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return j&&(j.scrollX||j.pageXOffset||j.document.documentElement.scrollLeft)||0}}var gT=t=>Ag(t?.config.mask_personal_data_properties,t?.config.custom_personal_data_properties);class ah{constructor(e,n,r,s){this.ae=o=>{var i=this.le();if(!i||i.sessionId!==o){var a={sessionId:o,props:this.ue(this._instance)};this.he.register({[Rl]:a})}},this._instance=e,this.de=n,this.he=r,this.ue=s||gT,this.de.onSessionId(this.ae)}le(){return this.he.props[Rl]}getSetOnceProps(){var e,n=(e=this.le())==null?void 0:e.props;return n?"r"in n?Ig(n):{$referring_domain:n.referringDomain,$pathname:n.initialPathName,utm_source:n.utm_source,utm_campaign:n.utm_campaign,utm_medium:n.utm_medium,utm_content:n.utm_content,utm_term:n.utm_term}:{}}getSessionProps(){var e={};return he(Fc(this.getSetOnceProps()),(n,r)=>{r==="$current_url"&&(r="url"),e["$session_entry_"+yl(r)]=n}),e}}var ka=we("[SessionId]");class lh{on(e,n){return this.ve.on(e,n)}constructor(e,n,r){var s;if(this.ce=[],this.fe=void 0,this.ve=new Bc,this.pe=(d,h)=>!(!qn(d)||!qn(h))&&Math.abs(d-h)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode==="always")throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.N=e.config,this.he=e.persistence,this._e=void 0,this.ge=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.me=n||cn,this.be=r||cn;var o=this.N.persistence_name||this.N.token,i=this.N.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*Ct(i,60,36e3,ka.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.ye(),this.we="ph_"+o+"_window_id",this.xe="ph_"+o+"_primary_window_exists",this.$e()){var a=Oe.j(this.we),l=Oe.j(this.xe);a&&!l?this._e=a:Oe.L(this.we),Oe.D(this.xe,!0)}if((s=this.N.bootstrap)!=null&&s.sessionID)try{var u=(d=>{var h=d.replace(/-/g,"");if(h.length!==32)throw new Error("Not a valid UUID");if(h[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(h.substring(0,12),16)})(this.N.bootstrap.sessionID);this.Ee(this.N.bootstrap.sessionID,new Date().getTime(),u)}catch(d){ka.error("Invalid sessionID in bootstrap",d)}this.Se()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return $(this.ce)&&(this.ce=[]),this.ce.push(e),this.ge&&e(this.ge,this._e),()=>{this.ce=this.ce.filter(n=>n!==e)}}$e(){return this.N.persistence!=="memory"&&!this.he.Dt&&Oe.O()}ke(e){e!==this._e&&(this._e=e,this.$e()&&Oe.D(this.we,e))}Pe(){return this._e?this._e:this.$e()?Oe.j(this.we):null}Ee(e,n,r){e===this.ge&&n===this._sessionActivityTimestamp&&r===this._sessionStartTimestamp||(this._sessionStartTimestamp=r,this._sessionActivityTimestamp=n,this.ge=e,this.he.register({[di]:[n,e,r]}))}Te(){var e=this.he.props[di];return ae(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Ee(null,null,null)}destroy(){clearTimeout(this.Ie),this.Ie=void 0,this.fe&&j&&(j.removeEventListener("beforeunload",this.fe,{capture:!1}),this.fe=void 0),this.ce=[]}Se(){this.fe=()=>{this.$e()&&Oe.L(this.xe)},Ce(j,"beforeunload",this.fe,{capture:!1})}checkAndGetSessionAndWindowId(e,n){if(e===void 0&&(e=!1),n===void 0&&(n=null),this.N.cookieless_mode==="always")throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=n||new Date().getTime(),[s,o,i]=this.Te(),a=this.Pe(),l=qn(i)&&Math.abs(r-i)>864e5,u=!1,d=!o,h=!d&&!e&&this.pe(r,s);d||h||l?(o=this.me(),a=this.be(),ka.info("new session ID generated",{sessionId:o,windowId:a,changeReason:{noSessionId:d,activityTimeout:h,sessionPastMaximumLength:l}}),i=r,u=!0):a||(a=this.be(),u=!0);var f=qn(s)&&e&&!l?s:r,m=qn(i)?i:new Date().getTime();return this.ke(a),this.Ee(o,f,m),e||this.ye(),u&&this.ce.forEach(v=>v(o,a,u?{noSessionId:d,activityTimeout:h,sessionPastMaximumLength:l}:void 0)),{sessionId:o,windowId:a,sessionStartTimestamp:m,changeReason:u?{noSessionId:d,activityTimeout:h,sessionPastMaximumLength:l}:void 0,lastActivityTimestamp:s}}ye(){clearTimeout(this.Ie),this.Ie=setTimeout(()=>{var[e]=this.Te();if(this.pe(new Date().getTime(),e)){var n=this.ge;this.resetSessionId(),this.ve.emit("forcedIdleReset",{idleSessionId:n})}},1.1*this.sessionTimeoutMs)}}var Ng=function(t,e){if(!t)return!1;var n=t.userAgent;if(n&&Pd(n,e))return!0;try{var r=t?.userAgentData;if(r!=null&&r.brands&&r.brands.some(s=>Pd(s?.brand,e)))return!0}catch{}return!!t.webdriver},Es=function(t){return t.US="us",t.EU="eu",t.CUSTOM="custom",t}({}),ch="i.posthog.com";class vT{constructor(e){this.Ce={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return e==="https://app.posthog.com"?"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,n=(e=this.instance.config.ui_host)==null?void 0:e.replace(/\/$/,"");return n||(n=this.apiHost.replace("."+ch,".posthog.com")),n==="https://app.posthog.com"?"https://us.posthog.com":n}get region(){return this.Ce[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.Ce[this.apiHost]=Es.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.Ce[this.apiHost]=Es.EU:this.Ce[this.apiHost]=Es.CUSTOM),this.Ce[this.apiHost]}endpointFor(e,n){if(n===void 0&&(n=""),n&&(n=n[0]==="/"?n:"/"+n),e==="ui")return this.uiHost+n;if(e==="flags")return this.flagsApiHost+n;if(this.region===Es.CUSTOM)return this.apiHost+n;var r=ch+n;switch(e){case"assets":return"https://"+this.region+"-assets."+r;case"api":return"https://"+this.region+"."+r}}}var yT={icontains:(t,e)=>!!j&&e.href.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>!!j&&e.href.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,e)=>!!j&&bi(e.href,t),not_regex:(t,e)=>!!j&&!bi(e.href,t),exact:(t,e)=>e.href===t,is_not:(t,e)=>e.href!==t};class Fe{constructor(e){var n=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(r){r===void 0&&(r=!1),n.getWebExperiments(s=>{Fe.Re("retrieved web experiments from the server"),n.Fe=new Map,s.forEach(o=>{if(o.feature_flag_key){var i;n.Fe&&(Fe.Re("setting flag key ",o.feature_flag_key," to web experiment ",o),(i=n.Fe)==null||i.set(o.feature_flag_key,o));var a=n._instance.getFeatureFlag(o.feature_flag_key);je(a)&&o.variants[a]&&n.Oe(o.name,a,o.variants[a].transforms)}else if(o.variants)for(var l in o.variants){var u=o.variants[l];Fe.Me(u)&&n.Oe(o.name,l,u.transforms)}})},r)},this._instance=e,this._instance.onFeatureFlags(r=>{this.onFeatureFlags(r)})}onFeatureFlags(e){if(this._is_bot())Fe.Re("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(re(this.Fe))return this.Fe=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Fe.Re("applying feature flags",e),e.forEach(n=>{var r;if(this.Fe&&(r=this.Fe)!=null&&r.has(n)){var s,o=this._instance.getFeatureFlag(n),i=(s=this.Fe)==null?void 0:s.get(n);o&&i!=null&&i.variants[o]&&this.Oe(i.name,o,i.variants[o].transforms)}})}}previewWebExperiment(){var e=Fe.getWindowLocation();if(e!=null&&e.search){var n=vi(e?.search,"__experiment_id"),r=vi(e?.search,"__experiment_variant");n&&r&&(Fe.Re("previewing web experiments "+n+" && "+r),this.getWebExperiments(s=>{this.Ae(parseInt(n),r,s)},!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,n,r){if(this._instance.config.disable_web_experiments&&!r)return e([]);var s=this._instance.get_property("$web_experiments");if(s&&!n)return e(s);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:o=>{if(o.statusCode!==200||!o.json)return e([]);var i=o.json.experiments||[];return e(i)}})}Ae(e,n,r){var s=r.filter(o=>o.id===e);s&&s.length>0&&(Fe.Re("Previewing web experiment ["+s[0].name+"] with variant ["+n+"]"),this.Oe(s[0].name,n,s[0].variants[n].transforms))}static Me(e){return!re(e.conditions)&&Fe.je(e)&&Fe.De(e)}static je(e){var n;if(re(e.conditions)||re((n=e.conditions)==null?void 0:n.url))return!0;var r,s,o,i=Fe.getWindowLocation();return!!i&&((r=e.conditions)==null||!r.url||yT[(s=(o=e.conditions)==null?void 0:o.urlMatchType)!==null&&s!==void 0?s:"icontains"](e.conditions.url,i))}static getWindowLocation(){return j?.location}static De(e){var n;if(re(e.conditions)||re((n=e.conditions)==null?void 0:n.utm))return!0;var r=Pg();if(r.utm_source){var s,o,i,a,l,u,d,h,f=(s=e.conditions)==null||(s=s.utm)==null||!s.utm_campaign||((o=e.conditions)==null||(o=o.utm)==null?void 0:o.utm_campaign)==r.utm_campaign,m=(i=e.conditions)==null||(i=i.utm)==null||!i.utm_source||((a=e.conditions)==null||(a=a.utm)==null?void 0:a.utm_source)==r.utm_source,v=(l=e.conditions)==null||(l=l.utm)==null||!l.utm_medium||((u=e.conditions)==null||(u=u.utm)==null?void 0:u.utm_medium)==r.utm_medium,g=(d=e.conditions)==null||(d=d.utm)==null||!d.utm_term||((h=e.conditions)==null||(h=h.utm)==null?void 0:h.utm_term)==r.utm_term;return f&&v&&g&&m}return!1}static Re(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];V.info("[WebExperiments] "+e,r)}Oe(e,n,r){this._is_bot()?Fe.Re("Refusing to render web experiment since the viewer is a likely bot"):n!=="control"?r.forEach(s=>{if(s.selector){var o;Fe.Re("applying transform of variant "+n+" for experiment "+e+" ",s);var i=(o=document)==null?void 0:o.querySelectorAll(s.selector);i?.forEach(a=>{var l=a;s.html&&(l.innerHTML=s.html),s.css&&l.setAttribute("style",s.css)})}}):Fe.Re("Control variants leave the page unmodified.")}_is_bot(){return Je&&this._instance?Ng(Je,this._instance.config.custom_blocked_useragents):void 0}}var _T=we("[PostHog ExternalIntegrations]"),xT={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class bT{constructor(e){this._instance=e}V(e,n){var r;(r=G.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,e,s=>{if(s)return _T.error("failed to load script",s);n()})}startIfEnabledOrStop(){var e=this,n=function(i){var a,l,u;!s||(a=G.__PosthogExtensions__)!=null&&(a=a.integrations)!=null&&a[i]||e.V(xT[i],()=>{var d;(d=G.__PosthogExtensions__)==null||(d=d.integrations)==null||(d=d[i])==null||d.start(e._instance)}),!s&&(l=G.__PosthogExtensions__)!=null&&(l=l.integrations)!=null&&l[i]&&((u=G.__PosthogExtensions__)==null||(u=u.integrations)==null||(u=u[i])==null||u.stop())};for(var[r,s]of Object.entries((o=this._instance.config.integrations)!==null&&o!==void 0?o:{})){var o;n(r)}}}var As={},Pa=0,Fl=()=>{},Xn="posthog",Lg=!$S&&We?.indexOf("MSIE")===-1&&We?.indexOf("Mozilla")===-1,uh=t=>{var e;return F({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:pS(L?.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Fl,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:t??"unset",__preview_deferred_init_extensions:!1,debug:De&&je(De?.search)&&De.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:(j==null||(e=j.location)==null?void 0:e.protocol)==="https:",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_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:n=>{var r="Bad HTTP status: "+n.statusCode+" "+n.text;V.error(r)},get_device_id:n=>n,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:Ll},error_tracking:{},_onCapture:Fl,__preview_eager_load_replay:!1},(n=>({rageclick:!(n&&n>="2025-11-30")||{content_ignorelist:!0},capture_pageview:!(n&&n>="2025-05-24")||"history_change",session_recording:n&&n>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:n&&n>="2026-01-30"?"head":"body",internal_or_test_user_hostname:n&&n>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0}))(t))},dh=t=>{var e={};$(t.process_person)||(e.person_profiles=t.process_person),$(t.xhr_headers)||(e.request_headers=t.xhr_headers),$(t.cookie_name)||(e.persistence_name=t.cookie_name),$(t.disable_cookie)||(e.disable_persistence=t.disable_cookie),$(t.store_google)||(e.save_campaign_params=t.store_google),$(t.verbose)||(e.debug=t.verbose);var n=ke({},e,t);return ae(t.property_blacklist)&&($(t.property_denylist)?n.property_denylist=t.property_blacklist:ae(t.property_denylist)?n.property_denylist=[...t.property_blacklist,...t.property_denylist]:V.error("Invalid value for property_denylist config: "+t.property_denylist)),n};class wT{constructor(){this.__forceAllowLocalhost=!1}get Le(){return this.__forceAllowLocalhost}set Le(e){V.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class jt{get decideEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}get flagsEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}constructor(){this.webPerformance=new wT,this.Ne=!1,this.version=Ut.LIB_VERSION,this.Tt=new Bc,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=uh(),this.SentryIntegration=PS,this.sentryIntegration=e=>function(n,r){var s=_g(n,r);return{name:yg,processEvent:o=>s(o)}}(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Ue=!1,this.ze=null,this.He=null,this.Be=null,this.featureFlags=new eT(this),this.toolbar=new RS(this),this.scrollManager=new mT(this),this.pageViewManager=new Kd(this),this.surveys=new lT(this),this.conversations=new cT(this),this.logs=new uT(this),this.experiments=new Fe(this),this.exceptions=new VS(this),this.rateLimiter=new dT(this),this.requestRouter=new vT(this),this.consent=new ES(this),this.externalIntegrations=new bT(this),this.people={set:(e,n,r)=>{var s=je(e)?{[e]:n}:e;this.setPersonProperties(s),r?.({})},set_once:(e,n,r)=>{var s=je(e)?{[e]:n}:e;this.setPersonProperties(void 0,s),r?.({})}},this.on("eventCaptured",e=>V.info('send "'+e?.event+'"',e))}init(e,n,r){if(r&&r!==Xn){var s,o=(s=As[r])!==null&&s!==void 0?s:new jt;return o._init(e,n,r),As[r]=o,As[Xn][r]=o,o}return this._init(e,n,r)}_init(e,n,r){var s;if(n===void 0&&(n={}),$(e)||_l(e))return V.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={},n.debug=this.qe(n.debug),this.We=n,this.Ge=[],n.person_profiles?this.He=n.person_profiles:n.process_person&&(this.He=n.process_person),this.set_config(ke({},uh(n.defaults),dh(n),{name:r,token:e})),this.config.on_xhr_error&&V.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:Tt.GZipJS;var o=this.Ve();this.persistence=new Ta(this.config,o),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Ta(F({},this.config,{persistence:"sessionStorage"}),o);var i=F({},this.persistence.props),a=F({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Je=new hT(x=>this.Ke(x),this.config.request_queue_config),this.Ye=new pT(this),this.__request_queue=[];var l=this.config.cookieless_mode==="always"||this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut();if(l||(this.sessionManager=new lh(this),this.sessionPropsManager=new ah(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(V.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.Xe(l)},0)):(V.info("Initializing extensions synchronously"),this.Xe(l)),Ut.DEBUG=Ut.DEBUG||this.config.debug,Ut.DEBUG&&V.info("Starting in debug mode",{this:this,config:n,thisC:F({},this.config),p:i,s:a}),((s=n.bootstrap)==null?void 0:s.distinctID)!==void 0){var u,d,h=this.config.get_device_id(cn()),f=(u=n.bootstrap)!=null&&u.isIdentifiedID?h:n.bootstrap.distinctID;this.persistence.set_property(Et,(d=n.bootstrap)!=null&&d.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:n.bootstrap.distinctID,$device_id:f})}if(this.Qe()){var m,v,g=Object.keys(((m=n.bootstrap)==null?void 0:m.featureFlags)||{}).filter(x=>{var w;return!((w=n.bootstrap)==null||(w=w.featureFlags)==null||!w[x])}).reduce((x,w)=>{var E;return x[w]=((E=n.bootstrap)==null||(E=E.featureFlags)==null?void 0:E[w])||!1,x},{}),y=Object.keys(((v=n.bootstrap)==null?void 0:v.featureFlagPayloads)||{}).filter(x=>g[x]).reduce((x,w)=>{var E,b;return(E=n.bootstrap)!=null&&(E=E.featureFlagPayloads)!=null&&E[w]&&(x[w]=(b=n.bootstrap)==null||(b=b.featureFlagPayloads)==null?void 0:b[w]),x},{});this.featureFlags.receivedFeatureFlags({featureFlags:g,featureFlagPayloads:y})}if(l)this.register_once({distinct_id:Dr,$device_id:null},"");else if(!this.get_distinct_id()){var _=this.config.get_device_id(cn());this.register_once({distinct_id:_,$device_id:_},""),this.persistence.set_property(Et,"anonymous")}return Ce(j,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),n.segment?kS(this,()=>this.Ze()):this.Ze(),Gt(this.config._onCapture)&&this.config._onCapture!==Fl&&(V.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",x=>this.config._onCapture(x.event,x))),this.config.ip&&V.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}Xe(e){var n=performance.now(),r=F({},jt.__defaultExtensionClasses,this.config.__extensionClasses);r.historyAutocapture&&(this.historyAutocapture=new r.historyAutocapture(this),this.historyAutocapture.startIfEnabled());var s=[];r.tracingHeaders&&s.push(()=>{new r.tracingHeaders(this).startIfEnabledOrStop()}),r.siteApps&&s.push(()=>{var o;this.siteApps=new r.siteApps(this),(o=this.siteApps)==null||o.init()}),!e&&r.sessionRecording&&s.push(()=>{this.sessionRecording=new r.sessionRecording(this),this.sessionRecording.startIfEnabledOrStop()}),this.config.disable_scroll_properties||s.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),r.autocapture&&s.push(()=>{this.autocapture=new r.autocapture(this),this.autocapture.startIfEnabled()}),s.push(()=>{this.surveys.loadIfEnabled()}),s.push(()=>{this.logs.loadIfEnabled()}),s.push(()=>{this.conversations.loadIfEnabled()}),r.productTours&&s.push(()=>{this.productTours=new r.productTours(this),this.productTours.loadIfEnabled()}),r.heatmaps&&s.push(()=>{this.heatmaps=new r.heatmaps(this),this.heatmaps.startIfEnabled()}),r.webVitalsAutocapture&&s.push(()=>{this.webVitalsAutocapture=new r.webVitalsAutocapture(this)}),r.exceptionObserver&&s.push(()=>{this.exceptionObserver=new r.exceptionObserver(this),this.exceptionObserver.startIfEnabledOrStop()}),r.deadClicksAutocapture&&s.push(()=>{this.deadClicksAutocapture=new r.deadClicksAutocapture(this,TS),this.deadClicksAutocapture.startIfEnabledOrStop()}),s.push(()=>{if(this.tr){var o=this.tr;this.tr=void 0,this.Ni(o)}}),this.ir(s,n)}ir(e,n){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-n>=30&&e.length>0)return void setTimeout(()=>{this.ir(e,n)},0);var r=e.shift();if(r)try{r()}catch(o){V.error("Error initializing extension:",o)}}var s=Math.round(performance.now()-n);this.register_for_session({$sdk_debug_extensions_init_method:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",$sdk_debug_extensions_init_time_ms:s}),this.config.__preview_deferred_init_extensions&&V.info("PostHog extensions initialized ("+s+"ms)")}Ni(e){var n,r,s,o,i,a,l,u,d;if(!L||!L.body)return V.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.Ni(e)},500);this.config.__preview_deferred_init_extensions&&(this.tr=e),this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=te(e.supportedCompression,Tt.GZipJS)?Tt.GZipJS:te(e.supportedCompression,Tt.Base64)?Tt.Base64:void 0),(n=e.analytics)!=null&&n.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.He?this.He:"identified_only"}),(r=this.siteApps)==null||r.onRemoteConfig(e),(s=this.sessionRecording)==null||s.onRemoteConfig(e),(o=this.autocapture)==null||o.onRemoteConfig(e),(i=this.heatmaps)==null||i.onRemoteConfig(e),this.surveys.onRemoteConfig(e),this.logs.onRemoteConfig(e),this.conversations.onRemoteConfig(e),(a=this.productTours)==null||a.onRemoteConfig(e),(l=this.webVitalsAutocapture)==null||l.onRemoteConfig(e),(u=this.exceptionObserver)==null||u.onRemoteConfig(e),this.exceptions.onRemoteConfig(e),(d=this.deadClicksAutocapture)==null||d.onRemoteConfig(e)}Ze(){try{this.config.loaded(this)}catch(r){V.critical("`loaded` function failed",r)}if(this.er(),this.config.internal_or_test_user_hostname&&De!=null&&De.hostname){var e=De.hostname,n=this.config.internal_or_test_user_hostname;(typeof n=="string"?e===n:n.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||this.config.cookieless_mode==="always")&&this.rr()},1),this.sr=new Dg(this),this.sr.load()}er(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.Je)==null||e.enable())}_dom_loaded(){this.is_capturing()&&dn(this.__request_queue,e=>this.Ke(e)),this.__request_queue=[],this.er()}_handle_unload(){var e,n;this.surveys.handlePageUnload(),this.config.request_batching?(this.nr()&&this.capture("$pageleave"),(e=this.Je)==null||e.unload(),(n=this.Ye)==null||n.unload()):this.nr()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}_send_request(e){this.__loaded&&(Lg?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=xi(e.url,{ip:this.config.ip?1:0}),e.headers=F({},this.config.request_headers,e.headers),e.compression=e.compression==="best-available"?this.compression:e.compression,e.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(n=>{var r,s,o,i=F({},n);i.timeout=i.timeout||6e4,i.url=xi(i.url,{_:new Date().getTime().toString(),ver:Ut.LIB_VERSION,compression:i.compression});var a=(r=i.transport)!==null&&r!==void 0?r:"fetch",l=Ko.filter(d=>!i.disableTransport||!d.transport||!i.disableTransport.includes(d.transport)),u=(s=(o=dg(l,d=>d.transport===a))==null?void 0:o.method)!==null&&s!==void 0?s:l[0].method;if(!u)throw new Error("No available transport method");u(i)})(F({},e,{callback:n=>{var r,s;this.rateLimiter.checkForLimiting(n),n.statusCode>=400&&((r=(s=this.config).on_request_error)==null||r.call(s,n)),e.callback==null||e.callback(n)}}))))}Ke(e){this.Ye?this.Ye.retriableRequest(e):this._send_request(e)}_execute_array(e){Pa++;try{var n,r=[],s=[],o=[];dn(e,a=>{a&&(n=a[0],ae(n)?o.push(a):Gt(a)?a.call(this):ae(a)&&n==="alias"?r.push(a):ae(a)&&n.indexOf("capture")!==-1&&Gt(this[n])?o.push(a):s.push(a))});var i=function(a,l){dn(a,function(u){if(ae(u[0])){var d=l;he(u,function(h){d=d[h[0]].apply(d,h.slice(1))})}else this[u[0]].apply(this,u.slice(1))},l)};i(r,this),i(s,this),i(o,this)}finally{Pa--}}Qe(){var e,n;return((e=this.config.bootstrap)==null?void 0:e.featureFlags)&&Object.keys((n=this.config.bootstrap)==null?void 0:n.featureFlags).length>0||!1}push(e){if(Pa>0&&ae(e)&&je(e[0])){var n=jt.prototype[e[0]];Gt(n)&&n.apply(this,e.slice(1))}else this._execute_array([e])}capture(e,n,r){var s;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Je){if(this.is_capturing())if(!$(e)&&je(e)){var o=!this.config.opt_out_useragent_filter&&this._is_bot();if(!(o&&!this.config.__preview_capture_bot_pageviews)){var i=r!=null&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(i==null||!i.isRateLimited){n!=null&&n.$current_url&&!je(n?.$current_url)&&(V.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),n==null||delete n.$current_url),e!=="$exception"||r!=null&&r.ft||V.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 a=new Date,l=r?.timestamp||a,u=cn(),d={uuid:u,event:e,properties:this.calculateEventProperties(e,n||{},l,u)};e==="$pageview"&&this.config.__preview_capture_bot_pageviews&&o&&(d.event="$bot_pageview",d.properties.$browser_type="bot"),i&&(d.properties.$lib_rate_limit_remaining_tokens=i.remainingTokens),r?.$set&&(d.$set=r?.$set);var h,f=e!=="$groupidentify",m=this.ar(r?.$set_once,f);if(m&&(d.$set_once=m),(d=hS(d,r!=null&&r._noTruncate?null:this.config.properties_string_max_length)).timestamp=l,$(r?.timestamp)||(d.properties.$event_time_override_provided=!0,d.properties.$event_time_override_system_time=a),e===Qn.DISMISSED||e===Qn.SENT){var v=n?.[Yo.SURVEY_ID],g=n?.[Yo.SURVEY_ITERATION];h={id:v,current_iteration:g},localStorage.getItem(oh(h))||localStorage.setItem(oh(h),"true"),d.$set=F({},d.$set,{[nT({id:v,current_iteration:g},e===Qn.SENT?"responded":"dismissed")]:!0})}else e===Qn.SHOWN&&(d.$set=F({},d.$set,{[Yo.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));var y=F({},d.properties.$set,d.$set);if(Zn(y)||this.setPersonPropertiesForFlags(y),!re(this.config.before_send)){var _=this.lr(d);if(!_)return;d=_}this.Tt.emit("eventCaptured",d);var x={method:"POST",url:(s=r?._url)!==null&&s!==void 0?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:d,compression:"best-available",batchKey:r?._batchKey};return!this.config.request_batching||r&&(r==null||!r._batchKey)||r!=null&&r.send_instantly?this.Ke(x):this.Je.enqueue(x),d}V.critical("This capture call is ignored due to client rate limiting.")}}else V.error("No event name provided to posthog.capture")}else V.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",n=>e(n.event,n))}calculateEventProperties(e,n,r,s,o){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return n;var i=o?void 0:this.persistence.remove_event_timer(e),a=F({},n);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,(this.config.cookieless_mode=="always"||this.config.cookieless_mode=="on_reject"&&this.consent.isExplicitlyOptedOut())&&(a.$cookieless_mode=!0),e==="$snapshot"){var l=F({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=l.distinct_id,(!je(a.distinct_id)&&!Zt(a.distinct_id)||_l(a.distinct_id))&&V.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var u,d=HS(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:h,windowId:f}=this.sessionManager.checkAndGetSessionAndWindowId(o,r.getTime());a.$session_id=h,a.$window_id=f}this.sessionPropsManager&&ke(a,this.sessionPropsManager.getSessionProps());try{var m;this.sessionRecording&&ke(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=(m=this.Ye)==null?void 0:m.length}catch(_){a.$sdk_debug_error_capturing_properties=String(_)}if(this.requestRouter.region===Es.CUSTOM&&(a.$lib_custom_api_host=this.config.api_host),u=e!=="$pageview"||o?e!=="$pageleave"||o?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,s),a=ke(a,u),e==="$pageview"&&L&&(a.title=L.title),!$(i)){var v=r.getTime()-i;a.$duration=parseFloat((v/1e3).toFixed(3))}We&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser"),(a=ke({},d,this.persistence.properties(),this.sessionPersistence.properties(),a)).$is_identified=this._isIdentified(),ae(this.config.property_denylist)?he(this.config.property_denylist,function(_){delete a[_]}):V.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var g=this.config.sanitize_properties;g&&(V.error("sanitize_properties is deprecated. Use before_send instead"),a=g(a,e));var y=this.ur();return a.$process_person_profile=y,y&&!o&&this.hr("_calculate_event_properties"),a}ar(e,n){var r;if(n===void 0&&(n=!0),!this.persistence||!this.ur()||this.Ne)return e;var s=this.persistence.get_initial_props(),o=(r=this.sessionPropsManager)==null?void 0:r.getSetOnceProps(),i=ke({},s,o||{},e||{}),a=this.config.sanitize_properties;return a&&(V.error("sanitize_properties is deprecated. Use before_send instead"),i=a(i,"$set_once")),n&&(this.Ne=!0),Zn(i)?void 0:i}register(e,n){var r;(r=this.persistence)==null||r.register(e,n)}register_once(e,n,r){var s;(s=this.persistence)==null||s.register_once(e,n,r)}register_for_session(e){var n;(n=this.sessionPersistence)==null||n.register(e)}unregister(e){var n;(n=this.persistence)==null||n.unregister(e)}unregister_for_session(e){var n;(n=this.sessionPersistence)==null||n.unregister(e)}dr(e,n){this.register({[e]:n})}getFeatureFlag(e,n){return this.featureFlags.getFeatureFlag(e,n)}getFeatureFlagPayload(e){return this.featureFlags.getFeatureFlagPayload(e)}getFeatureFlagResult(e,n){return this.featureFlags.getFeatureFlagResult(e,n)}isFeatureEnabled(e,n){return this.featureFlags.isFeatureEnabled(e,n)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateFlags(e,n,r){var s=r!=null&&r.merge?this.featureFlags.getFlagVariants():{},o=r!=null&&r.merge?this.featureFlags.getFlagPayloads():{},i=F({},s,e),a=F({},o,n),l={};for(var[u,d]of Object.entries(i)){var h=typeof d=="string";l[u]={key:u,enabled:!!h||!!d,variant:h?d:void 0,reason:void 0,metadata:$(a?.[u])?void 0:{id:0,version:void 0,description:void 0,payload:a[u]}}}this.featureFlags.receivedFeatureFlags({flags:l})}updateEarlyAccessFeatureEnrollment(e,n,r){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,n,r)}getEarlyAccessFeatures(e,n,r){return n===void 0&&(n=!1),this.featureFlags.getEarlyAccessFeatures(e,n,r)}on(e,n){return this.Tt.on(e,n)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSurveysLoaded(e){return this.surveys.onSurveysLoaded(e)}onSessionId(e){var n,r;return(n=(r=this.sessionManager)==null?void 0:r.onSessionId(e))!==null&&n!==void 0?n:()=>{}}getSurveys(e,n){n===void 0&&(n=!1),this.surveys.getSurveys(e,n)}getActiveMatchingSurveys(e,n){n===void 0&&(n=!1),this.surveys.getActiveMatchingSurveys(e,n)}renderSurvey(e,n){this.surveys.renderSurvey(e,n)}displaySurvey(e,n){n===void 0&&(n=sT),this.surveys.displaySurvey(e,n)}cancelPendingSurvey(e){this.surveys.cancelPendingSurvey(e)}canRenderSurvey(e){return this.surveys.canRenderSurvey(e)}canRenderSurveyAsync(e,n){return n===void 0&&(n=!1),this.surveys.canRenderSurveyAsync(e,n)}identify(e,n,r){if(!this.__loaded||!this.persistence)return V.uninitializedWarning("posthog.identify");if(Zt(e)&&(e=e.toString(),V.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e)if(["distinct_id","distinctid"].includes(e.toLowerCase()))V.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.');else if(e!==Dr){if(this.hr("posthog.identify")){var s=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var o=s;this.register_once({$had_persisted_distinct_id:!0,$device_id:o},"")}e!==s&&e!==this.get_property(ys)&&(this.unregister(ys),this.register({distinct_id:e}));var i=(this.persistence.get_property(Et)||"anonymous")==="anonymous";e!==s&&i?(this.persistence.set_property(Et,"identified"),this.setPersonPropertiesForFlags(F({},r||{},n||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:s},{$set:n||{},$set_once:r||{}}),this.Be=Qd(e,n,r),this.featureFlags.setAnonymousDistinctId(s)):(n||r)&&this.setPersonProperties(n,r),e!==s&&(this.reloadFeatureFlags(),this.unregister(hi))}}else V.critical('The string "'+Dr+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else V.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,n){if((e||n)&&this.hr("posthog.setPersonProperties")){var r=Qd(this.get_distinct_id(),e,n);this.Be!==r?(this.setPersonPropertiesForFlags(F({},n||{},e||{})),this.capture("$set",{$set:e||{},$set_once:n||{}}),this.Be=r):V.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,n,r){if(e&&n){var s=this.getGroups();s[e]!==n&&this.resetGroupPropertiesForFlags(e),this.register({$groups:F({},s,{[e]:n})}),r&&(this.capture("$groupidentify",{$group_type:e,$group_key:n,$group_set:r}),this.setGroupPropertiesForFlags({[e]:r})),s[e]===n||r||this.reloadFeatureFlags()}else V.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,n){n===void 0&&(n=!0),this.featureFlags.setPersonPropertiesForFlags(e,n)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,n){n===void 0&&(n=!0),this.hr("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,n)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){var n,r,s,o,i;if(V.info("reset"),!this.__loaded)return V.uninitializedWarning("posthog.reset");var a=this.get_property("$device_id");if(this.consent.reset(),(n=this.persistence)==null||n.clear(),(r=this.sessionPersistence)==null||r.clear(),this.surveys.reset(),(s=this.sr)==null||s.stop(),this.featureFlags.reset(),(o=this.persistence)==null||o.set_property(Et,"anonymous"),(i=this.sessionManager)==null||i.resetSessionId(),this.Be=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:Dr,$device_id:null},"");else{var l=this.config.get_device_id(cn());this.register_once({distinct_id:l,$device_id:e?l:a},"")}this.register({$last_posthog_reset:new Date().toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,n;return(e=(n=this.sessionManager)==null?void 0:n.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:n,sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0),s=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+n);if(e!=null&&e.withTimestamp&&r){var o,i=(o=e.timestampLookBack)!==null&&o!==void 0?o:10;if(!r)return s;s+="?t="+Math.max(Math.floor((new Date().getTime()-r)/1e3)-i,0)}return s}alias(e,n){return e===this.get_property(fg)?(V.critical("Attempting to create alias for existing People user - aborting."),-2):this.hr("posthog.alias")?($(n)&&(n=this.get_distinct_id()),e!==n?(this.dr(ys,e),this.capture("$create_alias",{alias:e,distinct_id:n})):(V.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var n=F({},this.config);if(Ae(e)){var r,s,o,i,a,l,u,d;ke(this.config,dh(e));var h=this.Ve();(r=this.persistence)==null||r.update_config(this.config,n,h),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Ta(F({},this.config,{persistence:"sessionStorage"}),h);var f=this.qe(this.config.debug);qt(f)&&(this.config.debug=f),qt(this.config.debug)&&(this.config.debug?(Ut.DEBUG=!0,xe.O()&&xe.D("ph_debug","true"),V.info("set_config",{config:e,oldConfig:n,newConfig:F({},this.config)})):(Ut.DEBUG=!1,xe.O()&&xe.L("ph_debug"))),(s=this.exceptionObserver)==null||s.onConfigChange(),(o=this.sessionRecording)==null||o.startIfEnabledOrStop(),(i=this.autocapture)==null||i.startIfEnabled(),(a=this.heatmaps)==null||a.startIfEnabled(),(l=this.exceptionObserver)==null||l.startIfEnabledOrStop(),(u=this.deadClicksAutocapture)==null||u.startIfEnabledOrStop(),this.surveys.loadIfEnabled(),this.vr(),(d=this.externalIntegrations)==null||d.startIfEnabledOrStop()}}startSessionRecording(e){var n=e===!0,r={sampling:n||!(e==null||!e.sampling),linked_flag:n||!(e==null||!e.linked_flag),url_trigger:n||!(e==null||!e.url_trigger),event_trigger:n||!(e==null||!e.event_trigger)};if(Object.values(r).some(Boolean)){var s,o,i,a,l;(s=this.sessionManager)==null||s.checkAndGetSessionAndWindowId(),r.sampling&&((o=this.sessionRecording)==null||o.overrideSampling()),r.linked_flag&&((i=this.sessionRecording)==null||i.overrideLinkedFlag()),r.url_trigger&&((a=this.sessionRecording)==null||a.overrideTrigger("url")),r.event_trigger&&((l=this.sessionRecording)==null||l.overrideTrigger("event"))}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!((e=this.sessionRecording)==null||!e.started)}captureException(e,n){var r=new Error("PostHog syntheticException"),s=this.exceptions.buildProperties(e,{handled:!0,syntheticException:r});return this.exceptions.sendExceptionEvent(F({},s,n))}startExceptionAutocapture(e){this.set_config({capture_exceptions:e==null||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){var n;return(n=this.persistence)==null?void 0:n.props[e]}getSessionProperty(e){var n;return(n=this.sessionPersistence)==null?void 0:n.props[e]}toString(){var e,n=(e=this.config.name)!==null&&e!==void 0?e:Xn;return n!==Xn&&(n=Xn+"."+n),n}_isIdentified(){var e,n;return((e=this.persistence)==null?void 0:e.get_property(Et))==="identified"||((n=this.sessionPersistence)==null?void 0:n.get_property(Et))==="identified"}ur(){var e,n;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&Zn(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[ys])&&((n=this.persistence)==null||(n=n.props)==null||!n[pi]))}nr(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&(this.config.capture_pageview===!0||this.config.capture_pageview==="history_change")}createPersonProfile(){this.ur()||this.hr("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.hr("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}hr(e){return this.config.person_profiles==="never"?(V.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.dr(pi,!0),!0)}Ve(){if(this.config.cookieless_mode==="always")return!0;var e=this.consent.isOptedOut(),n=this.config.opt_out_persistence_by_default||this.config.cookieless_mode==="on_reject";return this.config.disable_persistence||e&&!!n}vr(){var e,n,r,s,o=this.Ve();return((e=this.persistence)==null?void 0:e.Dt)!==o&&((r=this.persistence)==null||r.set_disabled(o)),((n=this.sessionPersistence)==null?void 0:n.Dt)!==o&&((s=this.sessionPersistence)==null||s.set_disabled(o)),o}opt_in_capturing(e){var n;if(this.config.cookieless_mode!=="always"){if(this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut()){var r,s,o,i,a;this.reset(!0),(r=this.sessionManager)==null||r.destroy(),(s=this.pageViewManager)==null||s.destroy(),this.sessionManager=new lh(this),this.pageViewManager=new Kd(this),this.persistence&&(this.sessionPropsManager=new ah(this,this.sessionManager,this.persistence));var l=(o=(i=this.config.__extensionClasses)==null?void 0:i.sessionRecording)!==null&&o!==void 0?o:(a=jt.__defaultExtensionClasses)==null?void 0:a.sessionRecording;l&&(this.sessionRecording=new l(this),this.sessionRecording.startIfEnabledOrStop())}var u;this.consent.optInOut(!0),this.vr(),this.er(),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),this.config.cookieless_mode=="on_reject"&&this.surveys.loadIfEnabled(),($(e?.captureEventName)||e!=null&&e.captureEventName)&&this.capture((u=e?.captureEventName)!==null&&u!==void 0?u:"$opt_in",e?.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.rr()}else V.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var e,n,r;this.config.cookieless_mode!=="always"?(this.config.cookieless_mode==="on_reject"&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.vr(),this.config.cookieless_mode==="on_reject"&&(this.register({distinct_id:Dr,$device_id:null}),(e=this.sessionManager)==null||e.destroy(),(n=this.pageViewManager)==null||n.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,(r=this.sessionRecording)==null||r.stopRecording(),this.sessionRecording=void 0,this.rr())):V.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}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 e===Wt.GRANTED?"granted":e===Wt.DENIED?"denied":"pending"}is_capturing(){return this.config.cookieless_mode==="always"||(this.config.cookieless_mode==="on_reject"?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.vr()}_is_bot(){return Je?Ng(Je,this.config.custom_blocked_useragents):void 0}rr(){L&&(L.visibilityState==="visible"?this.Ue||(this.Ue=!0,this.capture("$pageview",{title:L.title},{send_instantly:!0}),this.ze&&(L.removeEventListener("visibilitychange",this.ze),this.ze=null)):this.ze||(this.ze=this.rr.bind(this),Ce(L,"visibilitychange",this.ze)))}debug(e){e===!1?(j?.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(j?.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}))}Rt(){var e,n,r,s,o,i,a,l=this.We||{};return"advanced_disable_flags"in l?!!l.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(V.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):(r="advanced_disable_decide",s=!1,o=V,i=(n="advanced_disable_flags")in(e=l)&&!re(e[n]),a=r in e&&!re(e[r]),i?e[n]:a?(o&&o.warn("Config field '"+r+"' is deprecated. Please use '"+n+"' instead. The old field will be removed in a future major version."),e[r]):s)}lr(e){if(re(this.config.before_send))return e;var n=ae(this.config.before_send)?this.config.before_send:[this.config.before_send],r=e;for(var s of n){if(r=s(r),re(r)){var o="Event '"+e.event+"' was rejected in beforeSend function";return jE(e.event)?V.warn(o+". This can cause unexpected behavior."):V.info(o),null}r.properties&&!Zn(r.properties)||V.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return r}getPageViewId(){var e;return(e=this.pageViewManager.it)==null?void 0:e.pageViewId}captureTraceFeedback(e,n){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:n})}captureTraceMetric(e,n,r){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:n,$ai_metric_value:String(r)})}qe(e){var n=qt(e)&&!e,r=xe.O()&&xe.A("ph_debug")==="true";return!n&&(!!r||e)}}jt.__defaultExtensionClasses={},function(t,e){for(var n=0;n<e.length;n++)t.prototype[e[n]]=dS(t.prototype[e[n]])}(jt,["identify"]);function hh(t){return t instanceof Element&&(t.id===gg||!(t.closest==null||!t.closest(".toolbar-global-fade-container")))}function Xi(t){return!!t&&t.nodeType===1}function hn(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function Fg(t){return!!t&&t.nodeType===3}function $g(t){return!!t&&t.nodeType===11}function zc(t){return t?qi(t).split(/\s+/):[]}function fh(t){var e=j?.location.href;return!!(e&&t&&t.some(n=>e.match(n)))}function Ei(t){var e="";switch(typeof t.className){case"string":e=t.className;break;case"object":e=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:e=""}return zc(e)}function Vg(t){return re(t)?null:qi(t).split(/(\s+)/).filter(e=>qs(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function fo(t){var e="";return $l(t)&&!Hg(t)&&t.childNodes&&t.childNodes.length&&he(t.childNodes,function(n){var r;Fg(n)&&n.textContent&&(e+=(r=Vg(n.textContent))!==null&&r!==void 0?r:"")}),qi(e)}function ph(t){return $(t.target)?t.srcElement||null:(e=t.target)!=null&&e.shadowRoot?t.composedPath()[0]||null:t.target||null;var e}var Uc=["a","button","form","input","select","textarea","label"];function Bg(t,e){if($(e))return!0;var n,r=function(o){if(e.some(i=>o.matches(i)))return{v:!0}};for(var s of t)if(n=r(s))return n.v;return!1}function zg(t){var e=t.parentNode;return!(!e||!Xi(e))&&e}var ET=["next","previous","prev",">","<"],mh=10,gh=[".ph-no-rageclick",".ph-no-capture"];function ST(t,e){if(!j||Hc(t))return!1;var n,r,s;if(qt(e)?(n=!!e&&gh,r=void 0):(n=(s=e?.css_selector_ignorelist)!==null&&s!==void 0?s:gh,r=e?.content_ignorelist),n===!1)return!1;var{targetElementList:o}=Ug(t,!1);return!function(i,a){if(i===!1||$(i))return!1;var l;if(i===!0)l=ET;else{if(!ae(i))return!1;if(i.length>mh)return V.error("[PostHog] content_ignorelist array cannot exceed "+mh+" items. Use css_selector_ignorelist for more complex matching."),!1;l=i.map(u=>u.toLowerCase())}return a.some(u=>{var{safeText:d,ariaLabel:h}=u;return l.some(f=>d.includes(f)||h.includes(f))})}(r,o.map(i=>{var a;return{safeText:fo(i).toLowerCase(),ariaLabel:((a=i.getAttribute("aria-label"))==null?void 0:a.toLowerCase().trim())||""}}))&&!Bg(o,n)}var Hc=t=>!t||hn(t,"html")||!Xi(t),Ug=(t,e)=>{if(!j||Hc(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var n=!1,r=[t],s=t;s.parentNode&&!hn(s,"body");)if($g(s.parentNode))r.push(s.parentNode.host),s=s.parentNode.host;else{var o=zg(s);if(!o)break;if(e||Uc.indexOf(o.tagName.toLowerCase())>-1)n=!0;else{var i=j.getComputedStyle(o);i&&i.getPropertyValue("cursor")==="pointer"&&(n=!0)}r.push(o),s=o}return{parentIsUsefulElement:n,targetElementList:r}};function TT(t,e,n,r,s){var o,i,a,l;if(n===void 0&&(n=void 0),!j||Hc(t)||(o=n)!=null&&o.url_allowlist&&!fh(n.url_allowlist)||(i=n)!=null&&i.url_ignorelist&&fh(n.url_ignorelist))return!1;if((a=n)!=null&&a.dom_event_allowlist){var u=n.dom_event_allowlist;if(u&&!u.some(v=>e.type===v))return!1}var{parentIsUsefulElement:d,targetElementList:h}=Ug(t,r);if(!function(v,g){var y=g?.element_allowlist;if($(y))return!0;var _,x=function(E){if(y.some(b=>E.tagName.toLowerCase()===b))return{v:!0}};for(var w of v)if(_=x(w))return _.v;return!1}(h,n)||!Bg(h,(l=n)==null?void 0:l.css_selector_allowlist))return!1;var f=j.getComputedStyle(t);if(f&&f.getPropertyValue("cursor")==="pointer"&&e.type==="click")return!0;var m=t.tagName.toLowerCase();switch(m){case"html":return!1;case"form":return(s||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(s||["change","click"]).indexOf(e.type)>=0;default:return d?(s||["click"]).indexOf(e.type)>=0:(s||["click"]).indexOf(e.type)>=0&&(Uc.indexOf(m)>-1||t.getAttribute("contenteditable")==="true")}}function $l(t){for(var e=t;e.parentNode&&!hn(e,"body");e=e.parentNode){var n=Ei(e);if(te(n,"ph-sensitive")||te(n,"ph-no-capture"))return!1}if(te(Ei(t),"ph-include"))return!0;var r=t.type||"";if(je(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var s=t.name||t.id||"";return!(je(s)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(s.replace(/[^a-zA-Z0-9]/g,"")))}function Hg(t){return!!(hn(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||hn(t,"select")||hn(t,"textarea")||t.getAttribute("contenteditable")==="true")}var Wg="(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})",kT=new RegExp("^(?:"+Wg+")$"),PT=new RegExp(Wg),Gg="\\d{3}-?\\d{2}-?\\d{4}",CT=new RegExp("^("+Gg+")$"),jT=new RegExp("("+Gg+")");function qs(t,e){return e===void 0&&(e=!0),!(re(t)||je(t)&&(t=qi(t),(e?kT:PT).test((t||"").replace(/[- ]/g,""))||(e?CT:jT).test(t)))}function Kg(t){var e=fo(t);return qs(e=(e+" "+qg(t)).trim())?e:""}function qg(t){var e="";return t&&t.childNodes&&t.childNodes.length&&he(t.childNodes,function(n){var r;if(n&&((r=n.tagName)==null?void 0:r.toLowerCase())==="span")try{var s=fo(n);e=(e+" "+s).trim(),n.childNodes&&n.childNodes.length&&(e=(e+" "+qg(n)).trim())}catch(o){V.error("[AutoCapture]",o)}}),e}function RT(t){return function(e){var n=e.map(r=>{var s,o,i="";if(r.tag_name&&(i+=r.tag_name),r.attr_class)for(var a of(r.attr_class.sort(),r.attr_class))i+="."+a.replace(/"/g,"");var l=F({},r.text?{text:r.text}:{},{"nth-child":(s=r.nth_child)!==null&&s!==void 0?s:0,"nth-of-type":(o=r.nth_of_type)!==null&&o!==void 0?o:0},r.href?{href:r.href}:{},r.attr_id?{attr_id:r.attr_id}:{},r.attributes),u={};return Go(l).sort((d,h)=>{var[f]=d,[m]=h;return f.localeCompare(m)}).forEach(d=>{var[h,f]=d;return u[vh(h.toString())]=vh(f.toString())}),i+=":",i+=Go(u).map(d=>{var[h,f]=d;return h+'="'+f+'"'}).join("")});return n.join(";")}(function(e){return e.map(n=>{var r,s,o={text:(r=n.$el_text)==null?void 0:r.slice(0,400),tag_name:n.tag_name,href:(s=n.attr__href)==null?void 0:s.slice(0,2048),attr_class:AT(n),attr_id:n.attr__id,nth_child:n.nth_child,nth_of_type:n.nth_of_type,attributes:{}};return Go(n).filter(i=>{var[a]=i;return a.indexOf("attr__")===0}).forEach(i=>{var[a,l]=i;return o.attributes[a]=l}),o})}(t))}function vh(t){return t.replace(/"|\\"/g,'\\"')}function AT(t){var e=t.attr__class;return e?ae(e)?e:zc(e):void 0}class yh{constructor(e){this.disabled=e===!1;var n=Ae(e)?e:{};this.thresholdPx=n.threshold_px||30,this.timeoutMs=n.timeout_ms||1e3,this.clickCount=n.click_count||3,this.clicks=[]}isRageClick(e,n,r){if(this.disabled)return!1;var s=this.clicks[this.clicks.length-1];if(s&&Math.abs(e-s.x)+Math.abs(n-s.y)<this.thresholdPx&&r-s.timestamp<this.timeoutMs){if(this.clicks.push({x:e,y:n,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:n,timestamp:r}];return!1}}var Ca="$copy_autocapture",_h=we("[AutoCapture]");function ja(t,e){return e.length>t?e.slice(0,t)+"...":e}function IT(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do e=e.previousSibling;while(e&&!Xi(e));return e}function MT(t,e,n,r){var s=t.tagName.toLowerCase(),o={tag_name:s};Uc.indexOf(s)>-1&&!n&&(s.toLowerCase()==="a"||s.toLowerCase()==="button"?o.$el_text=ja(1024,Kg(t)):o.$el_text=ja(1024,fo(t)));var i=Ei(t);i.length>0&&(o.classes=i.filter(function(d){return d!==""})),he(t.attributes,function(d){var h;if((!Hg(t)||["name","id","class","aria-label"].indexOf(d.name)!==-1)&&(r==null||!r.includes(d.name))&&!e&&qs(d.value)&&(h=d.name,!je(h)||h.substring(0,10)!=="_ngcontent"&&h.substring(0,7)!=="_nghost")){var f=d.value;d.name==="class"&&(f=zc(f).join(" ")),o["attr__"+d.name]=ja(1024,f)}});for(var a=1,l=1,u=t;u=IT(u);)a++,u.tagName===t.tagName&&l++;return o.nth_child=a,o.nth_of_type=l,o}function OT(t,e){for(var n,r,{e:s,maskAllElementAttributes:o,maskAllText:i,elementAttributeIgnoreList:a,elementsChainAsString:l}=e,u=[t],d=t;d.parentNode&&!hn(d,"body");)$g(d.parentNode)?(u.push(d.parentNode.host),d=d.parentNode.host):(u.push(d.parentNode),d=d.parentNode);var h,f=[],m={},v=!1,g=!1;if(he(u,E=>{var b=$l(E);E.tagName.toLowerCase()==="a"&&(v=E.getAttribute("href"),v=b&&v&&qs(v)&&v),te(Ei(E),"ph-no-capture")&&(g=!0),f.push(MT(E,o,i,a));var T=function(k){if(!$l(k))return{};var P={};return he(k.attributes,function(O){if(O.name&&O.name.indexOf("data-ph-capture-attribute")===0){var R=O.name.replace("data-ph-capture-attribute-",""),B=O.value;R&&B&&qs(B)&&(P[R]=B)}}),P}(E);ke(m,T)}),g)return{props:{},explicitNoCapture:g};if(i||(t.tagName.toLowerCase()==="a"||t.tagName.toLowerCase()==="button"?f[0].$el_text=Kg(t):f[0].$el_text=fo(t)),v){var y,_;f[0].attr__href=v;var x=(y=gi(v))==null?void 0:y.host,w=j==null||(_=j.location)==null?void 0:_.host;x&&w&&x!==w&&(h=v)}return{props:ke({$event_type:s.type,$ce_version:1},l?{}:{$elements:f},{$elements_chain:RT(f)},(n=f[0])!=null&&n.$el_text?{$el_text:(r=f[0])==null?void 0:r.$el_text}:{},h&&s.type==="click"?{$external_click_url:h}:{},m)}}var zr=we("[ExceptionAutocapture]");function xh(t,e,n){try{if(!(e in t))return()=>{};var r=t[e],s=n(r);return Gt(s)&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__posthog_wrapped__:{enumerable:!1,value:!0}})),t[e]=s,()=>{t[e]=r}}catch{return()=>{}}}var DT=we("[TracingHeaders]"),nn=we("[Web Vitals]"),bh=9e5;we("[SessionRecording]");var Vl="[SessionRecording]",Hn=we(Vl),NT=we("[Heatmaps]");function wh(t){return Ae(t)&&"clientX"in t&&"clientY"in t&&Zt(t.clientX)&&Zt(t.clientY)}var Eh=we("[Product Tours]"),Ra="ph_product_tours",LT=["$set_once","$set"],rn=we("[SiteApps]"),FT={sessionRecording:class{get started(){var t;return!((t=this.cr)==null||!t.isStarted)}get status(){return this.cr?this.cr.status:this.pr&&!this._r?"disabled":"lazy_loading"}constructor(t){if(this._forceAllowLocalhostNetworkCapture=!1,this.pr=!1,this.gr=!1,this.mr=void 0,this._instance=t,!this._instance.sessionManager)throw Hn.error("started without valid sessionManager"),new Error(Vl+" started without valid sessionManager. This is a bug.");if(this._instance.config.cookieless_mode==="always")throw new Error(Vl+' cannot be used with cookieless_mode="always"')}get _r(){var t,e=!((t=this._instance.get_property(jo))==null||!t.enabled),n=!this._instance.config.disable_session_recording,r=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return j&&e&&n&&!r}startIfEnabledOrStop(t){var e;if(!this._r||(e=this.cr)==null||!e.isStarted){var n=!$(Object.assign)&&!$(Array.from);this._r&&n?(this.br(t),Hn.info("starting")):this.stopRecording()}}br(t){var e,n,r;this._r&&(G!=null&&(e=G.__PosthogExtensions__)!=null&&(e=e.rrweb)!=null&&e.record&&(n=G.__PosthogExtensions__)!=null&&n.initSessionRecording?this.yr(t):(r=G.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,this.wr,s=>{if(s)return Hn.error("could not load recorder",s);this.yr(t)}))}stopRecording(){var t,e;(t=this.mr)==null||t.call(this),this.mr=void 0,(e=this.cr)==null||e.stop()}$r(){var t;(t=this._instance.persistence)==null||t.unregister(mg)}Er(t){if(this._instance.persistence){var e,n,r=this._instance.persistence,s=()=>{var o=t.sessionRecording===!1?void 0:t.sessionRecording,i=o?.sampleRate,a=re(i)?null:parseFloat(i);re(a)&&this.$r();var l=o?.minimumDurationMilliseconds;r.register({[jo]:F({cache_timestamp:Date.now(),enabled:!!o},o,{networkPayloadCapture:F({capturePerformance:t.capturePerformance},o?.networkPayloadCapture),canvasRecording:{enabled:o?.recordCanvas,fps:o?.canvasFps,quality:o?.canvasQuality},sampleRate:a,minimumDurationMilliseconds:$(l)?null:l,endpoint:o?.endpoint,triggerMatchType:o?.triggerMatchType,masking:o?.masking,urlTriggers:o?.urlTriggers})})};s(),(e=this.mr)==null||e.call(this),this.mr=(n=this._instance.sessionManager)==null?void 0:n.onSessionId(s)}}onRemoteConfig(t){"sessionRecording"in t?t.sessionRecording!==!1?(this.gr=!1,this.Er(t),this.pr=!0,this.startIfEnabledOrStop()):this.pr=!0:Hn.info("skipping remote config with no sessionRecording",t)}log(t,e){var n;e===void 0&&(e="log"),(n=this.cr)!=null&&n.log?this.cr.log(t,e):Hn.warn("log called before recorder was ready")}get wr(){var t,e,n=(t=this._instance)==null||(t=t.persistence)==null?void 0:t.get_property(jo);return(n==null||(e=n.scriptConfig)==null?void 0:e.script)||"lazy-recorder"}Sr(){var t,e=this._instance.get_property(jo);if(!e)return!1;var n=(t=(typeof e=="object"?e:JSON.parse(e)).cache_timestamp)!==null&&t!==void 0?t:Date.now();return Date.now()-n<=3e5}yr(t){var e,n;if((e=G.__PosthogExtensions__)==null||!e.initSessionRecording)throw Error("Called on script loaded before session recording is available");this.cr||(this.cr=(n=G.__PosthogExtensions__)==null?void 0:n.initSessionRecording(this._instance),this.cr._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),this.Sr()?this.cr.start(t):this.gr||(this.gr=!0,Hn.info("persisted remote config is stale, requesting fresh config before starting"),new Dg(this._instance).load())}onRRwebEmit(t){var e;(e=this.cr)==null||e.onRRwebEmit==null||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.cr||(e=this._instance.persistence)==null||e.register({$replay_override_linked_flag:!0}),(t=this.cr)==null||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.cr||(e=this._instance.persistence)==null||e.register({$replay_override_sampling:!0}),(t=this.cr)==null||t.overrideSampling()}overrideTrigger(t){var e,n;this.cr||(n=this._instance.persistence)==null||n.register({[t==="url"?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),(e=this.cr)==null||e.overrideTrigger(t)}get sdkDebugProperties(){var t;return((t=this.cr)==null?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var n;return!((n=this.cr)==null||!n.tryAddCustomEvent(t,e))}}},$T={autocapture:class{constructor(t){this.kr=!1,this.Pr=null,this.Tr=!1,this.instance=t,this.rageclicks=new yh(t.config.rageclick),this.Ir=null}get N(){var t,e,n=Ae(this.instance.config.autocapture)?this.instance.config.autocapture:{};return n.url_allowlist=(t=n.url_allowlist)==null?void 0:t.map(r=>new RegExp(r)),n.url_ignorelist=(e=n.url_ignorelist)==null?void 0:e.map(r=>new RegExp(r)),n}Cr(){if(this.isBrowserSupported()){if(j&&L){var t=n=>{n=n||j?.event;try{this.Rr(n)}catch(r){_h.error("Failed to capture event",r)}};if(Ce(L,"submit",t,{capture:!0}),Ce(L,"change",t,{capture:!0}),Ce(L,"click",t,{capture:!0}),this.N.capture_copied_text){var e=n=>{n=n||j?.event,this.Rr(n,Ca)};Ce(L,"copy",e,{capture:!0}),Ce(L,"cut",e,{capture:!0})}}}else _h.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.kr&&(this.Cr(),this.kr=!0)}onRemoteConfig(t){t.elementsChainAsString&&(this.Tr=t.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Nd]:!!t.autocapture_opt_out}),this.Pr=!!t.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(t){this.Ir=t}getElementSelectors(t){var e,n=[];return(e=this.Ir)==null||e.forEach(r=>{var s=L?.querySelectorAll(r);s?.forEach(o=>{t===o&&n.push(r)})}),n}get isEnabled(){var t,e,n=(t=this.instance.persistence)==null?void 0:t.props[Nd],r=this.Pr;if(mt(r)&&!qt(n)&&!this.instance.Rt())return!1;var s=(e=this.Pr)!==null&&e!==void 0?e:!!n;return!!this.instance.config.autocapture&&!s}Rr(t,e){if(e===void 0&&(e="$autocapture"),this.isEnabled){var n,r=ph(t);Fg(r)&&(r=r.parentNode||null),e==="$autocapture"&&t.type==="click"&&t instanceof MouseEvent&&this.instance.config.rageclick&&(n=this.rageclicks)!=null&&n.isRageClick(t.clientX,t.clientY,t.timeStamp||new Date().getTime())&&ST(r,this.instance.config.rageclick)&&this.Rr(t,"$rageclick");var s=e===Ca;if(r&&TT(r,t,this.N,s,s?["copy","cut"]:void 0)){var{props:o,explicitNoCapture:i}=OT(r,{e:t,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.N.element_attribute_ignorelist,elementsChainAsString:this.Tr});if(i)return!1;var a=this.getElementSelectors(r);if(a&&a.length>0&&(o.$element_selectors=a),e===Ca){var l,u=Vg(j==null||(l=j.getSelection())==null?void 0:l.toString()),d=t.type||"clipboard";if(!u)return!1;o.$selected_content=u,o.$copy_type=d}return this.instance.capture(e,o),!0}}}isBrowserSupported(){return Gt(L?.querySelectorAll)}},historyAutocapture:class{constructor(t){var e;this._instance=t,this.Fr=(j==null||(e=j.location)==null?void 0:e.pathname)||""}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(V.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.Or&&this.Or(),this.Or=void 0,V.info("History API monitoring stopped")}monitorHistoryChanges(){var t,e;if(j&&j.history){var n=this;(t=j.history.pushState)!=null&&t.__posthog_wrapped__||xh(j.history,"pushState",r=>function(s,o,i){r.call(this,s,o,i),n.Mr("pushState")}),(e=j.history.replaceState)!=null&&e.__posthog_wrapped__||xh(j.history,"replaceState",r=>function(s,o,i){r.call(this,s,o,i),n.Mr("replaceState")}),this.Ar()}}Mr(t){try{var e,n=j==null||(e=j.location)==null?void 0:e.pathname;if(!n)return;n!==this.Fr&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:t}),this.Fr=n}catch(r){V.error("Error capturing "+t+" pageview",r)}}Ar(){if(!this.Or){var t=()=>{this.Mr("popstate")};Ce(j,"popstate",t),this.Or=()=>{j&&j.removeEventListener("popstate",t)}}}},heatmaps:class{constructor(t){var e;this.jr=!1,this.kr=!1,this.Dr=null,this.instance=t,this.jr=!((e=this.instance.persistence)==null||!e.props[Tl]),this.rageclicks=new yh(t.config.rageclick)}get flushIntervalMilliseconds(){var t=5e3;return Ae(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(t=this.instance.config.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return re(this.instance.config.capture_heatmaps)?re(this.instance.config.enable_heatmaps)?this.jr:this.instance.config.enable_heatmaps:this.instance.config.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.kr)return;NT.info("starting..."),this.Lr(),this.Nr()}else{var t;clearInterval((t=this.Dr)!==null&&t!==void 0?t:void 0),this.Ur(),this.getAndClearBuffer()}}onRemoteConfig(t){if("heatmaps"in t){var e=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Tl]:e}),this.jr=e,this.startIfEnabled()}}getAndClearBuffer(){var t=this.R;return this.R=void 0,t}zr(t){this.Hr(t.originalEvent,"deadclick")}Nr(){this.Dr&&clearInterval(this.Dr),this.Dr=function(t){return t?.visibilityState==="visible"}(L)?setInterval(this.te.bind(this),this.flushIntervalMilliseconds):null}Lr(){j&&L&&(this.Br=this.te.bind(this),Ce(j,"beforeunload",this.Br),this.qr=t=>this.Hr(t||j?.event),Ce(L,"click",this.qr,{capture:!0}),this.Wr=t=>this.Gr(t||j?.event),Ce(L,"mousemove",this.Wr,{capture:!0}),this.Vr=new Hd(this.instance,SS,this.zr.bind(this)),this.Vr.startIfEnabledOrStop(),this.Jr=this.Nr.bind(this),Ce(L,"visibilitychange",this.Jr),this.kr=!0)}Ur(){var t;j&&L&&(this.Br&&j.removeEventListener("beforeunload",this.Br),this.qr&&L.removeEventListener("click",this.qr,{capture:!0}),this.Wr&&L.removeEventListener("mousemove",this.Wr,{capture:!0}),this.Jr&&L.removeEventListener("visibilitychange",this.Jr),clearTimeout(this.Kr),(t=this.Vr)==null||t.stop(),this.kr=!1)}Yr(t,e){var n=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),s=this.instance.scrollManager.scrollElement(),o=function(i,a,l){for(var u=i;u&&Xi(u)&&!hn(u,"body");){if(u===l)return!1;if(te(a,j?.getComputedStyle(u).position))return!0;u=zg(u)}return!1}(ph(t),["fixed","sticky"],s);return{x:t.clientX+(o?0:r),y:t.clientY+(o?0:n),target_fixed:o,type:e}}Hr(t,e){var n;if(e===void 0&&(e="click"),!hh(t.target)&&wh(t)){var r=this.Yr(t,e);(n=this.rageclicks)!=null&&n.isRageClick(t.clientX,t.clientY,new Date().getTime())&&this.Xr(F({},r,{type:"rageclick"})),this.Xr(r)}}Gr(t){!hh(t.target)&&wh(t)&&(clearTimeout(this.Kr),this.Kr=setTimeout(()=>{this.Xr(this.Yr(t,"mousemove"))},500))}Xr(t){if(j){var e=j.location.href,n=this.instance.config.mask_personal_data_properties,r=this.instance.config.custom_personal_data_properties,s=n?pr([],gr,r||[]):[],o=Gs(e,s,Ks);this.R=this.R||{},this.R[o]||(this.R[o]=[]),this.R[o].push(t)}}te(){this.R&&!Zn(this.R)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:Hd,webVitalsAutocapture:class{constructor(t){var e;this.jr=!1,this.kr=!1,this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Qr=()=>{clearTimeout(this.Zr),this.R.metrics.length!==0&&(this._instance.capture("$web_vitals",this.R.metrics.reduce((n,r)=>F({},n,{["$web_vitals_"+r.name+"_event"]:F({},r),["$web_vitals_"+r.name+"_value"]:r.value}),{})),this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.ts=n=>{var r,s=(r=this._instance.sessionManager)==null?void 0:r.checkAndGetSessionAndWindowId(!0);if($(s))nn.error("Could not read session ID. Dropping metrics!");else{this.R=this.R||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var o=this.es();$(o)||(re(n?.name)||re(n?.value)?nn.error("Invalid metric received",n):this.rs&&n.value>=this.rs?nn.error("Ignoring metric with value >= "+this.rs,n):(this.R.url!==o&&(this.Qr(),this.Zr=setTimeout(this.Qr,this.flushToCaptureTimeoutMs)),$(this.R.url)&&(this.R.url=o),this.R.firstMetricTimestamp=$(this.R.firstMetricTimestamp)?Date.now():this.R.firstMetricTimestamp,n.attribution&&n.attribution.interactionTargetElement&&(n.attribution.interactionTargetElement=void 0),this.R.metrics.push(F({},n,{$current_url:o,$session_id:s.sessionId,$window_id:s.windowId,timestamp:Date.now()})),this.R.metrics.length===this.allowedMetrics.length&&this.Qr()))}},this.ss=()=>{if(!this.kr){var n,r,s,o,i=G.__PosthogExtensions__;$(i)||$(i.postHogWebVitalsCallbacks)||({onLCP:n,onCLS:r,onFCP:s,onINP:o}=i.postHogWebVitalsCallbacks),n&&r&&s&&o?(this.allowedMetrics.indexOf("LCP")>-1&&n(this.ts.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&r(this.ts.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&s(this.ts.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&o(this.ts.bind(this)),this.kr=!0):nn.error("web vitals callbacks not loaded - not starting")}},this._instance=t,this.jr=!((e=this._instance.persistence)==null||!e.props[$d]),this.startIfEnabled()}get allowedMetrics(){var t,e,n=Ae(this._instance.config.capture_performance)?(t=this._instance.config.capture_performance)==null?void 0:t.web_vitals_allowed_metrics:void 0;return re(n)?((e=this._instance.persistence)==null?void 0:e.props[Bd])||["CLS","FCP","INP","LCP"]:n}get flushToCaptureTimeoutMs(){return(Ae(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var t=Ae(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_attribution:void 0;return t!=null&&t}get rs(){var t=Ae(this._instance.config.capture_performance)&&Zt(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:bh;return 0<t&&t<=6e4?bh:t}get isEnabled(){var t=De?.protocol;if(t!=="http:"&&t!=="https:")return nn.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=Ae(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:qt(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return qt(e)?e:this.jr}startIfEnabled(){this.isEnabled&&!this.kr&&(nn.info("enabled, starting..."),this.V(this.ss))}onRemoteConfig(t){if("capturePerformance"in t){var e=Ae(t.capturePerformance)&&!!t.capturePerformance.web_vitals,n=Ae(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[$d]:e}),this._instance.persistence.register({[Bd]:n})),this.jr=e,this.startIfEnabled()}}V(t){var e,n;if((e=G.__PosthogExtensions__)!=null&&e.postHogWebVitalsCallbacks)t();else{var r=this.useAttribution?"web-vitals-with-attribution":"web-vitals";(n=G.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,r,s=>{s?nn.error("failed to load script",s):t()})}}es(){var t=j?j.location.href:void 0;if(t){var e=this._instance.config.mask_personal_data_properties,n=this._instance.config.custom_personal_data_properties,r=e?pr([],gr,n||[]):[];return Gs(t,r,Ks)}nn.error("Could not determine current URL")}}},VT={exceptionObserver:class{constructor(t){var e,n,r;this.ss=()=>{var s;if(j&&this.isEnabled&&(s=G.__PosthogExtensions__)!=null&&s.errorWrappingFunctions){var o=G.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,i=G.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,a=G.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.ns&&this.N.capture_unhandled_errors&&(this.ns=o(this.captureException.bind(this))),!this.os&&this.N.capture_unhandled_rejections&&(this.os=i(this.captureException.bind(this))),!this.ls&&this.N.capture_console_errors&&(this.ls=a(this.captureException.bind(this)))}catch(l){zr.error("failed to start",l),this.us()}}},this._instance=t,this.hs=!((e=this._instance.persistence)==null||!e.props[Ld]),this.ds=new IE({refillRate:(n=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)!==null&&n!==void 0?n:1,bucketSize:(r=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)!==null&&r!==void 0?r:10,refillInterval:1e4,h:zr}),this.N=this.vs(),this.startIfEnabledOrStop()}vs(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Ae(t)?e=F({},e,t):($(t)?this.hs:t)&&(e=F({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.N.capture_console_errors||this.N.capture_unhandled_errors||this.N.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(zr.info("enabled"),this.us(),this.V(this.ss)):this.us()}V(t){var e,n;(e=G.__PosthogExtensions__)!=null&&e.errorWrappingFunctions&&t(),(n=G.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"exception-autocapture",r=>{if(r)return zr.error("failed to load script",r);t()})}us(){var t,e,n;(t=this.ns)==null||t.call(this),this.ns=void 0,(e=this.os)==null||e.call(this),this.os=void 0,(n=this.ls)==null||n.call(this),this.ls=void 0}onRemoteConfig(t){if("autocaptureExceptions"in t){var e=t.autocaptureExceptions;this.hs=!!e||!1,this._instance.persistence&&this._instance.persistence.register({[Ld]:this.hs}),this.N=this.vs(),this.startIfEnabledOrStop()}}onConfigChange(){this.N=this.vs()}captureException(t){var e,n,r=(e=t==null||(n=t.$exception_list)==null||(n=n[0])==null?void 0:n.type)!==null&&e!==void 0?e:"Exception";this.ds.consumeRateLimit(r)?zr.info("Skipping exception capture because of client rate limiting.",{exception:r}):this._instance.exceptions.sendExceptionEvent(t)}}},BT={productTours:class{constructor(t){this.cs=null,this.fs=null,this._instance=t}onRemoteConfig(t){"productTours"in t&&(this._instance.persistence&&this._instance.persistence.register({[Vd]:!!t.productTours}),this.loadIfEnabled())}loadIfEnabled(){var t,e;this.cs||(t=this._instance).config.disable_product_tours||(e=t.persistence)==null||!e.get_property(Vd)||this.V(()=>this.ps())}V(t){var e,n;(e=G.__PosthogExtensions__)!=null&&e.generateProductTours?t():(n=G.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"product-tours",r=>{r?Eh.error("Could not load product tours script",r):t()})}ps(){var t;!this.cs&&(t=G.__PosthogExtensions__)!=null&&t.generateProductTours&&(this.cs=G.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(e===void 0&&(e=!1),!ae(this.fs)||e){var n=this._instance.persistence;if(n){var r=n.props[Ra];if(ae(r)&&!e)return this.fs=r,void t(r,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",callback:s=>{var o=s.statusCode;if(o!==200||!s.json){var i="Product Tours API could not be loaded, status: "+o;return Eh.error(i),void t([],{isLoaded:!1,error:i})}var a=ae(s.json.product_tours)?s.json.product_tours:[];this.fs=a,n&&n.register({[Ra]:a}),t(a,{isLoaded:!0})}})}else t(this.fs,{isLoaded:!0})}getActiveProductTours(t){re(this.cs)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.cs.getActiveProductTours(t)}showProductTour(t){var e;(e=this.cs)==null||e.showTourById(t)}previewTour(t){this.cs?this.cs.previewTour(t):this.V(()=>{var e;this.ps(),(e=this.cs)==null||e.previewTour(t)})}dismissProductTour(){var t;(t=this.cs)==null||t.dismissTour("user_clicked_skip")}nextStep(){var t;(t=this.cs)==null||t.nextStep()}previousStep(){var t;(t=this.cs)==null||t.previousStep()}clearCache(){var t;this.fs=null,(t=this._instance.persistence)==null||t.unregister(Ra)}resetTour(t){var e;(e=this.cs)==null||e.resetTour(t)}resetAllTours(){var t;(t=this.cs)==null||t.resetAllTours()}cancelPendingTour(t){var e;(e=this.cs)==null||e.cancelPendingTour(t)}}},zT={siteApps:class{constructor(t){this._instance=t,this._s=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}gs(t,e){if(e){var n=this.globalsForEvent(e);this._s.push(n),this._s.length>1e3&&(this._s=this._s.slice(10))}}get siteAppLoaders(){var t;return(t=G._POSTHOG_REMOTE_CONFIG)==null||(t=t[this._instance.config.token])==null?void 0:t.siteApps}init(){if(this.isEnabled){var t=this._instance._addCaptureHook(this.gs.bind(this));this.bs=()=>{t(),this._s=[],this.bs=void 0}}}globalsForEvent(t){var e,n,r,s,o,i,a;if(!t)throw new Error("Event payload is required");var l={},u=this._instance.get_property("$groups")||[],d=this._instance.get_property("$stored_group_properties")||{};for(var[h,f]of Object.entries(d))l[h]={id:u[h],type:h,properties:f};var{$set_once:m,$set:v}=t;return{event:F({},zm(t,LT),{properties:F({},t.properties,v?{$set:F({},(e=(n=t.properties)==null?void 0:n.$set)!==null&&e!==void 0?e:{},v)}:{},m?{$set_once:F({},(r=(s=t.properties)==null?void 0:s.$set_once)!==null&&r!==void 0?r:{},m)}:{}),elements_chain:(o=(i=t.properties)==null?void 0:i.$elements_chain)!==null&&o!==void 0?o:"",distinct_id:(a=t.properties)==null?void 0:a.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}setupSiteApp(t){var e=this.apps[t.id],n=()=>{var i;!e.errored&&this._s.length&&(rn.info("Processing "+this._s.length+" events for site app with id "+t.id),this._s.forEach(a=>e.processEvent==null?void 0:e.processEvent(a)),e.processedBuffer=!0),Object.values(this.apps).every(a=>a.processedBuffer||a.errored)&&((i=this.bs)==null||i.call(this))},r=!1,s=i=>{e.errored=!i,e.loaded=!0,rn.info("Site app with id "+t.id+" "+(i?"loaded":"errored")),r&&n()};try{var{processEvent:o}=t.init({posthog:this._instance,callback:i=>{s(i)}});o&&(e.processEvent=o),r=!0}catch(i){rn.error("Error while initializing PostHog app with config id "+t.id,i),s(!1)}if(r&&e.loaded)try{n()}catch(i){rn.error("Error while processing buffered events PostHog app with config id "+t.id,i),e.errored=!0}}ys(){var t=this.siteAppLoaders||[];for(var e of t)this.apps[e.id]={id:e.id,loaded:!1,errored:!1,processedBuffer:!1};for(var n of t)this.setupSiteApp(n)}ws(t){if(Object.keys(this.apps).length!==0){var e=this.globalsForEvent(t);for(var n of Object.values(this.apps))try{n.processEvent==null||n.processEvent(e)}catch(r){rn.error("Error while processing event "+t.event+" for site app "+n.id,r)}}}onRemoteConfig(t){var e,n,r,s=this;if((e=this.siteAppLoaders)!=null&&e.length)return this.isEnabled?(this.ys(),void this._instance.on("eventCaptured",l=>this.ws(l))):void rn.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((n=this.bs)==null||n.call(this),(r=t.siteApps)!=null&&r.length)if(this.isEnabled){var o=function(l){var u;G["__$$ph_site_app_"+l]=s._instance,(u=G.__PosthogExtensions__)==null||u.loadSiteApp==null||u.loadSiteApp(s._instance,a,d=>{if(d)return rn.error("Error while initializing PostHog app with config id "+l,d)})};for(var{id:i,url:a}of t.siteApps)o(i)}else rn.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},UT=F({},FT,$T,VT,BT,zT,{tracingHeaders:class{constructor(t){this.xs=void 0,this.$s=void 0,this.ss=()=>{var e,n;$(this.xs)&&((e=G.__PosthogExtensions__)==null||(e=e.tracingHeadersPatchFns)==null||e._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),$(this.$s)&&((n=G.__PosthogExtensions__)==null||(n=n.tracingHeadersPatchFns)==null||n._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=t}V(t){var e,n;(e=G.__PosthogExtensions__)!=null&&e.tracingHeadersPatchFns&&t(),(n=G.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"tracing-headers",r=>{if(r)return DT.error("failed to load script",r);t()})}startIfEnabledOrStop(){var t,e;this._instance.config.__add_tracing_headers?this.V(this.ss):((t=this.xs)==null||t.call(this),(e=this.$s)==null||e.call(this),this.xs=void 0,this.$s=void 0)}}});jt.__defaultExtensionClasses=F({},UT);var Sh;(function(t){return t.SHOWN="product tour shown",t.DISMISSED="product tour dismissed",t.COMPLETED="product tour completed",t.STEP_SHOWN="product tour step shown",t.STEP_COMPLETED="product tour step completed",t.BUTTON_CLICKED="product tour button clicked",t.STEP_SELECTOR_FAILED="product tour step selector failed",t.BANNER_CONTAINER_SELECTOR_FAILED="product tour banner container selector failed",t.BANNER_ACTION_CLICKED="product tour banner action clicked",t})({});(function(t){return t.TOUR_ID="$product_tour_id",t.TOUR_NAME="$product_tour_name",t.TOUR_ITERATION="$product_tour_iteration",t.TOUR_RENDER_REASON="$product_tour_render_reason",t.TOUR_STEP_ID="$product_tour_step_id",t.TOUR_STEP_ORDER="$product_tour_step_order",t.TOUR_STEP_TYPE="$product_tour_step_type",t.TOUR_DISMISS_REASON="$product_tour_dismiss_reason",t.TOUR_BUTTON_TEXT="$product_tour_button_text",t.TOUR_BUTTON_ACTION="$product_tour_button_action",t.TOUR_BUTTON_LINK="$product_tour_button_link",t.TOUR_BUTTON_TOUR_ID="$product_tour_button_tour_id",t.TOUR_STEPS_COUNT="$product_tour_steps_count",t.TOUR_STEP_SELECTOR="$product_tour_step_selector",t.TOUR_STEP_SELECTOR_FOUND="$product_tour_step_selector_found",t.TOUR_STEP_ELEMENT_TAG="$product_tour_step_element_tag",t.TOUR_STEP_ELEMENT_ID="$product_tour_step_element_id",t.TOUR_STEP_ELEMENT_CLASSES="$product_tour_step_element_classes",t.TOUR_STEP_ELEMENT_TEXT="$product_tour_step_element_text",t.TOUR_ERROR="$product_tour_error",t.TOUR_MATCHES_COUNT="$product_tour_matches_count",t.TOUR_FAILURE_PHASE="$product_tour_failure_phase",t.TOUR_WAITED_FOR_ELEMENT="$product_tour_waited_for_element",t.TOUR_WAIT_DURATION_MS="$product_tour_wait_duration_ms",t.TOUR_BANNER_SELECTOR="$product_tour_banner_selector",t.TOUR_LINKED_SURVEY_ID="$product_tour_linked_survey_id",t.USE_MANUAL_SELECTOR="$use_manual_selector",t.INFERENCE_DATA_PRESENT="$inference_data_present",t})({});var Is=(Sh=As[Xn]=new jt,function(){function t(){t.done||(t.done=!0,Lg=!1,he(As,function(e){e._dom_loaded()}))}L!=null&&L.addEventListener?L.readyState==="complete"?t():Ce(L,"DOMContentLoaded",t,{capture:!1}):j&&V.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),Sh);const HT=Object.freeze(Object.defineProperty({__proto__:null,Compression:Tt,DisplaySurveyType:wi,PostHog:jt,SurveyEventName:Qn,SurveyEventProperties:Yo,SurveyEventType:Yn,SurveyType:qo,default:Is,posthog:Is},Symbol.toStringTag,{value:"Module"})),Aa={trackPageView:(t,e)=>{typeof window<"u"&&window.gtag&&window.gtag("config","G-RKW2321F04",{page_path:t,page_title:e||document.title})},trackEvent:(t,e)=>{typeof window<"u"&&window.gtag&&window.gtag("event",t,e),typeof window<"u"&&Is.capture(t,e)},identifyUser:(t,e)=>{typeof window<"u"&&Is.identify(t,e)},resetUser:()=>{typeof window<"u"&&Is.reset()},initialize:()=>{typeof window<"u"&&window.gtag&&window.gtag("config","G-RKW2321F04",{page_path:window.location.pathname,page_title:document.title})}},Yg=p.createContext(void 0),Th=(t,e)=>Promise.race([t,new Promise((n,r)=>setTimeout(()=>r(new Error("Timeout")),e))]),WT=()=>{try{const t=e=>{const n=[];for(let r=0;r<e.length;r++){const s=e.key(r);s&&(s.includes("-auth-token")||s.includes("-code-verifier"))&&n.push(s)}n.forEach(r=>e.removeItem(r))};t(localStorage),t(sessionStorage),sessionStorage.removeItem("pendingAuthRedirect"),sessionStorage.removeItem("storyMakerDraft")}catch(t){console.warn("Error purging auth storage:",t)}},GT=({children:t})=>{const[e,n]=p.useState(null),[r,s]=p.useState(null),[o,i]=p.useState(!0),a=p.useRef(!1),l=p.useRef(0),{toast:u}=kp(),d=p.useCallback(async w=>{const E=w||e?.id;if(E)try{console.log("[AUTH] Refreshing subscription for:",E),await SE(!0)}catch(b){console.error("[AUTH] Error refreshing subscription:",b),Pt.error("Subscription refresh failed",{description:"Could not update your subscription status. Please try again later."})}},[e?.id]);p.useEffect(()=>{const{data:{subscription:w}}=ce.auth.onAuthStateChange((E,b)=>{if(console.log("[AUTH] Event:",E),a.current&&E!=="SIGNED_OUT"){console.log("[AUTH] Ignoring event during sign-out:",E);return}if(Date.now()<l.current&&(E==="SIGNED_IN"||E==="TOKEN_REFRESHED")){console.log("[AUTH] Ignoring late rehydration event after sign-out:",E);return}s(b);const T=b?.user?.id??null;n(k=>{const P=k?.id??null;return P===T&&P!==null?k:b?.user??null}),E==="SIGNED_OUT"&&(Aa.resetUser(),a.current=!1),i(!1)});return ce.auth.getSession().then(({data:{session:E}})=>{s(E),n(E?.user??null),i(!1)}),()=>w.unsubscribe()},[]),p.useEffect(()=>{if(!e||a.current)return;let w=!1;return(async()=>{Aa.identifyUser(e.id,{email:e.email,user_type:e.user_metadata?.user_type});try{const b=e.user_metadata,T=b?.avatar_url||b?.picture;if(T){const{data:k}=await ce.from("profiles").select("avatar_url").eq("id",e.id).single();!w&&!k?.avatar_url&&await ce.from("profiles").update({avatar_url:T}).eq("id",e.id)}}catch(b){console.error("[AUTH] Avatar sync error:",b)}if(!w)try{await d(e.id)}catch(b){console.error("[AUTH] Subscription refresh error on sign-in:",b)}})(),()=>{w=!0}},[e?.id]);const h=async(w,E)=>{try{i(!0);const{data:b,error:T}=await ce.auth.signInWithPassword({email:w,password:E});if(T)throw T}catch(b){throw console.error("Error signing in:",b),b}finally{i(!1)}},f=async(w,E,b,T)=>{try{i(!0);const{error:k}=await ce.auth.signUp({email:w,password:E,options:{data:{user_type:b||"free",display_name:T}}});if(k)throw u({title:"Sign up failed",description:k.message,variant:"destructive"}),k}catch(k){throw console.error("Error signing up:",k),k}finally{i(!1)}},m=async(w,E)=>{try{i(!0);const{error:b}=await ce.auth.signInWithOAuth({provider:w});if(b)throw u({title:`${E} sign in failed`,description:b.message,variant:"destructive"}),b}catch(b){throw console.error(`Error signing in with ${E}:`,b),b}finally{i(!1)}},v=()=>m("google","Google"),g=()=>m("facebook","Facebook"),y=()=>m("twitter","X"),_=()=>m("azure","Microsoft"),x=async()=>{a.current=!0;try{i(!0),Aa.resetUser();try{await Th(ce.auth.signOut(),3e3)}catch(w){console.warn("[AUTH] Global sign-out failed/timed out:",w);try{await Th(ce.auth.signOut({scope:"local"}),2e3)}catch(E){console.warn("[AUTH] Local sign-out also failed:",E)}}}catch(w){console.error("[AUTH] Sign-out error:",w)}finally{WT(),n(null),s(null),i(!1),l.current=Date.now()+2e3,a.current=!1}};return c.jsx(Yg.Provider,{value:{user:e,session:r,isLoading:o,signIn:h,signUp:f,signInWithGoogle:v,signInWithFacebook:g,signInWithTwitter:y,signInWithMicrosoft:_,signOut:x,refreshSubscription:d},children:t})},Wc=()=>{const t=p.useContext(Yg);if(t===void 0)throw new Error("useAuth must be used within an AuthProvider");return t},KT=(t,e,n)=>{const r=t[e];return r?typeof r=="function"?r():Promise.resolve(r):new Promise((s,o)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(o.bind(null,new Error("Unknown variable dynamic import: "+e+(e.split("/").length!==n?". Note that variables only represent file names one level deep.":""))))})};var qT=function(e){return{type:"backend",init:function(r,s,o){},read:function(r,s,o){if(typeof e=="function"){if(e.length<3){try{var i=e(r,s);i&&typeof i.then=="function"?i.then(function(a){return o(null,a&&a.default||a)}).catch(o):o(null,i)}catch(a){o(a)}return}e(r,s,o);return}o(null,e&&e[r]&&e[r][s])}}};const Ys=["en","zh","bn","es","ja"],Xg=["navbar","footer"],YT={"":["home","landing"],subscription:["subscription"],stories:["stories"],themes:["themes"],theme:["themes"],about:["about"],contact:["contact"],"improve-reading":["improve-reading"],"text-checker":["text-checker"],"reading-cart":["reading-cart"],vocabulary:["vocabulary"],progress:["progress"],research:["research"],blog:["blog","newsletter"],"story-maker":["story-maker"],story:["story-reader"],auth:["auth"],login:["auth"],signup:["auth"],"verify-email":["auth"],"reset-password":["auth"],terms:["terms"],privacy:["privacy"],refund:["refund"],newsletter:["newsletter"],"payment-status":["payment-status"],payment:["payment-status"],stripe:["payment-status"]};function Bl(t){const e=t.split("/").filter(Boolean)[0]?.toLowerCase();return Ys.includes(e)?e:"en"}function zl(t){const e=t.split("/").filter(Boolean),n=e[0]?.toLowerCase(),s=((Ys.includes(n)?e.slice(1):e)[0]||"").toLowerCase(),o=YT[s]??[];return Array.from(new Set([...Xg,...o]))}const XT=typeof window<"u"?Bl(window.location.pathname):"en";Ep.use(qT((t,e)=>KT(Object.assign({"../locales/bn/about.json":()=>S(()=>import("./about-IMrI-vB2.js"),[]),"../locales/bn/auth.json":()=>S(()=>import("./auth-527YGbra.js"),[]),"../locales/bn/blog.json":()=>S(()=>import("./blog-CRDfTz6g.js"),[]),"../locales/bn/contact.json":()=>S(()=>import("./contact-3LVKK4oT.js"),[]),"../locales/bn/footer.json":()=>S(()=>import("./footer-BSxBqHhD.js"),[]),"../locales/bn/generation.json":()=>S(()=>import("./generation-CbNDqnSu.js"),[]),"../locales/bn/home.json":()=>S(()=>import("./home-5IDLJ1L2.js"),[]),"../locales/bn/improve-reading.json":()=>S(()=>import("./improve-reading-CfTBjAlp.js"),[]),"../locales/bn/landing.json":()=>S(()=>import("./landing-DvNLxy8Y.js"),[]),"../locales/bn/navbar.json":()=>S(()=>import("./navbar-BWEOBUG7.js"),[]),"../locales/bn/newsletter.json":()=>S(()=>import("./newsletter-1T6UBzkr.js"),[]),"../locales/bn/notfound.json":()=>S(()=>import("./notfound-CPkJ3HOw.js"),[]),"../locales/bn/payment-status.json":()=>S(()=>import("./payment-status-wgfjMmgM.js"),[]),"../locales/bn/privacy.json":()=>S(()=>import("./privacy-DTLzvZAR.js"),[]),"../locales/bn/progress.json":()=>S(()=>import("./progress-BYexOijN.js"),[]),"../locales/bn/reading-cart.json":()=>S(()=>import("./reading-cart-BCd2nmAM.js"),[]),"../locales/bn/refund.json":()=>S(()=>import("./refund-75w9UWZs.js"),[]),"../locales/bn/research.json":()=>S(()=>import("./research-C9DfPdmg.js"),[]),"../locales/bn/stories.json":()=>S(()=>import("./stories-DQKP8VzD.js"),[]),"../locales/bn/story-maker.json":()=>S(()=>import("./story-maker-spUs0PQV.js"),[]),"../locales/bn/story-reader.json":()=>S(()=>import("./story-reader-CQcceV-f.js"),[]),"../locales/bn/subscription.json":()=>S(()=>import("./subscription-CWp09wcj.js"),[]),"../locales/bn/terms.json":()=>S(()=>import("./terms-DKuS4yZL.js"),[]),"../locales/bn/text-checker.json":()=>S(()=>import("./text-checker-CkQ1SWkj.js"),[]),"../locales/bn/themes.json":()=>S(()=>import("./themes-DRAP3_KB.js"),[]),"../locales/bn/vocabulary.json":()=>S(()=>import("./vocabulary-CCWpBz8Y.js"),[]),"../locales/en/about.json":()=>S(()=>import("./about-Cfi7PXQF.js"),[]),"../locales/en/auth.json":()=>S(()=>import("./auth-ChcFz0rH.js"),[]),"../locales/en/blog.json":()=>S(()=>import("./blog-DaqAtZWV.js"),[]),"../locales/en/contact.json":()=>S(()=>import("./contact-B1ewm6S_.js"),[]),"../locales/en/footer.json":()=>S(()=>import("./footer-Cj59KvtR.js"),[]),"../locales/en/generation.json":()=>S(()=>import("./generation-UrkKrDMw.js"),[]),"../locales/en/home.json":()=>S(()=>import("./home-i-64rcvp.js"),[]),"../locales/en/improve-reading.json":()=>S(()=>import("./improve-reading-Ba0OnmAu.js"),[]),"../locales/en/landing.json":()=>S(()=>import("./landing-DM_Z-0ac.js"),[]),"../locales/en/navbar.json":()=>S(()=>import("./navbar-D4XjqLhY.js"),[]),"../locales/en/newsletter.json":()=>S(()=>import("./newsletter-BaqeoYHu.js"),[]),"../locales/en/notfound.json":()=>S(()=>import("./notfound-CQuG0LtW.js"),[]),"../locales/en/payment-status.json":()=>S(()=>import("./payment-status-C7SHYdC9.js"),[]),"../locales/en/privacy.json":()=>S(()=>import("./privacy-D9qnP2jO.js"),[]),"../locales/en/progress.json":()=>S(()=>import("./progress-DbOw3W9u.js"),[]),"../locales/en/reading-cart.json":()=>S(()=>import("./reading-cart-BptBWt_r.js"),[]),"../locales/en/refund.json":()=>S(()=>import("./refund-CC1P1Dku.js"),[]),"../locales/en/research.json":()=>S(()=>import("./research-BW5Fbins.js"),[]),"../locales/en/stories.json":()=>S(()=>import("./stories-BthT35i0.js"),[]),"../locales/en/story-maker.json":()=>S(()=>import("./story-maker-CJAnJm6t.js"),[]),"../locales/en/story-reader.json":()=>S(()=>import("./story-reader-Dnw2Ezjl.js"),[]),"../locales/en/subscription.json":()=>S(()=>import("./subscription-Dj8KOFas.js"),[]),"../locales/en/terms.json":()=>S(()=>import("./terms-NVC40PjG.js"),[]),"../locales/en/text-checker.json":()=>S(()=>import("./text-checker-BkJbNwhe.js"),[]),"../locales/en/themes.json":()=>S(()=>import("./themes-CkPi0xuD.js"),[]),"../locales/en/vocabulary.json":()=>S(()=>import("./vocabulary-43COnWwL.js"),[]),"../locales/es/about.json":()=>S(()=>import("./about-CzvVkbDv.js"),[]),"../locales/es/auth.json":()=>S(()=>import("./auth-CWyG6RSy.js"),[]),"../locales/es/blog.json":()=>S(()=>import("./blog-BG7p7K8N.js"),[]),"../locales/es/contact.json":()=>S(()=>import("./contact-BZPyAx2-.js"),[]),"../locales/es/footer.json":()=>S(()=>import("./footer-BZPiJHxT.js"),[]),"../locales/es/generation.json":()=>S(()=>import("./generation-CoyA_3Lk.js"),[]),"../locales/es/home.json":()=>S(()=>import("./home-Dfzi3n6j.js"),[]),"../locales/es/improve-reading.json":()=>S(()=>import("./improve-reading-cSc0CSFc.js"),[]),"../locales/es/landing.json":()=>S(()=>import("./landing-CLCn5RB6.js"),[]),"../locales/es/navbar.json":()=>S(()=>import("./navbar-BthOgS2j.js"),[]),"../locales/es/newsletter.json":()=>S(()=>import("./newsletter-C7lJho9h.js"),[]),"../locales/es/notfound.json":()=>S(()=>import("./notfound-B_Gzz6gc.js"),[]),"../locales/es/payment-status.json":()=>S(()=>import("./payment-status-B32pY1CE.js"),[]),"../locales/es/privacy.json":()=>S(()=>import("./privacy-CLStpuoK.js"),[]),"../locales/es/progress.json":()=>S(()=>import("./progress-BcsPwhns.js"),[]),"../locales/es/reading-cart.json":()=>S(()=>import("./reading-cart-GwQBdftB.js"),[]),"../locales/es/refund.json":()=>S(()=>import("./refund-CHPr9L0z.js"),[]),"../locales/es/research.json":()=>S(()=>import("./research-DqNLNc5F.js"),[]),"../locales/es/stories.json":()=>S(()=>import("./stories-CVRvuLz2.js"),[]),"../locales/es/story-maker.json":()=>S(()=>import("./story-maker-C5NBEexq.js"),[]),"../locales/es/story-reader.json":()=>S(()=>import("./story-reader-BbMNfAUy.js"),[]),"../locales/es/subscription.json":()=>S(()=>import("./subscription-CZhn2cU7.js"),[]),"../locales/es/terms.json":()=>S(()=>import("./terms-CTcFR6yJ.js"),[]),"../locales/es/text-checker.json":()=>S(()=>import("./text-checker-CLT6Nwe8.js"),[]),"../locales/es/themes.json":()=>S(()=>import("./themes-DCZTUMpt.js"),[]),"../locales/es/vocabulary.json":()=>S(()=>import("./vocabulary-CP1qAXI7.js"),[]),"../locales/ja/about.json":()=>S(()=>import("./about-Ct4afmar.js"),[]),"../locales/ja/auth.json":()=>S(()=>import("./auth-dV0lN-LO.js"),[]),"../locales/ja/blog.json":()=>S(()=>import("./blog-BZZnUCkp.js"),[]),"../locales/ja/contact.json":()=>S(()=>import("./contact-BBFLer9D.js"),[]),"../locales/ja/footer.json":()=>S(()=>import("./footer-D-BMgFYB.js"),[]),"../locales/ja/generation.json":()=>S(()=>import("./generation-Pdrq8ZB-.js"),[]),"../locales/ja/home.json":()=>S(()=>import("./home-xirgBP8l.js"),[]),"../locales/ja/improve-reading.json":()=>S(()=>import("./improve-reading-BsRzsehI.js"),[]),"../locales/ja/landing.json":()=>S(()=>import("./landing-COdzYQPO.js"),[]),"../locales/ja/navbar.json":()=>S(()=>import("./navbar-FFSzRUGt.js"),[]),"../locales/ja/newsletter.json":()=>S(()=>import("./newsletter-DJBHGpWh.js"),[]),"../locales/ja/notfound.json":()=>S(()=>import("./notfound-Wrvu-KxG.js"),[]),"../locales/ja/payment-status.json":()=>S(()=>import("./payment-status-BwvT-6IN.js"),[]),"../locales/ja/privacy.json":()=>S(()=>import("./privacy-DI-ylDP2.js"),[]),"../locales/ja/progress.json":()=>S(()=>import("./progress-7pJUl9iw.js"),[]),"../locales/ja/reading-cart.json":()=>S(()=>import("./reading-cart-D1G8OPkf.js"),[]),"../locales/ja/refund.json":()=>S(()=>import("./refund-CYHonIjU.js"),[]),"../locales/ja/research.json":()=>S(()=>import("./research-CivulXLD.js"),[]),"../locales/ja/stories.json":()=>S(()=>import("./stories-xVkqpFyE.js"),[]),"../locales/ja/story-maker.json":()=>S(()=>import("./story-maker-Cji5XC0z.js"),[]),"../locales/ja/story-reader.json":()=>S(()=>import("./story-reader-CfRYkEJG.js"),[]),"../locales/ja/subscription.json":()=>S(()=>import("./subscription-BlMCO5U6.js"),[]),"../locales/ja/terms.json":()=>S(()=>import("./terms-CssJnV-J.js"),[]),"../locales/ja/text-checker.json":()=>S(()=>import("./text-checker-DSz7QeV-.js"),[]),"../locales/ja/themes.json":()=>S(()=>import("./themes-B3Dt6ojX.js"),[]),"../locales/ja/vocabulary.json":()=>S(()=>import("./vocabulary-CA_-k2Kb.js"),[]),"../locales/zh/about.json":()=>S(()=>import("./about-wynC5o3J.js"),[]),"../locales/zh/auth.json":()=>S(()=>import("./auth-CvR0HAI4.js"),[]),"../locales/zh/blog.json":()=>S(()=>import("./blog-BuGisSqj.js"),[]),"../locales/zh/contact.json":()=>S(()=>import("./contact-TRjNzjJw.js"),[]),"../locales/zh/footer.json":()=>S(()=>import("./footer-CZTn0yOr.js"),[]),"../locales/zh/generation.json":()=>S(()=>import("./generation-DmueeL_y.js"),[]),"../locales/zh/home.json":()=>S(()=>import("./home-BKeSHLWz.js"),[]),"../locales/zh/improve-reading.json":()=>S(()=>import("./improve-reading-Dv7w1L9N.js"),[]),"../locales/zh/landing.json":()=>S(()=>import("./landing-CInxhw3d.js"),[]),"../locales/zh/navbar.json":()=>S(()=>import("./navbar-BrsdzXsD.js"),[]),"../locales/zh/newsletter.json":()=>S(()=>import("./newsletter-wGuJRvTc.js"),[]),"../locales/zh/notfound.json":()=>S(()=>import("./notfound-BHjB4e-M.js"),[]),"../locales/zh/payment-status.json":()=>S(()=>import("./payment-status-ubxHsmFd.js"),[]),"../locales/zh/privacy.json":()=>S(()=>import("./privacy-y1aPYI4v.js"),[]),"../locales/zh/progress.json":()=>S(()=>import("./progress-BmrsDT3B.js"),[]),"../locales/zh/reading-cart.json":()=>S(()=>import("./reading-cart-DvJQrLvq.js"),[]),"../locales/zh/refund.json":()=>S(()=>import("./refund-VHDYVAUj.js"),[]),"../locales/zh/research.json":()=>S(()=>import("./research-funY68fu.js"),[]),"../locales/zh/stories.json":()=>S(()=>import("./stories-DZir73N6.js"),[]),"../locales/zh/story-maker.json":()=>S(()=>import("./story-maker-CwhU-fq9.js"),[]),"../locales/zh/story-reader.json":()=>S(()=>import("./story-reader-Kw0wr9wN.js"),[]),"../locales/zh/subscription.json":()=>S(()=>import("./subscription-Dm4UZQV5.js"),[]),"../locales/zh/terms.json":()=>S(()=>import("./terms-oJg-2cMy.js"),[]),"../locales/zh/text-checker.json":()=>S(()=>import("./text-checker-FwX8r5pE.js"),[]),"../locales/zh/themes.json":()=>S(()=>import("./themes-QUDfBGZx.js"),[]),"../locales/zh/vocabulary.json":()=>S(()=>import("./vocabulary-BWISugwZ.js"),[])}),`../locales/${t}/${e}.json`,4))).use(W_).init({lng:XT,fallbackLng:"en",defaultNS:"home",ns:[...Xg],partialBundledLanguages:!0,load:"languageOnly",supportedLngs:Ys,nonExplicitSupportedLngs:!0,interpolation:{escapeValue:!1},react:{useSuspense:!0}});const Zg=p.createContext(void 0),ZT=({children:t})=>{const{i18n:e}=Ue(),n=gc(),r=io(),[s,o]=p.useState(()=>Bl(typeof window<"u"?window.location.pathname:"/")),[i,a]=p.useState(!1),l=p.useRef(null),u=[];p.useEffect(()=>{const f=Bl(r.pathname),m=zl(r.pathname);o(f);let v=!1;return e.loadNamespaces(m).finally(()=>{!v&&e.language!==f?e.changeLanguage(f):v||e.changeLanguage(f),v||(a(!1),l.current&&(clearTimeout(l.current),l.current=null))}),()=>{v=!0}},[r.pathname,e]);const d=async f=>{if(f===s)return;a(!0),l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{a(!1)},4e3);let m=r.pathname;m.startsWith("/bn/")?m=m.substring(3):m==="/bn"?m="/":m.startsWith("/es/")?m=m.substring(3):m==="/es"?m="/":m.startsWith("/zh/")?m=m.substring(3):m==="/zh"?m="/":m.startsWith("/ja/")?m=m.substring(3):m==="/ja"&&(m="/");const v=u.includes(m);let g=m;!v&&f!=="en"&&(g=m==="/"?`/${f}/`:`/${f}${m}`);const y=zl(g),_=new Promise(x=>setTimeout(x,400));try{await Promise.all([e.loadNamespaces(y),_])}catch{}o(f),await e.changeLanguage(f),g!==r.pathname&&n(g),a(!1),l.current&&(clearTimeout(l.current),l.current=null)},h=f=>{const m=u.includes(f);return s==="bn"&&!m?f==="/"?"/bn/":`/bn${f}`:s==="es"&&!m?f==="/"?"/es/":`/es${f}`:s==="zh"&&!m?f==="/"?"/zh/":`/zh${f}`:s==="ja"&&!m?f==="/"?"/ja/":`/ja${f}`:f};return c.jsx(Zg.Provider,{value:{currentLanguage:s,changeLanguage:d,getLocalizedPath:h,isSwitchingLanguage:i},children:t})},Dn=()=>{const t=p.useContext(Zg);if(t===void 0)throw new Error("useLanguage must be used within a LanguageProvider");return t},Jg=p.createContext({targetElement:null,setLumiTarget:()=>{},onTargetReached:void 0,setOnTargetReached:()=>{}}),Qg=()=>p.useContext(Jg),JT=({children:t})=>{const[e,n]=p.useState(null),r=p.useRef(void 0),[,s]=p.useState(0),o=p.useCallback(a=>{n(a)},[]),i=p.useCallback(a=>{r.current=a,s(l=>l+1)},[]);return c.jsx(Jg.Provider,{value:{targetElement:e,setLumiTarget:o,onTargetReached:r.current,setOnTargetReached:i},children:t})},Gc=p.createContext({});function vn(t){const e=p.useRef(null);return e.current===null&&(e.current=t()),e.current}const Kc=typeof window<"u",po=Kc?p.useLayoutEffect:p.useEffect,Zi=p.createContext(null),mo=p.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});class QT extends p.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(n&&e.isPresent&&!this.props.isPresent){const r=n.offsetParent,s=r instanceof HTMLElement&&r.offsetWidth||0,o=this.props.sizeRef.current;o.height=n.offsetHeight||0,o.width=n.offsetWidth||0,o.top=n.offsetTop,o.left=n.offsetLeft,o.right=s-o.width-o.left}return null}componentDidUpdate(){}render(){return this.props.children}}function ek({children:t,isPresent:e,anchorX:n}){const r=p.useId(),s=p.useRef(null),o=p.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:i}=p.useContext(mo);return p.useInsertionEffect(()=>{const{width:a,height:l,top:u,left:d,right:h}=o.current;if(e||!s.current||!a||!l)return;const f=n==="left"?`left: ${d}`:`right: ${h}`;s.current.dataset.motionPopId=r;const m=document.createElement("style");return i&&(m.nonce=i),document.head.appendChild(m),m.sheet&&m.sheet.insertRule(`
[data-motion-pop-id="${r}"] {
position: absolute !important;
width: ${a}px !important;
height: ${l}px !important;
${f}px !important;
top: ${u}px !important;
}
`),()=>{document.head.removeChild(m)}},[e]),c.jsx(QT,{isPresent:e,childRef:s,sizeRef:o,children:p.cloneElement(t,{ref:s})})}const tk=({children:t,initial:e,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:o,mode:i,anchorX:a})=>{const l=vn(nk),u=p.useId(),d=p.useCallback(f=>{l.set(f,!0);for(const m of l.values())if(!m)return;r&&r()},[l,r]),h=p.useMemo(()=>({id:u,initial:e,isPresent:n,custom:s,onExitComplete:d,register:f=>(l.set(f,!1),()=>l.delete(f))}),o?[Math.random(),d]:[n,d]);return p.useMemo(()=>{l.forEach((f,m)=>l.set(m,!1))},[n]),p.useEffect(()=>{!n&&!l.size&&r&&r()},[n]),i==="popLayout"&&(t=c.jsx(ek,{isPresent:n,anchorX:a,children:t})),c.jsx(Zi.Provider,{value:h,children:t})};function nk(){return new Map}function ev(t=!0){const e=p.useContext(Zi);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=e,o=p.useId();p.useEffect(()=>{if(t)return s(o)},[t]);const i=p.useCallback(()=>t&&r&&r(o),[o,r,t]);return!n&&r?[!1,i]:[!0]}const Oo=t=>t.key||"";function kh(t){const e=[];return p.Children.forEach(t,n=>{p.isValidElement(n)&&e.push(n)}),e}const rk=({children:t,custom:e,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:o="sync",propagate:i=!1,anchorX:a="left"})=>{const[l,u]=ev(i),d=p.useMemo(()=>kh(t),[t]),h=i&&!l?[]:d.map(Oo),f=p.useRef(!0),m=p.useRef(d),v=vn(()=>new Map),[g,y]=p.useState(d),[_,x]=p.useState(d);po(()=>{f.current=!1,m.current=d;for(let b=0;b<_.length;b++){const T=Oo(_[b]);h.includes(T)?v.delete(T):v.get(T)!==!0&&v.set(T,!1)}},[_,h.length,h.join("-")]);const w=[];if(d!==g){let b=[...d];for(let T=0;T<_.length;T++){const k=_[T],P=Oo(k);h.includes(P)||(b.splice(T,0,k),w.push(k))}return o==="wait"&&w.length&&(b=w),x(kh(b)),y(d),null}const{forceRender:E}=p.useContext(Gc);return c.jsx(c.Fragment,{children:_.map(b=>{const T=Oo(b),k=i&&!l?!1:d===_||h.includes(T),P=()=>{if(v.has(T))v.set(T,!0);else return;let O=!0;v.forEach(R=>{R||(O=!1)}),O&&(E?.(),x(m.current),i&&u?.(),r&&r())};return c.jsx(tk,{isPresent:k,initial:!f.current||n?void 0:!1,custom:e,presenceAffectsLayout:s,mode:o,onExitComplete:k?void 0:P,anchorX:a,children:b},T)})})};function qc(t,e){t.indexOf(e)===-1&&t.push(e)}function Yc(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}let sk=()=>{},Ul=()=>{};const ok={skipAnimations:!1,useManualTiming:!1};function Xc(t){let e;return()=>(e===void 0&&(e=t()),e)}const Ke=t=>t,vr=(t,e,n)=>{const r=e-t;return r===0?1:(n-t)/r};class Zc{constructor(){this.subscriptions=[]}add(e){return qc(this.subscriptions,e),()=>Yc(this.subscriptions,e)}notify(e,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](e,n,r);else for(let o=0;o<s;o++){const i=this.subscriptions[o];i&&i(e,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const At=t=>t*1e3,It=t=>t/1e3;function Jc(t,e){return e?t*(1e3/e):0}const tv=Xc(()=>window.ScrollTimeline!==void 0);class ik{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,n){for(let r=0;r<this.animations.length;r++)this.animations[r][e]=n}attachTimeline(e,n){const r=this.animations.map(s=>{if(tv()&&s.attachTimeline)return s.attachTimeline(e);if(typeof n=="function")return n(s)});return()=>{r.forEach((s,o)=>{s&&s(),this.animations[o].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get startTime(){return this.getAll("startTime")}get duration(){let e=0;for(let n=0;n<this.animations.length;n++)e=Math.max(e,this.animations[n].duration);return e}runAll(e){this.animations.forEach(n=>n[e]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class ak extends ik{then(e,n){return this.finished.finally(e).then(()=>{})}}const Ph={value:null,addProjectionMetrics:null},Qc=t=>Array.isArray(t)&&typeof t[0]=="number",lk={};function ck(t,e){const n=Xc(t);return()=>lk[e]??n()}const Xs=ck(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),nv=(t,e,n=10)=>{let r="";const s=Math.max(Math.round(e/n),2);for(let o=0;o<s;o++)r+=t(o/(s-1))+", ";return`linear(${r.substring(0,r.length-2)})`},Ss=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,Hl={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ss([0,.65,.55,1]),circOut:Ss([.55,0,1,.45]),backIn:Ss([.31,.01,.66,-.59]),backOut:Ss([.33,1.53,.69,.99])};function rv(t,e){if(t)return typeof t=="function"&&Xs()?nv(t,e):Qc(t)?Ss(t):Array.isArray(t)?t.map(n=>rv(n,e)||Hl.easeOut):Hl[t]}function uk(t,e,n,{delay:r=0,duration:s=300,repeat:o=0,repeatType:i="loop",ease:a="easeInOut",times:l}={},u=void 0){const d={[e]:n};l&&(d.offset=l);const h=rv(a,s);return Array.isArray(h)&&(d.easing=h),t.animate(d,{delay:r,duration:s,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:o+1,direction:i==="reverse"?"alternate":"normal",pseudoElement:u})}function eu(t){return typeof t=="function"&&"applyToOptions"in t}function tu(t,e){return t?.[e]??t?.default??t}const Si=2e4;function nu(t){let e=0;const n=50;let r=t.next(e);for(;!r.done&&e<Si;)e+=n,r=t.next(e);return e>=Si?1/0:e}function dk(t,e=100,n){const r=n({...t,keyframes:[0,e]}),s=Math.min(nu(r),Si);return{type:"keyframes",ease:o=>r.next(s*o).value/e,duration:It(s)}}function sv(t){return!!(typeof t=="function"&&Xs()||!t||typeof t=="string"&&(t in Hl||Xs())||Qc(t)||Array.isArray(t)&&t.every(sv))}function Ch(t,e){t.timeline=e,t.onfinish=null}const Do=["read","resolveKeyframes","update","preRender","render","postRender"];function hk(t,e){let n=new Set,r=new Set,s=!1,o=!1;const i=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function u(h){i.has(h)&&(d.schedule(h),t()),l++,h(a)}const d={schedule:(h,f=!1,m=!1)=>{const g=m&&s?n:r;return f&&i.add(h),g.has(h)||g.add(h),h},cancel:h=>{r.delete(h),i.delete(h)},process:h=>{if(a=h,s){o=!0;return}s=!0,[n,r]=[r,n],n.forEach(u),e&&Ph.value&&Ph.value.frameloop[e].push(l),l=0,n.clear(),s=!1,o&&(o=!1,d.process(h))}};return d}const fk=40;function ov(t,e){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,i=Do.reduce((_,x)=>(_[x]=hk(o,e?x:void 0),_),{}),{read:a,resolveKeyframes:l,update:u,preRender:d,render:h,postRender:f}=i,m=()=>{const _=performance.now();n=!1,s.delta=r?1e3/60:Math.max(Math.min(_-s.timestamp,fk),1),s.timestamp=_,s.isProcessing=!0,a.process(s),l.process(s),u.process(s),d.process(s),h.process(s),f.process(s),s.isProcessing=!1,n&&e&&(r=!1,t(m))},v=()=>{n=!0,r=!0,s.isProcessing||t(m)};return{schedule:Do.reduce((_,x)=>{const w=i[x];return _[x]=(E,b=!1,T=!1)=>(n||v(),w.schedule(E,b,T)),_},{}),cancel:_=>{for(let x=0;x<Do.length;x++)i[Do[x]].cancel(_)},state:s,steps:i}}const{schedule:ie,cancel:ft,state:Ie,steps:Ia}=ov(typeof requestAnimationFrame<"u"?requestAnimationFrame:Ke,!0),{schedule:ru,cancel:nD}=ov(queueMicrotask,!1);let Xo;function pk(){Xo=void 0}const Mt={now:()=>(Xo===void 0&&Mt.set(Ie.isProcessing||ok.useManualTiming?Ie.timestamp:performance.now()),Xo),set:t=>{Xo=t,queueMicrotask(pk)}},ut={x:!1,y:!1};function iv(){return ut.x||ut.y}function mk(t){return t==="x"||t==="y"?ut[t]?null:(ut[t]=!0,()=>{ut[t]=!1}):ut.x||ut.y?null:(ut.x=ut.y=!0,()=>{ut.x=ut.y=!1})}function su(t,e,n){if(t instanceof EventTarget)return[t];if(typeof t=="string"){let r=document;const s=n?.[t]??r.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t)}function av(t,e){const n=su(t),r=new AbortController,s={passive:!0,...e,signal:r.signal};return[n,s,()=>r.abort()]}function jh(t){return!(t.pointerType==="touch"||iv())}function gk(t,e,n={}){const[r,s,o]=av(t,n),i=a=>{if(!jh(a))return;const{target:l}=a,u=e(l,a);if(typeof u!="function"||!l)return;const d=h=>{jh(h)&&(u(h),l.removeEventListener("pointerleave",d))};l.addEventListener("pointerleave",d,s)};return r.forEach(a=>{a.addEventListener("pointerenter",i,s)}),o}const lv=(t,e)=>e?t===e?!0:lv(t,e.parentElement):!1,ou=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,vk=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function yk(t){return vk.has(t.tagName)||t.tabIndex!==-1}const Ts=new WeakSet;function Rh(t){return e=>{e.key==="Enter"&&t(e)}}function Ma(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const _k=(t,e)=>{const n=t.currentTarget;if(!n)return;const r=Rh(()=>{if(Ts.has(n))return;Ma(n,"down");const s=Rh(()=>{Ma(n,"up")}),o=()=>Ma(n,"cancel");n.addEventListener("keyup",s,e),n.addEventListener("blur",o,e)});n.addEventListener("keydown",r,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),e)};function Ah(t){return ou(t)&&!iv()}function xk(t,e,n={}){const[r,s,o]=av(t,n),i=a=>{const l=a.currentTarget;if(!Ah(a)||Ts.has(l))return;Ts.add(l);const u=e(l,a),d=(m,v)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",f),!(!Ah(m)||!Ts.has(l))&&(Ts.delete(l),typeof u=="function"&&u(m,{success:v}))},h=m=>{d(m,l===window||l===document||n.useGlobalTarget||lv(l,m.target))},f=m=>{d(m,!1)};window.addEventListener("pointerup",h,s),window.addEventListener("pointercancel",f,s)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",i,s),a instanceof HTMLElement&&(a.addEventListener("focus",u=>_k(u,s)),!yk(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),o}const Ih=30,bk=t=>!isNaN(parseFloat(t)),Ms={current:void 0};class wk{constructor(e,n={}){this.version="12.6.3",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,s=!0)=>{const o=Mt.now();this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),s&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=Mt.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=bk(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new Zc);const r=this.events[e].add(n);return e==="change"?()=>{r(),ie.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e,n=!0){!n||!this.passiveEffect?this.updateAndNotify(e,n):this.passiveEffect(e,this.updateAndNotify)}setWithVelocity(e,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-r}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return Ms.current&&Ms.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const e=Mt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Ih)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Ih);return Jc(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Rt(t,e){return new wk(t,e)}const cv=p.createContext({strict:!1}),Mh={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},yr={};for(const t in Mh)yr[t]={isEnabled:e=>Mh[t].some(n=>!!e[n])};function Ek(t){for(const e in t)yr[e]={...yr[e],...t[e]}}const Sk=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Ti(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Sk.has(t)}let uv=t=>!Ti(t);function Tk(t){t&&(uv=e=>e.startsWith("on")?!Ti(e):t(e))}try{Tk(require("@emotion/is-prop-valid").default)}catch{}function kk(t,e,n){const r={};for(const s in t)s==="values"&&typeof t.values=="object"||(uv(s)||n===!0&&Ti(s)||!e&&!Ti(s)||t.draggable&&s.startsWith("onDrag"))&&(r[s]=t[s]);return r}function Pk(t){if(typeof Proxy>"u")return t;const e=new Map,n=(...r)=>t(...r);return new Proxy(n,{get:(r,s)=>s==="create"?t:(e.has(s)||e.set(s,t(s)),e.get(s))})}const Ji=p.createContext({});function Qi(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function Zs(t){return typeof t=="string"||Array.isArray(t)}const iu=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],au=["initial",...iu];function ea(t){return Qi(t.animate)||au.some(e=>Zs(t[e]))}function dv(t){return!!(ea(t)||t.variants)}function Ck(t,e){if(ea(t)){const{initial:n,animate:r}=t;return{initial:n===!1||Zs(n)?n:void 0,animate:Zs(r)?r:void 0}}return t.inherit!==!1?e:{}}function jk(t){const{initial:e,animate:n}=Ck(t,p.useContext(Ji));return p.useMemo(()=>({initial:e,animate:n}),[Oh(e),Oh(n)])}function Oh(t){return Array.isArray(t)?t.join(" "):t}const Rk=Symbol.for("motionComponentSymbol");function er(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function Ak(t,e,n){return p.useCallback(r=>{r&&t.onMount&&t.onMount(r),e&&(r?e.mount(r):e.unmount()),n&&(typeof n=="function"?n(r):er(n)&&(n.current=r))},[e])}const lu=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Ik="framerAppearId",hv="data-"+lu(Ik),fv=p.createContext({});function Mk(t,e,n,r,s){const{visualElement:o}=p.useContext(Ji),i=p.useContext(cv),a=p.useContext(Zi),l=p.useContext(mo).reducedMotion,u=p.useRef(null);r=r||i.renderer,!u.current&&r&&(u.current=r(t,{visualState:e,parent:o,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:l}));const d=u.current,h=p.useContext(fv);d&&!d.projection&&s&&(d.type==="html"||d.type==="svg")&&Ok(u.current,n,s,h);const f=p.useRef(!1);p.useInsertionEffect(()=>{d&&f.current&&d.update(n,a)});const m=n[hv],v=p.useRef(!!m&&!window.MotionHandoffIsComplete?.(m)&&window.MotionHasOptimisedAnimation?.(m));return po(()=>{d&&(f.current=!0,window.MotionIsMounted=!0,d.updateFeatures(),ru.render(d.render),v.current&&d.animationState&&d.animationState.animateChanges())}),p.useEffect(()=>{d&&(!v.current&&d.animationState&&d.animationState.animateChanges(),v.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(m)}),v.current=!1))}),d}function Ok(t,e,n,r){const{layoutId:s,layout:o,drag:i,dragConstraints:a,layoutScroll:l,layoutRoot:u}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:pv(t.parent)),t.projection.setOptions({layoutId:s,layout:o,alwaysMeasureLayout:!!i||a&&er(a),visualElement:t,animationType:typeof o=="string"?o:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:u})}function pv(t){if(t)return t.options.allowProjection!==!1?t.projection:pv(t.parent)}function Dk({preloadedFeatures:t,createVisualElement:e,useRender:n,useVisualState:r,Component:s}){t&&Ek(t);function o(a,l){let u;const d={...p.useContext(mo),...a,layoutId:Nk(a)},{isStatic:h}=d,f=jk(a),m=r(a,h);if(!h&&Kc){Lk();const v=Fk(d);u=v.MeasureLayout,f.visualElement=Mk(s,m,d,e,v.ProjectionNode)}return c.jsxs(Ji.Provider,{value:f,children:[u&&f.visualElement?c.jsx(u,{visualElement:f.visualElement,...d}):null,n(s,a,Ak(m,f.visualElement,l),m,h,f.visualElement)]})}o.displayName=`motion.${typeof s=="string"?s:`create(${s.displayName??s.name??""})`}`;const i=p.forwardRef(o);return i[Rk]=s,i}function Nk({layoutId:t}){const e=p.useContext(Gc).id;return e&&t!==void 0?e+"-"+t:t}function Lk(t,e){p.useContext(cv).strict}function Fk(t){const{drag:e,layout:n}=yr;if(!e&&!n)return{};const r={...e,...n};return{MeasureLayout:e?.isEnabled(t)||n?.isEnabled(t)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const mv=t=>e=>typeof e=="string"&&e.startsWith(t),cu=mv("--"),$k=mv("var(--"),uu=t=>$k(t)?Vk.test(t.split("/*")[0].trim()):!1,Vk=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Js={};function Bk(t){for(const e in t)Js[e]=t[e],cu(e)&&(Js[e].isCSSVariable=!0)}const Tr=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Nn=new Set(Tr);function gv(t,{layout:e,layoutId:n}){return Nn.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!Js[t]||t==="opacity")}const Me=t=>!!(t&&t.getVelocity),vv=(t,e)=>e&&typeof t=="number"?e.transform(t):t,Lt=(t,e,n)=>n>e?e:n<t?t:n,kr={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Qs={...kr,transform:t=>Lt(0,1,t)},No={...kr,default:1},go=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),on=go("deg"),Ot=go("%"),X=go("px"),zk=go("vh"),Uk=go("vw"),Dh={...Ot,parse:t=>Ot.parse(t)/100,transform:t=>Ot.transform(t*100)},Hk={borderWidth:X,borderTopWidth:X,borderRightWidth:X,borderBottomWidth:X,borderLeftWidth:X,borderRadius:X,radius:X,borderTopLeftRadius:X,borderTopRightRadius:X,borderBottomRightRadius:X,borderBottomLeftRadius:X,width:X,maxWidth:X,height:X,maxHeight:X,top:X,right:X,bottom:X,left:X,padding:X,paddingTop:X,paddingRight:X,paddingBottom:X,paddingLeft:X,margin:X,marginTop:X,marginRight:X,marginBottom:X,marginLeft:X,backgroundPositionX:X,backgroundPositionY:X},Wk={rotate:on,rotateX:on,rotateY:on,rotateZ:on,scale:No,scaleX:No,scaleY:No,scaleZ:No,skew:on,skewX:on,skewY:on,distance:X,translateX:X,translateY:X,translateZ:X,x:X,y:X,z:X,perspective:X,transformPerspective:X,opacity:Qs,originX:Dh,originY:Dh,originZ:X},Nh={...kr,transform:Math.round},du={...Hk,...Wk,zIndex:Nh,size:X,fillOpacity:Qs,strokeOpacity:Qs,numOctaves:Nh},Gk={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Kk=Tr.length;function qk(t,e,n){let r="",s=!0;for(let o=0;o<Kk;o++){const i=Tr[o],a=t[i];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(i.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const u=vv(a,du[i]);if(!l){s=!1;const d=Gk[i]||i;r+=`${d}(${u}) `}n&&(e[i]=u)}}return r=r.trim(),n?r=n(e,s?"":r):s&&(r="none"),r}function hu(t,e,n){const{style:r,vars:s,transformOrigin:o}=t;let i=!1,a=!1;for(const l in e){const u=e[l];if(Nn.has(l)){i=!0;continue}else if(cu(l)){s[l]=u;continue}else{const d=vv(u,du[l]);l.startsWith("origin")?(a=!0,o[l]=d):r[l]=d}}if(e.transform||(i||n?r.transform=qk(e,t.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:u="50%",originZ:d=0}=o;r.transformOrigin=`${l} ${u} ${d}`}}const fu=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function yv(t,e,n){for(const r in e)!Me(e[r])&&!gv(r,n)&&(t[r]=e[r])}function Yk({transformTemplate:t},e){return p.useMemo(()=>{const n=fu();return hu(n,e,t),Object.assign({},n.vars,n.style)},[e])}function Xk(t,e){const n=t.style||{},r={};return yv(r,n,t),Object.assign(r,Yk(t,e)),r}function Zk(t,e){const n={},r=Xk(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=r,n}const Jk=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function pu(t){return typeof t!="string"||t.includes("-")?!1:!!(Jk.indexOf(t)>-1||/[A-Z]/u.test(t))}const Qk={offset:"stroke-dashoffset",array:"stroke-dasharray"},eP={offset:"strokeDashoffset",array:"strokeDasharray"};function tP(t,e,n=1,r=0,s=!0){t.pathLength=1;const o=s?Qk:eP;t[o.offset]=X.transform(-r);const i=X.transform(e),a=X.transform(n);t[o.array]=`${i} ${a}`}function Lh(t,e,n){return typeof t=="string"?t:X.transform(e+n*t)}function nP(t,e,n){const r=Lh(e,t.x,t.width),s=Lh(n,t.y,t.height);return`${r} ${s}`}function mu(t,{attrX:e,attrY:n,attrScale:r,originX:s,originY:o,pathLength:i,pathSpacing:a=1,pathOffset:l=0,...u},d,h){if(hu(t,u,h),d){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:f,style:m,dimensions:v}=t;f.transform&&(v&&(m.transform=f.transform),delete f.transform),v&&(s!==void 0||o!==void 0||m.transform)&&(m.transformOrigin=nP(v,s!==void 0?s:.5,o!==void 0?o:.5)),e!==void 0&&(f.x=e),n!==void 0&&(f.y=n),r!==void 0&&(f.scale=r),i!==void 0&&tP(f,i,a,l,!1)}const _v=()=>({...fu(),attrs:{}}),gu=t=>typeof t=="string"&&t.toLowerCase()==="svg";function rP(t,e,n,r){const s=p.useMemo(()=>{const o=_v();return mu(o,e,gu(r),t.transformTemplate),{...o.attrs,style:{...o.style}}},[e]);if(t.style){const o={};yv(o,t.style,t),s.style={...o,...s.style}}return s}function sP(t=!1){return(n,r,s,{latestValues:o},i)=>{const l=(pu(n)?rP:Zk)(r,o,i,n),u=kk(r,typeof n=="string",t),d=n!==p.Fragment?{...u,...l,ref:s}:{},{children:h}=r,f=p.useMemo(()=>Me(h)?h.get():h,[h]);return p.createElement(n,{...d,children:f})}}function Fh(t){const e=[{},{}];return t?.values.forEach((n,r)=>{e[0][r]=n.get(),e[1][r]=n.getVelocity()}),e}function vu(t,e,n,r){if(typeof e=="function"){const[s,o]=Fh(r);e=e(n!==void 0?n:t.custom,s,o)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[s,o]=Fh(r);e=e(n!==void 0?n:t.custom,s,o)}return e}const Wl=t=>Array.isArray(t),oP=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),iP=t=>Wl(t)?t[t.length-1]||0:t;function Zo(t){const e=Me(t)?t.get():t;return oP(e)?e.toValue():e}function aP({scrapeMotionValuesFromProps:t,createRenderState:e,onUpdate:n},r,s,o){const i={latestValues:lP(r,s,o,t),renderState:e()};return n&&(i.onMount=a=>n({props:r,current:a,...i}),i.onUpdate=a=>n(a)),i}const xv=t=>(e,n)=>{const r=p.useContext(Ji),s=p.useContext(Zi),o=()=>aP(t,e,r,s);return n?o():vn(o)};function lP(t,e,n,r){const s={},o=r(t,{});for(const f in o)s[f]=Zo(o[f]);let{initial:i,animate:a}=t;const l=ea(t),u=dv(t);e&&u&&!l&&t.inherit!==!1&&(i===void 0&&(i=e.initial),a===void 0&&(a=e.animate));let d=n?n.initial===!1:!1;d=d||i===!1;const h=d?a:i;if(h&&typeof h!="boolean"&&!Qi(h)){const f=Array.isArray(h)?h:[h];for(let m=0;m<f.length;m++){const v=vu(t,f[m]);if(v){const{transitionEnd:g,transition:y,..._}=v;for(const x in _){let w=_[x];if(Array.isArray(w)){const E=d?w.length-1:0;w=w[E]}w!==null&&(s[x]=w)}for(const x in g)s[x]=g[x]}}}return s}function yu(t,e,n){const{style:r}=t,s={};for(const o in r)(Me(r[o])||e.style&&Me(e.style[o])||gv(o,t)||n?.getValue(o)?.liveStyle!==void 0)&&(s[o]=r[o]);return s}const cP={useVisualState:xv({scrapeMotionValuesFromProps:yu,createRenderState:fu})};function bv(t,e){try{e.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{e.dimensions={x:0,y:0,width:0,height:0}}}function wv(t,{style:e,vars:n},r,s){Object.assign(t.style,e,s&&s.getProjectionStyles(r));for(const o in n)t.style.setProperty(o,n[o])}const Ev=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Sv(t,e,n,r){wv(t,e,void 0,r);for(const s in e.attrs)t.setAttribute(Ev.has(s)?s:lu(s),e.attrs[s])}function Tv(t,e,n){const r=yu(t,e,n);for(const s in t)if(Me(t[s])||Me(e[s])){const o=Tr.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[o]=t[s]}return r}const $h=["x","y","width","height","cx","cy","r"],uP={useVisualState:xv({scrapeMotionValuesFromProps:Tv,createRenderState:_v,onUpdate:({props:t,prevProps:e,current:n,renderState:r,latestValues:s})=>{if(!n)return;let o=!!t.drag;if(!o){for(const a in s)if(Nn.has(a)){o=!0;break}}if(!o)return;let i=!e;if(e)for(let a=0;a<$h.length;a++){const l=$h[a];t[l]!==e[l]&&(i=!0)}i&&ie.read(()=>{bv(n,r),ie.render(()=>{mu(r,s,gu(n.tagName),t.transformTemplate),Sv(n,r)})})}})};function dP(t,e){return function(r,{forwardMotionProps:s}={forwardMotionProps:!1}){const i={...pu(r)?uP:cP,preloadedFeatures:t,useRender:sP(s),createVisualElement:e,Component:r};return Dk(i)}}function eo(t,e,n){const r=t.getProps();return vu(r,e,n!==void 0?n:r.custom,t)}const kv=new Set(["width","height","top","left","right","bottom",...Tr]);function hP(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Rt(n))}function fP(t,e){const n=eo(t,e);let{transitionEnd:r={},transition:s={},...o}=n||{};o={...o,...r};for(const i in o){const a=iP(o[i]);hP(t,i,a)}}function pP(t){return!!(Me(t)&&t.add)}function Gl(t,e){const n=t.getValue("willChange");if(pP(n))return n.add(e)}function Pv(t){return t.props[hv]}const Cv=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,mP=1e-7,gP=12;function vP(t,e,n,r,s){let o,i,a=0;do i=e+(n-e)/2,o=Cv(i,r,s)-t,o>0?n=i:e=i;while(Math.abs(o)>mP&&++a<gP);return i}function vo(t,e,n,r){if(t===e&&n===r)return Ke;const s=o=>vP(o,0,1,t,n);return o=>o===0||o===1?o:Cv(s(o),e,r)}const jv=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Rv=t=>e=>1-t(1-e),Av=vo(.33,1.53,.69,.99),_u=Rv(Av),Iv=jv(_u),Mv=t=>(t*=2)<1?.5*_u(t):.5*(2-Math.pow(2,-10*(t-1))),xu=t=>1-Math.sin(Math.acos(t)),Ov=Rv(xu),Dv=jv(xu),Nv=t=>/^0[^.\s]+$/u.test(t);function yP(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||Nv(t):!0}const Os=t=>Math.round(t*1e5)/1e5,bu=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function _P(t){return t==null}const xP=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,wu=(t,e)=>n=>!!(typeof n=="string"&&xP.test(n)&&n.startsWith(t)||e&&!_P(n)&&Object.prototype.hasOwnProperty.call(n,e)),Lv=(t,e,n)=>r=>{if(typeof r!="string")return r;const[s,o,i,a]=r.match(bu);return{[t]:parseFloat(s),[e]:parseFloat(o),[n]:parseFloat(i),alpha:a!==void 0?parseFloat(a):1}},bP=t=>Lt(0,255,t),Oa={...kr,transform:t=>Math.round(bP(t))},Tn={test:wu("rgb","red"),parse:Lv("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+Oa.transform(t)+", "+Oa.transform(e)+", "+Oa.transform(n)+", "+Os(Qs.transform(r))+")"};function wP(t){let e="",n="",r="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),r=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,r+=r,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const Kl={test:wu("#"),parse:wP,transform:Tn.transform},tr={test:wu("hsl","hue"),parse:Lv("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+Ot.transform(Os(e))+", "+Ot.transform(Os(n))+", "+Os(Qs.transform(r))+")"},$e={test:t=>Tn.test(t)||Kl.test(t)||tr.test(t),parse:t=>Tn.test(t)?Tn.parse(t):tr.test(t)?tr.parse(t):Kl.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?Tn.transform(t):tr.transform(t)},EP=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function SP(t){return isNaN(t)&&typeof t=="string"&&(t.match(bu)?.length||0)+(t.match(EP)?.length||0)>0}const Fv="number",$v="color",TP="var",kP="var(",Vh="${}",PP=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function to(t){const e=t.toString(),n=[],r={color:[],number:[],var:[]},s=[];let o=0;const a=e.replace(PP,l=>($e.test(l)?(r.color.push(o),s.push($v),n.push($e.parse(l))):l.startsWith(kP)?(r.var.push(o),s.push(TP),n.push(l)):(r.number.push(o),s.push(Fv),n.push(parseFloat(l))),++o,Vh)).split(Vh);return{values:n,split:a,indexes:r,types:s}}function Vv(t){return to(t).values}function Bv(t){const{split:e,types:n}=to(t),r=e.length;return s=>{let o="";for(let i=0;i<r;i++)if(o+=e[i],s[i]!==void 0){const a=n[i];a===Fv?o+=Os(s[i]):a===$v?o+=$e.transform(s[i]):o+=s[i]}return o}}const CP=t=>typeof t=="number"?0:t;function jP(t){const e=Vv(t);return Bv(t)(e.map(CP))}const yn={test:SP,parse:Vv,createTransformer:Bv,getAnimatableNone:jP},RP=new Set(["brightness","contrast","saturate","opacity"]);function AP(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[r]=n.match(bu)||[];if(!r)return t;const s=n.replace(r,"");let o=RP.has(e)?1:0;return r!==n&&(o*=100),e+"("+o+s+")"}const IP=/\b([a-z-]*)\(.*?\)/gu,ql={...yn,getAnimatableNone:t=>{const e=t.match(IP);return e?e.map(AP).join(" "):t}},MP={...du,color:$e,backgroundColor:$e,outlineColor:$e,fill:$e,stroke:$e,borderColor:$e,borderTopColor:$e,borderRightColor:$e,borderBottomColor:$e,borderLeftColor:$e,filter:ql,WebkitFilter:ql},zv=t=>MP[t];function Uv(t,e){let n=zv(t);return n!==ql&&(n=yn),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const OP=new Set(["auto","none","0"]);function DP(t,e,n){let r=0,s;for(;r<t.length&&!s;){const o=t[r];typeof o=="string"&&!OP.has(o)&&to(o).values.length&&(s=t[r]),r++}if(s&&n)for(const o of e)t[o]=Uv(n,s)}const kn=t=>t*180/Math.PI,Yl=t=>{const e=kn(Math.atan2(t[1],t[0]));return Xl(e)},NP={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Yl,rotateZ:Yl,skewX:t=>kn(Math.atan(t[1])),skewY:t=>kn(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Xl=t=>(t=t%360,t<0&&(t+=360),t),Bh=Yl,zh=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Uh=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),LP={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:zh,scaleY:Uh,scale:t=>(zh(t)+Uh(t))/2,rotateX:t=>Xl(kn(Math.atan2(t[6],t[5]))),rotateY:t=>Xl(kn(Math.atan2(-t[2],t[0]))),rotateZ:Bh,rotate:Bh,skewX:t=>kn(Math.atan(t[4])),skewY:t=>kn(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Hh(t){return t.includes("scale")?1:0}function Zl(t,e){if(!t||t==="none")return Hh(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=LP,s=n;else{const a=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=NP,s=a}if(!s)return Hh(e);const o=r[e],i=s[1].split(",").map($P);return typeof o=="function"?o(i):i[o]}const FP=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Zl(n,e)};function $P(t){return parseFloat(t.trim())}const Wh=t=>t===kr||t===X,VP=new Set(["x","y","z"]),BP=Tr.filter(t=>!VP.has(t));function zP(t){const e=[];return BP.forEach(n=>{const r=t.getValue(n);r!==void 0&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e}const _r={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>Zl(e,"x"),y:(t,{transform:e})=>Zl(e,"y")};_r.translateX=_r.x;_r.translateY=_r.y;const Cn=new Set;let Jl=!1,Ql=!1;function Hv(){if(Ql){const t=Array.from(Cn).filter(r=>r.needsMeasurement),e=new Set(t.map(r=>r.element)),n=new Map;e.forEach(r=>{const s=zP(r);s.length&&(n.set(r,s),r.render())}),t.forEach(r=>r.measureInitialState()),e.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([o,i])=>{r.getValue(o)?.set(i)})}),t.forEach(r=>r.measureEndState()),t.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Ql=!1,Jl=!1,Cn.forEach(t=>t.complete()),Cn.clear()}function Wv(){Cn.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Ql=!0)})}function UP(){Wv(),Hv()}class Eu{constructor(e,n,r,s,o,i=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=r,this.motionValue=s,this.element=o,this.isAsync=i}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Cn.add(this),Jl||(Jl=!0,ie.read(Wv),ie.resolveKeyframes(Hv))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:r,motionValue:s}=this;for(let o=0;o<e.length;o++)if(e[o]===null)if(o===0){const i=s?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(r&&n){const l=r.readValue(n,a);l!=null&&(e[0]=l)}e[0]===void 0&&(e[0]=a),s&&i===void 0&&s.set(e[0])}else e[o]=e[o-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Cn.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Cn.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const Gv=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),HP=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function WP(t){const e=HP.exec(t);if(!e)return[,];const[,n,r,s]=e;return[`--${n??r}`,s]}function Kv(t,e,n=1){const[r,s]=WP(t);if(!r)return;const o=window.getComputedStyle(e).getPropertyValue(r);if(o){const i=o.trim();return Gv(i)?parseFloat(i):i}return uu(s)?Kv(s,e,n+1):s}const qv=t=>e=>e.test(t),GP={test:t=>t==="auto",parse:t=>t},Yv=[kr,X,Ot,on,Uk,zk,GP],Gh=t=>Yv.find(qv(t));class Xv extends Eu{constructor(e,n,r,s,o){super(e,n,r,s,o,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<e.length;l++){let u=e[l];if(typeof u=="string"&&(u=u.trim(),uu(u))){const d=Kv(u,n.current);d!==void 0&&(e[l]=d),l===e.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!kv.has(r)||e.length!==2)return;const[s,o]=e,i=Gh(s),a=Gh(o);if(i!==a)if(Wh(i)&&Wh(a))for(let l=0;l<e.length;l++){const u=e[l];typeof u=="string"&&(e[l]=parseFloat(u))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,r=[];for(let s=0;s<e.length;s++)yP(e[s])&&r.push(s);r.length&&DP(e,r,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:r}=this;if(!e||!e.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=_r[r](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&e.getValue(r,s).jump(s,!1)}measureEndState(){const{element:e,name:n,unresolvedKeyframes:r}=this;if(!e||!e.current)return;const s=e.getValue(n);s&&s.jump(this.measuredOrigin,!1);const o=r.length-1,i=r[o];r[o]=_r[n](e.measureViewportBox(),window.getComputedStyle(e.current)),i!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=i),this.removedTransforms?.length&&this.removedTransforms.forEach(([a,l])=>{e.getValue(a).set(l)}),this.resolveNoneKeyframes()}}const Kh=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(yn.test(t)||t==="0")&&!t.startsWith("url("));function KP(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function qP(t,e,n,r){const s=t[0];if(s===null)return!1;if(e==="display"||e==="visibility")return!0;const o=t[t.length-1],i=Kh(s,e),a=Kh(o,e);return!i||!a?!1:KP(t)||(n==="spring"||eu(n))&&r}const YP=t=>t!==null;function ta(t,{repeat:e,repeatType:n="loop"},r){const s=t.filter(YP),o=e&&n!=="loop"&&e%2===1?0:s.length-1;return!o||r===void 0?s[o]:r}const XP=40;class Zv{constructor({autoplay:e=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:o=0,repeatType:i="loop",...a}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Mt.now(),this.options={autoplay:e,delay:n,type:r,repeat:s,repeatDelay:o,repeatType:i,...a},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>XP?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&UP(),this._resolved}onKeyframesResolved(e,n){this.resolvedAt=Mt.now(),this.hasAttemptedResolve=!0;const{name:r,type:s,velocity:o,delay:i,onComplete:a,onUpdate:l,isGenerator:u}=this.options;if(!u&&!qP(e,r,s,o))if(i)this.options.duration=0;else{l&&l(ta(e,this.options,n)),a&&a(),this.resolveFinishedPromise();return}const d=this.initPlayback(e,n);d!==!1&&(this._resolved={keyframes:e,finalKeyframe:n,...d},this.onPostResolved())}onPostResolved(){}then(e,n){return this.currentFinishedPromise.then(e,n)}flatten(){this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear")}updateFinishedPromise(){this.currentFinishedPromise=new Promise(e=>{this.resolveFinishedPromise=e})}}const be=(t,e,n)=>t+(e-t)*n;function Da(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function ZP({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,e/=100,n/=100;let s=0,o=0,i=0;if(!e)s=o=i=n;else{const a=n<.5?n*(1+e):n+e-n*e,l=2*n-a;s=Da(l,a,t+1/3),o=Da(l,a,t),i=Da(l,a,t-1/3)}return{red:Math.round(s*255),green:Math.round(o*255),blue:Math.round(i*255),alpha:r}}function ki(t,e){return n=>n>0?e:t}const Na=(t,e,n)=>{const r=t*t,s=n*(e*e-r)+r;return s<0?0:Math.sqrt(s)},JP=[Kl,Tn,tr],QP=t=>JP.find(e=>e.test(t));function qh(t){const e=QP(t);if(!e)return!1;let n=e.parse(t);return e===tr&&(n=ZP(n)),n}const Yh=(t,e)=>{const n=qh(t),r=qh(e);if(!n||!r)return ki(t,e);const s={...n};return o=>(s.red=Na(n.red,r.red,o),s.green=Na(n.green,r.green,o),s.blue=Na(n.blue,r.blue,o),s.alpha=be(n.alpha,r.alpha,o),Tn.transform(s))},eC=(t,e)=>n=>e(t(n)),yo=(...t)=>t.reduce(eC),ec=new Set(["none","hidden"]);function tC(t,e){return ec.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function nC(t,e){return n=>be(t,e,n)}function Su(t){return typeof t=="number"?nC:typeof t=="string"?uu(t)?ki:$e.test(t)?Yh:oC:Array.isArray(t)?Jv:typeof t=="object"?$e.test(t)?Yh:rC:ki}function Jv(t,e){const n=[...t],r=n.length,s=t.map((o,i)=>Su(o)(o,e[i]));return o=>{for(let i=0;i<r;i++)n[i]=s[i](o);return n}}function rC(t,e){const n={...t,...e},r={};for(const s in n)t[s]!==void 0&&e[s]!==void 0&&(r[s]=Su(t[s])(t[s],e[s]));return s=>{for(const o in r)n[o]=r[o](s);return n}}function sC(t,e){const n=[],r={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){const o=e.types[s],i=t.indexes[o][r[o]],a=t.values[i]??0;n[s]=a,r[o]++}return n}const oC=(t,e)=>{const n=yn.createTransformer(e),r=to(t),s=to(e);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?ec.has(t)&&!s.values.length||ec.has(e)&&!r.values.length?tC(t,e):yo(Jv(sC(r,s),s.values),n):ki(t,e)};function Qv(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?be(t,e,n):Su(t)(t,e)}const iC=5;function e0(t,e,n){const r=Math.max(e-iC,0);return Jc(n-t(r),e-r)}const Se={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},La=.001;function aC({duration:t=Se.duration,bounce:e=Se.bounce,velocity:n=Se.velocity,mass:r=Se.mass}){let s,o,i=1-e;i=Lt(Se.minDamping,Se.maxDamping,i),t=Lt(Se.minDuration,Se.maxDuration,It(t)),i<1?(s=u=>{const d=u*i,h=d*t,f=d-n,m=tc(u,i),v=Math.exp(-h);return La-f/m*v},o=u=>{const h=u*i*t,f=h*n+n,m=Math.pow(i,2)*Math.pow(u,2)*t,v=Math.exp(-h),g=tc(Math.pow(u,2),i);return(-s(u)+La>0?-1:1)*((f-m)*v)/g}):(s=u=>{const d=Math.exp(-u*t),h=(u-n)*t+1;return-La+d*h},o=u=>{const d=Math.exp(-u*t),h=(n-u)*(t*t);return d*h});const a=5/t,l=cC(s,o,a);if(t=At(t),isNaN(l))return{stiffness:Se.stiffness,damping:Se.damping,duration:t};{const u=Math.pow(l,2)*r;return{stiffness:u,damping:i*2*Math.sqrt(r*u),duration:t}}}const lC=12;function cC(t,e,n){let r=n;for(let s=1;s<lC;s++)r=r-t(r)/e(r);return r}function tc(t,e){return t*Math.sqrt(1-e*e)}const uC=["duration","bounce"],dC=["stiffness","damping","mass"];function Xh(t,e){return e.some(n=>t[n]!==void 0)}function hC(t){let e={velocity:Se.velocity,stiffness:Se.stiffness,damping:Se.damping,mass:Se.mass,isResolvedFromDuration:!1,...t};if(!Xh(t,dC)&&Xh(t,uC))if(t.visualDuration){const n=t.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,o=2*Lt(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:Se.mass,stiffness:s,damping:o}}else{const n=aC(t);e={...e,...n,mass:Se.mass},e.isResolvedFromDuration=!0}return e}function Pi(t=Se.visualDuration,e=Se.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:r,restDelta:s}=n;const o=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],a={done:!1,value:o},{stiffness:l,damping:u,mass:d,duration:h,velocity:f,isResolvedFromDuration:m}=hC({...n,velocity:-It(n.velocity||0)}),v=f||0,g=u/(2*Math.sqrt(l*d)),y=i-o,_=It(Math.sqrt(l/d)),x=Math.abs(y)<5;r||(r=x?Se.restSpeed.granular:Se.restSpeed.default),s||(s=x?Se.restDelta.granular:Se.restDelta.default);let w;if(g<1){const b=tc(_,g);w=T=>{const k=Math.exp(-g*_*T);return i-k*((v+g*_*y)/b*Math.sin(b*T)+y*Math.cos(b*T))}}else if(g===1)w=b=>i-Math.exp(-_*b)*(y+(v+_*y)*b);else{const b=_*Math.sqrt(g*g-1);w=T=>{const k=Math.exp(-g*_*T),P=Math.min(b*T,300);return i-k*((v+g*_*y)*Math.sinh(P)+b*y*Math.cosh(P))/b}}const E={calculatedDuration:m&&h||null,next:b=>{const T=w(b);if(m)a.done=b>=h;else{let k=0;g<1&&(k=b===0?At(v):e0(w,b,T));const P=Math.abs(k)<=r,O=Math.abs(i-T)<=s;a.done=P&&O}return a.value=a.done?i:T,a},toString:()=>{const b=Math.min(nu(E),Si),T=nv(k=>E.next(b*k).value,b,30);return b+"ms "+T},toTransition:()=>{}};return E}Pi.applyToOptions=t=>{const e=dk(t,100,Pi);return t.ease=Xs()?e.ease:"easeOut",t.duration=At(e.duration),t.type="keyframes",t};function Zh({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:i,min:a,max:l,restDelta:u=.5,restSpeed:d}){const h=t[0],f={done:!1,value:h},m=P=>a!==void 0&&P<a||l!==void 0&&P>l,v=P=>a===void 0?l:l===void 0||Math.abs(a-P)<Math.abs(l-P)?a:l;let g=n*e;const y=h+g,_=i===void 0?y:i(y);_!==y&&(g=_-h);const x=P=>-g*Math.exp(-P/r),w=P=>_+x(P),E=P=>{const O=x(P),R=w(P);f.done=Math.abs(O)<=u,f.value=f.done?_:R};let b,T;const k=P=>{m(f.value)&&(b=P,T=Pi({keyframes:[f.value,v(f.value)],velocity:e0(w,P,f.value),damping:s,stiffness:o,restDelta:u,restSpeed:d}))};return k(0),{calculatedDuration:null,next:P=>{let O=!1;return!T&&b===void 0&&(O=!0,E(P),k(P)),b!==void 0&&P>=b?T.next(P-b):(!O&&E(P),f)}}}const fC=vo(.42,0,1,1),pC=vo(0,0,.58,1),t0=vo(.42,0,.58,1),mC=t=>Array.isArray(t)&&typeof t[0]!="number",Jh={linear:Ke,easeIn:fC,easeInOut:t0,easeOut:pC,circIn:xu,circInOut:Dv,circOut:Ov,backIn:_u,backInOut:Iv,backOut:Av,anticipate:Mv},Qh=t=>{if(Qc(t)){Ul(t.length===4);const[e,n,r,s]=t;return vo(e,n,r,s)}else if(typeof t=="string")return Ul(Jh[t]!==void 0),Jh[t];return t};function gC(t,e,n){const r=[],s=n||Qv,o=t.length-1;for(let i=0;i<o;i++){let a=s(t[i],t[i+1]);if(e){const l=Array.isArray(e)?e[i]||Ke:e;a=yo(l,a)}r.push(a)}return r}function Tu(t,e,{clamp:n=!0,ease:r,mixer:s}={}){const o=t.length;if(Ul(o===e.length),o===1)return()=>e[0];if(o===2&&e[0]===e[1])return()=>e[1];const i=t[0]===t[1];t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=gC(e,r,s),l=a.length,u=d=>{if(i&&d<t[0])return e[0];let h=0;if(l>1)for(;h<t.length-2&&!(d<t[h+1]);h++);const f=vr(t[h],t[h+1],d);return a[h](f)};return n?d=>u(Lt(t[0],t[o-1],d)):u}function vC(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const s=vr(0,e,r);t.push(be(n,1,s))}}function n0(t){const e=[0];return vC(e,t.length-1),e}function yC(t,e){return t.map(n=>n*e)}function _C(t,e){return t.map(()=>e||t0).splice(0,t.length-1)}function Ci({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const s=mC(r)?r.map(Qh):Qh(r),o={done:!1,value:e[0]},i=yC(n&&n.length===e.length?n:n0(e),t),a=Tu(i,e,{ease:Array.isArray(s)?s:_C(e,s)});return{calculatedDuration:t,next:l=>(o.value=a(l),o.done=l>=t,o)}}const xC=t=>{const e=({timestamp:n})=>t(n);return{start:()=>ie.update(e,!0),stop:()=>ft(e),now:()=>Ie.isProcessing?Ie.timestamp:Mt.now()}},bC={decay:Zh,inertia:Zh,tween:Ci,keyframes:Ci,spring:Pi},wC=t=>t/100;class na extends Zv{constructor(e){super(e),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:l}=this.options;l&&l()};const{name:n,motionValue:r,element:s,keyframes:o}=this.options,i=s?.KeyframeResolver||Eu,a=(l,u)=>this.onKeyframesResolved(l,u);this.resolver=new i(o,a,n,r,s),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(e){const{type:n="keyframes",repeat:r=0,repeatDelay:s=0,repeatType:o,velocity:i=0}=this.options,a=eu(n)?n:bC[n]||Ci;let l,u;a!==Ci&&typeof e[0]!="number"&&(l=yo(wC,Qv(e[0],e[1])),e=[0,100]);const d=a({...this.options,keyframes:e});o==="mirror"&&(u=a({...this.options,keyframes:[...e].reverse(),velocity:-i})),d.calculatedDuration===null&&(d.calculatedDuration=nu(d));const{calculatedDuration:h}=d,f=h+s,m=f*(r+1)-s;return{generator:d,mirroredGenerator:u,mapPercentToKeyframes:l,calculatedDuration:h,resolvedDuration:f,totalDuration:m}}onPostResolved(){const{autoplay:e=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!e?this.pause():this.state=this.pendingPlayState}tick(e,n=!1){const{resolved:r}=this;if(!r){const{keyframes:P}=this.options;return{done:!0,value:P[P.length-1]}}const{finalKeyframe:s,generator:o,mirroredGenerator:i,mapPercentToKeyframes:a,keyframes:l,calculatedDuration:u,totalDuration:d,resolvedDuration:h}=r;if(this.startTime===null)return o.next(0);const{delay:f,repeat:m,repeatType:v,repeatDelay:g,onUpdate:y}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-d/this.speed,this.startTime)),n?this.currentTime=e:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(e-this.startTime)*this.speed;const _=this.currentTime-f*(this.speed>=0?1:-1),x=this.speed>=0?_<0:_>d;this.currentTime=Math.max(_,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let w=this.currentTime,E=o;if(m){const P=Math.min(this.currentTime,d)/h;let O=Math.floor(P),R=P%1;!R&&P>=1&&(R=1),R===1&&O--,O=Math.min(O,m+1),!!(O%2)&&(v==="reverse"?(R=1-R,g&&(R-=g/h)):v==="mirror"&&(E=i)),w=Lt(0,1,R)*h}const b=x?{done:!1,value:l[0]}:E.next(w);a&&(b.value=a(b.value));let{done:T}=b;!x&&u!==null&&(T=this.speed>=0?this.currentTime>=d:this.currentTime<=0);const k=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&T);return k&&s!==void 0&&(b.value=ta(l,this.options,s)),y&&y(b.value),k&&this.finish(),b}get duration(){const{resolved:e}=this;return e?It(e.calculatedDuration):0}get time(){return It(this.currentTime)}set time(e){e=At(e),this.currentTime=e,this.holdTime!==null||this.speed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=It(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:e=xC,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=e(o=>this.tick(o))),n&&n();const s=this.driver.now();this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=s):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=this.currentTime??0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:e}=this.options;e&&e()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}get finished(){return this.currentFinishedPromise}}function EC(t){return new na(t)}const SC=new Set(["opacity","clipPath","filter","transform"]),TC=Xc(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),ji=10,kC=2e4;function PC(t){return eu(t.type)||t.type==="spring"||!sv(t.ease)}function CC(t,e){const n=new na({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:t[0]};const s=[];let o=0;for(;!r.done&&o<kC;)r=n.sample(o),s.push(r.value),o+=ji;return{times:void 0,keyframes:s,duration:o-ji,ease:"linear"}}const r0={anticipate:Mv,backInOut:Iv,circInOut:Dv};function jC(t){return t in r0}class ef extends Zv{constructor(e){super(e);const{name:n,motionValue:r,element:s,keyframes:o}=this.options;this.resolver=new Xv(o,(i,a)=>this.onKeyframesResolved(i,a),n,r,s),this.resolver.scheduleResolve()}initPlayback(e,n){let{duration:r=300,times:s,ease:o,type:i,motionValue:a,name:l,startTime:u}=this.options;if(!a.owner||!a.owner.current)return!1;if(typeof o=="string"&&Xs()&&jC(o)&&(o=r0[o]),PC(this.options)){const{onComplete:h,onUpdate:f,motionValue:m,element:v,...g}=this.options,y=CC(e,g);e=y.keyframes,e.length===1&&(e[1]=e[0]),r=y.duration,s=y.times,o=y.ease,i="keyframes"}const d=uk(a.owner.current,l,e,{...this.options,duration:r,times:s,ease:o});return d.startTime=u??this.calcStartTime(),this.pendingTimeline?(Ch(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:h}=this.options;a.set(ta(e,this.options,n)),h&&h(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:r,times:s,type:i,ease:o,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:n}=e;return It(n)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:n}=e;return It(n.currentTime||0)}set time(e){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=At(e)}get speed(){const{resolved:e}=this;if(!e)return 1;const{animation:n}=e;return n.playbackRate}get finished(){return this.resolved.animation.finished}set speed(e){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=e}get state(){const{resolved:e}=this;if(!e)return"idle";const{animation:n}=e;return n.playState}get startTime(){const{resolved:e}=this;if(!e)return null;const{animation:n}=e;return n.startTime}attachTimeline(e){if(!this._resolved)this.pendingTimeline=e;else{const{resolved:n}=this;if(!n)return Ke;const{animation:r}=n;Ch(r,e)}return Ke}play(){if(this.isStopped)return;const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:e}=this;if(!e)return;const{animation:n,keyframes:r,duration:s,type:o,ease:i,times:a}=e;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:u,onUpdate:d,onComplete:h,element:f,...m}=this.options,v=new na({...m,keyframes:r,duration:s,type:o,ease:i,times:a,isGenerator:!0}),g=At(this.time);u.setWithVelocity(v.sample(g-ji).value,v.sample(g).value,ji)}const{onStop:l}=this.options;l&&l(),this.cancel()}complete(){const{resolved:e}=this;e&&e.animation.finish()}cancel(){const{resolved:e}=this;e&&e.animation.cancel()}static supports(e){const{motionValue:n,name:r,repeatDelay:s,repeatType:o,damping:i,type:a}=e;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:u}=n.owner.getProps();return TC()&&r&&SC.has(r)&&(r!=="transform"||!u)&&!l&&!s&&o!=="mirror"&&i!==0&&a!=="inertia"}}const RC={type:"spring",stiffness:500,damping:25,restSpeed:10},AC=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),IC={type:"keyframes",duration:.8},MC={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},OC=(t,{keyframes:e})=>e.length>2?IC:Nn.has(t)?t.startsWith("scale")?AC(e[1]):RC:MC;function DC({when:t,delay:e,delayChildren:n,staggerChildren:r,staggerDirection:s,repeat:o,repeatType:i,repeatDelay:a,from:l,elapsed:u,...d}){return!!Object.keys(d).length}const ku=(t,e,n,r={},s,o)=>i=>{const a=tu(r,t)||{},l=a.delay||r.delay||0;let{elapsed:u=0}=r;u=u-At(l);let d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-u,onUpdate:f=>{e.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{i(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:o?void 0:s};DC(a)||(d={...d,...OC(t,d)}),d.duration&&(d.duration=At(d.duration)),d.repeatDelay&&(d.repeatDelay=At(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let h=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(d.duration=0,d.delay===0&&(h=!0)),d.allowFlatten=!a.type&&!a.ease,h&&!o&&e.get()!==void 0){const f=ta(d.keyframes,a);if(f!==void 0)return ie.update(()=>{d.onUpdate(f),d.onComplete()}),new ak([])}return!o&&ef.supports(d)?new ef(d):new na(d)};function NC({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,r}function s0(t,e,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:o=t.getDefaultTransition(),transitionEnd:i,...a}=e;r&&(o=r);const l=[],u=s&&t.animationState&&t.animationState.getState()[s];for(const d in a){const h=t.getValue(d,t.latestValues[d]??null),f=a[d];if(f===void 0||u&&NC(u,d))continue;const m={delay:n,...tu(o||{},d)};let v=!1;if(window.MotionHandoffAnimation){const y=Pv(t);if(y){const _=window.MotionHandoffAnimation(y,d,ie);_!==null&&(m.startTime=_,v=!0)}}Gl(t,d),h.start(ku(d,h,f,t.shouldReduceMotion&&kv.has(d)?{type:!1}:m,t,v));const g=h.animation;g&&l.push(g)}return i&&Promise.all(l).then(()=>{ie.update(()=>{i&&fP(t,i)})}),l}function nc(t,e,n={}){const r=eo(t,e,n.type==="exit"?t.presenceContext?.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const o=r?()=>Promise.all(s0(t,r,n)):()=>Promise.resolve(),i=t.variantChildren&&t.variantChildren.size?(l=0)=>{const{delayChildren:u=0,staggerChildren:d,staggerDirection:h}=s;return LC(t,e,u+l,d,h,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[l,u]=a==="beforeChildren"?[o,i]:[i,o];return l().then(()=>u())}else return Promise.all([o(),i(n.delay)])}function LC(t,e,n=0,r=0,s=1,o){const i=[],a=(t.variantChildren.size-1)*r,l=s===1?(u=0)=>u*r:(u=0)=>a-u*r;return Array.from(t.variantChildren).sort(FC).forEach((u,d)=>{u.notify("AnimationStart",e),i.push(nc(u,e,{...o,delay:n+l(d)}).then(()=>u.notify("AnimationComplete",e)))}),Promise.all(i)}function FC(t,e){return t.sortNodePosition(e)}function $C(t,e,n={}){t.notify("AnimationStart",e);let r;if(Array.isArray(e)){const s=e.map(o=>nc(t,o,n));r=Promise.all(s)}else if(typeof e=="string")r=nc(t,e,n);else{const s=typeof e=="function"?eo(t,e,n.custom):e;r=Promise.all(s0(t,s,n))}return r.then(()=>{t.notify("AnimationComplete",e)})}function o0(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}const VC=au.length;function i0(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?i0(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<VC;n++){const r=au[n],s=t.props[r];(Zs(s)||s===!1)&&(e[r]=s)}return e}const BC=[...iu].reverse(),zC=iu.length;function UC(t){return e=>Promise.all(e.map(({animation:n,options:r})=>$C(t,n,r)))}function HC(t){let e=UC(t),n=tf(),r=!0;const s=l=>(u,d)=>{const h=eo(t,d,l==="exit"?t.presenceContext?.custom:void 0);if(h){const{transition:f,transitionEnd:m,...v}=h;u={...u,...v,...m}}return u};function o(l){e=l(t)}function i(l){const{props:u}=t,d=i0(t.parent)||{},h=[],f=new Set;let m={},v=1/0;for(let y=0;y<zC;y++){const _=BC[y],x=n[_],w=u[_]!==void 0?u[_]:d[_],E=Zs(w),b=_===l?x.isActive:null;b===!1&&(v=y);let T=w===d[_]&&w!==u[_]&&E;if(T&&r&&t.manuallyAnimateOnMount&&(T=!1),x.protectedKeys={...m},!x.isActive&&b===null||!w&&!x.prevProp||Qi(w)||typeof w=="boolean")continue;const k=WC(x.prevProp,w);let P=k||_===l&&x.isActive&&!T&&E||y>v&&E,O=!1;const R=Array.isArray(w)?w:[w];let B=R.reduce(s(_),{});b===!1&&(B={});const{prevResolvedValues:N={}}=x,K={...N,...B},M=U=>{P=!0,f.has(U)&&(O=!0,f.delete(U)),x.needsAnimating[U]=!0;const A=t.getValue(U);A&&(A.liveStyle=!1)};for(const U in K){const A=B[U],I=N[U];if(m.hasOwnProperty(U))continue;let ee=!1;Wl(A)&&Wl(I)?ee=!o0(A,I):ee=A!==I,ee?A!=null?M(U):f.add(U):A!==void 0&&f.has(U)?M(U):x.protectedKeys[U]=!0}x.prevProp=w,x.prevResolvedValues=B,x.isActive&&(m={...m,...B}),r&&t.blockInitialAnimation&&(P=!1),P&&(!(T&&k)||O)&&h.push(...R.map(U=>({animation:U,options:{type:_}})))}if(f.size){const y={};if(typeof u.initial!="boolean"){const _=eo(t,Array.isArray(u.initial)?u.initial[0]:u.initial);_&&_.transition&&(y.transition=_.transition)}f.forEach(_=>{const x=t.getBaseTarget(_),w=t.getValue(_);w&&(w.liveStyle=!0),y[_]=x??null}),h.push({animation:y})}let g=!!h.length;return r&&(u.initial===!1||u.initial===u.animate)&&!t.manuallyAnimateOnMount&&(g=!1),r=!1,g?e(h):Promise.resolve()}function a(l,u){if(n[l].isActive===u)return Promise.resolve();t.variantChildren?.forEach(h=>h.animationState?.setActive(l,u)),n[l].isActive=u;const d=i(l);for(const h in n)n[h].protectedKeys={};return d}return{animateChanges:i,setActive:a,setAnimateFunction:o,getState:()=>n,reset:()=>{n=tf(),r=!0}}}function WC(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!o0(e,t):!1}function wn(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function tf(){return{animate:wn(!0),whileInView:wn(),whileHover:wn(),whileTap:wn(),whileDrag:wn(),whileFocus:wn(),exit:wn()}}class _n{constructor(e){this.isMounted=!1,this.node=e}update(){}}class GC extends _n{constructor(e){super(e),e.animationState||(e.animationState=HC(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Qi(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let KC=0;class qC extends _n{constructor(){super(...arguments),this.id=KC++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;const s=this.node.animationState.setActive("exit",!e);n&&!e&&s.then(()=>{n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const YC={animation:{Feature:GC},exit:{Feature:qC}};function no(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n)}function _o(t){return{point:{x:t.pageX,y:t.pageY}}}const XC=t=>e=>ou(e)&&t(e,_o(e));function Ds(t,e,n,r){return no(t,e,XC(n),r)}function a0({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function ZC({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function JC(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),r=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}const l0=1e-4,QC=1-l0,ej=1+l0,c0=.01,tj=0-c0,nj=0+c0;function ze(t){return t.max-t.min}function rj(t,e,n){return Math.abs(t-e)<=n}function nf(t,e,n,r=.5){t.origin=r,t.originPoint=be(e.min,e.max,t.origin),t.scale=ze(n)/ze(e),t.translate=be(n.min,n.max,t.origin)-t.originPoint,(t.scale>=QC&&t.scale<=ej||isNaN(t.scale))&&(t.scale=1),(t.translate>=tj&&t.translate<=nj||isNaN(t.translate))&&(t.translate=0)}function Ns(t,e,n,r){nf(t.x,e.x,n.x,r?r.originX:void 0),nf(t.y,e.y,n.y,r?r.originY:void 0)}function rf(t,e,n){t.min=n.min+e.min,t.max=t.min+ze(e)}function sj(t,e,n){rf(t.x,e.x,n.x),rf(t.y,e.y,n.y)}function sf(t,e,n){t.min=e.min-n.min,t.max=t.min+ze(e)}function Ls(t,e,n){sf(t.x,e.x,n.x),sf(t.y,e.y,n.y)}const of=()=>({translate:0,scale:1,origin:0,originPoint:0}),nr=()=>({x:of(),y:of()}),af=()=>({min:0,max:0}),Te=()=>({x:af(),y:af()});function ot(t){return[t("x"),t("y")]}function Fa(t){return t===void 0||t===1}function rc({scale:t,scaleX:e,scaleY:n}){return!Fa(t)||!Fa(e)||!Fa(n)}function Sn(t){return rc(t)||u0(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function u0(t){return lf(t.x)||lf(t.y)}function lf(t){return t&&t!=="0%"}function Ri(t,e,n){const r=t-n,s=e*r;return n+s}function cf(t,e,n,r,s){return s!==void 0&&(t=Ri(t,s,r)),Ri(t,n,r)+e}function sc(t,e=0,n=1,r,s){t.min=cf(t.min,e,n,r,s),t.max=cf(t.max,e,n,r,s)}function d0(t,{x:e,y:n}){sc(t.x,e.translate,e.scale,e.originPoint),sc(t.y,n.translate,n.scale,n.originPoint)}const uf=.999999999999,df=1.0000000000001;function oj(t,e,n,r=!1){const s=n.length;if(!s)return;e.x=e.y=1;let o,i;for(let a=0;a<s;a++){o=n[a],i=o.projectionDelta;const{visualElement:l}=o.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&o.options.layoutScroll&&o.scroll&&o!==o.root&&sr(t,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),i&&(e.x*=i.x.scale,e.y*=i.y.scale,d0(t,i)),r&&Sn(o.latestValues)&&sr(t,o.latestValues))}e.x<df&&e.x>uf&&(e.x=1),e.y<df&&e.y>uf&&(e.y=1)}function rr(t,e){t.min=t.min+e,t.max=t.max+e}function hf(t,e,n,r,s=.5){const o=be(t.min,t.max,s);sc(t,e,n,o,r)}function sr(t,e){hf(t.x,e.x,e.scaleX,e.scale,e.originX),hf(t.y,e.y,e.scaleY,e.scale,e.originY)}function h0(t,e){return a0(JC(t.getBoundingClientRect(),e))}function ij(t,e,n){const r=h0(t,n),{scroll:s}=e;return s&&(rr(r.x,s.offset.x),rr(r.y,s.offset.y)),r}const f0=({current:t})=>t?t.ownerDocument.defaultView:null,ff=(t,e)=>Math.abs(t-e);function aj(t,e){const n=ff(t.x,e.x),r=ff(t.y,e.y);return Math.sqrt(n**2+r**2)}class p0{constructor(e,n,{transformPagePoint:r,contextWindow:s,dragSnapToOrigin:o=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const h=Va(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,m=aj(h.offset,{x:0,y:0})>=3;if(!f&&!m)return;const{point:v}=h,{timestamp:g}=Ie;this.history.push({...v,timestamp:g});const{onStart:y,onMove:_}=this.handlers;f||(y&&y(this.lastMoveEvent,h),this.startEvent=this.lastMoveEvent),_&&_(this.lastMoveEvent,h)},this.handlePointerMove=(h,f)=>{this.lastMoveEvent=h,this.lastMoveEventInfo=$a(f,this.transformPagePoint),ie.update(this.updatePoint,!0)},this.handlePointerUp=(h,f)=>{this.end();const{onEnd:m,onSessionEnd:v,resumeAnimation:g}=this.handlers;if(this.dragSnapToOrigin&&g&&g(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=Va(h.type==="pointercancel"?this.lastMoveEventInfo:$a(f,this.transformPagePoint),this.history);this.startEvent&&m&&m(h,y),v&&v(h,y)},!ou(e))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=r,this.contextWindow=s||window;const i=_o(e),a=$a(i,this.transformPagePoint),{point:l}=a,{timestamp:u}=Ie;this.history=[{...l,timestamp:u}];const{onSessionStart:d}=n;d&&d(e,Va(a,this.history)),this.removeListeners=yo(Ds(this.contextWindow,"pointermove",this.handlePointerMove),Ds(this.contextWindow,"pointerup",this.handlePointerUp),Ds(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),ft(this.updatePoint)}}function $a(t,e){return e?{point:e(t.point)}:t}function pf(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Va({point:t},e){return{point:t,delta:pf(t,m0(e)),offset:pf(t,lj(e)),velocity:cj(e,.1)}}function lj(t){return t[0]}function m0(t){return t[t.length-1]}function cj(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const s=m0(t);for(;n>=0&&(r=t[n],!(s.timestamp-r.timestamp>At(e)));)n--;if(!r)return{x:0,y:0};const o=It(s.timestamp-r.timestamp);if(o===0)return{x:0,y:0};const i={x:(s.x-r.x)/o,y:(s.y-r.y)/o};return i.x===1/0&&(i.x=0),i.y===1/0&&(i.y=0),i}function uj(t,{min:e,max:n},r){return e!==void 0&&t<e?t=r?be(e,t,r.min):Math.max(t,e):n!==void 0&&t>n&&(t=r?be(n,t,r.max):Math.min(t,n)),t}function mf(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function dj(t,{top:e,left:n,bottom:r,right:s}){return{x:mf(t.x,n,s),y:mf(t.y,e,r)}}function gf(t,e){let n=e.min-t.min,r=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,r]=[r,n]),{min:n,max:r}}function hj(t,e){return{x:gf(t.x,e.x),y:gf(t.y,e.y)}}function fj(t,e){let n=.5;const r=ze(t),s=ze(e);return s>r?n=vr(e.min,e.max-r,t.min):r>s&&(n=vr(t.min,t.max-s,e.min)),Lt(0,1,n)}function pj(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const oc=.35;function mj(t=oc){return t===!1?t=0:t===!0&&(t=oc),{x:vf(t,"left","right"),y:vf(t,"top","bottom")}}function vf(t,e,n){return{min:yf(t,e),max:yf(t,n)}}function yf(t,e){return typeof t=="number"?t:t[e]||0}const gj=new WeakMap;class vj{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Te(),this.visualElement=e}start(e,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const s=d=>{const{dragSnapToOrigin:h}=this.getProps();h?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(_o(d).point)},o=(d,h)=>{const{drag:f,dragPropagation:m,onDragStart:v}=this.getProps();if(f&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=mk(f),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),ot(y=>{let _=this.getAxisMotionValue(y).get()||0;if(Ot.test(_)){const{projection:x}=this.visualElement;if(x&&x.layout){const w=x.layout.layoutBox[y];w&&(_=ze(w)*(parseFloat(_)/100))}}this.originPoint[y]=_}),v&&ie.postRender(()=>v(d,h)),Gl(this.visualElement,"transform");const{animationState:g}=this.visualElement;g&&g.setActive("whileDrag",!0)},i=(d,h)=>{const{dragPropagation:f,dragDirectionLock:m,onDirectionLock:v,onDrag:g}=this.getProps();if(!f&&!this.openDragLock)return;const{offset:y}=h;if(m&&this.currentDirection===null){this.currentDirection=yj(y),this.currentDirection!==null&&v&&v(this.currentDirection);return}this.updateAxis("x",h.point,y),this.updateAxis("y",h.point,y),this.visualElement.render(),g&&g(d,h)},a=(d,h)=>this.stop(d,h),l=()=>ot(d=>this.getAnimationState(d)==="paused"&&this.getAxisMotionValue(d).animation?.play()),{dragSnapToOrigin:u}=this.getProps();this.panSession=new p0(e,{onSessionStart:s,onStart:o,onMove:i,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:f0(this.visualElement)})}stop(e,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:s}=n;this.startAnimation(s);const{onDragEnd:o}=this.getProps();o&&ie.postRender(()=>o(e,n))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(e,n,r){const{drag:s}=this.getProps();if(!r||!Lo(e,s,this.currentDirection))return;const o=this.getAxisMotionValue(e);let i=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(i=uj(i,this.constraints[e],this.elastic[e])),o.set(i)}resolveConstraints(){const{dragConstraints:e,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,s=this.constraints;e&&er(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&r?this.constraints=dj(r.layoutBox,e):this.constraints=!1,this.elastic=mj(n),s!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&ot(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=pj(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!er(e))return!1;const r=e.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const o=ij(r,s.root,this.visualElement.getTransformPagePoint());let i=hj(s.layout.layoutBox,o);if(n){const a=n(ZC(i));this.hasMutatedConstraints=!!a,a&&(i=a0(a))}return i}startAnimation(e){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:o,dragSnapToOrigin:i,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},u=ot(d=>{if(!Lo(d,n,this.currentDirection))return;let h=l&&l[d]||{};i&&(h={min:0,max:0});const f=s?200:1e6,m=s?40:1e7,v={type:"inertia",velocity:r?e[d]:0,bounceStiffness:f,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...o,...h};return this.startAxisValueAnimation(d,v)});return Promise.all(u).then(a)}startAxisValueAnimation(e,n){const r=this.getAxisMotionValue(e);return Gl(this.visualElement,e),r.start(ku(e,r,0,n,this.visualElement,!1))}stopAnimation(){ot(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){ot(e=>this.getAxisMotionValue(e).animation?.pause())}getAnimationState(e){return this.getAxisMotionValue(e).animation?.state}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,r=this.visualElement.getProps(),s=r[n];return s||this.visualElement.getValue(e,(r.initial?r.initial[e]:void 0)||0)}snapToCursor(e){ot(n=>{const{drag:r}=this.getProps();if(!Lo(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,o=this.getAxisMotionValue(n);if(s&&s.layout){const{min:i,max:a}=s.layout.layoutBox[n];o.set(e[n]-be(i,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!er(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};ot(i=>{const a=this.getAxisMotionValue(i);if(a&&this.constraints!==!1){const l=a.get();s[i]=fj({min:l,max:l},this.constraints[i])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),ot(i=>{if(!Lo(i,e,null))return;const a=this.getAxisMotionValue(i),{min:l,max:u}=this.constraints[i];a.set(be(l,u,s[i]))})}addListeners(){if(!this.visualElement.current)return;gj.set(this.visualElement,this);const e=this.visualElement.current,n=Ds(e,"pointerdown",l=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();er(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,o=s.addEventListener("measure",r);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),ie.read(r);const i=no(window,"resize",()=>this.scalePositionWithinConstraints()),a=s.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(ot(d=>{const h=this.getAxisMotionValue(d);h&&(this.originPoint[d]+=l[d].translate,h.set(h.get()+l[d].translate))}),this.visualElement.render())});return()=>{i(),n(),o(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:o=!1,dragElastic:i=oc,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:o,dragElastic:i,dragMomentum:a}}}function Lo(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function yj(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class _j extends _n{constructor(e){super(e),this.removeGroupControls=Ke,this.removeListeners=Ke,this.controls=new vj(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Ke}unmount(){this.removeGroupControls(),this.removeListeners()}}const _f=t=>(e,n)=>{t&&ie.postRender(()=>t(e,n))};class xj extends _n{constructor(){super(...arguments),this.removePointerDownListener=Ke}onPointerDown(e){this.session=new p0(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:f0(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:_f(e),onStart:_f(n),onMove:r,onEnd:(o,i)=>{delete this.session,s&&ie.postRender(()=>s(o,i))}}}mount(){this.removePointerDownListener=Ds(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Jo={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function xf(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Ur={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(X.test(t))t=parseFloat(t);else return t;const n=xf(t,e.target.x),r=xf(t,e.target.y);return`${n}% ${r}%`}},bj={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,s=yn.parse(t);if(s.length>5)return r;const o=yn.createTransformer(t),i=typeof s[0]!="number"?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;s[0+i]/=a,s[1+i]/=l;const u=be(a,l,.5);return typeof s[2+i]=="number"&&(s[2+i]/=u),typeof s[3+i]=="number"&&(s[3+i]/=u),o(s)}};class wj extends p.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:o}=e;Bk(Ej),o&&(n.group&&n.group.add(o),r&&r.register&&s&&r.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),Jo.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:r,drag:s,isPresent:o}=this.props,i=r.projection;return i&&(i.isPresent=o,s||e.layoutDependency!==n||n===void 0||e.isPresent!==o?i.willUpdate():this.safeToRemove(),e.isPresent!==o&&(o?i.promote():i.relegate()||ie.postRender(()=>{const a=i.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),ru.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=e;s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function g0(t){const[e,n]=ev(),r=p.useContext(Gc);return c.jsx(wj,{...t,layoutGroup:r,switchLayoutGroup:p.useContext(fv),isPresent:e,safeToRemove:n})}const Ej={borderRadius:{...Ur,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ur,borderTopRightRadius:Ur,borderBottomLeftRadius:Ur,borderBottomRightRadius:Ur,boxShadow:bj};function Sj(t,e,n){const r=Me(t)?t:Rt(t);return r.start(ku("",r,e,n)),r.animation}function Tj(t){return t instanceof SVGElement&&t.tagName!=="svg"}const kj=(t,e)=>t.depth-e.depth;class Pj{constructor(){this.children=[],this.isDirty=!1}add(e){qc(this.children,e),this.isDirty=!0}remove(e){Yc(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(kj),this.isDirty=!1,this.children.forEach(e)}}function Cj(t,e){const n=Mt.now(),r=({timestamp:s})=>{const o=s-n;o>=e&&(ft(r),t(o-e))};return ie.read(r,!0),()=>ft(r)}const v0=["TopLeft","TopRight","BottomLeft","BottomRight"],jj=v0.length,bf=t=>typeof t=="string"?parseFloat(t):t,wf=t=>typeof t=="number"||X.test(t);function Rj(t,e,n,r,s,o){s?(t.opacity=be(0,n.opacity!==void 0?n.opacity:1,Aj(r)),t.opacityExit=be(e.opacity!==void 0?e.opacity:1,0,Ij(r))):o&&(t.opacity=be(e.opacity!==void 0?e.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let i=0;i<jj;i++){const a=`border${v0[i]}Radius`;let l=Ef(e,a),u=Ef(n,a);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||wf(l)===wf(u)?(t[a]=Math.max(be(bf(l),bf(u),r),0),(Ot.test(u)||Ot.test(l))&&(t[a]+="%")):t[a]=u}(e.rotate||n.rotate)&&(t.rotate=be(e.rotate||0,n.rotate||0,r))}function Ef(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const Aj=y0(0,.5,Ov),Ij=y0(.5,.95,Ke);function y0(t,e,n){return r=>r<t?0:r>e?1:n(vr(t,e,r))}function Sf(t,e){t.min=e.min,t.max=e.max}function nt(t,e){Sf(t.x,e.x),Sf(t.y,e.y)}function Tf(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function kf(t,e,n,r,s){return t-=e,t=Ri(t,1/n,r),s!==void 0&&(t=Ri(t,1/s,r)),t}function Mj(t,e=0,n=1,r=.5,s,o=t,i=t){if(Ot.test(e)&&(e=parseFloat(e),e=be(i.min,i.max,e/100)-i.min),typeof e!="number")return;let a=be(o.min,o.max,r);t===o&&(a-=e),t.min=kf(t.min,e,n,a,s),t.max=kf(t.max,e,n,a,s)}function Pf(t,e,[n,r,s],o,i){Mj(t,e[n],e[r],e[s],e.scale,o,i)}const Oj=["x","scaleX","originX"],Dj=["y","scaleY","originY"];function Cf(t,e,n,r){Pf(t.x,e,Oj,n?n.x:void 0,r?r.x:void 0),Pf(t.y,e,Dj,n?n.y:void 0,r?r.y:void 0)}function jf(t){return t.translate===0&&t.scale===1}function _0(t){return jf(t.x)&&jf(t.y)}function Rf(t,e){return t.min===e.min&&t.max===e.max}function Nj(t,e){return Rf(t.x,e.x)&&Rf(t.y,e.y)}function Af(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function x0(t,e){return Af(t.x,e.x)&&Af(t.y,e.y)}function If(t){return ze(t.x)/ze(t.y)}function Mf(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class Lj{constructor(){this.members=[]}add(e){qc(this.members,e),e.scheduleRender()}remove(e){if(Yc(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){const n=this.members.findIndex(s=>e===s);if(n===0)return!1;let r;for(let s=n;s>=0;s--){const o=this.members[s];if(o.isPresent!==!1){r=o;break}}return r?(this.promote(r),!0):!1}promote(e,n){const r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.instance&&r.scheduleRender(),e.scheduleRender(),e.resumeFrom=r,n&&(e.resumeFrom.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:s}=e.options;s===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:n,resumingFrom:r}=e;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Fj(t,e,n){let r="";const s=t.x.translate/e.x,o=t.y.translate/e.y,i=n?.z||0;if((s||o||i)&&(r=`translate3d(${s}px, ${o}px, ${i}px) `),(e.x!==1||e.y!==1)&&(r+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:u,rotate:d,rotateX:h,rotateY:f,skewX:m,skewY:v}=n;u&&(r=`perspective(${u}px) ${r}`),d&&(r+=`rotate(${d}deg) `),h&&(r+=`rotateX(${h}deg) `),f&&(r+=`rotateY(${f}deg) `),m&&(r+=`skewX(${m}deg) `),v&&(r+=`skewY(${v}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const Ba=["","X","Y","Z"],$j={visibility:"hidden"},Of=1e3;let Vj=0;function za(t,e,n,r){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),r&&(r[t]=0))}function b0(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=Pv(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:o}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",ie,!(s||o))}const{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&b0(r)}function w0({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(i={},a=e?.()){this.id=Vj++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(Uj),this.nodes.forEach(qj),this.nodes.forEach(Yj),this.nodes.forEach(Hj)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=i,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new Pj)}addEventListener(i,a){return this.eventHandlers.has(i)||this.eventHandlers.set(i,new Zc),this.eventHandlers.get(i).add(a)}notifyListeners(i,...a){const l=this.eventHandlers.get(i);l&&l.notify(...a)}hasListeners(i){return this.eventHandlers.has(i)}mount(i,a=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=Tj(i),this.instance=i;const{layoutId:l,layout:u,visualElement:d}=this.options;if(d&&!d.current&&d.mount(i),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),a&&(u||l)&&(this.isLayoutDirty=!0),t){let h;const f=()=>this.root.updateBlockedByResize=!1;t(i,()=>{this.root.updateBlockedByResize=!0,h&&h(),h=Cj(f,250),Jo.hasAnimatedSinceResize&&(Jo.hasAnimatedSinceResize=!1,this.nodes.forEach(Nf))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&d&&(l||u)&&this.addEventListener("didUpdate",({delta:h,hasLayoutChanged:f,hasRelativeLayoutChanged:m,layout:v})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const g=this.options.transition||d.getDefaultTransition()||eR,{onLayoutAnimationStart:y,onLayoutAnimationComplete:_}=d.getProps(),x=!this.targetLayout||!x0(this.targetLayout,v),w=!f&&m;if(this.options.layoutRoot||this.resumeFrom||w||f&&(x||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(h,w);const E={...tu(g,"layout"),onPlay:y,onComplete:_};(d.shouldReduceMotion||this.options.layoutRoot)&&(E.delay=0,E.type=!1),this.startAnimation(E)}else f||Nf(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=v})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const i=this.getStack();i&&i.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,ft(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Xj),this.animationId++)}getTransformTemplate(){const{visualElement:i}=this.options;return i&&i.getProps().transformTemplate}willUpdate(i=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&b0(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){const h=this.path[d];h.shouldResetTransform=!0,h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),i&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Df);return}this.isUpdating||this.nodes.forEach(Gj),this.isUpdating=!1,this.nodes.forEach(Kj),this.nodes.forEach(Bj),this.nodes.forEach(zj),this.clearAllSnapshots();const a=Mt.now();Ie.delta=Lt(0,1e3/60,a-Ie.timestamp),Ie.timestamp=a,Ie.isProcessing=!0,Ia.update.process(Ie),Ia.preRender.process(Ie),Ia.render.process(Ie),Ie.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,ru.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Wj),this.sharedNodes.forEach(Zj)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ie.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ie.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!ze(this.snapshot.measuredBox.x)&&!ze(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const i=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Te(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,i?i.layoutBox:void 0)}updateScroll(i="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===i&&(a=!1),a){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:i,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!s)return;const i=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!_0(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,d=u!==this.prevTransformTemplateValue;i&&(a||Sn(this.latestValues)||d)&&(s(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(i=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return i&&(l=this.removeTransform(l)),tR(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:i}=this.options;if(!i)return Te();const a=i.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(nR))){const{scroll:u}=this.root;u&&(rr(a.x,u.offset.x),rr(a.y,u.offset.y))}return a}removeElementScroll(i){const a=Te();if(nt(a,i),this.scroll?.wasRoot)return a;for(let l=0;l<this.path.length;l++){const u=this.path[l],{scroll:d,options:h}=u;u!==this.root&&d&&h.layoutScroll&&(d.wasRoot&&nt(a,i),rr(a.x,d.offset.x),rr(a.y,d.offset.y))}return a}applyTransform(i,a=!1){const l=Te();nt(l,i);for(let u=0;u<this.path.length;u++){const d=this.path[u];!a&&d.options.layoutScroll&&d.scroll&&d!==d.root&&sr(l,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),Sn(d.latestValues)&&sr(l,d.latestValues)}return Sn(this.latestValues)&&sr(l,this.latestValues),l}removeTransform(i){const a=Te();nt(a,i);for(let l=0;l<this.path.length;l++){const u=this.path[l];if(!u.instance||!Sn(u.latestValues))continue;rc(u.latestValues)&&u.updateSnapshot();const d=Te(),h=u.measurePageBox();nt(d,h),Cf(a,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,d)}return Sn(this.latestValues)&&Cf(a,this.latestValues),a}setTargetDelta(i){this.targetDelta=i,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(i){this.options={...this.options,...i,crossfade:i.crossfade!==void 0?i.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Ie.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(i=!1){const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==a;if(!(i||l&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:h}=this.options;if(!(!this.layout||!(d||h))){if(this.resolvedRelativeTargetAt=Ie.timestamp,!this.targetDelta&&!this.relativeTarget){const f=this.getClosestProjectingParent();f&&f.layout&&this.animationProgress!==1?(this.relativeParent=f,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Te(),this.relativeTargetOrigin=Te(),Ls(this.relativeTargetOrigin,this.layout.layoutBox,f.layout.layoutBox),nt(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Te(),this.targetWithTransforms=Te()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),sj(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):nt(this.target,this.layout.layoutBox),d0(this.target,this.targetDelta)):nt(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const f=this.getClosestProjectingParent();f&&!!f.resumingFrom==!!this.resumingFrom&&!f.options.layoutScroll&&f.target&&this.animationProgress!==1?(this.relativeParent=f,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Te(),this.relativeTargetOrigin=Te(),Ls(this.relativeTargetOrigin,this.target,f.target),nt(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||rc(this.parent.latestValues)||u0(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){const i=this.getLead(),a=!!this.resumingFrom||this!==i;let l=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===Ie.timestamp&&(l=!1),l)return;const{layout:u,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||d))return;nt(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,f=this.treeScale.y;oj(this.layoutCorrected,this.treeScale,this.path,a),i.layout&&!i.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(i.target=i.layout.layoutBox,i.targetWithTransforms=Te());const{target:m}=i;if(!m){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Tf(this.prevProjectionDelta.x,this.projectionDelta.x),Tf(this.prevProjectionDelta.y,this.projectionDelta.y)),Ns(this.projectionDelta,this.layoutCorrected,m,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==f||!Mf(this.projectionDelta.x,this.prevProjectionDelta.x)||!Mf(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",m))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(i=!0){if(this.options.visualElement?.scheduleRender(),i){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=nr(),this.projectionDelta=nr(),this.projectionDeltaWithTransform=nr()}setAnimationOrigin(i,a=!1){const l=this.snapshot,u=l?l.latestValues:{},d={...this.latestValues},h=nr();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const f=Te(),m=l?l.source:void 0,v=this.layout?this.layout.source:void 0,g=m!==v,y=this.getStack(),_=!y||y.members.length<=1,x=!!(g&&!_&&this.options.crossfade===!0&&!this.path.some(Qj));this.animationProgress=0;let w;this.mixTargetDelta=E=>{const b=E/1e3;Lf(h.x,i.x,b),Lf(h.y,i.y,b),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Ls(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Jj(this.relativeTarget,this.relativeTargetOrigin,f,b),w&&Nj(this.relativeTarget,w)&&(this.isProjectionDirty=!1),w||(w=Te()),nt(w,this.relativeTarget)),g&&(this.animationValues=d,Rj(d,u,this.latestValues,b,x,_)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=b},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(i){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(ft(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ie.update(()=>{Jo.hasAnimatedSinceResize=!0,this.currentAnimation=Sj(0,Of,{...i,onUpdate:a=>{this.mixTargetDelta(a),i.onUpdate&&i.onUpdate(a)},onStop:()=>{},onComplete:()=>{i.onComplete&&i.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const i=this.getStack();i&&i.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Of),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const i=this.getLead();let{targetWithTransforms:a,target:l,layout:u,latestValues:d}=i;if(!(!a||!l||!u)){if(this!==i&&this.layout&&u&&E0(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||Te();const h=ze(this.layout.layoutBox.x);l.x.min=i.target.x.min,l.x.max=l.x.min+h;const f=ze(this.layout.layoutBox.y);l.y.min=i.target.y.min,l.y.max=l.y.min+f}nt(a,l),sr(a,d),Ns(this.projectionDeltaWithTransform,this.layoutCorrected,a,d)}}registerSharedNode(i,a){this.sharedNodes.has(i)||this.sharedNodes.set(i,new Lj),this.sharedNodes.get(i).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const i=this.getStack();return i?i.lead===this:!0}getLead(){const{layoutId:i}=this.options;return i?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:i}=this.options;return i?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:i}=this.options;if(i)return this.root.sharedNodes.get(i)}promote({needsReset:i,transition:a,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),i&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const i=this.getStack();return i?i.relegate(this):!1}resetSkewAndRotation(){const{visualElement:i}=this.options;if(!i)return;let a=!1;const{latestValues:l}=i;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const u={};l.z&&za("z",i,u,this.animationValues);for(let d=0;d<Ba.length;d++)za(`rotate${Ba[d]}`,i,u,this.animationValues),za(`skew${Ba[d]}`,i,u,this.animationValues);i.render();for(const d in u)i.setStaticValue(d,u[d]),this.animationValues&&(this.animationValues[d]=u[d]);i.scheduleRender()}getProjectionStyles(i){if(!this.instance||this.isSVG)return;if(!this.isVisible)return $j;const a={visibility:""},l=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,a.opacity="",a.pointerEvents=Zo(i?.pointerEvents)||"",a.transform=l?l(this.latestValues,""):"none",a;const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){const m={};return this.options.layoutId&&(m.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,m.pointerEvents=Zo(i?.pointerEvents)||""),this.hasProjected&&!Sn(this.latestValues)&&(m.transform=l?l({},""):"none",this.hasProjected=!1),m}const d=u.animationValues||u.latestValues;this.applyTransformsToTarget(),a.transform=Fj(this.projectionDeltaWithTransform,this.treeScale,d),l&&(a.transform=l(d,a.transform));const{x:h,y:f}=this.projectionDelta;a.transformOrigin=`${h.origin*100}% ${f.origin*100}% 0`,u.animationValues?a.opacity=u===this?d.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:d.opacityExit:a.opacity=u===this?d.opacity!==void 0?d.opacity:"":d.opacityExit!==void 0?d.opacityExit:0;for(const m in Js){if(d[m]===void 0)continue;const{correct:v,applyTo:g,isCSSVariable:y}=Js[m],_=a.transform==="none"?d[m]:v(d[m],u);if(g){const x=g.length;for(let w=0;w<x;w++)a[g[w]]=_}else y?this.options.visualElement.renderState.vars[m]=_:a[m]=_}return this.options.layoutId&&(a.pointerEvents=u===this?Zo(i?.pointerEvents)||"":"none"),a}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(i=>i.currentAnimation?.stop()),this.root.nodes.forEach(Df),this.root.sharedNodes.clear()}}}function Bj(t){t.updateLayout()}function zj(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:r}=t.layout,{animationType:s}=t.options,o=e.source!==t.layout.source;s==="size"?ot(d=>{const h=o?e.measuredBox[d]:e.layoutBox[d],f=ze(h);h.min=n[d].min,h.max=h.min+f}):E0(s,e.layoutBox,n)&&ot(d=>{const h=o?e.measuredBox[d]:e.layoutBox[d],f=ze(n[d]);h.max=h.min+f,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[d].max=t.relativeTarget[d].min+f)});const i=nr();Ns(i,n,e.layoutBox);const a=nr();o?Ns(a,t.applyTransform(r,!0),e.measuredBox):Ns(a,n,e.layoutBox);const l=!_0(i);let u=!1;if(!t.resumeFrom){const d=t.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:h,layout:f}=d;if(h&&f){const m=Te();Ls(m,e.layoutBox,h.layoutBox);const v=Te();Ls(v,n,f.layoutBox),x0(m,v)||(u=!0),d.options.layoutRoot&&(t.relativeTarget=v,t.relativeTargetOrigin=m,t.relativeParent=d)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:a,layoutDelta:i,hasLayoutChanged:l,hasRelativeLayoutChanged:u})}else if(t.isLead()){const{onExitComplete:n}=t.options;n&&n()}t.options.transition=void 0}function Uj(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function Hj(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Wj(t){t.clearSnapshot()}function Df(t){t.clearMeasurements()}function Gj(t){t.isLayoutDirty=!1}function Kj(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Nf(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function qj(t){t.resolveTargetDelta()}function Yj(t){t.calcProjection()}function Xj(t){t.resetSkewAndRotation()}function Zj(t){t.removeLeadSnapshot()}function Lf(t,e,n){t.translate=be(e.translate,0,n),t.scale=be(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Ff(t,e,n,r){t.min=be(e.min,n.min,r),t.max=be(e.max,n.max,r)}function Jj(t,e,n,r){Ff(t.x,e.x,n.x,r),Ff(t.y,e.y,n.y,r)}function Qj(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const eR={duration:.45,ease:[.4,0,.1,1]},$f=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Vf=$f("applewebkit/")&&!$f("chrome/")?Math.round:Ke;function Bf(t){t.min=Vf(t.min),t.max=Vf(t.max)}function tR(t){Bf(t.x),Bf(t.y)}function E0(t,e,n){return t==="position"||t==="preserve-aspect"&&!rj(If(e),If(n),.2)}function nR(t){return t!==t.root&&t.scroll?.wasRoot}const rR=w0({attachResizeListener:(t,e)=>no(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Ua={current:void 0},S0=w0({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Ua.current){const t=new rR({});t.mount(window),t.setOptions({layoutScroll:!0}),Ua.current=t}return Ua.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),sR={pan:{Feature:xj},drag:{Feature:_j,ProjectionNode:S0,MeasureLayout:g0}};function zf(t,e,n){const{props:r}=t;t.animationState&&r.whileHover&&t.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,o=r[s];o&&ie.postRender(()=>o(e,_o(e)))}class oR extends _n{mount(){const{current:e}=this.node;e&&(this.unmount=gk(e,(n,r)=>(zf(this.node,r,"Start"),s=>zf(this.node,s,"End"))))}unmount(){}}class iR extends _n{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=yo(no(this.node.current,"focus",()=>this.onFocus()),no(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Uf(t,e,n){const{props:r}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&r.whileTap&&t.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),o=r[s];o&&ie.postRender(()=>o(e,_o(e)))}class aR extends _n{mount(){const{current:e}=this.node;e&&(this.unmount=xk(e,(n,r)=>(Uf(this.node,r,"Start"),(s,{success:o})=>Uf(this.node,s,o?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const ic=new WeakMap,Ha=new WeakMap,lR=t=>{const e=ic.get(t.target);e&&e(t)},cR=t=>{t.forEach(lR)};function uR({root:t,...e}){const n=t||document;Ha.has(n)||Ha.set(n,{});const r=Ha.get(n),s=JSON.stringify(e);return r[s]||(r[s]=new IntersectionObserver(cR,{root:t,...e})),r[s]}function dR(t,e,n){const r=uR(e);return ic.set(t,n),r.observe(t),()=>{ic.delete(t),r.unobserve(t)}}const hR={some:0,all:1};class fR extends _n{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:o}=e,i={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:hR[s]},a=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,o&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:d,onViewportLeave:h}=this.node.getProps(),f=u?d:h;f&&f(l)};return dR(this.node.current,i,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(pR(e,n))&&this.startObserver()}unmount(){}}function pR({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const mR={inView:{Feature:fR},tap:{Feature:aR},focus:{Feature:iR},hover:{Feature:oR}},gR={layout:{ProjectionNode:S0,MeasureLayout:g0}},ac={current:null},T0={current:!1};function vR(){if(T0.current=!0,!!Kc)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>ac.current=t.matches;t.addListener(e),e()}else ac.current=!1}const yR=[...Yv,$e,yn],_R=t=>yR.find(qv(t)),xR=new WeakMap;function bR(t,e,n){for(const r in e){const s=e[r],o=n[r];if(Me(s))t.addValue(r,s);else if(Me(o))t.addValue(r,Rt(s,{owner:t}));else if(o!==s)if(t.hasValue(r)){const i=t.getValue(r);i.liveStyle===!0?i.jump(s):i.hasAnimated||i.set(s)}else{const i=t.getStaticValue(r);t.addValue(r,Rt(i!==void 0?i:s,{owner:t}))}}for(const r in n)e[r]===void 0&&t.removeValue(r);return e}const Hf=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class wR{scrapeMotionValuesFromProps(e,n,r){return{}}constructor({parent:e,props:n,presenceContext:r,reducedMotionConfig:s,blockInitialAnimation:o,visualState:i},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Eu,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const m=Mt.now();this.renderScheduledAt<m&&(this.renderScheduledAt=m,ie.render(this.render,!1,!0))};const{latestValues:l,renderState:u,onUpdate:d}=i;this.onUpdate=d,this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=u,this.parent=e,this.props=n,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=s,this.options=a,this.blockInitialAnimation=!!o,this.isControllingVariants=ea(n),this.isVariantNode=dv(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:h,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const m in f){const v=f[m];l[m]!==void 0&&Me(v)&&v.set(l[m],!1)}}mount(e){this.current=e,xR.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),T0.current||vR(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:ac.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),ft(this.notifyUpdate),ft(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(e,n){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const r=Nn.has(e);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",a=>{this.latestValues[e]=a,this.props.onUpdate&&ie.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),o=n.on("renderRequest",this.scheduleRender);let i;window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{s(),o(),i&&i(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in yr){const n=yr[e];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[e]&&s&&r(this.props)&&(this.features[e]=new s(this)),this.features[e]){const o=this.features[e];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Te()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<Hf.length;r++){const s=Hf[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const o="on"+s,i=e[o];i&&(this.propEventSubscriptions[s]=this.on(s,i))}this.prevMotionValues=bR(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const r=this.values.get(e);n!==r&&(r&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let r=this.values.get(e);return r===void 0&&n!==void 0&&(r=Rt(n===null?void 0:n,{owner:this}),this.addValue(e,r)),r}readValue(e,n){let r=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return r!=null&&(typeof r=="string"&&(Gv(r)||Nv(r))?r=parseFloat(r):!_R(r)&&yn.test(n)&&(r=Uv(e,n)),this.setBaseTarget(e,Me(r)?r.get():r)),Me(r)?r.get():r}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const o=vu(this.props,n,this.presenceContext?.custom);o&&(r=o[e])}if(n&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,e);return s!==void 0&&!Me(s)?s:this.initialValues[e]!==void 0&&r===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new Zc),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}}class k0 extends wR{constructor(){super(...arguments),this.KeyframeResolver=Xv}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){return e.style?e.style[n]:void 0}removeValueFromRenderState(e,{vars:n,style:r}){delete n[e],delete r[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Me(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function ER(t){return window.getComputedStyle(t)}class SR extends k0{constructor(){super(...arguments),this.type="html",this.renderInstance=wv}readValueFromInstance(e,n){if(Nn.has(n))return FP(e,n);{const r=ER(e),s=(cu(n)?r.getPropertyValue(n):r[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(e,{transformPagePoint:n}){return h0(e,n)}build(e,n,r){hu(e,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,n,r){return yu(e,n,r)}}class TR extends k0{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Te,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&bv(this.current,this.renderState)}}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(Nn.has(n)){const r=zv(n);return r&&r.default||0}return n=Ev.has(n)?n:lu(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,r){return Tv(e,n,r)}onBindTransform(){this.current&&!this.renderState.dimensions&&ie.postRender(this.updateDimensions)}build(e,n,r){mu(e,n,this.isSVGTag,r.transformTemplate)}renderInstance(e,n,r,s){Sv(e,n,r,s)}mount(e){this.isSVGTag=gu(e.tagName),super.mount(e)}}const kR=(t,e)=>pu(t)?new TR(e):new SR(e,{allowProjection:t!==p.Fragment}),PR=dP({...YC,...mR,...sR,...gR},kR),fe=Pk(PR);function CR(t,e,n){p.useInsertionEffect(()=>t.on(e,n),[t,e,n])}function P0(t,e){let n;const r=()=>{const{currentTime:s}=e,i=(s===null?0:s.value)/100;n!==i&&t(i),n=i};return ie.update(r,!0),()=>ft(r)}const Qo=new WeakMap;let ei;function jR(t,e){if(e){const{inlineSize:n,blockSize:r}=e[0];return{width:n,height:r}}else return t instanceof SVGElement&&"getBBox"in t?t.getBBox():{width:t.offsetWidth,height:t.offsetHeight}}function RR({target:t,contentRect:e,borderBoxSize:n}){Qo.get(t)?.forEach(r=>{r({target:t,contentSize:e,get size(){return jR(t,n)}})})}function AR(t){t.forEach(RR)}function IR(){typeof ResizeObserver>"u"||(ei=new ResizeObserver(AR))}function MR(t,e){ei||IR();const n=su(t);return n.forEach(r=>{let s=Qo.get(r);s||(s=new Set,Qo.set(r,s)),s.add(e),ei?.observe(r)}),()=>{n.forEach(r=>{const s=Qo.get(r);s?.delete(e),s?.size||ei?.unobserve(r)})}}const ti=new Set;let Fs;function OR(){Fs=()=>{const t={width:window.innerWidth,height:window.innerHeight},e={target:window,size:t,contentSize:t};ti.forEach(n=>n(e))},window.addEventListener("resize",Fs)}function DR(t){return ti.add(t),Fs||OR(),()=>{ti.delete(t),!ti.size&&Fs&&(Fs=void 0)}}function NR(t,e){return typeof t=="function"?DR(t):MR(t,e)}const LR=50,Wf=()=>({current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}),FR=()=>({time:0,x:Wf(),y:Wf()}),$R={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function Gf(t,e,n,r){const s=n[e],{length:o,position:i}=$R[e],a=s.current,l=n.time;s.current=t[`scroll${i}`],s.scrollLength=t[`scroll${o}`]-t[`client${o}`],s.offset.length=0,s.offset[0]=0,s.offset[1]=s.scrollLength,s.progress=vr(0,s.scrollLength,s.current);const u=r-l;s.velocity=u>LR?0:Jc(s.current-a,u)}function VR(t,e,n){Gf(t,"x",e,n),Gf(t,"y",e,n),e.time=n}function BR(t,e){const n={x:0,y:0};let r=t;for(;r&&r!==e;)if(r instanceof HTMLElement)n.x+=r.offsetLeft,n.y+=r.offsetTop,r=r.offsetParent;else if(r.tagName==="svg"){const s=r.getBoundingClientRect();r=r.parentElement;const o=r.getBoundingClientRect();n.x+=s.left-o.left,n.y+=s.top-o.top}else if(r instanceof SVGGraphicsElement){const{x:s,y:o}=r.getBBox();n.x+=s,n.y+=o;let i=null,a=r.parentNode;for(;!i;)a.tagName==="svg"&&(i=a),a=r.parentNode;r=i}else break;return n}const lc={start:0,center:.5,end:1};function Kf(t,e,n=0){let r=0;if(t in lc&&(t=lc[t]),typeof t=="string"){const s=parseFloat(t);t.endsWith("px")?r=s:t.endsWith("%")?t=s/100:t.endsWith("vw")?r=s/100*document.documentElement.clientWidth:t.endsWith("vh")?r=s/100*document.documentElement.clientHeight:t=s}return typeof t=="number"&&(r=e*t),n+r}const zR=[0,0];function UR(t,e,n,r){let s=Array.isArray(t)?t:zR,o=0,i=0;return typeof t=="number"?s=[t,t]:typeof t=="string"&&(t=t.trim(),t.includes(" ")?s=t.split(" "):s=[t,lc[t]?t:"0"]),o=Kf(s[0],n,r),i=Kf(s[1],e),o-i}const HR={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},WR={x:0,y:0};function GR(t){return"getBBox"in t&&t.tagName!=="svg"?t.getBBox():{width:t.clientWidth,height:t.clientHeight}}function KR(t,e,n){const{offset:r=HR.All}=n,{target:s=t,axis:o="y"}=n,i=o==="y"?"height":"width",a=s!==t?BR(s,t):WR,l=s===t?{width:t.scrollWidth,height:t.scrollHeight}:GR(s),u={width:t.clientWidth,height:t.clientHeight};e[o].offset.length=0;let d=!e[o].interpolate;const h=r.length;for(let f=0;f<h;f++){const m=UR(r[f],u[i],l[i],a[o]);!d&&m!==e[o].interpolatorOffsets[f]&&(d=!0),e[o].offset[f]=m}d&&(e[o].interpolate=Tu(e[o].offset,n0(r),{clamp:!1}),e[o].interpolatorOffsets=[...e[o].offset]),e[o].progress=Lt(0,1,e[o].interpolate(e[o].current))}function qR(t,e=t,n){if(n.x.targetOffset=0,n.y.targetOffset=0,e!==t){let r=e;for(;r&&r!==t;)n.x.targetOffset+=r.offsetLeft,n.y.targetOffset+=r.offsetTop,r=r.offsetParent}n.x.targetLength=e===t?e.scrollWidth:e.clientWidth,n.y.targetLength=e===t?e.scrollHeight:e.clientHeight,n.x.containerLength=t.clientWidth,n.y.containerLength=t.clientHeight}function YR(t,e,n,r={}){return{measure:()=>qR(t,r.target,n),update:s=>{VR(t,n,s),(r.offset||r.target)&&KR(t,n,r)},notify:()=>e(n)}}const Hr=new WeakMap,qf=new WeakMap,Wa=new WeakMap,Yf=t=>t===document.documentElement?window:t;function Pu(t,{container:e=document.documentElement,...n}={}){let r=Wa.get(e);r||(r=new Set,Wa.set(e,r));const s=FR(),o=YR(e,t,s,n);if(r.add(o),!Hr.has(e)){const a=()=>{for(const f of r)f.measure()},l=()=>{for(const f of r)f.update(Ie.timestamp)},u=()=>{for(const f of r)f.notify()},d=()=>{ie.read(a,!1,!0),ie.read(l,!1,!0),ie.update(u,!1,!0)};Hr.set(e,d);const h=Yf(e);window.addEventListener("resize",d,{passive:!0}),e!==document.documentElement&&qf.set(e,NR(e,d)),h.addEventListener("scroll",d,{passive:!0})}const i=Hr.get(e);return ie.read(i,!1,!0),()=>{ft(i);const a=Wa.get(e);if(!a||(a.delete(o),a.size))return;const l=Hr.get(e);Hr.delete(e),l&&(Yf(e).removeEventListener("scroll",l),qf.get(e)?.(),window.removeEventListener("resize",l))}}function XR({source:t,container:e,axis:n="y"}){t&&(e=t);const r={value:0},s=Pu(o=>{r.value=o[n].progress*100},{container:e,axis:n});return{currentTime:r,cancel:s}}const Ga=new Map;function C0({source:t,container:e=document.documentElement,axis:n="y"}={}){t&&(e=t),Ga.has(e)||Ga.set(e,{});const r=Ga.get(e);return r[n]||(r[n]=tv()?new ScrollTimeline({source:e,axis:n}):XR({source:e,axis:n})),r[n]}function ZR(t){return t.length===2}function j0(t){return t&&(t.target||t.offset)}function JR(t,e){return ZR(t)||j0(e)?Pu(n=>{t(n[e.axis].progress,n)},e):P0(t,C0(e))}function QR(t,e){if(t.flatten(),j0(e))return t.pause(),Pu(n=>{t.time=t.duration*n[e.axis].progress},e);{const n=C0(e);return t.attachTimeline?t.attachTimeline(n,r=>(r.pause(),P0(s=>{r.time=r.duration*s},n))):Ke}}function eA(t,{axis:e="y",...n}={}){const r={axis:e,...n};return typeof t=="function"?JR(t,r):QR(t,r)}function Xf(t,e){sk(!!(!e||e.current))}const tA=()=>({scrollX:Rt(0),scrollY:Rt(0),scrollXProgress:Rt(0),scrollYProgress:Rt(0)});function R0({container:t,target:e,layoutEffect:n=!0,...r}={}){const s=vn(tA);return(n?po:p.useEffect)(()=>(Xf("target",e),Xf("container",t),eA((i,{x:a,y:l})=>{s.scrollX.set(a.current),s.scrollXProgress.set(a.progress),s.scrollY.set(l.current),s.scrollYProgress.set(l.progress)},{...r,container:t?.current||void 0,target:e?.current||void 0})),[t,e,JSON.stringify(r.offset)]),s}function A0(t){const e=vn(()=>Rt(t)),{isStatic:n}=p.useContext(mo);if(n){const[,r]=p.useState(t);p.useEffect(()=>e.on("change",r),[])}return e}function I0(t,e){const n=A0(e()),r=()=>n.set(e());return r(),po(()=>{const s=()=>ie.preRender(r,!1,!0),o=t.map(i=>i.on("change",s));return()=>{o.forEach(i=>i()),ft(r)}}),n}function Zf(t,e={}){const{isStatic:n}=p.useContext(mo),r=p.useRef(null),s=vn(()=>Me(t)?t.get():t),o=vn(()=>typeof s=="string"?s.replace(/[\d.-]/g,""):void 0),i=A0(s),a=p.useRef(s),l=p.useRef(Ke),u=()=>{d(),r.current=EC({keyframes:[Qf(i.get()),Qf(a.current)],velocity:i.getVelocity(),type:"spring",restDelta:.001,restSpeed:.01,...e,onUpdate:l.current})},d=()=>{r.current&&r.current.stop()};return p.useInsertionEffect(()=>i.attach((h,f)=>n?f(h):(a.current=h,l.current=m=>f(Jf(m,o)),ie.postRender(u),i.get()),d),[JSON.stringify(e)]),po(()=>{if(Me(t))return t.on("change",h=>i.set(Jf(h,o)))},[i,o]),i}function Jf(t,e){return e?t+e:t}function Qf(t){return typeof t=="number"?t:parseFloat(t)}const nA=t=>t&&typeof t=="object"&&t.mix,rA=t=>nA(t)?t.mix:void 0;function sA(...t){const e=!Array.isArray(t[0]),n=e?0:-1,r=t[0+n],s=t[1+n],o=t[2+n],i=t[3+n],a=Tu(s,o,{mixer:rA(o[0]),...i});return e?a(r):a}function oA(t){Ms.current=[],t();const e=I0(Ms.current,t);return Ms.current=void 0,e}function Ai(t,e,n,r){if(typeof t=="function")return oA(t);const s=typeof e=="function"?e:sA(e,n,r);return Array.isArray(t)?ep(t,s):ep([t],([o])=>s(o))}function ep(t,e){const n=vn(()=>[]);return I0(t,()=>{n.length=0;const r=t.length;for(let s=0;s<r;s++)n[s]=t[s].get();return e(n)})}const iA={some:0,all:1};function aA(t,e,{root:n,margin:r,amount:s="some"}={}){const o=su(t),i=new WeakMap,a=u=>{u.forEach(d=>{const h=i.get(d.target);if(d.isIntersecting!==!!h)if(d.isIntersecting){const f=e(d.target,d);typeof f=="function"?i.set(d.target,f):l.unobserve(d.target)}else typeof h=="function"&&(h(d),i.delete(d.target))})},l=new IntersectionObserver(a,{root:n,rootMargin:r,threshold:typeof s=="number"?s:iA[s]});return o.forEach(u=>l.observe(u)),()=>l.disconnect()}function lA(t,{root:e,margin:n,amount:r,once:s=!1,initial:o=!1}={}){const[i,a]=p.useState(o);return p.useEffect(()=>{if(!t.current||s&&i)return;const l=()=>(a(!0),s?void 0:()=>a(!1)),u={root:e&&e.current||void 0,margin:n,amount:r};return aA(t.current,l,u)},[e,t,n,s,r]),i}const M0="/assets/lumi-idle-0POIBpsz.webp",O0="/assets/lumi-flying-BYO-JzK3.webp",cA=({flyingGifSrc:t=O0,idleGifSrc:e=M0,targetElement:n,onTargetReached:r})=>{const[s,o]=p.useState(!1),[i,a]=p.useState(!1),[l,u]=p.useState(!1),[d,h]=p.useState(!1),f=p.useRef({x:0,y:0}),m=p.useRef(!1),v={stiffness:150,damping:15,mass:1},g=Zf(0,v),y=Zf(0,v);if(p.useEffect(()=>{if(n){h(!0),m.current=!1;const x=n.getBoundingClientRect(),w=x.left+x.width/2+20,E=x.top-30;g.set(w),y.set(E);const b=setTimeout(()=>{m.current||(m.current=!0,r?.())},500);return()=>clearTimeout(b)}else h(!1)},[n,g,y,r]),p.useEffect(()=>{if(d)return;let x=0;const w=E=>{const b=performance.now();if(b-x<16)return;x=b,l||u(!0),g.set(E.clientX+20),y.set(E.clientY-20);const k=E.target.closest("[data-lumi-interactive]")!==null;o(k)};return window.addEventListener("mousemove",w,{passive:!0}),()=>{window.removeEventListener("mousemove",w)}},[l,g,y,d]),p.useEffect(()=>{if(d)return;let x=0;const w=b=>{const T=b.touches[0];if(!T)return;const k=performance.now();if(k-x<16)return;x=k,l||u(!0),g.set(T.clientX+20),y.set(T.clientY-50);const O=b.target.closest("[data-lumi-interactive]")!==null;o(O)},E=b=>{const T=b.touches[0];T&&(l||u(!0),g.set(T.clientX+20),y.set(T.clientY-50))};return window.addEventListener("touchstart",E,{passive:!0}),window.addEventListener("touchmove",w,{passive:!0}),()=>{window.removeEventListener("touchstart",E),window.removeEventListener("touchmove",w)}},[l,g,y,d]),p.useEffect(()=>{const x=setInterval(()=>{const w=g.get(),E=y.get(),b=w-f.current.x,T=E-f.current.y,k=Math.sqrt(b*b+T*T);a(k>1),f.current={x:w,y:E}},50);return()=>clearInterval(x)},[g,y]),!l)return null;const _=i&&!s&&!(d&&m.current);return c.jsxs(fe.div,{className:"fixed top-0 left-0 pointer-events-none z-[9999]",style:{x:g,y,willChange:"transform"},children:[c.jsx(fe.div,{animate:{scale:s||d?1.3:1,filter:s||d?"drop-shadow(0 0 20px rgba(255, 200, 100, 0.9)) drop-shadow(0 0 40px rgba(255, 180, 50, 0.6))":"drop-shadow(0 0 8px rgba(255, 200, 100, 0.4))"},transition:{duration:.25,ease:"easeOut"},children:c.jsxs("div",{className:"relative w-14 h-14",children:[c.jsx("img",{src:e,alt:"Lumi",className:"absolute inset-0 w-14 h-14 object-contain transition-opacity duration-150",style:{opacity:_?0:1},draggable:!1,decoding:"async"}),c.jsx("img",{src:t,alt:"","aria-hidden":"true",className:"absolute inset-0 w-14 h-14 object-contain transition-opacity duration-150",style:{opacity:_?1:0},draggable:!1,decoding:"async"})]})}),(s||d)&&c.jsx(fe.div,{className:"absolute inset-0 -z-10 rounded-full",initial:{scale:.8,opacity:0},animate:{scale:1.5,opacity:1},transition:{duration:.3},style:{background:"radial-gradient(circle, rgba(255, 200, 100, 0.4) 0%, transparent 70%)"}})]})};let Fo=null;function uA(t){"requestIdleCallback"in window?window.requestIdleCallback(t,{timeout:4e3}):setTimeout(t,2e3)}function dA(){return Fo||(Fo=new Promise(t=>{if(typeof window>"u"){t(null);return}uA(async()=>{const{default:e}=await S(async()=>{const{default:n}=await Promise.resolve().then(()=>HT);return{default:n}},void 0);e.init("phc_5WxlAFQoA7g6daYB1QX9p6OsJMQkzmwgbjaBKG28S5m",{api_host:"https://us.i.posthog.com",loaded:()=>{},capture_pageview:!1,capture_pageleave:!0}),t(e)})}),Fo)}function hA(){const t=io();return p.useEffect(()=>{dA().then(e=>{e?.capture("$pageview")})},[t.pathname]),null}function fA({children:t}){return c.jsxs(c.Fragment,{children:[c.jsx(hA,{}),t]})}const pA=()=>{const{user:t,session:e}=Wc(),[n,r]=p.useState("guest"),[s,o]=p.useState({status:"none",isExpired:!0,isCancelledAtPeriodEnd:!1,planType:null}),[i,a]=p.useState(null),[l,u]=p.useState(null),[d,h]=p.useState(!0),[f,m]=p.useState(!1),[v,g]=p.useState(null),[y,_]=p.useState(!1),x=p.useRef(null),w=p.useCallback(async(T=!1)=>{if(!t){r("guest"),o({status:"none",isExpired:!0,isCancelledAtPeriodEnd:!1,planType:null}),h(!1),_(!0),x.current=null;return}if(!(y&&x.current===t.id&&!T))try{h(!0),T&&m(!0),g(null);const{data:k,error:P}=await ce.from("profiles").select("user_type, avatar_url, display_name").eq("id",t.id).single();if(P)throw console.error("[ACCESS-CONTROL] Profile error:",P),P;const{data:O,error:R}=await ce.from("user_payments").select("subscription_status, subscription_start_date, subscription_end_date, cancel_at_period_end, plan_type").eq("user_id",t.id).maybeSingle();if(R&&console.error("[ACCESS-CONTROL] Payment error:",R),k){a(k.avatar_url||null);const B=k.display_name||t.user_metadata?.display_name||t.user_metadata?.name||t.user_metadata?.full_name||null;u(B);const N=k.user_type||"free",K=new Date,M=O?.subscription_end_date?new Date(O.subscription_end_date):void 0,q=M?K>M:!0;o({status:O?.subscription_status||"none",startDate:O?.subscription_start_date?new Date(O.subscription_start_date):void 0,endDate:M,isExpired:q,isCancelledAtPeriodEnd:O?.cancel_at_period_end??!1,planType:O?.plan_type??null}),N!=="admin"?O?.subscription_status==="active"&&!q?r("paid"):k.user_type!=="guest"&&r("free"):r(N)}}catch(k){console.error("[ACCESS-CONTROL] Error:",k);const P=k instanceof Error?k.message:String(k);g(P),T&&Pt.error("Failed to refresh profile data",{description:"Please try again later or contact support."})}finally{h(!1),_(!0),x.current=t.id,T&&m(!1)}},[t?.id,y]);p.useEffect(()=>{t?.id!==x.current&&_(!1)},[t?.id]),p.useEffect(()=>{w()},[w]);const E=T=>T==="guest"?!0:T==="free"?n==="free"||n==="paid"||n==="admin":T==="paid"?n==="paid"||n==="admin"||s.status==="active"&&!s.isExpired:!1,b=p.useCallback(async()=>{await w(!0)},[w]);return{userType:n,subscription:s,avatarUrl:i,displayName:l,isLoading:d,isRefreshing:f,lastRefreshError:v,canAccessStory:E,isAuthenticated:!!t,refreshSubscriptionStatus:b}},mA=Vi("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-all duration-300 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 hover:scale-[1.02] active:scale-[0.98]",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline",contrast:"bg-nature-red text-white hover:bg-nature-yellow",coral:"bg-nature-coral text-white hover:bg-nature-coral/90"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"},animated:{true:"animate-pulse-gentle",false:""}},defaultVariants:{variant:"default",size:"default",animated:!1}}),un=p.forwardRef(({className:t,variant:e,size:n,animated:r,asChild:s=!1,...o},i)=>{const a=s?jn:"button";return c.jsx(a,{className:_e(mA({variant:e,size:n,animated:r,className:t})),ref:i,...o})});un.displayName="Button";var gA=p.createContext(void 0);function D0(t){const e=p.useContext(gA);return t||e||"ltr"}var Ka=0;function N0(){p.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??tp()),document.body.insertAdjacentElement("beforeend",t[1]??tp()),Ka++,()=>{Ka===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Ka--}},[])}function tp(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var qa="focusScope.autoFocusOnMount",Ya="focusScope.autoFocusOnUnmount",np={bubbles:!1,cancelable:!0},vA="FocusScope",Cu=p.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...i}=t,[a,l]=p.useState(null),u=Ve(s),d=Ve(o),h=p.useRef(null),f=Pe(e,g=>l(g)),m=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(r){let g=function(w){if(m.paused||!a)return;const E=w.target;a.contains(E)?h.current=E:an(h.current,{select:!0})},y=function(w){if(m.paused||!a)return;const E=w.relatedTarget;E!==null&&(a.contains(E)||an(h.current,{select:!0}))},_=function(w){if(document.activeElement===document.body)for(const b of w)b.removedNodes.length>0&&an(a)};document.addEventListener("focusin",g),document.addEventListener("focusout",y);const x=new MutationObserver(_);return a&&x.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",y),x.disconnect()}}},[r,a,m.paused]),p.useEffect(()=>{if(a){sp.add(m);const g=document.activeElement;if(!a.contains(g)){const _=new CustomEvent(qa,np);a.addEventListener(qa,u),a.dispatchEvent(_),_.defaultPrevented||(yA(EA(L0(a)),{select:!0}),document.activeElement===g&&an(a))}return()=>{a.removeEventListener(qa,u),setTimeout(()=>{const _=new CustomEvent(Ya,np);a.addEventListener(Ya,d),a.dispatchEvent(_),_.defaultPrevented||an(g??document.body,{select:!0}),a.removeEventListener(Ya,d),sp.remove(m)},0)}}},[a,u,d,m]);const v=p.useCallback(g=>{if(!n&&!r||m.paused)return;const y=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,_=document.activeElement;if(y&&_){const x=g.currentTarget,[w,E]=_A(x);w&&E?!g.shiftKey&&_===E?(g.preventDefault(),n&&an(w,{select:!0})):g.shiftKey&&_===w&&(g.preventDefault(),n&&an(E,{select:!0})):_===x&&g.preventDefault()}},[n,r,m.paused]);return c.jsx(le.div,{tabIndex:-1,...i,ref:f,onKeyDown:v})});Cu.displayName=vA;function yA(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(an(r,{select:e}),document.activeElement!==n)return}function _A(t){const e=L0(t),n=rp(e,t),r=rp(e.reverse(),t);return[n,r]}function L0(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function rp(t,e){for(const n of t)if(!xA(n,{upTo:e}))return n}function xA(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function bA(t){return t instanceof HTMLInputElement&&"select"in t}function an(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&bA(t)&&e&&t.select()}}var sp=wA();function wA(){let t=[];return{add(e){const n=t[0];e!==n&&n?.pause(),t=op(t,e),t.unshift(e)},remove(e){t=op(t,e),t[0]?.resume()}}}function op(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function EA(t){return t.filter(e=>e.tagName!=="A")}function SA(t,e=[]){let n=[];function r(o,i){const a=p.createContext(i),l=n.length;n=[...n,i];function u(h){const{scope:f,children:m,...v}=h,g=f?.[t][l]||a,y=p.useMemo(()=>v,Object.values(v));return c.jsx(g.Provider,{value:y,children:m})}function d(h,f){const m=f?.[t][l]||a,v=p.useContext(m);if(v)return v;if(i!==void 0)return i;throw new Error(`\`${h}\` must be used within \`${o}\``)}return u.displayName=o+"Provider",[u,d]}const s=()=>{const o=n.map(i=>p.createContext(i));return function(a){const l=a?.[t]||o;return p.useMemo(()=>({[`__scope${t}`]:{...a,[t]:l}}),[a,l])}};return s.scopeName=t,[r,TA(s,...e)]}function TA(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const i=r.reduce((a,{useScope:l,scopeName:u})=>{const h=l(o)[`__scope${u}`];return{...a,...h}},{});return p.useMemo(()=>({[`__scope${e.scopeName}`]:i}),[i])}};return n.scopeName=e.scopeName,n}var Xa="rovingFocusGroup.onEntryFocus",kA={bubbles:!1,cancelable:!0},ra="RovingFocusGroup",[cc,F0,PA]=vc(ra),[CA,$0]=SA(ra,[PA]),[jA,RA]=CA(ra),V0=p.forwardRef((t,e)=>c.jsx(cc.Provider,{scope:t.__scopeRovingFocusGroup,children:c.jsx(cc.Slot,{scope:t.__scopeRovingFocusGroup,children:c.jsx(AA,{...t,ref:e})})}));V0.displayName=ra;var AA=p.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:o,currentTabStopId:i,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...h}=t,f=p.useRef(null),m=Pe(e,f),v=D0(o),[g=null,y]=co({prop:i,defaultProp:a,onChange:l}),[_,x]=p.useState(!1),w=Ve(u),E=F0(n),b=p.useRef(!1),[T,k]=p.useState(0);return p.useEffect(()=>{const P=f.current;if(P)return P.addEventListener(Xa,w),()=>P.removeEventListener(Xa,w)},[w]),c.jsx(jA,{scope:n,orientation:r,dir:v,loop:s,currentTabStopId:g,onItemFocus:p.useCallback(P=>y(P),[y]),onItemShiftTab:p.useCallback(()=>x(!0),[]),onFocusableItemAdd:p.useCallback(()=>k(P=>P+1),[]),onFocusableItemRemove:p.useCallback(()=>k(P=>P-1),[]),children:c.jsx(le.div,{tabIndex:_||T===0?-1:0,"data-orientation":r,...h,ref:m,style:{outline:"none",...t.style},onMouseDown:W(t.onMouseDown,()=>{b.current=!0}),onFocus:W(t.onFocus,P=>{const O=!b.current;if(P.target===P.currentTarget&&O&&!_){const R=new CustomEvent(Xa,kA);if(P.currentTarget.dispatchEvent(R),!R.defaultPrevented){const B=E().filter(z=>z.focusable),N=B.find(z=>z.active),K=B.find(z=>z.id===g),q=[N,K,...B].filter(Boolean).map(z=>z.ref.current);U0(q,d)}}b.current=!1}),onBlur:W(t.onBlur,()=>x(!1))})})}),B0="RovingFocusGroupItem",z0=p.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:o,...i}=t,a=Pn(),l=o||a,u=RA(B0,n),d=u.currentTabStopId===l,h=F0(n),{onFocusableItemAdd:f,onFocusableItemRemove:m}=u;return p.useEffect(()=>{if(r)return f(),()=>m()},[r,f,m]),c.jsx(cc.ItemSlot,{scope:n,id:l,focusable:r,active:s,children:c.jsx(le.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...i,ref:e,onMouseDown:W(t.onMouseDown,v=>{r?u.onItemFocus(l):v.preventDefault()}),onFocus:W(t.onFocus,()=>u.onItemFocus(l)),onKeyDown:W(t.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){u.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const g=OA(v,u.orientation,u.dir);if(g!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let _=h().filter(x=>x.focusable).map(x=>x.ref.current);if(g==="last")_.reverse();else if(g==="prev"||g==="next"){g==="prev"&&_.reverse();const x=_.indexOf(v.currentTarget);_=u.loop?DA(_,x+1):_.slice(x+1)}setTimeout(()=>U0(_))}})})})});z0.displayName=B0;var IA={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function MA(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function OA(t,e,n){const r=MA(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return IA[r]}function U0(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function DA(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var NA=V0,LA=z0,FA=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Wn=new WeakMap,$o=new WeakMap,Vo={},Za=0,H0=function(t){return t&&(t.host||H0(t.parentNode))},$A=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=H0(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},VA=function(t,e,n,r){var s=$A(e,Array.isArray(t)?t:[t]);Vo[n]||(Vo[n]=new WeakMap);var o=Vo[n],i=[],a=new Set,l=new Set(s),u=function(h){!h||a.has(h)||(a.add(h),u(h.parentNode))};s.forEach(u);var d=function(h){!h||l.has(h)||Array.prototype.forEach.call(h.children,function(f){if(a.has(f))d(f);else try{var m=f.getAttribute(r),v=m!==null&&m!=="false",g=(Wn.get(f)||0)+1,y=(o.get(f)||0)+1;Wn.set(f,g),o.set(f,y),i.push(f),g===1&&v&&$o.set(f,!0),y===1&&f.setAttribute(n,"true"),v||f.setAttribute(r,"true")}catch(_){console.error("aria-hidden: cannot operate on ",f,_)}})};return d(e),a.clear(),Za++,function(){i.forEach(function(h){var f=Wn.get(h)-1,m=o.get(h)-1;Wn.set(h,f),o.set(h,m),f||($o.has(h)||h.removeAttribute(r),$o.delete(h)),m||h.removeAttribute(n)}),Za--,Za||(Wn=new WeakMap,Wn=new WeakMap,$o=new WeakMap,Vo={})}},W0=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),s=FA(t);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live]"))),VA(r,s,n,"aria-hidden")):function(){return null}},kt=function(){return kt=Object.assign||function(e){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},kt.apply(this,arguments)};function G0(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(t);s<r.length;s++)e.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(t,r[s])&&(n[r[s]]=t[r[s]]);return n}function BA(t,e,n){if(n||arguments.length===2)for(var r=0,s=e.length,o;r<s;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))}var ni="right-scroll-bar-position",ri="width-before-scroll-bar",zA="with-scroll-bars-hidden",UA="--removed-body-scroll-bar-size";function Ja(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function HA(t,e){var n=p.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=e,n.facade}var WA=typeof window<"u"?p.useLayoutEffect:p.useEffect,ip=new WeakMap;function GA(t,e){var n=HA(null,function(r){return t.forEach(function(s){return Ja(s,r)})});return WA(function(){var r=ip.get(n);if(r){var s=new Set(r),o=new Set(t),i=n.current;s.forEach(function(a){o.has(a)||Ja(a,null)}),o.forEach(function(a){s.has(a)||Ja(a,i)})}ip.set(n,t)},[t]),n}function KA(t){return t}function qA(t,e){e===void 0&&(e=KA);var n=[],r=!1,s={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(o){var i=e(o,r);return n.push(i),function(){n=n.filter(function(a){return a!==i})}},assignSyncMedium:function(o){for(r=!0;n.length;){var i=n;n=[],i.forEach(o)}n={push:function(a){return o(a)},filter:function(){return n}}},assignMedium:function(o){r=!0;var i=[];if(n.length){var a=n;n=[],a.forEach(o),i=n}var l=function(){var d=i;i=[],d.forEach(o)},u=function(){return Promise.resolve().then(l)};u(),n={push:function(d){i.push(d),u()},filter:function(d){return i=i.filter(d),n}}}};return s}function YA(t){t===void 0&&(t={});var e=qA(null);return e.options=kt({async:!0,ssr:!1},t),e}var K0=function(t){var e=t.sideCar,n=G0(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return p.createElement(r,kt({},n))};K0.isSideCarExport=!0;function XA(t,e){return t.useMedium(e),K0}var q0=YA(),Qa=function(){},sa=p.forwardRef(function(t,e){var n=p.useRef(null),r=p.useState({onScrollCapture:Qa,onWheelCapture:Qa,onTouchMoveCapture:Qa}),s=r[0],o=r[1],i=t.forwardProps,a=t.children,l=t.className,u=t.removeScrollBar,d=t.enabled,h=t.shards,f=t.sideCar,m=t.noIsolation,v=t.inert,g=t.allowPinchZoom,y=t.as,_=y===void 0?"div":y,x=t.gapMode,w=G0(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=f,b=GA([n,e]),T=kt(kt({},w),s);return p.createElement(p.Fragment,null,d&&p.createElement(E,{sideCar:q0,removeScrollBar:u,shards:h,noIsolation:m,inert:v,setCallbacks:o,allowPinchZoom:!!g,lockRef:n,gapMode:x}),i?p.cloneElement(p.Children.only(a),kt(kt({},T),{ref:b})):p.createElement(_,kt({},T,{className:l,ref:b}),a))});sa.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};sa.classNames={fullWidth:ri,zeroRight:ni};var ZA=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function JA(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=ZA();return e&&t.setAttribute("nonce",e),t}function QA(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function e2(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var t2=function(){var t=0,e=null;return{add:function(n){t==0&&(e=JA())&&(QA(e,n),e2(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},n2=function(){var t=t2();return function(e,n){p.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},Y0=function(){var t=n2(),e=function(n){var r=n.styles,s=n.dynamic;return t(r,s),null};return e},r2={left:0,top:0,right:0,gap:0},el=function(t){return parseInt(t||"",10)||0},s2=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],r=e[t==="padding"?"paddingTop":"marginTop"],s=e[t==="padding"?"paddingRight":"marginRight"];return[el(n),el(r),el(s)]},o2=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return r2;var e=s2(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},i2=Y0(),cr="data-scroll-locked",a2=function(t,e,n,r){var s=t.left,o=t.top,i=t.right,a=t.gap;return n===void 0&&(n="margin"),`
.`.concat(zA,` {
overflow: hidden `).concat(r,`;
padding-right: `).concat(a,"px ").concat(r,`;
}
body[`).concat(cr,`] {
overflow: hidden `).concat(r,`;
overscroll-behavior: contain;
`).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&`
padding-left: `.concat(s,`px;
padding-top: `).concat(o,`px;
padding-right: `).concat(i,`px;
margin-left:0;
margin-top:0;
margin-right: `).concat(a,"px ").concat(r,`;
`),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
}
.`).concat(ni,` {
right: `).concat(a,"px ").concat(r,`;
}
.`).concat(ri,` {
margin-right: `).concat(a,"px ").concat(r,`;
}
.`).concat(ni," .").concat(ni,` {
right: 0 `).concat(r,`;
}
.`).concat(ri," .").concat(ri,` {
margin-right: 0 `).concat(r,`;
}
body[`).concat(cr,`] {
`).concat(UA,": ").concat(a,`px;
}
`)},ap=function(){var t=parseInt(document.body.getAttribute(cr)||"0",10);return isFinite(t)?t:0},l2=function(){p.useEffect(function(){return document.body.setAttribute(cr,(ap()+1).toString()),function(){var t=ap()-1;t<=0?document.body.removeAttribute(cr):document.body.setAttribute(cr,t.toString())}},[])},c2=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,s=r===void 0?"margin":r;l2();var o=p.useMemo(function(){return o2(s)},[s]);return p.createElement(i2,{styles:a2(o,!e,s,n?"":"!important")})},uc=!1;if(typeof window<"u")try{var Bo=Object.defineProperty({},"passive",{get:function(){return uc=!0,!0}});window.addEventListener("test",Bo,Bo),window.removeEventListener("test",Bo,Bo)}catch{uc=!1}var Gn=uc?{passive:!1}:!1,u2=function(t){return t.tagName==="TEXTAREA"},X0=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!u2(t)&&n[e]==="visible")},d2=function(t){return X0(t,"overflowY")},h2=function(t){return X0(t,"overflowX")},lp=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=Z0(t,r);if(s){var o=J0(t,r),i=o[1],a=o[2];if(i>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},f2=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},p2=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},Z0=function(t,e){return t==="v"?d2(e):h2(e)},J0=function(t,e){return t==="v"?f2(e):p2(e)},m2=function(t,e){return t==="h"&&e==="rtl"?-1:1},g2=function(t,e,n,r,s){var o=m2(t,window.getComputedStyle(e).direction),i=o*r,a=n.target,l=e.contains(a),u=!1,d=i>0,h=0,f=0;do{var m=J0(t,a),v=m[0],g=m[1],y=m[2],_=g-y-o*v;(v||_)&&Z0(t,a)&&(h+=_,f+=v),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!l&&a!==document.body||l&&(e.contains(a)||e===a));return(d&&(Math.abs(h)<1||!s)||!d&&(Math.abs(f)<1||!s))&&(u=!0),u},zo=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},cp=function(t){return[t.deltaX,t.deltaY]},up=function(t){return t&&"current"in t?t.current:t},v2=function(t,e){return t[0]===e[0]&&t[1]===e[1]},y2=function(t){return`
.block-interactivity-`.concat(t,` {pointer-events: none;}
.allow-interactivity-`).concat(t,` {pointer-events: all;}
`)},_2=0,Kn=[];function x2(t){var e=p.useRef([]),n=p.useRef([0,0]),r=p.useRef(),s=p.useState(_2++)[0],o=p.useState(Y0)[0],i=p.useRef(t);p.useEffect(function(){i.current=t},[t]),p.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(s));var g=BA([t.lockRef.current],(t.shards||[]).map(up),!0).filter(Boolean);return g.forEach(function(y){return y.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),g.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(s))})}}},[t.inert,t.lockRef.current,t.shards]);var a=p.useCallback(function(g,y){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!i.current.allowPinchZoom;var _=zo(g),x=n.current,w="deltaX"in g?g.deltaX:x[0]-_[0],E="deltaY"in g?g.deltaY:x[1]-_[1],b,T=g.target,k=Math.abs(w)>Math.abs(E)?"h":"v";if("touches"in g&&k==="h"&&T.type==="range")return!1;var P=lp(k,T);if(!P)return!0;if(P?b=k:(b=k==="v"?"h":"v",P=lp(k,T)),!P)return!1;if(!r.current&&"changedTouches"in g&&(w||E)&&(r.current=b),!b)return!0;var O=r.current||b;return g2(O,y,g,O==="h"?w:E,!0)},[]),l=p.useCallback(function(g){var y=g;if(!(!Kn.length||Kn[Kn.length-1]!==o)){var _="deltaY"in y?cp(y):zo(y),x=e.current.filter(function(b){return b.name===y.type&&(b.target===y.target||y.target===b.shadowParent)&&v2(b.delta,_)})[0];if(x&&x.should){y.cancelable&&y.preventDefault();return}if(!x){var w=(i.current.shards||[]).map(up).filter(Boolean).filter(function(b){return b.contains(y.target)}),E=w.length>0?a(y,w[0]):!i.current.noIsolation;E&&y.cancelable&&y.preventDefault()}}},[]),u=p.useCallback(function(g,y,_,x){var w={name:g,delta:y,target:_,should:x,shadowParent:b2(_)};e.current.push(w),setTimeout(function(){e.current=e.current.filter(function(E){return E!==w})},1)},[]),d=p.useCallback(function(g){n.current=zo(g),r.current=void 0},[]),h=p.useCallback(function(g){u(g.type,cp(g),g.target,a(g,t.lockRef.current))},[]),f=p.useCallback(function(g){u(g.type,zo(g),g.target,a(g,t.lockRef.current))},[]);p.useEffect(function(){return Kn.push(o),t.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:f}),document.addEventListener("wheel",l,Gn),document.addEventListener("touchmove",l,Gn),document.addEventListener("touchstart",d,Gn),function(){Kn=Kn.filter(function(g){return g!==o}),document.removeEventListener("wheel",l,Gn),document.removeEventListener("touchmove",l,Gn),document.removeEventListener("touchstart",d,Gn)}},[]);var m=t.removeScrollBar,v=t.inert;return p.createElement(p.Fragment,null,v?p.createElement(o,{styles:y2(s)}):null,m?p.createElement(c2,{gapMode:t.gapMode}):null)}function b2(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const w2=XA(q0,x2);var ju=p.forwardRef(function(t,e){return p.createElement(sa,kt({},t,{ref:e,sideCar:w2}))});ju.classNames=sa.classNames;var dc=["Enter"," "],E2=["ArrowDown","PageUp","Home"],Q0=["ArrowUp","PageDown","End"],S2=[...E2,...Q0],T2={ltr:[...dc,"ArrowRight"],rtl:[...dc,"ArrowLeft"]},k2={ltr:["ArrowLeft"],rtl:["ArrowRight"]},xo="Menu",[ro,P2,C2]=vc(xo),[Ln,ey]=br(xo,[C2,Hi,$0]),oa=Hi(),ty=$0(),[j2,Fn]=Ln(xo),[R2,bo]=Ln(xo),ny=t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:s,onOpenChange:o,modal:i=!0}=t,a=oa(e),[l,u]=p.useState(null),d=p.useRef(!1),h=Ve(o),f=D0(s);return p.useEffect(()=>{const m=()=>{d.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},v=()=>d.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),c.jsx(Cm,{...a,children:c.jsx(j2,{scope:e,open:n,onOpenChange:h,content:l,onContentChange:u,children:c.jsx(R2,{scope:e,onClose:p.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:d,dir:f,modal:i,children:r})})})};ny.displayName=xo;var A2="MenuAnchor",Ru=p.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,s=oa(n);return c.jsx(jm,{...s,...r,ref:e})});Ru.displayName=A2;var Au="MenuPortal",[I2,ry]=Ln(Au,{forceMount:void 0}),sy=t=>{const{__scopeMenu:e,forceMount:n,children:r,container:s}=t,o=Fn(Au,e);return c.jsx(I2,{scope:e,forceMount:n,children:c.jsx(pt,{present:n||o.open,children:c.jsx(lo,{asChild:!0,container:s,children:r})})})};sy.displayName=Au;var lt="MenuContent",[M2,Iu]=Ln(lt),oy=p.forwardRef((t,e)=>{const n=ry(lt,t.__scopeMenu),{forceMount:r=n.forceMount,...s}=t,o=Fn(lt,t.__scopeMenu),i=bo(lt,t.__scopeMenu);return c.jsx(ro.Provider,{scope:t.__scopeMenu,children:c.jsx(pt,{present:r||o.open,children:c.jsx(ro.Slot,{scope:t.__scopeMenu,children:i.modal?c.jsx(O2,{...s,ref:e}):c.jsx(D2,{...s,ref:e})})})})}),O2=p.forwardRef((t,e)=>{const n=Fn(lt,t.__scopeMenu),r=p.useRef(null),s=Pe(e,r);return p.useEffect(()=>{const o=r.current;if(o)return W0(o)},[]),c.jsx(Mu,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:W(t.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),D2=p.forwardRef((t,e)=>{const n=Fn(lt,t.__scopeMenu);return c.jsx(Mu,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Mu=p.forwardRef((t,e)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:h,onInteractOutside:f,onDismiss:m,disableOutsideScroll:v,...g}=t,y=Fn(lt,n),_=bo(lt,n),x=oa(n),w=ty(n),E=P2(n),[b,T]=p.useState(null),k=p.useRef(null),P=Pe(e,k,y.onContentChange),O=p.useRef(0),R=p.useRef(""),B=p.useRef(0),N=p.useRef(null),K=p.useRef("right"),M=p.useRef(0),q=v?ju:p.Fragment,z=v?{as:jn,allowPinchZoom:!0}:void 0,U=I=>{const ee=R.current+I,H=E().filter(me=>!me.disabled),Y=document.activeElement,Z=H.find(me=>me.ref.current===Y)?.textValue,oe=H.map(me=>me.textValue),Re=K2(oe,ee,Z),ne=H.find(me=>me.textValue===Re)?.ref.current;(function me(qe){R.current=qe,window.clearTimeout(O.current),qe!==""&&(O.current=window.setTimeout(()=>me(""),1e3))})(ee),ne&&setTimeout(()=>ne.focus())};p.useEffect(()=>()=>window.clearTimeout(O.current),[]),N0();const A=p.useCallback(I=>K.current===N.current?.side&&Y2(I,N.current?.area),[]);return c.jsx(M2,{scope:n,searchRef:R,onItemEnter:p.useCallback(I=>{A(I)&&I.preventDefault()},[A]),onItemLeave:p.useCallback(I=>{A(I)||(k.current?.focus(),T(null))},[A]),onTriggerLeave:p.useCallback(I=>{A(I)&&I.preventDefault()},[A]),pointerGraceTimerRef:B,onPointerGraceIntentChange:p.useCallback(I=>{N.current=I},[]),children:c.jsx(q,{...z,children:c.jsx(Cu,{asChild:!0,trapped:s,onMountAutoFocus:W(o,I=>{I.preventDefault(),k.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:c.jsx(ao,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:h,onInteractOutside:f,onDismiss:m,children:c.jsx(NA,{asChild:!0,...w,dir:_.dir,orientation:"vertical",loop:r,currentTabStopId:b,onCurrentTabStopIdChange:T,onEntryFocus:W(l,I=>{_.isUsingKeyboardRef.current||I.preventDefault()}),preventScrollOnEntryFocus:!0,children:c.jsx(Rm,{role:"menu","aria-orientation":"vertical","data-state":by(y.open),"data-radix-menu-content":"",dir:_.dir,...x,...g,ref:P,style:{outline:"none",...g.style},onKeyDown:W(g.onKeyDown,I=>{const H=I.target.closest("[data-radix-menu-content]")===I.currentTarget,Y=I.ctrlKey||I.altKey||I.metaKey,Z=I.key.length===1;H&&(I.key==="Tab"&&I.preventDefault(),!Y&&Z&&U(I.key));const oe=k.current;if(I.target!==oe||!S2.includes(I.key))return;I.preventDefault();const ne=E().filter(me=>!me.disabled).map(me=>me.ref.current);Q0.includes(I.key)&&ne.reverse(),W2(ne)}),onBlur:W(t.onBlur,I=>{I.currentTarget.contains(I.target)||(window.clearTimeout(O.current),R.current="")}),onPointerMove:W(t.onPointerMove,so(I=>{const ee=I.target,H=M.current!==I.clientX;if(I.currentTarget.contains(ee)&&H){const Y=I.clientX>M.current?"right":"left";K.current=Y,M.current=I.clientX}}))})})})})})})});oy.displayName=lt;var N2="MenuGroup",Ou=p.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return c.jsx(le.div,{role:"group",...r,ref:e})});Ou.displayName=N2;var L2="MenuLabel",iy=p.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return c.jsx(le.div,{...r,ref:e})});iy.displayName=L2;var Ii="MenuItem",dp="menu.itemSelect",ia=p.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:r,...s}=t,o=p.useRef(null),i=bo(Ii,t.__scopeMenu),a=Iu(Ii,t.__scopeMenu),l=Pe(e,o),u=p.useRef(!1),d=()=>{const h=o.current;if(!n&&h){const f=new CustomEvent(dp,{bubbles:!0,cancelable:!0});h.addEventListener(dp,m=>r?.(m),{once:!0}),yc(h,f),f.defaultPrevented?u.current=!1:i.onClose()}};return c.jsx(ay,{...s,ref:l,disabled:n,onClick:W(t.onClick,d),onPointerDown:h=>{t.onPointerDown?.(h),u.current=!0},onPointerUp:W(t.onPointerUp,h=>{u.current||h.currentTarget?.click()}),onKeyDown:W(t.onKeyDown,h=>{const f=a.searchRef.current!=="";n||f&&h.key===" "||dc.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})});ia.displayName=Ii;var ay=p.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...o}=t,i=Iu(Ii,n),a=ty(n),l=p.useRef(null),u=Pe(e,l),[d,h]=p.useState(!1),[f,m]=p.useState("");return p.useEffect(()=>{const v=l.current;v&&m((v.textContent??"").trim())},[o.children]),c.jsx(ro.ItemSlot,{scope:n,disabled:r,textValue:s??f,children:c.jsx(LA,{asChild:!0,...a,focusable:!r,children:c.jsx(le.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:u,onPointerMove:W(t.onPointerMove,so(v=>{r?i.onItemLeave(v):(i.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:W(t.onPointerLeave,so(v=>i.onItemLeave(v))),onFocus:W(t.onFocus,()=>h(!0)),onBlur:W(t.onBlur,()=>h(!1))})})})}),F2="MenuCheckboxItem",ly=p.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:r,...s}=t;return c.jsx(fy,{scope:t.__scopeMenu,checked:n,children:c.jsx(ia,{role:"menuitemcheckbox","aria-checked":Mi(n)?"mixed":n,...s,ref:e,"data-state":Nu(n),onSelect:W(s.onSelect,()=>r?.(Mi(n)?!0:!n),{checkForDefaultPrevented:!1})})})});ly.displayName=F2;var cy="MenuRadioGroup",[$2,V2]=Ln(cy,{value:void 0,onValueChange:()=>{}}),uy=p.forwardRef((t,e)=>{const{value:n,onValueChange:r,...s}=t,o=Ve(r);return c.jsx($2,{scope:t.__scopeMenu,value:n,onValueChange:o,children:c.jsx(Ou,{...s,ref:e})})});uy.displayName=cy;var dy="MenuRadioItem",hy=p.forwardRef((t,e)=>{const{value:n,...r}=t,s=V2(dy,t.__scopeMenu),o=n===s.value;return c.jsx(fy,{scope:t.__scopeMenu,checked:o,children:c.jsx(ia,{role:"menuitemradio","aria-checked":o,...r,ref:e,"data-state":Nu(o),onSelect:W(r.onSelect,()=>s.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});hy.displayName=dy;var Du="MenuItemIndicator",[fy,B2]=Ln(Du,{checked:!1}),py=p.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:r,...s}=t,o=B2(Du,n);return c.jsx(pt,{present:r||Mi(o.checked)||o.checked===!0,children:c.jsx(le.span,{...s,ref:e,"data-state":Nu(o.checked)})})});py.displayName=Du;var z2="MenuSeparator",my=p.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return c.jsx(le.div,{role:"separator","aria-orientation":"horizontal",...r,ref:e})});my.displayName=z2;var U2="MenuArrow",gy=p.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,s=oa(n);return c.jsx(Am,{...s,...r,ref:e})});gy.displayName=U2;var H2="MenuSub",[sD,vy]=Ln(H2),ks="MenuSubTrigger",yy=p.forwardRef((t,e)=>{const n=Fn(ks,t.__scopeMenu),r=bo(ks,t.__scopeMenu),s=vy(ks,t.__scopeMenu),o=Iu(ks,t.__scopeMenu),i=p.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=o,u={__scopeMenu:t.__scopeMenu},d=p.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return p.useEffect(()=>d,[d]),p.useEffect(()=>{const h=a.current;return()=>{window.clearTimeout(h),l(null)}},[a,l]),c.jsx(Ru,{asChild:!0,...u,children:c.jsx(ay,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":by(n.open),...t,ref:Ni(e,s.onTriggerChange),onClick:h=>{t.onClick?.(h),!(t.disabled||h.defaultPrevented)&&(h.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:W(t.onPointerMove,so(h=>{o.onItemEnter(h),!h.defaultPrevented&&!t.disabled&&!n.open&&!i.current&&(o.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:W(t.onPointerLeave,so(h=>{d();const f=n.content?.getBoundingClientRect();if(f){const m=n.content?.dataset.side,v=m==="right",g=v?-5:5,y=f[v?"left":"right"],_=f[v?"right":"left"];o.onPointerGraceIntentChange({area:[{x:h.clientX+g,y:h.clientY},{x:y,y:f.top},{x:_,y:f.top},{x:_,y:f.bottom},{x:y,y:f.bottom}],side:m}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(h),h.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:W(t.onKeyDown,h=>{const f=o.searchRef.current!=="";t.disabled||f&&h.key===" "||T2[r.dir].includes(h.key)&&(n.onOpenChange(!0),n.content?.focus(),h.preventDefault())})})})});yy.displayName=ks;var _y="MenuSubContent",xy=p.forwardRef((t,e)=>{const n=ry(lt,t.__scopeMenu),{forceMount:r=n.forceMount,...s}=t,o=Fn(lt,t.__scopeMenu),i=bo(lt,t.__scopeMenu),a=vy(_y,t.__scopeMenu),l=p.useRef(null),u=Pe(e,l);return c.jsx(ro.Provider,{scope:t.__scopeMenu,children:c.jsx(pt,{present:r||o.open,children:c.jsx(ro.Slot,{scope:t.__scopeMenu,children:c.jsx(Mu,{id:a.contentId,"aria-labelledby":a.triggerId,...s,ref:u,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{i.isUsingKeyboardRef.current&&l.current?.focus(),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:W(t.onFocusOutside,d=>{d.target!==a.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:W(t.onEscapeKeyDown,d=>{i.onClose(),d.preventDefault()}),onKeyDown:W(t.onKeyDown,d=>{const h=d.currentTarget.contains(d.target),f=k2[i.dir].includes(d.key);h&&f&&(o.onOpenChange(!1),a.trigger?.focus(),d.preventDefault())})})})})})});xy.displayName=_y;function by(t){return t?"open":"closed"}function Mi(t){return t==="indeterminate"}function Nu(t){return Mi(t)?"indeterminate":t?"checked":"unchecked"}function W2(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function G2(t,e){return t.map((n,r)=>t[(e+r)%t.length])}function K2(t,e,n){const s=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,o=n?t.indexOf(n):-1;let i=G2(t,Math.max(o,0));s.length===1&&(i=i.filter(u=>u!==n));const l=i.find(u=>u.toLowerCase().startsWith(s.toLowerCase()));return l!==n?l:void 0}function q2(t,e){const{x:n,y:r}=t;let s=!1;for(let o=0,i=e.length-1;o<e.length;i=o++){const a=e[o].x,l=e[o].y,u=e[i].x,d=e[i].y;l>r!=d>r&&n<(u-a)*(r-l)/(d-l)+a&&(s=!s)}return s}function Y2(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return q2(n,e)}function so(t){return e=>e.pointerType==="mouse"?t(e):void 0}var X2=ny,Z2=Ru,J2=sy,Q2=oy,eI=Ou,tI=iy,nI=ia,rI=ly,sI=uy,oI=hy,iI=py,aI=my,lI=gy,cI=yy,uI=xy,Lu="DropdownMenu",[dI,oD]=br(Lu,[ey]),He=ey(),[hI,wy]=dI(Lu),Ey=t=>{const{__scopeDropdownMenu:e,children:n,dir:r,open:s,defaultOpen:o,onOpenChange:i,modal:a=!0}=t,l=He(e),u=p.useRef(null),[d=!1,h]=co({prop:s,defaultProp:o,onChange:i});return c.jsx(hI,{scope:e,triggerId:Pn(),triggerRef:u,contentId:Pn(),open:d,onOpenChange:h,onOpenToggle:p.useCallback(()=>h(f=>!f),[h]),modal:a,children:c.jsx(X2,{...l,open:d,onOpenChange:h,dir:r,modal:a,children:n})})};Ey.displayName=Lu;var Sy="DropdownMenuTrigger",Ty=p.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...s}=t,o=wy(Sy,n),i=He(n);return c.jsx(Z2,{asChild:!0,...i,children:c.jsx(le.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...s,ref:Ni(e,o.triggerRef),onPointerDown:W(t.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(o.onOpenToggle(),o.open||a.preventDefault())}),onKeyDown:W(t.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&o.onOpenToggle(),a.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});Ty.displayName=Sy;var fI="DropdownMenuPortal",ky=t=>{const{__scopeDropdownMenu:e,...n}=t,r=He(e);return c.jsx(J2,{...r,...n})};ky.displayName=fI;var Py="DropdownMenuContent",Cy=p.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=wy(Py,n),o=He(n),i=p.useRef(!1);return c.jsx(Q2,{id:s.contentId,"aria-labelledby":s.triggerId,...o,...r,ref:e,onCloseAutoFocus:W(t.onCloseAutoFocus,a=>{i.current||s.triggerRef.current?.focus(),i.current=!1,a.preventDefault()}),onInteractOutside:W(t.onInteractOutside,a=>{const l=a.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,d=l.button===2||u;(!s.modal||d)&&(i.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Cy.displayName=Py;var pI="DropdownMenuGroup",mI=p.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=He(n);return c.jsx(eI,{...s,...r,ref:e})});mI.displayName=pI;var gI="DropdownMenuLabel",jy=p.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=He(n);return c.jsx(tI,{...s,...r,ref:e})});jy.displayName=gI;var vI="DropdownMenuItem",Ry=p.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=He(n);return c.jsx(nI,{...s,...r,ref:e})});Ry.displayName=vI;var yI="DropdownMenuCheckboxItem",Ay=p.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=He(n);return c.jsx(rI,{...s,...r,ref:e})});Ay.displayName=yI;var _I="DropdownMenuRadioGroup",xI=p.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=He(n);return c.jsx(sI,{...s,...r,ref:e})});xI.displayName=_I;var bI="DropdownMenuRadioItem",Iy=p.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=He(n);return c.jsx(oI,{...s,...r,ref:e})});Iy.displayName=bI;var wI="DropdownMenuItemIndicator",My=p.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=He(n);return c.jsx(iI,{...s,...r,ref:e})});My.displayName=wI;var EI="DropdownMenuSeparator",Oy=p.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=He(n);return c.jsx(aI,{...s,...r,ref:e})});Oy.displayName=EI;var SI="DropdownMenuArrow",TI=p.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=He(n);return c.jsx(lI,{...s,...r,ref:e})});TI.displayName=SI;var kI="DropdownMenuSubTrigger",Dy=p.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=He(n);return c.jsx(cI,{...s,...r,ref:e})});Dy.displayName=kI;var PI="DropdownMenuSubContent",Ny=p.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=He(n);return c.jsx(uI,{...s,...r,ref:e,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Ny.displayName=PI;var CI=Ey,jI=Ty,RI=ky,Ly=Cy,Fy=jy,$y=Ry,Vy=Ay,By=Iy,zy=My,Uy=Oy,Hy=Dy,Wy=Ny;const Gy=CI,Ky=jI,AI=p.forwardRef(({className:t,inset:e,children:n,...r},s)=>c.jsxs(Hy,{ref:s,className:_e("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",e&&"pl-8",t),...r,children:[n,c.jsx(Qx,{className:"ml-auto h-4 w-4"})]}));AI.displayName=Hy.displayName;const II=p.forwardRef(({className:t,...e},n)=>c.jsx(Wy,{ref:n,className:_e("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...e}));II.displayName=Wy.displayName;const Fu=p.forwardRef(({className:t,sideOffset:e=4,...n},r)=>c.jsx(RI,{children:c.jsx(Ly,{ref:r,sideOffset:e,className:_e("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...n})}));Fu.displayName=Ly.displayName;const ln=p.forwardRef(({className:t,inset:e,...n},r)=>c.jsx($y,{ref:r,className:_e("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e&&"pl-8",t),...n}));ln.displayName=$y.displayName;const MI=p.forwardRef(({className:t,children:e,checked:n,...r},s)=>c.jsxs(Vy,{ref:s,className:_e("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),checked:n,...r,children:[c.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:c.jsx(zy,{children:c.jsx(Zx,{className:"h-4 w-4"})})}),e]}));MI.displayName=Vy.displayName;const OI=p.forwardRef(({className:t,children:e,...n},r)=>c.jsxs(By,{ref:r,className:_e("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[c.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:c.jsx(zy,{children:c.jsx(tb,{className:"h-2 w-2 fill-current"})})}),e]}));OI.displayName=By.displayName;const DI=p.forwardRef(({className:t,inset:e,...n},r)=>c.jsx(Fy,{ref:r,className:_e("px-2 py-1.5 text-sm font-semibold",e&&"pl-8",t),...n}));DI.displayName=Fy.displayName;const Ps=p.forwardRef(({className:t,...e},n)=>c.jsx(Uy,{ref:n,className:_e("-mx-1 my-1 h-px bg-muted",t),...e}));Ps.displayName=Uy.displayName;var $u="Dialog",[qy,iD]=br($u),[NI,gt]=qy($u),Yy=t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:s,onOpenChange:o,modal:i=!0}=t,a=p.useRef(null),l=p.useRef(null),[u=!1,d]=co({prop:r,defaultProp:s,onChange:o});return c.jsx(NI,{scope:e,triggerRef:a,contentRef:l,contentId:Pn(),titleId:Pn(),descriptionId:Pn(),open:u,onOpenChange:d,onOpenToggle:p.useCallback(()=>d(h=>!h),[d]),modal:i,children:n})};Yy.displayName=$u;var Xy="DialogTrigger",Zy=p.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=gt(Xy,n),o=Pe(e,s.triggerRef);return c.jsx(le.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":zu(s.open),...r,ref:o,onClick:W(t.onClick,s.onOpenToggle)})});Zy.displayName=Xy;var Vu="DialogPortal",[LI,Jy]=qy(Vu,{forceMount:void 0}),Qy=t=>{const{__scopeDialog:e,forceMount:n,children:r,container:s}=t,o=gt(Vu,e);return c.jsx(LI,{scope:e,forceMount:n,children:p.Children.map(r,i=>c.jsx(pt,{present:n||o.open,children:c.jsx(lo,{asChild:!0,container:s,children:i})}))})};Qy.displayName=Vu;var Oi="DialogOverlay",e_=p.forwardRef((t,e)=>{const n=Jy(Oi,t.__scopeDialog),{forceMount:r=n.forceMount,...s}=t,o=gt(Oi,t.__scopeDialog);return o.modal?c.jsx(pt,{present:r||o.open,children:c.jsx(FI,{...s,ref:e})}):null});e_.displayName=Oi;var FI=p.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=gt(Oi,n);return c.jsx(ju,{as:jn,allowPinchZoom:!0,shards:[s.contentRef],children:c.jsx(le.div,{"data-state":zu(s.open),...r,ref:e,style:{pointerEvents:"auto",...r.style}})})}),Mn="DialogContent",t_=p.forwardRef((t,e)=>{const n=Jy(Mn,t.__scopeDialog),{forceMount:r=n.forceMount,...s}=t,o=gt(Mn,t.__scopeDialog);return c.jsx(pt,{present:r||o.open,children:o.modal?c.jsx($I,{...s,ref:e}):c.jsx(VI,{...s,ref:e})})});t_.displayName=Mn;var $I=p.forwardRef((t,e)=>{const n=gt(Mn,t.__scopeDialog),r=p.useRef(null),s=Pe(e,n.contentRef,r);return p.useEffect(()=>{const o=r.current;if(o)return W0(o)},[]),c.jsx(n_,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:W(t.onCloseAutoFocus,o=>{o.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:W(t.onPointerDownOutside,o=>{const i=o.detail.originalEvent,a=i.button===0&&i.ctrlKey===!0;(i.button===2||a)&&o.preventDefault()}),onFocusOutside:W(t.onFocusOutside,o=>o.preventDefault())})}),VI=p.forwardRef((t,e)=>{const n=gt(Mn,t.__scopeDialog),r=p.useRef(!1),s=p.useRef(!1);return c.jsx(n_,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{t.onCloseAutoFocus?.(o),o.defaultPrevented||(r.current||n.triggerRef.current?.focus(),o.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:o=>{t.onInteractOutside?.(o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const i=o.target;n.triggerRef.current?.contains(i)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),n_=p.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:o,...i}=t,a=gt(Mn,n),l=p.useRef(null),u=Pe(e,l);return N0(),c.jsxs(c.Fragment,{children:[c.jsx(Cu,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:o,children:c.jsx(ao,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":zu(a.open),...i,ref:u,onDismiss:()=>a.onOpenChange(!1)})}),c.jsxs(c.Fragment,{children:[c.jsx(BI,{titleId:a.titleId}),c.jsx(UI,{contentRef:l,descriptionId:a.descriptionId})]})]})}),Bu="DialogTitle",r_=p.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=gt(Bu,n);return c.jsx(le.h2,{id:s.titleId,...r,ref:e})});r_.displayName=Bu;var s_="DialogDescription",o_=p.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=gt(s_,n);return c.jsx(le.p,{id:s.descriptionId,...r,ref:e})});o_.displayName=s_;var i_="DialogClose",a_=p.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=gt(i_,n);return c.jsx(le.button,{type:"button",...r,ref:e,onClick:W(t.onClick,()=>s.onOpenChange(!1))})});a_.displayName=i_;function zu(t){return t?"open":"closed"}var l_="DialogTitleWarning",[aD,c_]=rx(l_,{contentName:Mn,titleName:Bu,docsSlug:"dialog"}),BI=({titleId:t})=>{const e=c_(l_),n=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users.
If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component.
For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return p.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},zI="DialogDescriptionWarning",UI=({contentRef:t,descriptionId:e})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${c_(zI).contentName}}.`;return p.useEffect(()=>{const s=t.current?.getAttribute("aria-describedby");e&&s&&(document.getElementById(e)||console.warn(r))},[r,t,e]),null},HI=Yy,WI=Zy,GI=Qy,u_=e_,d_=t_,h_=r_,f_=o_,KI=a_;const qI=HI,YI=WI,XI=GI,p_=p.forwardRef(({className:t,...e},n)=>c.jsx(u_,{className:_e("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e,ref:n}));p_.displayName=u_.displayName;const ZI=Vi("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),m_=p.forwardRef(({side:t="right",className:e,children:n,...r},s)=>c.jsxs(XI,{children:[c.jsx(p_,{}),c.jsxs(d_,{ref:s,className:_e(ZI({side:t}),e),...r,children:[n,c.jsxs(KI,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[c.jsx(Qp,{className:"h-4 w-4"}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));m_.displayName=d_.displayName;const JI=p.forwardRef(({className:t,...e},n)=>c.jsx(h_,{ref:n,className:_e("text-lg font-semibold text-foreground",t),...e}));JI.displayName=h_.displayName;const QI=p.forwardRef(({className:t,...e},n)=>c.jsx(f_,{ref:n,className:_e("text-sm text-muted-foreground",t),...e}));QI.displayName=f_.displayName;var Uu="Avatar",[eM,lD]=br(Uu),[tM,g_]=eM(Uu),v_=p.forwardRef((t,e)=>{const{__scopeAvatar:n,...r}=t,[s,o]=p.useState("idle");return c.jsx(tM,{scope:n,imageLoadingStatus:s,onImageLoadingStatusChange:o,children:c.jsx(le.span,{...r,ref:e})})});v_.displayName=Uu;var y_="AvatarImage",__=p.forwardRef((t,e)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:s=()=>{},...o}=t,i=g_(y_,n),a=nM(r,o.referrerPolicy),l=Ve(u=>{s(u),i.onImageLoadingStatusChange(u)});return Dt(()=>{a!=="idle"&&l(a)},[a,l]),a==="loaded"?c.jsx(le.img,{...o,ref:e,src:r}):null});__.displayName=y_;var x_="AvatarFallback",b_=p.forwardRef((t,e)=>{const{__scopeAvatar:n,delayMs:r,...s}=t,o=g_(x_,n),[i,a]=p.useState(r===void 0);return p.useEffect(()=>{if(r!==void 0){const l=window.setTimeout(()=>a(!0),r);return()=>window.clearTimeout(l)}},[r]),i&&o.imageLoadingStatus!=="loaded"?c.jsx(le.span,{...s,ref:e}):null});b_.displayName=x_;function nM(t,e){const[n,r]=p.useState("idle");return Dt(()=>{if(!t){r("error");return}let s=!0;const o=new window.Image,i=a=>()=>{s&&r(a)};return r("loading"),o.onload=i("loaded"),o.onerror=i("error"),o.src=t,e&&(o.referrerPolicy=e),()=>{s=!1}},[t,e]),n}var w_=v_,E_=__,S_=b_;const hc=p.forwardRef(({className:t,...e},n)=>c.jsx(w_,{ref:n,className:_e("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",t),...e}));hc.displayName=w_.displayName;const fc=p.forwardRef(({className:t,...e},n)=>c.jsx(E_,{ref:n,className:_e("aspect-square h-full w-full",t),...e}));fc.displayName=E_.displayName;const pc=p.forwardRef(({className:t,...e},n)=>c.jsx(S_,{ref:n,className:_e("flex h-full w-full items-center justify-center rounded-full bg-nature-red text-white hover:bg-nature-yellow transition-colors",t),...e}));pc.displayName=S_.displayName;const hp=Vi("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground",success:"border-transparent bg-green-500 text-white hover:bg-green-600",warning:"border-transparent bg-yellow-500 text-white hover:bg-yellow-600",info:"border-transparent bg-blue-500 text-white hover:bg-blue-600",gold:"border-transparent bg-yellow-400 text-yellow-900 hover:bg-yellow-500",silver:"border-transparent bg-gray-400 text-gray-50 hover:bg-gray-500",bronze:"border-transparent bg-amber-700 text-white hover:bg-amber-800",purple:"border-transparent bg-sparkle-purple text-white hover:opacity-90",gradient:"border-transparent bg-gradient-to-r from-pink-500 via-purple-500 to-indigo-500 text-white",mint:"border-transparent bg-green-100 text-green-800 hover:bg-green-200",peach:"border-transparent bg-orange-100 text-orange-800 hover:bg-orange-200",sky:"border-transparent bg-blue-100 text-blue-800 hover:bg-blue-200",lavender:"border-transparent bg-purple-100 text-purple-800 hover:bg-purple-200"}},defaultVariants:{variant:"default"}});function rM({className:t,variant:e,animated:n=!1,...r}){if(n){const s={className:_e(hp({variant:e}),t),initial:{scale:.8,opacity:0},animate:{scale:1,opacity:1},transition:{type:"spring",stiffness:400,damping:10},whileHover:{scale:1.1}};return c.jsx(fe.div,{...s,children:r.children})}return c.jsx("div",{className:_e(hp({variant:e}),t),...r})}const rt=({Icon:t,className:e="",size:n=24,hoverEffect:r="bounce"})=>{const s=()=>{switch(r){case"bounce":return{scale:[1,1.2,1],y:[0,-4,0],transition:{duration:.3}};case"rotate":return{rotate:[0,15,-15,0],transition:{duration:.4}};case"scale":return{scale:1.15,transition:{duration:.2}};case"wiggle":return{rotate:[0,-3,3,-3,3,0],scale:1.5,transition:{duration:.5}};default:return{}}},o=()=>({scale:1.2,rotate:[0,-2,2,0],transition:{duration:.15}});return c.jsx(fe.div,{className:`inline-block touch-manipulation ${e}`,whileHover:s(),whileTap:o(),style:{WebkitTapHighlightColor:"transparent",touchAction:"manipulation"},children:c.jsx(t,{size:n})})},fp=({countryCode:t,size:e=20,className:n=""})=>c.jsx("img",{src:`https://flagcdn.com/w40/${t.toLowerCase()}.png`,alt:`${t} flag`,className:`rounded-full object-cover ${n}`,style:{width:e,height:e},loading:"lazy"}),pp={en:"gb",zh:"cn",bn:"in",es:"es",ja:"jp"},cD={"zh-Hans":"cn",ja:"jp",ko:"kr",hi:"in",bn:"in",es:"es",pt:"br",th:"th",vi:"vn",fil:"ph",ms:"my",lo:"la",id:"id",km:"kh",my:"mm"},sM=()=>{const{currentLanguage:t,changeLanguage:e}=Dn(),n=[{code:"en",name:"English"},{code:"zh",name:"中文"},{code:"bn",name:"বাংলা"},{code:"es",name:"Español"},{code:"ja",name:"日本語"}],r=n.find(s=>s.code===t)?.name||"English";return c.jsxs(Gy,{children:[c.jsx(Ky,{asChild:!0,children:c.jsxs(un,{variant:"ghost",size:"sm",className:"gap-2",children:[c.jsx(fp,{countryCode:pp[t]||"gb",size:20}),c.jsx("span",{className:"hidden sm:inline",children:r})]})}),c.jsx(Fu,{align:"end",className:"bg-white",children:n.map(s=>c.jsxs(ln,{onClick:()=>e(s.code),className:`flex items-center gap-2 ${t===s.code?"bg-gray-100":""}`,children:[c.jsx(fp,{countryCode:pp[s.code]||"gb",size:16}),s.name]},s.code))})]})},mp="https://cdn.storysparkle.org/logo_assets/favicon.webp",oM=()=>{const[t,e]=p.useState(!1),[n,r]=p.useState(!1),s=io(),o=gc(),{user:i,signOut:a}=Wc(),{userType:l,subscription:u,avatarUrl:d,displayName:h,refreshSubscriptionStatus:f}=pA(),m=p.useRef(null),[v,g]=p.useState(!1),y=async R=>{const B=R.target.files?.[0];if(!(!B||!i)){if(B.size>5*1024*1024){Pt.error("Image must be under 5MB");return}g(!0),Pt.loading("Uploading photo...",{id:"avatar-upload"});try{const N=B.name.split(".").pop()||"jpg",K=`${i.id}/avatar.${N}`,{error:M}=await ce.storage.from("avatars").upload(K,B,{upsert:!0});if(M)throw M;const{data:{publicUrl:q}}=ce.storage.from("avatars").getPublicUrl(K),z=`${q}?t=${Date.now()}`,{error:U}=await ce.from("profiles").update({avatar_url:z}).eq("id",i.id);if(U)throw U;Pt.success("Profile photo updated!",{id:"avatar-upload"}),f()}catch(N){console.error("Avatar upload error:",N),Pt.error("Failed to upload photo",{id:"avatar-upload"})}finally{g(!1),m.current&&(m.current.value="")}}},{t:_}=Ue("navbar"),{getLocalizedPath:x}=Dn(),w=R=>s.pathname===R;let E=[{name:_("home"),path:"/",icon:ab},{name:_("stories"),path:"/stories",icon:hb},{name:_("improveReading"),path:"/improve-reading",icon:Gx},{name:_("themes"),path:"/themes",icon:Tb},{name:_("blog"),path:"/blog",icon:pb},{name:_("about"),path:"/about",icon:cb},{name:_("contact"),path:"/contact",icon:bb},{name:_("premiumPlans"),path:"/subscription",icon:Ir}];E.splice(2,0,{name:_("storyMaker"),path:"/story-maker",icon:Ib}),E.splice(3,0,{name:_("textChecker"),path:"/text-checker",icon:sb});const b=[{name:_("readingCart"),path:"/reading-cart",icon:Jp},{name:_("vocabulary"),path:"/vocabulary",icon:Eb},{name:_("progress"),path:"/progress",icon:Pb}],T=()=>e(!1),k=async()=>{if(!n){r(!0);try{await a(),o("/")}finally{r(!1)}}},P=(R,B)=>R?R.charAt(0).toUpperCase():B?B.charAt(0).toUpperCase():"U",O=l==="paid"||l==="admin"||u?.status==="active"&&!u?.isExpired;return c.jsxs("header",{className:"sticky top-0 z-50 w-full border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:[c.jsxs("div",{className:"container flex h-14 items-center",children:[c.jsxs(se,{to:x("/"),className:"flex items-center gap-2 mr-6",children:[c.jsx("img",{src:mp,alt:"StorySparkle Logo",width:24,height:24,fetchPriority:"high",decoding:"async",className:"h-6 w-6"}),c.jsxs("span",{className:"font-bold text-lg hidden sm:inline-block",children:[c.jsx("span",{className:"text-nature-red",children:"Story"}),c.jsx("span",{className:"text-nature-coral",children:"Sparkle"})]})]}),c.jsxs("nav",{className:"hidden md:flex ipad-portrait:!hidden items-center space-x-4 lg:space-x-6 mx-6",children:[E.map(R=>c.jsx(se,{to:x(R.path),className:`text-sm font-medium transition-colors hover:text-foreground/80 flex items-center justify-center p-2 ${w(R.path)?"text-nature-coral":"text-foreground/60"}`,title:R.name,children:w(R.path)?c.jsx(fe.div,{animate:{y:[0,-3,0]},transition:{duration:2,repeat:1/0,ease:"easeInOut"},children:c.jsx(rt,{Icon:R.icon,size:20,hoverEffect:"wiggle",className:"cursor-pointer text-nature-coral"})}):c.jsx(rt,{Icon:R.icon,size:20,hoverEffect:"wiggle",className:"cursor-pointer"})},R.path)),i&&c.jsx(c.Fragment,{children:b.map(R=>c.jsx(se,{to:x(R.path),className:`text-sm font-medium transition-colors hover:text-foreground/80 flex items-center justify-center p-2 ${w(R.path)?"text-nature-coral":"text-foreground/60"}`,title:R.name,children:w(R.path)?c.jsx(fe.div,{animate:{y:[0,-3,0]},transition:{duration:2,repeat:1/0,ease:"easeInOut"},children:c.jsx(rt,{Icon:R.icon,size:20,hoverEffect:"wiggle",className:"cursor-pointer text-nature-coral"})}):c.jsx(rt,{Icon:R.icon,size:20,hoverEffect:"wiggle",className:"cursor-pointer"})},R.path))})]}),c.jsxs("div",{className:"flex items-center ml-auto gap-2",children:[c.jsx(sM,{}),i?c.jsxs(Gy,{children:[c.jsx(Ky,{asChild:!0,children:c.jsxs(un,{variant:"ghost",className:"relative h-8 w-8 rounded-full",children:[c.jsxs(hc,{className:"h-8 w-8",children:[c.jsx(fc,{src:d||"",alt:i.email||"User"}),c.jsx(pc,{children:P(h,i.email)})]}),O&&c.jsx("span",{className:"absolute -top-1 -right-1",children:c.jsx(rM,{className:"h-4 w-4 p-0 flex items-center justify-center bg-amber-500 rounded-full",children:c.jsx(Ir,{className:"h-3 w-3 text-black"})})})]})}),c.jsxs(Fu,{align:"end",className:"bg-background border border-border shadow-lg",children:[c.jsx("div",{className:"flex items-center justify-start gap-2 p-2",children:c.jsxs("div",{className:"flex flex-col space-y-1 leading-none",children:[h&&c.jsx("p",{className:"text-sm font-medium leading-none",children:h}),O&&c.jsxs("p",{className:"font-medium text-sm flex items-center gap-1",children:[c.jsx(Ir,{className:"h-3 w-3 text-amber-500"}),"Premium"]}),c.jsx("p",{className:"text-xs text-muted-foreground",children:i.email})]})}),c.jsx(Ps,{}),l==="admin"&&c.jsx(ln,{asChild:!0,children:c.jsx(se,{to:"/admin",children:"Admin Dashboard"})}),l==="admin"&&c.jsx(Ps,{}),b.map(R=>c.jsx(ln,{asChild:!0,children:c.jsxs(se,{to:R.path,className:"flex items-center gap-2",children:[R.icon&&c.jsx(R.icon,{className:"h-4 w-4"}),R.name]})},R.path)),c.jsx(Ps,{}),c.jsxs(ln,{onSelect:()=>m.current?.click(),disabled:v,className:"flex items-center gap-2 cursor-pointer",children:[c.jsx(od,{className:"h-4 w-4"}),_(v?"uploading":"updatePhoto")]}),c.jsx(ln,{asChild:!0,children:c.jsxs(se,{to:x("/subscription"),className:"flex items-center gap-2",children:[c.jsx(Ir,{className:"h-4 w-4"}),_(O?"manageSubscription":"upgradeToPremium")]})}),c.jsx(ln,{asChild:!0,children:c.jsxs(se,{to:x("/reset-password"),className:"flex items-center gap-2",children:[c.jsx(id,{className:"h-4 w-4"}),_("resetPassword","Reset Password")]})}),c.jsx(Ps,{}),c.jsxs(ln,{className:"cursor-pointer",disabled:n,onSelect:R=>{R.preventDefault(),k()},children:[c.jsx(cd,{className:"mr-2 h-4 w-4"}),c.jsx("span",{children:n?"Signing out...":_("logOut")})]})]})]}):c.jsx(se,{to:x("/login"),children:c.jsxs(un,{variant:"default",size:"sm",className:"gap-1",children:[c.jsx(rt,{Icon:ld,size:16,hoverEffect:"scale",className:"cursor-pointer mr-1"}),_("signIn")]})}),c.jsxs(qI,{open:t,onOpenChange:e,children:[c.jsx(YI,{asChild:!0,children:c.jsxs(un,{variant:"outline",size:"icon",className:"md:hidden ipad-portrait:!inline-flex",children:[c.jsx(rt,{Icon:_b,size:20,hoverEffect:"wiggle",className:"cursor-pointer"}),c.jsx("span",{className:"sr-only",children:"Toggle menu"})]})}),c.jsxs(m_,{side:"right",className:"bg-white",children:[c.jsxs(se,{to:x("/"),className:"flex items-center gap-2 mb-8",onClick:T,children:[c.jsx("img",{src:mp,alt:"StorySparkle Logo",width:24,height:24,decoding:"async",className:"h-6 w-6"}),c.jsxs("span",{className:"font-bold text-lg",children:[c.jsx("span",{className:"text-nature-red",children:"Story"}),c.jsx("span",{className:"text-nature-coral",children:"Sparkle"})]})]}),c.jsxs("nav",{className:"flex flex-col gap-4",children:[E.map(R=>c.jsxs(se,{to:x(R.path),className:`hover:text-foreground flex items-center gap-2 ${w(R.path)?"text-nature-coral font-medium":"text-foreground/60"}`,onClick:T,children:[c.jsx(rt,{Icon:R.icon,size:16,hoverEffect:"wiggle",className:`cursor-pointer touch-manipulation ${w(R.path)?"text-nature-coral":""}`}),R.name,w(R.path)&&c.jsx(fe.div,{className:"ml-auto w-2 h-2 bg-nature-coral rounded-full",animate:{scale:[1,1.2,1]},transition:{duration:1,repeat:1/0}})]},R.path)),c.jsx("div",{className:"border-t my-2 pt-2"}),i?c.jsxs(c.Fragment,{children:[b.map(R=>c.jsxs(se,{to:x(R.path),className:`hover:text-foreground flex items-center gap-2 ${w(R.path)?"text-nature-coral font-medium":"text-foreground/60"}`,onClick:T,children:[c.jsx(rt,{Icon:R.icon,size:16,hoverEffect:"wiggle",className:`cursor-pointer touch-manipulation ${w(R.path)?"text-nature-coral":""}`}),R.name,w(R.path)&&c.jsx(fe.div,{className:"ml-auto w-2 h-2 bg-nature-coral rounded-full",animate:{scale:[1,1.2,1]},transition:{duration:1,repeat:1/0}})]},R.path)),c.jsx("div",{className:"border-t my-2 pt-2"}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs(hc,{className:"h-8 w-8",children:[c.jsx(fc,{src:d||"",alt:i.email||"User"}),c.jsx(pc,{children:P(h,i.email)})]}),c.jsxs("div",{className:"flex flex-col",children:[h&&c.jsx("span",{className:"text-sm font-medium",children:h}),c.jsx("span",{className:"text-xs text-muted-foreground",children:i.email})]})]}),l==="admin"&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"border-t my-2 pt-2"}),c.jsxs(se,{to:"/admin",className:"hover:text-foreground flex items-center gap-2 text-foreground/60",onClick:T,children:[c.jsx(rt,{Icon:qx,size:16,hoverEffect:"wiggle",className:"cursor-pointer touch-manipulation"}),_("adminDashboard")]})]}),c.jsx("div",{className:"border-t my-2 pt-2"}),c.jsxs("button",{onClick:()=>m.current?.click(),disabled:v,className:"hover:text-foreground flex items-center gap-2 text-foreground/60 text-left",children:[c.jsx(od,{className:"h-4 w-4"}),_(v?"uploading":"updatePhoto")]}),c.jsxs(se,{to:x("/subscription"),className:"hover:text-foreground flex items-center gap-2 text-foreground/60",onClick:T,children:[c.jsx(Ir,{className:"h-4 w-4"}),_(O?"manageSubscription":"upgradeToPremium")]}),c.jsxs(se,{to:x("/reset-password"),className:"hover:text-foreground flex items-center gap-2 text-foreground/60",onClick:T,children:[c.jsx(id,{className:"h-4 w-4"}),_("resetPassword","Reset Password")]}),c.jsx("div",{className:"border-t my-2 pt-2"}),c.jsxs(un,{variant:"outline",disabled:n,onClick:async()=>{await k(),T()},children:[c.jsx(rt,{Icon:cd,size:16,hoverEffect:"scale",className:"cursor-pointer mr-2 touch-manipulation"}),n?"Signing out...":_("logOut")]})]}):c.jsxs(c.Fragment,{children:[c.jsxs(se,{to:x("/login"),className:"flex items-center gap-2",onClick:T,children:[c.jsx(rt,{Icon:ld,size:16,hoverEffect:"scale",className:"cursor-pointer touch-manipulation"}),_("signIn")]}),c.jsxs(se,{to:x("/signup"),className:"flex items-center gap-2",onClick:T,children:[c.jsx(rt,{Icon:Rb,size:16,hoverEffect:"wiggle",className:"cursor-pointer touch-manipulation"}),_("createAccount")]})]})]})]})]})]})]}),i&&c.jsx("input",{type:"file",ref:m,className:"hidden",accept:"image/*",onChange:y})]})},iM="https://cdn.storysparkle.org/logo_assets/favicon.webp",aM=()=>{const{t,i18n:e}=Ue("footer"),{getLocalizedPath:n}=Dn(),r=new Date().getFullYear();return c.jsxs("footer",{className:"text-background py-12 px-4 md:px-8 bg-nature-green/80",children:[c.jsxs("div",{className:"max-w-7xl mx-auto grid grid-cols-1 lg:grid-cols-4 gap-8",children:[c.jsxs("div",{className:"flex flex-col gap-4",children:[c.jsxs(se,{to:n("/"),className:"flex items-center gap-2",children:[c.jsx("img",{src:iM,alt:"StorySparkle Logo",width:32,height:32,loading:"lazy",decoding:"async",className:"h-8 w-8"}),c.jsxs("span",{className:"font-bold text-xl",children:[c.jsx("span",{className:"text-nature-red",children:t("companyTitleStart")}),c.jsx("span",{className:"text-nature-coral",children:t("companyTitleEnd")})]})]}),c.jsx("p",{className:"text-white text-sm max-w-xs text-left",children:t("companyDescription")})]}),c.jsxs("div",{className:"text-left ",children:[c.jsx("h3",{className:"font-medium text-lg mb-4 text-white",children:t("quickLinks")}),c.jsxs("ul",{className:"space-y-2",children:[c.jsx("li",{children:c.jsx(se,{to:n("/"),className:"text-white hover:text-nature-red text-sm transition-colors",children:t("home")})}),c.jsx("li",{children:c.jsx(se,{to:n("/stories"),className:"text-white hover:text-nature-red text-sm transition-colors",children:t("stories")})}),c.jsx("li",{children:c.jsx(se,{to:n("/story-maker"),className:"text-white hover:text-nature-red text-sm transition-colors",children:t("storyMaker")})}),c.jsx("li",{children:c.jsx(se,{to:n("/about"),className:"text-white hover:text-nature-red text-sm transition-colors",children:t("about")})}),c.jsx("li",{children:c.jsx(se,{to:n("/subscription"),className:"text-white hover:text-nature-red text-sm transition-colors",children:t("subscription")})})]})]}),c.jsx("div",{children:c.jsxs("div",{className:"text-left ",children:[c.jsx("h3",{className:"font-medium text-lg mb-4 text-white",children:t("resources")}),c.jsxs("ul",{className:"space-y-2",children:[c.jsx("li",{children:c.jsx(se,{to:n("/text-checker"),className:"text-white hover:text-nature-red text-sm transition-colors",children:t("textChecker")})}),c.jsx("li",{children:c.jsx(se,{to:n("/improve-reading"),className:"text-white hover:text-nature-red text-sm transition-colors",children:t("improveReading")})}),c.jsx("li",{children:c.jsx(se,{to:n("/themes"),className:"text-white hover:text-nature-red text-sm transition-colors",children:t("themes")})}),c.jsx("li",{children:c.jsx(se,{to:n("/research"),className:"text-white hover:text-nature-red text-sm transition-colors",children:t("seslAlgorithm")})}),c.jsx("li",{children:c.jsx(se,{to:n("/blog"),className:"text-white hover:text-nature-red text-sm transition-colors",children:t("blog")})}),c.jsx("li",{children:c.jsx(se,{to:n("/blog/newsletter"),className:"text-white hover:text-nature-red text-sm transition-colors",children:t("newsletter")})}),c.jsx("li",{children:c.jsx(se,{to:n("/contact?tab=faq"),className:"text-white hover:text-nature-red text-sm transition-colors",children:t("faq")})}),c.jsx("li",{children:c.jsx(se,{to:n("/contact"),className:"text-white hover:text-nature-red text-sm transition-colors",children:t("contact")})})]})]})}),c.jsxs("div",{className:"text-left ",children:[c.jsx("h3",{className:"font-medium text-lg mb-4 text-white",children:t("legal")}),c.jsxs("ul",{className:"space-y-2",children:[c.jsx("li",{children:c.jsx(se,{to:n("/terms"),className:"text-white hover:text-nature-red text-sm transition-colors",children:t("terms")})}),c.jsx("li",{children:c.jsx(se,{to:n("/refund"),className:"text-white hover:text-nature-red text-sm transition-colors",children:t("refund")})}),c.jsx("li",{children:c.jsx(se,{to:n("/privacy"),className:"text-white hover:text-nature-red text-sm transition-colors",children:t("privacy")})})]})]})]}),c.jsxs("div",{className:"max-w-7xl mx-auto mt-12 pt-6 border-t border-border flex flex-col lg:flex-row justify-between items-center gap-4",children:[c.jsx("p",{className:"text-sm text-white",children:t("copyright",{year:r})}),c.jsxs("p",{className:"text-sm flex items-center gap-1 text-white",children:[t("madeWith")," ",c.jsx(Jp,{className:"h-3 w-3 text-nature-red"})," ",t("forYoungReaders")]})]})]})},lM=()=>{const[t,e]=p.useState({}),[n,r]=p.useState(!0);p.useEffect(()=>{(async()=>{try{const{data:a,error:l}=await ce.from("landing_assets").select("*");if(l)throw l;const u={};a?.forEach(d=>{u[d.section_id]||(u[d.section_id]={}),u[d.section_id][d.asset_key]=d.asset_url}),e(u)}catch(a){console.error("Failed to fetch landing assets:",a)}finally{r(!1)}})()},[]);const s=p.useCallback(async(i,a,l,u="image")=>{try{const{error:d}=await ce.from("landing_assets").upsert({section_id:i,asset_key:a,asset_url:l,asset_type:u},{onConflict:"section_id,asset_key"});if(d)throw d;return e(h=>({...h,[i]:{...h[i],[a]:l}})),!0}catch(d){return console.error("Failed to save landing asset:",d),!1}},[]),o=p.useCallback((i,a)=>t[i]?.[a],[t]);return{assets:t,isLoading:n,saveAsset:s,getAsset:o}},On={A1:{label:"A1 (Beginner)",shortLabel:"A1",ageBand:"5-7",classes:"bg-[#5ABFAD] text-white"},A2:{label:"A2 (Elementary)",shortLabel:"A2",ageBand:"7-9",classes:"bg-[#7BC99E] text-white"},B1:{label:"B1 (Intermediate)",shortLabel:"B1",ageBand:"9-12",classes:"bg-[#ABDA64] text-gray-800"},B2:{label:"B2 (Upper-Intermediate)",shortLabel:"B2",ageBand:"12-15",classes:"bg-[#F2CB05] text-gray-800"},C1:{label:"C1 (Advanced)",shortLabel:"C1",ageBand:"15-18",classes:"bg-[#F2A55E] text-gray-800"},C2:{label:"C2 (Proficient)",shortLabel:"C2",ageBand:"18+",classes:"bg-[#F27E7E] text-white"}},uD=t=>!t||!(t in On)?"bg-gray-100 text-gray-800":On[t].classes,dD=["A1","A2","B1","B2","C1","C2"],hD=t=>!t||!(t in On)?{label:"Unknown",shortLabel:"?",ageBand:"Unknown",classes:"bg-gray-100 text-gray-800"}:On[t],mc=t=>!t||!(t in On)?"Unknown":On[t].ageBand,fD=t=>{if(!t)return null;const e=Object.entries(On).find(([n,r])=>r.ageBand===t);return e?e[0]:null},pD=t=>t==null?"bg-gray-100 text-gray-800":t<=250?"bg-green-200 text-green-900":t<=400?"bg-green-500 text-green-50":t<=550?"bg-yellow-200 text-yellow-900":t<=700?"bg-yellow-500 text-yellow-50":t<=850?"bg-red-200 text-red-900":"bg-red-600 text-red-50",cM=(t,e=160)=>t.length<=e?t:t.substring(0,e-3).trim()+"...",uM=t=>{const e="https://storysparkle.org",n=t.startsWith("/")?t:`/${t}`,r=n==="/"?"/":n.replace(/\/$/,"");return`${e}${r}`},mD=t=>{const e=t.cefrLevel?mc(t.cefrLevel):t.ageRange,n=e?` for ages ${e}`:"",r=t.cefrLevel?` (${t.cefrLevel} level)`:"";return cM(`${t.description}${n}${r}. Interactive reading with audio narration and dyslexia support.`)},dM={en:"en_US",bn:"bn_BD",es:"es_ES",zh:"zh_CN",ja:"ja_JP"},Pr=({title:t="StorySparkle - Interactive Reading Experiences for Children",description:e="StorySparkle—reading practice app for kids with interactive leveled stories, adjustable-speed video narration, vocabulary builder, and custom AI story maker.",canonical:n,ogImage:r="https://cdn.storysparkle.org/logo_assets/favicon_512x512.png",ogType:s="website",structuredData:o,noIndex:i=!1,keywords:a})=>{const{currentLanguage:l}=Dn(),u=t.includes("StorySparkle")?t:`${t} | StorySparkle`,d=n||window.location.pathname,h=uM(d),f="https://storysparkle.org",m=Ys.filter(_=>_!=="en"),v=new RegExp(`^/(${m.join("|")})(?=/|$)`);let g=d.replace(v,"");g===""&&(g="/");const y=_=>_==="en"?f+(g==="/"?"/":g):f+"/"+_+(g==="/"?"":g);return c.jsxs(U_,{children:[c.jsx("title",{children:u}),c.jsx("meta",{name:"description",content:e}),c.jsx("meta",{name:"author",content:"StorySparkle"}),a&&c.jsx("meta",{name:"keywords",content:a}),c.jsx("link",{rel:"icon",href:"/favicon.webp",type:"image/webp"}),c.jsx("link",{rel:"apple-touch-icon",href:"/favicon.webp"}),c.jsx("html",{lang:l}),c.jsx("link",{rel:"canonical",href:h}),Ys.map(_=>c.jsx("link",{rel:"alternate",href:y(_),hrefLang:_},_)),c.jsx("link",{rel:"alternate",href:y("en"),hrefLang:"x-default"}),c.jsx("meta",{property:"og:title",content:u}),c.jsx("meta",{property:"og:description",content:e}),c.jsx("meta",{property:"og:type",content:s}),c.jsx("meta",{property:"og:url",content:h}),c.jsx("meta",{property:"og:image",content:r}),c.jsx("meta",{property:"og:site_name",content:"StorySparkle"}),c.jsx("meta",{property:"og:locale",content:dM[l]||"en_US"}),c.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),c.jsx("meta",{name:"twitter:title",content:u}),c.jsx("meta",{name:"twitter:description",content:e}),c.jsx("meta",{name:"twitter:image",content:r}),c.jsx("meta",{name:"viewport",content:"width=device-width, initial-scale=1.0"}),c.jsx("meta",{name:"robots",content:i?"noindex,nofollow":"index,follow"}),c.jsx("meta",{name:"googlebot",content:i?"noindex,nofollow":"index,follow"}),c.jsx("meta",{name:"language",content:l}),o&&c.jsx("script",{type:"application/ld+json",children:JSON.stringify(o)})]})},hM={"@context":"https://schema.org","@type":"Organization",name:"StorySparkle",description:"Interactive reading experiences for children with special support for dyslexic readers",url:"https://storysparkle.org",logo:"https://storysparkle.org/favicon.webp",sameAs:["https://twitter.com/StorySparkle"],contactPoint:{"@type":"ContactPoint",contactType:"customer service",email:"hello@storysparkle.com"}},fM={"@context":"https://schema.org","@type":"WebSite",name:"StorySparkle",description:"Interactive reading experiences for children",url:"https://storysparkle.org",potentialAction:{"@type":"SearchAction",target:"https://storysparkle.org/stories?search={search_term_string}","query-input":"required name=search_term_string"}},gD=t=>({"@context":"https://schema.org","@type":"CreativeWork",name:t.title,description:t.description,author:{"@type":"Organization",name:"StorySparkle"},publisher:{"@type":"Organization",name:"StorySparkle",logo:"https://storysparkle.org/favicon.webp"},audience:(()=>{const e=mc(t.cefrLevel),n=e.includes("+")?parseInt(e):parseInt(e.split("-")[0])||3,r=e.includes("+")?99:parseInt(e.split("-")[1])||12;return{"@type":"Audience",audienceType:"Children",suggestedMinAge:n,suggestedMaxAge:r}})(),educationalAlignment:{"@type":"AlignmentObject",educationalFramework:"CEFR Language Levels",targetDescription:`CEFR ${t.cefrLevel||"Unknown"} reading level`},learningResourceType:"Interactive Story",interactivityType:"active",typicalAgeRange:`${mc(t.cefrLevel)} years`,timeRequired:`PT${Math.floor(t.duration/60)}M${t.duration%60}S`,wordCount:t.wordCount,genre:t.theme,accessibilityFeature:["audioDescription","synchronizedAudioText","dyslexiaSupport"],isAccessibleForFree:!1,hasPart:{"@type":"WebPageElement",isAccessibleForFree:!1,cssSelector:".story-body-gated"}}),vD=t=>({"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:t.map((e,n)=>({"@type":"ListItem",position:n+1,name:e.name,item:`https://storysparkle.org${e.url}`}))}),pM={1:"M0,64 C120,20 240,100 480,64 C720,28 960,96 1200,64 C1320,48 1380,80 1440,64 L1440,120 L0,120 Z",2:"M0,40 C180,100 360,20 540,60 C720,100 900,30 1080,70 C1200,90 1340,40 1440,50 L1440,120 L0,120 Z",3:"M0,80 C160,30 320,90 480,50 C640,10 800,80 960,40 C1120,0 1280,70 1440,30 L1440,120 L0,120 Z",4:"M0,60 C240,110 480,10 720,70 C960,130 1200,20 1440,60 L1440,120 L0,120 Z",5:"M0,50 C100,20 200,80 360,40 C520,0 640,90 800,50 C960,10 1100,85 1260,45 C1360,25 1400,60 1440,55 L1440,120 L0,120 Z",6:"M0,45 C180,36 360,58 540,45 S900,32 1080,45 S1260,54 1440,45 L1440,120 L0,120 Z",7:"M0,30 C180,90 360,10 600,70 C840,130 1020,20 1200,60 C1320,80 1400,40 1440,50 L1440,120 L0,120 Z",8:"M0,70 C80,20 160,100 300,50 C440,0 520,80 660,60 C800,40 880,100 1020,30 C1160,-10 1300,80 1440,55 L1440,120 L0,120 Z",9:"M0,55 C60,90 140,15 260,65 C380,115 440,20 580,55 C720,90 800,10 940,50 C1080,90 1180,25 1300,60 C1380,80 1420,50 1440,60 L1440,120 L0,120 Z",10:"M0,80 C240,20 480,100 720,40 C960,-10 1200,90 1440,35 L1440,120 L0,120 Z",11:"M0,25 C100,70 220,10 380,55 C540,100 660,15 820,65 C980,110 1120,30 1280,70 C1360,90 1420,45 1440,55 L1440,120 L0,120 Z",12:"M0,40 C180,90 360,100 540,30 C720,-20 900,-10 1080,50 C1200,90 1340,80 1440,45 L1440,120 L0,120 Z"},ct=({topColor:t,bottomColor:e,variant:n=1,flip:r=!1,className:s=""})=>c.jsx("div",{className:`relative w-full overflow-hidden leading-[0] ${s}`,style:{backgroundColor:t},"aria-hidden":"true",children:c.jsx("svg",{viewBox:"0 0 1440 120",preserveAspectRatio:"none",className:"block w-full h-[60px] md:h-[80px] lg:h-[120px]",style:{transform:r?"scaleX(-1)":void 0},children:c.jsx("path",{d:pM[n],fill:e})})}),gp=1024;function mM(){const[t,e]=p.useState(void 0);return p.useEffect(()=>{const n=()=>{const s=window.innerWidth,o=window.innerHeight;return s<gp||s===gp&&o>s},r=()=>e(n());return window.addEventListener("resize",r),window.addEventListener("orientationchange",r),e(n()),()=>{window.removeEventListener("resize",r),window.removeEventListener("orientationchange",r)}},[]),!!t}function gM(t,e,n){const r=t(e,{returnObjects:!0});return Array.isArray(r)?r:[]}const vM=({words:t,className:e="",typingSpeed:n=100,deletingSpeed:r=60,pauseAfterWord:s=1500,finalWordMultiplier:o=5})=>{const[i,a]=p.useState(0),[l,u]=p.useState(""),[d,h]=p.useState(!1),[f,m]=p.useState(!1),v=Array.isArray(t)&&t.length>0?t:[];p.useEffect(()=>{a(0),u(""),h(!1),m(!1)},[v.join("|")]);const g=v[i]??"",y=i===v.length-1,_=p.useCallback(()=>{if(!(f||!g))if(d)l.length>0?u(l.slice(0,-1)):(h(!1),a(x=>v.length?(x+1)%v.length:0));else if(l.length<g.length)u(g.slice(0,l.length+1));else{m(!0);const x=y?s*o:s;setTimeout(()=>{m(!1),h(!0)},x)}},[l,d,f,g,y,s,o,v.length]);return p.useEffect(()=>{if(f||!g)return;const w=setTimeout(_,d?r:n);return()=>clearTimeout(w)},[_,d,f,n,r,g]),g?c.jsxs("span",{className:e,children:[l,c.jsx("span",{className:"animate-blink",children:"|"})]}):null};function T_(t){const e=p.useCallback(()=>{try{t().catch(()=>{})}catch{}},[t]);return{onMouseEnter:e,onFocus:e,onTouchStart:e}}const yM="https://cdn.storysparkle.org/ui_elements/Hero%20Icons/StoryLibrary.webp",Hu=({className:t="",labelOverride:e})=>{const{getLocalizedPath:n}=Dn(),{t:r}=Ue("landing"),s=T_(()=>S(()=>import("./StoriesPage-BqoiYBLd.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28])));return c.jsx(se,{to:n("/stories"),className:t,...s,children:c.jsxs(fe.div,{className:"relative inline-flex flex-col items-center pl-12",whileHover:{scale:1.05},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:17},children:[c.jsx("img",{src:yM,alt:"Magical story book",className:"absolute -top-0 left-0 w-20 h-auto pointer-events-none z-10 rotate-[-15deg]"}),c.jsx("div",{className:`bg-gradient-to-r from-orange-600 via-red-400 to-orange-300
pl-12 pr-10 py-4 rounded-full shadow-lg shadow-orange-600/30
hover:shadow-xl hover:shadow-orange-600/40 transition-shadow`,children:c.jsx("span",{className:"text-white font-bold uppercase tracking-widest text-sm md:text-base whitespace-nowrap",children:e||r("buttons.readStories")})})]})})},_M="https://cdn.storysparkle.org/landing_assets/computer.webp",vp="https://cdn.storysparkle.org/logo_assets/StorySparkle_Logo_Colourful_Padding.webp",xM="https://cdn.storysparkle.org/landing_assets/cheerful-characters-reduced-size.mp4",bM=()=>{const t=p.useRef(null),e=mM(),{t:n}=Ue("landing"),[r,s]=p.useState(!1),[o,i]=p.useState(!1);p.useEffect(()=>{const h=new Image,f=()=>i(!0);h.onload=f,h.onerror=f,h.src=vp;const m=window.setTimeout(f,800);return()=>window.clearTimeout(m)},[]);const{scrollYProgress:a}=R0({target:t,offset:["start start","end end"]}),l=Ai(a,[0,.5],[0,500]),u=Ai(a,[0,.5],[1,0]);CR(a,"change",h=>{h>=.01&&!r&&s(!0),h<.01&&r&&s(!1)});const d=gM(n,"hero.typewriterWords");return c.jsx("section",{ref:t,className:"relative h-auto md:h-[250vh]",children:c.jsxs("div",{className:"md:sticky overflow-hidden min-h-[calc(100vh-3.5rem)] md:min-h-0 md:h-[calc(100vh-3.5rem)]",style:{top:"3.5rem"},children:[c.jsx("div",{className:"absolute top-0 left-0 right-0 bottom-0",style:{background:"#FFFFFF"}}),c.jsxs("div",{className:"relative h-full flex flex-col md:flex-row ipad-portrait:!flex-col items-center justify-center ipad-portrait:!justify-around px-4 md:px-8 ipad-portrait:!py-4",children:[c.jsx("div",{className:"w-full md:w-1/2 ipad-portrait:!w-full flex items-center justify-center ipad-portrait:!order-1",children:c.jsxs("div",{className:"relative w-[80vw] md:w-[42vw] max-w-2xl",children:[c.jsx(fe.div,{className:"relative z-10 w-full",initial:{scale:.95},animate:o?{scale:1}:{scale:.95},transition:{delay:.1,duration:.6,type:"spring",stiffness:200,damping:20},children:c.jsx("img",{src:_M,alt:"Desktop computer",className:"w-full h-auto",width:2084,height:1916,fetchPriority:"high",decoding:"async"})}),c.jsxs("div",{className:"absolute z-20 top-[8%] md:top-[5%] left-[10%] md:left-[8%] right-[10%] md:right-[8%] bottom-[40%] md:bottom-[38%] flex flex-col items-center justify-center text-center px-2 md:px-4",children:[c.jsx(fe.p,{initial:{opacity:0,y:10},animate:o?{opacity:1,y:0}:{opacity:0,y:10},transition:{delay:.8,duration:.5},className:"text-sm sm:text-lg md:text-xl lg:text-2xl font-noto font-semibold text-foreground mb-1",children:n("hero.prefix")}),c.jsxs(fe.div,{initial:{opacity:0},animate:o?{opacity:1}:{opacity:0},transition:{delay:1.1,duration:.5},children:[c.jsx("h1",{className:"sr-only",children:"StorySparkle | Reading is Fun"}),c.jsx("div",{"aria-hidden":"true",children:c.jsx(vM,{words:d,className:"text-lg sm:text-2xl md:text-3xl lg:text-4xl bg-gradient-to-r from-nature-purple via-nature-coral to-nature-green bg-clip-text text-transparent font-bold",finalWordMultiplier:5})})]}),c.jsx(fe.img,{src:vp,alt:"StorySparkle Logo",className:"mt-2 md:mt-4 w-[55%] md:w-[60%] max-w-xs h-auto",initial:{opacity:0,y:10},animate:o?{opacity:1,y:0}:{opacity:0,y:10},transition:{delay:1.4,duration:.5}})]})]})}),c.jsxs("div",{className:"w-full md:w-1/2 ipad-portrait:!w-full flex flex-col items-center md:items-end ipad-portrait:!items-center justify-between md:py-[4%] h-full max-[1366px]:lg:justify-center max-[1366px]:lg:gap-4 max-[1366px]:lg:py-0 ipad-portrait:!justify-around ipad-portrait:!py-0 ipad-portrait:!h-auto ipad-portrait:!gap-6 ipad-portrait:!order-2",children:[c.jsx(fe.div,{initial:{opacity:0,y:20},animate:o?{opacity:1,y:0}:{opacity:0,y:20},transition:{delay:e?2:3.8,duration:.6},className:"mt-4 md:mt-0 ipad-portrait:!order-1",children:c.jsx(Hu,{})}),c.jsx(fe.video,{src:xM,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,className:"w-[80%] md:w-[90%] ipad-portrait:!w-[60%] max-w-xl h-auto pointer-events-none self-center md:self-end ipad-portrait:!self-center ipad-portrait:!order-2",style:{y:r&&!e?l:0,opacity:r&&!e?u:1},initial:{y:300,opacity:0},animate:o?{y:0,opacity:1}:{y:300,opacity:0},transition:{delay:e?2.2:3.2,duration:1.2,ease:"easeOut"}})]})]})]})})},wM="https://cdn.storysparkle.org/landing_assets/flicker-reading-reduced-size.mp4",EM=()=>{const t=p.useRef(null),e=lA(t,{amount:.3}),{t:n}=Ue("landing");return c.jsx("section",{ref:t,className:"relative min-h-0 py-8 lg:py-0 lg:min-h-screen flex items-center overflow-hidden",style:{background:"#FFF8E7"},children:c.jsx("div",{className:"container mx-auto max-w-6xl px-6",children:c.jsxs("div",{className:"flex flex-col lg:flex-row items-center gap-4 lg:gap-12",children:[c.jsxs("div",{className:"max-w-lg text-center lg:text-left flex flex-col",children:[c.jsxs("div",{className:"space-y-2 lg:space-y-4",children:[c.jsx("h2",{className:"section-header text-[22px] lg:text-[32px]",children:n("description.heading")}),c.jsx("p",{className:"section-subtext text-sm lg:text-xl",children:n("description.subtext")})]}),c.jsx("div",{className:"mt-4 lg:mt-8",children:c.jsx(Hu,{})})]}),c.jsx("div",{className:"flex-1 flex justify-center items-center",children:c.jsx(fe.div,{className:"w-40 md:w-80 lg:w-96",initial:{x:200,opacity:0},animate:{x:e?0:200,opacity:e?1:0},transition:{duration:1.2,ease:[.25,.1,.25,1]},children:c.jsx("video",{src:wM,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,className:"w-full object-contain"})})})]})})})},SM="https://cdn.storysparkle.org/ui_elements/Speedometer.webp",TM=({className:t=""})=>{const{getLocalizedPath:e}=Dn(),{t:n}=Ue("landing"),r=T_(()=>S(()=>import("./ResearchPage-BTDlGCdT.js"),__vite__mapDeps([29,1,2,23,6,4,30,31,32,33,34,35,27,28])));return c.jsx(se,{to:e("/research"),className:t,...r,children:c.jsxs(fe.div,{className:"relative inline-flex flex-col items-center pl-10",whileHover:{scale:1.05},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:17},children:[c.jsx("img",{src:SM,alt:"SESL Algorithm speedometer",className:"absolute top-2 left-0 w-16 h-auto pointer-events-none z-10 rotate-[-15deg]"}),c.jsx("div",{className:`bg-gradient-to-r from-cyan-500 via-teal-500 to-blue-500
pl-12 pr-10 py-4 rounded-full shadow-lg shadow-teal-500/30
hover:shadow-xl hover:shadow-teal-500/40 transition-shadow`,children:c.jsx("span",{className:"text-white font-bold uppercase tracking-widest text-sm md:text-base",children:n("buttons.seslAlgorithm")})})]})})},kM="https://cdn.storysparkle.org/landing_assets/xp-chart-card.webp",PM=({sectionRef:t})=>{const e=p.useRef(null),n=t??e,{t:r}=Ue("landing"),[s,o]=p.useState(!1);return p.useEffect(()=>{const i=n.current;if(!i)return;const a=new IntersectionObserver(l=>{l.forEach(u=>o(u.isIntersecting))},{rootMargin:"-50% 0px -50% 0px",threshold:0});return a.observe(i),()=>a.disconnect()},[n]),c.jsx("section",{ref:n,className:"relative h-[150vh]",style:{background:"#ECF4E8"},children:c.jsxs("div",{className:"sticky top-14 h-[calc(100vh-3.5rem)] overflow-hidden flex flex-col justify-start pt-16 md:pt-0 md:justify-center",children:[c.jsxs("div",{className:"relative z-10 px-6 md:absolute md:top-16 md:left-0 md:right-0 md:px-12 lg:px-20",children:[c.jsx("h2",{className:"section-header text-[22px] lg:text-[32px] mb-4",children:r("seslProgress.heading")}),c.jsx("p",{className:"section-subtext text-sm lg:text-xl max-w-6xl",children:r("seslProgress.subtext")})]}),c.jsx("div",{className:"relative z-10 mt-6 px-6 flex justify-center md:block md:absolute md:top-[30%] md:left-0 md:mt-0 md:px-12 lg:px-20",children:c.jsx(TM,{})}),c.jsx(fe.div,{className:"relative mt-8 w-full px-6 md:absolute md:left-0 md:top-[45%] md:-translate-y-1/2 md:w-[75vw] md:max-w-6xl md:mt-0 md:px-0 md:pl-12 lg:pl-20",initial:{x:"30%",opacity:0},animate:s?{x:"0%",opacity:1}:{x:"30%",opacity:0},transition:{duration:.8,ease:[.22,1,.36,1]},children:c.jsx("img",{src:kM,alt:"XP Points Progress Chart",className:"w-full h-auto rounded-2xl shadow-2xl",width:1600,height:1e3,loading:"lazy",decoding:"async"})})]})})},CM=({variant:t="inline",className:e="",as:n="span"})=>{let r="",s="";switch(t){case"navbar":r="text-lg",s="font-bold";break;case"footer":r="text-xl",s="font-bold";break;default:r="",s="";break}return c.jsxs(n,{className:wc(e,s,r,"whitespace-nowrap font-noto inline"),children:[c.jsx("span",{className:"text-nature-red",children:"Story"}),c.jsx("span",{className:"text-nature-coral",children:"Sparkle"})]})},jM="https://cdn.storysparkle.org/landing_assets/castle-on-cloud.webp",RM=()=>{const{t}=Ue("landing");return c.jsx("section",{className:"relative h-[200vh]",children:c.jsxs("div",{className:"sticky top-14 h-[calc(100vh-3.5rem)] flex flex-col overflow-hidden",style:{background:"#FFF7ED"},children:[c.jsx(fe.img,{src:jM,alt:"Castle on Cloud",className:"absolute bottom-0 left-0 h-[35vh] md:h-[75vh] max-[1366px]:lg:h-[55vh] ipad-portrait:!h-[42vh] w-auto object-contain animate-bob pl-4 md:pl-8",initial:{opacity:0},whileInView:{opacity:1},viewport:{once:!0},transition:{duration:1.5,ease:"easeOut"}}),c.jsxs("div",{className:"relative flex flex-col items-center justify-start md:justify-center ipad-portrait:!justify-start text-center z-10 px-4 md:px-8 flex-1",children:[c.jsxs("div",{className:"absolute top-[12%] left-0 right-0 px-4 md:relative md:top-auto md:px-0 md:pt-0 ipad-portrait:!absolute ipad-portrait:!top-[12%] ipad-portrait:!px-4",children:[c.jsx(fe.h2,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.6},className:"section-header text-[22px] lg:text-[32px] text-center mb-3",children:t("cta.heading")}),c.jsxs(fe.p,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.6,delay:.2},className:"section-subtext text-sm lg:text-xl text-center max-w-lg ipad-portrait:!max-w-md mx-auto mb-8",children:[t("cta.subtextPart1")," ",c.jsx(CM,{})," ",t("cta.subtextPart2")]})]}),c.jsxs("div",{className:"absolute top-[45%] left-0 right-0 -translate-y-1/2 md:relative md:top-auto md:translate-y-0 ipad-portrait:!absolute ipad-portrait:!top-[45%] ipad-portrait:!-translate-y-1/2",children:[c.jsx(fe.div,{initial:{y:30,opacity:0},whileInView:{y:0,opacity:1},viewport:{once:!0},transition:{delay:.5},children:c.jsx(Hu,{})}),c.jsx(fe.p,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.6,delay:.3},className:"section-footnote mt-3 text-center",children:t("cta.footnote")})]})]})]})})},yp=()=>c.jsx("div",{style:{minHeight:"100vh"},"aria-hidden":"true"}),AM="https://cdn.storysparkle.org";function tl(t){let n="";for(let r=0;r<t.length;r+=32768){const s=t.subarray(r,r+32768);n+=String.fromCharCode.apply(null,s)}return btoa(n)}async function IM(t,e,n,r){let s,o=r;if(n instanceof File){o=o||n.type;const l=await n.arrayBuffer();s=tl(new Uint8Array(l))}else if(n instanceof Blob){o=o||n.type;const l=await n.arrayBuffer();s=tl(new Uint8Array(l))}else s=tl(n);const{data:i,error:a}=await ce.functions.invoke("r2-upload",{body:{bucket:t,path:e,content:s,contentType:o||"application/octet-stream"}});if(a)throw new Error(`R2 upload failed: ${a.message}`);if(i?.error)throw new Error(`R2 upload failed: ${i.error}`);return i.url}async function yD(t,e){const{data:n,error:r}=await ce.functions.invoke("r2-delete",{body:{bucket:t,path:e}});if(r)throw new Error(`R2 delete failed: ${r.message}`);if(n?.error)throw new Error(`R2 delete failed: ${n.error}`);return!0}async function _D(t){const{data:e,error:n}=await ce.functions.invoke("r2-list",{body:{prefix:t}});if(n)throw new Error(`R2 list failed: ${n.message}`);if(e?.error)throw new Error(`R2 list failed: ${e.error}`);return e.files||[]}function MM(t,e){return`${AM}/${t}/${e}`}function OM(t){const e=t.split(".").pop(),n=Date.now(),r=Math.random().toString(36).substring(2,8);return`${n}-${r}.${e}`}const DM=({placeholder:t,description:e,aspectRatio:n="square",className:r="",imageSrc:s,size:o="md",uploadPath:i="landing",onUpload:a})=>{const l=p.useRef(null),[u,d]=p.useState(!1),[h,f]=p.useState(s),m={square:"aspect-square","16:9":"aspect-video","4:3":"aspect-[4/3]",auto:""},v={sm:"w-16 h-16",md:"w-24 h-24",lg:"w-32 h-32",full:"w-full"},g=()=>{l.current?.click()},y=async _=>{const x=_.target.files?.[0];if(!x)return;if(!["image/jpeg","image/png","image/gif","image/webp"].includes(x.type)){Pt.error("Please upload an image file (JPEG, PNG, GIF, or WebP)");return}if(x.size>10*1024*1024){Pt.error("File size must be less than 10MB");return}d(!0);try{const E=OM(x.name),b=`${i}/${E}`;await IM("landing_assets",b,x,x.type);const T=MM("landing_assets",b);f(T),a?.(T),Pt.success("Image uploaded successfully!")}catch(E){console.error("Upload failed:",E),Pt.error("Failed to upload image")}finally{d(!1),l.current&&(l.current.value="")}};return h?c.jsxs("div",{className:"relative group",children:[c.jsx("img",{src:h,alt:e,className:`object-cover rounded-xl ${n!=="auto"?m[n]:""} ${o!=="full"?v[o]:"w-full"} ${r}`}),c.jsx("input",{ref:l,type:"file",accept:"image/*",onChange:y,className:"hidden"}),c.jsx(un,{variant:"secondary",size:"sm",onClick:g,disabled:u,className:"absolute bottom-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity",children:u?c.jsx(ad,{className:"w-4 h-4 animate-spin"}):c.jsx(ud,{className:"w-4 h-4"})})]}):c.jsxs("div",{className:`relative border-2 border-dashed border-muted-foreground/40 rounded-xl bg-muted/20 flex flex-col items-center justify-center p-4 text-center ${n!=="auto"?m[n]:"min-h-[100px]"} ${o!=="full"?v[o]:"w-full"} ${r}`,children:[c.jsx("input",{ref:l,type:"file",accept:"image/*",onChange:y,className:"hidden"}),c.jsx("div",{className:"text-2xl mb-2",children:"🖼️"}),c.jsx(un,{variant:"outline",size:"sm",onClick:g,disabled:u,className:"text-xs",children:u?c.jsxs(c.Fragment,{children:[c.jsx(ad,{className:"w-3 h-3 mr-1 animate-spin"}),"Uploading..."]}):c.jsxs(c.Fragment,{children:[c.jsx(ud,{className:"w-3 h-3 mr-1"}),"Upload"]})})]})},NM=({isVisible:t,beanstalkImageSrc:e,onBeanstalkUpload:n})=>c.jsx(rk,{children:t&&c.jsx(fe.div,{initial:{y:"100%"},animate:{y:0},exit:{y:"100%"},transition:{duration:1.2,ease:[.4,0,.2,1]},className:"fixed bottom-0 right-0 z-30 h-screen ipad-portrait:!h-[45vh] pointer-events-none",children:e?c.jsx("img",{src:e,alt:"Magical beanstalk",className:"h-full w-auto object-contain"}):c.jsx("div",{className:"h-full w-32 pointer-events-auto",children:c.jsx(DM,{placeholder:"BEANSTALK",description:"Claymation beanstalk growing from bottom to top",aspectRatio:"auto",size:"full",className:"h-full",imageSrc:e,onUpload:n})})})}),LM="1071313126266-r1durnkl0lrnj4ur1609lit0dm7div5n.apps.googleusercontent.com",_p="googleOneTapDismissed",FM=1e3*60*60,$M=async t=>{const e=new TextEncoder().encode(t),n=await crypto.subtle.digest("SHA-256",e);return Array.from(new Uint8Array(n)).map(r=>r.toString(16).padStart(2,"0")).join("")},VM=()=>{const{user:t,isLoading:e}=Wc(),n=p.useRef(!1);return p.useEffect(()=>{if(t||e||n.current)return;const r=sessionStorage.getItem(_p);if(r&&Date.now()-Number(r)<FM)return;const s=()=>new Promise(l=>{if(document.querySelector('script[src="https://accounts.google.com/gsi/client"]')){l();return}const u=document.createElement("script");u.src="https://accounts.google.com/gsi/client",u.async=!0,u.onload=()=>l(),u.onerror=()=>l(),document.head.appendChild(u)});let o,i;const a=async()=>{if(!window.google?.accounts?.id)return!1;const l=crypto.randomUUID(),u=await $M(l);return window.google.accounts.id.initialize({client_id:LM,callback:async d=>{try{const{error:h}=await ce.auth.signInWithIdToken({provider:"google",token:d.credential,nonce:l});h&&console.error("Google One Tap sign-in error:",h.message)}catch(h){console.error("Google One Tap callback error:",h)}},nonce:u,use_fedcm_for_prompt:!0,auto_select:!1,cancel_on_tap_outside:!0,context:"signup",itp_support:!0}),window.google.accounts.id.prompt(d=>{d.isDismissedMoment()&&sessionStorage.setItem(_p,String(Date.now()))}),n.current=!0,!0};return s().then(()=>{a().then(l=>{l||(o=setInterval(()=>{a().then(u=>{u&&o&&clearInterval(o)})},300),i=setTimeout(()=>{o&&clearInterval(o)},5e3))})}),()=>{o&&clearInterval(o),i&&clearTimeout(i),window.google?.accounts?.id&&window.google.accounts.id.cancel()}},[t,e]),null},BM=p.lazy(()=>S(()=>import("./ProfessionalNarrationSection-C8R1WCEI.js"),__vite__mapDeps([36,1,2,6,27,28]))),zM=p.lazy(()=>S(()=>import("./SyncedHighlightsSection-C0I-fUaU.js"),__vite__mapDeps([37,1,2,38,6,27,28]))),UM=p.lazy(()=>S(()=>import("./InteractiveWordsSection-_QpeWfdr.js"),__vite__mapDeps([39,1,2,6,27,28]))),HM=p.lazy(()=>S(()=>import("./VocabularySection-a68dOsrU.js"),__vite__mapDeps([40,1,2,6,27,28]))),WM=p.lazy(()=>S(()=>import("./ChooseYourPaceSection-DnHU4oUS.js"),__vite__mapDeps([41,1,2,6,42,27,28]))),GM=p.lazy(()=>S(()=>import("./DyslexiaSection-CQoixqAV.js"),__vite__mapDeps([43,1,2,38,6,27,28]))),KM=p.lazy(()=>S(()=>import("./CheckTextSection-BJYNAHLg.js"),__vite__mapDeps([44,1,2,38,45,27,6,28]))),qM=p.lazy(()=>S(()=>import("./ThemesSection-C6JxdD8i.js"),__vite__mapDeps([46,1,2,38,47,6,27,28]))),YM=p.lazy(()=>S(()=>import("./StoryMakerSection-DmBtWQnX.js"),__vite__mapDeps([48,1,2,6,27,28]))),XM=p.lazy(()=>S(()=>import("./AchievementsSection-BCE-2KAd.js"),__vite__mapDeps([49,1,2,6,27,28]))),ZM=p.lazy(()=>S(()=>import("./HotAirBalloon-DxSIhaJ2.js"),__vite__mapDeps([50,1,2,27,28,6]))),JM=p.lazy(()=>S(()=>import("./QuillWipe-mOdOGsm9.js"),__vite__mapDeps([51,1,2,27,28,6]))),QM="https://cdn.storysparkle.org/landing_assets/flicker-on-beanstalk.webp",Ee={white:"#FFFFFF",buttercream:"#FFF8E7",lavender:"#F3E8FF",sky:"#E0F2FE",lemon:"#FEF9C3",pink:"#FCE7F3",mint:"#F0FDF4",violet:"#EDE9FE",peach:"#FFF7ED",apricot:"#FFECD2",seafoam:"#E0F5F0",rose:"#FFE4E6",sage:"#ECF4E8"},Wr=()=>{const{t}=Ue("home"),{getAsset:e,saveAsset:n}=lM(),[r,s]=p.useState(!1),[o,i]=p.useState(!1),[a,l]=p.useState(0),u=p.useRef(null),d=p.useRef(null),{scrollYProgress:h}=R0({target:d,offset:["start start","end end"]}),f=Ai(h,[.4,.9],["100%","0%"]),m=Ai(h,[.4,.7],[0,1]),{setLumiTarget:v,setOnTargetReached:g}=Qg(),[y,_]=p.useState(!1);return p.useEffect(()=>(g(()=>{_(!0),setTimeout(()=>{_(!1),v(null)},1e3)}),()=>g(void 0)),[g,v,_]),p.useEffect(()=>{const x=()=>{const w=window.scrollY,E=window.innerHeight,b=Math.floor(w/E);l(Math.min(b,10))};return window.addEventListener("scroll",x),()=>window.removeEventListener("scroll",x)},[]),c.jsxs(c.Fragment,{children:[c.jsx(VM,{}),c.jsx(Pr,{title:t("meta.title"),description:t("meta.description"),keywords:t("meta.keywords",{defaultValue:""})||void 0,canonical:"/",structuredData:[hM,fM]}),c.jsxs("div",{className:"min-h-screen overflow-x-clip",style:{background:Ee.white},children:[c.jsx(bM,{}),c.jsx(ct,{topColor:Ee.white,bottomColor:Ee.buttercream,variant:8,flip:!0}),c.jsx(EM,{}),c.jsxs(p.Suspense,{fallback:c.jsx(yp,{}),children:[c.jsx(ct,{topColor:Ee.buttercream,bottomColor:Ee.lavender,variant:8}),c.jsx(BM,{}),c.jsx(ct,{topColor:Ee.lavender,bottomColor:Ee.sky,variant:2,flip:!0}),c.jsx(zM,{}),c.jsx(ct,{topColor:Ee.sky,bottomColor:Ee.apricot,variant:9}),c.jsx(UM,{videoSrc:e("interactive_words","main_video"),onVideoUpload:x=>n("interactive_words","main_video",x,"video"),onLumiTarget:x=>v(x),isWordHovered:y}),c.jsx(ct,{topColor:Ee.apricot,bottomColor:Ee.lemon,variant:4,flip:!0}),c.jsx(HM,{}),c.jsx(ct,{topColor:Ee.lemon,bottomColor:Ee.seafoam,variant:10}),c.jsx(WM,{}),c.jsx("div",{className:"relative -mt-12 z-20 pointer-events-none",children:c.jsx(ct,{topColor:"transparent",bottomColor:Ee.pink,variant:6,flip:!0})}),c.jsx(GM,{}),c.jsx(KM,{}),c.jsx(qM,{onInteractionComplete:()=>{},hasCarouselInteracted:!0}),c.jsx(ZM,{isActive:r,onComplete:()=>s(!1)})]}),c.jsxs(p.Suspense,{fallback:null,children:[c.jsx(ct,{topColor:Ee.mint,bottomColor:Ee.rose,variant:11}),c.jsx(YM,{flickerWritingImageSrc:e("story_maker","flicker_writing_image")}),c.jsx(JM,{isActive:o,onComplete:()=>i(!1)})]}),c.jsxs(p.Suspense,{fallback:c.jsx(yp,{}),children:[c.jsx(ct,{topColor:Ee.rose,bottomColor:Ee.violet,variant:3,flip:!0}),c.jsx(XM,{}),c.jsx(ct,{topColor:Ee.violet,bottomColor:Ee.sage,variant:12}),c.jsxs("div",{className:"relative",children:[c.jsx(PM,{sectionRef:d}),c.jsx(ct,{topColor:Ee.sage,bottomColor:Ee.peach,variant:5,flip:!0}),c.jsx("div",{ref:u,children:c.jsx(RM,{})}),c.jsx("div",{className:"sticky bottom-0 h-0 z-30 pointer-events-none",children:c.jsx("div",{className:"absolute bottom-0 right-[5vw] w-[24vw] sm:w-[40vw] max-w-[250px] sm:max-w-[420px] h-[312px] sm:h-[65vh] ipad-portrait:!w-[30vw] ipad-portrait:!max-w-[280px] ipad-portrait:!h-[45vh] overflow-hidden",children:c.jsx(fe.img,{src:QM,alt:"Flicker on Beanstalk",className:"absolute inset-0 w-full h-full object-contain object-bottom will-change-transform",width:420,height:650,loading:"lazy",decoding:"async",style:{y:f,opacity:m}})})})]})]}),c.jsx(NM,{isVisible:!1,beanstalkImageSrc:e("progress","beanstalk_image"),onBeanstalkUpload:x=>n("progress","beanstalk_image",x,"image")})]})]})},eO="https://cdn.storysparkle.org";async function tO(){try{return[{name:"OpenDyslexic-Regular.woff2",format:"woff2"},{name:"OpenDyslexic-Regular.woff",format:"woff"},{name:"OpenDyslexic-Bold.woff2",format:"woff2"},{name:"OpenDyslexic-Bold.woff",format:"woff"}].map(e=>({name:e.name,url:`${eO}/fonts/${e.name}`,format:e.format}))}catch(t){return console.error("Failed to load fonts:",t),[]}}function nO(){const[t,e]=p.useState(!1);return p.useEffect(()=>{(async()=>{await new Promise(r=>{"requestIdleCallback"in window?window.requestIdleCallback(()=>r(),{timeout:5e3}):setTimeout(r,3e3)});try{const r=await tO();if(r.length===0){console.log("No fonts found in storage, using fallback"),e(!0);return}const s=r.map(o=>{const i=o.name.includes("Bold");return new FontFace("OpenDyslexic",`url(${o.url}) format('${o.format}')`,{weight:i?"700":"400",style:"normal",display:"swap"}).load().then(l=>(document.fonts.add(l),l))});await Promise.all(s),e(!0),console.log("All fonts loaded from Supabase")}catch(r){console.error("Error loading fonts (using fallback):",r),e(!0)}})()},[]),null}const rO=()=>{const{pathname:t}=io();return p.useEffect(()=>{window.scrollTo(0,0)},[t]),null},sO="Main Scene",oO=0,iO=260.1941560444079,aO=260.1941046463815,lO={g:"@lottiefiles/creator@1.88.0"},cO=[{ty:0,nm:"StorySparkle Logo",sr:1,st:0,op:90,ip:0,hd:!1,ddd:0,bm:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[92,92]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[130.09706517269734,130.09706517269737]},r:{a:1,k:[{o:{x:.66,y:0},i:{x:.34,y:1},s:[50],t:0},{o:{x:.66,y:0},i:{x:.34,y:1},s:[-50],t:22.63},{o:{x:.66,y:0},i:{x:.34,y:1},s:[50],t:45.25},{o:{x:.66,y:0},i:{x:.34,y:1},s:[-50],t:67.87},{s:[50],t:90}]},sa:{a:0,k:0},o:{a:0,k:100}},w:184,h:184,refId:"precomp_Shape Layer - SVG_ktGbUW1Zv3_b371b8fc-0abe-40ce-b884-13b7441df0ed",ind:1}],uO="5.7.0",dO=30,hO=90,fO=0,pO=[{nm:"StorySparkle Logo",id:"precomp_Shape Layer - SVG_ktGbUW1Zv3_b371b8fc-0abe-40ce-b884-13b7441df0ed",fr:30,layers:[{ty:4,nm:"Shape Layer 1",sr:1,st:0,op:90,ip:0,hd:!1,ddd:0,bm:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[24.356674043576486,24.364452763262335]},s:{a:0,k:[377.95,377.95]},sk:{a:0,k:0},p:{a:0,k:[92.05604954769733,92.08544921875]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},shapes:[{ty:"gr",bm:0,hd:!1,nm:"g1893",np:3,it:[{ty:"gr",bm:0,hd:!1,nm:"g1747",np:5,it:[{ty:"gr",bm:0,hd:!1,nm:"g14158-7",np:3,it:[{ty:"gr",bm:0,hd:!1,nm:"path14149-1",np:3,it:[{ty:"sh",bm:0,hd:!1,nm:"Path 1",d:1,ks:{a:0,k:{c:!1,i:[[0,0],[0,-1.61]],o:[[0,1.61],[0,0]],v:[[83.2,135.12],[83.2,139.95]]}}},{ty:"st",bm:0,hd:!1,nm:"Stroke",lc:2,lj:1,ml:4,o:{a:0,k:100},w:{a:0,k:1.41},c:{a:0,k:[0,0,0]}},{ty:"fl",bm:0,hd:!1,nm:"Fill",c:{a:0,k:[.949,.8,.0196]},r:1,o:{a:0,k:100}},{ty:"tr",a:{a:0,k:[83.19985747300423,137.5333392562743]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[83.19985747300423,137.5333392562743]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]},{ty:"gr",bm:0,hd:!1,nm:"g14147-7",np:3,it:[{ty:"gr",bm:0,hd:!1,nm:"g13994-6",np:2,it:[{ty:"gr",bm:0,hd:!1,nm:"path13986-2",np:4,it:[{ty:"sh",bm:0,hd:!1,nm:"Path 2",d:1,ks:{a:0,k:{c:!0,i:[[0,0],[0,0],[3.33,1.13],[2.63,.45],[1.99,-1.31],[1.05,-1.31],[0,0],[0,0]],o:[[0,0],[-4.33,-.06],[-3.33,-1.13],[-2.63,-.45],[-1.99,1.31],[0,0],[0,0],[0,0]],v:[[113.56,144.76],[113.56,140.3],[101.56,139.06],[93.25,135.27],[85.7,137.43],[81.61,141.35],[81.64,144.76],[113.56,144.76]]}}},{ty:"sh",bm:0,hd:!1,nm:"Path 3",d:1,ks:{a:0,k:{c:!0,i:[[0,0],[0,0],[-3.33,1.13],[-2.63,.45],[-1.99,-1.31],[-1.05,-1.31],[0,0],[0,0]],o:[[0,0],[4.33,-.06],[3.33,-1.13],[2.63,-.45],[1.99,1.31],[0,0],[0,0],[0,0]],v:[[49.66,144.76],[49.66,140.3],[61.66,139.06],[69.97,135.27],[77.52,137.43],[81.61,141.35],[81.64,144.76],[49.66,144.76]]}}},{ty:"st",bm:0,hd:!1,nm:"Stroke",lc:2,lj:1,ml:4,o:{a:0,k:100},w:{a:0,k:1.41},c:{a:0,k:[0,0,0]}},{ty:"fl",bm:0,hd:!1,nm:"Fill",c:{a:0,k:[.949,.8,.0196]},r:1,o:{a:0,k:100}},{ty:"tr",a:{a:0,k:[81.60584766273162,139.893564781624]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[81.60584766273162,139.893564781624]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]},{ty:"tr",a:{a:0,k:[81.60584766273162,139.893564781624]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[83.17584766273161,131.313564781624]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]},{ty:"gr",bm:0,hd:!1,nm:"rect13980-5",np:3,it:[{ty:"sh",bm:0,hd:!1,nm:"Path 4",d:1,ks:{a:0,k:{c:!0,i:[[0,0],[0,0],[0,-1.33],[0,0],[1.63,0],[0,0],[0,1.33],[0,0],[-1.63,0]],o:[[0,0],[1.63,0],[0,0],[0,1.33],[0,0],[-1.63,0],[0,0],[0,-1.33],[0,0]],v:[[51.44,136.18],[114.92,136.18],[117.87,138.59],[117.87,138.59],[114.92,141],[51.44,141],[48.48,138.59],[48.48,138.59],[51.44,136.18]]}}},{ty:"st",bm:0,hd:!1,nm:"Stroke",lc:2,lj:1,ml:4,o:{a:0,k:100},w:{a:0,k:1.41},c:{a:0,k:[0,0,0]}},{ty:"fl",bm:0,hd:!1,nm:"Fill",c:{a:0,k:[.949,.8,.0196]},r:1,o:{a:0,k:100}},{ty:"tr",a:{a:0,k:[83.17104570067707,138.5885372942198]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[83.17104570067707,138.5885372942198]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]},{ty:"tr",a:{a:0,k:[83.17104570067707,133.72414973299237]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[83.17104570067707,132.66414973299237]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]},{ty:"tr",a:{a:0,k:[83.17104570067707,132.66895169504693]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[83.17104570067707,127.37895169504692]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]},{ty:"gr",bm:0,hd:!1,nm:"path16323-5",np:3,it:[{ty:"sh",bm:0,hd:!1,nm:"Path 5",d:1,ks:{a:0,k:{c:!0,i:[[0,0],[0,-6.99],[-2.37,-2.37],[-3.36,0],[-2.15,4.28],[.93,0],[0,5.67],[-2.59,1.94],[.81,0]],o:[[-6.99,0],[0,3.36],[2.37,2.37],[4.79,0],[-.89,.25],[-5.67,0],[0,-3.23],[-.8,-.16],[0,0]],v:[[65.73,68.45],[53.07,81.11],[56.78,90.06],[65.73,93.77],[77.04,86.79],[74.31,87.17],[64.04,76.9],[68.15,68.68],[65.73,68.45]]}}},{ty:"st",bm:0,hd:!1,nm:"Stroke",lc:2,lj:2,ml:4,o:{a:0,k:100},w:{a:0,k:1.41},c:{a:0,k:[0,0,0]}},{ty:"fl",bm:0,hd:!1,nm:"Fill",c:{a:0,k:[.349,.749,.6784]},r:1,o:{a:0,k:100}},{ty:"tr",a:{a:0,k:[65.09165856541426,81.10724533770491]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[65.09165856541426,81.10724533770491]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]},{ty:"gr",bm:0,hd:!1,nm:"g4820-5",np:10,it:[{ty:"gr",bm:0,hd:!1,nm:"path4510-1-1-9-9-9",np:3,it:[{ty:"sh",bm:0,hd:!1,nm:"Path 6",d:1,ks:{a:0,k:{c:!1,i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[95.63,92.56],[93.06,95.13]]}}},{ty:"st",bm:0,hd:!1,nm:"Stroke",lc:2,lj:1,ml:4,o:{a:0,k:100},w:{a:0,k:1.41},c:{a:0,k:[0,0,0]}},{ty:"fl",bm:0,hd:!1,nm:"Fill",c:{a:0,k:[.749,.0196,.0118]},r:1,o:{a:0,k:100}},{ty:"tr",a:{a:0,k:[94.34130335898263,93.83873294507185]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[94.34130335898263,93.83873294507185]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]},{ty:"gr",bm:0,hd:!1,nm:"path4510-0-8-6-4",np:3,it:[{ty:"sh",bm:0,hd:!1,nm:"Path 7",d:1,ks:{a:0,k:{c:!1,i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[112.32,75.86],[109.75,78.43]]}}},{ty:"st",bm:0,hd:!1,nm:"Stroke",lc:2,lj:1,ml:4,o:{a:0,k:100},w:{a:0,k:1.41},c:{a:0,k:[0,0,0]}},{ty:"fl",bm:0,hd:!1,nm:"Fill",c:{a:0,k:[.749,.0196,.0118]},r:1,o:{a:0,k:100}},{ty:"tr",a:{a:0,k:[111.03292346048953,77.14231088151041]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[111.03292346048953,77.14231088151041]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]},{ty:"gr",bm:0,hd:!1,nm:"path4510-1-1-9-1",np:3,it:[{ty:"sh",bm:0,hd:!1,nm:"Path 8",d:1,ks:{a:0,k:{c:!1,i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[92.7,85.5],[89.07,85.5]]}}},{ty:"st",bm:0,hd:!1,nm:"Stroke",lc:2,lj:1,ml:4,o:{a:0,k:100},w:{a:0,k:1.41},c:{a:0,k:[0,0,0]}},{ty:"fl",bm:0,hd:!1,nm:"Fill",c:{a:0,k:[.749,.0196,.0118]},r:1,o:{a:0,k:100}},{ty:"tr",a:{a:0,k:[90.8838906797292,85.49772485637291]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[90.8838906797292,85.49772485637291]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]},{ty:"gr",bm:0,hd:!1,nm:"path4510-0-8-1",np:3,it:[{ty:"sh",bm:0,hd:!1,nm:"Path 9",d:1,ks:{a:0,k:{c:!1,i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[116.31,85.5],[112.68,85.5]]}}},{ty:"st",bm:0,hd:!1,nm:"Stroke",lc:2,lj:1,ml:4,o:{a:0,k:100},w:{a:0,k:1.41},c:{a:0,k:[0,0,0]}},{ty:"fl",bm:0,hd:!1,nm:"Fill",c:{a:0,k:[.749,.0196,.0118]},r:1,o:{a:0,k:100}},{ty:"tr",a:{a:0,k:[114.49033613974304,85.49772485637291]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[114.49033613974304,85.49772485637291]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]},{ty:"gr",bm:0,hd:!1,nm:"path4510-1-1-7",np:3,it:[{ty:"sh",bm:0,hd:!1,nm:"Path 10",d:1,ks:{a:0,k:{c:!1,i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[95.63,78.43],[93.06,75.86]]}}},{ty:"st",bm:0,hd:!1,nm:"Stroke",lc:2,lj:1,ml:4,o:{a:0,k:100},w:{a:0,k:1.41},c:{a:0,k:[0,0,0]}},{ty:"fl",bm:0,hd:!1,nm:"Fill",c:{a:0,k:[.749,.0196,.0118]},r:1,o:{a:0,k:100}},{ty:"tr",a:{a:0,k:[94.34130335898263,77.14231088151041]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[94.34130335898263,77.14231088151041]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]},{ty:"gr",bm:0,hd:!1,nm:"path4510-0-2",np:3,it:[{ty:"sh",bm:0,hd:!1,nm:"Path 11",d:1,ks:{a:0,k:{c:!1,i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[112.32,95.13],[109.75,92.56]]}}},{ty:"st",bm:0,hd:!1,nm:"Stroke",lc:2,lj:1,ml:4,o:{a:0,k:100},w:{a:0,k:1.41},c:{a:0,k:[0,0,0]}},{ty:"fl",bm:0,hd:!1,nm:"Fill",c:{a:0,k:[.749,.0196,.0118]},r:1,o:{a:0,k:100}},{ty:"tr",a:{a:0,k:[111.03292346048953,93.83873294507185]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[111.03292346048953,93.83873294507185]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]},{ty:"gr",bm:0,hd:!1,nm:"path4510-1-8",np:3,it:[{ty:"sh",bm:0,hd:!1,nm:"Path 12",d:1,ks:{a:0,k:{c:!1,i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[102.69,95.48],[102.69,99.12]]}}},{ty:"st",bm:0,hd:!1,nm:"Stroke",lc:2,lj:1,ml:4,o:{a:0,k:100},w:{a:0,k:1.41},c:{a:0,k:[0,0,0]}},{ty:"fl",bm:0,hd:!1,nm:"Fill",c:{a:0,k:[.749,.0196,.0118]},r:1,o:{a:0,k:100}},{ty:"tr",a:{a:0,k:[102.68711340973613,97.29614562432529]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[102.68711340973613,97.29614562432529]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]},{ty:"gr",bm:0,hd:!1,nm:"path4510-06",np:3,it:[{ty:"sh",bm:0,hd:!1,nm:"Path 13",d:1,ks:{a:0,k:{c:!1,i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[102.69,71.87],[102.69,75.51]]}}},{ty:"st",bm:0,hd:!1,nm:"Stroke",lc:2,lj:1,ml:4,o:{a:0,k:100},w:{a:0,k:1.41},c:{a:0,k:[0,0,0]}},{ty:"fl",bm:0,hd:!1,nm:"Fill",c:{a:0,k:[.749,.0196,.0118]},r:1,o:{a:0,k:100}},{ty:"tr",a:{a:0,k:[102.68711340973613,73.68970016431149]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[102.68711340973613,73.68970016431149]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]},{ty:"gr",bm:0,hd:!1,nm:"path3766-8",np:3,it:[{ty:"sh",bm:0,hd:!1,nm:"Path 14",d:1,ks:{a:0,k:{c:!0,i:[[0,0],[1.21,-1.21],[1.71,0],[1.21,1.21],[0,1.71],[-1.21,1.21],[-1.71,0],[-1.21,-1.21],[0,-1.71]],o:[[0,1.71],[-1.21,1.21],[-1.71,0],[-1.21,-1.21],[0,-1.71],[1.21,-1.21],[1.71,0],[1.21,1.21],[0,0]],v:[[109.13,85.5],[107.25,90.05],[102.69,91.94],[98.13,90.05],[96.24,85.5],[98.13,80.94],[102.69,79.05],[107.25,80.94],[109.13,85.5]]}}},{ty:"st",bm:0,hd:!1,nm:"Stroke",lc:2,lj:1,ml:4,o:{a:0,k:100},w:{a:0,k:1.41},c:{a:0,k:[0,0,0]}},{ty:"fl",bm:0,hd:!1,nm:"Fill",c:{a:0,k:[.749,.0196,.0118]},r:1,o:{a:0,k:100}},{ty:"tr",a:{a:0,k:[102.67750948562706,85.48812093226385]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[102.67750948562706,85.48812093226385]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]},{ty:"tr",a:{a:0,k:[102.68711340973613,85.49292289431838]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[101.93711340973613,85.21292289431838]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]},{ty:"gr",bm:0,hd:!1,nm:"g13931-2",np:4,it:[{ty:"gr",bm:0,hd:!1,nm:"path13914-1",np:3,it:[{ty:"sh",bm:0,hd:!1,nm:"Path 15",d:1,ks:{a:0,k:{c:!1,i:[[0,0],[0,1.71],[-4.96,0],[0,-4.96],[.92,-1.44]],o:[[-.92,-1.44],[0,-4.96],[4.96,0],[0,1.71],[0,0]],v:[[75.31,130.68],[73.9,125.86],[82.88,116.88],[91.86,125.86],[90.45,130.68]]}}},{ty:"st",bm:0,hd:!1,nm:"Stroke",lc:2,lj:1,ml:4,o:{a:0,k:100},w:{a:0,k:1.41},c:{a:0,k:[0,0,0]}},{ty:"fl",bm:0,hd:!1,nm:"Fill",c:{a:0,k:[1,1,1]},r:1,o:{a:0,k:100}},{ty:"tr",a:{a:0,k:[82.87332405329694,123.81589585059405]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[82.87332405329694,123.81589585059405]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]},{ty:"gr",bm:0,hd:!1,nm:"path13918-5",np:3,it:[{ty:"sh",bm:0,hd:!1,nm:"Path 16",d:1,ks:{a:0,k:{c:!1,i:[[0,0],[0,1.64],[-8.18,0],[0,-8.18],[.53,-1.55]],o:[[-.53,-1.55],[0,-8.18],[8.18,0],[0,1.64],[0,0]],v:[[68.88,130.68],[68.07,125.86],[82.88,111.05],[97.69,125.86],[96.88,130.68]]}}},{ty:"st",bm:0,hd:!1,nm:"Stroke",lc:2,lj:1,ml:4,o:{a:0,k:100},w:{a:0,k:1.41},c:{a:0,k:[0,0,0]}},{ty:"fl",bm:0,hd:!1,nm:"Fill",c:{a:0,k:[.349,.749,.6784]},r:1,o:{a:0,k:100}},{ty:"tr",a:{a:0,k:[82.87332405329694,120.90110488350122]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[82.87332405329694,120.90110488350122]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]},{ty:"gr",bm:0,hd:!1,nm:"path13922-0",np:3,it:[{ty:"sh",bm:0,hd:!1,nm:"Path 17",d:1,ks:{a:0,k:{c:!1,i:[[0,0],[0,1.62],[-11.9,0],[0,-11.9],[.36,-1.58]],o:[[-.36,-1.58],[0,-11.9],[11.9,0],[0,1.62],[0,0]],v:[[61.88,130.68],[61.33,125.86],[82.88,104.32],[104.43,125.86],[103.88,130.68]]}}},{ty:"st",bm:0,hd:!1,nm:"Stroke",lc:2,lj:1,ml:4,o:{a:0,k:100},w:{a:0,k:1.41},c:{a:0,k:[0,0,0]}},{ty:"fl",bm:0,hd:!1,nm:"Fill",c:{a:0,k:[.4,.651,.2118]},r:1,o:{a:0,k:100}},{ty:"tr",a:{a:0,k:[82.87332405329694,117.53012752122908]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[82.87332405329694,117.53012752122908]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]},{ty:"gr",bm:0,hd:!1,nm:"path5706-9-2-2-4",np:3,it:[{ty:"sh",bm:0,hd:!1,nm:"Path 18",d:1,ks:{a:0,k:{c:!1,i:[[0,0],[0,1.62],[-15.27,0],[0,-15.27],[0,0],[.28,-1.59]],o:[[-.28,-1.59],[0,-15.27],[15.27,0],[0,0],[0,1.62],[0,0]],v:[[55.65,130.68],[55.22,125.86],[82.88,98.2],[110.54,125.86],[110.54,125.86],[110.11,130.68]]}}},{ty:"st",bm:0,hd:!1,nm:"Stroke",lc:2,lj:1,ml:4,o:{a:0,k:100},w:{a:0,k:1.41},c:{a:0,k:[0,0,0]}},{ty:"fl",bm:0,hd:!1,nm:"Fill",c:{a:0,k:[.949,.4902,.4902]},r:1,o:{a:0,k:100}},{ty:"tr",a:{a:0,k:[82.87332405329694,114.45206984428263]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[82.87332405329694,114.45206984428263]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]},{ty:"tr",a:{a:0,k:[82.87332405329694,114.4760796545552]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[82.87332405329694,114.4760796545552]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]},{ty:"tr",a:{a:0,k:[83.17104570067707,101.55399976584549]},s:{a:0,k:[58.42,58.42]},sk:{a:0,k:0},p:{a:0,k:[-193.43147510166446,151.09784666320695]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]},{ty:"tr",a:{a:0,k:[-193.43001765741099,151.09500848229226]},s:{a:0,k:[62.05,62.05]},sk:{a:0,k:0},p:{a:0,k:[24.35667404357649,24.364452763262335]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:1},{ty:4,nm:"Ellipse 2",sr:1,st:0,op:90,ip:0,hd:!1,ddd:0,bm:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[0,0]},s:{a:0,k:[110.58860990667239,102.92084485785465]},sk:{a:0,k:0},p:{a:0,k:[91.99999833904434,92.00000410170529]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},shapes:[{ty:"el",bm:0,hd:!1,nm:"Ellipse Shape 1",d:1,p:{a:0,k:[0,0]},s:{a:0,k:[155.76450914731709,173.36591162188924]}},{ty:"fl",bm:0,hd:!1,nm:"Fill",c:{a:0,k:[1,1,1]},r:1,o:{a:0,k:100}}],ind:2}]}],mO={nm:sO,ddd:oO,h:iO,w:aO,meta:lO,layers:cO,v:uO,fr:dO,op:hO,ip:fO,assets:pO},gO=p.lazy(()=>S(()=>import("./index.es-C3Wz79fL.js"),__vite__mapDeps([52,2]))),k_=({delay:t=150,label:e="Loading…",overlay:n=!0,minHeight:r="60vh",transparent:s=!1})=>{const[o,i]=p.useState(!1),[a,l]=p.useState(!1);p.useEffect(()=>{const h=window.matchMedia("(prefers-reduced-motion: reduce)");l(h.matches);const f=setTimeout(()=>i(!0),t);return()=>clearTimeout(f)},[t]),p.useEffect(()=>{if(!n)return;const h=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=h}},[n]);const u=s?{}:{background:"radial-gradient(circle at center, white 0%, white 30%, #a5f3fc 100%)"},d=n?`fixed inset-0 z-40 w-screen h-screen flex items-center justify-center${s?" pointer-events-auto":""}`:"w-full flex items-center justify-center";return c.jsxs("div",{role:"status","aria-busy":"true","aria-live":"polite","aria-label":e,className:d,style:n?u:{...u,minHeight:r},children:[o&&c.jsx(p.Suspense,{fallback:c.jsx("span",{className:"sr-only",children:e}),children:c.jsx("div",{className:"w-32 h-32 md:w-40 md:h-40",style:s?{filter:"drop-shadow(0 6px 14px rgba(0,0,0,0.12)) drop-shadow(0 2px 4px rgba(0,0,0,0.08))",willChange:"transform"}:void 0,children:c.jsx(gO,{animationData:mO,loop:!0,autoplay:!a,initialSegment:[0,90],"aria-hidden":"true"})})}),c.jsx("span",{className:"sr-only",children:e})]})},vO=()=>{const{isSwitchingLanguage:t}=Dn();return t?c.jsx(k_,{overlay:!0,transparent:!0}):null},yO=["en","es","bn","zh","ja"],_O=t=>{const e=t.match(/^\/([a-z]{2})(\/|$)/);return e&&yO.includes(e[1])?e[1]:null},xO=t=>t?`/${t}/subscription`:"/subscription",bO=t=>{const e=t.match(/^(?:\/[a-z]{2})?\/story\/([^/?#]+)/);return e?e[1]:null},wO=()=>{const t=gc();p.useEffect(()=>{const{data:{subscription:e}}=ce.auth.onAuthStateChange((n,r)=>{if(n!=="SIGNED_IN")return;const s=sessionStorage.getItem("pendingAuthRedirect");if(!s){sessionStorage.getItem("storyMakerDraft")&&setTimeout(()=>t("/story-maker"),0);return}sessionStorage.removeItem("pendingAuthRedirect");const o=bO(s);if(!o||!r?.user){setTimeout(()=>t(s),0);return}(async()=>{try{const i=_O(s),[a,l,u]=await Promise.all([ce.from("stories").select("access_level").eq("id",o).maybeSingle(),ce.from("profiles").select("user_type").eq("id",r.user.id).maybeSingle(),ce.from("user_payments").select("subscription_status, subscription_end_date").eq("user_id",r.user.id).maybeSingle()]),d=a.data?.access_level??"paid",h=l.data?.user_type??"free",f=u.data?.subscription_status,m=u.data?.subscription_end_date?new Date(u.data.subscription_end_date):null,v=f==="active"&&(!m||m>new Date);let g=!1;h==="admin"||d==="guest"||d==="free"?g=!0:d==="paid"&&(g=h==="paid"||v),g?setTimeout(()=>t(s),0):(sessionStorage.setItem("postSubscriptionRedirect",s),setTimeout(()=>t(xO(i)),0))}catch(i){console.error("[useAuthRedirect] story access check failed:",i),setTimeout(()=>t(s),0)}})()});return()=>e.unsubscribe()},[t])},Gr=()=>{const{t}=Ue("improve-reading");return c.jsx(Pr,{title:t("meta.title"),description:t("meta.description"),keywords:t("meta.keywords",{defaultValue:""})||void 0,canonical:"/improve-reading"})},Kr=()=>{const{t}=Ue("contact");return c.jsx(Pr,{title:t("meta.title"),description:t("meta.description"),keywords:t("meta.keywords",{defaultValue:""})||void 0,canonical:"/contact"})},qr=()=>{const{t}=Ue("subscription");return c.jsx(Pr,{title:t("meta.title"),description:t("meta.description"),keywords:t("meta.keywords",{defaultValue:""})||void 0,canonical:"/subscription"})},Yr=()=>{const{t}=Ue("auth");return c.jsx(Pr,{title:t("meta.login.title"),description:t("meta.login.description"),keywords:t("meta.login.keywords",{defaultValue:""})||void 0,canonical:"/login",noIndex:!0})},Xr=()=>{const{t}=Ue("auth");return c.jsx(Pr,{title:t("meta.signup.title"),description:t("meta.signup.description"),keywords:t("meta.signup.keywords",{defaultValue:""})||void 0,canonical:"/signup"})},Zr=p.lazy(()=>S(()=>import("./StoriesPage-BqoiYBLd.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28]))),xt=p.lazy(()=>S(()=>import("./StoryReaderPage-GEqZ4sDg.js"),__vite__mapDeps([53,1,2,54,55,18,15,56,6,42,57,19,8,9,58,31,13,59,4,60,61,33,38,23,27,28]))),Jr=p.lazy(()=>S(()=>import("./AboutPage-sQFXyS6d.js"),__vite__mapDeps([62,1,2,23,6,47,63,14,27,28]))),Qr=p.lazy(()=>S(()=>import("./ContactPage-DU69VSQ9.js"),__vite__mapDeps([64,1,2,16,65,66,22,19,67,23,6,68,69,27,28]))),es=p.lazy(()=>S(()=>import("./ImproveReadingPage-C7pPn_wz.js"),__vite__mapDeps([70,1,2,4,23,6,31,71,72,27,28]))),ts=p.lazy(()=>S(()=>import("./AuthPages-xtOGdjiU.js"),__vite__mapDeps([73,1,2,16,74,18,67,6,68,75,71,27,28])).then(t=>({default:t.LoginPage}))),ns=p.lazy(()=>S(()=>import("./AuthPages-xtOGdjiU.js"),__vite__mapDeps([73,1,2,16,74,18,67,6,68,75,71,27,28])).then(t=>({default:t.SignupPage}))),rs=p.lazy(()=>S(()=>import("./ResetPasswordPage-DiPPDoiI.js"),__vite__mapDeps([76,1,2,16,6,68,54,69,75,71,27,28]))),ss=p.lazy(()=>S(()=>import("./VerifyEmailPage-w4AnYzEq.js"),__vite__mapDeps([77,1,2,4,6,68,12,69,54,27,28]))),EO=p.lazy(()=>S(()=>import("./NotFound-CIzVx4FF.js"),__vite__mapDeps([78,1,2,23,6,35,25,54,27,28]))),os=p.lazy(()=>S(()=>import("./ProgressPage-CF5eL6AK.js"),__vite__mapDeps([79,1,2,4,59,24,23,6,80,81,82,83,84,60,35,12,85,25,27,28]))),is=p.lazy(()=>S(()=>import("./ReadingCartPage-C9Py8y98.js"),__vite__mapDeps([86,1,2,3,4,5,6,7,8,9,10,11,12,13,14,23,35,27,28]))),as=p.lazy(()=>S(()=>import("./VocabularyNotebookPage-BmK3tsDY.js"),__vite__mapDeps([87,1,2,4,16,88,56,21,22,23,6,9,25,58,89,20,19,27,28]))),SO=p.lazy(()=>S(()=>import("./AdminPage-BWCIY7-q.js"),__vite__mapDeps([90,1,2,15,16,17,18,19,20,4,91,65,21,22,30,88,55,56,6,5,7,25,71,89,92,80,61,93,94,95,96,82,57,74,33,32,97,12,98,45,85,69,66,8,99,100,11,101,34,26,60,83,81,68,72,27,28]))),TO=p.lazy(()=>S(()=>import("./FontManagementPage-I_yLLEHu.js"),__vite__mapDeps([102,1,2,4,16,100,61,89,27,28,6]))),ls=p.lazy(()=>S(()=>import("./TermsPage-Dww7AT1l.js"),__vite__mapDeps([103,1,2,91,23,6,27,28]))),cs=p.lazy(()=>S(()=>import("./PrivacyPage-BUttGnu8.js"),__vite__mapDeps([104,1,2,91,23,6,27,28]))),us=p.lazy(()=>S(()=>import("./RefundPage-Cq7N36Tr.js"),__vite__mapDeps([105,1,2,91,23,6,27,28]))),ds=p.lazy(()=>S(()=>import("./SubscriptionPage-0CZ1RA-S.js"),__vite__mapDeps([106,1,2,60,107,6,80,92,10,23,63,4,96,85,27,28]))),st=p.lazy(()=>S(()=>import("./PaymentStatusPage-KQyaDPRJ.js"),__vite__mapDeps([108,1,2,4,6,69,97,35,27,28]))),bt=p.lazy(()=>S(()=>import("./ThemeInfoPage-CKs6tGkh.js"),__vite__mapDeps([109,1,2,4,91,23,6,31,14,27,28]))),hs=p.lazy(()=>S(()=>import("./BlogPage-DH8cBDRN.js"),__vite__mapDeps([110,1,2,16,111,4,12,98,6,23,25,27,28]))),wt=p.lazy(()=>S(()=>import("./BlogPostPage-CGVheEF0.js"),__vite__mapDeps([112,1,2,4,24,101,26,31,6,98,23,54,85,12,27,28]))),fs=p.lazy(()=>S(()=>import("./NewsletterPage-DF1frZkU.js"),__vite__mapDeps([113,1,2,16,111,4,12,98,23,6,25,27,28]))),ps=p.lazy(()=>S(()=>import("./StoryMakerPage-D_AS2NGd.js"),__vite__mapDeps([114,1,2,107,23,6,72,7,82,99,4,16,17,18,19,20,33,45,96,115,32,94,27,28]))),ms=p.lazy(()=>S(()=>import("./ResearchPage-BTDlGCdT.js"),__vite__mapDeps([29,1,2,23,6,4,30,31,32,33,34,35,27,28]))),gs=p.lazy(()=>S(()=>import("./TextCheckerPage-CvRawyH7.js"),__vite__mapDeps([116,1,2,107,65,4,17,18,19,20,6,57,25,34,83,84,11,24,95,23,31,28,94,27]))),kO=p.lazy(()=>S(()=>import("./SitemapRoute-BLZu2rtc.js"),__vite__mapDeps([117,1,2,93,27,28,6]))),PO=new L_({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1,staleTime:5*60*1e3}}}),CO=()=>(wO(),null),jO=()=>{const{targetElement:t,onTargetReached:e}=Qg();return c.jsx(cA,{targetElement:t,onTargetReached:e})},RO=()=>c.jsx(k_,{}),AO=({children:t})=>{const e=io();return c.jsx(Tp,{children:t},e.pathname)};function IO(){return c.jsx(H_,{children:c.jsx(F_,{client:PO,children:c.jsx(xE,{children:c.jsx(V_,{children:c.jsx(fA,{children:c.jsx(GT,{children:c.jsx(ZT,{children:c.jsxs(JT,{children:[c.jsx(nO,{}),c.jsx(rO,{}),c.jsx(CO,{}),c.jsx(jO,{}),c.jsx(vO,{}),c.jsxs("div",{className:"min-h-screen flex flex-col",children:[c.jsx(oM,{}),c.jsx("main",{className:"flex-1",children:c.jsx(AO,{children:c.jsx(p.Suspense,{fallback:c.jsx(RO,{}),children:c.jsxs(B_,{children:[c.jsx(C,{path:"/",element:c.jsx(Wr,{})}),c.jsx(C,{path:"/stories",element:c.jsx(Zr,{})}),c.jsx(C,{path:"/story-maker",element:c.jsx(ps,{})}),c.jsx(C,{path:"/stories/:id",element:c.jsx(xt,{})}),c.jsx(C,{path:"/story/:id",element:c.jsx(xt,{})}),c.jsx(C,{path:"/improve-reading",element:c.jsxs(c.Fragment,{children:[c.jsx(Gr,{}),c.jsx(es,{})]})}),c.jsx(C,{path:"/themes",element:c.jsx(bt,{})}),c.jsx(C,{path:"/themes/:themeSlug",element:c.jsx(bt,{})}),c.jsx(C,{path:"/about",element:c.jsx(Jr,{})}),c.jsx(C,{path:"/contact",element:c.jsxs(c.Fragment,{children:[c.jsx(Kr,{}),c.jsx(Qr,{})]})}),c.jsx(C,{path:"/blog",element:c.jsx(hs,{})}),c.jsx(C,{path:"/blog/newsletter",element:c.jsx(fs,{})}),c.jsx(C,{path:"/blog/newsletter/:slug",element:c.jsx(wt,{})}),c.jsx(C,{path:"/blog/:slug",element:c.jsx(wt,{})}),c.jsx(C,{path:"/research",element:c.jsx(ms,{})}),c.jsx(C,{path:"/login",element:c.jsxs(c.Fragment,{children:[c.jsx(Yr,{}),c.jsx(ts,{})]})}),c.jsx(C,{path:"/signup",element:c.jsxs(c.Fragment,{children:[c.jsx(Xr,{}),c.jsx(ns,{})]})}),c.jsx(C,{path:"/reset-password",element:c.jsx(rs,{})}),c.jsx(C,{path:"/verify-email",element:c.jsx(ss,{})}),c.jsx(C,{path:"/progress",element:c.jsx(os,{})}),c.jsx(C,{path:"/reading-cart",element:c.jsx(is,{})}),c.jsx(C,{path:"/vocabulary",element:c.jsx(as,{})}),c.jsx(C,{path:"/admin",element:c.jsx(SO,{})}),c.jsx(C,{path:"/admin/fonts",element:c.jsx(TO,{})}),c.jsx(C,{path:"/terms",element:c.jsx(ls,{})}),c.jsx(C,{path:"/privacy",element:c.jsx(cs,{})}),c.jsx(C,{path:"/refund",element:c.jsx(us,{})}),c.jsx(C,{path:"/subscription",element:c.jsxs(c.Fragment,{children:[c.jsx(qr,{}),c.jsx(ds,{})]})}),c.jsx(C,{path:"/payment/success",element:c.jsx(st,{})}),c.jsx(C,{path:"/payment/cancel",element:c.jsx(st,{})}),c.jsx(C,{path:"/stripe/success",element:c.jsx(st,{})}),c.jsx(C,{path:"/stripe/failure",element:c.jsx(st,{})}),c.jsx(C,{path:"/es",element:c.jsx(Wr,{})}),c.jsx(C,{path:"/es/stories",element:c.jsx(Zr,{})}),c.jsx(C,{path:"/es/story-maker",element:c.jsx(ps,{})}),c.jsx(C,{path:"/es/stories/:id",element:c.jsx(xt,{})}),c.jsx(C,{path:"/es/story/:id",element:c.jsx(xt,{})}),c.jsx(C,{path:"/es/improve-reading",element:c.jsxs(c.Fragment,{children:[c.jsx(Gr,{}),c.jsx(es,{})]})}),c.jsx(C,{path:"/es/themes",element:c.jsx(bt,{})}),c.jsx(C,{path:"/es/themes/:themeSlug",element:c.jsx(bt,{})}),c.jsx(C,{path:"/es/about",element:c.jsx(Jr,{})}),c.jsx(C,{path:"/es/contact",element:c.jsxs(c.Fragment,{children:[c.jsx(Kr,{}),c.jsx(Qr,{})]})}),c.jsx(C,{path:"/es/blog",element:c.jsx(hs,{})}),c.jsx(C,{path:"/es/blog/newsletter",element:c.jsx(fs,{})}),c.jsx(C,{path:"/es/blog/newsletter/:slug",element:c.jsx(wt,{})}),c.jsx(C,{path:"/es/blog/:slug",element:c.jsx(wt,{})}),c.jsx(C,{path:"/es/research",element:c.jsx(ms,{})}),c.jsx(C,{path:"/es/login",element:c.jsxs(c.Fragment,{children:[c.jsx(Yr,{}),c.jsx(ts,{})]})}),c.jsx(C,{path:"/es/signup",element:c.jsxs(c.Fragment,{children:[c.jsx(Xr,{}),c.jsx(ns,{})]})}),c.jsx(C,{path:"/es/reset-password",element:c.jsx(rs,{})}),c.jsx(C,{path:"/es/verify-email",element:c.jsx(ss,{})}),c.jsx(C,{path:"/es/progress",element:c.jsx(os,{})}),c.jsx(C,{path:"/es/reading-cart",element:c.jsx(is,{})}),c.jsx(C,{path:"/es/vocabulary",element:c.jsx(as,{})}),c.jsx(C,{path:"/es/terms",element:c.jsx(ls,{})}),c.jsx(C,{path:"/es/privacy",element:c.jsx(cs,{})}),c.jsx(C,{path:"/es/refund",element:c.jsx(us,{})}),c.jsx(C,{path:"/es/subscription",element:c.jsxs(c.Fragment,{children:[c.jsx(qr,{}),c.jsx(ds,{})]})}),c.jsx(C,{path:"/es/stripe/success",element:c.jsx(st,{})}),c.jsx(C,{path:"/es/stripe/failure",element:c.jsx(st,{})}),c.jsx(C,{path:"/bn",element:c.jsx(Wr,{})}),c.jsx(C,{path:"/bn/stories",element:c.jsx(Zr,{})}),c.jsx(C,{path:"/bn/story-maker",element:c.jsx(ps,{})}),c.jsx(C,{path:"/bn/stories/:id",element:c.jsx(xt,{})}),c.jsx(C,{path:"/bn/story/:id",element:c.jsx(xt,{})}),c.jsx(C,{path:"/bn/improve-reading",element:c.jsxs(c.Fragment,{children:[c.jsx(Gr,{}),c.jsx(es,{})]})}),c.jsx(C,{path:"/bn/themes",element:c.jsx(bt,{})}),c.jsx(C,{path:"/bn/themes/:themeSlug",element:c.jsx(bt,{})}),c.jsx(C,{path:"/bn/about",element:c.jsx(Jr,{})}),c.jsx(C,{path:"/bn/contact",element:c.jsxs(c.Fragment,{children:[c.jsx(Kr,{}),c.jsx(Qr,{})]})}),c.jsx(C,{path:"/bn/blog",element:c.jsx(hs,{})}),c.jsx(C,{path:"/bn/blog/newsletter",element:c.jsx(fs,{})}),c.jsx(C,{path:"/bn/blog/newsletter/:slug",element:c.jsx(wt,{})}),c.jsx(C,{path:"/bn/blog/:slug",element:c.jsx(wt,{})}),c.jsx(C,{path:"/bn/research",element:c.jsx(ms,{})}),c.jsx(C,{path:"/bn/login",element:c.jsxs(c.Fragment,{children:[c.jsx(Yr,{}),c.jsx(ts,{})]})}),c.jsx(C,{path:"/bn/signup",element:c.jsxs(c.Fragment,{children:[c.jsx(Xr,{}),c.jsx(ns,{})]})}),c.jsx(C,{path:"/bn/reset-password",element:c.jsx(rs,{})}),c.jsx(C,{path:"/bn/verify-email",element:c.jsx(ss,{})}),c.jsx(C,{path:"/bn/progress",element:c.jsx(os,{})}),c.jsx(C,{path:"/bn/reading-cart",element:c.jsx(is,{})}),c.jsx(C,{path:"/bn/vocabulary",element:c.jsx(as,{})}),c.jsx(C,{path:"/bn/terms",element:c.jsx(ls,{})}),c.jsx(C,{path:"/bn/privacy",element:c.jsx(cs,{})}),c.jsx(C,{path:"/bn/refund",element:c.jsx(us,{})}),c.jsx(C,{path:"/bn/subscription",element:c.jsxs(c.Fragment,{children:[c.jsx(qr,{}),c.jsx(ds,{})]})}),c.jsx(C,{path:"/bn/stripe/success",element:c.jsx(st,{})}),c.jsx(C,{path:"/bn/stripe/failure",element:c.jsx(st,{})}),c.jsx(C,{path:"/zh",element:c.jsx(Wr,{})}),c.jsx(C,{path:"/zh/stories",element:c.jsx(Zr,{})}),c.jsx(C,{path:"/zh/story-maker",element:c.jsx(ps,{})}),c.jsx(C,{path:"/zh/stories/:id",element:c.jsx(xt,{})}),c.jsx(C,{path:"/zh/story/:id",element:c.jsx(xt,{})}),c.jsx(C,{path:"/zh/improve-reading",element:c.jsxs(c.Fragment,{children:[c.jsx(Gr,{}),c.jsx(es,{})]})}),c.jsx(C,{path:"/zh/themes",element:c.jsx(bt,{})}),c.jsx(C,{path:"/zh/themes/:themeSlug",element:c.jsx(bt,{})}),c.jsx(C,{path:"/zh/about",element:c.jsx(Jr,{})}),c.jsx(C,{path:"/zh/contact",element:c.jsxs(c.Fragment,{children:[c.jsx(Kr,{}),c.jsx(Qr,{})]})}),c.jsx(C,{path:"/zh/blog",element:c.jsx(hs,{})}),c.jsx(C,{path:"/zh/blog/newsletter",element:c.jsx(fs,{})}),c.jsx(C,{path:"/zh/blog/newsletter/:slug",element:c.jsx(wt,{})}),c.jsx(C,{path:"/zh/blog/:slug",element:c.jsx(wt,{})}),c.jsx(C,{path:"/zh/research",element:c.jsx(ms,{})}),c.jsx(C,{path:"/zh/login",element:c.jsxs(c.Fragment,{children:[c.jsx(Yr,{}),c.jsx(ts,{})]})}),c.jsx(C,{path:"/zh/signup",element:c.jsxs(c.Fragment,{children:[c.jsx(Xr,{}),c.jsx(ns,{})]})}),c.jsx(C,{path:"/zh/reset-password",element:c.jsx(rs,{})}),c.jsx(C,{path:"/zh/verify-email",element:c.jsx(ss,{})}),c.jsx(C,{path:"/zh/progress",element:c.jsx(os,{})}),c.jsx(C,{path:"/zh/reading-cart",element:c.jsx(is,{})}),c.jsx(C,{path:"/zh/vocabulary",element:c.jsx(as,{})}),c.jsx(C,{path:"/zh/terms",element:c.jsx(ls,{})}),c.jsx(C,{path:"/zh/privacy",element:c.jsx(cs,{})}),c.jsx(C,{path:"/zh/refund",element:c.jsx(us,{})}),c.jsx(C,{path:"/zh/subscription",element:c.jsxs(c.Fragment,{children:[c.jsx(qr,{}),c.jsx(ds,{})]})}),c.jsx(C,{path:"/zh/stripe/success",element:c.jsx(st,{})}),c.jsx(C,{path:"/zh/stripe/failure",element:c.jsx(st,{})}),c.jsx(C,{path:"/ja",element:c.jsx(Wr,{})}),c.jsx(C,{path:"/ja/stories",element:c.jsx(Zr,{})}),c.jsx(C,{path:"/ja/story-maker",element:c.jsx(ps,{})}),c.jsx(C,{path:"/ja/stories/:id",element:c.jsx(xt,{})}),c.jsx(C,{path:"/ja/story/:id",element:c.jsx(xt,{})}),c.jsx(C,{path:"/ja/improve-reading",element:c.jsxs(c.Fragment,{children:[c.jsx(Gr,{}),c.jsx(es,{})]})}),c.jsx(C,{path:"/ja/themes",element:c.jsx(bt,{})}),c.jsx(C,{path:"/ja/themes/:themeSlug",element:c.jsx(bt,{})}),c.jsx(C,{path:"/ja/about",element:c.jsx(Jr,{})}),c.jsx(C,{path:"/ja/contact",element:c.jsxs(c.Fragment,{children:[c.jsx(Kr,{}),c.jsx(Qr,{})]})}),c.jsx(C,{path:"/ja/blog",element:c.jsx(hs,{})}),c.jsx(C,{path:"/ja/blog/newsletter",element:c.jsx(fs,{})}),c.jsx(C,{path:"/ja/blog/newsletter/:slug",element:c.jsx(wt,{})}),c.jsx(C,{path:"/ja/blog/:slug",element:c.jsx(wt,{})}),c.jsx(C,{path:"/ja/research",element:c.jsx(ms,{})}),c.jsx(C,{path:"/ja/login",element:c.jsxs(c.Fragment,{children:[c.jsx(Yr,{}),c.jsx(ts,{})]})}),c.jsx(C,{path:"/ja/signup",element:c.jsxs(c.Fragment,{children:[c.jsx(Xr,{}),c.jsx(ns,{})]})}),c.jsx(C,{path:"/ja/reset-password",element:c.jsx(rs,{})}),c.jsx(C,{path:"/ja/verify-email",element:c.jsx(ss,{})}),c.jsx(C,{path:"/ja/progress",element:c.jsx(os,{})}),c.jsx(C,{path:"/ja/reading-cart",element:c.jsx(is,{})}),c.jsx(C,{path:"/ja/vocabulary",element:c.jsx(as,{})}),c.jsx(C,{path:"/ja/terms",element:c.jsx(ls,{})}),c.jsx(C,{path:"/ja/privacy",element:c.jsx(cs,{})}),c.jsx(C,{path:"/ja/refund",element:c.jsx(us,{})}),c.jsx(C,{path:"/ja/subscription",element:c.jsxs(c.Fragment,{children:[c.jsx(qr,{}),c.jsx(ds,{})]})}),c.jsx(C,{path:"/ja/stripe/success",element:c.jsx(st,{})}),c.jsx(C,{path:"/ja/stripe/failure",element:c.jsx(st,{})}),c.jsx(C,{path:"/text-checker",element:c.jsx(gs,{})}),c.jsx(C,{path:"/es/text-checker",element:c.jsx(gs,{})}),c.jsx(C,{path:"/bn/text-checker",element:c.jsx(gs,{})}),c.jsx(C,{path:"/zh/text-checker",element:c.jsx(gs,{})}),c.jsx(C,{path:"/ja/text-checker",element:c.jsx(gs,{})}),c.jsx(C,{path:"/sitemap.xml",element:c.jsx(kO,{})}),c.jsx(C,{path:"*",element:c.jsx(EO,{})})]})})})}),c.jsx(aM,{})]}),c.jsx(mw,{}),c.jsx(Hw,{})]})})})})})})})})}const xp="ss_build_id",MO=60*1e3,OO=2e3,DO="ss-build";let xr=null,nl=null,$s=null;const oo=()=>{try{const t=window.location.pathname;return t.includes("/story/")||t.includes("/story-maker")}catch{return!1}},P_=()=>{try{return"1778326417597-nlzcju"}catch{return"dev"}};async function NO(){try{const t=P_();if(localStorage.getItem(xp)===t)return;if("caches"in window){const n=await caches.keys();await Promise.all(n.map(r=>caches.delete(r)))}if("serviceWorker"in navigator){const n=await navigator.serviceWorker.getRegistrations();await Promise.all(n.map(r=>r.update().catch(()=>{})))}localStorage.setItem(xp,t)}catch{}}function C_(t,e=!1){if(!(t===P_()||t===xr)){if(xr=t,console.info("[build-version] new build detected:",t),!e&&$s)try{$s.postMessage({type:"stale",buildId:t})}catch{}typeof document<"u"&&document.visibilityState==="hidden"&&!oo()&&window.location.reload()}}async function Cs(){try{const t=await fetch(`/version.json?t=${Date.now()}`,{cache:"no-store",headers:{"cache-control":"no-cache"}});if(!t.ok)return;const n=(await t.json())?.buildId;if(!n)return;C_(n)}catch{}}function LO(){if(typeof window>"u")return;const t=window;if(t.__ssNavReloadInstalled)return;t.__ssNavReloadInstalled=!0;const e=a=>{if(!xr||oo())return!1;const l=a?String(a):window.location.pathname+window.location.search;return window.location.href=l,!0},n=history.pushState.bind(history),r=history.replaceState.bind(history);history.pushState=function(a,l,u){if(!e(u))return n(a,l,u??null)},history.replaceState=function(a,l,u){if(!e(u))return r(a,l,u??null)},window.addEventListener("popstate",()=>{xr&&!oo()&&window.location.reload()});const s=()=>{Cs()},o=history.pushState,i=history.replaceState;history.pushState=function(...a){const l=o.apply(this,a);return s(),l},history.replaceState=function(...a){const l=i.apply(this,a);return s(),l}}function FO(){if(!(typeof window>"u")){LO();try{$s=new BroadcastChannel(DO),$s.onmessage=t=>{const e=t?.data?.buildId;typeof e=="string"&&C_(e,!0)}}catch{$s=null}setTimeout(()=>void Cs(),OO),nl&&clearInterval(nl),nl=setInterval(()=>void Cs(),MO),document.addEventListener("visibilitychange",()=>{if(document.visibilityState==="visible"){if(xr&&!oo()){window.location.reload();return}Cs()}}),window.addEventListener("focus",()=>{if(xr&&!oo()){window.location.reload();return}Cs()})}}const Wu=document.getElementById("root");if(!Wu)throw new Error("Root element not found");Wu.innerHTML="";NO().finally(()=>{FO()});const $O=Sp(Wu),VO=zl(window.location.pathname),BO=()=>$O.render(c.jsx(D.StrictMode,{children:c.jsx(Tp,{children:c.jsx(IO,{})})})),zO=new Promise(t=>setTimeout(t,1500));Promise.race([Ep.loadNamespaces(VO),zO]).finally(BO);const bp=()=>{[M0,O0].forEach(t=>{const e=new Image;e.decoding="async",e.src=t})};typeof window.requestIdleCallback=="function"?window.requestIdleCallback(bp,{timeout:3e3}):setTimeout(bp,1500);export{IM as $,rk as A,un as B,_e as C,Gy as D,rM as E,fp as F,VM as G,ab as H,wc as I,Pt as J,id as K,ld as L,xE as M,ZO as N,JO as O,le as P,bE as Q,Hu as R,Pr as S,cD as T,Rb as U,Jp as V,uD as W,Qp as X,hD as Y,Vi as Z,OM as _,kp as a,Me as a$,dD as a0,cb as a1,jn as a2,Qx as a3,X_ as a4,ud as a5,mA as a6,pD as a7,pt as a8,Ve as a9,HI as aA,WI as aB,iD as aC,aD,Pp as aE,_D as aF,yD as aG,SE as aH,cM as aI,uM as aJ,QO as aK,eD as aL,tD as aM,eO as aN,On as aO,Li as aP,lA as aQ,R0 as aR,Ai as aS,tO as aT,T_ as aU,ct as aV,DM as aW,mC as aX,su as aY,be as aZ,Yc as a_,Dt as aa,tb as ab,Ib as ac,q1 as ad,Hi as ae,jm as af,W0 as ag,ju as ah,N0 as ai,Cu as aj,ao as ak,Rm as al,Am as am,lo as an,Cm as ao,$0 as ap,NA as aq,LA as ar,Zx as as,Ir as at,u_ as au,d_ as av,KI as aw,h_ as ax,f_ as ay,GI as az,Dn as b,n0 as b0,dk as b1,vC as b2,vr as b3,eu as b4,At as b5,wR as b6,Te as b7,Tj as b8,TR as b9,SR as ba,xR as bb,Sj as bc,s0 as bd,Pi as be,ak as bf,A0 as bg,pA as c,fD as d,pe as e,Ky as f,mc as g,Fu as h,ln as i,ad as j,mM as k,mD as l,fe as m,gD as n,vD as o,CM as p,vc as q,br as r,ce as s,gM as t,Wc as u,co as v,Pe as w,D0 as x,W as y,Pn as z};
//# sourceMappingURL=index-HnpjXQh_.js.map