PageSourceSearch

https://houseboats.com/assets/index-BCzxcVBD.js

js houseboats.com collected 2026-09-25 04:46:53 UTC 461,518 bytes, 75 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/HouseboatDetail-BBUxyNSq.js","assets/vendor-query-BarZjiPZ.js","assets/vendor-react-zMtsgP4v.js","assets/vendor-ui-ytEjRW8e.js","assets/GalleryLightbox-BMQ1VMpF.js","assets/ResponsiveImage-BIjn1A-7.js","assets/PetsAllowedCallout-BZ3tebC8.js","assets/index-BIU02ScU.js","assets/accordion-Z5E4ST3E.js","assets/houseboats-CfABNMQY.js","assets/escapade-houseboat-hero-profile-CDY0aZ48.js","assets/escapade-houseboat-exterior-shasta-lake-01-2ZhoS4VH.js","assets/WhyShastaLake-CflgmY2L.js","assets/SocialProof-HOBHMmlw.js","assets/skeleton-C0NmBAhf.js","assets/CrossSell-Dmhpzx5N.js","assets/small-boat-rentals-hero-shasta-lake-z6oqWhHX.js","assets/SEOContent-D0qOVDqR.js","assets/ResortLocations-5-v0-mFx.js","assets/HomepageFAQ-CnxM68xQ.js","assets/WhyChooseOurFleet-B0RlqrnQ.js","assets/BoatieChat-DLW-UGZ0.js","assets/CompareHouseboats-RLEbsLc_.js","assets/SEO-BmnZDrl7.js","assets/houseboatCompareCards-CfR2_P7h.js","assets/EndOfSummerSale-CBVzE0Tf.js","assets/breadcrumb-CrS2uPxn.js","assets/Pricing-
1D4zeJcg-.js","assets/EmbedHero-DuNzbxGV.js","assets/NotFound-CwbeFM_r.js","assets/Privacy-C6p9vBUw.js","assets/separator-CpCLCWl6.js","assets/Terms-Da4B9BWi.js","assets/FAQ-D0CSW6Rz.js","assets/ContactUs-BiUWzufH.js","assets/card-CyxjJ_U8.js","assets/MarinaStore-B6SnIEe0.js","assets/BoatSlipsStorage-CM1HAfRh.js","assets/JonesValleyBoatSlips-B6dhwL3M.js","assets/table-BO0I2wxE.js","assets/SilverthornBoatSlips-DVq5H5aW.js","assets/SugarloafBoatSlips-CDRlPb-6.js","assets/LakeShasta-CYdWaBm0.js","assets/ShastaInfoNav-Cw5WqtEI.js","assets/WeatherReports-Cydd2512.js","assets/BookmarkPrompt-D1YMvDRE.js","assets/LiveWeatherCam-DLZXVPU3.js","assets/LiveCamCounter-g7bSUseQ.js","assets/LakeLevels-BfcPH96P.js","assets/CartesianChart-C4jhCPTo.js","assets/LineChart-ik1E3-3b.js","assets/getRadiusAndStrokeWidthFromDot-Bca8URxh.js","assets/ErrorBarContext-DmrvlWgW.js","assets/CartesianGrid-CgaNu3k3.js","assets/MapsLocations-CddYq0Z7.js","assets/Fishing-Bkaah-Oa.js","assets/badge-DT6RwNQy.js","assets/JonesValleyBoatRentals-Dn7Lwf0k.js","assets/centurion-t5-card-jones-valley-K4Vpj59k.js","assets/patio-boat-30-card-jones-valley-Rg6jHZaY.js","assets/collapsible-BAVQiP3G.js","assets/kayak-shasta-lake-hero-CRAKsBpo.js","assets/SilverthornBoatRentals-BthQM_La.js","assets/party-cruiser-i-silverthorn-C1mBKLFt.js","assets/JonesValleyResort-DVwvdBME.js","assets/SilverthornResort-Amv0f7NA.js","assets/JonesValleyHub-DUpX89DZ.js","assets/SilverthornHub-iDy5LDge.js","assets/Kayak-DA-xgf67.js","assets/RelatedBoats-Cw6FQ8oD.js","assets/kayak-shasta-lake-sunset-golden-hour-vCj3TEO2.js","assets/StandUpPaddleBoard-B9o53TFg.js","assets/WaterToys-CFkU1AwQ.js","assets/JetSkis-BnbOczkA.js","assets/AxisT220R-D
1B2vD9k2.js","assets/AirWarrior-CExA_3Vo.js","assets/TahoeDeckBoat-CPDwd-Pp.js","assets/CenturionT5-D2FRmsdf.js","assets/SupercruiserPartyBoat-DO7eipDH.js","assets/PartyCruiserII-CHGEU2PJ.js","assets/PatioBoat30-Ct7kOFcu.js","assets/DeluxePatioBoat-CJzE6Hkw.js","assets/BenningtonPontoon-DyouRbQm.js","assets/FishingBoat-CY73bCuT.js","assets/GatheringYourGroup-DnJI29yh.js","assets/WhatToBring-BiCS0jgt.js","assets/GroupEvents-7pm4O2wq.js","assets/PetPolicy-Bgnlfjef.js","assets/MattressSizes-D55W0Kmy.js","assets/PriorToArrival-a7zFNmng.js","assets/GuestInformation-ClgrkTDW.js","assets/JetSkisSilverthorn-Ch9tOpCL.js","assets/RelatedBoatsSilverthorn-CbysuV5D.js","assets/AxisT220RSilverthorn-B0otuXKO.js","assets/CenturionT5Silverthorn-BcdVQvu1.js","assets/TahoeDeckBoatSilverthorn-Ck39rqtH.js","assets/PatioBoatSilverthorn-DkmBnBeO.js","assets/SunTrackerPontoonSilverthorn-BTKex2L1.js","assets/PartyCruiserISilverthorn-XJki4NtS.js","assets/FishingBoatSilverthorn-C7gYxK5Z.js","assets/KayakSilverthorn-BLn4Guex.js","assets/StandUpPaddleBoardSilverthorn-rxPslUrF.js","assets/AccessibilityStatement-C_UKB2fE.js","assets/AdminLogin-C6zEuCiK.js","assets/AdminLayout-t0zoVzlR.js","assets/AdminOverview-B3O7GFsO.js","assets/AdminBoatie-CZEyQX0p.js","assets/BarChart-DJfLfLkg.js","assets/tooltipContext-C9lmm0kD.js","assets/graphicalItemSelectors-yZdNj2fV.js","assets/PieChart-Ca7FbARi.js","assets/AdminBoatieCost-fijCWJGW.js","assets/AdminBoatieAbuse-B5Ce99Z5.js","assets/AdminBoatieStaff-BzpSCevS.js","assets/DateRangePicker-CBlV2Mc8.js","assets/AdminTraffic-BJrUsKXL.js","assets/KpiTile-CfUV3sV1.js","assets/AdminSEO-AmlvUMeb.js"])))=>i.map(i=>d[i]);
2import{j as c,Q as Lc,a as $c}from"./vendor-query-BarZjiPZ.js";import{a as Ut,r as f,R as T,v as qi,b as Bt,u as zi,c as Ft,L as ee,B as Dc,d as Mc,e as C,N as Ln}from"./vendor-react-zMtsgP4v.js";import{t as Uc,c as Bc,X as gr,a as Ki,A as Fc,C as Sr,P as tn,M as Hc,S as rn,H as Vc,b as oo,d as Ji,T as Wc,R as qc,e as zc,f as Kc,G as Jc,g as Gi,h as $n,i as Yi,j as Gc,k as Yc,l as io,Z as Xc,L as Qc,U as Xi,B as Zc,m as eu,n as tu,o as ru,p as nu,q as su,W as ao,r as ou,s as iu,F as au,u as lu,v as is,w as lo,x as cu,y as uu,I as du,z as co,D as hu,E as fu,J as pu,K as mu,V as gu,N as Qi,O as vu,Q as yu,Y as bu,_ as wu}from"./vendor-ui-ytEjRW8e.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"]'))n(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"&&n(i)}).observe(document,{childList:!0,subtree:!0});function r(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 n(s){if(s.ep)return;s.ep=!0;const o=r(s);fetch(s.href,o)}})();var Zi,uo=Ut;Zi=uo.createRoot,uo.hydrateRoot;function ea(t){const e=[];return f.Children.forEach(t,r=>{if(f.isValidElement(r)){if(r.type===f.Fragment){ea(r.props.children).forEach(n=>e.push(n));return}typeof r.type=="string"&&e.push(r)}}),e}function xu(t){const e=t.props;if(t.type==="meta"){if(typeof e.name=="string")return`meta[name="${CSS.escape(e.name)}"]`;if(typeof e.property=="string")return`meta[property="${CSS.escape(e.property)}"]`}return t.type==="link"&&e.rel==="canonical"?'link[rel="canonical"]':null}function _u(t,e){Object.entries(e).forEach(([r,n])=>{if(r==="children"||n===void 0||n===null||n===!1)return;const s=r==="charSet"?"charset":r==="httpEquiv"?"http-equiv":r;t.setAttribute(s,n===!0?"":String(n))})}function Eu({children:t}){const e=ea(t);return f.useLayoutEffect(()=>{const r=[];return e.forEach(n=>{if(n.type==="title"){document.title=f.Children.toArray(n.props.children).join("");return}if(!["meta","link"].includes(n.type))return;const s=xu(n);s&&document.head.querySelectorAll(s).forEach(i=>i.remove());const o=document.createElement(n.type);_u(o,n.props),o.dataset.routeHead="true",document.head.appendChild(o),r.push(o)}),()=>{r.forEach(n=>n.remove())}},[t]),null}function Su({children:t}){return c.jsx(c.Fragment,{children:t})}const ku="modulepreload",Tu=function(t){return"/"+t},ho={},R=function(e,r,n){let s=Promise.resolve();if(r&&r.length>0){document.getElementsByTagName("link");const i=document.querySelector("meta[property=csp-nonce]"),a=(i==null?void 0:i.nonce)||(i==null?void 0:i.getAttribute("nonce"));s=Promise.allSettled(r.map(l=>{if(l=Tu(l),l in ho)return;ho[l]=!0;const u=l.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${d}`))return;const h=document.createElement("link");
2if(h.rel=u?"stylesheet":ku,u||(h.as="script"),h.crossOrigin="",h.href=l,a&&h.setAttribute("nonce",a),document.head.appendChild(h),u)return new Promise((m,p)=>{h.addEventListener("load",m),h.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${l}`)))})}))}function o(i){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=i,window.dispatchEvent(a),!a.defaultPrevented)throw i}return s.then(i=>{for(const a of i||[])a.status==="rejected"&&o(a.reason);return e().catch(o)})},fo="lovable:chunk-reloaded",po=t=>{const e=t instanceof Error?t.message:String(t);return/Loading chunk|Loading CSS chunk|Failed to fetch dynamically imported module|Importing a module script failed|dynamically imported module|ChunkLoadError/i.test(e)},Ru=t=>new Promise(e=>setTimeout(e,t));function j(t){return f.lazy(async()=>{const e=[0,350,900];let r;for(const n of e)try{return n&&await Ru(n),await t()}catch(s){if(r=s,!po(s))throw s}if(typeof window<"u"&&po(r)&&!(window.sessionStorage.getItem(fo)==="1"))return window.sessionStorage.setItem(fo,"1"),window.location.reload(),new Promise(()=>{});throw r})}function Au(t){try{t().catch(()=>{})}catch{}}const Cu=1,ju=1e6;let Dn=0;function Pu(){return Dn=(Dn+1)%Number.MAX_SAFE_INTEGER,Dn.toString()}const Mn=new Map,mo=t=>{if(Mn.has(t))return;const e=setTimeout(()=>{Mn.delete(t),Zt({type:"REMOVE_TOAST",toastId:t})},ju);Mn.set(t,e)},Ou=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,Cu)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(r=>r.id===e.toast.id?{...r,...e.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=e;return r?mo(r):t.toasts.forEach(n=>{mo(n.id)}),{...t,toasts:t.toasts.map(n=>
2n.id===r||r===void 0?{...n,open:!1}:n)}}case"REMOVE_TOAST":return e.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(r=>r.id!==e.toastId)}}},Kr=[];let Jr={toasts:[]};function Zt(t){Jr=Ou(Jr,t),Kr.forEach(e=>{e(Jr)})}function Nu({...t}){const e=Pu(),r=s=>Zt({type:"UPDATE_TOAST",toast:{...s,id:e}}),n=()=>Zt({type:"DISMISS_TOAST",toastId:e});return Zt({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:s=>{s||n()}}}),{id:e,dismiss:n,update:r}}function Iu(){const[t,e]=f.useState(Jr);return f.useEffect(()=>(Kr.push(e),()=>{const r=Kr.indexOf(e);r>-1&&Kr.splice(r,1)}),[t]),{...t,toast:Nu,dismiss:r=>Zt({type:"DISMISS_TOAST",toastId:r})}}function he(t,e,{checkForDefaultPrevented:r=!0}={}){return function(s){if(t==null||t(s),r===!1||!s.defaultPrevented)return e==null?void 0:e(s)}}function go(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function js(...t){return e=>{let r=!1;const n=t.map(s=>{const o=go(s,e);return!r&&typeof o=="function"&&(r=!0),o});if(r)return()=>{for(let s=0;s<n.length;s++){const o=n[s];typeof o=="function"?o():go(t[s],null)}}}}function ft(...t){return f.useCallback(js(...t),t)}function ta(t,e=[]){let r=[];function n(o,i){const a=f.createContext(i),l=r.length;r=[...r,i];const u=h=>{var x;const{scope:m,children:p,...v}=h,g=((x=m==null?void 0:m[t])==null?void 0:x[l])||a,y=f.useMemo(()=>v,Object.values(v));return c.jsx(g.Provider,{value:y,children:p})};u.displayName=o+"Provider";function d(h,m){var g;const p=((g=m==null?void 0:m[t])==null?void 0:g[l])||a,v=f.useContext(p);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=r.map(i=>f.createContext(i));return function(a){const l=(a==null?void 0:a[t])||o;return f.useMemo(()=>({[`__scope${t}`]:{...a,[t]:l}}),[a,l])}};return s.scopeName=t,[n,Lu(s,...e)]}function Lu(...t){const e=t[0];if(t.length===1)return e;const r=()=>{const n=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const i=n.reduce((a,{useScope:l,scopeName:u})=>{const h=l(o)[`__scope${u}`];return{...a,...h}},{});return f.useMemo(()=>({[`__scope${e.scopeName}`]:i}),[i])}};return r.scopeName=e.scopeName,r}function vo(t){const e=$u(t),r=f.forwardRef((n,s)=>{const{children:o,...i}=n,a=f.Children.toArray(o),l=a.find(Mu);if(l){const u=l.props.children,d=a.map(h=>h===l?f.Children.count(u)>1?f.Children.only(null):f.isValidElement(u)?u.props.children:null:h);return c.jsx(e,{...i,ref:s,children:f.isValidElement(u)?f.cloneElement(u,void 0,d):null})}return c.jsx(e,{...i,ref:s,children:o})});return r.displayName=`${t}.Slot`,r}function $u(t){const e=f.forwardRef((r,n)=>{const{children:s,...o}=r;if(f.isValidElement(s)){const i=Bu(s),a=Uu(o,s.props);return s.type!==f.Fragment&&(a.ref=n?js(n,i):i),f.cloneElement(s,a)}return f.Children.count(s)>1?f.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var Du=Symbol("radix.slottable");function Mu(t){return f.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===Du}function Uu(t,e){const r={...e};for(const n in e){const s=t[n],o=e[n];/^on[A-Z]/.test(n)?s&&o?r[n]=(...a)=>{const l=o(...a);return s(...a),l}:s&&(r[n]=s):n==="style"?r[n]={...s,...o}:n==="className"&&(r[n]=[s,o].filter(Boolean).join(" "))}return{...t,...r}}function Bu(t){var n,s;let e=(n=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:n.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}function Fu(t){const e=t+"CollectionProvider",[r,n]=ta(e),[s,o]=r(e,{collectionRef:{current:null},itemMap:new Map}),i=g=>{const{scope:y,children:x}=g,b=T.useRef(null),w=T.useRef(new Map).current;return c.jsx(s,{scope:y,itemMap:w,collectionRef:b,children:x})};i.displayName=e;const a=t+"CollectionSlot",l=vo(a),u=T.forwardRef((g,y)=>{const{scope:x,children:b}=g,w=o(a,x),_=ft(y,w.collectionRef);return c.jsx(l,{ref:_,children:b})});u.displayName=a;const d=t+"CollectionItemSlot",h="data-radix-collection-item",m=vo(d),p=T.forwardRef((g,y)=>{const{scope:x,children:b,...w}=g,_=T.useRef(null),S=ft(y,_),k=o(d,x);return T.useEffect(()=>(k.itemMap.set(_,{ref:_,...w}),()=>
2void k.itemMap.delete(_))),c.jsx(m,{[h]:"",ref:S,children:b})});p.displayName=d;function v(g){const y=o(t+"CollectionConsumer",g);return T.useCallback(()=>{const b=y.collectionRef.current;if(!b)return[];const w=Array.from(b.querySelectorAll(`[${h}]`));return Array.from(y.itemMap.values()).sort((k,E)=>w.indexOf(k.ref.current)-w.indexOf(E.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:i,Slot:u,ItemSlot:p},v,n]}function Hu(t){const e=Vu(t),r=f.forwardRef((n,s)=>{const{children:o,...i}=n,a=f.Children.toArray(o),l=a.find(qu);if(l){const u=l.props.children,d=a.map(h=>h===l?f.Children.count(u)>1?f.Children.only(null):f.isValidElement(u)?u.props.children:null:h);return c.jsx(e,{...i,ref:s,children:f.isValidElement(u)?f.cloneElement(u,void 0,d):null})}return c.jsx(e,{...i,ref:s,children:o})});return r.displayName=`${t}.Slot`,r}function Vu(t){const e=f.forwardRef((r,n)=>{const{children:s,...o}=r;if(f.isValidElement(s)){const i=Ku(s),a=zu(o,s.props);return s.type!==f.Fragment&&(a.ref=n?js(n,i):i),f.cloneElement(s,a)}return f.Children.count(s)>1?f.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var Wu=Symbol("radix.slottable");function qu(t){return f.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===Wu}function zu(t,e){const r={...e};for(const n in e){const s=t[n],o=e[n];/^on[A-Z]/.test(n)?s&&o?r[n]=(...a)=>{const l=o(...a);return s(...a),l}:s&&(r[n]=s):n==="style"?r[n]={...s,...o}:n==="className"&&(r[n]=[s,o].filter(Boolean).join(" "))}return{...t,...r}}function Ku(t){var n,s;let e=(n=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:n.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}var Ju=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],$e=Ju.reduce((t,e)=>{const r=Hu(`Primitive.${e}`),n=f.forwardRef((s,o)=>{const{asChild:i,...a}=s,l=i?r:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...a,ref:o})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function ra(t,e){t&&Ut.flushSync(()=>t.dispatchEvent(e))}function pt(t){const e=f.useRef(t);return f.useEffect(()=>{e.current=t}),f.useMemo(()=>(...r)=>{var n;return(n=e.current)==null?void 0:n.call(e,...r)},[])}function Gu(t,e=globalThis==null?void 0:globalThis.document){const r=pt(t);f.useEffect(()=>{const n=s=>{s.key==="Escape"&&r(s)};return e.addEventListener("keydown",n,{capture:!0}),()=>e.removeEventListener("keydown",n,{capture:!0})},[r,e])}var Yu="DismissableLayer",as="dismissableLayer.update",Xu="dismissableLayer.pointerDownOutside",Qu="dismissableLayer.focusOutside",yo,na=f.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),sa=f.forwardRef((t,e)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:i,onDismiss:a,...l}=t,u=f.useContext(na),[d,h]=f.useState(null),m=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=f.useState({}),v=ft(e,E=>h(E)),g=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),x=g.indexOf(y),b=d?g.indexOf(d):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,_=b>=x,S=ed(E=>{const $=E.target,L=[...u.branches].some(B=>B.contains($));!_||L||(s==null||s(E),i==null||i(E),E.defaultPrevented||a==null||a())},m),k=td(E=>{const $=E.target;[...u.branches].some(B=>B.contains($))||(o==null||o(E),i==null||i(E),E.defaultPrevented||a==null||a())},m);return Gu(E=>{b===u.layers.size-1&&(n==null||n(E),!E.defaultPrevented&&a&&(E.preventDefault(),a()))},m),f.useEffect(()=>{if(d)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(yo=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),bo(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=yo)}},[d,m,r,u]),f.useEffect(()=>()=>
2{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),bo())},[d,u]),f.useEffect(()=>{const E=()=>p({});return document.addEventListener(as,E),()=>document.removeEventListener(as,E)},[]),c.jsx($e.div,{...l,ref:v,style:{pointerEvents:w?_?"auto":"none":void 0,...t.style},onFocusCapture:he(t.onFocusCapture,k.onFocusCapture),onBlurCapture:he(t.onBlurCapture,k.onBlurCapture),onPointerDownCapture:he(t.onPointerDownCapture,S.onPointerDownCapture)})});sa.displayName=Yu;var Zu="DismissableLayerBranch",oa=f.forwardRef((t,e)=>{const r=f.useContext(na),n=f.useRef(null),s=ft(e,n);return f.useEffect(()=>{const o=n.current;if(o)return r.branches.add(o),()=>{r.branches.delete(o)}},[r.branches]),c.jsx($e.div,{...t,ref:s})});oa.displayName=Zu;function ed(t,e=globalThis==null?void 0:globalThis.document){const r=pt(t),n=f.useRef(!1),s=f.useRef(()=>{});return f.useEffect(()=>{const o=a=>{if(a.target&&!n.current){let l=function(){ia(Xu,r,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);n.current=!1},i=window.setTimeout(()=>{e.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(i),e.removeEventListener("pointerdown",o),e.removeEventListener("click",s.current)}},[e,r]),{onPointerDownCapture:()=>n.current=!0}}function td(t,e=globalThis==null?void 0:globalThis.document){const r=pt(t),n=f.useRef(!1);return f.useEffect(()=>{const s=o=>{o.target&&!n.current&&ia(Qu,r,{originalEvent:o},{discrete:!1})};return e.addEventListener("focusin",s),()=>e.removeEventListener("focusin",s)},[e,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function bo(){const t=new CustomEvent(as);document.dispatchEvent(t)}function ia(t,e,r,{discrete:n}){const s=r.originalEvent.target,o=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:r});e&&s.addEventListener(t,e,{once:!0}),n?ra(s,o):s.dispatchEvent(o)}var rd=sa,nd=oa,sr=globalThis!=null&&globalThis.document?f.useLayoutEffect:()=>{},sd="Portal",aa=f.forwardRef((t,e)=>{var a;const{container:r,...n}=t,[s,o]=f.useState(!1);sr(()=>o(!0),[]);const i=r||s&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?qi.createPortal(c.jsx($e.div,{...n,ref:e}),i):null});aa.displayName=sd;function od(t,e){return f.useReducer((r,n)=>e[r][n]??r,t)}var la=t=>{const{present:e,children:r}=t,n=id(e),s=typeof r=="function"?r({present:n.isPresent}):f.Children.only(r),o=ft(n.ref,ad(s));return typeof r=="function"||n.isPresent?f.cloneElement(s,{ref:o}):null};la.displayName="Presence";function id(t){const[e,r]=f.useState(),n=f.useRef(null),s=f.useRef(t),o=f.useRef("none"),i=t?"mounted":"unmounted",[a,l]=od(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{const u=kr(n.current);o.current=a==="mounted"?u:"none"},[a]),sr(()=>{const u=n.current,d=s.current;if(d!==t){const m=o.current,p=kr(u);t?l("MOUNT"):p==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(d&&m!==p?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,l]),sr(()=>{if(e){let u;const d=e.ownerDocument.defaultView??window,h=p=>{const g=kr(n.current).includes(p.animationName);if(p.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)})}},m=p=>{p.target===e&&(o.current=kr(n.current))};return e.addEventListener("animationstart",m),e.addEventListener("animationcancel",h),e.addEventListener("animationend",h),()=>{d.clearTimeout(u),e.removeEventListener("animationstart",m),e.removeEventListener("animationcancel",h),e.removeEventListener("animationend",h)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:f.useCallback(u=>{n.current=u?getComputedStyle(u):null,r(u)},[])}}function kr(t){return(t==null?void 0:t.animationName)||"none"}function ad(t){var n,s;let e=(n=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:n.get,r=e&&"isReactWarning"in e&&e.
2isReactWarning;return r?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}var ld=Bt[" useInsertionEffect ".trim().toString()]||sr;function cd({prop:t,defaultProp:e,onChange:r=()=>{},caller:n}){const[s,o,i]=ud({defaultProp:e,onChange:r}),a=t!==void 0,l=a?t:s;{const d=f.useRef(t!==void 0);f.useEffect(()=>{const h=d.current;h!==a&&console.warn(`${n} is changing from ${h?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=a},[a,n])}const u=f.useCallback(d=>{var h;if(a){const m=dd(d)?d(t):d;m!==t&&((h=i.current)==null||h.call(i,m))}else o(d)},[a,t,o,i]);return[l,u]}function ud({defaultProp:t,onChange:e}){const[r,n]=f.useState(t),s=f.useRef(r),o=f.useRef(e);return ld(()=>{o.current=e},[e]),f.useEffect(()=>{var i;s.current!==r&&((i=o.current)==null||i.call(o,r),s.current=r)},[r,s]),[r,n,o]}function dd(t){return typeof t=="function"}var hd=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),fd="VisuallyHidden",Ps=f.forwardRef((t,e)=>c.jsx($e.span,{...t,ref:e,style:{...hd,...t.style}}));Ps.displayName=fd;var Os="ToastProvider",[Ns,pd,md]=Fu("Toast"),[ca,Ux]=ta("Toast",[md]),[gd,yn]=ca(Os),ua=t=>{const{__scopeToast:e,label:r="Notification",duration:n=5e3,swipeDirection:s="right",swipeThreshold:o=50,children:i}=t,[a,l]=f.useState(null),[u,d]=f.useState(0),h=f.useRef(!1),m=f.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${Os}\`. Expected non-empty \`string\`.`),c.jsx(Ns.Provider,{scope:e,children:c.jsx(gd,{scope:e,label:r,duration:n,swipeDirection:s,swipeThreshold:o,toastCount:u,viewport:a,onViewportChange:l,onToastAdd:f.useCallback(()=>d(p=>p+1),[]),onToastRemove:f.useCallback(()=>d(p=>p-1),[]),isFocusedToastEscapeKeyDownRef:h,isClosePausedRef:m,children:i})})};ua.displayName=Os;var da="ToastViewport",vd=["F8"],ls="toast.viewportPause",cs="toast.viewportResume",ha=f.forwardRef((t,e)=>{const{__scopeToast:r,hotkey:n=vd,label:s="Notifications ({hotkey})",...o}=t,i=yn(da,r),a=pd(r),l=f.useRef(null),u=f.useRef(null),d=f.useRef(null),h=f.useRef(null),m=ft(e,h,i.onViewportChange),p=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),v=i.toastCount>0;f.useEffect(()=>{const y=x=>{var w;n.length!==0&&n.every(_=>x[_]||x.code===_)&&((w=h.current)==null||w.focus())};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[n]),f.useEffect(()=>{const y=l.current,x=h.current;if(v&&y&&x){const b=()=>{if(!i.isClosePausedRef.current){const k=new CustomEvent(ls);x.dispatchEvent(k),i.isClosePausedRef.current=!0}},w=()=>{if(i.isClosePausedRef.current){const k=new CustomEvent(cs);x.dispatchEvent(k),i.isClosePausedRef.current=!1}},_=k=>{!y.contains(k.relatedTarget)&&w()},S=()=>{y.contains(document.activeElement)||w()};return y.addEventListener("focusin",b),y.addEventListener("focusout",_),y.addEventListener("pointermove",b),y.addEventListener("pointerleave",S),window.addEventListener("blur",b),window.addEventListener("focus",w),()=>{y.removeEventListener("focusin",b),y.removeEventListener("focusout",_),y.removeEventListener("pointermove",b),y.removeEventListener("pointerleave",S),window.removeEventListener("blur",b),window.removeEventListener("focus",w)}}},[v,i.isClosePausedRef]);const g=f.useCallback(({tabbingDirection:y})=>{const b=a().map(w=>{const _=w.ref.current,S=[_,...jd(_)];return y==="forwards"?S:S.reverse()});return(y==="forwards"?b.reverse():b).flat()},[a]);return f.useEffect(()=>{const y=h.current;if(y){const x=b=>{var S,k,E;const w=b.altKey||b.ctrlKey||b.metaKey;if(b.key==="Tab"&&!w){const $=document.activeElement,L=b.shiftKey;if(b.target===y&&L){(S=u.current)==null||S.focus();return}const M=g({tabbingDirection:L?"backwards":"forwards"}),q=M.findIndex(P=>P===$);Un(M.slice(q+1))?b.preventDefault():L?(k=u.current)==null||k.focus():(E=d.current)==null||E.focus()}};return y.addEventListener("keydown",x),()=>y.removeEventListener("keydown",x)}},[a,g]),c.jsxs(nd,{ref:l,role:"region","aria-label":s.replace("{hotkey}",p),tabIndex:-1,style:{pointerEvents:v?void 0:"none"},children:[v&&c.jsx(us,{ref:u,onFocusFromOutsideViewport:()=>{const y=g({tabbingDirection:"forwards"});Un(y)}}),c.jsx(Ns.Slot,{scope:r,children:c.jsx($e.ol,{tabIndex:-1,...o,ref:m})}),v&&c.jsx(us,{ref:d,onFocusFromOutsideViewport:()=>{const y=g({tabbingDirection:"backwards"});Un(y)}})]})});ha.displayName=da;var fa="ToastFocusProxy",us=f.forwardRef((t,e)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...s}=t,o=yn(fa,r);return c.jsx(Ps,{"aria-hidden":!0,tabIndex:0,...s,ref:e,style:{position:"fixed"},onFocus:i=>{var u;const a=i.relatedTarget;!((u=o.viewport)!=null&&u.contains(a))&&n()}})});us.displayName=fa;var vr="Toast",yd="toast.swipeStart",bd="toast.swipeMove",wd="toast.swipeCancel",xd="toast.swipeEnd",pa=f.forwardRef((t,e)=>{const{forceMount:r,open:n,defaultOpen:s,onOpenChange:o,...i}=t,[a,l]=cd({prop:n,defaultProp:s??!0,onChange:o,caller:vr});return c.jsx(la,{present:r||a,children:c.jsx(Sd,{open:a,...i,ref:e,onClose:()=>l(!1),onPause:pt(t.onPause),onResume:pt(t.onResume),onSwipeStart:he(t.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:he(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:he(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:he(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)})})})});pa.displayName=vr;var[_d,Ed]=ca(vr,{onClose(){}}),Sd=f.forwardRef((t,e)=>{const{__scopeToast:r,type:n="foreground",duration:s,open:o,onClose:i,onEscapeKeyDown:a,onPause:l,onResume:u,onSwipeStart:d,onSwipeMove:h,onSwipeCancel:m,onSwipeEnd:p,...v}=t,g=yn(vr,r),[y,x]=f.useState(null),b=ft(e,P=>x(P)),w=f.useRef(null),_=f.useRef(null),S=s||g.duration,k=f.useRef(0),E=f.useRef(S),$=f.useRef(0),{onToastAdd:L,onToastRemove:B}=g,F=pt(()=>{var K;(y==null?void 0:y.contains(document.activeElement))&&((K=g.viewport)==null||K.focus()),i()}),M=f.useCallback(P=>
2{!P||P===1/0||(window.clearTimeout($.current),k.current=new Date().getTime(),$.current=window.setTimeout(F,P))},[F]);f.useEffect(()=>{const P=g.viewport;if(P){const K=()=>{M(E.current),u==null||u()},H=()=>{const W=new Date().getTime()-k.current;E.current=E.current-W,window.clearTimeout($.current),l==null||l()};return P.addEventListener(ls,H),P.addEventListener(cs,K),()=>{P.removeEventListener(ls,H),P.removeEventListener(cs,K)}}},[g.viewport,S,l,u,M]),f.useEffect(()=>{o&&!g.isClosePausedRef.current&&M(S)},[o,S,g.isClosePausedRef,M]),f.useEffect(()=>(L(),()=>B()),[L,B]);const q=f.useMemo(()=>y?xa(y):null,[y]);return g.viewport?c.jsxs(c.Fragment,{children:[q&&c.jsx(kd,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0,children:q}),c.jsx(_d,{scope:r,onClose:F,children:Ut.createPortal(c.jsx(Ns.ItemSlot,{scope:r,children:c.jsx(rd,{asChild:!0,onEscapeKeyDown:he(a,()=>{g.isFocusedToastEscapeKeyDownRef.current||F(),g.isFocusedToastEscapeKeyDownRef.current=!1}),children:c.jsx($e.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":o?"open":"closed","data-swipe-direction":g.swipeDirection,...v,ref:b,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:he(t.onKeyDown,P=>{P.key==="Escape"&&(a==null||a(P.nativeEvent),P.nativeEvent.defaultPrevented||(g.isFocusedToastEscapeKeyDownRef.current=!0,F()))}),onPointerDown:he(t.onPointerDown,P=>{P.button===0&&(w.current={x:P.clientX,y:P.clientY})}),onPointerMove:he(t.onPointerMove,P=>{if(!w.current)return;const K=P.clientX-w.current.x,H=P.clientY-w.current.y,W=!!_.current,D=["left","right"].includes(g.swipeDirection),N=["left","up"].includes(g.swipeDirection)?Math.min:Math.max,Y=D?N(0,K):0,ze=D?0:N(0,H),V=P.pointerType==="touch"?10:2,z={x:Y,y:ze},J={originalEvent:P,delta:z};W?(_.current=z,Tr(bd,h,J,{discrete:!1})):wo(z,g.swipeDirection,V)?(_.current=z,Tr(yd,d,J,{discrete:!1}),P.target.setPointerCapture(P.pointerId)):(Math.abs(K)>V||Math.abs(H)>V)&&(w.current=null)}),onPointerUp:he(t.onPointerUp,P=>{const K=_.current,H=P.target;if(H.hasPointerCapture(P.pointerId)&&H.releasePointerCapture(P.pointerId),_.current=null,w.current=null,K){const W=P.currentTarget,D={originalEvent:P,delta:K};wo(K,g.swipeDirection,g.swipeThreshold)?Tr(xd,p,D,{discrete:!0}):Tr(wd,m,D,{discrete:!0}),W.addEventListener("click",N=>N.preventDefault(),{once:!0})}})})})}),g.viewport)})]}):null}),kd=t=>{const{__scopeToast:e,children:r,...n}=t,s=yn(vr,e),[o,i]=f.useState(!1),[a,l]=f.useState(!1);return Ad(()=>i(!0)),f.useEffect(()=>{const u=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(u)},[]),a?null:c.jsx(aa,{asChild:!0,children:c.jsx(Ps,{...n,children:o&&c.jsxs(c.Fragment,{children:[s.label," ",r]})})})},Td="ToastTitle",ma=f.forwardRef((t,e)=>{const{__scopeToast:r,...n}=t;return c.jsx($e.div,{...n,ref:e})});ma.displayName=Td;var Rd="ToastDescription",ga=f.forwardRef((t,e)=>{const{__scopeToast:r,...n}=t;return c.jsx($e.div,{...n,ref:e})});ga.displayName=Rd;var va="ToastAction",ya=f.forwardRef((t,e)=>{const{altText:r,...n}=t;return r.trim()?c.jsx(wa,{altText:r,asChild:!0,children:c.jsx(Is,{...n,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${va}\`. Expected non-empty \`string\`.`),null)});ya.displayName=va;var ba="ToastClose",Is=f.forwardRef((t,e)=>{const{__scopeToast:r,...n}=t,s=Ed(ba,r);return c.jsx(wa,{asChild:!0,children:c.jsx($e.button,{type:"button",...n,ref:e,onClick:he(t.onClick,s.onClose)})})});Is.displayName=ba;var wa=f.forwardRef((t,e)=>{const{__scopeToast:r,altText:n,...s}=t;return c.jsx($e.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...s,ref:e})});function xa(t){const e=[];return Array.from(t.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&e.push(n.textContent),Cd(n)){const s=n.ariaHidden||n.hidden||n.style.display==="none",o=n.dataset.radixToastAnnounceExclude==="";if(!s)if(o){const i=n.dataset.radixToastAnnounceAlt;i&&e.push(i)}else e.push(...xa(n))}}),e}function Tr(t,e,r,{discrete:n}){const s=r.originalEvent.currentTarget,o=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r});e&&s.addEventListener(t,e,{once:!0}),n?ra(s,o):s.dispatchEvent(o)}var wo=(t,e,r=0)=>{const n=Math.abs(t.x),s=Math.abs(t.y),o=n>s;return e==="left"||e==="right"?o&&n>r:!o&&s>r};function Ad(t=()=>{}){const e=pt(t);sr(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[e])}function Cd(t){return t.nodeType===t.ELEMENT_NODE}
2function jd(t){const e=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)e.push(r.currentNode);return e}function Un(t){const e=document.activeElement;return t.some(r=>r===e?!0:(r.focus(),document.activeElement!==e))}var Pd=ua,_a=ha,Ea=pa,Sa=ma,ka=ga,Ta=ya,Ra=Is;function ue(...t){return Uc(Bc(t))}const Od=Pd,Aa=f.forwardRef(({className:t,...e},r)=>c.jsx(_a,{ref:r,className:ue("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}));Aa.displayName=_a.displayName;const Nd=Ki("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"}}),Ca=f.forwardRef(({className:t,variant:e,...r},n)=>c.jsx(Ea,{ref:n,className:ue(Nd({variant:e}),t),...r}));Ca.displayName=Ea.displayName;const Id=f.forwardRef(({className:t,...e},r)=>c.jsx(Ta,{ref:r,className:ue("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 group-[.destructive]:border-muted/40 hover:bg-secondary group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 group-[.destructive]:focus:ring-destructive disabled:pointer-events-none disabled:opacity-50",t),...e}));Id.displayName=Ta.displayName;const ja=f.forwardRef(({className:t,...e},r)=>c.jsx(Ra,{ref:r,className:ue("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 hover:text-foreground group-[.destructive]:hover:text-red-50 focus:opacity-100 focus:outline-none focus:ring-2 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",t),"toast-close":"",...e,children:c.jsx(gr,{className:"h-4 w-4"})}));ja.displayName=Ra.displayName;const Pa=f.forwardRef(({className:t,...e},r)=>c.jsx(Sa,{ref:r,className:ue("text-sm font-semibold",t),...e}));Pa.displayName=Sa.displayName;const Oa=f.forwardRef(({className:t,...e},r)=>c.jsx(ka,{ref:r,className:ue("text-sm opacity-90",t),...e}));Oa.displayName=ka.displayName;function Ld(){const{toasts:t}=Iu();return c.jsxs(Od,{children:[t.map(function({id:e,title:r,description:n,action:s,...o}){return c.jsxs(Ca,{...o,children:[c.jsxs("div",{className:"grid gap-1",children:[r&&c.jsx(Pa,{children:r}),n&&c.jsx(Oa,{children:n})]}),s,c.jsx(ja,{})]},e)}),c.jsx(Aa,{})]})}var xo=["light","dark"],$d="(prefers-color-scheme: dark)",Dd=f.createContext(void 0),Md={setTheme:t=>{},themes:[]},Ud=()=>{var t;return(t=f.useContext(Dd))!=null?t:Md};f.memo(({forcedTheme:t,storageKey:e,attribute:r,enableSystem:n,enableColorScheme:s,defaultTheme:o,value:i,attrs:a,nonce:l})=>{let u=o==="system",d=r==="class"?`var d=document.documentElement,c=d.classList;
2${`c.remove(${a.map(v=>`'${v}'`).join(",")})`};`:`var d=document.documentElement,n='${r}',s='setAttribute';`,h=s?xo.includes(o)&&o?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${o}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",m=(v,g=!1,y=!0)=>{let x=i?i[v]:v,b=g?v+"|| ''":`'${x}'`,w="";return s&&y&&!g&&xo.includes(v)&&(w+=`d.style.colorScheme = '${v}';`),r==="class"?g||x?w+=`c.add(${b})`:w+="null":x&&(w+=`d[s](n,${b})`),w},p=t?`!function(){${d}${m(t)}}()`:n?`!function(){try{${d}var e=localStorage.getItem('${e}');if('system'===e||(!e&&${u})){var t='${$d}',m=window.matchMedia(t);if(m.media!==t||m.matches){${m("dark")}}else{${m("light")}}}else if(e){${i?`var x=${JSON.stringify(i)};`:""}${m(i?"x[e]":"e",!0)}}${u?"":"else{"+m(o,!1,!1)+"}"}${h}}catch(e){}}()`:`!function(){try{${d}var e=localStorage.getItem('${e}');if(e){${i?`var x=${JSON.stringify(i)};`:""}${m(i?"x[e]":"e",!0)}}else{${m(o,!1,!1)};}${h}}catch(t){}}();`;return f.createElement("script",{nonce:l,dangerouslySetInnerHTML:{__html:p}})});var Bd=t=>{switch(t){case"success":return Vd;case"info":return qd;case"warning":return Wd;case"error":return zd;default:return null}},Fd=Array(12).fill(0),Hd=({visible:t,className:e})=>T.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},T.createElement("div",{className:"sonner-spinner"},Fd.map((r,n)=>T.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),Vd=T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},T.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"})),Wd=T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},T.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"})),qd=T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},T.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"})),zd=T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},T.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"})),Kd=T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},T.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),T.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Jd=()=>{let[t,e]=T.useState(document.hidden);return T.useEffect(()=>{let r=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),t},ds=1,Gd=class{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{let e=this.subscribers.indexOf(t);this.subscribers.splice(e,1)}),this.publish=t=>{this.subscribers.forEach(e=>e(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var e;let{message:r,...n}=t,s=typeof(t==null?void 0:t.id)=="number"||((e=t.id)==null?void 0:e.length)>0?t.id:ds++,o=this.toasts.find(a=>a.id===s),i=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),o?this.toasts=this.toasts.map(a=>a.id===s?(this.publish({...a,...t,id:s,title:r}),{...a,...t,id:s,dismissible:i,title:r}):a):this.addToast({title:r,...n,dismissible:i,id:s}),s},this.dismiss=t=>
2(this.dismissedToasts.add(t),t||this.toasts.forEach(e=>{this.subscribers.forEach(r=>r({id:e.id,dismiss:!0}))}),this.subscribers.forEach(e=>e({id:t,dismiss:!0})),t),this.message=(t,e)=>this.create({...e,message:t}),this.error=(t,e)=>this.create({...e,message:t,type:"error"}),this.success=(t,e)=>this.create({...e,type:"success",message:t}),this.info=(t,e)=>this.create({...e,type:"info",message:t}),this.warning=(t,e)=>this.create({...e,type:"warning",message:t}),this.loading=(t,e)=>this.create({...e,type:"loading",message:t}),this.promise=(t,e)=>{if(!e)return;let r;e.loading!==void 0&&(r=this.create({...e,promise:t,type:"loading",message:e.loading,description:typeof e.description!="function"?e.description:void 0}));let n=t instanceof Promise?t:t(),s=r!==void 0,o,i=n.then(async l=>{if(o=["resolve",l],T.isValidElement(l))s=!1,this.create({id:r,type:"default",message:l});else if(Xd(l)&&!l.ok){s=!1;let u=typeof e.error=="function"?await e.error(`HTTP error! status: ${l.status}`):e.error,d=typeof e.description=="function"?await e.description(`HTTP error! status: ${l.status}`):e.description;this.create({id:r,type:"error",message:u,description:d})}else if(e.success!==void 0){s=!1;let u=typeof e.success=="function"?await e.success(l):e.success,d=typeof e.description=="function"?await e.description(l):e.description;this.create({id:r,type:"success",message:u,description:d})}}).catch(async l=>{if(o=["reject",l],e.error!==void 0){s=!1;let u=typeof e.error=="function"?await e.error(l):e.error,d=typeof e.description=="function"?await e.description(l):e.description;this.create({id:r,type:"error",message:u,description:d})}}).finally(()=>{var l;s&&(this.dismiss(r),r=void 0),(l=e.finally)==null||l.call(e)}),a=()=>new Promise((l,u)=>i.then(()=>o[0]==="reject"?u(o[1]):l(o[1])).catch(u));return typeof r!="string"&&typeof r!="number"?{unwrap:a}:Object.assign(r,{unwrap:a})},this.custom=(t,e)=>{let r=(e==null?void 0:e.id)||ds++;return this.create({jsx:t(r),id:r,...e}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},ce=new Gd,Yd=(t,e)=>{let r=(e==null?void 0:e.id)||ds++;return ce.addToast({title:t,...e,id:r}),r},Xd=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",Qd=Yd,Zd=()=>ce.toasts,eh=()=>ce.getActiveToasts(),th=Object.assign(Qd,{success:ce.success,info:ce.info,warning:ce.warning,error:ce.error,custom:ce.custom,message:ce.message,promise:ce.promise,dismiss:ce.dismiss,loading:ce.loading},{getHistory:Zd,getToasts:eh});function rh(t,{insertAt:e}={}){if(typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",e==="top"&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}rh(`: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;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-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;
2left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}: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:-50%;right:-50%;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}
2: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-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-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-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 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%);
2--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[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%)}
3`);function Rr(t){return t.label!==void 0}var nh=3,sh="32px",oh="16px",_o=4e3,ih=356,ah=14,lh=20,ch=200;function xe(...t){return t.filter(Boolean).join(" ")}function uh(t){let[e,r]=t.split("-"),n=[];return e&&n.push(e),r&&n.push(r),n}var dh=t=>{var e,r,n,s,o,i,a,l,u,d,h;let{invert:m,toast:p,unstyled:v,interacting:g,setHeights:y,visibleToasts:x,heights:b,index:w,toasts:_,expanded:S,removeToast:k,defaultRichColors:E,closeButton:$,style:L,cancelButtonStyle:B,actionButtonStyle:F,className:M="",descriptionClassName:q="",duration:P,position:K,gap:H,loadingIcon:W,expandByDefault:D,classNames:N,icons:Y,closeButtonAriaLabel:ze="Close toast",pauseWhenPageIsHidden:V}=t,[z,J]=T.useState(null),[oe,Ke]=T.useState(null),[Q,vt]=T.useState(!1),[Je,st]=T.useState(!1),[Ge,yt]=T.useState(!1),[zt,ot]=T.useState(!1),[xr,_r]=T.useState(!1),[Pn,Kt]=T.useState(0),[On,it]=T.useState(0),Jt=T.useRef(p.duration||P||_o),eo=T.useRef(null),at=T.useRef(null),Tc=w===0,Rc=w+1<=x,ge=p.type,bt=p.dismissible!==!1,Ac=p.className||"",Cc=p.descriptionClassName||"",Er=T.useMemo(()=>b.findIndex(U=>U.toastId===p.id)||0,[b,p.id]),jc=T.useMemo(()=>{var U;return(U=p.closeButton)!=null?U:$},[p.closeButton,$]),to=T.useMemo(()=>p.duration||P||_o,[p.duration,P]),Nn=T.useRef(0),wt=T.useRef(0),ro=T.useRef(0),xt=T.useRef(null),[Pc,Oc]=K.split("-"),no=T.useMemo(()=>b.reduce((U,G,Z)=>Z>=Er?U:U+G.height,0),[b,Er]),so=Jd(),Nc=p.invert||m,In=ge==="loading";wt.current=T.useMemo(()=>Er*H+no,[Er,no]),T.useEffect(()=>{Jt.current=to},[to]),T.useEffect(()=>{vt(!0)},[]),T.useEffect(()=>{let U=at.current;if(U){let G=U.getBoundingClientRect().height;return it(G),y(Z=>[{toastId:p.id,height:G,position:p.position},...Z]),()=>y(Z=>Z.filter(ye=>ye.toastId!==p.id))}},[y,p.id]),T.useLayoutEffect(()=>{if(!Q)return;let U=at.current,G=U.style.height;U.style.height="auto";let Z=U.getBoundingClientRect().height;U.style.height=G,it(Z),y(ye=>
3ye.find(be=>be.toastId===p.id)?ye.map(be=>be.toastId===p.id?{...be,height:Z}:be):[{toastId:p.id,height:Z,position:p.position},...ye])},[Q,p.title,p.description,y,p.id]);let Ye=T.useCallback(()=>{st(!0),Kt(wt.current),y(U=>U.filter(G=>G.toastId!==p.id)),setTimeout(()=>{k(p)},ch)},[p,k,y,wt]);T.useEffect(()=>{if(p.promise&&ge==="loading"||p.duration===1/0||p.type==="loading")return;let U;return S||g||V&&so?(()=>{if(ro.current<Nn.current){let G=new Date().getTime()-Nn.current;Jt.current=Jt.current-G}ro.current=new Date().getTime()})():Jt.current!==1/0&&(Nn.current=new Date().getTime(),U=setTimeout(()=>{var G;(G=p.onAutoClose)==null||G.call(p,p),Ye()},Jt.current)),()=>clearTimeout(U)},[S,g,p,ge,V,so,Ye]),T.useEffect(()=>{p.delete&&Ye()},[Ye,p.delete]);function Ic(){var U,G,Z;return Y!=null&&Y.loading?T.createElement("div",{className:xe(N==null?void 0:N.loader,(U=p==null?void 0:p.classNames)==null?void 0:U.loader,"sonner-loader"),"data-visible":ge==="loading"},Y.loading):W?T.createElement("div",{className:xe(N==null?void 0:N.loader,(G=p==null?void 0:p.classNames)==null?void 0:G.loader,"sonner-loader"),"data-visible":ge==="loading"},W):T.createElement(Hd,{className:xe(N==null?void 0:N.loader,(Z=p==null?void 0:p.classNames)==null?void 0:Z.loader),visible:ge==="loading"})}return T.createElement("li",{tabIndex:0,ref:at,className:xe(M,Ac,N==null?void 0:N.toast,(e=p==null?void 0:p.classNames)==null?void 0:e.toast,N==null?void 0:N.default,N==null?void 0:N[ge],(r=p==null?void 0:p.classNames)==null?void 0:r[ge]),"data-sonner-toast":"","data-rich-colors":(n=p.richColors)!=null?n:E,"data-styled":!(p.jsx||p.unstyled||v),"data-mounted":Q,"data-promise":!!p.promise,"data-swiped":xr,"data-removed":Je,"data-visible":Rc,"data-y-position":Pc,"data-x-position":Oc,"data-index":w,"data-front":Tc,"data-swiping":Ge,"data-dismissible":bt,"data-type":ge,"data-invert":Nc,"data-swipe-out":zt,"data-swipe-direction":oe,"data-expanded":!!(S||D&&Q),style:{"--index":w,"--toasts-before":w,"--z-index":_.length-w,"--offset":`${Je?Pn:wt.current}px`,"--initial-height":D?"auto":`${On}px`,...L,...p.style},onDragEnd:()=>{yt(!1),J(null),xt.current=null},onPointerDown:U=>{In||!bt||(eo.current=new Date,Kt(wt.current),U.target.setPointerCapture(U.pointerId),U.target.tagName!=="BUTTON"&&(yt(!0),xt.current={x:U.clientX,y:U.clientY}))},onPointerUp:()=>{var U,G,Z,ye;if(zt||!bt)return;xt.current=null;let be=Number(((U=at.current)==null?void 0:U.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Xe=Number(((G=at.current)==null?void 0:G.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),lt=new Date().getTime()-((Z=eo.current)==null?void 0:Z.getTime()),we=z==="x"?be:Xe,Qe=Math.abs(we)/lt;if(Math.abs(we)>=lh||Qe>.11){Kt(wt.current),(ye=p.onDismiss)==null||ye.call(p,p),Ke(z==="x"?be>0?"right":"left":Xe>0?"down":"up"),Ye(),ot(!0),_r(!1);return}yt(!1),J(null)},onPointerMove:U=>{var G,Z,ye,be;if(!xt.current||!bt||((G=window.getSelection())==null?void 0:G.toString().length)>0)return;let Xe=U.clientY-xt.current.y,lt=U.clientX-xt.current.x,we=(Z=t.swipeDirections)!=null?Z:uh(K);!z&&(Math.abs(lt)>1||Math.abs(Xe)>1)&&J(Math.abs(lt)>Math.abs(Xe)?"x":"y");let Qe={x:0,y:0};z==="y"?(we.includes("top")||we.includes("bottom"))&&(we.includes("top")&&Xe<0||we.includes("bottom")&&Xe>0)&&(Qe.y=Xe):z==="x"&&(we.includes("left")||we.includes("right"))&&(we.includes("left")&&lt<0||we.includes("right")&&lt>0)&&(Qe.x=lt),(Math.abs(Qe.x)>0||Math.abs(Qe.y)>0)&&_r(!0),(ye=at.current)==null||ye.style.setProperty("--swipe-amount-x",`${Qe.x}px`),(be=at.current)==null||be.style.setProperty("--swipe-amount-y",`${Qe.y}px`)}},jc&&!p.jsx?T.createElement("button",{"aria-label":ze,"data-disabled":In,"data-close-button":!0,onClick:In||!bt?()=>{}:()=>{var U;Ye(),(U=p.onDismiss)==null||U.call(p,p)},className:xe(N==null?void 0:N.closeButton,(s=p==null?void 0:p.classNames)==null?void 0:s.closeButton)},(o=Y==null?void 0:Y.close)!=null?o:Kd):null,p.jsx||f.isValidElement(p.title)?p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title:T.createElement(T.Fragment,null,ge||p.icon||p.promise?T.createElement("div",{"data-icon":"",className:xe(N==null?void 0:N.icon,(i=p==null?void 0:p.classNames)==null?void 0:i.icon)}
3,p.promise||p.type==="loading"&&!p.icon?p.icon||Ic():null,p.type!=="loading"?p.icon||(Y==null?void 0:Y[ge])||Bd(ge):null):null,T.createElement("div",{"data-content":"",className:xe(N==null?void 0:N.content,(a=p==null?void 0:p.classNames)==null?void 0:a.content)},T.createElement("div",{"data-title":"",className:xe(N==null?void 0:N.title,(l=p==null?void 0:p.classNames)==null?void 0:l.title)},typeof p.title=="function"?p.title():p.title),p.description?T.createElement("div",{"data-description":"",className:xe(q,Cc,N==null?void 0:N.description,(u=p==null?void 0:p.classNames)==null?void 0:u.description)},typeof p.description=="function"?p.description():p.description):null),f.isValidElement(p.cancel)?p.cancel:p.cancel&&Rr(p.cancel)?T.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||B,onClick:U=>{var G,Z;Rr(p.cancel)&&bt&&((Z=(G=p.cancel).onClick)==null||Z.call(G,U),Ye())},className:xe(N==null?void 0:N.cancelButton,(d=p==null?void 0:p.classNames)==null?void 0:d.cancelButton)},p.cancel.label):null,f.isValidElement(p.action)?p.action:p.action&&Rr(p.action)?T.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||F,onClick:U=>{var G,Z;Rr(p.action)&&((Z=(G=p.action).onClick)==null||Z.call(G,U),!U.defaultPrevented&&Ye())},className:xe(N==null?void 0:N.actionButton,(h=p==null?void 0:p.classNames)==null?void 0:h.actionButton)},p.action.label):null))};function Eo(){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}function hh(t,e){let r={};return[t,e].forEach((n,s)=>{let o=s===1,i=o?"--mobile-offset":"--offset",a=o?oh:sh;function l(u){["top","right","bottom","left"].forEach(d=>{r[`${i}-${d}`]=typeof u=="number"?`${u}px`:u})}typeof n=="number"||typeof n=="string"?l(n):typeof n=="object"?["top","right","bottom","left"].forEach(u=>{n[u]===void 0?r[`${i}-${u}`]=a:r[`${i}-${u}`]=typeof n[u]=="number"?`${n[u]}px`:n[u]}):l(a)}),r}var fh=f.forwardRef(function(t,e){let{invert:r,position:n="bottom-right",hotkey:s=["altKey","KeyT"],expand:o,closeButton:i,className:a,offset:l,mobileOffset:u,theme:d="light",richColors:h,duration:m,style:p,visibleToasts:v=nh,toastOptions:g,dir:y=Eo(),gap:x=ah,loadingIcon:b,icons:w,containerAriaLabel:_="Notifications",pauseWhenPageIsHidden:S}=t,[k,E]=T.useState([]),$=T.useMemo(()=>Array.from(new Set([n].concat(k.filter(V=>V.position).map(V=>V.position)))),[k,n]),[L,B]=T.useState([]),[F,M]=T.useState(!1),[q,P]=T.useState(!1),[K,H]=T.useState(d!=="system"?d:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),W=T.useRef(null),D=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),N=T.useRef(null),Y=T.useRef(!1),ze=T.useCallback(V=>{E(z=>{var J;return(J=z.find(oe=>oe.id===V.id))!=null&&J.delete||ce.dismiss(V.id),z.filter(({id:oe})=>oe!==V.id)})},[]);return T.useEffect(()=>ce.subscribe(V=>{if(V.dismiss){E(z=>z.map(J=>J.id===V.id?{...J,delete:!0}:J));return}setTimeout(()=>{qi.flushSync(()=>{E(z=>{let J=z.findIndex(oe=>oe.id===V.id);return J!==-1?[...z.slice(0,J),{...z[J],...V},...z.slice(J+1)]:[V,...z]})})})}),[]),T.useEffect(()=>{if(d!=="system"){H(d);return}if(d==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?H("dark"):H("light")),typeof window>"u")return;let V=window.matchMedia("(prefers-color-scheme: dark)");try{V.addEventListener("change",({matches:z})=>{H(z?"dark":"light")})}catch{V.addListener(({matches:J})=>{try{H(J?"dark":"light")}catch(oe){console.error(oe)}})}},[d]),T.useEffect(()=>{k.length<=1&&M(!1)},[k]),T.useEffect(()=>{let V=z=>{var J,oe;s.every(Ke=>z[Ke]||z.code===Ke)&&(M(!0),(J=W.current)==null||J.focus()),z.code==="Escape"&&(document.activeElement===W.current||(oe=W.current)!=null&&oe.contains(document.activeElement))&&M(!1)};return document.addEventListener("keydown",V),()=>document.removeEventListener("keydown",V)},[s]),T.useEffect(()=>{if(W.current)return()=>{N.current&&(N.current.focus({preventScroll:!0}),N.current=null,Y.current=!1)}},[W.current]),T.createElement("section",{ref:e,"aria-label":`${_} ${D}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},$.map((V,z)=>{var J;let[oe,Ke]=V.split("-");return k.length?T.createElement("ol",{key:V,dir:y==="auto"?Eo():y,tabIndex:-1,ref:W,className:a,"data-sonner-toaster":!0,"data-theme":K,"data-y-position":oe,"data-lifted":F&&k.length>1&&!o,"data-x-position":Ke,style:{"--front-toast-height":`${((J=L[0])==null?void 0:J.height)||0}px`,"--width":`${ih}px`,"--gap":`${x}px`,...p,...hh(l,u)},onBlur:Q=>{Y.current&&!Q.currentTarget.contains(Q.relatedTarget)&&(Y.current=!1,N.current&&(N.current.focus({preventScroll:!0}),N.current=null))},onFocus:Q=>{Q.target instanceof HTMLElement&&Q.target.dataset.dismissible==="false"||Y.current||(Y.current=!0,N.current=Q.relatedTarget)},onMouseEnter:()=>M(!0),onMouseMove:()=>M(!0),onMouseLeave:()=>{q||M(!1)},onDragEnd:()=>M(!1),onPointerDown:Q=>{Q.target instanceof HTMLElement&&Q.target.dataset.dismissible==="false"||P(!0)},onPointerUp:()=>P(!1)},k.filter(Q=>!Q.position&&z===0||Q.position===V).map((Q,vt)=>{var Je,st;return T.createElement(dh,{key:Q.id,icons:w,index:vt,toast:Q,defaultRichColors:h,duration:(Je=g==null?void 0:g.duration)!=null?Je:m,className:g==null?void 0:g.className,descriptionClassName:g==null?void 0:g.descriptionClassName,invert:r,visibleToasts:v,closeButton:(st=g==null?void 0:g.closeButton)!=null?st:i,interacting:q,position:V,style:g==null?void 0:g.style,unstyled:g==null?void 0:g.unstyled,classNames:g==null?void 0:g.classNames,cancelButtonStyle:g==null?void 0:g.cancelButtonStyle,actionButtonStyle:g==null?void 0:g.actionButtonStyle,removeToast:ze,toasts:k.filter(Ge=>Ge.position==Q.position),heights:L.filter(Ge=>Ge.position==Q.position),setHeights:B,expandByDefault:o,gap:x,loadingIcon:b,expanded:F,pauseWhenPageIsHidden:S,swipeDirections:t.swipeDirections})})):null}))});const ph=({...t})=>{const{theme:e="system"}=Ud();return c.jsx(fh,{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})};function _t(t,e,{checkForDefaultPrevented:r=!0}={}){return function(s){if(t==null||t(s),r===!1||!s.defaultPrevented)return e==null?void 0:e(s)}}function So(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function mh(...t){return e=>{let r=!1;const n=t.map(s=>{const o=So(s,e);return!r&&typeof o=="function"&&(r=!0),o});if(r)return()=>{for(let s=0;s<n.length;s++){const o=n[s];typeof o=="function"?o():So(t[s],null)}}}}function Na(...t){return f.useCallback(mh(...t),t)}function gh(t,e=[]){let r=[];function n(o,i){const a=f.createContext(i);a.displayName=o+"Context";const l=r.length;r=[...r,i];const u=h=>{var x;const{scope:m,children:p,...v}=h,g=((x=m==null?void 0:m[t])==null?void 0:x[l])||a,y=f.useMemo(()=>v,Object.values(v));return c.jsx(g.Provider,{value:y,children:p})};u.displayName=o+"Provider";function d(h,m){var g;const p=((g=m==null?void 0:m[t])==null?void 0:g[l])||a,v=f.useContext(p);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=r.map(i=>f.createContext(i));return function(a){const l=(a==null?void 0:a[t])||o;return f.useMemo(()=>({[`__scope${t}`]:{...a,[t]:l}}),[a,l])}};return s.scopeName=t,[n,vh(s,...e)]}function vh(...t){const e=t[0];if(t.length===1)return e;const r=()=>{const n=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const i=n.reduce((a,{useScope:l,scopeName:u})=>{const h=l(o)[`__scope${u}`];return{...a,...h}},{});return f.useMemo(()=>({[`__scope${e.scopeName}`]:i}),[i])}};return r.scopeName=e.scopeName,r}function Bn(t,e,{checkForDefaultPrevented:r=!0}={}){return function(s){if(t==null||t(s),r===!1||!s.defaultPrevented)return e==null?void 0:e(s)}}function ko(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function yh(...t){return e=>{let r=!1;const n=t.map(s=>{const o=ko(s,e);return!r&&typeof o=="function"&&(r=!0),o});if(r)return()=>{for(let s=0;s<n.length;s++){const o=n[s];typeof o=="function"?o():ko(t[s],null)}}}}function bh(...t){return f.useCallback(yh(...t),t)}function qe(t){const e=f.forwardRef((r,n)=>{let{children:s,...o}=r,i=null,a=!1;const l=[];To(s)&&typeof Ar=="function"&&(s=Ar(s._payload)),f.Children.forEac
3h(s,m=>{var p;if(kh(m)){a=!0;const v=m;let g="child"in v.props?v.props.child:v.props.children;To(g)&&typeof Ar=="function"&&(g=Ar(g._payload)),i=_h(v,g),l.push((p=i==null?void 0:i.props)==null?void 0:p.children)}else l.push(m)}),i?i=f.cloneElement(i,void 0,l):!a&&f.Children.count(s)===1&&f.isValidElement(s)&&(i=s);const u=i?Sh(i):void 0,d=bh(n,u);if(!i){if(s||s===0)throw new Error(a?Ch(t):Ah(t));return s}const h=Eh(o,i.props??{});return i.type!==f.Fragment&&(h.ref=n?d:u),f.cloneElement(i,h)});return e.displayName=`${t}.Slot`,e}var wh=qe("Slot"),Ia=Symbol.for("radix.slottable");function xh(t){const e=r=>"child"in r?r.children(r.child):r.children;return e.displayName=`${t}.Slottable`,e.__radixId=Ia,e}var _h=(t,e)=>{if("child"in t.props){const r=t.props.child;return f.isValidElement(r)?f.cloneElement(r,void 0,t.props.children(r.props.children)):null}return f.isValidElement(e)?e:null};function Eh(t,e){const r={...e};for(const n in e){const s=t[n],o=e[n];/^on[A-Z]/.test(n)?s&&o?r[n]=(...a)=>{const l=o(...a);return s(...a),l}:s&&(r[n]=s):n==="style"?r[n]={...s,...o}:n==="className"&&(r[n]=[s,o].filter(Boolean).join(" "))}return{...t,...r}}function Sh(t){var n,s;let e=(n=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:n.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}function kh(t){return f.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===Ia}var Th=Symbol.for("react.lazy");function To(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===Th&&"_payload"in t&&Rh(t._payload)}function Rh(t){return typeof t=="object"&&t!==null&&"then"in t}var Ah=t=>`${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,Ch=t=>`${t} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,Ar=Bt[" use ".trim().toString()],jh=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],La=jh.reduce((t,e)=>{const r=qe(`Primitive.${e}`),n=f.forwardRef((s,o)=>{const{asChild:i,...a}=s,l=i?r:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...a,ref:o})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function Ph(t,e){t&&Ut.flushSync(()=>t.dispatchEvent(e))}function Ro(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function Oh(...t){return e=>{let r=!1;const n=t.map(s=>{const o=Ro(s,e);return!r&&typeof o=="function"&&(r=!0),o});if(r)return()=>{for(let s=0;s<n.length;s++){const o=n[s];typeof o=="function"?o():Ro(t[s],null)}}}}function $a(...t){return f.useCallback(Oh(...t),t)}function Da(t){const e=f.useRef(t);return f.useEffect(()=>{e.current=t}),f.useMemo(()=>(...r)=>{var n;return(n=e.current)==null?void 0:n.call(e,...r)},[])}function Nh(t){const e=f.useRef(t);return f.useEffect(()=>{e.current=t}),f.useMemo(()=>(...r)=>{var n;return(n=e.current)==null?void 0:n.call(e,...r)},[])}function Ih(t,e=globalThis==null?void 0:globalThis.document){const r=Nh(t);f.useEffect(()=>{const n=s=>{s.key==="Escape"&&r(s)};return e.addEventListener("keydown",n,{capture:!0}),()=>e.removeEventListener("keydown",n,{capture:!0})},[r,e])}var Lh="DismissableLayer",hs="dismissableLayer.update",$h="dismissableLayer.pointerDownOutside",Dh="dismissableLayer.focusOutside",Ao,Ma=f.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ls=f.forwardRef((t,e)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:i,onDismiss:a,...l}=t,u=f.useContext(Ma),[d,h]=f.useState(null),m=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=f.useState({}),v=$a(e,E=>h(E)),g=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),x=g.indexOf(y),b=d?g.indexOf(d):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,_=b>=x,S=Bh(E=>{const $=E.target,L=[...u.branches].some(B=>B.contains($));!_||L||(s==null||s(E),i==null||i(E),E.defaultPrevented||a==null||a())},m),k=Fh(E=>{const $=E.target;[...u.branches].some(B=>B.contains($))||(o==null||o(E),i==null||i(E),E.defaultPrevented||a==null||a())},m);return Ih(E=>{b===u.layers.size-1&&(n==null||n(E),!E.defaultPrevented&&a&&(E.preventDefault(),a()))},m),f.useEffect(()=>{if(d)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Ao=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Co(),()=>
3{r&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(m.body.style.pointerEvents=Ao))}},[d,m,r,u]),f.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Co())},[d,u]),f.useEffect(()=>{const E=()=>p({});return document.addEventListener(hs,E),()=>document.removeEventListener(hs,E)},[]),c.jsx(La.div,{...l,ref:v,style:{pointerEvents:w?_?"auto":"none":void 0,...t.style},onFocusCapture:Bn(t.onFocusCapture,k.onFocusCapture),onBlurCapture:Bn(t.onBlurCapture,k.onBlurCapture),onPointerDownCapture:Bn(t.onPointerDownCapture,S.onPointerDownCapture)})});Ls.displayName=Lh;var Mh="DismissableLayerBranch",Uh=f.forwardRef((t,e)=>{const r=f.useContext(Ma),n=f.useRef(null),s=$a(e,n);return f.useEffect(()=>{const o=n.current;if(o)return r.branches.add(o),()=>{r.branches.delete(o)}},[r.branches]),c.jsx(La.div,{...t,ref:s})});Uh.displayName=Mh;function Bh(t,e=globalThis==null?void 0:globalThis.document){const r=Da(t),n=f.useRef(!1),s=f.useRef(()=>{});return f.useEffect(()=>{const o=a=>{if(a.target&&!n.current){let l=function(){Ua($h,r,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);n.current=!1},i=window.setTimeout(()=>{e.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(i),e.removeEventListener("pointerdown",o),e.removeEventListener("click",s.current)}},[e,r]),{onPointerDownCapture:()=>n.current=!0}}function Fh(t,e=globalThis==null?void 0:globalThis.document){const r=Da(t),n=f.useRef(!1);return f.useEffect(()=>{const s=o=>{o.target&&!n.current&&Ua(Dh,r,{originalEvent:o},{discrete:!1})};return e.addEventListener("focusin",s),()=>e.removeEventListener("focusin",s)},[e,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function Co(){const t=new CustomEvent(hs);document.dispatchEvent(t)}function Ua(t,e,r,{discrete:n}){const s=r.originalEvent.target,o=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:r});e&&s.addEventListener(t,e,{once:!0}),n?Ph(s,o):s.dispatchEvent(o)}var Hh=globalThis!=null&&globalThis.document?f.useLayoutEffect:()=>{},Vh=Bt[" useId ".trim().toString()]||(()=>{}),Wh=0;function qh(t){const[e,r]=f.useState(Vh());return Hh(()=>{r(n=>n??String(Wh++))},[t]),e?`radix-${e}`:""}const zh=["top","right","bottom","left"],rt=Math.min,de=Math.max,nn=Math.round,Cr=Math.floor,Ie=t=>({x:t,y:t}),Kh={left:"right",right:"left",bottom:"top",top:"bottom"},Jh={start:"end",end:"start"};function fs(t,e,r){return de(t,rt(e,r))}function Ve(t,e){return typeof t=="function"?t(e):t}function We(t){return t.split("-")[0]}function Ht(t){return t.split("-")[1]}function $s(t){return t==="x"?"y":"x"}function Ds(t){return t==="y"?"height":"width"}const Gh=new Set(["top","bottom"]);function Ne(t){return Gh.has(We(t))?"y":"x"}function Ms(t){return $s(Ne(t))}function Yh(t,e,r){r===void 0&&(r=!1);const n=Ht(t),s=Ms(t),o=Ds(s);let i=s==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(i=sn(i)),[i,sn(i)]}function Xh(t){const e=sn(t);return[ps(t),e,ps(e)]}function ps(t){return t.replace(/start|end/g,e=>Jh[e])}const jo=["left","right"],Po=["right","left"],Qh=["top","bottom"],Zh=["bottom","top"];function ef(t,e,r){switch(t){case"top":case"bottom":return r?e?Po:jo:e?jo:Po;case"left":case"right":return e?Qh:Zh;default:return[]}}function tf(t,e,r,n){const s=Ht(t);let o=ef(We(t),r==="start",n);return s&&(o=o.map(i=>i+"-"+s),e&&(o=o.concat(o.map(ps)))),o}function sn(t){return t.replace(/left|right|bottom|top/g,e=>Kh[e])}function rf(t){return{top:0,right:0,bottom:0,left:0,...t}}function Ba(t){return typeof t!="number"?rf(t):{top:t,right:t,bottom:t,left:t}}function on(t){const{x:e,y:r,width:n,height:s}=t;return{width:n,height:s,top:r,left:e,right:e+n,bottom:r+s,x:e,y:r}}function Oo(t,e,r){let{reference:n,floating:s}=t;const o=Ne(e),i=Ms(e),a=Ds(i),l=We(e),u=o==="y",d=n.x+n.width/2-s.width/2,h=n.y+n.height/2-s.height/2,m=n[a]/2-s[a]/2;let p;switch(l){case"top":p={x:d,y:n.y-s.height};break;case"bottom":p={x:d,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:h};break;case"left":p={x:n.x-s.width,y:h};break;default:p={x:n.x,y:n.y}}switch(Ht(e)){case"start":p[i]-=m*(r&&u?-1:1);break;case"end":p[i]+=m*(r&&u?-1:1);break}return p}const nf=async(t,e,r)=>{const{placement:n="bottom",strategy:s="absolute",middleware:o=[],platform:i}
3=r,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}=Oo(u,n,l),m=n,p={},v=0;for(let g=0;g<a.length;g++){const{name:y,fn:x}=a[g],{x:b,y:w,data:_,reset:S}=await x({x:d,y:h,initialPlacement:n,placement:m,strategy:s,middlewareData:p,rects:u,platform:i,elements:{reference:t,floating:e}});d=b??d,h=w??h,p={...p,[y]:{...p[y],..._}},S&&v<=50&&(v++,typeof S=="object"&&(S.placement&&(m=S.placement),S.rects&&(u=S.rects===!0?await i.getElementRects({reference:t,floating:e,strategy:s}):S.rects),{x:d,y:h}=Oo(u,m,l)),g=-1)}return{x:d,y:h,placement:m,strategy:s,middlewareData:p}};async function or(t,e){var r;e===void 0&&(e={});const{x:n,y:s,platform:o,rects:i,elements:a,strategy:l}=t,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:m=!1,padding:p=0}=Ve(e,t),v=Ba(p),y=a[m?h==="floating"?"reference":"floating":h],x=on(await o.getClippingRect({element:(r=await(o.isElement==null?void 0:o.isElement(y)))==null||r?y:y.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:u,rootBoundary:d,strategy:l})),b=h==="floating"?{x:n,y:s,width:i.floating.width,height:i.floating.height}:i.reference,w=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),_=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},S=on(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:w,strategy:l}):b);return{top:(x.top-S.top+v.top)/_.y,bottom:(S.bottom-x.bottom+v.bottom)/_.y,left:(x.left-S.left+v.left)/_.x,right:(S.right-x.right+v.right)/_.x}}const sf=t=>({name:"arrow",options:t,async fn(e){const{x:r,y:n,placement:s,rects:o,platform:i,elements:a,middlewareData:l}=e,{element:u,padding:d=0}=Ve(t,e)||{};if(u==null)return{};const h=Ba(d),m={x:r,y:n},p=Ms(s),v=Ds(p),g=await i.getDimensions(u),y=p==="y",x=y?"top":"left",b=y?"bottom":"right",w=y?"clientHeight":"clientWidth",_=o.reference[v]+o.reference[p]-m[p]-o.floating[v],S=m[p]-o.reference[p],k=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u));let E=k?k[w]:0;(!E||!await(i.isElement==null?void 0:i.isElement(k)))&&(E=a.floating[w]||o.floating[v]);const $=_/2-S/2,L=E/2-g[v]/2-1,B=rt(h[x],L),F=rt(h[b],L),M=B,q=E-g[v]-F,P=E/2-g[v]/2+$,K=fs(M,P,q),H=!l.arrow&&Ht(s)!=null&&P!==K&&o.reference[v]/2-(P<M?B:F)-g[v]/2<0,W=H?P<M?P-M:P-q:0;return{[p]:m[p]+W,data:{[p]:K,centerOffset:P-K-W,...H&&{alignmentOffset:W}},reset:H}}}),of=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var r,n;const{placement:s,middlewareData:o,rects:i,initialPlacement:a,platform:l,elements:u}=e,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:m,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:g=!0,...y}=Ve(t,e);if((r=o.arrow)!=null&&r.alignmentOffset)return{};const x=We(s),b=Ne(a),w=We(a)===a,_=await(l.isRTL==null?void 0:l.isRTL(u.floating)),S=m||(w||!g?[sn(a)]:Xh(a)),k=v!=="none";!m&&k&&S.push(...tf(a,g,v,_));const E=[a,...S],$=await or(e,y),L=[];let B=((n=o.flip)==null?void 0:n.overflows)||[];if(d&&L.push($[x]),h){const P=Yh(s,i,_);L.push($[P[0]],$[P[1]])}if(B=[...B,{placement:s,overflows:L}],!L.every(P=>P<=0)){var F,M;const P=(((F=o.flip)==null?void 0:F.index)||0)+1,K=E[P];if(K&&(!(h==="alignment"?b!==Ne(K):!1)||B.every(D=>D.overflows[0]>0&&Ne(D.placement)===b)))return{data:{index:P,overflows:B},reset:{placement:K}};let H=(M=B.filter(W=>W.overflows[0]<=0).sort((W,D)=>W.overflows[1]-D.overflows[1])[0])==null?void 0:M.placement;if(!H)switch(p){case"bestFit":{var q;const W=(q=B.filter(D=>{if(k){const N=Ne(D.placement);return N===b||N==="y"}return!0}).map(D=>[D.placement,D.overflows.filter(N=>N>0).reduce((N,Y)=>N+Y,0)]).sort((D,N)=>D[1]-N[1])[0])==null?void 0:q[0];W&&(H=W);break}case"initialPlacement":H=a;break}if(s!==H)return{reset:{placement:H}}}return{}}}};function No(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Io(t){return zh.some(e=>t[e]>=0)}const af=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:r}=e,{strategy:n="referenceHidden",...s}=Ve(t,e);switch(n){case"referenceHidden":{const o=await or(e,{...s,elementContext:"reference"}),i=No(o,r.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:Io(i)}}}case"escaped":{const o=await or(e,{...s,altBoundary:!0}),i=No(o,r.floating);return{data:{escapedOffsets:i,escaped:Io(i)}}}default:return{}}}}},Fa=new Set(["left","top"]);async function lf(t,e){const{placement:r,platform:n,elements:s}=t,o=await(n.isRTL==null?void 0:n.isRTL(s.floating)),i=We(r),a=Ht(r),l=Ne(r)==="y",u=Fa.has(i)?-1:1,d=o&&l?-1:1,h=Ve(e,t);let{mainAxis:m,crossAxis:p,alignmentAxis:v}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}
3:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&typeof v=="number"&&(p=a==="end"?v*-1:v),l?{x:p*d,y:m*u}:{x:m*u,y:p*d}}const cf=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var r,n;const{x:s,y:o,placement:i,middlewareData:a}=e,l=await lf(e,t);return i===((r=a.offset)==null?void 0:r.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:s+l.x,y:o+l.y,data:{...l,placement:i}}}}},uf=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:r,y:n,placement:s}=e,{mainAxis:o=!0,crossAxis:i=!1,limiter:a={fn:y=>{let{x,y:b}=y;return{x,y:b}}},...l}=Ve(t,e),u={x:r,y:n},d=await or(e,l),h=Ne(We(s)),m=$s(h);let p=u[m],v=u[h];if(o){const y=m==="y"?"top":"left",x=m==="y"?"bottom":"right",b=p+d[y],w=p-d[x];p=fs(b,p,w)}if(i){const y=h==="y"?"top":"left",x=h==="y"?"bottom":"right",b=v+d[y],w=v-d[x];v=fs(b,v,w)}const g=a.fn({...e,[m]:p,[h]:v});return{...g,data:{x:g.x-r,y:g.y-n,enabled:{[m]:o,[h]:i}}}}}},df=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:r,y:n,placement:s,rects:o,middlewareData:i}=e,{offset:a=0,mainAxis:l=!0,crossAxis:u=!0}=Ve(t,e),d={x:r,y:n},h=Ne(s),m=$s(h);let p=d[m],v=d[h];const g=Ve(a,e),y=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){const w=m==="y"?"height":"width",_=o.reference[m]-o.floating[w]+y.mainAxis,S=o.reference[m]+o.reference[w]-y.mainAxis;p<_?p=_:p>S&&(p=S)}if(u){var x,b;const w=m==="y"?"width":"height",_=Fa.has(We(s)),S=o.reference[h]-o.floating[w]+(_&&((x=i.offset)==null?void 0:x[h])||0)+(_?0:y.crossAxis),k=o.reference[h]+o.reference[w]+(_?0:((b=i.offset)==null?void 0:b[h])||0)-(_?y.crossAxis:0);v<S?v=S:v>k&&(v=k)}return{[m]:p,[h]:v}}}},hf=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var r,n;const{placement:s,rects:o,platform:i,elements:a}=e,{apply:l=()=>{},...u}=Ve(t,e),d=await or(e,u),h=We(s),m=Ht(s),p=Ne(s)==="y",{width:v,height:g}=o.floating;let y,x;h==="top"||h==="bottom"?(y=h,x=m===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(x=h,y=m==="end"?"top":"bottom");const b=g-d.top-d.bottom,w=v-d.left-d.right,_=rt(g-d[y],b),S=rt(v-d[x],w),k=!e.middlewareData.shift;let E=_,$=S;if((r=e.middlewareData.shift)!=null&&r.enabled.x&&($=w),(n=e.middlewareData.shift)!=null&&n.enabled.y&&(E=b),k&&!m){const B=de(d.left,0),F=de(d.right,0),M=de(d.top,0),q=de(d.bottom,0);p?$=v-2*(B!==0||F!==0?B+F:de(d.left,d.right)):E=g-2*(M!==0||q!==0?M+q:de(d.top,d.bottom))}await l({...e,availableWidth:$,availableHeight:E});const L=await i.getDimensions(a.floating);return v!==L.width||g!==L.height?{reset:{rects:!0}}:{}}}};function bn(){return typeof window<"u"}function Vt(t){return Ha(t)?(t.nodeName||"").toLowerCase():"#document"}function pe(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function De(t){var e;return(e=(Ha(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Ha(t){return bn()?t instanceof Node||t instanceof pe(t).Node:!1}function Te(t){return bn()?t instanceof Element||t instanceof pe(t).Element:!1}function Le(t){return bn()?t instanceof HTMLElement||t instanceof pe(t).HTMLElement:!1}function Lo(t){return!bn()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof pe(t).ShadowRoot}const ff=new Set(["inline","contents"]);function yr(t){const{overflow:e,overflowX:r,overflowY:n,display:s}=Re(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+r)&&!ff.has(s)}const pf=new Set(["table","td","th"]);function mf(t){return pf.has(Vt(t))}const gf=[":popover-open",":modal"];function wn(t){return gf.some(e=>{try{return t.matches(e)}catch{return!1}})}const vf=["transform","translate","scale","rotate","perspective"],yf=["transform","translate","scale","rotate","perspective","filter"],bf=["paint","layout","strict","content"];function Us(t){const e=Bs(),r=Te(t)?Re(t):t;return vf.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!e&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!e&&(r.filter?r.filter!=="none":!1)||yf.some(n=>(r.willChange||"").includes(n))||bf.some(n=>(r.contain||"").includes(n))}function wf(t){let e=nt(t);for(;Le(e)&&!Dt(e);){if(Us(e))return e;if(wn(e))return null;e=nt(e)}return null}function Bs(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const xf=new Set(["html","body","#document"]);function Dt(t){return xf.has(Vt(t))}function Re(t){return pe(t).getComputedStyle(t)}function xn(t){return Te(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function nt(t){if(Vt(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Lo(t)&&t.host||De(t);return Lo(e)?e.host:e}function Va(t){const e=nt(t);return Dt(e)?t.ownerDocument?t.ownerDocument.body:t.body:Le(e)&&yr(e)?e:Va(e)}function ir(t,e,r){var n;e===void 0&&(e=[]),r===void 0&&(r=!0);const s=Va(t),o=s===((n=t.ownerDocument)==null?void 0:n.body),i=pe(s);if(o){const a=ms(i);
3return e.concat(i,i.visualViewport||[],yr(s)?s:[],a&&r?ir(a):[])}return e.concat(s,ir(s,[],r))}function ms(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Wa(t){const e=Re(t);let r=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const s=Le(t),o=s?t.offsetWidth:r,i=s?t.offsetHeight:n,a=nn(r)!==o||nn(n)!==i;return a&&(r=o,n=i),{width:r,height:n,$:a}}function Fs(t){return Te(t)?t:t.contextElement}function It(t){const e=Fs(t);if(!Le(e))return Ie(1);const r=e.getBoundingClientRect(),{width:n,height:s,$:o}=Wa(e);let i=(o?nn(r.width):r.width)/n,a=(o?nn(r.height):r.height)/s;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const _f=Ie(0);function qa(t){const e=pe(t);return!Bs()||!e.visualViewport?_f:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Ef(t,e,r){return e===void 0&&(e=!1),!r||e&&r!==pe(t)?!1:e}function mt(t,e,r,n){e===void 0&&(e=!1),r===void 0&&(r=!1);const s=t.getBoundingClientRect(),o=Fs(t);let i=Ie(1);e&&(n?Te(n)&&(i=It(n)):i=It(t));const a=Ef(o,r,n)?qa(o):Ie(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 m=pe(o),p=n&&Te(n)?pe(n):n;let v=m,g=ms(v);for(;g&&n&&p!==v;){const y=It(g),x=g.getBoundingClientRect(),b=Re(g),w=x.left+(g.clientLeft+parseFloat(b.paddingLeft))*y.x,_=x.top+(g.clientTop+parseFloat(b.paddingTop))*y.y;l*=y.x,u*=y.y,d*=y.x,h*=y.y,l+=w,u+=_,v=pe(g),g=ms(v)}}return on({width:d,height:h,x:l,y:u})}function Hs(t,e){const r=xn(t).scrollLeft;return e?e.left+r:mt(De(t)).left+r}function za(t,e,r){r===void 0&&(r=!1);const n=t.getBoundingClientRect(),s=n.left+e.scrollLeft-(r?0:Hs(t,n)),o=n.top+e.scrollTop;return{x:s,y:o}}function Sf(t){let{elements:e,rect:r,offsetParent:n,strategy:s}=t;const o=s==="fixed",i=De(n),a=e?wn(e.floating):!1;if(n===i||a&&o)return r;let l={scrollLeft:0,scrollTop:0},u=Ie(1);const d=Ie(0),h=Le(n);if((h||!h&&!o)&&((Vt(n)!=="body"||yr(i))&&(l=xn(n)),Le(n))){const p=mt(n);u=It(n),d.x=p.x+n.clientLeft,d.y=p.y+n.clientTop}const m=i&&!h&&!o?za(i,l,!0):Ie(0);return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-l.scrollLeft*u.x+d.x+m.x,y:r.y*u.y-l.scrollTop*u.y+d.y+m.y}}function kf(t){return Array.from(t.getClientRects())}function Tf(t){const e=De(t),r=xn(t),n=t.ownerDocument.body,s=de(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),o=de(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let i=-r.scrollLeft+Hs(t);const a=-r.scrollTop;return Re(n).direction==="rtl"&&(i+=de(e.clientWidth,n.clientWidth)-s),{width:s,height:o,x:i,y:a}}function Rf(t,e){const r=pe(t),n=De(t),s=r.visualViewport;let o=n.clientWidth,i=n.clientHeight,a=0,l=0;if(s){o=s.width,i=s.height;const u=Bs();(!u||u&&e==="fixed")&&(a=s.offsetLeft,l=s.offsetTop)}return{width:o,height:i,x:a,y:l}}const Af=new Set(["absolute","fixed"]);function Cf(t,e){const r=mt(t,!0,e==="fixed"),n=r.top+t.clientTop,s=r.left+t.clientLeft,o=Le(t)?It(t):Ie(1),i=t.clientWidth*o.x,a=t.clientHeight*o.y,l=s*o.x,u=n*o.y;return{width:i,height:a,x:l,y:u}}function $o(t,e,r){let n;if(e==="viewport")n=Rf(t,r);else if(e==="document")n=Tf(De(t));else if(Te(e))n=Cf(e,r);else{const s=qa(t);n={x:e.x-s.x,y:e.y-s.y,width:e.width,height:e.height}}return on(n)}function Ka(t,e){const r=nt(t);return r===e||!Te(r)||Dt(r)?!1:Re(r).position==="fixed"||Ka(r,e)}function jf(t,e){const r=e.get(t);if(r)return r;let n=ir(t,[],!1).filter(a=>Te(a)&&Vt(a)!=="body"),s=null;const o=Re(t).position==="fixed";let i=o?nt(t):t;for(;Te(i)&&!Dt(i);){const a=Re(i),l=Us(i);!l&&a.position==="fixed"&&(s=null),(o?!l&&!s:!l&&a.position==="static"&&!!s&&Af.has(s.position)||yr(i)&&!l&&Ka(t,i))?n=n.filter(d=>d!==i):s=a,i=nt(i)}return e.set(t,n),n}function Pf(t){let{element:e,boundary:r,rootBoundary:n,strategy:s}=t;const i=[...r==="clippingAncestors"?wn(e)?[]:jf(e,this._c):[].concat(r),n],a=i[0],l=i.reduce((u,d)=>{const h=$o(e,d,s);return u.top=de(h.top,u.top),u.right=rt(h.right,u.right),u.bottom=rt(h.bottom,u.bottom),u.left=de(h.left,u.left),u},$o(e,a,s));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Of(t){const{width:e,height:r}=Wa(t);return{width:e,height:r}}function Nf(t,e,r){const n=Le(e),s=De(e),o=r==="fixed",i=mt(t,!0,o,e);let a={scrollLeft:0,scrollTop:0};const l=Ie(0);function u(){l.x=Hs(s)}if(n||!n&&!o)if((Vt(e)!=="body"||yr(s))&&(a=xn(e)),n){const p=mt(e,!0,o,e);l.x=p.x+e.clientLeft,l.y=p.y+e.clientTop}else s&&u();o&&!n&&s&&u();const d=s&&!n&&!o?za(s,a):Ie(0),h=i.left+a.scrollLeft-l.x-d.x,m=i.top+a.scrollTop-l.y-d.y;return{x:h,y:m,width:i.width,height:i.height}}function Fn(t){return Re(t).position==="static"}function Do(t,e){if(!Le(t)||Re(t).position==="fixed")return null;if(e)return e(t);let r=t.offsetParent;return De(t)===r&&(r=r.ownerDocument.body),r}function Ja(t,e){const r=pe(t);if(wn(t))return r;if(!Le(t)){let s=nt(t);for(;s&&!Dt(s);
3){if(Te(s)&&!Fn(s))return s;s=nt(s)}return r}let n=Do(t,e);for(;n&&mf(n)&&Fn(n);)n=Do(n,e);return n&&Dt(n)&&Fn(n)&&!Us(n)?r:n||wf(t)||r}const If=async function(t){const e=this.getOffsetParent||Ja,r=this.getDimensions,n=await r(t.floating);return{reference:Nf(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function Lf(t){return Re(t).direction==="rtl"}const $f={convertOffsetParentRelativeRectToViewportRelativeRect:Sf,getDocumentElement:De,getClippingRect:Pf,getOffsetParent:Ja,getElementRects:If,getClientRects:kf,getDimensions:Of,getScale:It,isElement:Te,isRTL:Lf};function Ga(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Df(t,e){let r=null,n;const s=De(t);function o(){var a;clearTimeout(n),(a=r)==null||a.disconnect(),r=null}function i(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();const u=t.getBoundingClientRect(),{left:d,top:h,width:m,height:p}=u;if(a||e(),!m||!p)return;const v=Cr(h),g=Cr(s.clientWidth-(d+m)),y=Cr(s.clientHeight-(h+p)),x=Cr(d),w={rootMargin:-v+"px "+-g+"px "+-y+"px "+-x+"px",threshold:de(0,rt(1,l))||1};let _=!0;function S(k){const E=k[0].intersectionRatio;if(E!==l){if(!_)return i();E?i(!1,E):n=setTimeout(()=>{i(!1,1e-7)},1e3)}E===1&&!Ga(u,t.getBoundingClientRect())&&i(),_=!1}try{r=new IntersectionObserver(S,{...w,root:s.ownerDocument})}catch{r=new IntersectionObserver(S,w)}r.observe(t)}return i(!0),o}function Mf(t,e,r,n){n===void 0&&(n={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,u=Fs(t),d=s||o?[...u?ir(u):[],...ir(e)]:[];d.forEach(x=>{s&&x.addEventListener("scroll",r,{passive:!0}),o&&x.addEventListener("resize",r)});const h=u&&a?Df(u,r):null;let m=-1,p=null;i&&(p=new ResizeObserver(x=>{let[b]=x;b&&b.target===u&&p&&(p.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var w;(w=p)==null||w.observe(e)})),r()}),u&&!l&&p.observe(u),p.observe(e));let v,g=l?mt(t):null;l&&y();function y(){const x=mt(t);g&&!Ga(g,x)&&r(),g=x,v=requestAnimationFrame(y)}return r(),()=>{var x;d.forEach(b=>{s&&b.removeEventListener("scroll",r),o&&b.removeEventListener("resize",r)}),h==null||h(),(x=p)==null||x.disconnect(),p=null,l&&cancelAnimationFrame(v)}}const Uf=cf,Bf=uf,Ff=of,Hf=hf,Vf=af,Mo=sf,Wf=df,qf=(t,e,r)=>{const n=new Map,s={platform:$f,...r},o={...s.platform,_c:n};return nf(t,e,{...s,platform:o})};var zf=typeof document<"u",Kf=function(){},Gr=zf?f.useLayoutEffect:Kf;function an(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 r,n,s;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(r=t.length,r!==e.length)return!1;for(n=r;n--!==0;)if(!an(t[n],e[n]))return!1;return!0}if(s=Object.keys(t),r=s.length,r!==Object.keys(e).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(e,s[n]))return!1;for(n=r;n--!==0;){const o=s[n];if(!(o==="_owner"&&t.$$typeof)&&!an(t[o],e[o]))return!1}return!0}return t!==t&&e!==e}function Ya(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Uo(t,e){const r=Ya(t);return Math.round(e*r)/r}function Hn(t){const e=f.useRef(t);return Gr(()=>{e.current=t}),e}function Jf(t){t===void 0&&(t={});const{placement:e="bottom",strategy:r="absolute",middleware:n=[],platform:s,elements:{reference:o,floating:i}={},transform:a=!0,whileElementsMounted:l,open:u}=t,[d,h]=f.useState({x:0,y:0,strategy:r,placement:e,middlewareData:{},isPositioned:!1}),[m,p]=f.useState(n);an(m,n)||p(n);const[v,g]=f.useState(null),[y,x]=f.useState(null),b=f.useCallback(D=>{D!==k.current&&(k.current=D,g(D))},[]),w=f.useCallback(D=>{D!==E.current&&(E.current=D,x(D))},[]),_=o||v,S=i||y,k=f.useRef(null),E=f.useRef(null),$=f.useRef(d),L=l!=null,B=Hn(l),F=Hn(s),M=Hn(u),q=f.useCallback(()=>{if(!k.current||!E.current)return;const D={placement:e,strategy:r,middleware:m};F.current&&(D.platform=F.current),qf(k.current,E.current,D).then(N=>{const Y={...N,isPositioned:M.current!==!1};P.current&&!an($.current,Y)&&($.current=Y,Ut.flushSync(()=>{h(Y)}))})},[m,e,r,F,M]);Gr(()=>{u===!1&&$.current.isPositioned&&($.current.isPositioned=!1,h(D=>({...D,isPositioned:!1})))},[u]);const P=f.useRef(!1);Gr(()=>(P.current=!0,()=>{P.current=!1}),[]),Gr(()=>
3{if(_&&(k.current=_),S&&(E.current=S),_&&S){if(B.current)return B.current(_,S,q);q()}},[_,S,q,B,L]);const K=f.useMemo(()=>({reference:k,floating:E,setReference:b,setFloating:w}),[b,w]),H=f.useMemo(()=>({reference:_,floating:S}),[_,S]),W=f.useMemo(()=>{const D={position:r,left:0,top:0};if(!H.floating)return D;const N=Uo(H.floating,d.x),Y=Uo(H.floating,d.y);return a?{...D,transform:"translate("+N+"px, "+Y+"px)",...Ya(H.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:N,top:Y}},[r,a,H.floating,d.x,d.y]);return f.useMemo(()=>({...d,update:q,refs:K,elements:H,floatingStyles:W}),[d,q,K,H,W])}const Gf=t=>{function e(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:t,fn(r){const{element:n,padding:s}=typeof t=="function"?t(r):t;return n&&e(n)?n.current!=null?Mo({element:n.current,padding:s}).fn(r):{}:n?Mo({element:n,padding:s}).fn(r):{}}}},Yf=(t,e)=>({...Uf(t),options:[t,e]}),Xf=(t,e)=>({...Bf(t),options:[t,e]}),Qf=(t,e)=>({...Wf(t),options:[t,e]}),Zf=(t,e)=>({...Ff(t),options:[t,e]}),ep=(t,e)=>({...Hf(t),options:[t,e]}),tp=(t,e)=>({...Vf(t),options:[t,e]}),rp=(t,e)=>({...Gf(t),options:[t,e]});var np=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],sp=np.reduce((t,e)=>{const r=qe(`Primitive.${e}`),n=f.forwardRef((s,o)=>{const{asChild:i,...a}=s,l=i?r:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...a,ref:o})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{}),op="Arrow",Xa=f.forwardRef((t,e)=>{const{children:r,width:n=10,height:s=5,...o}=t;return c.jsx(sp.svg,{...o,ref:e,width:n,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?r:c.jsx("polygon",{points:"0,0 30,0 15,10"})})});Xa.displayName=op;var ip=Xa;function Bo(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function ap(...t){return e=>{let r=!1;const n=t.map(s=>{const o=Bo(s,e);return!r&&typeof o=="function"&&(r=!0),o});if(r)return()=>{for(let s=0;s<n.length;s++){const o=n[s];typeof o=="function"?o():Bo(t[s],null)}}}}function Qa(...t){return f.useCallback(ap(...t),t)}function lp(t,e=[]){let r=[];function n(o,i){const a=f.createContext(i);a.displayName=o+"Context";const l=r.length;r=[...r,i];const u=h=>{var x;const{scope:m,children:p,...v}=h,g=((x=m==null?void 0:m[t])==null?void 0:x[l])||a,y=f.useMemo(()=>v,Object.values(v));return c.jsx(g.Provider,{value:y,children:p})};u.displayName=o+"Provider";function d(h,m){var g;const p=((g=m==null?void 0:m[t])==null?void 0:g[l])||a,v=f.useContext(p);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=r.map(i=>f.createContext(i));return function(a){const l=(a==null?void 0:a[t])||o;return f.useMemo(()=>({[`__scope${t}`]:{...a,[t]:l}}),[a,l])}};return s.scopeName=t,[n,cp(s,...e)]}function cp(...t){const e=t[0];if(t.length===1)return e;const r=()=>{const n=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const i=n.reduce((a,{useScope:l,scopeName:u})=>{const h=l(o)[`__scope${u}`];return{...a,...h}},{});return f.useMemo(()=>({[`__scope${e.scopeName}`]:i}),[i])}};return r.scopeName=e.scopeName,r}var up=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Za=up.reduce((t,e)=>{const r=qe(`Primitive.${e}`),n=f.forwardRef((s,o)=>{const{asChild:i,...a}=s,l=i?r:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...a,ref:o})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function dp(t){const e=f.useRef(t);return f.useEffect(()=>{e.current=t}),f.useMemo(()=>(...r)=>{var n;return(n=e.current)==null?void 0:n.call(e,...r)},[])}var Yr=globalThis!=null&&globalThis.document?f.useLayoutEffect:()=>{};function hp(t){const[e,r]=f.useState(void 0);return Yr(()=>{if(t){r({width:t.offsetWidth,height:t.offsetHeight});const n=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;r({width:i,height:a})});return n.observe(t,{box:"border-box"}),()=>n.unobserve(t)}else r(void 0)},[t]),e}var Vs="Popper",[el,tl]=lp(Vs),[fp,rl]=el(Vs),nl=t=>{const{__scopePopper:e,children:r}=t,[n,s]=f.useState(null),[o,i]=f.useState(void 0);return c.jsx(fp,{scope:e,anchor:n,onAnchorChange:s,placementState:o,setPlacementState:i,children:r})};
3nl.displayName=Vs;var sl="PopperAnchor",ol=f.forwardRef((t,e)=>{const{__scopePopper:r,virtualRef:n,...s}=t,o=rl(sl,r),i=f.useRef(null),a=o.onAnchorChange,l=f.useCallback(v=>{i.current=v,v&&a(v)},[a]),u=Qa(e,l),d=f.useRef(null);f.useEffect(()=>{if(!n)return;const v=d.current;d.current=n.current,v!==d.current&&a(d.current)});const h=o.placementState&&qs(o.placementState),m=h==null?void 0:h[0],p=h==null?void 0:h[1];return n?null:c.jsx(Za.div,{"data-radix-popper-side":m,"data-radix-popper-align":p,...s,ref:u})});ol.displayName=sl;var Ws="PopperContent",[pp,mp]=el(Ws),il=f.forwardRef((t,e)=>{var vt,Je,st,Ge,yt,zt;const{__scopePopper:r,side:n="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:m=!1,updatePositionStrategy:p="optimized",onPlaced:v,...g}=t,y=rl(Ws,r),[x,b]=f.useState(null),w=Qa(e,ot=>b(ot)),[_,S]=f.useState(null),k=hp(_),E=(k==null?void 0:k.width)??0,$=(k==null?void 0:k.height)??0,L=n+(o!=="center"?"-"+o:""),B=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},F=u?Array.isArray(u)?u:[u]:void 0,M=F!==void 0&&F.length>0,q={padding:B,boundary:F==null?void 0:F.filter(vp),altBoundary:M},{refs:P,floatingStyles:K,placement:H,isPositioned:W,middlewareData:D}=Jf({strategy:"fixed",placement:L,whileElementsMounted:(...ot)=>Mf(...ot,{animationFrame:p==="always"}),elements:{reference:y.anchor},middleware:[Yf({mainAxis:s+$,alignmentAxis:i}),l&&Xf({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?Qf():void 0,...q}),l&&Zf({...q}),ep({...q,apply:({elements:ot,rects:xr,availableWidth:_r,availableHeight:Pn})=>{const{width:Kt,height:On}=xr.reference,it=ot.floating.style;it.setProperty("--radix-popper-available-width",`${_r}px`),it.setProperty("--radix-popper-available-height",`${Pn}px`),it.setProperty("--radix-popper-anchor-width",`${Kt}px`),it.setProperty("--radix-popper-anchor-height",`${On}px`)}}),_&&rp({element:_,padding:a}),yp({arrowWidth:E,arrowHeight:$}),m&&tp({strategy:"referenceHidden",...q})]}),N=y.setPlacementState;Yr(()=>(N(H),()=>{N(void 0)}),[H,N]);const[Y,ze]=qs(H),V=dp(v);Yr(()=>{W&&(V==null||V())},[W,V]);const z=(vt=D.arrow)==null?void 0:vt.x,J=(Je=D.arrow)==null?void 0:Je.y,oe=((st=D.arrow)==null?void 0:st.centerOffset)!==0,[Ke,Q]=f.useState();return Yr(()=>{x&&Q(window.getComputedStyle(x).zIndex)},[x]),c.jsx("div",{ref:P.setFloating,"data-radix-popper-content-wrapper":"",style:{...K,transform:W?K.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Ke,"--radix-popper-transform-origin":[(Ge=D.transformOrigin)==null?void 0:Ge.x,(yt=D.transformOrigin)==null?void 0:yt.y].join(" "),...((zt=D.hide)==null?void 0:zt.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:c.jsx(pp,{scope:r,placedSide:Y,placedAlign:ze,onArrowChange:S,arrowX:z,arrowY:J,shouldHideArrow:oe,children:c.jsx(Za.div,{"data-side":Y,"data-align":ze,...g,ref:w,style:{...g.style,animation:W?void 0:"none"}})})})});il.displayName=Ws;var al="PopperArrow",gp={top:"bottom",right:"left",bottom:"top",left:"right"},ll=f.forwardRef(function(e,r){const{__scopePopper:n,...s}=e,o=mp(al,n),i=gp[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(ip,{...s,ref:r,style:{...s.style,display:"block"}})})});ll.displayName=al;function vp(t){return t!==null}var yp=t=>({name:"transformOrigin",options:t,fn(e){var y,x,b;const{placement:r,rects:n,middlewareData:s}=e,i=((y=s.arrow)==null?void 0:y.centerOffset)!==0,a=i?0:t.arrowWidth,l=i?0:t.arrowHeight,[u,d]=qs(r),h={start:"0%",center:"50%",end:"100%"}[d],m=(((x=s.arrow)==null?void 0:x.x)??0)+a/2,p=(((b=s.arrow)==null?void 0:b.y)??0)+l/2;let v="",g="";return u==="bottom"?(v=i?h:`${m}px`,g=`${-l}px`):u==="top"?(v=i?h:`${m}px`,g=`${n.floating.height+l}px`):u==="right"?(v=`${-l}px`,g=i?h:`${p}px`):u==="left"&&(v=`${n.floating.width+l}px`,g=i?h:`${p}px`),{data:{x:v,y:g}}}});function qs(t){const[e,r="center"]=t.split("-");return[e,r]}var bp=nl,wp=ol,xp=il,_p=ll,Ep=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Sp=Ep.reduce((t,e)=>{const r=qe(`Primitive.${e}`),n=f.forwardRef((s,o)=>{const{asChild:i,...a}=s,l=i?r:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...a,ref:o})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{}),kp=globalThis!=null&&globalThis.document?f.useLayoutEffect:()=>{},Tp="Portal",cl=f.forwardRef((t,e)=>{var a;const{container:r,...n}=t,[s,o]=f.useState(!1);kp(()=>o(!0),[]);const i=r||s&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?Ut.createPortal(c.jsx(Sp.div,{...n,ref:e}),i):null});cl.displayName=Tp;var Fo=globalThis!=null&&globalThis.document?f.useLayoutEffect:()=>{};function Rp(t,e){return f.useReducer((r,n)=>e[r][n]??r,t)}var ul=t=>{const{present:e,children:r}=t,n=Ap(e),s=typeof r=="function"?r({present:n.isPresent}):f.Children.only(r),o=Cp(n.ref,jp(s));return typeof r=="function"||n.isPresent?f.cloneElement(s,{ref:o}):null};ul.displayName="Presence";function Ap(t){const[e,r]=f.useState(),n=f.useRef(null),s=f.useRef(t),o=f.useRef("none"),i=t?"mounted":"unmounted",[a,l]=Rp(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{const u=jr(n.current);o.current=a==="mounted"?u:"none"},[a]),Fo(()=>{const u=n.current,d=s.current;if(d!==t){const m=o.current,p=jr(u);t?l("MOUNT"):p==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(d&&m!==p?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,l]),Fo(()=>
3{if(e){let u;const d=e.ownerDocument.defaultView??window,h=p=>{const g=jr(n.current).includes(CSS.escape(p.animationName));if(p.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)})}},m=p=>{p.target===e&&(o.current=jr(n.current))};return e.addEventListener("animationstart",m),e.addEventListener("animationcancel",h),e.addEventListener("animationend",h),()=>{d.clearTimeout(u),e.removeEventListener("animationstart",m),e.removeEventListener("animationcancel",h),e.removeEventListener("animationend",h)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:f.useCallback(u=>{n.current=u?getComputedStyle(u):null,r(u)},[])}}function Ho(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function Cp(...t){const e=f.useRef(t);return e.current=t,f.useCallback(r=>{const n=e.current;let s=!1;const o=n.map(i=>{const a=Ho(i,r);return!s&&typeof a=="function"&&(s=!0),a});if(s)return()=>{for(let i=0;i<o.length;i++){const a=o[i];typeof a=="function"?a():Ho(n[i],null)}}},[])}function jr(t){return(t==null?void 0:t.animationName)||"none"}function jp(t){var n,s;let e=(n=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:n.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}var Pp=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],dl=Pp.reduce((t,e)=>{const r=qe(`Primitive.${e}`),n=f.forwardRef((s,o)=>{const{asChild:i,...a}=s,l=i?r:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...a,ref:o})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{}),Op=globalThis!=null&&globalThis.document?f.useLayoutEffect:()=>{},Np=Bt[" useInsertionEffect ".trim().toString()]||Op;function Ip({prop:t,defaultProp:e,onChange:r=()=>{},caller:n}){const[s,o,i]=Lp({defaultProp:e,onChange:r}),a=t!==void 0,l=a?t:s;{const d=f.useRef(t!==void 0);f.useEffect(()=>{const h=d.current;h!==a&&console.warn(`${n} is changing from ${h?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=a},[a,n])}const u=f.useCallback(d=>{var h;if(a){const m=$p(d)?d(t):d;m!==t&&((h=i.current)==null||h.call(i,m))}else o(d)},[a,t,o,i]);return[l,u]}function Lp({defaultProp:t,onChange:e}){const[r,n]=f.useState(t),s=f.useRef(r),o=f.useRef(e);return Np(()=>{o.current=e},[e]),f.useEffect(()=>{var i;s.current!==r&&((i=o.current)==null||i.call(o,r),s.current=r)},[r,s]),[r,n,o]}function $p(t){return typeof t=="function"}var Dp=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Mp="VisuallyHidden",hl=f.forwardRef((t,e)=>c.jsx(dl.span,{...t,ref:e,style:{...Dp,...t.style}}));hl.displayName=Mp;var Up=hl,[_n,Bx]=gh("Tooltip",[tl]),En=tl(),fl="TooltipProvider",Bp=700,gs="tooltip.open",[Fp,zs]=_n(fl),pl=t=>{const{__scopeTooltip:e,delayDuration:r=Bp,skipDelayDuration:n=300,disableHoverableContent:s=!1,children:o}=t,i=f.useRef(!0),a=f.useRef(!1),l=f.useRef(0);return f.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),c.jsx(Fp,{scope:e,isOpenDelayedRef:i,delayDuration:r,onOpen:f.useCallback(()=>{n<=0||(window.clearTimeout(l.current),i.current=!1)},[n]),onClose:f.useCallback(()=>{n<=0||(window.clearTimeout(l.current),l.current=window.setTimeout(()=>i.current=!0,n))},[n]),isPointerInTransitRef:a,onPointerInTransitChange:f.useCallback(u=>{a.current=u},[]),disableHoverableContent:s,children:o})};pl.displayName=fl;var ar="Tooltip",[Hp,Sn]=_n(ar),ml=t=>{const{__scopeTooltip:e,children:r,open:n,defaultOpen:s,onOpenChange:o,disableHoverableContent:i,delayDuration:a}=t,l=zs(ar,t.__scopeTooltip),u=En(e),[d,h]=f.useState(null),m=qh(),p=f.useRef(0),v=i??l.disableHoverableContent,g=a??l.delayDuration,y=f.useRef(!1),[x,b]=Ip({prop:n,defaultProp:s??!1,onChange:E=>{E?(l.onOpen(),document.dispatchEvent(new CustomEvent(gs))):l.onClose(),o==null||o(E)},caller:ar}),w=f.useMemo(()=>x?y.current?"delayed-open":"instant-open":"closed",[x]),_=f.useCallback(()=>{window.clearTimeout(p.current),p.current=0,y.current=!1,b(!0)},[b]),S=f.useCallback(()=>{window.clearTimeout(p.current),p.current=0,b(!1)},[b]),k=f.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{y.current=!0,b(!0),p.current=0},g)},[g,b]);return f.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),c.jsx(bp,{...u,children:c.jsx(Hp,{scope:e,contentId:m,open:x,stateAttribute:w,trigger:d,onTriggerChange:h,onTriggerEnter:f.useCallback(()=>{l.isOpenDelayedRef.current?k():_()},[l.isOpenDelayedRef,k,_]),onTriggerLeave:f.useCallback(()=>{v?S():(window.clearTimeout(p.current),p.current=0)},[S,v]),onOpen:_,onClose:S,disableHoverableContent:v,children:r})})};ml.displayName=ar;var vs="TooltipTrigger",gl=f.forwardRef((t,e)=>{const{__scopeTooltip:r,...n}=t,s=Sn(vs,r),o=zs(vs,r),i=En(r),a=f.useRef(null),l=Na(e,a,s.onTriggerChange),u=f.useRef(!1),d=f.useRef(!1),h=f.useCallback(()=>u.current=!1,[]);return f.useEffect(()=>()=>
3document.removeEventListener("pointerup",h),[h]),c.jsx(wp,{asChild:!0,...i,children:c.jsx(dl.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...n,ref:l,onPointerMove:_t(t.onPointerMove,m=>{m.pointerType!=="touch"&&!d.current&&!o.isPointerInTransitRef.current&&(s.onTriggerEnter(),d.current=!0)}),onPointerLeave:_t(t.onPointerLeave,()=>{s.onTriggerLeave(),d.current=!1}),onPointerDown:_t(t.onPointerDown,()=>{s.open&&s.onClose(),u.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:_t(t.onFocus,()=>{u.current||s.onOpen()}),onBlur:_t(t.onBlur,s.onClose),onClick:_t(t.onClick,s.onClose)})})});gl.displayName=vs;var Vp="TooltipPortal",[Fx,Wp]=_n(Vp,{forceMount:void 0}),Mt="TooltipContent",vl=f.forwardRef((t,e)=>{const r=Wp(Mt,t.__scopeTooltip),{forceMount:n=r.forceMount,side:s="top",...o}=t,i=Sn(Mt,t.__scopeTooltip);return c.jsx(ul,{present:n||i.open,children:i.disableHoverableContent?c.jsx(yl,{side:s,...o,ref:e}):c.jsx(qp,{side:s,...o,ref:e})})}),qp=f.forwardRef((t,e)=>{const r=Sn(Mt,t.__scopeTooltip),n=zs(Mt,t.__scopeTooltip),s=f.useRef(null),o=Na(e,s),[i,a]=f.useState(null),{trigger:l,onClose:u}=r,d=s.current,{onPointerInTransitChange:h}=n,m=f.useCallback(()=>{a(null),h(!1)},[h]),p=f.useCallback((v,g)=>{const y=v.currentTarget,x={x:v.clientX,y:v.clientY},b=Yp(x,y.getBoundingClientRect()),w=Xp(x,b),_=Qp(g.getBoundingClientRect()),S=em([...w,..._]);a(S),h(!0)},[h]);return f.useEffect(()=>()=>m(),[m]),f.useEffect(()=>{if(l&&d){const v=y=>p(y,d),g=y=>p(y,l);return l.addEventListener("pointerleave",v),d.addEventListener("pointerleave",g),()=>{l.removeEventListener("pointerleave",v),d.removeEventListener("pointerleave",g)}}},[l,d,p,m]),f.useEffect(()=>{if(i){const v=g=>{const y=g.target,x={x:g.clientX,y:g.clientY},b=(l==null?void 0:l.contains(y))||(d==null?void 0:d.contains(y)),w=!Zp(x,i);b?m():w&&(m(),u())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[l,d,i,u,m]),c.jsx(yl,{...t,ref:o})}),[zp,Kp]=_n(ar,{isInside:!1}),Jp=xh("TooltipContent"),yl=f.forwardRef((t,e)=>{const{__scopeTooltip:r,children:n,"aria-label":s,onEscapeKeyDown:o,onPointerDownOutside:i,...a}=t,l=Sn(Mt,r),u=En(r),{onClose:d}=l;return f.useEffect(()=>(document.addEventListener(gs,d),()=>document.removeEventListener(gs,d)),[d]),f.useEffect(()=>{if(l.trigger){const h=m=>{m.target instanceof Node&&m.target.contains(l.trigger)&&d()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[l.trigger,d]),c.jsx(Ls,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:h=>h.preventDefault(),onDismiss:d,children:c.jsxs(xp,{"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(Jp,{children:n}),c.jsx(zp,{scope:r,isInside:!0,children:c.jsx(Up,{id:l.contentId,role:"tooltip",children:s||n})})]})})});vl.displayName=Mt;var bl="TooltipArrow",Gp=f.forwardRef((t,e)=>{const{__scopeTooltip:r,...n}=t,s=En(r);return Kp(bl,r).isInside?null:c.jsx(_p,{...s,...n,ref:e})});Gp.displayName=bl;function Yp(t,e){const r=Math.abs(e.top-t.y),n=Math.abs(e.bottom-t.y),s=Math.abs(e.right-t.x),o=Math.abs(e.left-t.x);switch(Math.min(r,n,s,o)){case o:return"left";case s:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function Xp(t,e,r=5){const n=[];switch(e){case"top":n.push({x:t.x-r,y:t.y+r},{x:t.x+r,y:t.y+r});break;case"bottom":n.push({x:t.x-r,y:t.y-r},{x:t.x+r,y:t.y-r});break;case"left":n.push({x:t.x+r,y:t.y-r},{x:t.x+r,y:t.y+r});break;case"right":n.push({x:t.x-r,y:t.y-r},{x:t.x-r,y:t.y+r});break}return n}function Qp(t){const{top:e,right:r,bottom:n,left:s}=t;return[{x:s,y:e},{x:r,y:e},{x:r,y:n},{x:s,y:n}]}function Zp(t,e){const{x:r,y:n}=t;let s=!1;for(let o=0,i=e.length-1;o<e.length;i=o++){const a=e[o],l=e[i],u=a.x,d=a.y,h=l.x,m=l.y;d>n!=m>n&&r<(h-u)*(n-d)/(m-d)+u&&(s=!s)}return s}function em(t){const e=t.slice();return e.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),tm(e)}function tm(t){if(t.length<=1)return t.slice();const e=[];for(let n=0;n<t.length;n++){const s=t[n];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 r=[];for(let n=t.length-1;n>=0;n--){const s=t[n];for(;r.length>=2;){const o=r[r.length-1],i=r[r.length-2];if((o.x-i.x)*(s.y-i.y)>=(o.y-i.y)*(s.x-i.x))r.pop();else break}r.push(s)}return r.pop(),e.length===1&&r.length===1&&e[0].x===r[0].x&&e[0].y===r[0].y?e:e.concat(r)}var rm=pl,nm=ml,sm=gl,wl=vl;const om=rm,Hx=nm,Vx=sm,im=f.forwardRef(({className:t,sideOffset:e=4,...r},n)=>c.jsx(wl,{ref:n,sideOffset:e,className:ue("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]:sli
3de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...r}));im.displayName=wl.displayName;const am={"/summer-sale-compare-houseboats":"/compare-houseboats","/summer-sale-compare-houseboats/":"/compare-houseboats","/shasta-lake-april-houseboat-deal":"/compare-houseboats","/shasta-lake-april-houseboat-deal/":"/compare-houseboats","/labor-day-sale-houseboats":"/end-of-summer-sale-shasta-lake","/labor-day-sale-houseboats/":"/end-of-summer-sale-shasta-lake"};function lm(){const t=zi(),e=Ft();return f.useLayoutEffect(()=>{const r=am[e.pathname];if(!r)return;const n=document.createElement("meta");n.setAttribute("name","robots"),n.setAttribute("content","noindex, follow"),n.setAttribute("data-retired-promo","true"),document.head.appendChild(n),Array.from(document.head.querySelectorAll('link[rel="canonical"]')).forEach(i=>i.remove());const o=document.createElement("link");return o.setAttribute("rel","canonical"),o.setAttribute("href",`https://houseboats.com${r}`),o.setAttribute("data-retired-promo","true"),document.head.appendChild(o),()=>{document.head.querySelectorAll('[data-retired-promo="true"]').forEach(i=>i.remove())}},[e.pathname]),f.useEffect(()=>{const r=e.pathname;if(r.startsWith("/shasta-lake/")){const a=r.replace("/shasta-lake","")||"/";t(a,{replace:!0});return}if(r==="/shasta-lake"){t("/",{replace:!0});return}if(r.startsWith("/vessel/")){const a=r.replace("/vessel/","").replace(/\/$/,""),u={kayak:"/kayak","stand-up-paddle-board":"/stand-up-paddle-board","water-toys":"/water-toys","yamaha-vx100":"/jet-skis","jet-ski":"/jet-skis","paddle-board":"/stand-up-paddle-board","axis-t220-r":"/axis-t220r-wakeboard","centurion-wakeboard":"/air-warrior-wakeboard","tahoe-deck-boat-2150":"/tahoe-deck-boat","centurion-t-5":"/centurion-t5-wakeboard","centurion-t5":"/centurion-t5-wakeboard","supercruiser-party-boat":"/supercruiser-party-boat","party-cruiser-ii":"/party-cruiser-ii","patio-boat-30":"/patio-boat-30","patio-boat":"/patio-boat-silverthorn","deluxe-patio-boat":"/deluxe-patio-boat","bennington-pontoon-boat":"/bennington-pontoon","fishing-boat":"/fishing-boat"}[a];u?t(u,{replace:!0}):t(`/houseboats/${a}`,{replace:!0});return}if(r==="/vessel"){t("/houseboats",{replace:!0});return}const s={"/lake-shasta":"/shasta-lake-info/lake-shasta","/weather-reports":"/shasta-lake-info/weather-reports","/maps-locations":"/shasta-lake-info/maps-locations","/fishing":"/shasta-lake-info/fishing"}[r];if(s){t(s,{replace:!0});return}if(r.startsWith("/shasta-lake-info/")){const a=r.replace("/shasta-lake-info/","").replace(/\/$/,""),u={"lake-levels":"/lake-levels","jones-valley-resort":"/jones-valley","silverthorn-resort":"/silverthorn"}[a];u&&t(u,{replace:!0});return}if(r==="/shasta-lake-info"){t("/shasta-lake-info/lake-shasta",{replace:!0});return}const i={"/boats":"/houseboats","/fleet":"/houseboats","/rentals":"/houseboats","/compare":"/compare-houseboats","/summer-sale-compare-houseboats":"/compare-houseboats","/summer-sale-compare-houseboats/":"/compare-houseboats","/shasta-lake-april-houseboat-deal":"/compare-houseboats","/shasta-lake-april-houseboat-deal/":"/compare-houseboats","/labor-day-sale-houseboats":"/end-of-summer-sale-shasta-lake","/labor-day-sale-houseboats/":"/end-of-summer-sale-shasta-lake","/houseboat-rentals":"/houseboats","/shasta-lake-houseboats":"/houseboats","/jones-valley-watercraft":"/jones-valley-boat-rentals-shasta-lake","/jones-valley-watercraft/":"/jones-valley-boat-rentals-shasta-lake","/silverthorn-watercraft":"/silverthorn-boat-rentals-shasta-lake","/silverthorn-watercraft/":"/silverthorn-boat-rentals-shasta-lake","/shasta-lake-houseboat-rentals/jones-valley-resort":"/jones-valley-resort-houseboats","/shasta-lake-houseboat-rentals/jones-valley-resort/":"/jones-valley-resort-houseboats","/shasta-lake-houseboat-rentals/silverthorn-resort":"/silverthorn-houseboats","/shasta-lake-houseboat-rentals/silverthorn-resort/":"/silverthorn-houseboats","/silverthorn-resort-houseboats":"/silverthorn-houseboats","/silverthorn-resort-houseboats/":"/silverthorn-houseboats","/silverthorn-resort":"/silverthorn","/silverthorn-resort/":"/silverthorn","/jones-valley-resort":"/jones-valley","/jones-valley-resort/":"/jones-valley","/shasta-lake-houseboat-rentals":"/houseboats","/shasta-lake-houseboat-rentals/":"/houseboats","/pricing":"/houseboat-rental-prices","/about-us":"/","/pricing/":"/houseboat-rental-prices","/contact":"/contact-us","/contact/":"/contact-us","/faq/":"/faq","/houseboats/":"/houseboats","/houseboat-rental-prices/":"/houseboat-rental-prices","/contact-us/":"/contact-us","/marina-store/":"/marina-store","/boat-slips-storage/":"/boat-slips-storage","/compare-houseboats/":"/compare-houseboats"}[r];i&&t(i,{replace:!0})},[e.pathname,t]),null}const cm=()=>{const{pathname:t}=Ft();return f.useEffect(()=>{window.scrollTo({top:0,left:0,behavior:"instant"})},[t]),null};function um(){const t=Ft(),e=zi();return f.useEffect(()=>{const{pathname:r}=t;if(r!=="/"&&r.endsWith("/")){const n=r.slice(0,-1);e(n+t.search+t.hash,{replace:!0})}},[t,e]),null}const dm=Ki("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-lg text-sm font-semibold ring-offset-background transition-all duration-200 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",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90 shadow-sm",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",gold:"bg-accent text-accent-foreground hover:bg-accent/90 shadow-md hover:shadow-lg",goldOutline:"border-2 border-accent text-accent hover:bg-accent hover:text-accent-foreground",hero:"bg-primary text-primary-foreground hover:bg-primary/90 shadow-lg hover:shadow-xl",heroSecondary:"bg-card/90 backdrop-blur-sm text-primary border border-card/50 hover:bg-card shadow-lg",nav:"text-foreground hover:text-primary hover:bg-transparent",cta:"bg-accent text-accent-foreground font-bold shadow-md hover:shadow-lg"},size:{default:"h-11 px-5 py-2",sm:"h-9 rounded-md px-3",lg:"h-12 px-8 text-base rounded-xl",xl:"h-14 px-10 text-lg rounded-xl",icon:"h-11 w-11","icon-sm":"h-8 w-8"}},defaultVariants:{variant:"default",size:"default"}}),me=f.forwardRef(({className:t,variant:e,size:r,asChild:n=!1,...s},o)=>{const i=n?wh:"button";
3return c.jsx(i,{className:ue(dm({variant:e,size:r,className:t})),ref:o,...s})});me.displayName="Button";const hm=()=>{const[t,e]=f.useState(!1);f.useEffect(()=>{const n=()=>{e(window.scrollY>400)};return window.addEventListener("scroll",n),()=>window.removeEventListener("scroll",n)},[]);const r=()=>{window.scrollTo({top:0,behavior:"smooth"})};return c.jsx(me,{variant:"gold",size:"icon",onClick:r,"aria-label":"Back to top",className:`fixed bottom-6 right-6 z-50 rounded-full shadow-lg transition-all duration-300 ${t?"opacity-100 translate-y-0":"opacity-0 translate-y-4 pointer-events-none"}`,children:c.jsx(Fc,{className:"h-5 w-5"})})};function fm(t,e){f.useEffect(()=>{const r=Array.isArray(t)?t:[t],n=[];return document.querySelectorAll(`script[data-page-schema="${e}"]`).forEach(s=>s.remove()),r.forEach((s,o)=>{const i=document.createElement("script");i.type="application/ld+json",i.setAttribute("data-page-schema",e),i.text=JSON.stringify(s),document.head.appendChild(i),n.push(i)}),()=>{n.forEach(s=>s.remove())}},[JSON.stringify(t),e])}const xl="/assets/houseboats-logo-Bm9Cz0Wu.png",Vo=[{name:"Home",href:"/",icon:Vc},{name:"Houseboats",href:"/houseboats",icon:rn,linkDisabled:!0,hasMegaMenu:!0,megaMenu:{categories:[{title:"Quick Links",icon:oo,items:[{name:"Compare Houseboats",href:"/compare-houseboats",description:"Side-by-side comparison",icon:oo},{name:"Jones Valley Resort Houseboats",href:"/jones-valley-resort-houseboats",description:"Full-service marina with amenities",icon:Ji},{name:"Silverthorn Resort Houseboats",href:"/silverthorn-houseboats",description:"Scenic lakeside location",icon:Wc},{name:"Houseboat Rental Prices",href:"/houseboat-rental-prices",description:"View all rental rates",icon:qc}]},{title:"Our Fleet",icon:rn,items:[{name:"The Titan",href:"/houseboats/titan",description:"Luxury flagship",icon:zc},{name:"The Queen",href:"/houseboats/queen",description:"Classic elegance",icon:Kc},{name:"The Corinthian",href:"/houseboats/corinthian",description:"Premium comfort",icon:Jc},{name:"Queen I",href:"/houseboats/queen-i",description:"Refined style",icon:Gi},{name:"The Escapade",href:"/houseboats/escapade",description:"Adventure awaits",icon:$n},{name:"Queen II",href:"/houseboats/queen-ii",description:"Modern luxury",icon:Yi},{name:"The Senator",href:"/houseboats/senator",description:"Spacious retreat",icon:Gc},{name:"The Odyssey",href:"/houseboats/odyssey",description:"Intimate getaway",icon:Yc}]}]}},{name:"Small Boats",href:"/small-boats",icon:io,linkDisabled:!0,hasMegaMenu:!0,megaMenu:{categories:[{title:"Small Boat Rentals",icon:io,items:[{name:"Jones Valley Resort Small Boat Rentals",href:"/jones-valley-boat-rentals-shasta-lake",description:"Ski boats, jet skis & more",icon:Xc},{name:"Silverthorn Resort Small Boat Rentals",href:"/silverthorn-boat-rentals-shasta-lake",description:"Watercraft rentals",icon:Qc}]}]}},{name:"Trip Prep",href:"/trip-preparation",icon:$n,linkDisabled:!0,hasMegaMenu:!0,megaMenu:{categories:[{title:"Plan Your Trip",icon:$n,items:[{name:"Gathering Your Group",href:"/trip-preparation/gathering-your-group",description:"Tips for organizing your party",icon:Xi},{name:"What to Bring / Items Aboard",href:"/trip-preparation/what-to-bring",description:"Packing list & essentials",icon:Zc},{name:"Group Events",href:"/trip-preparation/group-events",description:"Corporate & special events",icon:eu},{name:"Pet Policy",href:"/trip-preparation/pet-policy",description:"Bringing your pets aboard",icon:tu},{name:"Mattress Sizes",href:"/trip-preparation/mattress-sizes",description:"Bedding specifications",icon:ru},{name:"Prior to Arrival",href:"/trip-preparation/prior-to-arrival",description:"Pre-trip checklist",icon:nu},{name:"Guest Information",href:"/trip-preparation/guest-information",description:"Important guest details",icon:su}]}]}},{name:"Shasta Lake",href:"/shasta-lake-info",icon:ao,linkDisabled:!0,hasMegaMenu:!0,megaMenu:{categories:[{title:"Lake Information",icon:ao,items:[{name:"Lake Shasta",href:"/shasta-lake-info/lake-shasta",description:"About Shasta Lake",icon:ou},{name:"Maps and Locations",href:"/shasta-lake-info/maps-locations",description:"Lake maps & points of interest",icon:iu},{name:"Fishing",href:"/shasta-lake-info/fishing",description:"Fishing guides & tips",icon:au},{name:"Weather Report",href:"/shasta-lake-info/weather-reports",description:"Current conditions",icon:lu},{name:"Live Weather Cam",href:"/shasta-lake-info/live-weather-cam",description:"Real-time Jones Valley cam",icon:is}]}]}},{name:"Services",href:"/marine-services",icon:lo,linkDisabled:!0,hasMegaMenu:!0,megaMenu:{categories:[{title:"Our Services",icon:lo,items:[{name:"Boat Slips and Storage",href:"/boat-slips-storage",description:"Marina slip rentals",
3icon:cu},{name:"Marina Store",href:"/marina-store",description:"Supplies & provisions",icon:uu}]}]}},{name:"FAQ",href:"/faq",icon:du}];function pm(){const[t,e]=f.useState(!1),[r,n]=f.useState(null),[s,o]=f.useState(null),i=f.useRef(null),a=f.useRef(null),l=d=>{i.current&&clearTimeout(i.current),a.current&&clearTimeout(a.current),a.current=setTimeout(()=>n(d),150)},u=()=>{a.current&&clearTimeout(a.current),i.current=setTimeout(()=>n(null),250)};return f.useEffect(()=>()=>{i.current&&clearTimeout(i.current),a.current&&clearTimeout(a.current)},[]),c.jsx("header",{className:"fixed top-0 left-0 right-0 z-50 bg-card/95 backdrop-blur-lg border-b border-border shadow-nav",children:c.jsxs("nav",{className:"max-w-[1920px] mx-auto px-4",children:[c.jsxs("div",{className:"flex h-20 items-center justify-between",children:[c.jsx(ee,{to:"/",className:"flex items-center",children:c.jsx("img",{src:xl,alt:"Houseboats.com",className:"h-12 w-auto",width:180,height:48,decoding:"async"})}),c.jsx("div",{className:"hidden 2xl:flex items-center gap-0",children:Vo.map(d=>c.jsxs("div",{className:"relative",onMouseEnter:()=>d.hasMegaMenu&&l(d.name),onMouseLeave:()=>d.hasMegaMenu&&u(),children:[d.linkDisabled?c.jsxs("span",{className:"flex items-center gap-1 px-3 py-2 text-base font-medium text-muted-foreground hover:text-foreground transition-colors cursor-default select-none",children:[d.name,d.hasMegaMenu&&c.jsx(Sr,{className:"w-4 h-4"})]}):c.jsxs(ee,{to:d.href,className:"flex items-center gap-1 px-3 py-2 text-base font-medium text-muted-foreground hover:text-foreground transition-colors",children:[d.name,d.hasMegaMenu&&c.jsx(Sr,{className:"w-4 h-4"})]}),d.hasMegaMenu&&d.megaMenu&&c.jsx("div",{className:`mega-menu ${r===d.name?"mega-menu-open":""}`,style:{left:"-250px",width:"850px"},children:c.jsx("div",{className:"p-8",children:c.jsx("div",{className:"grid grid-cols-2 gap-8",children:d.megaMenu.categories.map(h=>c.jsxs("div",{children:[c.jsxs("h3",{className:"flex items-center gap-2 text-sm font-semibold text-foreground mb-4 uppercase tracking-wider",children:[h.icon&&c.jsx(h.icon,{className:"w-4 h-4 text-primary"}),h.title]}),c.jsx("ul",{className:"space-y-2",children:h.items.map(m=>c.jsx("li",{children:c.jsxs(ee,{to:m.href,className:"group flex items-start gap-3 p-2 -mx-2 rounded-lg hover:bg-secondary/80 transition-all duration-200",children:[m.icon&&c.jsx("span",{className:"mt-0.5 p-1.5 rounded-md bg-primary/10 text-primary group-hover:bg-primary group-hover:text-primary-foreground transition-all duration-200",children:c.jsx(m.icon,{className:"w-4 h-4"})}),c.jsxs("div",{className:"flex-1",children:[c.jsx("span",{className:"text-sm font-medium text-foreground group-hover:text-primary transition-colors",children:m.name}),c.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 group-hover:text-foreground/70 transition-colors",children:m.description})]})]})},m.name))})]},h.title))})})})]},d.name))}),c.jsxs("div",{className:"hidden 2xl:flex items-center gap-3",children:[c.jsx(me,{variant:"ghost",size:"sm",className:"gap-2",asChild:!0,children:c.jsxs("a",{href:"tel:1-833-474-2782",children:[c.jsx(tn,{className:"w-4 h-4"}),"1 833 474-2782"]})}),c.jsx(me,{variant:"gold",size:"default",asChild:!0,children:c.jsx("a",{href:"https://rentals.houseboats.com/",target:"_blank",rel:"noopener noreferrer",children:"Book Now"})})]}),c.jsx("button",{type:"button",className:"2xl:hidden inline-flex items-center justify-center w-11 h-11 p-2 text-foreground rounded-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",onClick:()=>e(!t),"aria-label":t?"Close main menu":"Open main menu","aria-expanded":t,"aria-controls":"mobile-navigation",children:t?c.jsx(gr,{className:"w-6 h-6","aria-hidden":"true"}):c.jsx(Hc,{className:"w-6 h-6","aria-hidden":"true"})})]}),t&&c.jsx("div",{id:"mobile-navigation",className:"2xl:hidden py-4 border-t border-border animate-slide-down max-h-[calc(100vh-5rem)] overflow-y-auto",children:c.jsxs("div",{className:"flex flex-col gap-1",children:[Vo.map(d=>c.jsx("div",{children:d.hasMegaMenu&&d.megaMenu?c.jsxs("div",{children:[c.jsx("div",{className:"flex items-center",children:d.linkDisabled?c.jsxs("button",{onClick:()=>o(s===d.name?null:d.name),className:"flex-1 flex items-center gap-3 px-4 py-3 text-foreground hover:bg-secondary rounded-lg transition-colors text-left",children:[d.icon?c.jsx(d.icon,{className:"w-5 h-5 text-muted-foreground"}):c.jsx(rn,{className:"w-5 h-5 text-muted-foreground"}),d.name,c.jsx(Sr,{className:`w-5 h-5 ml-auto text-muted-foreground transition-transform duration-200 ${s===d.name?"rotate-180":""}`})]}):c.jsxs(c.Fragment,{children:[c.jsxs(ee,{to:d.href,className:"flex-1 flex items-center gap-3 px-4 py-3 text-foreground hover:bg-secondary rounded-l-lg transition-colors",onClick:()=>e(!1),children:[d.icon?c.jsx(d.icon,{className:"w-5 h-5 text-muted-foreground"}):c.jsx(rn,{className:"w-5 h-5 text-muted-foreground"}),d.name]}),c.jsx("button",{onClick:()=>o(s===d.name?null:d.name),className:"px-4 py-3 text-muted-foreground hover:bg-secondary rounded-r-lg transition-colors","aria-label":`Expand ${d.name} submenu`,children:c.jsx(Sr,{className:`w-5 h-5 transition-transform duration-200 ${s===d.name?"rotate-180":""}`})})]})}),s===d.name&&c.jsx("div",{className:"pl-4 pb-2 animate-accordion-down",children:d.megaMenu.categories.map(h=>c.jsxs("div",{className:"mt-2",children:[c.jsxs("h4",{className:"flex items-center gap-2 px-4 py-2 text-xs font-semibold text-muted-foreground uppercase tracking-wider",children:[h.icon&&c.jsx(h.icon,{className:"w-3 h-3"}),h.title]}),c.jsx("div",{className:"flex flex-col",children:h.items.map(m=>c.jsxs(ee,{to:m.href,className:"flex items-center gap-3 px-4 py-2.5 text-sm text-foreground hover:bg-secondary rounded-lg transition-colors ml-2",onClick:()=>{e(!1),o(null)},children:[m.icon&&c.jsx(m.icon,{className:"w-4 h-4 text-primary"}),c.jsx("span",{children:m.name})]},m.name))})]},h.title))})]}):c.jsxs(ee,{to:d.href,className:"flex items-center gap-3 px-4 py-3 rounded-lg text-foreground hover:bg-secondary transition-colors",onClick:()=>e(!1),children:[d.icon&&c.jsx(d.icon,{className:"w-5 h-5 text-muted-foreground"}),d.name]})},d.name)),c.jsx("div",{className:"mt-4 px-4",children:c.jsx(me,{variant:"gold",size:"lg",className:"w-full",asChild:!0,children:c.jsx("a",{href:"https://rentals.houseboats.com/",target:"_blank",rel:"noopener noreferrer",children:"Book Now"})})})]})})]})})}const mm=t=>{const e="/",r=t.startsWith("/")?t.slice(1):t;return`${e}${r}`},ae={name:"End of Summer Sale",code:"LABOR26",discountPercent:20,travelStart:"2026-08-30",travelEnd:"2026-09-30",travelLabel:"August 30 – September 30, 2026",travelShort:"8/30 – 9/30",url:"/end-of-summer-sale-shasta-lake",excludedHouseboatIds:["titan"],excludedSmallBoatIds:["jet-skis","jet-skis-silverthorn","water-toys","water-toys-silverthorn"],headline:"End of Summer Sale — 20% Off Selected Houseboats & Small Boats",terms:["New reservations only","Cannot be combined with any other offer or discount","Subject to availability"]};function ln(t){return!ae.excludedHouseboatIds.includes(t)}function Wx(t){return!ae.excludedSmallBoatIds.includes(t)}function gm(t){return Math.round(t*(1-ae.discountPercent/100))}function vm(){const[t,e]=f.useState(!1),r=f.useRef(null);return f.useEffect(()=>{const n=()=>e(!0);if("requestIdleCallback"in window){const s=requestIdleCallback(n,{timeout:5e3});return()=>cancelIdleCallback(s)}else{const s=setTimeout(n,5e3);return()=>clearTimeout(s)}},[]),c.jsxs("section",{ref:r,className:"relative min-h-[85vh] md:min-
3h-screen flex items-center justify-center overflow-hidden",style:{backgroundImage:`url(${mm("/assets/hero-bg.jpg")})`,backgroundSize:"cover",backgroundPosition:"center"},children:[c.jsxs("div",{className:"absolute inset-0 overflow-hidden",children:[t&&c.jsx("iframe",{loading:"lazy",className:"absolute pointer-events-none",src:"https://www.youtube.com/embed/b-yqrntjJdo?autoplay=1&mute=1&loop=1&playlist=b-yqrntjJdo&controls=0&showinfo=0&rel=0&modestbranding=1&playsinline=1&disablekb=1",title:"Shasta Lake houseboats background video",allow:"autoplay; encrypted-media",style:{position:"absolute",top:"50%",left:"50%",width:"100vw",height:"56.25vw",minHeight:"100vh",minWidth:"177.77vh",transform:"translate(-50%, -50%)",border:"none"}}),c.jsx("div",{className:"absolute inset-0 bg-hero-gradient"})]}),c.jsxs("div",{className:"relative z-10 section-container text-center py-20 pt-28 sm:py-24 sm:pt-32 md:py-32 md:pt-40",children:[c.jsxs(ee,{to:ae.url,className:"inline-flex flex-wrap items-center justify-center gap-2 rounded-full border border-sunset-gold/60 bg-primary/40 px-4 py-2 mb-4 sm:mb-6 text-card backdrop-blur-sm transition-colors hover:bg-primary/60 animate-fade-in-up",children:[c.jsx("span",{className:"rounded-full bg-destructive px-2.5 py-0.5 text-[11px] font-extrabold uppercase tracking-wider text-destructive-foreground",children:"End of Summer Sale"}),c.jsxs("span",{className:"text-sm sm:text-base font-semibold",children:["20% off on selected houseboats · 20% off small boats! · ",ae.travelShort," · Code"," ",c.jsx("span",{className:"whitespace-nowrap text-sunset-gold",children:ae.code})]})]}),c.jsxs("h1",{className:"font-display text-3xl sm:text-4xl md:text-5xl lg:text-6xl xl:text-7xl font-bold text-card mb-4 sm:mb-6 animate-fade-in-up delay-100 max-w-2xl md:max-w-3xl lg:max-w-5xl mx-auto leading-tight",children:["Shasta Lake Houseboat Rentals"," ",c.jsx("span",{className:"text-gradient-gold",children:"— Luxury Fleet, 6–20 Guests"})]}),c.jsx("p",{className:"text-base sm:text-lg md:text-xl lg:text-2xl text-card/90 mb-3 sm:mb-4 animate-fade-in-up delay-200 max-w-2xl md:max-w-3xl mx-auto px-2 sm:px-0",children:"Premium Shasta Lake houseboat rentals from Jones Valley Resort and Silverthorn Resort — hot tubs, waterslides, gourmet kitchens, and 365 miles of crystal-clear shoreline. Starting from $2,392 for 6 to 20 guests."}),c.jsxs("a",{href:"tel:18334742782",className:"inline-flex items-center gap-2 text-card/90 hover:text-card font-medium text-base sm:text-lg mb-6 sm:mb-8 md:mb-10 animate-fade-in-up delay-250 transition-colors",children:[c.jsx(tn,{className:"w-5 h-5"}),"1-833-474-2782"]}),c.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-center gap-3 sm:gap-4 animate-fade-in-up delay-300 px-4 sm:px-0",children:[c.jsx(me,{variant:"gold",size:"xl",asChild:!0,className:"w-full sm:w-auto sm:min-w-[200px]",children:c.jsx("a",{href:"https://rentals.houseboats.com",target:"_blank",rel:"noopener noreferrer",children:"Check Availability"})}),c.jsx(me,{variant:"heroSecondary",size:"xl",asChild:!0,className:"w-full sm:w-auto sm:min-w-[200px]",children:c.jsx(ee,{to:"/compare-houseboats",children:"View All Houseboats"})})]}),c.jsx("p",{className:"text-sm text-card/80 mt-3 sm:mt-4 animate-fade-in-up delay-300 tracking-wide",children:"Prime weeks are going fast — Book Now."}),c.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3 sm:gap-4 md:gap-6 mt-10 sm:mt-12 md:mt-16 animate-fade-in-up delay-400",children:[{value:"8",label:"Premium Houseboat Models"},{value:"30+",label:"Years Experience"},{value:"10,000+",label:"Happy Families"},{value:"365",label:"Miles of Shoreline"}].map(n=>c.jsxs("div",{className:"flex flex-col items-center p-3 sm:p-4 bg-card/10 backdrop-blur-sm rounded-xl border border-card/20",children:[c.jsx("span",{className:"text-xl sm:text-2xl md:text-3xl font-display font-bold text-sunset-gold",children:n.value}),c.jsx("span",{className:"text-xs sm:text-sm text-card/80 mt-1",children:n.label})]},n.label))})]}),c.jsx("div",{className:"absolute bottom-8 left-1/2 -translate-x-1/2 animate-bounce",children:c.jsx("div",{className:"w-6 h-10 border-2 border-card/50 rounded-full flex items-start justify-center p-2",children:c.jsx("div",{className:"w-1.5 h-2.5 bg-card/70 rounded-full animate-pulse"})})})]})}const ym="/assets/senator-houseboat-exterior-running-shasta-lake-CKLQwPWA.jpg",bm="/assets/corinthian-houseboat-jones-valley-resort-fHlrZY-Q.jpg",wm="/assets/queen-ii-houseboat-silverthorn-resort-shasta-lake-exterior-qUx915FT.jpg",xm="/assets/odyssey-houseboat-exterior-running-shasta-lake-BNuzrOs9.jpg",_m="/assets/queen-i-houseboat-shasta-lake-01-qwyI86lO.jpg",Em=1,Sm="461c8de7-1aba-4d8f-acc8-45e1402ace86",km="d7132c39-fd4e-4c6e-aac1-267f15319b28",Tm="/__l5e/assets-v1/461c8de7-1aba-4d8f-acc8-45e1402ace86/escapade-houseboat-card-shasta-lake.jpg",Rm="a/v1/d7132c39-fd4e-4c6e-aac1-267f15319b28/461c8de7-1aba-4d8f-acc8-45e1402ace86/escapade-houseboat-card-shasta-lake.jpg",Am="escapade-houseboat-card-shasta-lake.jpg",Cm=1137735,jm="image/jpeg",Pm="2026-06-25T05:31:53Z",Om={version:Em,asset_id:Sm,project_id:km,url:Tm,r2_key:Rm,original_filename:Am,size:Cm,content_type:jm,created_at:Pm},Nm="/assets/queen-houseboat-exterior-lifestyle-anchored-silverthorn-resort-DgbATYch.jpg",Im="/assets/titan-houseboat-shasta-lake-exterior-CEPkuD3c.jpg",Lm=[{id:"senator",name:"Senator",tagline:"Comfort & Convenience at Silverthorn",image:ym,sleeps:16,beds:6,bathrooms:2,length:"53 ft",priceFrom:2392,rating:4.7,reviews:89,badge:"Value Pick",bookingUrl:"https://rentals.silverthornresort.com/detail
3s/21"},{id:"corinthian",name:"Corinthian",tagline:"Gourmet Galley & Hot Tub Luxury",image:bm,sleeps:12,beds:7,bathrooms:1.5,length:"56 ft",priceFrom:3484,rating:4.8,reviews:112,badge:"Affordable Luxury",bookingUrl:"https://rentals.houseboats.com/details/4"},{id:"queen-ii",name:"Queen II",tagline:"Pinnacle of Luxury at Silverthorn",image:wm,sleeps:16,beds:7,bathrooms:3,length:"56 ft",priceFrom:3811,rating:4.9,reviews:145,badge:"Most Popular",bookingUrl:"https://rentals.silverthornresort.com/details/20"},{id:"odyssey",name:"Odyssey",tagline:"Cherry Wood Elegance & Old-World Charm",image:xm,sleeps:15,beds:8,bathrooms:1.5,length:"56 ft",priceFrom:3265,rating:4.8,reviews:98,badge:"Old-World Elegance",bookingUrl:"https://rentals.houseboats.com/details/3"},{id:"queen-i",name:"Queen I",tagline:"Ultimate Luxury for Large Groups at Silverthorn",image:_m,sleeps:20,beds:7,bathrooms:3,length:"56 ft",priceFrom:4030,rating:4.9,reviews:134,badge:"Family Favorite",bookingUrl:"https://rentals.silverthornresort.com/details/19"},{id:"escapade",name:"Escapade",tagline:"Home Theater & Ultimate Entertainment",image:Om.url,sleeps:15,beds:8,bathrooms:1.5,length:"56 ft",priceFrom:3811,rating:4.8,reviews:121,badge:"Entertainment King",bookingUrl:"https://rentals.houseboats.com/details/2"},{id:"queen",name:"Queen",tagline:"The Most Elite Vessel at Silverthorn Resort",image:Nm,sleeps:20,beds:7,bathrooms:3,length:"56 ft",priceFrom:4248,rating:4.9,reviews:156,badge:"Elite Luxury",bookingUrl:"https://rentals.silverthornresort.com/details/18"},{id:"titan",name:"Titan",tagline:"Unparalleled Luxury on Shasta Lake",image:Im,sleeps:22,beds:10,bathrooms:3,length:"65 ft",priceFrom:7087,rating:5,reviews:89,badge:"Luxury Choice",bookingUrl:"https://rentals.houseboats.com/details/1"}],$m=()=>R(()=>import("./HouseboatDetail-BBUxyNSq.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]));let Wo=!1;function Xr(){Wo||(Wo=!0,Au($m))}const Dm={onMouseEnter:Xr,onFocus:Xr,onTouchStart:Xr};function Mm({className:t=""}){return c.jsxs("span",{className:`inline-flex items-center gap-1 rounded-full bg-summer-teal px-2.5 py-1 text-[11px] font-extrabold uppercase tracking-wide text-white shadow-lg ${t}`,children:[ae.discountPercent,"% OFF · ",ae.code]})}const Um=["odyssey","escapade","queen-i","queen-ii"],Bm=Um.map(t=>Lm.find(e=>e.id===t)).filter(Boolean);function Fm({boat:t,index:e}){return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"relative aspect-[4/3] overflow-hidden",children:[c.jsx("img",{src:t.image,alt:`${t.name} luxury houseboat rental on Shasta Lake`,className:"w-full h-full object-cover img-zoom",loading:"eager",decoding:"async",...e===0?{fetchPriority:"high"}:{},width:600,height:450}),ln(t.id)&&c.jsx("div",{className:"absolute bottom-3 left-4",children:c.jsx(Mm,{})}),c.jsx("div",{className:"absolute top-4 left-4",children:c.jsx("span",{className:"px-3 py-1.5 bg-accent text-accent-foreground text-xs font-bold rounded-full shadow-lg",children:t.badge})}),c.jsxs("div",{className:"absolute top-4 right-4 flex items-center gap-1 px-2.5 py-1 bg-card/90 backdrop-blur-sm rounded-full",children:[c.jsx(Yi,{className:"w-4 h-4 text-sunset-gold fill-sunset-gold"}),c.jsx("span",{className:"text-sm font-semibold text-foreground",children:t.rating}),c.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",t.reviews,")"]})]})]}),c.jsxs("div",{className:"p-6 pb-0",children:[c.jsxs("div",{className:"mb-4",children:[c.jsx("h3",{className:"font-display text-xl font-bold text-foreground group-hover:text-primary transition-colors",children:t.name}),c.jsx("p",{className:"text-sm text-muted-foreground",children:t.tagline})]}),c.jsxs("div",{className:"grid grid-cols-4 gap-3 mb-5 py-4 border-y border-border",children:[c.jsxs("div",{className:"text-center",children:[c.jsx(Xi,{className:"w-4 h-4 mx-auto text-muted-foreground mb-1"}),c.jsx("span",{className:"text-sm font-medium text-foreground",children:t.sleeps}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Sleeps"})]}),c.jsxs("div",{className:"text-center",children:[c.jsx(hu,{className:"w-4 h-4 mx-auto text-muted-foreground mb-1"}),c.jsx("span",{className:"text-sm font-medium text-foreground",children:t.beds}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Beds"})]}),c.jsxs("div",{className:"text-center",children:[c.jsx(fu,{className:"w-4 h-4 mx-auto text-muted-foreground mb-1"}),c.jsx("span",{className:"text-sm font-medium text-foreground",children:t.bathrooms}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Baths"})]}),c.jsxs("div",{className:"text-center",children:[c.jsx(pu,{className:"w-4 h-4 mx-auto text-muted-foreground mb-1"}),c.jsx("span",{className:"text-sm font-medium text-foreground",children:t.length}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Length"})]})]})]})]})}function Hm({boat:t}){const e=ln(t.id)?gm(t.priceFrom):t.priceFrom;return c.jsxs("div",{children:[c.jsx("span",{className:"text-xs text-muted-foreground uppercase tracking-wide",children:"Starting From"}),c.jsx("div",{className:"flex items-baseline gap-2",children:ln(t.id)?c.jsxs(c.Fragment,{children:[c.jsxs("span",{className:"text-2xl font-bold text-summer-coral",children:["$",e.toLocaleStr
3ing()]}),c.jsxs("span",{className:"text-sm text-muted-foreground line-through",children:["$",t.priceFrom.toLocaleString()]})]}):c.jsxs("span",{className:"text-2xl font-bold text-foreground",children:["$",e.toLocaleString()]})}),c.jsx("span",{className:"text-xs text-muted-foreground italic",children:"3 Nights Low Season"})]})}function Vm(){return c.jsx("section",{className:"relative py-20 lg:py-28 bg-background",children:c.jsxs("div",{className:"section-container",children:[c.jsxs("div",{className:"text-center mb-12 lg:mb-16",children:[c.jsx("span",{className:"inline-block px-4 py-1.5 bg-accent/10 text-accent text-sm font-semibold rounded-full mb-4",children:"Our Fleet"}),c.jsx("h2",{className:"font-display text-3xl sm:text-4xl lg:text-5xl font-bold text-foreground mb-4",children:"Luxury Houseboats on Shasta Lake"}),c.jsx("p",{className:"text-lg text-muted-foreground max-w-2xl mx-auto",children:"Explore our most popular luxury houseboats. Each vessel offers premium amenities, stunning views, and everything you need for the perfect lake vacation."})]}),c.jsx("div",{className:"grid sm:grid-cols-2 xl:grid-cols-4 gap-6 lg:gap-8",children:Bm.map((t,e)=>c.jsxs(ee,{to:`/houseboats/${t.id}`,className:`group card-premium ${ln(t.id)?"ring-2 ring-summer-coral/70 shadow-xl":""}`,...Dm,children:[c.jsx(Fm,{boat:t,index:e}),c.jsxs("div",{className:"p-6 pt-0 flex items-center justify-between",children:[c.jsx(Hm,{boat:t}),c.jsxs(me,{variant:"outline",size:"sm",className:"gap-1 group-hover:bg-primary group-hover:text-primary-foreground transition-colors",children:["View Details",c.jsx(co,{className:"w-4 h-4"})]})]})]},t.id))}),c.jsxs("div",{className:"text-center mt-12",children:[c.jsx(me,{variant:"default",size:"lg",asChild:!0,children:c.jsxs(ee,{to:"/compare-houseboats",children:["View All Houseboats",c.jsx(co,{className:"w-5 h-5 ml-1"})]})}),c.jsx("p",{className:"text-sm text-muted-foreground mt-3",children:"2026 dates filling fast"})]})]})})}const Wm=[{kind:"weather-cam"},{kind:"text",text:`${ae.discountPercent}% Off Selected Houseboats — Until September 30! Code ${ae.code}`,highlight:!0},{kind:"text",text:"Book Your Shasta Lake Houseboat Vacation Now! — 3-4-7 Days Available!!",highlight:!0},{kind:"text",text:"Pet Friendly"}],qm=()=>c.jsxs(ee,{to:"/shasta-lake-info/live-weather-cam",className:"inline-flex items-center gap-2 font-bold text-[#38bdf8] hover:text-[#67e8f9] transition-colors",style:{textShadow:"0 0 8px rgba(56, 189, 248, 0.4)"},children:[c.jsx(mu,{className:"w-4 h-4 text-[#fbbf24]","aria-hidden":"true"}),c.jsx(is,{className:"w-4 h-4 text-[#67e8f9]","aria-hidden":"true"}),c.jsx("span",{children:"Live Weather Cam"}),c.jsx(gu,{className:"w-4 h-4 text-[#22d3ee]","aria-hidden":"true"}),c.jsx(is,{className:"w-4 h-4 text-[#67e8f9]","aria-hidden":"true"})]}),qo=()=>c.jsx(c.Fragment,{children:Wm.map((t,e)=>c.jsxs("span",{className:"inline-flex items-center whitespace-nowrap",children:[t.kind==="weather-cam"?c.jsx(qm,{}):c.jsx("span",{className:t.highlight?"text-sunset-gold font-semibold":"text-white/90",children:t.text}),c.jsx("span",{className:"mx-6 text-sunset-gold text-xs",children:"◆"})]},e))}),zm=()=>c.jsx("div",{className:"bg-lake-blue-dark overflow-hidden py-3 motion-reduce:overflow-x-auto","aria-hidden":"true",children:c.jsxs("div",{className:"animate-ticker inline-flex motion-reduce:animate-none",children:[c.jsx(qo,{}),c.jsx(qo,{})]})});function Km({isHero:t=!1,width:e,height:r,style:n,...s}){return c.jsx("img",{width:e,height:r,loading:t?"eager":"lazy",decoding:"async",...t?{fetchPriority:"high"}:{},style:{aspectRatio:`${e}/${r}`,...n},...s})}const Jm=1,Gm="0f503516-e074-4c82-ab74-2953c58e710c",Ym="d7132c39-fd4e-4c6e-aac1-267f15319b28",Xm="/__l5e/assets-v1/0f503516-e074-4c82-ab74-2953c58e710c/end-of-summer-banner.webp",Qm="a/v1/d7132c39-fd4e-4c6e-aac1-267f15319b28/0f503516-e074-4c82-ab74-2953c58e710c/end-of-summer-banner.webp",Zm="end-of-summer-banner.webp",eg=312618,tg="image/webp",rg="2026-09-04T02:00:01Z",ng={version:Jm,asset_id:Gm,project_id:Ym,url:Xm,r2_key:Qm,original_filename:Zm,size:eg,content_type:tg,created_at:rg};function sg(){return c.jsx("section",{className:"bg-background py-6 sm:py-8","aria-label":"End of Summer Sale promotion",children:c.jsx("div",{className:"section-container",children:c.jsx(ee,{to:ae.url,className:"block overflow-hidden rounded-2xl shadow-xl ring-1 ring-border transition-transform duration-300 hover:scale-[1.01] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-summer-teal",children:c.jsx(Km,{src:ng.url,alt:"End of Summer Sale — 20% off all houseboats except Titan and all small boats except jet skis, code LABOR26, extended through September 30, 2026. New reservations only.",width:1920,height:640,isHero:!0,className:"w-full h-auto object-cover"})})})})}const Ks=f.forwardRef(({className:t,type:e,...r},n)=>c.jsx("input",{type:e,className:ue("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),ref:n,...r}));Ks.displayName="Input";var Oe=function(){return Oe=Object.assign||function(e){for(var r,n=1,s=arguments.length;n<s;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},Oe.apply(this,arguments)};function Wt(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(r[n[s]]=t[n[s]]);return r}function og(t,e,r,n){function s(o){return o instanceof r?o:new r(function(i){i(o)})}return new(r||(r=Promise))(function(o,i){function a(d){try{u(n.next(d))}catch(h){i(h)}}function l(d){try{u(n.throw(d))}catch(h){i(h)}}function u(d){d.done?o(d.value):s(d.value).then(a,l)}u((n=n.apply(t,e||[])).next())})}function ig(t,e,r){if(r||arguments.length===2)for(var n=0,s=e.length,o;n<s;
3n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))}const ag=t=>t?(...e)=>t(...e):(...e)=>fetch(...e);class Js extends Error{constructor(e,r="FunctionsError",n){super(e),this.name=r,this.context=n}toJSON(){return{name:this.name,message:this.message,context:this.context}}}class lg extends Js{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class zo extends Js{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class Ko extends Js{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}var ys;(function(t){t.Any="any",t.ApNortheast1="ap-northeast-1",t.ApNortheast2="ap-northeast-2",t.ApSouth1="ap-south-1",t.ApSoutheast1="ap-southeast-1",t.ApSoutheast2="ap-southeast-2",t.CaCentral1="ca-central-1",t.EuCentral1="eu-central-1",t.EuWest1="eu-west-1",t.EuWest2="eu-west-2",t.EuWest3="eu-west-3",t.SaEast1="sa-east-1",t.UsEast1="us-east-1",t.UsWest1="us-west-1",t.UsWest2="us-west-2"})(ys||(ys={}));class cg{constructor(e,{headers:r={},customFetch:n,region:s=ys.Any}={}){this.url=e,this.headers=r,this.region=s,this.fetch=ag(n)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e){return og(this,arguments,void 0,function*(r,n={}){var s;let o,i;try{const{headers:a,method:l,body:u,signal:d,timeout:h}=n;let m={},{region:p}=n;p||(p=this.region);const v=new URL(`${this.url}/${r}`);p&&p!=="any"&&(m["x-region"]=p,v.searchParams.set("forceFunctionRegion",p));let g;const y=!!a&&Object.keys(a).some(k=>k.toLowerCase()==="content-type");u&&!y?typeof Blob<"u"&&u instanceof Blob||u instanceof ArrayBuffer?(m["Content-Type"]="application/octet-stream",g=u):typeof u=="string"?(m["Content-Type"]="text/plain",g=u):typeof FormData<"u"&&u instanceof FormData?g=u:(m["Content-Type"]="application/json",g=JSON.stringify(u)):u&&typeof u!="string"&&!(typeof Blob<"u"&&u instanceof Blob)&&!(u instanceof ArrayBuffer)&&!(typeof FormData<"u"&&u instanceof FormData)?g=JSON.stringify(u):g=u;let x=d;h&&(i=new AbortController,o=setTimeout(()=>i.abort(),h),d?(x=i.signal,d.addEventListener("abort",()=>i.abort())):x=i.signal);const b=yield this.fetch(v.toString(),{method:l||"POST",headers:Object.assign(Object.assign(Object.assign({},m),this.headers),a),body:g,signal:x}).catch(k=>{throw new lg(k)}),w=b.headers.get("x-relay-error");if(w&&w==="true")throw new zo(b);if(!b.ok)throw new Ko(b);let _=((s=b.headers.get("Content-Type"))!==null&&s!==void 0?s:"text/plain").split(";")[0].trim(),S;return _==="application/json"?S=yield b.json():_==="application/octet-stream"||_==="application/pdf"?S=yield b.blob():_==="text/event-stream"?S=b:_==="multipart/form-data"?S=yield b.formData():S=yield b.text(),{data:S,error:null,response:b}}catch(a){return{data:null,error:a,response:a instanceof Ko||a instanceof zo?a.context:void 0}}finally{o&&clearTimeout(o)}})}}const _l=3,Jo=t=>Math.min(1e3*2**t,3e4),ug=[520,503],El=["GET","HEAD","OPTIONS"];var Go=class extends Error{constructor(t){super(t.message),this.name="PostgrestError",this.details=t.details,this.hint=t.hint,this.co
3de=t.code}toJSON(){return{name:this.name,message:this.message,details:this.details,hint:this.hint,code:this.code}}};function Yo(t,e){return new Promise(r=>{if(e!=null&&e.aborted){r();return}const n=setTimeout(()=>{e==null||e.removeEventListener("abort",s),r()},t);function s(){clearTimeout(n),r()}e==null||e.addEventListener("abort",s)})}function dg(t,e,r,n){return!(!n||r>=_l||!El.includes(t)||!ug.includes(e))}var hg=class{constructor(t){var e,r,n,s,o;this.shouldThrowOnError=!1,this.retryEnabled=!0,this.method=t.method,this.url=t.url,this.headers=new Headers(t.headers),this.schema=t.schema,this.body=t.body,this.shouldThrowOnError=(e=t.shouldThrowOnError)!==null&&e!==void 0?e:!1,this.signal=t.signal,this.isMaybeSingle=(r=t.isMaybeSingle)!==null&&r!==void 0?r:!1,this.shouldStripNulls=(n=t.shouldStripNulls)!==null&&n!==void 0?n:!1,this.urlLengthLimit=(s=t.urlLengthLimit)!==null&&s!==void 0?s:8e3,this.retryEnabled=(o=t.retry)!==null&&o!==void 0?o:!0,t.fetch?this.fetch=t.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}stripNulls(){if(this.headers.get("Accept")==="text/csv")throw new Error("stripNulls() cannot be used with csv()");return this.shouldStripNulls=!0,this}setHeader(t,e){return this.headers=new Headers(this.headers),this.headers.set(t,e),this}retry(t){return this.retryEnabled=t,this}then(t,e){var r=this;if(this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json"),this.shouldStripNulls){const i=this.headers.get("Accept");i==="application/vnd.pgrst.object+json"?this.headers.set("Accept","application/vnd.pgrst.object+json;nulls=stripped"):(!i||i==="application/json")&&this.headers.set("Accept","application/vnd.pgrst.array+json;nulls=stripped")}const n=this.fetch;let o=(async()=>{let i=0;for(;;){const u={};r.headers.forEach((h,m)=>{u[m]=h}),i>0&&(u["X-Retry-Count"]=String(i));let d;try{d=await n(r.url.toString(),{method:r.method,headers:u,body:JSON.stringify(r.body,(h,m)=>typeof m=="bigint"?m.toString():m),signal:r.signal})}catch(h){if((h==null?void 0:h.name)==="AbortError"||(h==null?void 0:h.code)==="ABORT_ERR"||!El.includes(r.method))throw h;if(r.retryEnabled&&i<_l){const m=Jo(i);i++,await Yo(m,r.signal);continue}throw h}if(dg(r.method,d.status,i,r.retryEnabled)){var a,l;const h=(a=(l=d.headers)===null||l===void 0?void 0:l.get("Retry-After"))!==null&&a!==void 0?a:null,m=h!==null?Math.max(0,parseInt(h,10)||0)*1e3:Jo(i);await d.text(),i++,await Yo(m,r.signal);continue}return await r.processResponse(d)}})();return this.shouldThrowOnError||(o=o.catch(i=>{var a;let l="",u="",d="";const h=i==null?void 0:i.cause;if(h){var m,p,v,g;const b=(m=h==null?void 0:h.message)!==null&&m!==void 0?m:"",w=(p=h==null?void 0:h.code)!==null&&p!==void 0?p:"";l=`${(v=i==null?void 0:i.name)!==null&&v!==void 0?v:"FetchError"}: ${i==null?void 0:i.message}`,l+=`
4
5Caused by: ${(g=h==null?void 0:h.name)!==null&&g!==void 0?g:"Error"}: ${b}`,w&&(l+=` (${w})`),h!=null&&h.stack&&(l+=`
6${h.stack}`)}else{var y;l=(y=i==null?void 0:i.stack)!==null&&y!==void 0?y:""}const x=this.url.toString().length;return(i==null?void 0:i.name)==="AbortError"||(i==null?void 0:i.code)==="ABORT_ERR"?(d="",u="Request was aborted (timeout or manual cancellation)",x>this.urlLengthLimit&&(u+=`. Note: Your request URL is ${x} characters, which may exceed server limits. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [many IDs])), consider using an RPC function to pass values server-side.`)):((h==null?void 0:h.name)==="HeadersOverflowError"||(h==null?void 0:h.code)==="UND_ERR_HEADERS_OVERFLOW")&&(d="",u="HTTP headers exceeded server limits (typically 16KB)",x>this.urlLengthLimit&&(u+=`. Your request URL is ${x} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`)),{success:!1,error:{message:`${(a=i==null?void 0:i.name)!==null&&a!==void 0?a:"FetchError"}: ${i==null?void 0:i.message}`,details:l,hint:u,code:d},data:null,count:null,status:0,statusText:""}}
6)),o.then(t,e)}async processResponse(t){var e=this;let r=null,n=null,s=null,o=t.status,i=t.statusText;if(t.ok){var a,l;if(e.method!=="HEAD"){var u;const m=await t.text();if(m!=="")if(e.headers.get("Accept")==="text/csv")n=m;else if(e.headers.get("Accept")&&(!((u=e.headers.get("Accept"))===null||u===void 0)&&u.includes("application/vnd.pgrst.plan+text")))n=m;else try{n=JSON.parse(m)}catch{if(r={message:m},n=null,e.shouldThrowOnError)throw new Go({message:m,details:"",hint:"",code:""})}}const d=(a=e.headers.get("Prefer"))===null||a===void 0?void 0:a.match(/count=(exact|planned|estimated)/),h=(l=t.headers.get("content-range"))===null||l===void 0?void 0:l.split("/");d&&h&&h.length>1&&(s=parseInt(h[1])),e.isMaybeSingle&&Array.isArray(n)&&(n.length>1?(r={code:"PGRST116",details:`Results contain ${n.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},n=null,s=null,o=406,i="Not Acceptable"):n.length===1?n=n[0]:n=null)}else{const d=await t.text();try{r=JSON.parse(d),Array.isArray(r)&&t.status===404&&(n=[],r=null,o=200,i="OK")}catch{t.status===404&&d===""?(o=204,i="No Content"):r={message:d}}if(r&&e.shouldThrowOnError)throw new Go(r)}return{success:r===null,error:r,data:n,count:s,status:o,statusText:i}}returns(){return this}overrideTypes(){return this}},fg=class extends hg{throwOnError(){return super.throwOnError()}select(t){let e=!1;const r=(t??"*").split("").map(n=>/\s/.test(n)&&!e?"":(n==='"'&&(e=!e),n)).join("");return this.url.searchParams.set("select",r),this.headers.append("Prefer","return=representation"),this}order(t,{ascending:e=!0,nullsFirst:r,foreignTable:n,referencedTable:s=n}={}){const o=s?`${s}.order`:"order",i=this.url.searchParams.get(o);return this.url.searchParams.set(o,`${i?`${i},`:""}${t}.${e?"asc":"desc"}${r===void 0?"":r?".nullsfirst":".nullslast"}`),this}limit(t,{foreignTable:e,referencedTable:r=e}={}){const n=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(n,`${t}`),this}range(t,e,{foreignTable:r,referencedTable:n=r}={}){const s=typeof n>"u"?"offset":`${n}.offset`,o=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(s,`${t}`),this.url.searchParams.set(o,`${e-t+1}`),this}abortSignal(t){return this.signal=t,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:t=!1,verbose:e=!1,settings:r=!1,buffers:n=!1,wal:s=!1,format:o="text"}={}){var i;const a=[t?"analyze":null,e?"verbose":null,r?"settings":null,n?"buffers":null,s?"wal":null].filter(Boolean).join("|"),l=(i=this.headers.get("Accept"))!==null&&i!==void 0?i:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${o}; for="${l}"; options=${a};`),o==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(t){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${t}`),this}};const Xo=new RegExp("[,()]");var jt=class extends fg{throwOnError(){return super.throwOnError()}eq(t,e){return this.url.searchParams.append(t,`eq.${e}`),this}neq(t,e){return this.url.searchParams.append(t,`neq.${e}`),this}gt(t,e){return this.url.searchParams.append(t,`gt.${e}`),this}gte(t,e){return this.url.searchParams.append(t,`gte.${e}`),this}lt(t,e){return this.url.searchParams.append(t,`lt.${e}`),this}lte(t,e){return this.url.searchParams.append(t,`lte.${e}`),this}like(t,e){return this.url.searchParams.append(t,`like.${e}`),this}likeAllOf(t,e){return this.url.searchParams.append(t,`like(all).{${e.join(",")}}`),this}likeAnyOf(t,e){return this.url.searchParams.append(t,`like(any).{${e.join(",")}}`),this}ilike(t,e){return this.url.searchParams.append(t,`ilike.${e}`),this}ilikeAllOf(t,e){return this.url.searchParams.append(t,`ilike(all).{${e.join(",")}}`),this}ilikeAnyOf(t,e){return this.url.searchParams.append(t,`ilike(any).{${e.join(",")}}`),this}regexMatch(t,e){return this.url.searchParams.append(t,`match.${e}`),this}regexIMatch(t,e){return this.url.searchParams.append(t,`imatch.${e}`),this}is(t,e){return this.url.searchParams.append(t,`is.${e}`),this}isDistinct(t,e){return this.url.searchParams.append(t,`isdistinct.${e}`),this}in(t,e){const r=Array.from(new Set(e)).map(n=>typeof n=="string"&&Xo.test(n)?`"${n}"`:`${n}`).join(",");return this.url.searchParams.append(t,`in.(${r})`),this}notIn(t,e){const r=Array.from(new Set(e)).map(n=>typeof n=="string"&&Xo.test(n)?`"${n}"`:`${n}`).join(",");return this.url.searchParams.append(t,`not.in.(${r})`),this}contains(t,e){return typeof e=="string"?this.url.searchParams.append(t,`cs.${e}`):Array.isArray(e)?this.url.searchParams.append(t,`cs.{${e.join(",")}}`):this.url.searchParams.append(t,`cs.${JSON.stringify(e)}`),this}containedBy(t,e){return typeof e=="string"?this.url.searchParams.append(t,`cd.${e}`):Array.isArray(e)?this.url.searchParams.append(t,`cd.{${e.join(",")}}`):this.url.searchParams.append(t,`cd.${JSON.stringify(e)}`),this}rangeGt(t,e){return this.url.searchParams.append(t,`sr.${e}`),this}rangeGte(t,e){return this.url.searchParams.append(t,`nxl.${e}`),this}rangeLt(t,e){return this.url.searchParams.append(t,`sl.${e}`),this}rangeLte(t,e){return this.url.searchParams.append(t,`nxr.${e}`),this}rangeAdjacent(t,e){return this.url.searchParams.append(t,`adj.${e}`),this}overlaps(t,e){return typeof e=="string"?this.url.searchParams.append(t,`ov.${e}`):this.url.searchParams.append(t,`ov.{${e.join(",")}}`),this}textSearch(t,e,{config:r,type:n}={}){let s="";n==="plain"?s="pl":n==="phrase"?s="ph":n==="websearch"&&(s="w");const o=r===void 0?"":`(${r})`;return this.url.searchParams.append(t,`${s}fts${o}.${e}`),this}match(t){return Object.entries(t).filter(([e,r])=>
6r!==void 0).forEach(([e,r])=>{this.url.searchParams.append(e,`eq.${r}`)}),this}not(t,e,r){return this.url.searchParams.append(t,`not.${e}.${r}`),this}or(t,{foreignTable:e,referencedTable:r=e}={}){const n=r?`${r}.or`:"or";return this.url.searchParams.append(n,`(${t})`),this}filter(t,e,r){return this.url.searchParams.append(t,`${e}.${r}`),this}},pg=class{constructor(t,{headers:e={},schema:r,fetch:n,urlLengthLimit:s=8e3,retry:o}){this.url=t,this.headers=new Headers(e),this.schema=r,this.fetch=n,this.urlLengthLimit=s,this.retry=o}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(t,e){const{head:r=!1,count:n}=e??{},s=r?"HEAD":"GET";let o=!1;const i=(t??"*").split("").map(u=>/\s/.test(u)&&!o?"":(u==='"'&&(o=!o),u)).join(""),{url:a,headers:l}=this.cloneRequestState();return a.searchParams.set("select",i),n&&l.append("Prefer",`count=${n}`),new jt({method:s,url:a,headers:l,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}insert(t,{count:e,defaultToNull:r=!0}={}){var n;const s="POST",{url:o,headers:i}=this.cloneRequestState();if(e&&i.append("Prefer",`count=${e}`),r||i.append("Prefer","missing=default"),Array.isArray(t)){const a=t.reduce((l,u)=>l.concat(Object.keys(u)),[]);if(a.length>
60){const l=[...new Set(a)].map(u=>`"${u}"`);o.searchParams.set("columns",l.join(","))}}return new jt({method:s,url:o,headers:i,schema:this.schema,body:t,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}upsert(t,{onConflict:e,ignoreDuplicates:r=!1,count:n,defaultToNull:s=!0}={}){var o;const i="POST",{url:a,headers:l}=this.cloneRequestState();if(l.append("Prefer",`resolution=${r?"ignore":"merge"}-duplicates`),e!==void 0&&a.searchParams.set("on_conflict",e),n&&l.append("Prefer",`count=${n}`),s||l.append("Prefer","missing=default"),Array.isArray(t)){const u=t.reduce((d,h)=>d.concat(Object.keys(h)),[]);if(u.length>0){const d=[...new Set(u)].map(h=>`"${h}"`);a.searchParams.set("columns",d.join(","))}}return new jt({method:i,url:a,headers:l,schema:this.schema,body:t,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}update(t,{count:e}={}){var r;const n="PATCH",{url:s,headers:o}=this.cloneRequestState();return e&&o.append("Prefer",`count=${e}`),new jt({method:n,url:s,headers:o,schema:this.schema,body:t,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}delete({count:t}={}){var e;const r="DELETE",{url:n,headers:s}=this.cloneRequestState();return t&&s.append("Prefer",`count=${t}`),new jt({method:r,url:n,headers:s,schema:this.schema,fetch:(e=this.fetch)!==null&&e!==void 0?e:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};function lr(t){"@babel/helpers - typeof";return lr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},lr(t)}function mg(t,e){if(lr(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(lr(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function gg(t){var e=mg(t,"string");return lr(e)=="symbol"?e:e+""}function vg(t,e,r){return(e=gg(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Qo(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function Pr(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Qo(Object(r),!0).forEach(function(n){vg(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Qo(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}var yg=class Sl{constructor(e,{headers:r={},schema:n,fetch:s,timeout:o,urlLengthLimit:i=8e3,retry:a}={}){this.url=e,this.headers=new Headers(r),this.schemaName=n,this.urlLengthLimit=i;const l=s??globalThis.fetch;o!==void 0&&o>0?this.fetch=(u,d)=>{const h=new AbortController,m=setTimeout(()=>h.abort(),o),p=d==null?void 0:d.signal;if(p){if(p.aborted)return clearTimeout(m),l(u,d);const v=()=>{clearTimeout(m),h.abort()};return p.addEventListener("abort",v,{once:!0}),l(u,Pr(Pr({},d),{},{signal:h.signal})).finally(()=>{clearTimeout(m),p.removeEventListener("abort",v)})}return l(u,Pr(Pr({},d),{},{signal:h.signal})).finally(()=>clearTimeout(m))}:this.fetch=l,this.retry=a}from(e){if(!e||typeof e!="string"||e.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new pg(new URL(`${this.url}/${e}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}schema(e){return new Sl(this.url,{headers:this.headers,schema:e,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}rpc(e,r={},{head:n=!1,get:s=!1,count:o}={}){var i;let a;const l=new URL(`${this.url}/rpc/${e}`);let u;const d=p=>p!==null&&typeof p=="object"&&(!Array.isArray(p)||p.some(d)),h=n&&Object.values(r).some(d);h?(a="POST",u=r):n||s?(a=n?"HEAD":"GET",Object.entries(r).filter(([p,v])=>v!==void 0).map(([p,v])=>[p,Array.isArray(v)?`{${v.join(",")}}`:`${v}
6`]).forEach(([p,v])=>{l.searchParams.append(p,v)})):(a="POST",u=r);const m=new Headers(this.headers);return h?m.set("Prefer",o?`count=${o},return=minimal`:"return=minimal"):o&&m.set("Prefer",`count=${o}`),new jt({method:a,url:l,headers:m,schema:this.schemaName,body:u,fetch:(i=this.fetch)!==null&&i!==void 0?i:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};class bg{constructor(){}static detectEnvironment(){var e;if(typeof WebSocket<"u")return{type:"native",wsConstructor:WebSocket};const r=globalThis;if(typeof globalThis<"u"&&typeof r.WebSocket<"u")return{type:"native",wsConstructor:r.WebSocket};const n=typeof global<"u"?global:void 0;if(n&&typeof n.WebSocket<"u")return{type:"native",wsConstructor:n.WebSocket};if(typeof globalThis<"u"&&typeof r.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&r.EdgeRuntime||typeof navigator<"u"&&(!((e=navigator.userAgent)===null||e===void 0)&&e.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};const s=globalThis.process;if(s){const o=s.versions;if(o&&o.node)return{type:"unsupported",error:"Node.js detected but native WebSocket not found.",workaround:"Ensure you are running Node.js 22+ or provide a WebSocket implementation via the transport option."}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){const e=this.detectEnvironment();if(e.wsConstructor)return e.wsConstructor;let r=e.error||"WebSocket not supported in this environment.";throw e.workaround&&(r+=`
7
8Suggested solution: ${e.workaround}`),new Error(r)}static isWebSocketSupported(){try{return this.detectEnvironment().type==="native"}catch{return!1}}}const wg="2.110.0",xg=`realtime-js/${wg}`,_g="1.0.0",kl="2.0.0",Eg=kl,Sg=1e4,kg=100,et={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},Tl={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave",access_token:"access_token"},bs={connecting:"connecting",open:"open",closing:"closing",closed:"closed"};class Tg{constructor(e){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=e??[]}encode(e,r){if(e.event===this.BROADCAST_EVENT&&!(e.payload instanceof ArrayBuffer)&&typeof e.payload.event=="string")return r(this._binaryEncodeUserBroadcastPush(e));let n=[e.join_ref,e.ref,e.topic,e.event,e.payload];return r(JSON.stringify(n))}_binaryEncodeUserBroadcastPush(e){var r;return this._isArrayBuffer((r=e.payload)===null||r===void 0?void 0:r.payload)?this._encodeBinaryUserBroadcastPush(e):this._encodeJsonUserBroadcastPush(e)}_encodeBinaryUserBroadcastPush(e){var r,n;const s=(n=(r=e.payload)===null||r===void 0?void 0:r.payload)!==null&&n!==void 0?n:new ArrayBuffer(0);return this._encodeUserBroadcastPush(e,this.BINARY_ENCODING,s)}_encodeJsonUserBroadcastPush(e){var r,n;const s=(n=(r=e.payload)===null||r===void 0?void 0:r.payload)!==null&&n!==void 0?n:{},i=new TextEncoder().encode(JSON.stringify(s)).buffer;return this._encodeUserBroadcastPush(e,this.JSON_ENCODING,i)}_encodeUserBroadcastPush(e,r,n){var s,o;const i=e.topic,a=(s=e.ref)!==null&&s!==void 0?s:"",l=(o=e.join_ref)!==null&&o!==void 0?o:"",u=e.payload.event,d=this.allowedMetadataKeys?this._pick(e.payload,this.allowedMetadataKeys):{},h=Object.keys(d).length===0?"":JSON.stringify(d);if(l.length>255)throw new Error(`joinRef length ${l.length} exceeds maximum of 255`);if(a.length>255)throw new Error(`ref length ${a.length} exceeds maximum of 255`);if(i.length>255)throw new Error(`topic length ${i.length} exceeds maximum of 255`);if(u.length>255)throw new Error(`userEvent length ${u.length} exceeds maximum of 255`);if(h.length>255)throw new Error(`metadata length ${h.length} exceeds maximum of 255`);const m=this.USER_BROADCAST_PUSH_META_LENGTH+l.length+a.length+i.length+u.length+h.length,p=new ArrayBuffer(this.HEADER_LENGTH+m);let v=new DataView(p),g=0;v.setUint8(g++,this.KINDS.userBroadcastPush),v.setUint8(g++,l.length),v.setUint8(g++,a.length),v.setUint8(g++,i.length),v.setUint8(g++,u.length),v.setUint8(g++,h.length),v.setUint8(g++,r),Array.from(l,x=>v.setUint8(g++,x.charCodeAt(0))),Array.from(a,x=>v.setUint8(g++,x.charCodeAt(0))),Array.from(i,x=>v.setUint8(g++,x.charCodeAt(0))),Array.from(u,x=>v.setUint8(g++,x.charCodeAt(0))),Array.from(h,x=>v.setUint8(g++,x.charCodeAt(0)));var y=new Uint8Array(p.byteLength+n.byteLength);return y.set(new Uint8Array(p),0),y.set(new Uint8Array(n),p.byteLength),y.buffer}decode(e,r){if(this._isArrayBuffer(e)){let n=this._binaryDecode(e);return r(n)}if(typeof e=="string"){const n=JSON.parse(e),[s,o,i,a,l]=n;return r({join_ref:s,ref:o,topic:i,event:a,payload:l})}return r({})}_binaryDecode(e){const r=new DataView(e),n=r.getUint8(0),s=new TextDecoder;switch(n){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(e,r,s)}}_decodeUserBroadcast(e,r,n){const s=r.getUint8(1),o=r.getUint8(2),i=r.getUint8(3),a=r.getUint8(4);let l=this.HEADER_LENGTH+4;const u=n.decode(e.slice(l,l+s));l=l+s;
8const d=n.decode(e.slice(l,l+o));l=l+o;const h=n.decode(e.slice(l,l+i));l=l+i;const m=e.slice(l,e.byteLength),p=a===this.JSON_ENCODING?JSON.parse(n.decode(m)):m,v={type:this.BROADCAST_EVENT,event:d,payload:p};return i>0&&(v.meta=JSON.parse(h)),{join_ref:null,ref:null,topic:u,event:this.BROADCAST_EVENT,payload:v}}_isArrayBuffer(e){var r;return e instanceof ArrayBuffer||((r=e==null?void 0:e.constructor)===null||r===void 0?void 0:r.name)==="ArrayBuffer"}_pick(e,r){return!e||typeof e!="object"?{}:Object.fromEntries(Object.entries(e).filter(([n])=>r.includes(n)))}}var X;(function(t){t.abstime="abstime",t.bool="bool",t.date="date",t.daterange="daterange",t.float4="float4",t.float8="float8",t.int2="int2",t.int4="int4",t.int4range="int4range",t.int8="int8",t.int8range="int8range",t.json="json",t.jsonb="jsonb",t.money="money",t.numeric="numeric",t.oid="oid",t.reltime="reltime",t.text="text",t.time="time",t.timestamp="timestamp",t.timestamptz="timestamptz",t.timetz="timetz",t.tsrange="tsrange",t.tstzrange="tstzrange"})(X||(X={}));const Zo=(t,e,r={})=>{var n;const s=(n=r.skipTypes)!==null&&n!==void 0?n:[];return e?Object.keys(e).reduce((o,i)=>(o[i]=Rg(i,t,e,s),o),{}):{}},Rg=(t,e,r,n)=>{const s=e.find(a=>a.name===t),o=s==null?void 0:s.type,i=r[t];return o&&!n.includes(o)?Rl(o,i):ws(i)},Rl=(t,e)=>{if(t.charAt(0)==="_"){const r=t.slice(1,t.length);return Pg(e,r)}switch(t){case X.bool:return Ag(e);case X.float4:case X.float8:case X.int2:case X.int4:case X.int8:case X.numeric:case X.oid:return Cg(e);case X.json:case X.jsonb:return jg(e);case X.timestamp:return Og(e);case X.abstime:case X.date:case X.daterange:case X.int4range:case X.int8range:case X.money:case X.reltime:case X.text:case X.time:case X.timestamptz:case X.timetz:case X.tsrange:case X.tstzrange:return ws(e);default:return ws(e)}},ws=t=>t,Ag=t=>{switch(t){case"t":return!0;case"f":return!1;default:return t}},Cg=t=>{if(typeof t=="string"){const e=parseFloat(t);if(!Number.isNaN(e))return e}return t},jg=t=>{if(typeof t=="string")try{return JSON.parse(t)}catch{return t}return t},Pg=(t,e)=>{if(typeof t!="string")return t;const r=t.length-1,n=t[r];if(t[0]==="{"&&n==="}"){let o;const i=t.slice(1,r);try{o=JSON.parse("["+i+"]")}catch{o=i?i.split(","):[]}return o.map(a=>Rl(e,a))}return t},Og=t=>typeof t=="string"?t.replace(" ","T"):t,Al=t=>{const e=new URL(t);return e.protocol=e.protocol.replace(/^ws/i,"http"),e.pathname=e.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),e.pathname===""||e.pathname==="/"?e.pathname="/api/broadcast":e.pathname=e.pathname+"/api/broadcast",e.href};var er=t=>typeof t=="function"?t:function(){return t},Ng=typeof self<"u"?self:null,Pt=typeof window<"u"?window:null,je=Ng||Pt||globalThis,Ig="2.0.0",Lg=1e4,$g=1e3,Pe={connecting:0,open:1,closing:2,closed:3},le={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},Be={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave"},xs={longpoll:"longpoll",websocket:"websocket"},Dg={complete:4},_s="base64url.bearer.phx.",Or=class{constructor(t,e,r,n){this.channel=t,this.event=e,this.payload=r||function(){return{}},this.receivedResp=null,this.timeout=n,this.timeoutTimer=null,this.recHooks=[],this.sent=!1,this.ref=void 0}resend(t){this.timeout=t,this.reset(),this.send()}send(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}))}receive(t,e){return this.hasReceived(t)&&e(this.receivedResp.response),this.recHooks.push({status:t,callback:e}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}destroy(){this.cancelRefEvent(),this.cancelTimeout()}matchReceive({status:t,response:e,_ref:r}){this.recHooks.filter(n=>n.status===t).forEach(n=>n.callback(e))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,t=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=t,this.matchReceive(t)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}hasReceived(t){return this.receivedResp&&this.receivedResp.status===t}trigger(t,e){this.channel.trigger(this.refEvent,{status:t,response:e})}},Cl=class{constructor(t,e){this.callback=t,this.timerCalc=e,this.timer=void 0,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}},Mg=class{constructor(t,e,r){this.state=le.closed,this.topic=t,this.params=er(e||{}),this.socket=r,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new Or(this,Be.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new Cl(()=>{this.socket.isConnected()&&this.rejoin()},this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError(()=>this.rejoinTimer.reset())),this.stateChangeRefs.push(this.socket.onOpen(()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()})),this.joinPush.receive("ok",()=>{this.state=le.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(n=>n.send()),this.pushBuffer=[]}),this.joinPush.receive("error",n=>{this.state=le.errored,this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,n),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic}`),this.state=le.closed,this.socket.remove(this)}),this.onError(n=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,n),this.isJoining()&&this.joinPush.reset(),this.state=le.errored,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.joinPush.receive("timeout",()=>{this.socket.hasLogger()&&this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),new Or(this,Be.leave,er({}),this.timeout).send(),this.state=le.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(Be.reply,(n,s)=>{this.trigger(this.replyEventName(s),n)})}join(t=this.timeout){if(this.joinedOnce)throw new Error("tried to join multiple times. 'join' can only be called a single time per channel instance");return this.timeout=t,this.joinedOnce=!0,this.rejoin(),this.joinPush}teardown(){this.pushBuffer.forEach(t=>t.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=le.closed,this.bindings=[]}onClose(t){this.on(Be.close,t)}onError(t){return this.on(Be.error,e=>t(e))}on(t,e){let r=this.bindingRef++;return this.bindings.push({event:t,ref:r,callback:e}),r}off(t,e){this.bindings=this.bindings.filter(r=>!(r.event===t&&(typeof e>"u"||e===r.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(t,e,r=this.timeout){if(e=e||{},!this.joinedOnce)throw new Error(`tried to push '${t}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let n=new Or(this,t,function(){return e},r);return this.canPush()?n.send():(n.startTimeout(),this.pushBuffer.push(n)),n}leave(t=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=le.leaving;let e=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(Be.close,"leave")},r=new Or(this,Be.leave,er({}),t);return r.receive("ok",()=>e()).receive("timeout",()=>e()),r.send(),this.canPush()||r.trigger("ok",{}),r}onMessage(t,e,r){return e}filterBindings(t,e,r){return!0}isMember(t,e,r,n){return this.topic!==t?!1:n&&n!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:t,event:e,payload:r,joinRef:n}),!1):!0}joinRef(){return this.joinPush.ref}rejoin(t=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=le.joining,this.joinPush.resend(t))}trigger(t,e,r,n){let s=this.onMessage(t,e,r,n);if(e&&!s)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let o=this.bindings.filter(i=>i.event===t&&this.filterBindings(i,e,r));for(let i=0;i<o.length;i++)o[i].callback(s,r,n||this.joinRef())}replyEventName(t){return`chan_reply_${t}`}isClosed(){return this.state===le.closed}isErrored(){return this.state===le.errored}
8isJoined(){return this.state===le.joined}isJoining(){return this.state===le.joining}isLeaving(){return this.state===le.leaving}},cn=class{static request(t,e,r,n,s,o,i){if(je.XDomainRequest){let a=new je.XDomainRequest;return this.xdomainRequest(a,t,e,n,s,o,i)}else if(je.XMLHttpRequest){let a=new je.XMLHttpRequest;return this.xhrRequest(a,t,e,r,n,s,o,i)}else{if(je.fetch&&je.AbortController)return this.fetchRequest(t,e,r,n,s,o,i);throw new Error("No suitable XMLHttpRequest implementation found")}}static fetchRequest(t,e,r,n,s,o,i){let a={method:t,headers:r,body:n},l=null;return s&&(l=new AbortController,setTimeout(()=>l.abort(),s),a.signal=l.signal),je.fetch(e,a).then(u=>u.text()).then(u=>this.parseJSON(u)).then(u=>i&&i(u)).catch(u=>{u.name==="AbortError"&&o?o():i&&i(null)}),l}static xdomainRequest(t,e,r,n,s,o,i){return t.timeout=s,t.open(e,r),t.onload=()=>{let a=this.parseJSON(t.responseText);i&&i(a)},o&&(t.ontimeout=o),t.onprogress=()=>{},t.send(n),t}static xhrRequest(t,e,r,n,s,o,i,a){t.open(e,r,!0),t.timeout=o;for(let[l,u]of Object.entries(n))t.setRequestHeader(l,u);return t.onerror=()=>a&&a(null),t.onreadystatechange=()=>{if(t.readyState===Dg.complete&&a){let l=this.parseJSON(t.responseText);a(l)}},i&&(t.ontimeout=i),t.send(s),t}static parseJSON(t){if(!t||t==="")return null;try{return JSON.parse(t)}catch{return console&&console.log("failed to parse JSON response",t),null}}static serialize(t,e){let r=[];for(var n in t){if(!Object.prototype.hasOwnProperty.call(t,n))continue;let s=e?`${e}[${n}]`:n,o=t[n];typeof o=="object"?r.push(this.serialize(o,s)):r.push(encodeURIComponent(s)+"="+encodeURIComponent(o))}return r.join("&")}static appendParams(t,e){if(Object.keys(e).length===0)return t;let r=t.match(/\?/)?"&":"?";return`${t}${r}${this.serialize(e)}`}},Ug=t=>{let e="",r=new Uint8Array(t),n=r.byteLength;for(let s=0;s<n;s++)e+=String.fromCharCode(r[s]);return btoa(e)},Et=class{constructor(t,e){e&&e.length===2&&e[1].startsWith(_s)&&(this.authToken=atob(e[1].slice(_s.length))),this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.reqs=new Set,this.awaitingBatchAck=!1,this.currentBatch=null,this.currentBatchTimer=null,this.batchBuffer=[],this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(t),this.readyState=Pe.connecting,setTimeout(()=>this.poll(),0)}normalizeEndpoint(t){return t.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+xs.websocket),"$1/"+xs.longpoll)}endpointURL(){return cn.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(t,e,r){this.close(t,e,r),this.readyState=Pe.connecting}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return this.readyState===Pe.open||this.readyState===Pe.connecting}poll(){const t={Accept:"application/json"};this.authToken&&(t["X-Phoenix-AuthToken"]=this.authToken),this.ajax("GET",t,null,()=>this.ontimeout(),e=>{if(e){var{status:r,token:n,messages:s}=e;if(r===410&&this.token!==null){this.onerror(410),this.closeAndRetry(3410,"session_gone",!1);return}this.token=n}else r=0;switch(r){case 200:s.forEach(o=>{setTimeout(()=>this.onmessage({data:o}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=Pe.open,this.onopen({}),this.poll();break;
8case 403:this.onerror(403),this.close(1008,"forbidden",!1);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,"internal server error",500);break;default:throw new Error(`unhandled poll status ${r}`)}})}send(t){typeof t!="string"&&(t=Ug(t)),this.currentBatch?this.currentBatch.push(t):this.awaitingBatchAck?this.batchBuffer.push(t):(this.currentBatch=[t],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(t){this.awaitingBatchAck=!0,this.ajax("POST",{"Content-Type":"application/x-ndjson"},t.join(`
9`),()=>this.onerror("timeout"),e=>{this.awaitingBatchAck=!1,!e||e.status!==200?(this.onerror(e&&e.status),this.closeAndRetry(1011,"internal server error",!1)):this.batchBuffer.length>0&&(this.batchSend(this.batchBuffer),this.batchBuffer=[])})}close(t,e,r){for(let s of this.reqs)s.abort();this.readyState=Pe.closed;let n=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:t,reason:e,wasClean:r});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent<"u"?this.onclose(new CloseEvent("close",n)):this.onclose(n)}ajax(t,e,r,n,s){let o,i=()=>{this.reqs.delete(o),n()};o=cn.request(t,this.endpointURL(),e,r,this.timeout,i,a=>{this.reqs.delete(o),this.isActive()&&s(a)}),this.reqs.add(o)}},Bg=class Yt{constructor(e,r={}){let n=r.events||{state:"presence_state",diff:"presence_diff"};this.state={},this.pendingDiffs=[],this.channel=e,this.joinRef=null,this.caller={onJoin:function(){},onLeave:function(){},onSync:function(){}},this.channel.on(n.state,s=>{let{onJoin:o,onLeave:i,onSync:a}=this.caller;this.joinRef=this.channel.joinRef(),this.state=Yt.syncState(this.state,s,o,i),this.pendingDiffs.forEach(l=>{this.state=Yt.syncDiff(this.state,l,o,i)}),this.pendingDiffs=[],a()}),this.channel.on(n.diff,s=>{let{onJoin:o,onLeave:i,onSync:a}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(s):(this.state=Yt.syncDiff(this.state,s,o,i),a())})}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}list(e){return Yt.list(this.state,e)}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel.joinRef()}static syncState(e,r,n,s){let o=this.clone(e),i={},a={};return this.map(o,(l,u)=>{r[l]||(a[l]=u)}),this.map(r,(l,u)=>{let d=o[l];if(d){let h=u.metas.map(g=>g.phx_ref),m=d.metas.map(g=>g.phx_ref),p=u.metas.filter(g=>m.indexOf(g.phx_ref)<0),v=d.metas.filter(g=>h.indexOf(g.phx_ref)<0);p.length>0&&(i[l]=u,i[l].metas=p),v.length>0&&(a[l]=this.clone(d),a[l].metas=v)}else i[l]=u}),this.syncDiff(o,{joins:i,leaves:a},n,s)}static syncDiff(e,r,n,s){let{joins:o,leaves:i}=this.clone(r);return n||(n=function(){}),s||(s=function(){}),this.map(o,(a,l)=>{let u=e[a];if(e[a]=this.clone(l),u){let d=e[a].metas.map(m=>m.phx_ref),h=u.metas.filter(m=>d.indexOf(m.phx_ref)<0);e[a].metas.unshift(...h)}n(a,u,l)}),this.map(i,(a,l)=>{let u=e[a];if(!u)return;let d=l.metas.map(h=>h.phx_ref);u.metas=u.metas.filter(h=>d.indexOf(h.phx_ref)<0),s(a,u,l),u.metas.length===0&&delete e[a]}),e}static list(e,r){return r||(r=function(n,s){return s}),this.map(e,(n,s)=>r(n,s))}static map(e,r){return Object.getOwnPropertyNames(e).map(n=>r(n,e[n]))}static clone(e){return JSON.parse(JSON.stringify(e))}},Nr={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(t,e){if(t.payload.constructor===ArrayBuffer)return e(this.binaryEncode(t));{let r=[t.join_ref,t.ref,t.topic,t.event,t.payload];return e(JSON.stringify(r))}},decode(t,e){if(t.constructor===ArrayBuffer)return e(this.binaryDecode(t));{let[r,n,s,o,i]=JSON.parse(t);return e({join_ref:r,ref:n,topic:s,event:o,payload:i})}},binaryEncode(t){let{join_ref:e,ref:r,event:n,topic:s,payload:o}=t,i=this.META_LENGTH+e.length+r.length+s.length+n.length,a=new ArrayBuffer(this.HEADER_LENGTH+i),l=new DataView(a),u=0;l.setUint8(u++,this.KINDS.push),l.setUint8(u++,e.length),l.setUint8(u++,r.length),l.setUint8(u++,s.length),l.setUint8(u++,n.length),Array.from(e,h=>l.setUint8(u++,h.charCodeAt(0))),Array.from(r,h=>l.setUint8(u++,h.charCodeAt(0))),Array.from(s,h=>l.setUint8(u++,h.charCodeAt(0))),Array.from(n,h=>l.setUint8(u++,h.charCodeAt(0)));var d=new Uint8Array(a.byteLength+o.byteLength);return d.set(new Uint8Array(a),0),d.set(new Uint8Array(o),a.byteLength),d.buffer},binaryDecode(t){let e=new DataView(t),r=e.getUint8(0),n=new TextDecoder;switch(r){case this.KINDS.push:return this.decodePush(t,e,n);case this.KINDS.reply:return this.decodeReply(t,e,n);case this.KINDS.broadcast:return this.decodeBroadcast(t,e,n)}},decodePush(t,e,r){let n=e.getUint8(1),s=e.getUint8(2),o=e.getUint8(3),i=this.HEADER_LENGTH+this.META_LENGTH-1,a=r.decode(t.slice(i,i+n));i=i+n;let l=r.decode(t.slice(i,i+s));i=i+s;let u=r.decode(t.slice(i,i+o));i=i+o;let d=t.slice(i,t.byteLength);return{join_ref:a,ref:null,topic:l,event:u,payload:d}},decodeReply(t,e,r){let n=e.getUint8(1),s=e.getUint8(2),o=e.getUint8(3),i=e.getUint8(4),a=this.HEADER_LENGTH+this.META_LENGTH,l=r.decode(t.slice(a,a+n));a=a+n;let u=r.decode(t.slice(a,a+s));a=a+s;let d=r.decode(t.slice(a,a+o));a=a+o;let h=r.decode(t.slice(a,a+i));a=a+i;let m=t.slice(a,t.byteLength),p={status:h,response:m};return{join_ref:l,ref:u,topic:d,event:Be.reply,payload:p}},decodeBroadcast(t,e,r){let n=e.getUint8(1),s=e.getUint8(2),o=this.HEADER_LENGTH+2,i=r.decode(t.slice(o,o+n));o=o+n;let a=r.decode(t.slice(o,o+s));o=o+s;let l=t.slice(o,t.byteLength);return{join_ref:null,ref:null,topic:i,event:a,payload:l}}},Fg=class{constructor(t,e={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=e.timeout||Lg,this.transport=e.transport||je.WebSocket||Et,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=e.longPollFallbackMs,this.fallbackTimer=null;let r=null;try{r=je&&je.sessionStorage}catch{}this.sessionStore=e.sessionStorage||r,this.establishedConnections=0,this.defaultEncoder=Nr.encode.bind(Nr),this.defaultDecoder=Nr.decode.bind(Nr),this.closeWasClean=!0,this.disconnecting=!1,this.binaryType=e.binaryType||"arraybuffer",this.connectClock=1,this.pageHidden=!1,this.encode=void 0,this.decode=void 0,this.transport!==Et?(this.encode=e.encode||this.defaultEncoder,this.decode=e.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let n=null;Pt&&Pt.addEventListener&&(Pt.addEventListener("pagehide",s=>{this.conn&&(this.disconnect(),n=this.connectClock)}),Pt.addEventListener("pageshow",s=>{n===this.connectClock&&(n=null,this.connect())}),Pt.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"?this.pageHidden=!0:(this.pageHidden=!1,!this.isConnected()&&!this.closeWasClean&&this.teardown(()=>this.connect()))})),this.heartbeatIntervalMs=e.heartbeatIntervalMs||3e4,this.autoSendHeartbeat=e.autoSendHeartbeat??!0,this.heartbeatCallback=e.heartbeatCallback??(()=>{}),this.rejoinAfterMs=s=>e.rejoinAfterMs?e.rejoinAfterMs(s):[1e3,2e3,5e3][s-1]||1e4,this.reconnectAfterMs=s=>e.reconnectAfterMs?e.reconnectAfterMs(s):[10,50,100,150,200,250,500,1e3,2e3][s-1]||5e3,this.logger=e.logger||null,!this.logger&&e.debug&&(this.logger=(s,o,i)=>{console.log(`${s}: ${o}`,i)}),this.longpollerTimeout=e.longpollerTimeout||2e4,this.params=er(e.params||{}),this.endPoint=`${t}/${xs.websocket}`,this.vsn=e.vsn||Ig,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new Cl(()=>{if(this.pageHidden){this.log("Not reconnecting as page is hidden!"),this.teardown();return}this.teardown(async()=>{e.beforeReconnect&&await e.beforeReconnect(),this.connect()})},this.reconnectAfterMs),this.authToken=e.authToken}getLongPollTransport(){return Et}replaceTransport(t){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.
vendor: 4,363 bytes, line 9
9close(),this.conn=null),this.transport=t}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let t=cn.appendParams(cn.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return t.charAt(0)!=="/"?t:t.charAt(1)==="/"?`${this.protocol()}:${t}`:`${this.protocol()}://${location.host}${t}`}disconnect(t,e,r){this.connectClock++,this.disconnecting=!0,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=!1,t&&t()},e,r)}connect(t){t&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=er(t)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==Et?this.connectWithFallback(Et,this.longPollFallbackMs):this.transportConnect())}log(t,e,r){this.logger&&this.logger(t,e,r)}hasLogger(){return this.logger!==null}onOpen(t){let e=this.makeRef();return this.stateChangeCallbacks.open.push([e,t]),e}onClose(t){let e=this.makeRef();return this.stateChangeCallbacks.close.push([e,t]),e}onError(t){let e=this.makeRef();return this.stateChangeCallbacks.error.push([e,t]),e}onMessage(t){let e=this.makeRef();return this.stateChangeCallbacks.message.push([e,t]),e}onHeartbeat(t){this.heartbeatCallback=t}ping(t){if(!this.isConnected())return!1;let e=this.makeRef(),r=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:e});let n=this.onMessage(s=>{s.ref===e&&(this.off([n]),t(Date.now()-r))});return!0}transportName(t){switch(t){case Et:return"LongPoll";default:return t.name}}transportConnect(){this.connectClock++,this.closeWasClean=!1;let t;this.authToken&&(t=["phoenix",`${_s}${btoa(this.authToken).replace(/=/g,"")}`]),this.conn=new this.transport(this.endPointURL(),t),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=e=>this.onConnError(e),this.conn.onmessage=e=>this.onConnMessage(e),this.conn.onclose=e=>this.onConnClose(e)}getSession(t){return this.sessionStore&&this.sessionStore.getItem(t)}storeSession(t,e){this.sessionStore&&this.sessionStore.setItem(t,e)}connectWithFallback(t,e=2500){clearTimeout(this.fallbackTimer);let r=!1,n=!0,s,o,i=this.transportName(t),a=l=>{this.log("transport",`falling back to ${i}...`,l),this.off([s,o]),n=!1,this.replaceTransport(t),this.transportConnect()};if(this.getSession(`phx:fallback:${i}`))return a("memorized");this.fallbackTimer=setTimeout(a,e),o=this.onError(l=>{this.log("transport","error",l),n&&!r&&(clearTimeout(this.fallbackTimer),a(l))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(r=!0,!n){let l=this.transportName(t);return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${l}`,"true"),this.log("transport",`established ${l} fallback`)}clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(a,e),this.ping(l=>{this.log("transport","connected to primary after",l),this.primaryPassedHealthCheck=!0,clearTimeout(this.fallbackTimer)})}),this.transportConnect()}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log("transport",`connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.disconnecting=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.autoSendHeartbeat&&this.resetHeartbeat(),this.triggerStateCallbacks("open")}heartbeatTimeout(){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.hasLogger()&&this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(t){this.log("error","error in heartbeat callback",t)}this.triggerChanError(new Error("heartbeat timeout")),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),$g,"heartbeat timeout")}}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(t,e,r){if(!this.conn)return t&&t();const n=this.conn;this.waitForBufferDone(n,()=>{e?n.close(e,r||""):n.close(),this.waitForSocketClosed(n,()=>{this.conn===n&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){}
9,this.conn.onclose=function(){},this.conn=null),t&&t()})})}waitForBufferDone(t,e,r=1){if(r===5||!t.bufferedAmount){e();return}setTimeout(()=>{this.waitForBufferDone(t,e,r+1)},150*r)}waitForSocketClosed(t,e,r=1){if(r===5||t.readyState===Pe.closed){e();return}setTimeout(()=>{this.waitForSocketClosed(t,e,r+1)},150*r)}onConnClose(t){this.conn&&(this.conn.onclose=()=>{}),this.hasLogger()&&this.log("transport","close",t),this.triggerChanError(t),this.clearHeartbeats(),this.closeWasClean||this.reconnectTimer.scheduleTimeout(),this.triggerStateCallbacks("close",t)}onConnError(t){this.hasLogger()&&this.log("transport","error",t);let e=this.transport,r=this.establishedConnections;this.triggerStateCallbacks("error",t,e,r),(e===this.transport||r>0)&&this.triggerChanError(t)}triggerChanError(t){this.channels.forEach(e=>{e.isErrored()||e.isLeaving()||e.isClosed()||e.trigger(Be.error,t)})}connectionState(){switch(this.conn&&this.conn.readyState){case Pe.connecting:return"connecting";case Pe.open:return"open";case Pe.closing:return"closing";default:return"closed"}}isConnected(){return this.connectionState()==="open"}remove(t){this.off(t.stateChangeRefs),this.channels=this.channels.filter(e=>e!==t)}off(t){for(let e in this.stateChangeCallbacks)this.stateChangeCallbacks[e]=this.stateChangeCallbacks[e].filter(([r])=>t.indexOf(r)===-1)}channel(t,e={}){let r=new Mg(t,e,this);return this.channels.push(r),r}push(t){if(this.hasLogger()){let{topic:e,event:r,payload:n,ref:s,join_ref:o}=t;this.log("push",`${e} ${r} (${o}, ${s})`,n)}this.isConnected()?this.encode(t,e=>this.conn.send(e)):this.sendBuffer.push(()=>this.encode(t,e=>this.conn.send(e)))}makeRef(){let t=this.ref+1;return t===this.ref?this.ref=0:this.ref=t,this.ref.toString()}sendHeartbeat(){if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(t){this.log("error","error in heartbeat callback",t)}return}if(this.pendingHeartbeatRef){this.heartbeatTimeout();return}this.pendingHeartbeatRef=this.makeRef(),this.heartbeatSentAt=Date.now(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(t){this.log("error","error in heartbeat callback",t)}this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs)}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(t=>t()),this.sendBuffer=[])}onConnMessage(t){this.decode(t.data,e=>{let{topic:r,event:n,payload:s,ref:o,join_ref:i}=e;if(o&&o===this.pendingHeartbeatRef){const a=this.heartbeatSentAt?Date.now()-this.heartbeatSentAt:void 0;this.clearHeartbeats();try{this.heartbeatCallback(s.status==="ok"?"ok":"error",a)}catch(l){this.log("error","error in heartbeat callback",l)}this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.autoSendHeartbeat&&(this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}this.hasLogger()&&this.log("receive",`${s.status||""} ${r} ${n} ${o&&"("+o+")"||""}`.trim(),s);for(let a=0;a<this.channels.length;a++){const l=this.channels[a];l.isMember(r,n,s,i)&&l.trigger(n,s,o,i)}this.triggerStateCallbacks("message",e)})}triggerStateCallbacks(t,...e){try{this.stateChangeCallbacks[t].forEach(([r,n])=>{try{n(...e)}catch(s){this.log("error",`error in ${t} callback`,s)}})}catch(r){this.log("error",`error triggering ${t} callbacks`,r)}}leaveOpenTopic(t){let e=this.channels.find(r=>r.topic===t&&(r.isJoined()||r.isJoining()));e&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${t}"`),e.leave())}};class tr{constructor(e,r){const n=Vg(r);this.presence=new Bg(e.getChannel(),n),this.presence.onJoin((s,o,i)=>{const a=tr.onJoinPayload(s,o,i);e.getChannel().trigger("presence",a)}),this.presence.onLeave((s,o,i)=>{const a=tr.onLeavePayload(s,o,i);e.getChannel().trigger("presence",a)}),this.presence.onSync(()=>{e.getChannel().trigger("presence",{event:"sync"})})}get state(){return tr.transformState(this.presence.state)}static transformState(e){return e=Hg(e),Object.getOwnPropertyNames(e).reduce((r,n)=>{const s=e[n];return r[n]=Qr(s),r},{})}static onJoinPayload(e,r,n){const s=ei(r),o=Qr(n);return{event:"join",key:e,currentPresences:s,newPresences:o}}static onLeavePayload(e,r,n){const s=ei(r),o=Qr(n);return{event:"leave",key:e,currentPresences:s,leftPresences:o}}}function Qr(t){return t.metas.map(e=>(e.presence_ref=e.phx_ref,delete e.phx_ref,delete e.phx_ref_prev,e))}function Hg(t){return JSON.parse(JSON.stringify(t))}function Vg(t){return(t==null?void 0:t.events)&&{events:t.events}}function ei(t){return t!=null&&t.metas?Qr(t):[]}var ti;(function(t){t.SYNC="sync",t.JOIN="join",t.LEAVE="leave"})(ti||(ti={}));class Wg{get state(){return this.presenceAdapter.state}constructor(e,r){this.channel=e,this.presenceAdapter=new tr(this.channel.channelAdapter,r)}}function qg(t){if(t instanceof Error)return t;if(typeof t=="string")return new Error(t);if(t&&typeof t=="object"){const e=t;
9if(typeof e.code=="number"){const r=typeof e.reason=="string"&&e.reason?` (${e.reason})`:"";return new Error(`socket closed: ${e.code}${r}`,{cause:t})}return new Error("channel error: transport failure",{cause:t})}return new Error("channel error: connection lost")}class zg{constructor(e,r,n){const s=Kg(n);this.channel=e.getSocket().channel(r,s),this.socket=e}get state(){return this.channel.state}set state(e){this.channel.state=e}get joinedOnce(){return this.channel.joinedOnce}get joinPush(){return this.channel.joinPush}get rejoinTimer(){return this.channel.rejoinTimer}on(e,r){return this.channel.on(e,r)}off(e,r){this.channel.off(e,r)}subscribe(e){return this.channel.join(e)}unsubscribe(e){return this.channel.leave(e)}teardown(){this.channel.teardown()}onClose(e){this.channel.onClose(e)}onError(e){return this.channel.onError(e)}push(e,r,n){let s;try{s=this.channel.push(e,r,n)}catch{throw new Error(`tried to push '${e}' to '${this.channel.topic}' before joining. Use channel.subscribe() before pushing events`)}if(this.channel.pushBuffer.length>kg){const o=this.channel.pushBuffer.shift();o.cancelTimeout(),this.socket.log("channel",`discarded push due to buffer overflow: ${o.event}`,o.payload())}return s}updateJoinPayload(e){const r=this.channel.joinPush.payload();this.channel.joinPush.payload=()=>Object.assign(Object.assign({},r),e)}canPush(){return this.socket.isConnected()&&this.state===et.joined}isJoined(){return this.state===et.joined}isJoining(){return this.state===et.joining}isClosed(){return this.state===et.closed}isLeaving(){return this.state===et.leaving}updateFilterBindings(e){this.channel.filterBindings=e}updatePayloadTransform(e){this.channel.onMessage=e}getChannel(){return this.channel}}function Kg(t){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},t.config)}}const Jg=/[,()"\\]/,Gg=t=>Jg.test(t)||t!==t.trim(),Yg=t=>`"${t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`,ri=t=>{const e=t===null?"null":String(t);return Gg(e)?Yg(e):e},Xg=t=>t===null?"null":String(t),Qg=(t,e)=>{if(t==="in"){const r=Array.isArray(e)?e:[e];if(r.length===0)throw new Error("Realtime `in` filter requires at least one value.");return`in.(${Array.from(new Set(r)).map(s=>ri(s)).join(",")})`}return t==="is"?`is.${Xg(e)}`:`${t}.${ri(e)}`};class Zg{constructor(){this.filters=[]}add(e,r,n,s=!1){const o=s?"not.":"";return this.filters.push(`${e}=${o}${Qg(r,n)}`),this}eq(e,r){return this.add(e,"eq",r)}neq(e,r){return this.add(e,"neq",r)}gt(e,r){return this.add(e,"gt",r)}gte(e,r){return this.add(e,"gte",r)}lt(e,r){return this.add(e,"lt",r)}lte(e,r){return this.add(e,"lte",r)}in(e,r){return this.add(e,"in",r)}like(e,r){return this.add(e,"like",r)}ilike(e,r){return this.add(e,"ilike",r)}match(e,r){return this.add(e,"match",r)}imatch(e,r){return this.add(e,"imatch",r)}is(e,r){return this.add(e,"is",r)}isDistinct(e,r){return this.add(e,"isdistinct",r)}not(e,r,n){return this.add(e,r,n,!0)}build(){return this.filters.join(",")}toString(){return this.build()}}var ni;(function(t){t.ALL="*",t.INSERT="INSERT",t.UPDATE="UPDATE",t.DELETE="DELETE"})(ni||(ni={}));var Nt;(function(t){t.BROADCAST="broadcast",t.PRESENCE="presence",t.POSTGRES_CHANGES="postgres_changes",t.SYSTEM="system"})(Nt||(Nt={}));var Fe;(function(t){t.SUBSCRIBED="SUBSCRIBED",t.TIMED_OUT="TIMED_OUT",t.CLOSED="CLOSED",t.CHANNEL_ERROR="CHANNEL_ERROR"})(Fe||(Fe={}));class rr{get state(){return this.channelAdapter.state}set state(e){this.channelAdapter.state=e}get joinedOnce(){return this.channelAdapter.joinedOnce}get timeout(){return this.socket.timeout}get joinPush(){return this.channelAdapter.joinPush}get rejoinTimer(){return this.channelAdapter.rejoinTimer}constructor(e,r={config:{}},n){var s,o;if(this.topic=e,this.params=r,this.socket=n,this.bindings={},this.subTopic=e.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},r.config),this.channelAdapter=new zg(this.socket.socketAdapter,e,this.params),this.presence=new Wg(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=Al(this.socket.socketAdapter.endPointURL()),this.private=this.params.config.private||!1,!this.private&&(!((o=(s=this.params.config)===null||s===void 0?void 0:s.broadcast)===null||o===void 0)&&o.replay))throw new Error(`tried to use replay on public channel '${this.topic}'. It must be a private channel.`)}subscribe(e,r=this.timeout){var n,s,o;if(this.socket.isConnected()||this.socket.connect(),this.channelAdapter.isClosed()){const{config:{broadcast:i,presence:a,private:l}}=this.params,u=(s=(n=this.bindings.postgres_changes)===null||n===void 0?void 0:n.map(p=>p.filter))!==null&&s!==void 0?s:[],d=!!this.bindings[Nt.PRESENCE]&&this.bindings[Nt.PRESENCE].length>0||((o=this.params.config.presence)===null||o===void 0?void 0:o.enabled)===!0,h={},m={broadcast:i,presence:Object.assign(Object.assign({},a),{enabled:d}),postgres_changes:u,private:l};this.socket.accessTokenValue&&(h.access_token=this.socket.accessTokenValue),this._onError(p=>{e==null||e(Fe.CHANNEL_ERROR,qg(p))}),this._onClose(()=>e==null?void 0:e(Fe.CLOSED)),this.updateJoinPayload(Object.assign({config:m},h)),this._updateFilterMessage(),this.channelAdapter.subscribe(r).receive("ok",async({postgres_changes:p})=>{if(this.socket._isManualToken()||this.socket.setAuth(),p===void 0){e==null||e(Fe.SUBSCRIBED);return}this._updatePostgresBindings(p,e)}).receive("error",p=>{this.state=et.errored;const v=Object.values(p).join(", ")||"error";e==null||e(Fe.CHANNEL_ERROR,new Error(v,{cause:p}))}).receive("timeout",()=>{e==null||e(Fe.TIMED_OUT)})}return this}_updatePostgresBindings(e,r){var n;const s=this.bindings.postgres_changes,o=(n=s==null?void 0:s.length)!==null&&n!==void 0?n:0,i=[];for(let a=0;a<o;a++){const l=s[a],{filter:{event:u,schema:d,table:h,filter:m}}=l,p=e&&e[a];if(p&&p.event===u&&rr.isFilterValueEqual(p.schema,d)&&rr.isFilterValueEqual(p.table,h)&&rr.isFilterValueEqual(p.filter,m))i.push(Object.assign(Object.assign({},l),{id:p.id}));else{this.unsubscribe(),this.state=et.errored,r==null||r(Fe.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=i,this.state!=et.errored&&r&&r(Fe.SUBSCRIBED)}presenceState(){return this.presence.state}async track(e,r={}){return await this.send({type:"presence",event:"track",payload:e},r.timeout||this.timeout)}async untrack(e={}){return await this.send({type:"presence",event:"untrack"},e)}on(e,r,n){const s=this.channelAdapter.isJoined()||this.channelAdapter.isJoining(),o=e===Nt.PRESENCE||e===Nt.POSTGRES_CHANGES;if(s&&o)throw this.socket.log("channel",`cannot add \`${e}\` callbacks for ${this.topic} after \`subscribe()\`.`),new Error(`cannot add \`${e}\` callbacks for ${this.topic} after \`subscribe()\`.`);return this._on(e,r,n)}async httpSend(e,r,n={}){var s;if(r==null)return Promise.reject(new Error("Payload is required for httpSend()"));const o=r instanceof ArrayBuffer||ArrayBuffer.isView(r),i={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":o?"application/octet-stream":"application/json"};this.socket.accessTokenValue&&(i.Authorization=`Bearer ${this.socket.accessTokenValue}`);const a=new URL(this.broadcastEndpointURL);a.pathname+=`/${encodeURIComponent(this.subTopic)}/events/${encodeURIComponent(e)}`,this.private&&a.searchParams.set("private","true");const l={method:"POST",headers:i,body:o?r:JSON.stringify(r)},u=await this._fetchWithTimeout(a.toString(),l,(s=n.timeout)!==null&&s!==void 0?s:this.timeout);if(u.status===202)return{success:!0};if(u.status===404)return Promise.reject(new Error("httpSend() requires Realtime server v2.97.0 or newer; the endpoint returned 404. Update your Supabase CLI to a recent version, or upgrade the Realtime server in your self-hosted setup. See https://github.com/supabase/supabase-js/blob/master/packages/core/realt
9ime-js/migrations/httpsend-server-version.md"));let d=u.statusText;try{const h=await u.json();d=h.error||h.message||d}catch{}return Promise.reject(new Error(d))}async send(e,r={}){var n,s;if(!this.channelAdapter.canPush()&&e.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated in the future. Please use httpSend() explicitly for REST delivery.");const{event:o,payload:i}=e,a={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(a.Authorization=`Bearer ${this.socket.accessTokenValue}`);const l={method:"POST",headers:a,body:JSON.stringify({messages:[{topic:this.subTopic,event:o,payload:i,private:this.private}]})};try{const u=await this._fetchWithTimeout(this.broadcastEndpointURL,l,(n=r.timeout)!==null&&n!==void 0?n:this.timeout);return await((s=u.body)===null||s===void 0?void 0:s.cancel()),u.ok?"ok":"error"}catch(u){return u instanceof Error&&u.name==="AbortError"?"timed out":"error"}}else return new Promise(o=>{var i,a,l;const u=this.channelAdapter.push(e.type,e,r.timeout||this.timeout);e.type==="broadcast"&&!(!((l=(a=(i=this.params)===null||i===void 0?void 0:i.config)===null||a===void 0?void 0:a.broadcast)===null||l===void 0)&&l.ack)&&o("ok"),u.receive("ok",()=>o("ok")),u.receive("error",()=>o("error")),u.receive("timeout",()=>o("timed out"))})}updateJoinPayload(e){this.channelAdapter.updateJoinPayload(e)}async unsubscribe(e=this.timeout){return new Promise(r=>{this.channelAdapter.unsubscribe(e).receive("ok",()=>r("ok")).receive("timeout",()=>r("timed out")).receive("error",()=>r("error"))})}teardown(){this.channelAdapter.teardown()}async _fetchWithTimeout(e,r,n){const s=new AbortController,o=setTimeout(()=>s.abort(),n),i=await this.socket.fetch(e,Object.assign(Object.assign({},r),{signal:s.signal}));return clearTimeout(o),i}_on(e,r,n){const s=e.toLocaleLowerCase(),o=r==null?void 0:r.filter;(o instanceof Zg||typeof o=="object"&&o!==null&&typeof o.build=="function")&&(r=Object.assign(Object.assign({},r),{filter:o.build()}));const i=this.channelAdapter.on(e,n),a={type:s,filter:r,callback:n,ref:i};return this.bindings[s]?this.bindings[s].push(a):this.bindings[s]=[a],this._updateFilterMessage(),this}_onClose(e){this.channelAdapter.onClose(e)}_onError(e){this.channelAdapter.onError(e)}_updateFilterMessage(){this.channelAdapter.updateFilterBindings((e,r,n)=>{var s,o,i,a,l,u,d;const h=e.event.toLocaleLowerCase();if(this._notThisChannelEvent(h,n))return!1;const m=(s=this.bindings[h])===null||s===void 0?void 0:s.find(p=>p.ref===e.ref);if(!m)return!0;if(["broadcast","presence","postgres_changes"].includes(h))if("id"in m){const p=m.id,v=(o=m.filter)===null||o===void 0?void 0:o.event;return p&&((i=r.ids)===null||i===void 0?void 0:i.includes(p))&&(v==="*"||(v==null?void 0:v.toLocaleLowerCase())===((a=r.data)===null||a===void 0?void 0:a.type.toLocaleLowerCase()))}else{const p=(u=(l=m==null?void 0:m.filter)===null||l===void 0?void 0:l.event)===null||u===void 0?void 0:u.toLocaleLowerCase();return p==="*"||p===((d=r==null?void 0:r.event)===null||d===void 0?void 0:d.toLocaleLowerCase())}else return m.type.toLocaleLowerCase()===h})}_notThisChannelEvent(e,r){const{close:n,error:s,leave:o,join:i}=Tl;return r&&[n,s,o,i].includes(e)&&r!==this.joinPush.ref}_updateFilterTransform(){this.channelAdapter.updatePayloadTransform((e,r,n)=>{if(typeof r=="object"&&"ids"in r){const s=r.data,{schema:o,table:i,commit_timestamp:a,type:l,errors:u}=s;return Object.assign(Object.assign({},{schema:o,table:i,commit_timestamp:a,eventType:l,new:{},old:{},errors:u}),this._getPayloadRecords(s))}return r})}copyBindings(e){if(this.joinedOnce)throw new Error("cannot copy bindings into joined channel");for(const r in e.bindings)for(const n of e.bindings[r])this._on(n.type,n.filter,n.callback)}static isFilterValueEqual(e,r){return(e??void 0)===(r??void 0)}_getPayloadRecords(e){const r={new:{},old:{}};return(e.type==="INSERT"||e.type==="UPDATE")&&(r.new=Zo(e.columns,e.record)),(e.type==="UPDATE"||e.type==="DELETE")&&(r.old=Zo(e.columns,e.old_record)),r}}class ev{constructor(e,r){this.socket=new Fg(e,r)}get timeout(){return this.socket.timeout}get endPoint(){return this.socket.endPoint}get transport(){return this.socket.transport}get heartbeatIntervalMs(){return this.socket.heartbeatIntervalMs}get heartbeatCallback(){return this.socket.heartbeatCallback}set heartbeatCallback(e){this.socket.heartbeatCallback=e}get heartbeatTimer(){return this.socket.heartbeatTimer}get pendingHeartbeatRef(){return this.socket.pendingHeartbeatRef}get reconnectTimer(){return this.socket.reconnectTimer}get vsn(){return this.socket.vsn}get encode(){return this.socket.encode}get decode(){return this.socket.decode}get reconnectAfterMs(){return this.socket.reconnectAfterMs}get sendBuffer(){return this.socket.sendBuffer}get stateChangeCallbacks(){return this.socket.stateChangeCallbacks}connect(){this.socket.connect()}disconnect(e,r,n,s=1e4){return new Promise(o=>{setTimeout(()=>
9o("timeout"),s),this.socket.disconnect(()=>{e(),o("ok")},r,n)})}push(e){this.socket.push(e)}log(e,r,n){this.socket.log(e,r,n)}makeRef(){return this.socket.makeRef()}onOpen(e){this.socket.onOpen(e)}onClose(e){this.socket.onClose(e)}onError(e){this.socket.onError(e)}onMessage(e){this.socket.onMessage(e)}isConnected(){return this.socket.isConnected()}isConnecting(){return this.socket.connectionState()==bs.connecting}isDisconnecting(){return this.socket.connectionState()==bs.closing}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}}const si={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},tv=[1e3,2e3,5e3,1e4],rv=1e4;function nv(){const t=new Map;return{get length(){return t.size},clear(){t.clear()},getItem(e){return t.has(e)?t.get(e):null},key(e){var r;return(r=Array.from(t.keys())[e])!==null&&r!==void 0?r:null},removeItem(e){t.delete(e)},setItem(e,r){t.set(e,String(r))}}}function sv(){try{if(typeof globalThis<"u"&&globalThis.sessionStorage)return globalThis.sessionStorage}catch{}return nv()}const ov=`
10  addEventListener("message", (e) => {
11    if (e.data.event === "start") {
12      setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
13    }
14  });`;class iv{get endPoint(){return this.socketAdapter.endPoint}get timeout(){return this.socketAdapter.timeout}get transport(){return this.socketAdapter.transport}get heartbeatCallback(){return this.socketAdapter.heartbeatCallback}get heartbeatIntervalMs(){return this.socketAdapter.heartbeatIntervalMs}get heartbeatTimer(){return this.worker?this._workerHeartbeatTimer:this.socketAdapter.heartbeatTimer}get pendingHeartbeatRef(){return this.worker?this._pendingWorkerHeartbeatRef:this.socketAdapter.pendingHeartbeatRef}get reconnectTimer(){return this.socketAdapter.reconnectTimer}get vsn(){return this.socketAdapter.vsn}get encode(){return this.socketAdapter.encode}get decode(){return this.socketAdapter.decode}get reconnectAfterMs(){return this.socketAdapter.reconnectAfterMs}get sendBuffer(){return this.socketAdapter.sendBuffer}get stateChangeCallbacks(){return this.socketAdapter.stateChangeCallbacks}constructor(e,r){var n;if(this.channels=new Array,this.accessTokenValue=null,this.accessToken=null,this.apiKey=null,this.httpEndpoint="",this.headers={},this.params={},this.ref=0,this.serializer=new Tg,this._manuallySetToken=!1,this._authPromise=null,this._workerHeartbeatTimer=void 0,this._pendingWorkerHeartbeatRef=null,this._pendingDisconnectTimer=null,this._disconnectOnEmptyChannelsAfterMs=0,this._resolveFetch=o=>o?(...i)=>o(...i):(...i)=>fetch(...i),!(!((n=r==null?void 0:r.params)===null||n===void 0)&&n.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=r.params.apikey;const s=this._initializeOptions(r);this.socketAdapter=new ev(e,s),this.httpEndpoint=Al(e),this.fetch=this._resolveFetch(r==null?void 0:r.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.isConnected())){this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this._setupConnectionHandlers();try{this.socketAdapter.connect()}catch(e){const r=e.message;throw new Error(`WebSocket not available: ${r}`)}this._handleNodeJsRaceCondition()}}endpointURL(){return this.socketAdapter.endPointURL()}async disconnect(e,r){return this._cancelPendingDisconnect(),this.isDisconnecting()?"ok":await this.socketAdapter.disconnect(()=>{clearInterval(this._workerHeartbeatTimer),this._terminateWorker()},e,r)}getChannels(){return this.channels}async removeChannel(e){const r=await e.unsubscribe();return r==="ok"&&e.teardown(),r}async removeAllChannels(){const e=this.channels.map(async n=>{const s=await n.unsubscribe();return n.teardown(),s}),r=await Promise.all(e);return await this.disconnect(),r}log(e,r,n){this.socketAdapter.log(e,r,n)}connectionState(){return this.socketAdapter.connectionState()||bs.closed}isConnected(){return this.socketAdapter.isConnected()}isConnecting(){return this.socketAdapter.isConnecting()}isDisconnecting(){return this.socketAdapter.isDisconnecting()}channel(e,r={config:{}}){const n=`realtime:${e}`,s=this.getChannels().find(o=>o.topic===n);if(s)return s;{const o=new rr(`realtime:${e}`,r,this);return this._cancelPendingDisconnect(),this.channels.push(o),o}}push(e){this.socketAdapter.push(e)}async setAuth(e=null){this._authPromise=this._performAuth(e);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){this.socketAdapter.sendHeartbeat()}onHeartbeat(e){this.socketAdapter.heartbeatCallback=this._wrapHeartbeatCallback(e)}_makeRef(){return this.socketAdapter.makeRef()}_remove(e){this.channels=this.channels.filter(r=>r.topic!==e.topic),this.channels.length===0&&(this.log("transport","no channels remaining, scheduling disconnect"),this._schedulePendingDisconnect())}_schedulePendingDisconnect(){if(this._cancelPendingDisconnect(),this._disconnectOnEmptyChannelsAfterMs===0){this.log("transport","disconnecting immediately - no channels"),this.disconnect();return}
14this._pendingDisconnectTimer=setTimeout(()=>{this._pendingDisconnectTimer=null,this.channels.length===0&&(this.log("transport","deferred disconnect fired - no channels, disconnecting"),this.disconnect())},this._disconnectOnEmptyChannelsAfterMs),this.log("transport",`deferred disconnect scheduled in ${this._disconnectOnEmptyChannelsAfterMs}ms`)}_cancelPendingDisconnect(){this._pendingDisconnectTimer!==null&&(this.log("transport","pending disconnect cancelled - channel activity detected"),clearTimeout(this._pendingDisconnectTimer),this._pendingDisconnectTimer=null)}async _performAuth(e=null){let r,n=!1;if(e)r=e,n=!0;else if(this.accessToken)try{r=await this.accessToken()}catch(s){this.log("error","Error fetching access token from callback",s),r=this.accessTokenValue}else r=this.accessTokenValue;n?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=r&&(this.accessTokenValue=r,this.channels.forEach(s=>{const o={access_token:r,version:xg};r&&s.updateJoinPayload(o),s.joinedOnce&&s.channelAdapter.isJoined()&&s.channelAdapter.push(Tl.access_token,{access_token:r})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(e="general"){this._isManualToken()||this.setAuth().catch(r=>{this.log("error",`Error setting auth in ${e}`,r)})}_setupConnectionHandlers(){this.socketAdapter.onOpen(()=>{(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).catch(r=>{this.log("error","error waiting for auth on connect",r)}),this.worker&&!this.workerRef&&this._startWorkerHeartbeat()}),this.socketAdapter.onClose(()=>{this.worker&&this.workerRef&&this._terminateWorker()}),this.socketAdapter.onMessage(e=>{e.ref&&e.ref===this._pendingWorkerHeartbeatRef&&(this._pendingWorkerHeartbeatRef=null)})}_handleNodeJsRaceCondition(){this.socketAdapter.isConnected()&&this.socketAdapter.getSocket().onConnOpen()}_wrapHeartbeatCallback(e){return(r,n)=>{r=="sent"&&this._setAuthSafely(),e&&e(r,n)}}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const e=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(e),this.workerRef.onerror=r=>{this.log("worker","worker error",r.message),this._terminateWorker(),this.disconnect()},this.workerRef.onmessage=r=>{r.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&(this.log("worker","terminating worker"),this.workerRef.terminate(),this.workerRef=void 0)}_workerObjectUrl(e){let r;if(e)r=e;else{const n=new Blob([ov],{type:"application/javascript"});r=URL.createObjectURL(n)}return r}_initializeOptions(e){var r,n,s,o,i,a,l,u,d,h,m,p;this.worker=(r=e==null?void 0:e.worker)!==null&&r!==void 0?r:!1,this.accessToken=(n=e==null?void 0:e.accessToken)!==null&&n!==void 0?n:null;const v={};v.timeout=(s=e==null?void 0:e.timeout)!==null&&s!==void 0?s:Sg,v.heartbeatIntervalMs=(o=e==null?void 0:e.heartbeatIntervalMs)!==null&&o!==void 0?o:si.HEARTBEAT_INTERVAL,this._disconnectOnEmptyChannelsAfterMs=(i=e==null?void 0:e.disconnectOnEmptyChannelsAfterMs)!==null&&i!==void 0?i:2*((a=e==null?void 0:e.heartbeatIntervalMs)!==null&&a!==void 0?a:si.HEARTBEAT_INTERVAL),v.transport=(l=e==null?void 0:e.transport)!==null&&l!==void 0?l:bg.getWebSocketConstructor(),v.params=e==null?void 0:e.params,v.logger=e==null?void 0:e.logger,v.heartbeatCallback=this._wrapHeartbeatCallback(e==null?void 0:e.heartbeatCallback),v.sessionStorage=(u=e==null?void 0:e.sessionStorage)!==null&&u!==void 0?u:sv(),v.reconnectAfterMs=(d=e==null?void 0:e.reconnectAfterMs)!==null&&d!==void 0?d:b=>tv[b-1]||rv;let g,y;const x=(h=e==null?void 0:e.vsn)!==null&&h!==void 0?h:Eg;switch(x){case _g:g=(b,w)=>w(JSON.stringify(b)),y=(b,w)=>w(JSON.parse(b));break;case kl:g=this.serializer.encode.bind(this.serializer),y=this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${v.vsn}`)}if(v.vsn=x,v.encode=(m=e==null?void 0:e.encode)!==null&&m!==void 0?m:g,v.decode=(p=e==null?void 0:e.decode)!==null&&p!==void 0?p:y,v.beforeReconnect=this._reconnectAuth.bind(this),(e!=null&&e.logLevel||e!=null&&e.log_level)&&(this.logLevel=e.logLevel||e.log_level,v.params=Object.assign(Object.assign({},v.params),{log_level:this.logLevel})),this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=e==null?void 0:e.workerUrl,v.autoSendHeartbeat=!this.worker}return v}async _reconnectAuth(){await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()}}
14var cr=class extends Error{constructor(t,e){var r;super(t),this.name="IcebergError",this.status=e.status,this.icebergType=e.icebergType,this.icebergCode=e.icebergCode,this.details=e.details,this.isCommitStateUnknown=e.icebergType==="CommitStateUnknownException"||[500,502,504].includes(e.status)&&((r=e.icebergType)==null?void 0:r.includes("CommitState"))===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function av(t,e,r){const n=new URL(e,t);if(r)for(const[s,o]of Object.entries(r))o!==void 0&&n.searchParams.set(s,o);return n.toString()}async function lv(t){return!t||t.type==="none"?{}:t.type==="bearer"?{Authorization:`Bearer ${t.token}`}:t.type==="header"?{[t.name]:t.value}:t.type==="custom"?await t.getHeaders():{}}function cv(t){const e=t.fetchImpl??globalThis.fetch;return{async request({method:r,path:n,query:s,body:o,headers:i}){const a=av(t.baseUrl,n,s),l=await lv(t.auth),u=await e(a,{method:r,headers:{...o?{"Content-Type":"application/json"}:{},...l,...i},body:o?JSON.stringify(o):void 0}),d=await u.text(),h=(u.headers.get("content-type")||"").includes("application/json"),m=h&&d?JSON.parse(d):d;if(!u.ok){const p=h?m:void 0,v=p==null?void 0:p.error;throw new cr((v==null?void 0:v.message)??`Request failed with status ${u.status}`,{status:u.status,icebergType:v==null?void 0:v.type,icebergCode:v==null?void 0:v.code,details:p})}return{status:u.status,headers:u.headers,data:m}}}}function Ir(t){return t.join("�")}var uv=class{constructor(t,e=""){this.client=t,this.prefix=e}async listNamespaces(t){const e=t?{parent:Ir(t.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:e})).data.namespaces.map(n=>({namespace:n}))}async createNamespace(t,e){const r={namespace:t.namespace,properties:e==null?void 0:e.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:r})).data}async dropNamespace(t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${Ir(t.namespace)}`})}async loadNamespaceMetadata(t){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Ir(t.namespace)}`})).data.properties}}async namespaceExists(t){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${Ir(t.namespace)}`}),!0}catch(e){if(e instanceof cr&&e.status===404)return!1;throw e}}async createNamespaceIfNotExists(t,e){try{return await this.createNamespace(t,e)}catch(r){if(r instanceof cr&&r.status===409)return;throw r}}};function St(t){return t.join("�")}var dv=class{constructor(t,e="",r){this.client=t,this.prefix=e,this.accessDelegation=r}async listTables(t){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${St(t.namespace)}/tables`})).data.identifiers}async createTable(t,e){const r={};return this.accessDelegation&&(r["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${St(t.namespace)}/tables`,body:e,headers:r})).data.metadata}async updateTable(t,e){const r=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${St(t.namespace)}/tables/${t.name}`,body:e});return{"metadata-location":r.data["metadata-location"],metadata:r.data.metadata}}async dropTable(t,e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${St(t.namespace)}/tables/${t.name}`,query:{purgeRequested:String((e==null?void 0:e.purge)??!1)}})}async loadTable(t){const e={};return this.accessDelegation&&(e["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${St(t.namespace)}/tables/${t.name}`,headers:e})).data.metadata}async tableExists(t){const e={};this.accessDelegation&&(e["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${St(t.namespace)}/tables/${t.name}`,headers:e}),!0}catch(r){if(r instanceof cr&&r.status===404)return!1;throw r}}async createTableIfNotExists(t,e){try{return await this.createTable(t,e)}catch(r){if(r instanceof cr&&r.status===409)return await this.loadTable({namespace:t.namespace,name:e.name});throw r}}},hv=class{constructor(t){var n;let e="v1";t.catalogName&&(e+=`/${t.catalogName}`);const r=t.baseUrl.endsWith("/")?t.baseUrl:`${t.baseUrl}/`;this.client=cv({baseUrl:r,auth:t.auth,fetchImpl:t.fetch}),this.accessDelegation=(n=t.accessDelegation)==null?void 0:n.join(","),this.namespaceOps=new uv(this.client,e),this.tableOps=new dv(this.client,e,this.accessDelegation)}async listNamespaces(t){return this.namespaceOps.listNamespaces(t)}async createNamespace(t,e){return this.namespaceOps.createNamespace(t,e)}async dropNamespace(t){await this.namespaceOps.dropNamespace(t)}async loadNamespaceMetadata(t){return this.namespaceOps.loadNamespaceMetadata(t)}async listTables(t){return this.tableOps.listTables(t)}
14async createTable(t,e){return this.tableOps.createTable(t,e)}async updateTable(t,e){return this.tableOps.updateTable(t,e)}async dropTable(t,e){await this.tableOps.dropTable(t,e)}async loadTable(t){return this.tableOps.loadTable(t)}async namespaceExists(t){return this.namespaceOps.namespaceExists(t)}async tableExists(t){return this.tableOps.tableExists(t)}async createNamespaceIfNotExists(t,e){return this.namespaceOps.createNamespaceIfNotExists(t,e)}async createTableIfNotExists(t,e){return this.tableOps.createTableIfNotExists(t,e)}};function ur(t){"@babel/helpers - typeof";return ur=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ur(t)}function fv(t,e){if(ur(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(ur(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function pv(t){var e=fv(t,"string");return ur(e)=="symbol"?e:e+""}function mv(t,e,r){return(e=pv(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function oi(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function I(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?oi(Object(r),!0).forEach(function(n){mv(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):oi(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}var kn=class extends Error{constructor(t,e="storage",r,n){super(t),this.__isStorageError=!0,this.namespace=e,this.name=e==="vectors"?"StorageVectorsError":"StorageError",this.status=r,this.statusCode=n}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}};function Tn(t){return typeof t=="object"&&t!==null&&"__isStorageError"in t}var Es=class extends kn{constructor(t,e,r,n="storage"){super(t,n,e,r),this.name=n==="vectors"?"StorageVectorsApiError":"StorageApiError",this.status=e,this.statusCode=r}toJSON(){return I({},super.toJSON())}},jl=class extends kn{constructor(t,e,r="storage"){super(t,r),this.name=r==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=e}};function un(t,e,r){const n=I({},t),s=e.toLowerCase();for(const o of Object.keys(n))o.toLowerCase()===s&&delete n[o];return n[s]=r,n}function gv(t){const e={};for(const[r,n]of Object.entries(t))e[r.toLowerCase()]=n;return e}const vv=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),yv=t=>{if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},Ss=t=>{if(Array.isArray(t))return t.map(r=>Ss(r));if(typeof t=="function"||t!==Object(t))return t;const e={};return Object.entries(t).forEach(([r,n])=>{const s=r.replace(/([-_][a-z])/gi,o=>o.toUpperCase().replace(/[-_]/g,""));e[s]=Ss(n)}),e},bv=t=>!t||typeof t!="string"||t.length===0||t.length>100||t.trim()!==t||t.includes("/")||t.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(t),ii=t=>{if(typeof t=="object"&&t!==null){const e=t;if(typeof e.msg=="string")return e.msg;if(typeof e.message=="string")return e.message;if(typeof e.error_description=="string")return e.error_description;if(typeof e.error=="string")return e.error;if(typeof e.error=="object"&&e.error!==null){const r=e.error;if(typeof r.message=="string")return r.message}}return JSON.stringify(t)},wv=async(t,e,r,n)=>{if(t!==null&&typeof t=="object"&&"json"in t&&typeof t.json=="function"){const s=t;let o=parseInt(String(s.status),10);Number.isFinite(o)||(o=500),s.json().then(i=>{const a=(i==null?void 0:i.statusCode)||(i==null?void 0:i.code)||o+"";e(new Es(ii(i),o,a,n))}).catch(()=>{const i=o+"";e(new Es(s.statusText||`HTTP ${o} error`,o,i,n))})}else e(new jl(ii(t),t,n))},xv=(t,e,r,n)=>{const s={method:t,headers:(e==null?void 0:e.headers)||{}};if(t==="GET"||t==="HEAD"||!n)return I(I({},s),r);if(yv(n)){var o;const i=(e==null?void 0:e.headers)||{};let a;for(const[l,u]of Object.entries(i))l.toLowerCase()==="content-type"&&(a=u);s.headers=un(i,"Content-Type",(o=a)!==null&&o!==void 0?o:"application/json"),s.body=JSON.stringify(n)}else s.body=n;return e!=null&&e.duplex&&(s.duplex=e.duplex),I(I({},s),r)};async function Gt(t,e,r,n,s,o,i){return new Promise((a,l)=>{t(r,xv(e,n,s,o)).then(u=>{if(!u.ok)throw u;if(n!=null&&n.noResolveJson)return u;if(i==="vectors"){const d=u.headers.get("content-type");if(u.headers.get("content-length")==="0"||u.status===204)return{};if(!d||!d.includes("application/json"))return{}}return u.json()}).then(u=>a(u)).catch(u=>wv(u,l,n,i))})}function Pl(t="storage"){return{get:async(e,r,n,s)=>Gt(e,"GET",r,n,s,void 0,t),post:async(e,r,n,s,o)=>Gt(e,"POST",r,s,o,n,t),put:async(e,r,n,s,o)=>Gt(e,"PUT",r,s,o,n,t),head:async(e,r,n,s)=>Gt(e,"HEAD",r,I(I({},n),{},{noResolveJson:!0}),s,void 0,t),remove:async(e,r,n,s,o)=>Gt(e,"DELETE",r,s,o,n,t)}}const _v=Pl("storage"),{get:dr,post:Se,put:ks,head:Ev,remove:hr}=_v,fe=Pl("vectors");var qt=class{constructor(t,e={},r,n="storage"){this.shouldThrowOnError=!1,this.url=t,this.headers=gv(e),this.fetch=vv(r),this.namespace=n}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(t,e){return this.headers=un(this.headers,t,e),this}async handleOperation(t){var e=this;try{return{data:await t(),error:null}}catch(r){if(e.shouldThrowOnError)throw r;if(Tn(r))return{data:null,error:r};throw r}}};let Ol;Ol=Symbol.toStringTag;var Sv=class{constructor(t,e){this.downloadFn=t,this.shouldThrowOnError=e,this[Ol]="StreamDownloadBuilder",this.promise=null}
14then(t,e){return this.getPromise().then(t,e)}catch(t){return this.getPromise().catch(t)}finally(t){return this.getPromise().finally(t)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var t=this;try{return{data:(await t.downloadFn()).body,error:null}}catch(e){if(t.shouldThrowOnError)throw e;if(Tn(e))return{data:null,error:e};throw e}}};let Nl;Nl=Symbol.toStringTag;var kv=class{constructor(t,e){this.downloadFn=t,this.shouldThrowOnError=e,this[Nl]="BlobDownloadBuilder",this.promise=null}asStream(){return new Sv(this.downloadFn,this.shouldThrowOnError)}then(t,e){return this.getPromise().then(t,e)}catch(t){return this.getPromise().catch(t)}finally(t){return this.getPromise().finally(t)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var t=this;try{return{data:await(await t.downloadFn()).blob(),error:null}}catch(e){if(t.shouldThrowOnError)throw e;if(Tn(e))return{data:null,error:e};throw e}}};const Vn={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},ai={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var Tv=class extends qt{constructor(t,e={},r,n){super(t,e,n,"storage"),this.bucketId=r}async uploadOrUpdate(t,e,r,n){var s=this;return s.handleOperation(async()=>{let o;const i=I(I({},ai),n);let a=I(I({},s.headers),t==="POST"&&{"x-upsert":String(i.upsert)});const l=i.metadata;if(typeof Blob<"u"&&r instanceof Blob?(o=new FormData,o.append("cacheControl",i.cacheControl),l&&o.append("metadata",s.encodeMetadata(l)),o.append("",r)):typeof FormData<"u"&&r instanceof FormData?(o=r,o.has("cacheControl")||o.append("cacheControl",i.cacheControl),l&&!o.has("metadata")&&o.append("metadata",s.encodeMetadata(l))):(o=r,a["cache-control"]=`max-age=${i.cacheControl}`,a["content-type"]=i.contentType,l&&(a["x-metadata"]=s.toBase64(s.encodeMetadata(l))),(typeof ReadableStream<"u"&&o instanceof ReadableStream||o&&typeof o=="object"&&"pipe"in o&&typeof o.pipe=="function")&&!i.duplex&&(i.duplex="half")),n!=null&&n.headers)for(const[m,p]of Object.entries(n.headers))a=un(a,m,p);const u=s._removeEmptyFolders(e),d=s._getFinalPath(u),h=await(t=="PUT"?ks:Se)(s.fetch,`${s.url}/object/${d}`,o,I({headers:a},i!=null&&i.duplex?{duplex:i.duplex}:{}));return{path:u,id:h.Id,fullPath:h.Key}})}async upload(t,e,r){return this.uploadOrUpdate("POST",t,e,r)}async uploadToSignedUrl(t,e,r,n){var s=this;const o=s._removeEmptyFolders(t),i=s._getFinalPath(o),a=new URL(s.url+`/object/upload/sign/${i}`);return a.searchParams.set("token",e),s.handleOperation(async()=>{let l;const u=I(I({},ai),n);let d=I(I({},s.headers),{"x-upsert":String(u.upsert)});const h=u.metadata;if(typeof Blob<"u"&&r instanceof Blob?(l=new FormData,l.append("cacheControl",u.cacheControl),h&&l.append("metadata",s.encodeMetadata(h)),l.append("",r)):typeof FormData<"u"&&r instanceof FormData?(l=r,l.has("cacheControl")||l.append("cacheControl",u.cacheControl),h&&!l.has("metadata")&&l.append("metadata",s.encodeMetadata(h))):(l=r,d["cache-control"]=`max-age=${u.cacheControl}`,d["content-type"]=u.contentType,h&&(d["x-metadata"]=s.toBase64(s.encodeMetadata(h))),(typeof ReadableStream<"u"&&l instanceof ReadableStream||l&&typeof l=="object"&&"pipe"in l&&typeof l.pipe=="function")&&!u.duplex&&(u.duplex="half")),n!=null&&n.headers)for(const[m,p]of Object.entries(n.headers))d=un(d,m,p);return{path:o,fullPath:(await ks(s.fetch,a.toString(),l,I({headers:d},u!=null&&u.duplex?{duplex:u.duplex}:{}))).Key}})}async createSignedUploadUrl(t,e){var r=this;return r.handleOperation(async()=>{let n=r._getFinalPath(t);const s=I({},r.headers);e!=null&&e.upsert&&(s["x-upsert"]="true");const o=await Se(r.fetch,`${r.url}/object/upload/sign/${n}`,{},{headers:s}),i=new URL(r.url+o.url),a=i.searchParams.get("token");if(!a)throw new kn("No token returned by API");return{signedUrl:i.toString(),path:t,token:a}})}async update(t,e,r){return this.uploadOrUpdate("PUT",t,e,r)}async move(t,e,r){var n=this;return n.handleOperation(async()=>await Se(n.fetch,`${n.url}/object/move`,{bucketId:n.bucketId,sourceKey:t,destinationKey:e,destinationBucket:r==null?void 0:r.destinationBucket},{headers:n.headers}))}async copy(t,e,r){var n=this;return n.handleOperation(async()=>({path:(await Se(n.fetch,`${n.url}/object/copy`,{bucketId:n.bucketId,sourceKey:t,destinationKey:e,destinationBucket:r==null?void 0:r.destinationBucket},{headers:n.headers})).Key}))}async createSignedUrl(t,e,r){var n=this;return n.handleOperation(async()=>{let s=n._getFinalPath(t);const o=typeof(r==null?void 0:r.transform)=="object"&&r.transform!==null&&Object.keys(r.transform).length>0;let i=await Se(n.fetch,`${n.url}/object/sign/${s}
14`,I({expiresIn:e},o?{transform:r.transform}:{}),{headers:n.headers});const a=new URLSearchParams;r!=null&&r.download&&a.set("download",r.download===!0?"":r.download),(r==null?void 0:r.cacheNonce)!=null&&a.set("cacheNonce",String(r.cacheNonce));const l=a.toString();return{signedUrl:encodeURI(`${n.url}${i.signedURL}${l?`&${l}`:""}`)}})}async createSignedUrls(t,e,r){var n=this;return n.handleOperation(async()=>{const s=await Se(n.fetch,`${n.url}/object/sign/${n.bucketId}`,{expiresIn:e,paths:t},{headers:n.headers}),o=new URLSearchParams;r!=null&&r.download&&o.set("download",r.download===!0?"":r.download),(r==null?void 0:r.cacheNonce)!=null&&o.set("cacheNonce",String(r.cacheNonce));const i=o.toString();return s.map(a=>I(I({},a),{},{signedUrl:a.signedURL?encodeURI(`${n.url}${a.signedURL}${i?`&${i}`:""}`):null}))})}download(t,e,r){const n=typeof(e==null?void 0:e.transform)=="object"&&e.transform!==null&&Object.keys(e.transform).length>0?"render/image/authenticated":"object",s=new URLSearchParams;e!=null&&e.transform&&this.applyTransformOptsToQuery(s,e.transform),(e==null?void 0:e.cacheNonce)!=null&&s.set("cacheNonce",String(e.cacheNonce));const o=s.toString(),i=this._getFinalPath(t),a=()=>dr(this.fetch,`${this.url}/${n}/${i}${o?`?${o}`:""}`,{headers:this.headers,noResolveJson:!0},r);return new kv(a,this.shouldThrowOnError)}async info(t){var e=this;const r=e._getFinalPath(t);return e.handleOperation(async()=>Ss(await dr(e.fetch,`${e.url}/object/info/${r}`,{headers:e.headers})))}async exists(t){var e=this;const r=e._getFinalPath(t);try{return await Ev(e.fetch,`${e.url}/object/${r}`,{headers:e.headers}),{data:!0,error:null}}catch(s){if(e.shouldThrowOnError)throw s;if(Tn(s)){var n;const o=s instanceof Es?s.status:s instanceof jl?(n=s.originalError)===null||n===void 0?void 0:n.status:void 0;if(o!==void 0&&[400,404].includes(o))return{data:!1,error:s}}throw s}}getPublicUrl(t,e){const r=this._getFinalPath(t),n=new URLSearchParams;e!=null&&e.download&&n.set("download",e.download===!0?"":e.download),e!=null&&e.transform&&this.applyTransformOptsToQuery(n,e.transform),(e==null?void 0:e.cacheNonce)!=null&&n.set("cacheNonce",String(e.cacheNonce));const s=n.toString(),o=typeof(e==null?void 0:e.transform)=="object"&&e.transform!==null&&Object.keys(e.transform).length>0?"render/image":"object";return{data:{publicUrl:encodeURI(`${this.url}/${o}/public/${r}`)+(s?`?${s}`:"")}}}async remove(t){var e=this;return e.handleOperation(async()=>await hr(e.fetch,`${e.url}/object/${e.bucketId}`,{prefixes:t},{headers:e.headers}))}async purgeCache(t,e,r){var n=this;return n.handleOperation(async()=>{const s=n._getFinalPath(t),o=new URLSearchParams;e!=null&&e.transformations&&o.set("transformations","true");const i=o.toString();return await hr(n.fetch,`${n.url}/cdn/${s}${i?`?${i}`:""}`,{},{headers:n.headers},r)})}async list(t,e,r){var n=this;return n.handleOperation(async()=>{const s=e!=null&&e.sortBy?I(I({},Vn.sortBy),e.sortBy):Vn.sortBy,o=I(I(I({},Vn),e),{},{sortBy:s,prefix:t||""});return await Se(n.fetch,`${n.url}/object/list/${n.bucketId}`,o,{headers:n.headers},r)})}async listV2(t,e){var r=this;return r.handleOperation(async()=>{const n=I({},t);return await Se(r.fetch,`${r.url}/object/list-v2/${r.bucketId}`,n,{headers:r.headers},e)})}encodeMetadata(t){return JSON.stringify(t)}toBase64(t){return typeof Buffer<"u"?Buffer.from(t).toString("base64"):btoa(t)}_getFinalPath(t){return`${this.bucketId}/${t.replace(/^\/+/,"")}`}_removeEmptyFolders(t){return t.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}applyTransformOptsToQuery(t,e){return e.width&&t.set("width",e.width.toString()),e.height&&t.set("height",e.height.toString()),e.resize&&t.set("resize",e.resize),e.format&&t.set("format",e.format),e.quality&&t.set("quality",e.quality.toString()),t}};const Rv="2.110.0",br={"X-Client-Info":`storage-js/${Rv}`};var Av=class extends qt{constructor(t,e={},r,n){const s=new URL(t);n!=null&&n.useNewHostname&&/supabase\.(co|in|red)$/.test(s.hostname)&&!s.hostname.includes("storage.supabase.")&&(s.hostname=s.hostname.replace("supabase.","storage.supabase."));const o=s.href.replace(/\/$/,""),i=I(I({},br),e);super(o,i,r,"storage")}async listBuckets(t){var e=this;return e.handleOperation(async()=>{const r=e.listBucketOptionsToQueryString(t);return await dr(e.fetch,`${e.url}/bucket${r}`,{headers:e.headers})})}async getBucket(t){var e=this;return e.handleOperation(async()=>await dr(e.fetch,`${e.url}/bucket/${t}`,{headers:e.headers}))}async createBucket(t,e={public:!1}){var r=this;return r.handleOperation(async()=>await Se(r.fetch,`${r.url}/bucket`,{id:t,name:t,type:e.type,public:e.public,file_size_limit:e.fileSizeLimit,allowed_mime_types:e.allowedMimeTypes},{headers:r.headers}))}async updateBucket(t,e){var r=this;return r.handleOperation(async()=>await ks(r.fetch,`${r.url}/bucket/${t}`,{id:t,name:t,public:e.public,file_size_limit:e.fileSizeLimit,allowed_mime_types:e.allowedMimeTypes},{headers:r.headers}))}async emptyBucket(t){var e=this;return e.handleOperation(async()=>await Se(e.fetch,`${e.url}/bucket/${t}/empty`,{},{headers:e.headers}))}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await hr(e.fetch,`${e.url}/bucket/${t}`,{},{headers:e.headers}))}async purgeBucketCache(t,e,r){var n=this;return n.handleOperation(async()=>{const s=new URLSearchParams;e!=null&&e.transformations&&s.set("transformations","true");const o=s.toString();return await hr(n.fetch,`${n.url}/cdn/${t}${o?`?${o}`:""}`,{},{headers:n.headers},r)})}listBucketOptionsToQueryString(t){const e={};return t&&("limit"in t&&(e.limit=String(t.limit)),"offset"in t&&(e.offset=String(t.offset)),t.search&&(e.search=t.search),t.sortColumn&&(e.sortColumn=t.sortColumn),t.sortOrder&&(e.sortOrder=t.sortOrder)),Object.keys(e).length>0?"?"+new URLSearchParams(e).toString():""}},Cv=class extends qt{constructor(t,e={},r){const n=t.replace(/\/$/,""),s=I(I({},br),e);super(n,s,r,"storage")}async createBucket(t){var e=this;return e.handleOperation(async()=>await Se(e.fetch,`${e.url}/bucket`,{name:t},{headers:e.headers}))}async listBuckets(t){var e=this;return e.handleOperation(async()=>
14{const r=new URLSearchParams;(t==null?void 0:t.limit)!==void 0&&r.set("limit",t.limit.toString()),(t==null?void 0:t.offset)!==void 0&&r.set("offset",t.offset.toString()),t!=null&&t.sortColumn&&r.set("sortColumn",t.sortColumn),t!=null&&t.sortOrder&&r.set("sortOrder",t.sortOrder),t!=null&&t.search&&r.set("search",t.search);const n=r.toString(),s=n?`${e.url}/bucket?${n}`:`${e.url}/bucket`;return await dr(e.fetch,s,{headers:e.headers})})}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await hr(e.fetch,`${e.url}/bucket/${t}`,{},{headers:e.headers}))}from(t){var e=this;if(!bv(t))throw new kn("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");const r=new hv({baseUrl:this.url,catalogName:t,auth:{type:"custom",getHeaders:async()=>e.headers},fetch:this.fetch}),n=this.shouldThrowOnError;return new Proxy(r,{get(s,o){const i=s[o];return typeof i!="function"?i:async(...a)=>{try{return{data:await i.apply(s,a),error:null}}catch(l){if(n)throw l;return{data:null,error:l}}}}})}},jv=class extends qt{constructor(t,e={},r){const n=t.replace(/\/$/,""),s=I(I({},br),{},{"Content-Type":"application/json"},e);super(n,s,r,"vectors")}async createIndex(t){var e=this;return e.handleOperation(async()=>await fe.post(e.fetch,`${e.url}/CreateIndex`,t,{headers:e.headers})||{})}async getIndex(t,e){var r=this;return r.handleOperation(async()=>await fe.post(r.fetch,`${r.url}/GetIndex`,{vectorBucketName:t,indexName:e},{headers:r.headers}))}async listIndexes(t){var e=this;return e.handleOperation(async()=>await fe.post(e.fetch,`${e.url}/ListIndexes`,t,{headers:e.headers}))}async deleteIndex(t,e){var r=this;return r.handleOperation(async()=>await fe.post(r.fetch,`${r.url}/DeleteIndex`,{vectorBucketName:t,indexName:e},{headers:r.headers})||{})}},Pv=class extends qt{constructor(t,e={},r){const n=t.replace(/\/$/,""),s=I(I({},br),{},{"Content-Type":"application/json"},e);super(n,s,r,"vectors")}async putVectors(t){var e=this;if(t.vectors.length<1||t.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return e.handleOperation(async()=>await fe.post(e.fetch,`${e.url}/PutVectors`,t,{headers:e.headers})||{})}async getVectors(t){var e=this;return e.handleOperation(async()=>await fe.post(e.fetch,`${e.url}/GetVectors`,t,{headers:e.headers}))}async listVectors(t){var e=this;if(t.segmentCount!==void 0){if(t.segmentCount<1||t.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");if(t.segmentIndex!==void 0&&(t.segmentIndex<0||t.segmentIndex>=t.segmentCount))throw new Error(`segmentIndex must be between 0 and ${t.segmentCount-1}`)}return e.handleOperation(async()=>await fe.post(e.fetch,`${e.url}/ListVectors`,t,{headers:e.headers}))}async queryVectors(t){var e=this;return e.handleOperation(async()=>await fe.post(e.fetch,`${e.url}/QueryVectors`,t,{headers:e.headers}))}async deleteVectors(t){var e=this;if(t.keys.length<1||t.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return e.handleOperation(async()=>await fe.post(e.fetch,`${e.url}/DeleteVectors`,t,{headers:e.headers})||{})}},Ov=class extends qt{constructor(t,e={},r){const n=t.replace(/\/$/,""),s=I(I({},br),{},{"Content-Type":"application/json"},e);super(n,s,r,"vectors")}async createBucket(t){var e=this;return e.handleOperation(async()=>await fe.post(e.fetch,`${e.url}/CreateVectorBucket`,{vectorBucketName:t},{headers:e.headers})||{})}async getBucket(t){var e=this;return e.handleOperation(async()=>await fe.post(e.fetch,`${e.url}/GetVectorBucket`,{vectorBucketName:t},{headers:e.headers}))}async listBuckets(t={}){var e=this;return e.handleOperation(async()=>await fe.post(e.fetch,`${e.url}/ListVectorBuckets`,t,{headers:e.headers}))}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await fe.post(e.fetch,`${e.url}/DeleteVectorBucket`,{vectorBucketName:t},{headers:e.headers})||{})}},Nv=class extends Ov{constructor(t,e={}){super(t,e.headers||{},e.fetch)}from(t){return new Iv(this.url,this.headers,t,this.fetch)}async createBucket(t){var e=()=>super.createBucket,r=this;return e().call(r,t)}async getBucket(t){var e=()=>super.getBucket,r=this;return e().call(r,t)}async listBuckets(t={}){var e=()=>super.listBuckets,r=this;return e().call(r,t)}async deleteBucket(t){var e=()=>super.deleteBucket,r=this;return e().call(r,t)}},Iv=class extends jv{constructor(t,e,r,n){super(t,e,n),this.vectorBucketName=r}async createIndex(t){var e=()=>super.createIndex,r=this;return e().call(r,I(I({},t),{},{vectorBucketName:r.vectorBucketName}))}async listIndexes(t={}){var e=()=>super.listIndexes,r=this;return e().call(r,I(I({},t),{},{vectorBucketName:r.vectorBucketName}))}async getIndex(t){var e=()=>super.getIndex,r=this;return e().call(r,r.vectorBucketName,t)}async deleteIndex(t){var e=()=>super.deleteIndex,r=this;return e().call(r,r.vectorBucketName,t)}index(t){return new Lv(this.url,this.headers,this.vectorBucketName,t,this.fetch)}},Lv=class extends Pv{constructor(t,e,r,n,s){super(t,e,s),this.vectorBucketName=r,this.indexName=n}async putVectors(t){var e=()=>super.putVectors,r=this;return e().call(r,I(I({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async getVectors(t){var e=()=>super.getVectors,r=this;return e().call(r,I(I({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async listVectors(t={}){var e=()=>super.listVectors,r=this;return e().call(r,I(I({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async queryVectors(t){var e=()=>super.queryVectors,r=this;return e().call(r,I(I({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async deleteVectors(t){var e=()=>super.deleteVectors,r=this;return e().call(r,I(I({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}},$v=class extends Av{constructor(t,e={},r,n){super(t,e,r,n)}from(t){return new Tv(this.url,this.headers,t,this.fetch)}get vectors(){return new Nv(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new Cv(this.url+"/iceberg",this.headers,this.fetch)}};const Il="2.110.0",He=30*1e3,Xt=3,Wn=Xt*He,Dv=2*He,Mv="http://localhost:9999",Uv="supabase.auth.token",Bv={"X-Client-Info":`gotrue-js/${Il}`},Ts="X-Supabase-Api-Version",Ll={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},Fv=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,Hv=10*60*1e3;
14class fr extends Error{constructor(e,r,n){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=r,this.code=n}toJSON(){return{name:this.name,message:this.message,status:this.status,code:this.code}}}function A(t){return typeof t=="object"&&t!==null&&"__isAuthError"in t}class Vv extends fr{constructor(e,r,n){super(e,r,n),this.name="AuthApiError",this.status=r,this.code=n}}function Wv(t){return A(t)&&t.name==="AuthApiError"}class ke extends fr{constructor(e,r){super(e),this.name="AuthUnknownError",this.originalError=r}}class Me extends fr{constructor(e,r,n,s){super(e,n,s),this.name=r,this.status=n}}class se extends Me{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function Lr(t){return A(t)&&t.name==="AuthSessionMissingError"}class kt extends Me{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class $r extends Me{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}}class Dr extends Me{constructor(e,r=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=r}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}function qv(t){return A(t)&&t.name==="AuthImplicitGrantRedirectError"}class li extends Me{constructor(e,r=null){super(e,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=r}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}class zv extends Me{constructor(){super("PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.","AuthPKCECodeVerifierMissingError",400,"pkce_code_verifier_not_found")}}class Rs extends Me{constructor(e,r){super(e,"AuthRetryableFetchError",r,void 0)}}function ci(t){return A(t)&&t.name==="AuthRetryableFetchError"}class ui extends Me{constructor(e="Refresh result discarded: session state changed mid-flight (e.g., concurrent signOut)"){super(e,"AuthRefreshDiscardedError",409,void 0)}}function Kv(t){return A(t)&&t.name==="AuthRefreshDiscardedError"}class di extends Me{constructor(e,r,n){super(e,"AuthWeakPasswordError",r,"weak_password"),this.reasons=n}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reasons:this.reasons})}}class dn extends Me{constructor(e){super(e,"AuthInvalidJwtError",400,"invalid_jwt")}}const hn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),hi=` 	
15\r=`.split(""),Jv=(()=>{const t=new Array(128);for(let e=0;e<t.length;e+=1)t[e]=-1;for(let e=0;e<hi.length;e+=1)t[hi[e].charCodeAt(0)]=-2;for(let e=0;e<hn.length;e+=1)t[hn[e].charCodeAt(0)]=e;return t})();function fi(t,e,r){if(t!==null)for(e.queue=e.queue<<8|t,e.queuedBits+=8;e.queuedBits>=6;){const n=e.queue>>e.queuedBits-6&63;r(hn[n]),e.queuedBits-=6}else if(e.queuedBits>0)for(e.queue=e.queue<<6-e.queuedBits,e.queuedBits=6;e.queuedBits>=6;){const n=e.queue>>e.queuedBits-6&63;r(hn[n]),e.queuedBits-=6}}function $l(t,e,r){const n=Jv[t];if(n>-1)for(e.queue=e.queue<<6|n,e.queuedBits+=6;e.queuedBits>=8;)r(e.queue>>e.queuedBits-8&255),e.queuedBits-=8;else{if(n===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(t)}"`)}}function pi(t){const e=[],r=i=>{e.push(String.fromCodePoint(i))},n={utf8seq:0,codepoint:0},s={queue:0,queuedBits:0},o=i=>{Xv(i,n,r)};for(let i=0;i<t.length;i+=1)$l(t.charCodeAt(i),s,o);return e.join("")}function Gv(t,e){if(t<=127){e(t);return}else if(t<=2047){e(192|t>>6),e(128|t&63);return}else if(t<=65535){e(224|t>>12),e(128|t>>6&63),e(128|t&63);return}else if(t<=1114111){e(240|t>>18),e(128|t>>12&63),e(128|t>>6&63),e(128|t&63);return}throw new Error(`Unrecognized Unicode codepoint: ${t.toString(16)}`)}function Yv(t,e){for(let r=0;r<t.length;r+=1){let n=t.charCodeAt(r);if(n>55295&&n<=56319){const s=(n-55296)*1024&65535;n=(t.charCodeAt(r+1)-56320&65535|s)+65536,r+=1}Gv(n,e)}}function Xv(t,e,r){if(e.utf8seq===0){if(t<=127){r(t);return}for(let n=1;n<6;n+=1)if(!(t>>7-n&1)){e.utf8seq=n;break}if(e.utf8seq===2)e.codepoint=t&31;else if(e.utf8seq===3)e.codepoint=t&15;else if(e.utf8seq===4)e.codepoint=t&7;else throw new Error("Invalid UTF-8 sequence");e.utf8seq-=1}else if(e.utf8seq>0){if(t<=127)throw new Error("Invalid UTF-8 sequence");e.codepoint=e.codepoint<<6|t&63,e.utf8seq-=1,e.utf8seq===0&&r(e.codepoint)}}function Lt(t){const e=[],r={queue:0,queuedBits:0},n=s=>{e.push(s)};for(let s=0;s<t.length;
15s+=1)$l(t.charCodeAt(s),r,n);return new Uint8Array(e)}function Qv(t){const e=[];return Yv(t,r=>e.push(r)),new Uint8Array(e)}function ht(t){const e=[],r={queue:0,queuedBits:0},n=s=>{e.push(s)};return t.forEach(s=>fi(s,r,n)),fi(null,r,n),e.join("")}function Zv(t){return Math.round(Date.now()/1e3)+t}function ey(){return Symbol("auth-callback")}const ie=()=>typeof window<"u"&&typeof document<"u",ct={tested:!1,writable:!1},Dl=()=>{if(!ie())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(ct.tested)return ct.writable;const t=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(t,t),globalThis.localStorage.removeItem(t),ct.tested=!0,ct.writable=!0}catch{ct.tested=!0,ct.writable=!1}return ct.writable};function ty(t){const e={},r=new URL(t);if(r.hash&&r.hash[0]==="#")try{new URLSearchParams(r.hash.substring(1)).forEach((s,o)=>{e[o]=s})}catch{}return r.searchParams.forEach((n,s)=>{e[s]=n}),e}const Ml=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),ry=t=>typeof t=="object"&&t!==null&&"status"in t&&"ok"in t&&"json"in t&&typeof t.json=="function",Ot=async(t,e,r)=>{await t.setItem(e,JSON.stringify(r))},_e=async(t,e)=>{const r=await t.getItem(e);if(!r)return null;try{return JSON.parse(r)}catch{return null}},re=async(t,e)=>{await t.removeItem(e)};class Rn{constructor(){this.promise=new Rn.promiseConstructor((e,r)=>{this.resolve=e,this.reject=r})}}Rn.promiseConstructor=Promise;function Mr(t){const e=t.split(".");if(e.length!==3)throw new dn("Invalid JWT structure");for(let n=0;n<e.length;n++)if(!Fv.test(e[n]))throw new dn("JWT not in base64url format");return{header:JSON.parse(pi(e[0])),payload:JSON.parse(pi(e[1])),signature:Lt(e[2]),raw:{header:e[0],payload:e[1]}}}async function ny(t){return await new Promise(e=>{setTimeout(()=>e(null),t)})}function sy(t,e){return new Promise((n,s)=>{(async()=>{for(let o=0;o<1/0;o++)try{const i=await t(o);if(!e(o,null,i)){n(i);return}}catch(i){if(!e(o,i)){s(i);return}}})()})}function oy(t){return("0"+t.toString(16)).substr(-2)}function iy(){const e=new Uint32Array(56);if(typeof crypto>"u"){const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",n=r.length;let s="";for(let o=0;o<56;o++)s+=r.charAt(Math.floor(Math.random()*n));return s}return crypto.getRandomValues(e),Array.from(e,oy).join("")}async function ay(t){const r=new TextEncoder().encode(t),n=await crypto.subtle.digest("SHA-256",r),s=new Uint8Array(n);return Array.from(s).map(o=>String.fromCharCode(o)).join("")}async function ly(t){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),t;const r=await ay(t);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function ut(t,e,r=!1){const n=iy();let s=n;r&&(s+="/recovery"),await Ot(t,`${e}-code-verifier`,s);const o=await ly(n);return[o,n===o?"plain":"s256"]}const cy=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function uy(t){const e=t.headers.get(Ts);if(!e||!e.match(cy))return null;try{return new Date(`${e}T00:00:00.0Z`)}catch{return null}}function dy(t){if(!t)throw new Error("Missing exp claim");const e=Math.floor(Date.now()/1e3);if(t<=e)throw new Error("JWT has expired")}function hy(t){switch(t){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw new Error("Invalid alg claim")}}const fy=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function Ue(t){if(!fy.test(t))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function Ee(t){if(!t.passkey)throw new Error("@supabase/auth-js: the passkey API is experimental and disabled by default. Enable it by passing `auth: { experimental: { passkey: true } }` to createClient (or to the GoTrueClient constructor).")}function qn(){const t={};return new Proxy(t,{get:(e,r)=>{if(r==="__isUserNotAvailableProxy")return!0;if(typeof r=="symbol"){const n=r.toString();if(n==="Symbol(Symbol.toPrimitive)"||n==="Symbol(Symbol.toStringTag)"||n==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${r}" property of the session object is not supported. Please use getUser() instead.`)},set:(e,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(e,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function py(t,e){return new Proxy(t,{get:(r,n,s)=>{if(n==="__isInsecureUserWarningProxy")return!0;
15if(typeof n=="symbol"){const o=n.toString();if(o==="Symbol(Symbol.toPrimitive)"||o==="Symbol(Symbol.toStringTag)"||o==="Symbol(util.inspect.custom)"||o==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(r,n,s)}return!e.value&&typeof n=="string"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),e.value=!0),Reflect.get(r,n,s)}})}function mi(t){return JSON.parse(JSON.stringify(t))}const dt=t=>{if(typeof t=="object"&&t!==null){const e=t;if(typeof e.msg=="string")return e.msg;if(typeof e.message=="string")return e.message;if(typeof e.error_description=="string")return e.error_description;if(typeof e.error=="string")return e.error}return JSON.stringify(t)},my=[500,501,502,503,504,520,521,522,523,524,525,526,527,528,529,530];async function gi(t){var e;if(!ry(t))throw new Rs(dt(t),0);if(my.includes(t.status))throw new Rs(dt(t),t.status);let r;try{r=await t.json()}catch(o){throw new ke(dt(o),o)}let n;const s=uy(t);if(s&&s.getTime()>=Ll["2024-01-01"].timestamp&&typeof r=="object"&&r&&typeof r.code=="string"?n=r.code:typeof r=="object"&&r&&typeof r.error_code=="string"&&(n=r.error_code),n){if(n==="weak_password")throw new di(dt(r),t.status,((e=r.weak_password)===null||e===void 0?void 0:e.reasons)||[]);if(n==="session_not_found")throw new se}else if(typeof r=="object"&&r&&typeof r.weak_password=="object"&&r.weak_password&&Array.isArray(r.weak_password.reasons)&&r.weak_password.reasons.length&&r.weak_password.reasons.reduce((o,i)=>o&&typeof i=="string",!0))throw new di(dt(r),t.status,r.weak_password.reasons);throw new Vv(dt(r),t.status||500,n)}const gy=(t,e,r,n)=>{const s={method:t,headers:(e==null?void 0:e.headers)||{}};return t==="GET"?s:(s.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},e==null?void 0:e.headers),s.body=JSON.stringify(n),Object.assign(Object.assign({},s),r))};async function O(t,e,r,n){var s;const o=Object.assign({},n==null?void 0:n.headers);o[Ts]||(o[Ts]=Ll["2024-01-01"].name),n!=null&&n.jwt&&(o.Authorization=`Bearer ${n.jwt}`);const i=(s=n==null?void 0:n.query)!==null&&s!==void 0?s:{};n!=null&&n.redirectTo&&(i.redirect_to=n.redirectTo);const a=Object.keys(i).length?"?"+new URLSearchParams(i).toString():"",l=await vy(t,e,r+a,{headers:o,noResolveJson:n==null?void 0:n.noResolveJson},{},n==null?void 0:n.body);return n!=null&&n.xform?n==null?void 0:n.xform(l):{data:Object.assign({},l),error:null}}async function vy(t,e,r,n,s,o){const i=gy(e,n,s,o);let a;try{a=await t(r,Object.assign({},i))}catch(l){throw console.error(l),new Rs(dt(l),0)}if(a.ok||await gi(a),n!=null&&n.noResolveJson)return a;try{return await a.json()}catch(l){await gi(l)}}function ve(t){var e;let r=null;wy(t)&&(r=Object.assign({},t),t.expires_at||(r.expires_at=Zv(t.expires_in)));const n=(e=t.user)!==null&&e!==void 0?e:typeof(t==null?void 0:t.id)=="string"?t:null;return{data:{session:r,user:n},error:null}}function vi(t){const e=ve(t);return!e.error&&t.weak_password&&typeof t.weak_password=="object"&&Array.isArray(t.weak_password.reasons)&&t.weak_password.reasons.length&&t.weak_password.message&&typeof t.weak_password.message=="string"&&t.weak_password.reasons.reduce((r,n)=>r&&typeof n=="string",!0)&&(e.data.weak_password=t.weak_password),e}function tt(t){var e;return{data:{user:(e=t.user)!==null&&e!==void 0?e:t},error:null}}function yy(t){return{data:t,error:null}}function by(t){const{action_link:e,email_otp:r,hashed_token:n,redirect_to:s,verification_type:o}=t,i=Wt(t,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),a={action_link:e,email_otp:r,hashed_token:n,redirect_to:s,verification_type:o},l=Object.assign({},i);return{data:{properties:a,user:l},error:null}}function yi(t){return t}function wy(t){return!!t.access_token&&!!t.refresh_token&&!!t.expires_in}const zn=["global","local","others"];class xy{constructor({url:e="",headers:r={},fetch:n,experimental:s}){this.url=e,this.headers=r,this.fetch=Ml(n),this.experimental=s??{},this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)},this.customProviders={listProviders:this._listCustomProviders.bind(this),createProvider:this._createCustomProvider.bind(this),getProvider:this._getCustomProvider.bind(this),updateProvider:this._updateCustomProvider.bind(this),deleteProvider:this._deleteCustomProvider.bind(this)},this.passkey={listPasskeys:this._adminListPasskeys.bind(this),deletePasskey:this._adminDeletePasskey.bind(this)}}
15async signOut(e,r=zn[0]){if(zn.indexOf(r)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${zn.join(", ")}`);try{return await O(this.fetch,"POST",`${this.url}/logout?scope=${r}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(n){if(A(n))return{data:null,error:n};throw n}}async inviteUserByEmail(e,r={}){try{return await O(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:r.data},headers:this.headers,redirectTo:r.redirectTo,xform:tt})}catch(n){if(A(n))return{data:{user:null},error:n};throw n}}async generateLink(e){try{const{options:r}=e,n=Wt(e,["options"]),s=Object.assign(Object.assign({},n),r);return"newEmail"in n&&(s.new_email=n==null?void 0:n.newEmail,delete s.newEmail),await O(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:s,headers:this.headers,xform:by,redirectTo:r==null?void 0:r.redirectTo})}catch(r){if(A(r))return{data:{properties:null,user:null},error:r};throw r}}async createUser(e){try{return await O(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:tt})}catch(r){if(A(r))return{data:{user:null},error:r};throw r}}async listUsers(e){var r,n,s,o,i,a,l;try{const u={nextPage:null,lastPage:0,total:0},d=await O(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(n=(r=e==null?void 0:e.page)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:"",per_page:(o=(s=e==null?void 0:e.perPage)===null||s===void 0?void 0:s.toString())!==null&&o!==void 0?o:""},xform:yi});if(d.error)throw d.error;const h=await d.json(),m=(i=d.headers.get("x-total-count"))!==null&&i!==void 0?i:0,p=(l=(a=d.headers.get("link"))===null||a===void 0?void 0:a.split(","))!==null&&l!==void 0?l:[];return p.length>0&&(p.forEach(v=>{const g=parseInt(v.split(";")[0].split("=")[1].substring(0,1)),y=JSON.parse(v.split(";")[1].split("=")[1]);u[`${y}Page`]=g}),u.total=parseInt(m)),{data:Object.assign(Object.assign({},h),u),error:null}}catch(u){if(A(u))return{data:{users:[]},error:u};throw u}}async getUserById(e){Ue(e);try{return await O(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:tt})}catch(r){if(A(r))return{data:{user:null},error:r};throw r}}async updateUserById(e,r){Ue(e);try{return await O(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:r,headers:this.headers,xform:tt})}catch(n){if(A(n))return{data:{user:null},error:n};throw n}}async deleteUser(e,r=!1){Ue(e);try{return await O(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:r},xform:tt})}catch(n){if(A(n))return{data:{user:null},error:n};throw n}}async _listFactors(e){Ue(e.userId);try{const{data:r,error:n}=await O(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:s=>({data:{factors:s},error:null})});return{data:r,error:n}}catch(r){if(A(r))return{data:null,error:r};throw r}}async _deleteFactor(e){Ue(e.userId),Ue(e.id);try{return{data:await O(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(r){if(A(r))return{data:null,error:r};throw r}}async _listOAuthClients(e){var r,n,s,o,i,a,l;try{const u={nextPage:null,lastPage:0,total:0},d=await O(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(n=(r=e==null?void 0:e.page)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:"",per_page:(o=(s=e==null?void 0:e.perPage)===null||s===void 0?void 0:s.toString())!==null&&o!==void 0?o:""},xform:yi});if(d.error)throw d.error;const h=await d.json(),m=(i=d.headers.get("x-total-count"))!==null&&i!==void 0?i:0,p=(l=(a=d.headers.get("link"))===null||a===void 0?void 0:a.split(","))!==null&&l!==void 0?l:[];return p.length>0&&(p.forEach(v=>{const g=parseInt(v.split(";")[0].split("=")[1].substring(0,1)),y=JSON.parse(v.split(";")[1].split("=")[1]);u[`${y}Page`]=g}),u.total=parseInt(m)),{data:Object.assign(Object.assign({},h),u),error:null}}catch(u){if(A(u))return{data:{clients:[]},error:u};throw u}}async _createOAuthClient(e){try{return await O(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:e,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(A(r))return{data:null,error:r};throw r}}async _getOAuthClient(e){try{return await O(this.fetch,"GET",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(A(r))return{data:null,error:r};throw r}}async _updateOAuthClient(e,r){try{return await O(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${e}`,{body:r,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(A(n))return{data:null,error:n};throw n}}async _deleteOAuthClient(e){try{return await O(this.fetch,"DELET
15E",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(A(r))return{data:null,error:r};throw r}}async _regenerateOAuthClientSecret(e){try{return await O(this.fetch,"POST",`${this.url}/admin/oauth/clients/${e}/regenerate_secret`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(A(r))return{data:null,error:r};throw r}}async _listCustomProviders(e){try{const r={};return e!=null&&e.type&&(r.type=e.type),await O(this.fetch,"GET",`${this.url}/admin/custom-providers`,{headers:this.headers,query:r,xform:n=>{var s;return{data:{providers:(s=n==null?void 0:n.providers)!==null&&s!==void 0?s:[]},error:null}}})}catch(r){if(A(r))return{data:{providers:[]},error:r};throw r}}async _createCustomProvider(e){try{return await O(this.fetch,"POST",`${this.url}/admin/custom-providers`,{body:e,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(A(r))return{data:null,error:r};throw r}}async _getCustomProvider(e){try{return await O(this.fetch,"GET",`${this.url}/admin/custom-providers/${e}`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(A(r))return{data:null,error:r};throw r}}async _updateCustomProvider(e,r){try{return await O(this.fetch,"PUT",`${this.url}/admin/custom-providers/${e}`,{body:r,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(A(n))return{data:null,error:n};throw n}}async _deleteCustomProvider(e){try{return await O(this.fetch,"DELETE",`${this.url}/admin/custom-providers/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(A(r))return{data:null,error:r};throw r}}async _adminListPasskeys(e){Ee(this.experimental),Ue(e.userId);try{return await O(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/passkeys`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(A(r))return{data:null,error:r};throw r}}async _adminDeletePasskey(e){Ee(this.experimental),Ue(e.userId),Ue(e.passkeyId);try{return await O(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/passkeys/${e.passkeyId}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(A(r))return{data:null,error:r};throw r}}}function bi(t={}){return{getItem:e=>t[e]||null,setItem:(e,r)=>{t[e]=r},removeItem:e=>{delete t[e]}}}globalThis&&Dl()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug");class _y extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}}function Ey(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}function Ul(t){if(!/^0x[a-fA-F0-9]{40}$/.test(t))throw new Error(`@supabase/auth-js: Address "${t}" is invalid.`);return t.toLowerCase()}function Sy(t){return parseInt(t,16)}function ky(t){const e=new TextEncoder().encode(t);return"0x"+Array.from(e,n=>n.toString(16).padStart(2,"0")).join("")}function Ty(t){var e;const{chainId:r,domain:n,expirationTime:s,issuedAt:o=new Date,nonce:i,notBefore:a,requestId:l,resources:u,scheme:d,uri:h,version:m}=t;{if(!Number.isInteger(r))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${r}`);if(!n)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(i&&i.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${i}`);if(!h)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(m!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${m}`);if(!((e=t.statement)===null||e===void 0)&&e.includes(`
16`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${t.statement}`)}const p=Ul(t.address),v=d?`${d}://${n}`:n,g=t.statement?`${t.statement}
17`:"",y=`${v} wants you to sign in with your Ethereum account:
18${p}
19
20${g}`;let x=`URI: ${h}
21Version: ${m}
22Chain ID: ${r}${i?`
23Nonce: ${i}`:""}
24Issued At: ${o.toISOString()}`;if(s&&(x+=`
25Expiration Time: ${s.toISOString()}`),a&&(x+=`
26Not Before: ${a.toISOString()}`),l&&(x+=`
27Request ID: ${l}`),u){let b=`
28Resources:`;
28for(const w of u){if(!w||typeof w!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${w}`);b+=`
29- ${w}`}x+=b}return`${y}
30${x}`}class ne extends Error{constructor({message:e,code:r,cause:n,name:s}){var o;super(e,{cause:n}),this.__isWebAuthnError=!0,this.name=(o=s??(n instanceof Error?n.name:void 0))!==null&&o!==void 0?o:"Unknown Error",this.code=r}toJSON(){return{name:this.name,message:this.message,code:this.code}}}class fn extends ne{constructor(e,r){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:r,message:e}),this.name="WebAuthnUnknownError",this.originalError=r}}function Ry({error:t,options:e}){var r,n,s;const{publicKey:o}=e;if(!o)throw Error("options was missing required publicKey property");if(t.name==="AbortError"){if(e.signal instanceof AbortSignal)return new ne({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else if(t.name==="ConstraintError"){if(((r=o.authenticatorSelection)===null||r===void 0?void 0:r.requireResidentKey)===!0)return new ne({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:t});if(e.mediation==="conditional"&&((n=o.authenticatorSelection)===null||n===void 0?void 0:n.userVerification)==="required")return new ne({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:t});if(((s=o.authenticatorSelection)===null||s===void 0?void 0:s.userVerification)==="required")return new ne({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:t})}else{if(t.name==="InvalidStateError")return new ne({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:t});if(t.name==="NotAllowedError")return new ne({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="NotSupportedError")return o.pubKeyCredParams.filter(a=>a.type==="public-key").length===0?new ne({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:t}):new ne({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:t});if(t.name==="SecurityError"){const i=window.location.hostname;if(Bl(i)){if(o.rp.id!==i)return new ne({message:`The RP ID "${o.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new ne({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="TypeError"){if(o.user.id.byteLength<1||o.user.id.byteLength>64)return new ne({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:t})}else if(t.name==="UnknownError")return new ne({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:t})}return new ne({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t})}function Ay({error:t,options:e}){const{publicKey:r}=e;if(!r)throw Error("options was missing required publicKey property");if(t.name==="AbortError"){if(e.signal instanceof AbortSignal)return new ne({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else{if(t.name==="NotAllowedError")return new ne({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="SecurityError"){const n=window.location.hostname;if(Bl(n)){if(r.rpId!==n)return new ne({message:`The RP ID "${r.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new ne({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="UnknownError")return new ne({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ER
30ROR",cause:t})}return new ne({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t})}class Cy{createNewAbortSignal(){if(this.controller){const r=new Error("Cancelling existing WebAuthn API call for new one");r.name="AbortError",this.controller.abort(r)}const e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){const e=new Error("Manually cancelling existing WebAuthn API call");e.name="AbortError",this.controller.abort(e),this.controller=void 0}}}const As=new Cy;function wi(t){if(!t)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(t);const{challenge:e,user:r,excludeCredentials:n}=t,s=Wt(t,["challenge","user","excludeCredentials"]),o=Lt(e).buffer,i=Object.assign(Object.assign({},r),{id:Lt(r.id).buffer}),a=Object.assign(Object.assign({},s),{challenge:o,user:i});if(n&&n.length>0){a.excludeCredentials=new Array(n.length);for(let l=0;l<n.length;l++){const u=n[l];a.excludeCredentials[l]=Object.assign(Object.assign({},u),{id:Lt(u.id).buffer,type:u.type||"public-key",transports:u.transports})}}return a}function xi(t){if(!t)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(t);const{challenge:e,allowCredentials:r}=t,n=Wt(t,["challenge","allowCredentials"]),s=Lt(e).buffer,o=Object.assign(Object.assign({},n),{challenge:s});if(r&&r.length>0){o.allowCredentials=new Array(r.length);for(let i=0;i<r.length;i++){const a=r[i];o.allowCredentials[i]=Object.assign(Object.assign({},a),{id:Lt(a.id).buffer,type:a.type||"public-key",transports:a.transports})}}return o}function _i(t){var e;if("toJSON"in t&&typeof t.toJSON=="function")return t.toJSON();const r=t;return{id:t.id,rawId:t.id,response:{attestationObject:ht(new Uint8Array(t.response.attestationObject)),clientDataJSON:ht(new Uint8Array(t.response.clientDataJSON))},type:"public-key",clientExtensionResults:t.getClientExtensionResults(),authenticatorAttachment:(e=r.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function Ei(t){var e;if("toJSON"in t&&typeof t.toJSON=="function")return t.toJSON();const r=t,n=t.getClientExtensionResults(),s=t.response;return{id:t.id,rawId:t.id,response:{authenticatorData:ht(new Uint8Array(s.authenticatorData)),clientDataJSON:ht(new Uint8Array(s.clientDataJSON)),signature:ht(new Uint8Array(s.signature)),userHandle:s.userHandle?ht(new Uint8Array(s.userHandle)):void 0},type:"public-key",clientExtensionResults:n,authenticatorAttachment:(e=r.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function Bl(t){return t==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(t)}function pn(){var t,e;return!!(ie()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((t=navigator==null?void 0:navigator.credentials)===null||t===void 0?void 0:t.create)=="function"&&typeof((e=navigator==null?void 0:navigator.credentials)===null||e===void 0?void 0:e.get)=="function")}async function Fl(t){try{const e=await navigator.credentials.create(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new fn("Browser returned unexpected credential type",e)}:{data:null,error:new fn("Empty credential response",e)}}catch(e){return{data:null,error:Ry({error:e,options:t})}}}async function Hl(t){try{const e=await navigator.credentials.get(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new fn("Browser returned unexpected credential type",e)}:{data:null,error:new fn("Empty credential response",e)}}catch(e){return{data:null,error:Ay({error:e,options:t})}}}const jy={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},Py={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function mn(...t){const e=s=>s!==null&&typeof s=="object"&&!Array.isArray(s),r=s=>s instanceof ArrayBuffer||ArrayBuffer.isView(s),n={};for(const s of t)if(s)for(const o in s){const i=s[o];if(i!==void 0)if(Array.isArray(i))n[o]=i;else if(r(i))n[o]=i;else if(e(i)){const a=n[o];e(a)?n[o]=mn(a,i):n[o]=mn(i)}else n[o]=i}return n}function Oy(t,e){return mn(jy,t,e||{})}function Ny(t,e){return mn(Py,t,e||{})}class Iy{constructor(e){this.client=e,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(e){return this.client.mfa.enroll(Object.assign(Object.assign({},e),{factorType:"webauthn"}))}async _challenge({factorId:e,webauthn:r,friendlyName:n,signal:s},o){var i;try{const{data:a,error:l}=await this.client.mfa.challenge({factorId:e,webauthn:r});if(!a)return{data:null,error:l};const u=s??As.createNewAbortSignal();if(a.webauthn.type==="create"){const{user:d}=a.webauthn.credential_options.publicKey;if(!d.name){const h=n;if(h)d.name=`${d.id}:${h}`;else{const p=(await this.client.getUser()).data.user,v=((i=p==null?void 0:p.user_metadata)===null||i===void 0?void 0:i.name)||(p==null?void 0:p.email)||(p==null?void 0:p.id)||"User";d.name=`${d.id}:${v}`}}d.displayName||(d.displayName=d.name)}switch(a.webauthn.type){case"create":{const d=Oy(a.webauthn.credential_options.publicKey,o==null?void 0:o.create),{data:h,error:m}=await Fl({publicKey:d,signal:u});return h?{data:{factorId:e,challengeId:a.id,webauthn:{type:a.webauthn.type,credential_response:h}},error:null}:{data:null,error:m}}case"request":{const d=Ny(a.webauthn.credential_options.publicKey,o==null?void 0:o.request),{data:h,error:m}=await Hl(Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:d,signal:u}));return h?{data:{factorId:e,challengeId:a.id,webauthn:{type:a.webauthn.type,credential_response:h}},error:null}:{data:null,error:m}}}}catch(a){return A(a)?{data:null,error:a}:{data:null,error:new ke("Unexpected error in challenge",a)}}}async _verify({challengeId:e,factorId:r,webauthn:n}){return this.client.mfa.verify({factorId:r,challengeId:e,webauthn:n})}async _authenticate({factorId:e,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:n=typeof window<"u"?[window.location.origin]:void 0,signal:s}={}},o){if(!r)return{data:null,error:new fr("rpId is required for WebAuthn authentication")};try{if(!pn())return{data:null,error:new ke("Browser does not support WebAuthn",null)};const{data:i,error:a}=await this.challenge({factorId:e,webauthn:{rpId:r,rpOrigins:n},signal:s},{request:o});if(!i)return{data:null,error:a};const{webauthn:l}=i;return this._verify({factorId:e,challengeId:i.challengeId,webauthn:{type:l.type,rpId:r,rpOrigins:n,credential_response:l.credential_response}})}catch(i){return A(i)?{data:null,error:i}:{data:null,error:new ke("Unexpected error in authenticate",i)}}}async _register({friendlyName:e,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:n=typeof window<"u"?[window.location.origin]:void 0,signal:s}={}},o){if(!r)return{data:null,error:new fr("rpId is required for WebAuthn registration")};try{if(!pn())return{data:null,error:new ke("Browser does not support WebAuthn",null)};const{data:i,error:a}=await this._enroll({friendlyName:e});if(!i)return await this.client.mfa.listFactors().then(d=>{var h;
30return(h=d.data)===null||h===void 0?void 0:h.all.find(m=>m.factor_type==="webauthn"&&m.friendly_name===e&&m.status!=="unverified")}).then(d=>d?this.client.mfa.unenroll({factorId:d==null?void 0:d.id}):void 0),{data:null,error:a};const{data:l,error:u}=await this._challenge({factorId:i.id,friendlyName:i.friendly_name,webauthn:{rpId:r,rpOrigins:n},signal:s},{create:o});return l?this._verify({factorId:i.id,challengeId:l.challengeId,webauthn:{rpId:r,rpOrigins:n,type:l.webauthn.type,credential_response:l.webauthn.credential_response}}):{data:null,error:u}}catch(i){return A(i)?{data:null,error:i}:{data:null,error:new ke("Unexpected error in register",i)}}}}Ey();const Ly={url:Mv,storageKey:Uv,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:Bv,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1,experimental:{}},Tt={};class pr{get jwks(){var e,r;return(r=(e=Tt[this.storageKey])===null||e===void 0?void 0:e.jwks)!==null&&r!==void 0?r:{keys:[]}}set jwks(e){Tt[this.storageKey]=Object.assign(Object.assign({},Tt[this.storageKey]),{jwks:e})}get jwks_cached_at(){var e,r;return(r=(e=Tt[this.storageKey])===null||e===void 0?void 0:e.cachedAt)!==null&&r!==void 0?r:Number.MIN_SAFE_INTEGER}set jwks_cached_at(e){Tt[this.storageKey]=Object.assign(Object.assign({},Tt[this.storageKey]),{cachedAt:e})}constructor(e){var r,n,s;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.lastRefreshFailure=null,this._sessionRemovalEpoch=0,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lock=null,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;const o=Object.assign(Object.assign({},Ly),e);if(this.storageKey=o.storageKey,this.instanceID=(r=pr.nextInstanceID[this.storageKey])!==null&&r!==void 0?r:0,pr.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!o.debug,typeof o.debug=="function"&&(this.logger=o.debug),this.instanceID>0&&ie()){const i=`${this._logPrefix()} Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.`;console.warn(i),this.logDebugMessages&&console.trace(i)}if(this.persistSession=o.persistSession,this.autoRefreshToken=o.autoRefreshToken,this.experimental=(n=o.experimental)!==null&&n!==void 0?n:{},this.admin=new xy({url:o.url,headers:o.headers,fetch:o.fetch,experimental:this.experimental}),this.url=o.url,this.headers=o.headers,this.fetch=Ml(o.fetch),this.detectSessionInUrl=o.detectSessionInUrl,this.flowType=o.flowType,this.hasCustomAuthorizationHeader=o.hasCustomAuthorizationHeader,this.throwOnError=o.throwOnError,this.lockAcquireTimeout=o.lockAcquireTimeout,o.lock!=null&&(this.lock=o.lock),this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new Iy(this)},this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.passkey={startRegistration:this._startPasskeyRegistration.bind(this),verifyRegistration:this._verifyPasskeyRegistration.bind(this),startAuthentication:this._startPasskeyAuthentication.bind(this),verifyAuthentication:this._verifyPasskeyAuthentication.bind(this),list:this._listPasskeys.bind(this),update:this._updatePasskey.bind(this),delete:this._deletePasskey.bind(this)},this.persistSession?(o.storage?this.storage=o.storage:Dl()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=bi(this.memoryStorage)),o.userStorage&&(this.userStorage=o.userStorage)):(this.memoryStorage={},this.storage=bi(this.memoryStorage)),ie()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(i){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",i)}(s=this.broadcastChannel)===null||s===void 0||s.addEventListener("message",async i=>{this._debug("received broadcast notification from other tab or client",i),(i.data.event==="TOKEN_REFRESHED"||i.data.event==="SIGNED_IN")&&(this.lastRefreshFailure=null);try{await this._notifyAllSubscribers(i.data.event,i.data.session,!1)}catch(a){this._debug("#broadcastChannel","error",a)}})}o.skipAutoInitialize||this.initialize().catch(i=>{this._debug("#initialize()","error",i)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(e){if(this.throwOnError&&e&&e.error)throw e.error;return e}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${Il}) ${new Date().toISOString()}`}_debug(...e){return this.logDebugMessages&&this.logger(this._logPrefix(),...e),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()):await this._initialize())(),await this.initializePromise)}async _initialize(){var e;try{let r={},n="none";if(ie()&&(r=ty(window.location.href),this._isImplicitGrantCallback(r)?n="implicit":await this._isPKCECallback(r)&&(n="pkce")),ie()&&this.detectSessionInUrl&&n!=="none"){const{data:s,error:o}=await this._getSessionFromURL(r,n);if(o){if(this._debug("#_initialize()","error detecting session from URL",o),qv(o)){const l=(e=o.details)===null||e===void 0?void 0:e.code;if(l==="identity_already_exists"||l==="identity_not_found"||l==="single_identity_not_deletable")return{error:o}}return{error:o}}const{session:i,redirectType:a}=s;return this._debug("#_initialize()","detected session in URL",i,"redirect type",a),await this._saveSession(i),setTimeout(async()=>{a==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",i):await this._notifyAllSubscribers("SIGNED_IN",i)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(r){return A(r)?this._returnResult({error:r}):this._returnResult({error:new ke("Unexpected error during initialization",r)}
30)}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var r,n,s;try{const o=await O(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(n=(r=e==null?void 0:e.options)===null||r===void 0?void 0:r.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:(s=e==null?void 0:e.options)===null||s===void 0?void 0:s.captchaToken}},xform:ve}),{data:i,error:a}=o;if(a||!i)return this._returnResult({data:{user:null,session:null},error:a});const l=i.session,u=i.user;return i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers("SIGNED_IN",l)),this._returnResult({data:{user:u,session:l},error:null})}catch(o){if(A(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}}async signUp(e){var r,n,s;try{let o;if("email"in e){const{email:d,password:h,options:m}=e;let p=null,v=null;this.flowType==="pkce"&&([p,v]=await ut(this.storage,this.storageKey)),o=await O(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:m==null?void 0:m.emailRedirectTo,body:{email:d,password:h,data:(r=m==null?void 0:m.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:m==null?void 0:m.captchaToken},code_challenge:p,code_challenge_method:v},xform:ve})}else if("phone"in e){const{phone:d,password:h,options:m}=e;o=await O(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:d,password:h,data:(n=m==null?void 0:m.data)!==null&&n!==void 0?n:{},channel:(s=m==null?void 0:m.channel)!==null&&s!==void 0?s:"sms",gotrue_meta_security:{captcha_token:m==null?void 0:m.captchaToken}},xform:ve})}else throw new $r("You must provide either an email or phone number and a password");const{data:i,error:a}=o;if(a||!i)return await re(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:a});const l=i.session,u=i.user;return i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers("SIGNED_IN",l)),this._returnResult({data:{user:u,session:l},error:null})}catch(o){if(await re(this.storage,`${this.storageKey}-code-verifier`),A(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}}async signInWithPassword(e){try{let r;if("email"in e){const{email:o,password:i,options:a}=e;r=await O(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:o,password:i,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},xform:vi})}else if("phone"in e){const{phone:o,password:i,options:a}=e;r=await O(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:o,password:i,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},xform:vi})}else throw new $r("You must provide either an email or phone number and a password");const{data:n,error:s}=r;if(s)return this._returnResult({data:{user:null,session:null},error:s});if(!n||!n.session||!n.user){const o=new kt;return this._returnResult({data:{user:null,session:null},error:o})}return n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",n.session)),this._returnResult({data:Object.assign({user:n.user,session:n.session},n.weak_password?{weakPassword:n.weak_password}:null),error:s})}catch(r){if(A(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOAuth(e){var r,n,s,o;return await this._handleProviderSignIn(e.provider,{redirectTo:(r=e.options)===null||r===void 0?void 0:r.redirectTo,scopes:(n=e.options)===null||n===void 0?void 0:n.scopes,queryParams:(s=e.options)===null||s===void 0?void 0:s.queryParams,skipBrowserRedirect:(o=e.options)===null||o===void 0?void 0:o.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this.lock!=null?this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(e)):this._exchangeCodeForSession(e)}async signInWithWeb3(e){const{chain:r}=e;switch(r){case"ethereum":return await this.signInWithEthereum(e);case"solana":return await this.signInWithSolana(e);default:throw new Error(`@supabase/auth-js: Unsupported chain "${r}"`)}}async signInWithEthereum(e){var r,n,s,o,i,a,l,u,d,h,m;let p,v;if("message"in e)p=e.message,v=e.signature;else{const{chain:g,wallet:y,statement:x,options:b}=e;let w;if(ie())if(typeof y=="object")w=y;else{const L=window;if("ethereum"in L&&typeof L.ethereum=="object"&&"request"in L.ethereum&&typeof L.ethereum.request=="function")w=L.ethereum;else throw new Error("@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.")}else{if(typeof y!="object"||!(b!=null&&b.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");w=y}const _=new URL((r=b==null?void 0:b.url)!==null&&r!==void 0?r:window.location.href),S=await w.request({method:"eth_requestAccounts"}).then(L=>L).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!S||S.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const k=Ul(S[0]);let E=(n=b==null?void 0:b.signInWithEthereum)===null||n===void 0?void 0:n.chainId;if(!E){const L=await w.request({method:"eth_chainId"});E=Sy(L)}const $={domain:_.host,address:k,statement:x,uri:_.href,version:"1",chainId:E,nonce:(s=b==null?void 0:b.signInWithEthereum)===null||s===void 0?void 0:s.nonce,issuedAt:(i=(o=b==null?void 0:b.signInWithEthereum)===null||o===void 0?void 0:o.issuedAt)!==null&&i!==void 0?i:new Date,expirationTime:(a=b==null?void 0:b.signInWithEthereum)===null||a===void 0?void 0:a.expirationTime,notBefore:(l=b==null?void 0:b.signInWithEthereum)===null||l===void 0?void 0:l.notBefore,requestId:(u=b==null?void 0:b.signInWithEthereum)===null||u===void 0?void 0:u.requestId,resources:(d=b==null?void 0:b.signInWithEthereum)===null||d===void 0?void 0:d.resources};p=Ty($),v=await w.request({method:"personal_sign",params:[ky(p),k]})}try{const{data:g,error:y}=await O(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:p,signature:v}
30,!((h=e.options)===null||h===void 0)&&h.captchaToken?{gotrue_meta_security:{captcha_token:(m=e.options)===null||m===void 0?void 0:m.captchaToken}}:null),xform:ve});if(y)throw y;if(!g||!g.session||!g.user){const x=new kt;return this._returnResult({data:{user:null,session:null},error:x})}return g.session&&(await this._saveSession(g.session),await this._notifyAllSubscribers("SIGNED_IN",g.session)),this._returnResult({data:Object.assign({},g),error:y})}catch(g){if(A(g))return this._returnResult({data:{user:null,session:null},error:g});throw g}}async signInWithSolana(e){var r,n,s,o,i,a,l,u,d,h,m,p;let v,g;if("message"in e)v=e.message,g=e.signature;else{const{chain:y,wallet:x,statement:b,options:w}=e;let _;if(ie())if(typeof x=="object")_=x;else{const k=window;if("solana"in k&&typeof k.solana=="object"&&("signIn"in k.solana&&typeof k.solana.signIn=="function"||"signMessage"in k.solana&&typeof k.solana.signMessage=="function"))_=k.solana;else throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if(typeof x!="object"||!(w!=null&&w.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");_=x}const S=new URL((r=w==null?void 0:w.url)!==null&&r!==void 0?r:window.location.href);if("signIn"in _&&_.signIn){const k=await _.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},w==null?void 0:w.signInWithSolana),{version:"1",domain:S.host,uri:S.href}),b?{statement:b}:null));let E;if(Array.isArray(k)&&k[0]&&typeof k[0]=="object")E=k[0];else if(k&&typeof k=="object"&&"signedMessage"in k&&"signature"in k)E=k;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in E&&"signature"in E&&(typeof E.signedMessage=="string"||E.signedMessage instanceof Uint8Array)&&E.signature instanceof Uint8Array)v=typeof E.signedMessage=="string"?E.signedMessage:new TextDecoder().decode(E.signedMessage),g=E.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in _)||typeof _.signMessage!="function"||!("publicKey"in _)||typeof _!="object"||!_.publicKey||!("toBase58"in _.publicKey)||typeof _.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");v=[`${S.host} wants you to sign in with your Solana account:`,_.publicKey.toBase58(),...b?["",b,""]:[""],"Version: 1",`URI: ${S.href}`,`Issued At: ${(s=(n=w==null?void 0:w.signInWithSolana)===null||n===void 0?void 0:n.issuedAt)!==null&&s!==void 0?s:new Date().toISOString()}`,...!((o=w==null?void 0:w.signInWithSolana)===null||o===void 0)&&o.notBefore?[`Not Before: ${w.signInWithSolana.notBefore}`]:[],...!((i=w==null?void 0:w.signInWithSolana)===null||i===void 0)&&i.expirationTime?[`Expiration Time: ${w.signInWithSolana.expirationTime}`]:[],...!((a=w==null?void 0:w.signInWithSolana)===null||a===void 0)&&a.chainId?[`Chain ID: ${w.signInWithSolana.chainId}`]:[],...!((l=w==null?void 0:w.signInWithSolana)===null||l===void 0)&&l.nonce?[`Nonce: ${w.signInWithSolana.nonce}`]:[],...!((u=w==null?void 0:w.signInWithSolana)===null||u===void 0)&&u.requestId?[`Request ID: ${w.signInWithSolana.requestId}`]:[],...!((h=(d=w==null?void 0:w.signInWithSolana)===null||d===void 0?void 0:d.resources)===null||h===void 0)&&h.length?["Resources",...w.signInWithSolana.resources.map(E=>`- ${E}`)]:[]].join(`
31`);const k=await _.signMessage(new TextEncoder().encode(v),"utf8");if(!k||!(k instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");g=k}}try{const{data:y,error:x}=await O(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:v,signature:ht(g)},!((m=e.options)===null||m===void 0)&&m.captchaToken?{gotrue_meta_security:{captcha_token:(p=e.options)===null||p===void 0?void 0:p.captchaToken}}:null),xform:ve});if(x)throw x;if(!y||!y.session||!y.user){const b=new kt;return this._returnResult({data:{user:null,session:null},error:b})}return y.session&&(await this._saveSession(y.session),await this._notifyAllSubscribers("SIGNED_IN",y.session)),this._returnResult({data:Object.assign({},y),error:x})}catch(y){if(A(y))return this._returnResult({data:{user:null,session:null},error:y});throw y}}async _exchangeCodeForSession(e){const r=await _e(this.storage,`${this.storageKey}-code-verifier`),[n,s]=(r??"").split("/");try{if(!n&&this.flowType==="pkce")throw new zv;const{data:o,error:i}=await O(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:n},xform:ve});if(await re(this.storage,`${this.storageKey}-code-verifier`),i)throw i;if(!o||!o.session||!o.user){const a=new kt;return this._returnResult({data:{user:null,session:null,redirectType:null},error:a})}return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers(s==="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",o.session)),this._returnResult({data:Object.assign(Object.assign({},o),{redirectType:s??null}),error:i})}catch(o){if(await re(this.storage,`${this.storageKey}-code-verifier`),A(o))return this._returnResult({data:{user:null,session:null,redirectType:null},error:o});throw o}}async signInWithIdToken(e){try{const{options:r,provider:n,token:s,access_token:o,nonce:i}=e,a=await O(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:n,id_token:s,access_token:o,nonce:i,gotrue_meta_security:{captcha_token:r==null?void 0:r.captchaToken}},xform:ve}),{data:l,error:u}=a;if(u)return this._returnResult({data:{user:null,session:null},error:u});if(!l||!l.session||!l.user){const d=new kt;return this._returnResult({data:{user:null,session:null},error:d})}return l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers("SIGNED_IN",l.session)),this._returnResult({data:l,error:u})}catch(r){if(A(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOtp(e){var r,n,s,o,i;try{if("email"in e){const{email:a,options:l}=e;let u=null,d=null;this.flowType==="pkce"&&([u,d]=await ut(this.storage,this.storageKey));const{error:h}=await O(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:a,data:(r=l==null?void 0:l.data)!==null&&r!==void 0?r:{},create_user:(n=l==null?void 0:l.shouldCreateUser)!==null&&n!==void 0?n:!0,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken},code_challenge:u,code_challenge_method:d},redirectTo:l==null?void 0:l.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:h})}if("phone"in e){const{phone:a,options:l}=e,{data:u,error:d}=await O(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:a,data:(s=l==null?void 0:l.data)!==null&&s!==void 0?s:{},create_user:(o=l==null?void 0:l.shouldCreateUser)!==null&&o!==void 0?o:!0,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken},channel:(i=l==null?void 0:l.channel)!==null&&i!==void 0?i:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:u==null?void 0:u.message_id},error:d})}throw new $r("You must provide either an email or phone number.")}catch(a){if(await re(this.storage,`${this.storageKey}-code-verifier`),A(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}}async verifyOtp(e){var r,n;try{let s,o;"options"in e&&(s=(r=e.options)===null||r===void 0?void 0:r.redirectTo,o=(n=e.options)===null||n===void 0?void 0:n.captchaToken);const{data:i,error:a}=await O(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:o}}),redirectTo:s,xform:ve});if(a)throw a;if(!i)throw new Error("An error occurred on token verification.");const l=i.session,u=i.user;return l!=null&&l.access_token&&(await this._saveSession(l),await this._notifyAllSubscribers(e.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",l)),this._returnResult({data:{user:u,session:l},error:null})}catch(s){if(A(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signInWithSSO(e){var r,n,s,o,i;try{let a=null,l=null;this.flowType==="pkce"&&([a,l]=await ut(this.storage,this.storageKey));const u=await O(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in e?{provider_id:e.providerId}:null),"domain"in e?{domain:e.domain}:null),{redirect_to:(n=(r=e.options)===null||r===void 0?void 0:r.redirectTo)!==null&&n!==void 0?n:void 0}),!((s=e==null?void 0:e.options)===null||s===void 0)&&s.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:a,code_challenge_method:l}),headers:this.headers,xform:yy});return!((o=u.data)===null||o===void 0)&&o.url&&ie()&&!(!((i=e.options)===null||i===void 0)&&i.skipBrowserRedirect)&&window.location.assign(u.data.url),this._returnResult(u)}catch(a){if(await re(this.storage,`${this.storageKey}-code-verifier`),A(a))return this._returnResult({data:null,error:a});throw a}}async reauthenticate(){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate()):await this._reauthenticate()}async _reauthenticate(){try{return await this._useSession(async e=>{const{data:{session:r},error:n}=e;if(n)throw n;if(!r)throw new se;const{error:s}=await O(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:r.access_token});return this._returnResult({data:{user:null,session:null},error:s})})}catch(e){if(A(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async resend(e){try{const r=`${this.url}/resend`;if("email"in e){const{email:n,type:s,options:o}=e;let i=null,a=null;this.flowType==="pkce"&&([i,a]=await ut(this.storage,this.storageKey));const{error:l}=await O(this.fetch,"POST",r,{headers:this.headers,body:{email:n,type:s,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken},code_challenge:i,code_challenge_method:a},redirectTo:o==null?void 0:o.emailRedirectTo});return l&&await re(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:l})}else if("phone"in e){const{phone:n,type:s,options:o}=e,{data:i,error:a}=await O(this.fetch,"POST",r,{headers:this.headers,body:{phone:n,type:s,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:i==null?void 0:i.message_id},error:a})}throw new $r("You must provide either an email or phone number and a type")}catch(r){if(await re(this.storage,`${this.storageKey}-code-verifier`),A(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async getSession(){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async e=>e)):await this._useSession(async e=>e)}async _acquireLock(e,r){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){const n=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),s=(async()=>(await n,await r()))();return this.pendingInLock.push((async()=>{try{await s}catch{}})()),s}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const n=r();for(this.pendingInLock.push((async()=>{try{await n}catch{}})()),await n;this.pendingInLock.length;){const s=[...this.pendingInLock];await Promise.all(s),this.pendingInLock.splice(0,s.length)}return await n}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(e){this._debug("#_useSession","begin");try{const r=await this.__loadSession();return await e(r)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lock!=null&&!this.lockAcquired&&this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let e=null;const r=await _e(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",r),r!==null&&(this._isValidSession(r)?e=r:(this._debug("#getSession()","session from storage is not val
31id"),await this._removeSession())),!e)return{data:{session:null},error:null};const n=e.expires_at?e.expires_at*1e3-Date.now()<Wn:!1;if(this._debug("#__loadSession()",`session has${n?"":" not"} expired`,"expires_at",e.expires_at),!n){if(this.userStorage){const i=await _e(this.userStorage,this.storageKey+"-user");i!=null&&i.user?e.user=i.user:e.user=qn()}if(this.storage.isServer&&e.user&&!e.user.__isUserNotAvailableProxy){const i={value:this.suppressGetSessionWarning};e.user=py(e.user,i),i.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:e},error:null}}const{data:s,error:o}=await this._callRefreshToken(e.refresh_token);if(o){if(!!(e.expires_at&&e.expires_at*1e3>Date.now())){const a=await _e(this.storage,this.storageKey);if(a&&a.refresh_token===e.refresh_token)return this._returnResult({data:{session:e},error:null})}return this._returnResult({data:{session:null},error:o})}return this._returnResult({data:{session:s},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(e){if(e)return await this._getUser(e);await this.initializePromise;let r;return this.lock!=null?r=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser()):r=await this._getUser(),r.data.user&&(this.suppressGetSessionWarning=!0),r}async _getUser(e){try{return e?await O(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:tt}):await this._useSession(async r=>{var n,s,o;const{data:i,error:a}=r;if(a)throw a;return!(!((n=i.session)===null||n===void 0)&&n.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new se}:await O(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(o=(s=i.session)===null||s===void 0?void 0:s.access_token)!==null&&o!==void 0?o:void 0,xform:tt})})}catch(r){if(A(r))return Lr(r)&&(await this._removeSession(),await re(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:r});throw r}}async updateUser(e,r={}){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(e,r)):await this._updateUser(e,r)}async _updateUser(e,r={}){try{return await this._useSession(async n=>{const{data:s,error:o}=n;if(o)throw o;if(!s.session)throw new se;const i=s.session;let a=null,l=null;this.flowType==="pkce"&&e.email!=null&&([a,l]=await ut(this.storage,this.storageKey));const{data:u,error:d}=await O(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:r==null?void 0:r.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:a,code_challenge_method:l}),jwt:i.access_token,xform:tt});if(d)throw d;return i.user=u.user,await this._saveSession(i),await this._notifyAllSubscribers("USER_UPDATED",i),this._returnResult({data:{user:i.user},error:null})})}catch(n){if(await re(this.storage,`${this.storageKey}-code-verifier`),A(n))return this._returnResult({data:{user:null},error:n});throw n}}async setSession(e){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(e)):await this._setSession(e)}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new se;const r=Date.now()/1e3;let n=r,s=!0,o=null;const{payload:i}=Mr(e.access_token);if(i.exp&&(n=i.exp,s=n<=r),s){const{data:a,error:l}=await this._callRefreshToken(e.refresh_token);if(l)return this._returnResult({data:{user:null,session:null},error:l});if(!a)return{data:{user:null,session:null},error:null};o=a}else{const{data:a,error:l}=await this._getUser(e.access_token);if(l)return this._returnResult({data:{user:null,session:null},error:l});o={access_token:e.access_token,refresh_token:e.refresh_token,user:a.user,token_type:"bearer",expires_in:n-r,expires_at:n},await this._saveSession(o),await this._notifyAllSubscribers("SIGNED_IN",o)}return this._returnResult({data:{user:o.user,session:o},error:null})}catch(r){if(A(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}}async refreshSession(e){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(e)):await this._refreshSession(e)}async _refreshSession(e){try{return await this._useSession(async r=>{var n;if(!e){const{data:i,error:a}=r;if(a)throw a;e=(n=i.session)!==null&&n!==void 0?n:void 0}if(!(e!=null&&e.refresh_token))throw new se;const{data:s,error:o}=await this._callRefreshToken(e.refresh_token);return o?this._returnResult({data:{user:null,session:null},error:o}):s?this._returnResult({data:{user:s.user,session:s},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(r){if(A(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async _getSessionFromURL(e,r){var n;try{if(!ie())throw new Dr("No browser detected.");
31if(e.error||e.error_description||e.error_code)throw new Dr(e.error_description||"Error in URL with unspecified error_description",{error:e.error||"unspecified_error",code:e.error_code||"unspecified_code"});switch(r){case"implicit":if(this.flowType==="pkce")throw new li("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new Dr("Not a valid implicit grant flow url.");break;default:}if(r==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!e.code)throw new li("No code detected.");const{data:w,error:_}=await this._exchangeCodeForSession(e.code);if(_)throw _;const S=new URL(window.location.href);return S.searchParams.delete("code"),window.history.replaceState(window.history.state,"",S.toString()),{data:{session:w.session,redirectType:(n=w.redirectType)!==null&&n!==void 0?n:null},error:null}}const{provider_token:s,provider_refresh_token:o,access_token:i,refresh_token:a,expires_in:l,expires_at:u,token_type:d}=e;if(!i||!l||!a||!d)throw new Dr("No session defined in URL");const h=Math.round(Date.now()/1e3),m=parseInt(l);let p=h+m;u&&(p=parseInt(u));const v=p-h;v*1e3<=He&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${v}s, should have been closer to ${m}s`);const g=p-m;h-g>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",g,p,h):h-g<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",g,p,h);const{data:y,error:x}=await this._getUser(i);if(x)throw x;const b={provider_token:s,provider_refresh_token:o,access_token:i,expires_in:m,expires_at:p,refresh_token:a,token_type:d,user:y.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:b,redirectType:e.type},error:null})}catch(s){if(A(s))return this._returnResult({data:{session:null,redirectType:null},error:s});throw s}}_isImplicitGrantCallback(e){return typeof this.detectSessionInUrl=="function"?this.detectSessionInUrl(new URL(window.location.href),e):!!(e.access_token||e.error||e.error_description||e.error_code)}async _isPKCECallback(e){const r=await _e(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&r)}async signOut(e={scope:"global"}){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(e)):await this._signOut(e)}async _signOut({scope:e}={scope:"global"}){return await this._useSession(async r=>{var n;const{data:s,error:o}=r;if(o&&!Lr(o))return this._returnResult({error:o});const i=(n=s.session)===null||n===void 0?void 0:n.access_token;if(i){const{error:a}=await this.admin.signOut(i,e);if(a&&!(Wv(a)&&(a.status===404||a.status===401||a.status===403)||Lr(a)))return this._returnResult({error:a})}return e!=="others"&&(await this._removeSession(),await re(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(e){const r=ey(),n={id:r,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",r),this.stateChangeEmitters.delete(r)}};return this._debug("#onAuthStateChange()","registered callback with id",r),this.stateChangeEmitters.set(r,n),(async()=>(await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(r)}):await this._emitInitialSession(r)))(),{data:{subscription:n}}}async _emitInitialSession(e){return await this._useSession(async r=>{var n,s;try{const{data:{session:o},error:i}=r;if(i)throw i;await((n=this.stateChangeEmitters.get(e))===null||n===void 0?void 0:n.callback("INITIAL_SESSION",o)),this._debug("INITIAL_SESSION","callback id",e,"session",o)}catch(o){await((s=this.stateChangeEmitters.get(e))===null||s===void 0?void 0:s.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",o),Lr(o)?console.warn(o):console.error(o)}})}async resetPasswordForEmail(e,r={}){let n=null,s=null;this.flowType==="pkce"&&([n,s]=await ut(this.storage,this.storageKey,!0));try{return await O(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:n,code_challenge_method:s,gotrue_meta_security:{captcha_token:r.captchaToken}},headers:this.headers,redirectTo:r.redirectTo})}catch(o){if(await re(this.storage,`${this.storageKey}-code-verifier`),A(o))return this._returnResult({data:null,error:o});throw o}}async getUserIdentities(){var e;try{const{data:r,error:n}=await this.getUser();if(n)throw n;return this._returnResult({data:{identities:(e=r.user.identities)!==null&&e!==void 0?e:[]},error:null})}catch(r){if(A(r))return this._returnResult({data:null,error:r});throw r}}async linkIdentity(e){return"token"in e?this.linkIdentityIdToken(e):this.linkIdentityOAuth(e)}async linkIdentityOAuth(e){var r;try{const{data:n,error:s}=await this._useSession(async o=>{var i,a,l,u,d;const{data:h,error:m}=o;if(m)throw m;const p=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:(i=e.options)===null||i===void 0?void 0:i.redirectTo,scopes:(a=e.options)===null||a===void 0?void 0:a.scopes,queryParams:(l=e.options)===null||l===void 0?void 0:l.queryParams,skipBrowserRedirect:!0});return await O(this.fetch,"GET",p,{headers:this.headers,jwt:(d=(u=h.session)===null||u===void 0?void 0:u.access_token)!==null&&d!==void 0?d:void 0})});if(s)throw s;return ie()&&!(!((r=e.options)===null||r===void 0)&&r.skipBrowserRedirect)&&window.location.assign(n==null?void 0:n.url),this._returnResult({data:{provider:e.provider,url:n==null?void 0:n.url},error:null})}catch(n){if(A(n))return this._returnResult({data:{provider:e.provider,url:null},error:n});throw n}}async linkIdentityIdToken(e){return await this._useSession(async r=>{var n;try{const{error:s,data:{session:o}}=r;if(s)throw s;const{options:i,provider:a,token:l,access_token:u,nonce:d}=e,h=await O(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(n=o==null?void 0:o.access_token)!==null&&n!==void 0?n:void 0,body:{provider:a,id_token:l,access_token:u,nonce:d,link_identity:!0,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}},xform:ve}),{data:m,error:p}=h;return p?this._returnResult({data:{user:null,session:null},error:p}):!m||!m.session||!m.user?this._returnResult({data:{user:null,session:null},error:new kt}):(m.session&&(await this._saveSession(m.session),await this._notifyAllSubscribers("USER_UPDATED",m.session)),this._returnResult({data:m,error:p}))}catch(s){if(await re(this.storage,`${this.storageKey}-code-verifier`),A(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}})}async unlinkIdentity(e){try{return await this._useSession(async r=>{var n,s;const{data:o,error:i}=r;if(i)throw i;
31return await O(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:(s=(n=o.session)===null||n===void 0?void 0:n.access_token)!==null&&s!==void 0?s:void 0})})}catch(r){if(A(r))return this._returnResult({data:null,error:r});throw r}}async _refreshAccessToken(e){const r="#_refreshAccessToken()";this._debug(r,"begin");try{const n=Date.now();return await sy(async s=>(s>0&&await ny(200*Math.pow(2,s-1)),this._debug(r,"refreshing attempt",s),await O(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:ve})),(s,o)=>{const i=200*Math.pow(2,s);return o&&ci(o)&&Date.now()+i-n<He})}catch(n){if(this._debug(r,"error",n),A(n))return this._returnResult({data:{session:null,user:null},error:n});throw n}finally{this._debug(r,"end")}}_isValidSession(e){return typeof e=="object"&&e!==null&&"access_token"in e&&"refresh_token"in e&&"expires_at"in e}async _handleProviderSignIn(e,r){const n=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:r.redirectTo,scopes:r.scopes,queryParams:r.queryParams});return this._debug("#_handleProviderSignIn()","provider",e,"options",r,"url",n),ie()&&!r.skipBrowserRedirect&&window.location.assign(n),{data:{provider:e,url:n},error:null}}async _recoverAndRefresh(){var e,r;const n="#_recoverAndRefresh()";this._debug(n,"begin");try{const s=await _e(this.storage,this.storageKey);if(s&&this.userStorage){let i=await _e(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!i&&(i={user:s.user},await Ot(this.userStorage,this.storageKey+"-user",i)),s.user=(e=i==null?void 0:i.user)!==null&&e!==void 0?e:qn()}else if(s&&!s.user&&!s.user){const i=await _e(this.storage,this.storageKey+"-user");i&&(i!=null&&i.user)?(s.user=i.user,await re(this.storage,this.storageKey+"-user"),await Ot(this.storage,this.storageKey,s)):s.user=qn()}if(this._debug(n,"session from storage",s),!this._isValidSession(s)){this._debug(n,"session is not valid"),s!==null&&await this._removeSession();return}const o=((r=s.expires_at)!==null&&r!==void 0?r:1/0)*1e3-Date.now()<Wn;if(this._debug(n,`session has${o?"":" not"} expired with margin of ${Wn}s`),o){if(this.autoRefreshToken&&s.refresh_token){const{error:i}=await this._callRefreshToken(s.refresh_token);i&&(Kv(i)?this._debug(n,"refresh discarded by commit guard",i):this._debug(n,"refresh failed",i))}}else if(s.user&&s.user.__isUserNotAvailableProxy===!0)try{const{data:i,error:a}=await this._getUser(s.access_token);!a&&(i!=null&&i.user)?(s.user=i.user,await this._saveSession(s),await this._notifyAllSubscribers("SIGNED_IN",s)):this._debug(n,"could not get user data, skipping SIGNED_IN notification")}catch(i){console.error("Error getting user data:",i),this._debug(n,"error getting user data, skipping SIGNED_IN notification",i)}else await this._notifyAllSubscribers("SIGNED_IN",s)}catch(s){this._debug(n,"error",s),console.error(s);return}finally{this._debug(n,"end")}}async _callRefreshToken(e){var r,n;if(!e)throw new se;if(this.refreshingDeferred)return this.refreshingDeferred.promise;if(this.lastRefreshFailure&&this.lastRefreshFailure.refreshToken===e&&Date.now()<this.lastRefreshFailure.expiresAt)return this._debug("#_callRefreshToken()","returning cached failure (cooldown active)"),this.lastRefreshFailure.result;const s="#_callRefreshToken()";this._debug(s,"begin");try{this.refreshingDeferred=new Rn;const o=await _e(this.storage,this.storageKey),{data:i,error:a}=await this._refreshAccessToken(e);if(a)throw a;if(!i.session)throw new se;const l=await _e(this.storage,this.storageKey);if(o!==null&&(l===null||l.refresh_token!==o.refresh_token)){this._debug(s,"commit guard: storage changed since refresh started, discarding rotated tokens",{startedWith:"present",nowHolds:l?"replaced":"cleared"});const m={data:null,error:new ui};return this.refreshingDeferred.resolve(m),m}const d=this._sessionRemovalEpoch;if(await this._saveSession(i.session),this._sessionRemovalEpoch!==d){this._debug(s,"commit guard (post-save): _removeSession ran during _saveSession, und
31oing write"),await re(this.storage,this.storageKey),this.userStorage&&await re(this.userStorage,this.storageKey+"-user");const m={data:null,error:new ui};return this.refreshingDeferred.resolve(m),m}await this._notifyAllSubscribers("TOKEN_REFRESHED",i.session);const h={data:i.session,error:null};return this.lastRefreshFailure=null,this.refreshingDeferred.resolve(h),h}catch(o){if(this._debug(s,"error",o),A(o)){const i={data:null,error:o};if(!ci(o)){const a=await _e(this.storage,this.storageKey);!!(a!=null&&a.expires_at&&a.expires_at*1e3>Date.now())?this._debug(s,"proactive refresh failed, access token still valid — preserving session"):await this._removeSession()}return this.lastRefreshFailure={refreshToken:e,result:i,expiresAt:Date.now()+Dv},(r=this.refreshingDeferred)===null||r===void 0||r.resolve(i),i}throw(n=this.refreshingDeferred)===null||n===void 0||n.reject(o),o}finally{this.refreshingDeferred=null,this._debug(s,"end")}}async _notifyAllSubscribers(e,r,n=!0){const s=`#_notifyAllSubscribers(${e})`;this._debug(s,"begin",r,`broadcast = ${n}`);try{this.broadcastChannel&&n&&this.broadcastChannel.postMessage({event:e,session:r});const o=[],i=Array.from(this.stateChangeEmitters.values()).map(async a=>{try{await a.callback(e,r)}catch(l){o.push(l)}});if(await Promise.all(i),o.length>0){for(let a=0;a<o.length;a+=1)console.error(o[a]);throw o[0]}}finally{this._debug(s,"end")}}async _saveSession(e){this._debug("#_saveSession()",e),this.suppressGetSessionWarning=!0,await re(this.storage,`${this.storageKey}-code-verifier`);const r=Object.assign({},e),n=r.user&&r.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!n&&r.user&&await Ot(this.userStorage,this.storageKey+"-user",{user:r.user});const s=Object.assign({},r);delete s.user;const o=mi(s);await Ot(this.storage,this.storageKey,o)}else{const s=mi(r);await Ot(this.storage,this.storageKey,s)}}async _removeSession(){this._sessionRemovalEpoch+=1,this._debug("#_removeSession()"),this.lastRefreshFailure=null,this.suppressGetSessionWarning=!1,await re(this.storage,this.storageKey),await re(this.storage,this.storageKey+"-code-verifier"),await re(this.storage,this.storageKey+"-user"),this.userStorage&&await re(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&ie()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",e)}catch(r){console.error("removing visibilitychange callback failed",r)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const e=setInterval(()=>this._autoRefreshTokenTick(),He);this.autoRefreshTicker=e,e&&typeof e=="object"&&typeof e.unref=="function"?e.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(e);const r=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=r,r&&typeof r=="object"&&typeof r.unref=="function"?r.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(r)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e);const r=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,r&&clearTimeout(r)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async dispose(){var e;this._removeVisibilityChangedCallback(),await this._stopAutoRefresh(),(e=this.broadcastChannel)===null||e===void 0||e.close(),this.broadcastChannel=null,this.stateChangeEmitters.clear()}async _autoRefreshTokenTick(){if(this._debug("#_autoRefreshTokenTick()","begin"),this.lock!=null){try{await this._acquireLock(0,async()=>{try{const e=Date.now();try{return await this._useSession(async r=>{const{data:{session:n}}=r;if(!n||!n.refresh_token||!n.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const s=Math.floor((n.expires_at*1e3-e)/He);this._debug("#_autoRefreshTokenTick()",`access token expires in ${s} ticks, a tick lasts ${He}ms, refresh threshold is ${Xt} ticks`),s<=Xt&&await this._callRefreshToken(n.refresh_token)})}catch(r){console.error("Auto refresh tick failed with error. This is likely a transient error.",r)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(e){if(e instanceof _y)this._debug("auto refresh token tick lock not available");else throw e}return}if(this.refreshingDeferred!==null){this._debug("#_autoRefreshTokenTick()","refresh already in flight, skipping");return}try{const e=Date.now();try{await this._useSession(async r=>{const{data:{session:n}}=r;if(!n||!n.refresh_token||!n.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const s=Math.floor((n.expires_at*1e3-e)/He);this._debug("#_autoRefreshTokenTick()",`access token expires in ${s} ticks, a tick lasts ${He}ms, refresh threshold is ${Xt} ticks`),s<=Xt&&await this._callRefreshToken(n.refresh_token)})}catch(r){console.error("Auto refresh tick failed with error. This is likely a transient error.",r)}}finally{this._debug("#_autoRefreshTokenTick()","end")}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!ie()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(e){this._debug("#visibilityChangedCallback","error",e)}},window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error("_handleVisibilityChange",e)}}async _onVisibilityChanged(e){const r=`#_onVisibilityChanged(${e})`;if(this._debug(r,"visibilityState",document.visibilityState),document.visibilityState==="visible"){if(this.autoRefreshToken&&this._startAutoRefresh(),!e)if(await this.initializePromise,this.lock!=null)await this._acquireLock(this.lockAcquireTimeout,async()=>
31{if(document.visibilityState!=="visible"){this._debug(r,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()});else{if(document.visibilityState!=="visible"){this._debug(r,"visibilityState is no longer visible, skipping recovery");return}await this._recoverAndRefresh()}}else document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,r,n){const s=[`provider=${encodeURIComponent(r)}`];if(n!=null&&n.redirectTo&&s.push(`redirect_to=${encodeURIComponent(n.redirectTo)}`),n!=null&&n.scopes&&s.push(`scopes=${encodeURIComponent(n.scopes)}`),this.flowType==="pkce"){const[o,i]=await ut(this.storage,this.storageKey),a=new URLSearchParams({code_challenge:`${encodeURIComponent(o)}`,code_challenge_method:`${encodeURIComponent(i)}`});s.push(a.toString())}if(n!=null&&n.queryParams){const o=new URLSearchParams(n.queryParams);s.push(o.toString())}return n!=null&&n.skipBrowserRedirect&&s.push(`skip_http_redirect=${n.skipBrowserRedirect}`),`${e}?${s.join("&")}`}async _unenroll(e){try{return await this._useSession(async r=>{var n;const{data:s,error:o}=r;return o?this._returnResult({data:null,error:o}):await O(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:(n=s==null?void 0:s.session)===null||n===void 0?void 0:n.access_token})})}catch(r){if(A(r))return this._returnResult({data:null,error:r});throw r}}async _enroll(e){try{return await this._useSession(async r=>{var n,s;const{data:o,error:i}=r;if(i)return this._returnResult({data:null,error:i});const a=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},e.factorType==="phone"?{phone:e.phone}:e.factorType==="totp"?{issuer:e.issuer}:{}),{data:l,error:u}=await O(this.fetch,"POST",`${this.url}/factors`,{body:a,headers:this.headers,jwt:(n=o==null?void 0:o.session)===null||n===void 0?void 0:n.access_token});return u?this._returnResult({data:null,error:u}):(e.factorType==="totp"&&l.type==="totp"&&(!((s=l==null?void 0:l.totp)===null||s===void 0)&&s.qr_code)&&(l.totp.qr_code=`data:image/svg+xml;utf-8,${l.totp.qr_code}`),this._returnResult({data:l,error:null}))})}catch(r){if(A(r))return this._returnResult({data:null,error:r});throw r}}async _verify(e){const r=async()=>{try{return await this._useSession(async n=>{var s;const{data:o,error:i}=n;if(i)return this._returnResult({data:null,error:i});const a=Object.assign({challenge_id:e.challengeId},"webauthn"in e?{webauthn:Object.assign(Object.assign({},e.webauthn),{credential_response:e.webauthn.type==="create"?_i(e.webauthn.credential_response):Ei(e.webauthn.credential_response)})}:{code:e.code}),{data:l,error:u}=await O(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:a,headers:this.headers,jwt:(s=o==null?void 0:o.session)===null||s===void 0?void 0:s.access_token});return u?this._returnResult({data:null,error:u}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+l.expires_in},l)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",l),this._returnResult({data:l,error:u}))})}catch(n){if(A(n))return this._returnResult({data:null,error:n});throw n}};return this.lock!=null?this._acquireLock(this.lockAcquireTimeout,r):r()}async _challenge(e){const r=async()=>{try{return await this._useSession(async n=>{var s;const{data:o,error:i}=n;if(i)return this._returnResult({data:null,error:i});const a=await O(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{body:e,headers:this.headers,jwt:(s=o==null?void 0:o.session)===null||s===void 0?void 0:s.access_token});if(a.error)return a;const{data:l}=a;if(l.type!=="webauthn")return{data:l,error:null};switch(l.webauthn.type){case"create":return{data:Object.assign(Object.assign({},l),{webauthn:Object.assign(Object.assign({},l.webauthn),{credential_options:Object.assign(Object.assign({},l.webauthn.credential_options),{publicKey:wi(l.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},l),{webauthn:Object.assign(Object.assign({},l.webauthn),{credential_options:Object.assign(Object.assign({},l.webauthn.credential_options),{publicKey:xi(l.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(n){if(A(n))return this._returnResult({data:null,error:n});throw n}};return this.lock!=null?this._acquireLock(this.lockAcquireTimeout,r):r()}async _challengeAndVerify(e){const{data:r,error:n}=await this._challenge({factorId:e.factorId});return n?this._returnResult({data:null,error:n}):await this._verify({factorId:e.factorId,challengeId:r.id,code:e.code})}async _listFactors(){var e;const{data:{user:r},error:n}=await this.getUser();if(n)return{data:null,error:n};const s={all:[],phone:[],totp:[],webauthn:[]};for(const o of(e=r==null?void 0:r.factors)!==null&&e!==void 0?e:[])s.all.push(o),o.status==="verified"&&s[o.factor_type].push(o);return{data:s,error:null}}async _getAuthenticatorAssuranceLevel(e){var r,n,s,o;if(e)try{const{payload:p}=Mr(e);let v=null;p.aal&&(v=p.aal);let g=v;const{data:{user:y},error:x}=await this.getUser(e);if(x)return this._returnResult({data:null,error:x});((n=(r=y==null?void 0:y.factors)===null||r===void 0?void 0:r.filter(_=>_.status==="verified"))!==null&&n!==void 0?n:[]).length>0&&(g="aal2");const w=p.amr||[];return{data:{currentLevel:v,nextLevel:g,currentAuthenticationMethods:w},error:null}}catch(p){if(A(p))return this._returnResult({data:null,error:p});throw p}const{data:{session:i},error:a}
31=await this.getSession();if(a)return this._returnResult({data:null,error:a});if(!i)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:l}=Mr(i.access_token);let u=null;l.aal&&(u=l.aal);let d=u;((o=(s=i.user.factors)===null||s===void 0?void 0:s.filter(p=>p.status==="verified"))!==null&&o!==void 0?o:[]).length>0&&(d="aal2");const m=l.amr||[];return{data:{currentLevel:u,nextLevel:d,currentAuthenticationMethods:m},error:null}}async _getAuthorizationDetails(e){try{return await this._useSession(async r=>{const{data:{session:n},error:s}=r;return s?this._returnResult({data:null,error:s}):n?await O(this.fetch,"GET",`${this.url}/oauth/authorizations/${e}`,{headers:this.headers,jwt:n.access_token,xform:o=>({data:o,error:null})}):this._returnResult({data:null,error:new se})})}catch(r){if(A(r))return this._returnResult({data:null,error:r});throw r}}async _approveAuthorization(e,r){try{return await this._useSession(async n=>{const{data:{session:s},error:o}=n;if(o)return this._returnResult({data:null,error:o});if(!s)return this._returnResult({data:null,error:new se});const i=await O(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:s.access_token,body:{action:"approve"},xform:a=>({data:a,error:null})});return i.data&&i.data.redirect_url&&ie()&&!(r!=null&&r.skipBrowserRedirect)&&window.location.assign(i.data.redirect_url),i})}catch(n){if(A(n))return this._returnResult({data:null,error:n});throw n}}async _denyAuthorization(e,r){try{return await this._useSession(async n=>{const{data:{session:s},error:o}=n;if(o)return this._returnResult({data:null,error:o});if(!s)return this._returnResult({data:null,error:new se});const i=await O(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:s.access_token,body:{action:"deny"},xform:a=>({data:a,error:null})});return i.data&&i.data.redirect_url&&ie()&&!(r!=null&&r.skipBrowserRedirect)&&window.location.assign(i.data.redirect_url),i})}catch(n){if(A(n))return this._returnResult({data:null,error:n});throw n}}async _listOAuthGrants(){try{return await this._useSession(async e=>{const{data:{session:r},error:n}=e;return n?this._returnResult({data:null,error:n}):r?await O(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,xform:s=>({data:s,error:null})}):this._returnResult({data:null,error:new se})})}catch(e){if(A(e))return this._returnResult({data:null,error:e});throw e}}async _revokeOAuthGrant(e){try{return await this._useSession(async r=>{const{data:{session:n},error:s}=r;return s?this._returnResult({data:null,error:s}):n?(await O(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,query:{client_id:e.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new se})})}catch(r){if(A(r))return this._returnResult({data:null,error:r});throw r}}async fetchJwk(e,r={keys:[]}){let n=r.keys.find(a=>a.kid===e);if(n)return n;const s=Date.now();if(n=this.jwks.keys.find(a=>a.kid===e),n&&this.jwks_cached_at+Hv>s)return n;const{data:o,error:i}=await O(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(i)throw i;return!o.keys||o.keys.length===0||(this.jwks=o,this.jwks_cached_at=s,n=o.keys.find(a=>a.kid===e),!n)?null:n}async getClaims(e,r={}){try{let n=e;if(!n){const{data:p,error:v}
31=await this.getSession();if(v||!p.session)return this._returnResult({data:null,error:v});n=p.session.access_token}const{header:s,payload:o,signature:i,raw:{header:a,payload:l}}=Mr(n);if(!(r!=null&&r.allowExpired))try{dy(o.exp)}catch(p){throw new dn(p instanceof Error?p.message:"JWT validation failed")}const u=!s.alg||s.alg.startsWith("HS")||!s.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(s.kid,r!=null&&r.keys?{keys:r.keys}:r==null?void 0:r.jwks);if(!u){const{error:p}=await this.getUser(n);if(p)throw p;return{data:{claims:o,header:s,signature:i},error:null}}const d=hy(s.alg),h=await crypto.subtle.importKey("jwk",u,d,!0,["verify"]);if(!await crypto.subtle.verify(d,h,i,Qv(`${a}.${l}`)))throw new dn("Invalid JWT signature");return{data:{claims:o,header:s,signature:i},error:null}}catch(n){if(A(n))return this._returnResult({data:null,error:n});throw n}}async signInWithPasskey(e){var r,n,s;Ee(this.experimental);try{if(!pn())return this._returnResult({data:null,error:new ke("Browser does not support WebAuthn",null)});const{data:o,error:i}=await this._startPasskeyAuthentication({options:{captchaToken:(r=e==null?void 0:e.options)===null||r===void 0?void 0:r.captchaToken}});if(i||!o)return this._returnResult({data:null,error:i});const a=xi(o.options),l=(s=(n=e==null?void 0:e.options)===null||n===void 0?void 0:n.signal)!==null&&s!==void 0?s:As.createNewAbortSignal(),{data:u,error:d}=await Hl({publicKey:a,signal:l});if(d||!u)return this._returnResult({data:null,error:d??new ke("WebAuthn ceremony failed",null)});const h=Ei(u);return this._verifyPasskeyAuthentication({challengeId:o.challenge_id,credential:h})}catch(o){if(A(o))return this._returnResult({data:null,error:o});throw o}}async registerPasskey(e){var r,n;Ee(this.experimental);try{if(!pn())return this._returnResult({data:null,error:new ke("Browser does not support WebAuthn",null)});const{data:s,error:o}=await this._startPasskeyRegistration();if(o||!s)return this._returnResult({data:null,error:o});const i=wi(s.options),a=(n=(r=e==null?void 0:e.options)===null||r===void 0?void 0:r.signal)!==null&&n!==void 0?n:As.createNewAbortSignal(),{data:l,error:u}=await Fl({publicKey:i,signal:a});if(u||!l)return this._returnResult({data:null,error:u??new ke("WebAuthn ceremony failed",null)});const d=_i(l);return this._verifyPasskeyRegistration({challengeId:s.challenge_id,credential:d})}catch(s){if(A(s))return this._returnResult({data:null,error:s});throw s}}async _startPasskeyRegistration(){Ee(this.experimental);try{return await this._useSession(async e=>{const{data:{session:r},error:n}=e;if(n)return this._returnResult({data:null,error:n});if(!r)return this._returnResult({data:null,error:new se});const{data:s,error:o}=await O(this.fetch,"POST",`${this.url}/passkeys/registration/options`,{headers:this.headers,jwt:r.access_token,body:{}});return o?this._returnResult({data:null,error:o}):this._returnResult({data:s,error:null})})}catch(e){if(A(e))return this._returnResult({data:null,error:e});throw e}}async _verifyPasskeyRegistration(e){Ee(this.experimental);try{return await this._useSession(async r=>{const{data:{session:n},error:s}=r;if(s)return this._returnResult({data:null,error:s});if(!n)return this._returnResult({data:null,error:new se});const{data:o,error:i}=await O(this.fetch,"POST",`${this.url}/passkeys/registration/verify`,{headers:this.headers,jwt:n.access_token,body:{challenge_id:e.challengeId,credential:e.credential}});return i?this._returnResult({data:null,error:i}):this._returnResult({data:o,error:null})})}catch(r){if(A(r))return this._returnResult({data:null,error:r});throw r}}async _startPasskeyAuthentication(e){var r;Ee(this.experimental);try{const{data:n,error:s}=await O(this.fetch,"POST",`${this.url}/passkeys/authentication/options`,{headers:this.headers,body:{gotrue_meta_security:{captcha_token:(r=e==null?void 0:e.options)===null||r===void 0?void 0:r.captchaToken}}});return s?this._returnResult({data:null,error:s}):this._returnResult({data:n,error:null})}catch(n){if(A(n))return this._returnResult({data:null,error:n});throw n}}async _verifyPasskeyAuthentication(e){Ee(this.experimental);try{const{data:r,error:n}=await O(this.fetch,"POST",`${this.url}/passkeys/authentication/verify`,{headers:this.headers,body:{challenge_id:e.challengeId,credential:e.credential},xform:ve});return n?this._returnResult({data:null,error:n}):(r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),this._returnResult({data:r,error:null}))}catch(r){if(A(r))return this._returnResult({data:null,error:r});throw r}}async _listPasskeys(){Ee(this.experimental);try{return await this._useSession(async e=>{const{data:{session:r},error:n}=e;if(n)return this._returnResult({data:null,error:n});if(!r)return this._returnResult({data:null,error:new se});const{data:s,error:o}=await O(this.fetch,"GET",`${this.url}/passkeys`,{headers:this.headers,jwt:r.access_token,xform:i=>({data:i,error:null})});return o?this._returnResult({data:null,error:o}):this._returnResult({data:s,error:null})})}catch(e){if(A(e))return this._returnResult({data:null,error:e});throw e}}async _updatePasskey(e){Ee(this.experimental);try{return await this._useSession(async r=>{const{data:{session:n},error:s}=r;if(s)return this._returnResult({data:null,error:s});if(!n)return this._returnResult({data:null,error:new se});const{data:o,error:i}=await O(this.fetch,"PATCH",`${this.url}/passkeys/${e.passkeyId}`,{headers:this.headers,jwt:n.access_token,body:{friendly_name:e.friendlyName}});return i?this._returnResult({data:null,error:i}):this._returnResult({data:o,error:null})})}catch(r){if(A(r))return this._returnResult({data:null,error:r});throw r}}async _deletePasskey(e){Ee(this.experimental);try{return await this._useSession(async r=>{const{data:{session:n},error:s}=r;if(s)return this._returnResult({data:null,error:s});if(!n)return this._returnResult({data:null,error:new se});const{error:o}
31=await O(this.fetch,"DELETE",`${this.url}/passkeys/${e.passkeyId}`,{headers:this.headers,jwt:n.access_token,noResolveJson:!0});return o?this._returnResult({data:null,error:o}):this._returnResult({data:null,error:null})})}catch(r){if(A(r))return this._returnResult({data:null,error:r});throw r}}}pr.nextInstanceID={};const $y=pr,Dy="2.110.0";let Qt="",gn;if(typeof Deno<"u"){var Kn;Qt="deno",gn=(Kn=Deno.version)===null||Kn===void 0?void 0:Kn.deno}else if(typeof document<"u")Qt="web";else if(typeof navigator<"u"&&navigator.product==="ReactNative")Qt="react-native";else{var Jn;Qt="node",gn=typeof process<"u"?(Jn=process.version)===null||Jn===void 0?void 0:Jn.replace(/^v/,""):void 0}const Vl=[`runtime=${Qt}`];gn&&Vl.push(`runtime-version=${gn}`);const My={"X-Client-Info":`supabase-js/${Dy}; ${Vl.join("; ")}`},Uy={headers:My},By={schema:"public"},Fy={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},Hy={},Vy={enabled:!1,respectSamplingDecision:!0};function Wy(t,e,r,n){function s(o){return o instanceof r?o:new r(function(i){i(o)})}return new(r||(r=Promise))(function(o,i){function a(d){try{u(n.next(d))}catch(h){i(h)}}function l(d){try{u(n.throw(d))}catch(h){i(h)}}function u(d){d.done?o(d.value):s(d.value).then(a,l)}u((n=n.apply(t,[])).next())})}let Gn=null;const qy="@opentelemetry/api";function zy(){return Gn===null&&(Gn=import(qy).catch(()=>null)),Gn}function Ky(){return Wy(this,void 0,void 0,function*(){try{const t=yield zy();if(!t||!t.propagation||!t.context)return null;const e={};t.propagation.inject(t.context.active(),e);const r=e.traceparent;return r?{traceparent:r,tracestate:e.tracestate,baggage:e.baggage}:null}catch{return null}})}function Jy(t){if(!t||typeof t!="string")return null;const e=t.split("-");if(e.length!==4)return null;const[r,n,s,o]=e;if(r.length!==2||n.length!==32||s.length!==16||o.length!==2)return null;const i=/^[0-9a-f]+$/i;return!i.test(r)||!i.test(n)||!i.test(s)||!i.test(o)||n==="00000000000000000000000000000000"||s==="0000000000000000"?null:{version:r,traceId:n,parentId:s,traceFlags:o,isSampled:(parseInt(o,16)&1)===1}}function Gy(t,e){if(!t||!e||e.length===0)return!1;let r;if(t instanceof URL)r=t;else try{r=new URL(t)}catch{return!1}for(const n of e)try{if(typeof n=="string"){if(Yy(r.hostname,n))return!0}else if(n instanceof RegExp){if(n.test(r.hostname))return!0}else if(typeof n=="function"&&n(r))return!0}catch{continue}return!1}function Yy(t,e){if(e===t)return!0;if(e.startsWith("*.")){const r=e.slice(2);if(t.endsWith(r)&&(t===r||t.endsWith("."+r)))return!0}return!1}function Xy(t){const e=[];try{const r=new URL(t);e.push(r.hostname)}catch{}return e.push("*.supabase.co","*.supabase.in"),e.push("localhost","127.0.0.1","[::1]"),e}function mr(t){"@babel/helpers - typeof";return mr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},mr(t)}function Qy(t,e){if(mr(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(mr(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Zy(t){var e=Qy(t,"string");return mr(e)=="symbol"?e:e+""}function eb(t,e,r){return(e=Zy(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Si(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function te(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Si(Object(r),!0).forEach(function(n){eb(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Si(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}const tb=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),rb=()=>Headers,nb=(t,e,r,n,s)=>{const o=tb(n),i=rb(),a=(s==null?void 0:s.enabled)===!0,l=(s==null?void 0:s.respectSamplingDecision)!==!1,u=a?Xy(e):null;return async(d,h)=>{var m;const p=(m=await r())!==null&&m!==void 0?m:t;let v=new i(h==null?void 0:h.headers);if(v.has("apikey")||v.set("apikey",t),v.has("Authorization")||v.set("Authorization",`Bearer ${p}`),u){const g=await sb(d,u,l);g&&(g.traceparent&&!v.has("traceparent")&&v.set("traceparent",g.traceparent),g.tracestate&&!v.has("tracestate")&&v.set("tracestate",g.tracestate),g.baggage&&!v.has("baggage")&&v.set("baggage",g.baggage))}return o(d,te(te({},h),{},{headers:v}))}};
31async function sb(t,e,r){if(!Gy(typeof t=="string"||t instanceof URL?t:t.url,e))return null;const n=await Ky();if(!n||!n.traceparent)return null;if(r){const s=Jy(n.traceparent);if(s&&!s.isSampled)return null}return n}function ki(t){return typeof t=="boolean"?{enabled:t}:t}function ob(t){return t.endsWith("/")?t:t+"/"}function ib(t,e){var r,n,s,o,i,a;const{db:l,auth:u,realtime:d,global:h}=t,{db:m,auth:p,realtime:v,global:g}=e,y=ki(t.tracePropagation),x=ki(e.tracePropagation),b={db:te(te({},m),l),auth:te(te({},p),u),realtime:te(te({},v),d),storage:{},global:te(te(te({},g),h),{},{headers:te(te({},(r=g==null?void 0:g.headers)!==null&&r!==void 0?r:{}),(n=h==null?void 0:h.headers)!==null&&n!==void 0?n:{})}),tracePropagation:{enabled:(s=(o=y==null?void 0:y.enabled)!==null&&o!==void 0?o:x==null?void 0:x.enabled)!==null&&s!==void 0?s:!1,respectSamplingDecision:(i=(a=y==null?void 0:y.respectSamplingDecision)!==null&&a!==void 0?a:x==null?void 0:x.respectSamplingDecision)!==null&&i!==void 0?i:!0},accessToken:async()=>""};return t.accessToken?b.accessToken=t.accessToken:delete b.accessToken,b}function ab(t){const e=t==null?void 0:t.trim();if(!e)throw new Error("supabaseUrl is required.");if(!e.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(ob(e))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var lb=class extends $y{constructor(t){super(t)}},cb=class{constructor(t,e,r){var n,s;this.supabaseUrl=t,this.supabaseKey=e;const o=ab(t);if(!e)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",o),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",o),this.storageUrl=new URL("storage/v1",o),this.functionsUrl=new URL("functions/v1",o);const i=`sb-${o.hostname.split(".")[0]}-auth-token`,a={db:By,realtime:Hy,auth:te(te({},Fy),{},{storageKey:i}),global:Uy,tracePropagation:Vy},l=ib(r??{},a);if(this.settings=l,this.storageKey=(n=l.auth.storageKey)!==null&&n!==void 0?n:"",this.headers=(s=l.global.headers)!==null&&s!==void 0?s:{},l.accessToken)this.accessToken=l.accessToken,this.auth=new Proxy({},{get:(d,h)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(h)} is not possible`)}});else{var u;this.auth=this._initSupabaseAuthClient((u=l.auth)!==null&&u!==void 0?u:{},this.headers,l.global.fetch)}this.fetch=nb(e,t,this._getAccessToken.bind(this),l.global.fetch,l.tracePropagation),this.realtime=this._initRealtimeClient(te({headers:this.headers,accessToken:this._getAccessToken.bind(this),fetch:this.fetch},l.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(d=>this.realtime.setAuth(d)).catch(d=>console.warn("Failed to set initial Realtime auth token:",d)),this.rest=new yg(new URL("rest/v1",o).href,{headers:this.headers,schema:l.db.schema,fetch:this.fetch,timeout:l.db.timeout,urlLengthLimit:l.db.urlLengthLimit}),this.storage=new $v(this.storageUrl.href,this.headers,this.fetch,r==null?void 0:r.storage),l.accessToken||this._listenForAuthEvents()}get functions(){return new cg(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(t){return this.rest.from(t)}schema(t){return this.rest.schema(t)}rpc(t,e={},r={head:!1,get:!1,count:void 0}){return this.rest.rpc(t,e,r)}channel(t,e={config:{}}){return this.realtime.channel(t,e)}getChannels(){return this.realtime.getChannels()}removeChannel(t){return this.realtime.removeChannel(t)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var t=this,e,r;if(t.accessToken)return await t.accessToken();const{data:n}=await t.auth.getSession();return(e=(r=n.session)===null||r===void 0?void 0:r.access_token)!==null&&e!==void 0?e:t.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:t,persistSession:e,detectSessionInUrl:r,storage:n,userStorage:s,storageKey:o,flowType:i,lock:a,debug:l,throwOnError:u,experimental:d,lockAcquireTimeout:h,skipAutoInitialize:m},p,v){const g={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new lb({url:this.authUrl.href,headers:te(te({},g),p),storageKey:o,autoRefreshToken:t,persistSession:e,detectSessionInUrl:r,storage:n,userStorage:s,flowType:i,lock:a,debug:l,throwOnError:u,experimental:d,fetch:v,lockAcquireTimeout:h,skipAutoInitialize:m,hasCustomAuthorizationHeader:Object.keys(this.headers).some(y=>y.toLowerCase()==="authorization")})}_initRealtimeClient(t){return new iv(this.realtimeUrl.href,te(te({},t),{},{params:te(te({},{apikey:this.supabaseKey}),t==null?void 0:t.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((t,e)=>{this._handleTokenChanged(t,"CLIENT",e==null?void 0:e.access_token)})}_handleTokenChanged(t,e,r){(t==="TOKEN_REFRESHED"||t==="SIGNED_IN")&&this.changedAccessToken!==r?(this.changedAccessToken=r,this.realtime.setAuth(r)):t==="SIGNED_OUT"&&(this.realtime.setAuth(),e=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};const ub=(t,e,r)=>new cb(t,e,r);function db(){if(typeof window<"u")return!1;const t=globalThis.process;if(!t)return!1;const e=t.version;if(e==null)return!1;const r=e.match(/^v(\d+)\./);return r?parseInt(r[1],10)<=20:!1}db()&&console.warn("⚠️  Node.js 20 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to N
31ode.js 22 or later. For more information, visit: https://github.com/orgs/supabase/discussions/45715");function hb(){var y,x;if(typeof window>"u")return;const t=location.hostname,r=["lovableproject.com","lovableproject-dev.com","lovable.app","gpt-eng.com","gptengineer.run"].some(b=>t===b||t.endsWith("."+b)),n="[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}",s=r?((y=t.match(new RegExp("^(?:id-preview(?:-[a-z0-9]+)?|project)--("+n+")(?:-dev)?(?=\\.|$)","i")))==null?void 0:y[1])??((x=t.match(new RegExp("^("+n+")(?=[.-])","i")))==null?void 0:x[1]):void 0,o=window.parent&&window.parent!==window;if(!s||!o)return localStorage;const i=t.endsWith(".lovableproject-dev.com")||t.endsWith(".gpt-eng.com"),a=i?/^https:\/\/([a-z0-9-]+\.)*(lovable\.dev|gptengineer\.app)$|^http:\/\/localhost:3000$/:/^https:\/\/([a-z0-9-]+\.)*(lovable\.dev|gptengineer\.app)$/,l=location.ancestorOrigins&&location.ancestorOrigins[0]||(document.referrer?new URL(document.referrer).origin:""),u=l&&a.test(l)?[l]:i?["https://lovable.dev","http://localhost:3000"]:["https://lovable.dev"],d="lovable-preview-auth:result",h=2e3,m=()=>Math.random().toString(36).slice(2)+Date.now().toString(36),p=(b,w,_)=>new Promise(S=>{const k=m();let E=!1,$;const L=M=>{E||(E=!0,clearTimeout($),window.removeEventListener("message",B),S(M))},B=M=>{if(u.indexOf(M.origin)<0)return;const q=M.data;q&&q.type===d&&q.requestId===k&&L(q)};window.addEventListener("message",B);const F={type:b,requestId:k,projectId:s,key:w};_!==void 0&&(F.value=_);for(const M of u)window.parent.postMessage(F,M);$=setTimeout(()=>L(null),h)});let v=!0;const g=250;return{getItem:async b=>{let w=await p("lovable-preview-auth:get",b);return!w&&v&&(await new Promise(_=>setTimeout(_,g)),w=await p("lovable-preview-auth:get",b)),v=!1,w&&w.ok&&typeof w.value=="string"?w.value===""?(localStorage.removeItem(b),null):w.value:localStorage.getItem(b)},setItem:(b,w)=>(localStorage.setItem(b,w),p("lovable-preview-auth:set",b,w).then(()=>{})),removeItem:b=>(localStorage.removeItem(b),p("lovable-preview-auth:remove",b).then(()=>{}))}}const fb="https://bgkojpcsuertduonjubz.supabase.co",pb="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImJna29qcGNzdWVydGR1b25qdWJ6Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzE5ODYzNzUsImV4cCI6MjA4NzU2MjM3NX0.2Z-XkSPWwmbriIlFQ_43ICpmZy0d0w53kwf2V-iOTXU",Gs=ub(fb,pb,{auth:{storage:hb(),persistSession:!0,autoRefreshToken:!0}}),Wl="hb_cookie_consent_v1",ql="hb:consent-change",zl="hb:consent-open";function mb(){if(typeof window>"u")return"unset";try{const t=window.localStorage.getItem(Wl);return t==="accepted"||t==="rejected"?t:"unset"}catch{return"unset"}}function Ti(t){if(!(typeof window>"u")){try{window.localStorage.setItem(Wl,t)}catch{}window.dispatchEvent(new CustomEvent(ql,{detail:t}))}}function gb(){typeof window>"u"||window.dispatchEvent(new CustomEvent(zl))}const Ur={change:ql,open:zl},Br={houseboats:[{name:"End of Summer Sale 2026",href:"/end-of-summer-sale-shasta-lake"},{name:"Titan Houseboat",href:"/houseboats/titan"},{name:"Queen Houseboat",href:"/houseboats/queen"},{name:"Compare Houseboats",href:"/compare-houseboats"},{name:"2026 Pricing",href:"/houseboat-rental-prices"}],locations:[{name:"Jones Valley Resort",href:"/jones-valley"},{name:"Silverthorn Resort",href:"/silverthorn"},{name:"About Lake Shasta",href:"/shasta-lake-info/lake-shasta"},{name:"Weather Reports",href:"/shasta-lake-info/weather-reports"},{name:"Marina Store",href:"/marina-store"}],planning:[{name:"Pricing",href:"/houseboat-rental-prices"},{name:"Rental Costs Guide",href:"/houseboat-rental-prices"},{name:"FAQ",href:"/faq"},{name:"Contact Us",href:"/contact-us"},{name:"Boat Slips & Storage",href:"/boat-slips-storage"}],company:[{name:"Contact Us",href:"/contact-us"},{name:"FAQ",href:"/faq"}]},vb=[{name:"Facebook",href:"https://www.facebook.com/houseboats.lakeshasta",label:"Follow Houseboats.com on Facebook",bgClass:"bg-[#1877F2]",icon:c.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:c.jsx("path",{d:"M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"})})},{name:"Instagram",href:"https://www.instagram.com/jonesvalleyresort.houseboats",label:"Follow Houseboats.com on Instagram",bgClass:"bg-gradient-to-br from-purple-600 via-pink-500 to-yellow-500",icon:c.jsx("svg",{viewBox:"0 0 24 24",fill:"
31currentColor","aria-hidden":"true",children:c.jsx("path",{d:"M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zM12 0C8.741 0 8.333.014 7.053.072 2.695.272.273 2.69.073 7.052.014 8.333 0 8.741 0 12c0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98C8.333 23.986 8.741 24 12 24c3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98C15.668.014 15.259 0 12 0zm0 5.838a6.162 6.162 0 100 12.324 6.162 6.162 0 000-12.324zM12 16a4 4 0 110-8 4 4 0 010 8zm6.406-11.845a1.44 1.44 0 100 2.881 1.44 1.44 0 000-2.881z"})})},{name:"TikTok",href:"https://www.tiktok.com/@houseboats.com",label:"Follow Houseboats.com on TikTok",bgClass:"bg-gradient-to-br from-[#00f2ea] to-[#ff0050]",icon:c.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:c.jsx("path",{d:"M12.525.02c1.31-.02 2.61-.01 3.91-.02.08 1.53.63 3.09 1.75 4.17 1.12 1.11 2.7 1.62 4.24 1.79v4.03c-1.44-.05-2.89-.35-4.2-.97-.57-.26-1.1-.59-1.62-.93-.01 2.92.01 5.84-.02 8.75-.08 1.4-.54 2.79-1.35 3.94-1.31 1.92-3.58 3.17-5.91 3.21-1.43.08-2.86-.31-4.08-1.03-2.02-1.19-3.44-3.37-3.65-5.71-.02-.5-.03-1-.01-1.49.18-1.9 1.12-3.72 2.58-4.96 1.66-1.44 3.98-2.13 6.15-1.72.02 1.48-.04 2.96-.04 4.44-.99-.32-2.15-.23-3.02.37-.63.41-1.11 1.04-1.36 1.75-.21.51-.15 1.07-.14 1.61.24 1.64 1.82 3.02 3.5 2.87 1.12-.01 2.19-.66 2.77-1.61.19-.33.4-.67.41-1.06.1-1.79.06-3.57.07-5.36.01-4.03-.01-8.05.02-12.07z"})})},{name:"YouTube",href:"https://www.youtube.com/@houseboatslakeshasta",label:"Subscribe to Houseboats.com on YouTube",bgClass:"bg-[#FF0000]",icon:c.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:c.jsx("path",{d:"M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z"})})},{name:"Pinterest",href:"https://www.pinterest.com/shastalakehouseboats",label:"Follow Houseboats.com on Pinterest",bgClass:"bg-[#E60023]",icon:c.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:c.jsx("path",{d:"M12.017 0C5.396 0 .029 5.367.029 11.987c0 5.079 3.158 9.417 7.618 11.162-.105-.949-.199-2.403.041-3.439.219-.937 1.406-5.957 1.406-5.957s-.359-.72-.359-1.781c0-1.663.967-2.911 2.168-2.911 1.024 0 1.518.769 1.518 1.688 0 1.029-.653 2.567-.992 3.992-.285 1.187.602 2.156 1.775 2.156 2.128 0 3.768-2.245 3.768-5.487 0-2.861-2.063-4.869-5.008-4.869-3.41 0-5.409 2.562-5.409 5.199 0 1.033.394 2.143.889 2.741.099.12.112.225.085.345-.09.375-.293 1.199-.334 1.363-.053.225-.172.271-.401.165-1.495-.69-2.433-2.878-2.433-4.646 0-3.776 2.748-7.252 7.92-7.252 4.158 0 7.392 2.967 7.392 6.923 0 4.135-2.607 7.489-6.233 7.489-1.175 0-2.305-.691-2.691-1.534l-.731 2.79c-.265 1.012-1.002 2.281-1.492 3.045.75.233 1.574.357 2.42.357 6.624 0 11.99-5.367 11.99-11.987C24.007 5.367 18.641.001 12.017.001z"})})}];function yb({link:t}){return c.jsx("a",{href:t.href,target:"_blank",rel:"noopener noreferrer","aria-label":t.label,className:`group inline-flex items-center justify-center w-9 h-9 md:w-10 md:h-10 rounded-full border-2 border-white text-white shadow-md transition-all duration-300 hover:scale-110 hover:shadow-lg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-lake-blue-dark ${t.bgClass}`,children:c.jsx("span",{className:"w-5 h-5 md:w-6 md:h-6 transition-transform duration-300 group-hover:scale-105",children:t.icon})})}function bb(){const[t,e]=f.useState(""),[r,n]=f.useState("idle"),[s,o]=f.useState(""),i=async a=>{if(a.preventDefault(),!!t){n("loading");try{const{data:l,error:u}=await Gs.functions.invoke("subscribe-newsletter",{body:{email:t,source:"footer"}});if(u){n("error"),o("Something went wrong.");return}l!=null&&l.success?(n("success"),o(l.message)):(n("error"),o((l==null?void 0:l.error)||"Subscription failed."))}catch{n("error"),o("Something went wrong.")}}};return c.jsxs("div",{className:"mt-6 pt-6 border-t border-primary-foreground
31/10",children:[c.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[c.jsx("h4",{className:"font-semibold text-primary-foreground",children:"Stay in the Loop"}),c.jsxs("svg",{width:"44",height:"28",viewBox:"0 0 44 28",fill:"none",className:"overflow-visible","aria-hidden":"true",children:[c.jsx("path",{d:"M0 20 Q6 16, 12 20 T24 20 T36 20 T44 20",stroke:"hsl(var(--accent))",strokeOpacity:"0.5",strokeWidth:"1.5",fill:"none",style:{animation:"footer-wave 3s ease-in-out infinite"}}),c.jsx("path",{d:"M0 24 Q6 20, 12 24 T24 24 T36 24 T44 24",stroke:"hsl(var(--accent))",strokeOpacity:"0.3",strokeWidth:"1.2",fill:"none",style:{animation:"footer-wave 3s ease-in-out infinite 0.4s"}}),c.jsxs("g",{style:{animation:"footer-bob 2s ease-in-out infinite"},children:[c.jsx("path",{d:"M16 18 L20 12 L20 18 Z",fill:"currentColor",opacity:"0.7"})," ",c.jsx("path",{d:"M12 18 Q14 22, 28 22 L26 18 Z",fill:"currentColor",opacity:"0.6"})," "]})]})]}),c.jsx("p",{className:"text-xs text-primary-foreground/60 mb-3",children:"Get exclusive deals & Shasta Lake updates"}),r==="success"?c.jsx("p",{className:"text-accent text-sm font-semibold",children:s}):c.jsxs("form",{onSubmit:i,className:"flex gap-2",children:[c.jsx(Ks,{type:"email",placeholder:"Your email",value:t,onChange:a=>e(a.target.value),required:!0,className:"bg-primary-foreground/10 border-primary-foreground/20 text-primary-foreground placeholder:text-primary-foreground/40 h-10 flex-1"}),c.jsx(me,{type:"submit",disabled:r==="loading",size:"sm",className:"bg-accent text-accent-foreground hover:bg-accent/90 h-10 px-4",children:c.jsx(vu,{className:"w-4 h-4"})})]}),r==="error"&&c.jsx("p",{className:"text-red-300 text-xs mt-1",children:s})]})}function Kl(){return c.jsxs("footer",{className:"bg-lake-blue-dark text-primary-foreground",children:[c.jsx("div",{className:"section-container py-16 lg:py-20",children:c.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-8 lg:gap-8",children:[c.jsxs("div",{className:"col-span-2 md:col-span-3 lg:col-span-2",children:[c.jsx(ee,{to:"/",className:"mb-6 inline-block",children:c.jsx("img",{src:xl,alt:"Houseboats.com",className:"h-20 w-auto",width:240,height:80,loading:"lazy",decoding:"async"})}),c.jsx("p",{className:"text-primary-foreground/70 mb-6 max-w-sm",children:"Family-owned since 1990. The premier destination for luxury houseboat rentals on California's beautiful Shasta Lake."}),c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx("p",{className:"text-xs text-primary-foreground/50 uppercase tracking-wide",children:"Jones Valley Resort"}),c.jsxs("a",{href:"tel:1-833-474-2782",className:"flex items-center gap-3 text-primary-foreground/80 hover:text-accent transition-colors",children:[c.jsx(tn,{className:"w-5 h-5"}),"1 833 474-2782"]})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx("p",{className:"text-xs text-primary-foreground/50 uppercase tracking-wide",children:"Silverthorn Resort"}),c.jsxs("a",{href:"tel:1-800-332-3044",className:"flex items-center gap-3 text-primary-foreground/80 hover:text-accent transition-colors",children:[c.jsx(tn,{className:"w-5 h-5"}),"1 800 332-3044"]})]}),c.jsx("div",{className:"space-y-2",children:c.jsxs("a",{href:"mailto:[email protected]",className:"flex items-center gap-3 text-primary-foreground/80 hover:text-accent transition-colors",children:[c.jsx(Qi,{className:"w-5 h-5"}),"[email protected]"]})}),c.jsxs("div",{className:"flex items-center gap-3 text-primary-foreground/80",children:[c.jsx(Ji,{className:"w-5 h-5"}),"22300 Jones Valley Marina Drive, Redding, CA 96003"]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx("p",{className:"text-xs text-primary-foreground/50 uppercase tracking-wide",children:"Follow us"}),c.jsx("div",{className:"flex flex-wrap gap-3",children:vb.map(t=>c.jsx(yb,{link:t},t.name))})]})]}),c.jsx(bb,{})]}),c.jsxs("div",{children:[c.jsx("h4",{className:"font-semibold text-primary-foreground mb-4",children:c.jsx(ee,{to:"/houseboats",className:"hover:text-accent transition-colors",children:"Houseboats"})}),c.jsx("ul",{className:"space-y-2",children:Br.houseboats.map(t=>c.jsx("li",{children:c.jsx(ee,{to:t.href,className:"text-sm text-primary-foreground
31/70 hover:text-accent transition-colors",children:t.name})},t.name))})]}),c.jsxs("div",{children:[c.jsx("h4",{className:"font-semibold text-primary-foreground mb-4",children:"Locations"}),c.jsx("ul",{className:"space-y-2",children:Br.locations.map(t=>c.jsx("li",{children:c.jsx(ee,{to:t.href,className:"text-sm text-primary-foreground/70 hover:text-accent transition-colors",children:t.name})},t.name))})]}),c.jsxs("div",{children:[c.jsx("h4",{className:"font-semibold text-primary-foreground mb-4",children:"Planning"}),c.jsx("ul",{className:"space-y-2",children:Br.planning.map(t=>c.jsx("li",{children:c.jsx(ee,{to:t.href,className:"text-sm text-primary-foreground/70 hover:text-accent transition-colors",children:t.name})},t.name))})]}),c.jsxs("div",{children:[c.jsx("h4",{className:"font-semibold text-primary-foreground mb-4",children:"Company"}),c.jsx("ul",{className:"space-y-2",children:Br.company.map(t=>c.jsx("li",{children:c.jsx(ee,{to:t.href,className:"text-sm text-primary-foreground/70 hover:text-accent transition-colors",children:t.name})},t.name))})]})]})}),c.jsx("div",{className:"border-t border-primary-foreground/10",children:c.jsxs("div",{className:"section-container py-6 flex flex-col md:flex-row items-center justify-between gap-4",children:[c.jsxs("p",{className:"text-sm text-primary-foreground/60",children:["© ",new Date().getFullYear()," Houseboats.com. All rights reserved."]}),c.jsxs("div",{className:"flex items-center gap-4",children:[c.jsx(ee,{to:"/privacy",className:"text-sm text-primary-foreground/60 hover:text-accent transition-colors",children:"Privacy Policy"}),c.jsx(ee,{to:"/terms",className:"text-sm text-primary-foreground/60 hover:text-accent transition-colors",children:"Terms of Service"}),c.jsx("a",{href:"/sitemap.xml",className:"text-sm text-primary-foreground/60 hover:text-accent transition-colors",children:"Sitemap"}),c.jsx(ee,{to:"/accessibility-statement",className:"text-sm text-primary-foreground/60 hover:text-accent transition-colors",children:"Accessibility"}),c.jsx("button",{type:"button",onClick:gb,className:"text-sm text-primary-foreground/60 hover:text-accent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent rounded",children:"Cookie Settings"})]})]})})]})}const qx=Object.freeze(Object.defineProperty({__proto__:null,Footer:Kl},Symbol.toStringTag,{value:"Module"})),wb=f.lazy(()=>R(()=>import("./WhyShastaLake-CflgmY2L.js"),__vite__mapDeps([12,1,2,3])).then(t=>({default:t.WhyShastaLake}))),xb=f.lazy(()=>R(()=>import("./SocialProof-HOBHMmlw.js"),__vite__mapDeps([13,1,2,14,3])).then(t=>({default:t.SocialProof}))),_b=f.lazy(()=>R(()=>import("./CrossSell-Dmhpzx5N.js"),__vite__mapDeps([15,1,2,16,3])).then(t=>({default:t.CrossSell}))),Eb=f.lazy(()=>R(()=>import("./SEOContent-D0qOVDqR.js"),__vite__mapDeps([17,1,2])).then(t=>({default:t.SEOContent}))),Sb=f.lazy(()=>R(()=>import("./ResortLocations-5-v0-mFx.js"),__vite__mapDeps([18,1,2,3])).then(t=>
31({default:t.ResortLocations}))),kb=f.lazy(()=>R(()=>import("./HomepageFAQ-CnxM68xQ.js"),__vite__mapDeps([19,1,2,8,7,3])).then(t=>({default:t.HomepageFAQ}))),Tb=f.lazy(()=>R(()=>import("./WhyChooseOurFleet-B0RlqrnQ.js"),__vite__mapDeps([20,1,2,3])).then(t=>({default:t.WhyChooseOurFleet}))),Yn="End of Summer Sale: 20% off selected houseboats & small boats through 9/30/2026 with code LABOR26. Luxury Shasta Lake houseboat rentals for 6–20 guests from Jones Valley and Silverthorn Resort.",Xn="Shasta Lake Houseboat Rentals — End of Summer Sale 20% Off | Houseboats.com",Rb={"@context":"https://schema.org","@graph":[{"@type":"Offer","@id":"https://houseboats.com/#end-of-summer-offer",name:"End of Summer Sale — 20% off selected houseboats and small boats",description:"20% off new Shasta Lake houseboat and small boat reservations on eligible vessels through September 30, 2026. Promo code LABOR26. Excludes Titan and jet skis. New reservations only, cannot be combined, subject to availability.",url:"https://houseboats.com/compare-houseboats",priceCurrency:"USD",availability:"https://schema.org/LimitedAvailability",validFrom:"2026-08-30",validThrough:"2026-09-30",category:"Houseboat and Small Boat Rental Discount",seller:{"@id":"https://houseboats.com/#organization"}},{"@type":"Product","@id":"https://houseboats.com/houseboats/titan#product",name:"Titan Luxury Houseboat Rental",category:"Houseboat Rental",description:"The ultimate luxury houseboat on Shasta Lake. Sleeps up to 22 guests max with hot tub, waterslide, sky deck, gourmet kitchen, and panoramic mountain views.",image:"https://houseboats.com/assets/titan-luxury-houseboat-aerial-view.jpg",url:"https://houseboats.com/houseboats/titan",mainEntityOfPage:"https://houseboats.com/houseboats/titan",brand:{"@type":"Brand",name:"Houseboats.com"},isRelatedTo:{"@id":"https://houseboats.com/#jones-valley"},offers:{"@type":"AggregateOffer",lowPrice:"7087",highPrice:"22320",priceCurrency:"USD",availability:"https://schema.org/InStock",offerCount:"3",validFrom:"2026-01-01"},aggregateRating:{"@type":"AggregateRating",ratingValue:"4.9",reviewCount:"89",bestRating:"5"}},{"@type":"Product","@id":"https://houseboats.com/houseboats/queen#product",name:"Queen Luxury Houseboat Rental",category:"Houseboat Rental",description:"Our most popular houseboat on Shasta Lake. Sleeps up to 14 guests with hot tub, full kitchen, multiple staterooms, and upper-deck entertaining area.",image:"https://houseboats.com/assets/queen-houseboat-exterior-lifestyle-silverthorn.webp",url:"https://houseboats.com/houseboats/queen",mainEntityOfPage:"https://houseboats.com/houseboats/queen",brand:{"@type":"Brand",name:"Houseboats.com"},isRelatedTo:{"@id":"https://houseboats.com/#silverthorn"},offers:{"@type":"AggregateOffer",lowPrice:"4248",highPrice:"11691",priceCurrency:"USD",availability:"https://schema.org/InStock",offerCount:"3",validFrom:"2026-01-01"},aggregateRating:{"@type":"AggregateRating",ratingValue:"4.8",reviewCount:"156",bestRating:"5"}},{"@type":"Product","@id":"https://houseboats.com/houseboats/senator#product",name:"Senator Houseboat Rental",category:"Houseboat Rental",description:"Exceptional value houseboat on Shasta Lake. Sleeps up to 10 guests with full kitchen, comfortable staterooms, and upper-deck BBQ area.",image:"https://houseboats.com/assets/senator-houseboat-exterior-running-shasta-lake.jpg",url:"https://houseboats.com/houseboats/senator",mainEntityOfPage:"https://houseboats.com/houseboats/senator",brand:{"@type":"Brand",name:"Houseboats.com"},isRelatedTo:{"@id":"https://houseboats.com/#silverthorn"},offers:{"@type":"AggregateOffer",lowPrice:"2392",highPrice:"6175",priceCurrency:"USD",availability:"https://schema.org/InStock",offerCount:"3",validFrom:"2026-01-01"},aggregateRating:{"@type":"AggregateRating",ratingValue:"4.8",reviewCount:"134",bestRating:"5"}},{"@type":"VideoObject","@id":"https://houseboats.com/#hero-video",name:"Shasta Lake Luxury Houseboat Rentals — Aerial Tour",description:"Experience Shasta Lake's crystal-clear waters and luxury houseboats from above. See the Titan, Queen, and Corinthian houseboats at Jones Valley and Silverthorn Resorts.",thumbnailUrl:"https://img.youtube.com/vi/b-yqrntjJdo/maxresdefault.jpg",uploadDate:"2026-02-01",contentUrl:"https://www.youtube.com/watch?v=b-yqrntjJdo",embedUrl:"https://www.youtube.com/embed/b-yqrntjJdo",duration:"PT4M34S",publisher:{"@id":"https://houseboats.com/#organization"},isFamilyFriendly:!0},{"@type":"Product","@id":"https://houseboats.com/houseboats/odyssey#product",name:"Odyssey Houseboat Rental",category:"Houseboat Rental",description:"Luxury houseboat at Jones Valley Resort on Shasta Lake. Sleeps up to 15 guests with hot tub, waterslide, cherry wood gourmet galley.",image:"https://houseboats.com/assets/odyssey-houseboat-exterior-running-shasta-lake.jpg",url:"https://houseboats.com/houseboats/odyssey",mainEntityOfPage:"https://houseboats.com/houseboats/odyssey",brand:{"@type":"Brand",name:"Houseboats.com"},isRelatedTo:{"@id":"https://houseboats.com/#jones-valley"},offers:{"@type":"AggregateOffer",lowPrice:"3265",highPrice:"8462",priceCurrency:"USD",availability:"https://schema.org/InStock",offerCount:"3",validFrom:"2026-01-01"},aggregateRating:{"@type":"AggregateRating",ratingValue:"4.8",reviewCount:"98",bestRating:"5"}},{"@type":"Product","@id":"https://houseboats.com/houseboats/escapade#product",name:"Escapade Houseboat Rental",category:"Houseboat Rental",description:"Luxury houseboat at Jones Valley Resort on Shasta Lake. Sleeps up to 15 guests with hot tub, waterslide, home theater sound system.",image:"https://houseboats.com/assets/escapade-houseboat-hero-profile.jpg",url:"https://houseboats.com/houseboats/escapade",mainEntityOfPage:"https://houseboats.com/houseboats/escapade",brand:{"@type":"Brand",name:"Houseboats.com"},isRelatedTo:{"@id":"https://houseboats.com/#jones-valley"},offers:{"@type":"AggregateOffer",lowPrice:"3811",highPrice:"8731",priceCurrency:"USD",availability:"https://schema.org/InStock",offerCount:"3",validFrom:"2026-01-01"},aggregateRating:{"@type":"AggregateRating",ratingValue:"4.8",reviewCount:"121",bestRating:"5"}},{"@type":"Product","@id":"https://houseboats.com/houseboats/corinthian#product",name:"Corinthian Houseboat Rental",category:"Houseboat Rental",description:"Luxury houseboat at Jones Valley Resort on Shasta Lake. Sleeps up to 12 guests with hot tub, waterslide, sunken gourmet galley.",image:"https://houseboats.com/assets/corinthian-houseboat-jones-valley-resort.jpg",url:"https://houseboats.com/houseboats/corinthian",mainEntityOfPage:"https://houseboats.com/houseboats/corinthian",brand:{"@type":"Brand",name:"Houseboats.com"},isRelatedTo:{"@id":"https://houseboats.com/#jones-valley"},offers:{"@type":"AggregateOffer",lowPrice:"3484",highPrice:"9270",priceCurrency:"USD",availability:"https://schema.org/InStock",offerCount:"3",validFrom:"2026-01-01"},aggregateRating:{"@type":"AggregateRating",ratingValue:"4.8",reviewCount:"112",bestRating:"5"}},{"@type":"Product","@id":"https://houseboats.com/houseboats/queen-i#product",name:"Queen I Houseboat Rental",category:"Houseboat Rental",description:"Luxury houseboat at Silverthorn Resort on Shasta Lake. Sleeps up to 20 guests with hot tub, waterslide, fireplace.",image:"https://houseboats.com/assets/queen-i-houseboat-shasta-lake-01.jpg",url:"https://houseboats.com/houseboats/queen-i",mainEntityOfPage:"https://houseboats.com/houseboats/queen-i",brand:{"@type":"Brand",name:"Houseboats.com"},isRelatedTo:{"@id":"https://houseboats.com/#silverthorn"},offers:{"@type":"AggregateOffer",lowPrice:"4030",highPrice:"10615",priceCurrency:"USD",availability:"https://schema.org/InStock",offerCount:"3",validFrom:"2026-01-01"},aggregateRating:{"@type":"AggregateRating",ratingValue:"4.9",reviewCount:"134",bestRating:"5"}},{"@type":"Product","@id":"https://houseboats.com/houseboats/queen-ii#product",name:"Queen II Houseboat Rental",category:"Houseboat Rental",description:"Luxury houseboat at Silverthorn Resort on Shasta Lake. Sleeps up to 16 guests with hot tub, waterslide, private penthouse suite.",image:"https://houseboats.com/assets/queen-ii-houseboat-silverthorn-resort-shasta-lake-exterior.jpg",url:"https://houseboats.com/houseboats/queen-ii",mainEntityOfPage:"https://houseboats.com/houseboats/queen-ii",brand:{"@type":"Brand",name:"Houseboats.com"},isRelatedTo:{"@id":"https://houseboats.com/#silverthorn"},offers:{"@type":"AggregateOffer",lowPrice:"3811",highPrice:"9808",priceCurrency:"USD",availability:"https://schema.org/InStock",offerCount:"3",validFrom:"2026-01-01"},aggregateRating:{"@type":"AggregateRating",ratingValue:"4.9",reviewCount:"145",bestRating:"5"}},{"@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",position:1,name:"Home",item:"https://houseboats.com/"},{"@type":"ListItem",position:2,name:"Shasta Lake",item:"https://houseboats.com/"}]},{"@type":"TouristAttraction",name:"Houseboats.com — Shasta Lake Houseboat Rentals",description:"Luxury houseboat rentals on Shasta Lake at Jones Valley Resort and Silverthorn Resort. 8 premium houseboat models, hot tubs, waterslides. Northern California.",url:"https://houseboats.com",image:"https://houseboats.com/og-image.jpg",telephone:"+18334742782",priceRange:"$$$$",address:{"@type":"PostalAddress",streetAddress:"22300 Jones Valley Marina Dr",addressLocality:"Redding",addressRegion:"CA",postalCode:"96003",addressCountry:"US"},geo:{"@type":"GeoCoordinates",latitude:40.7361,longitude:-122.2271},openingHours:"Mo-Su 08:00-17:00",sameAs:["https://www.facebook.com/HouseboatsCom","https://www.instagram.com/houseboatscom"]},{"@type":"LocalBusiness","@id":"https://houseboats.com/jones-valley#localbusiness",name:"Jones Valley Resort — Houseboats.com",description:"Full-service marina on the Pit River Arm of Shasta Lake offering luxury houseboat rentals, ski boats, patio boats, jet skis and boat slips.",url:"https://houseboats.com/jones-valley",image:"https://houseboats.com/og-jones-valley.jpg",telephone:"+18334742782",email:"[email protected]",priceRange:"$$$$",parentOrganization:{"@id":"https://houseboats.com/#organization"},address:{"@type":"PostalAddress",streetAddress:"22300 Jones Valley Marina Dr",addressLocality:"Redding",addressRegion:"CA",postalCode:"96003",addressCountry:"US"},geo:{"@type":"GeoCoordinates",latitude:40.7361,longitude:-122.2271},openingHours:"Mo-Su 08:00-17:00"},{"@type":"LocalBusiness","@id":"https://houseboats.com/silverthorn#localbusiness",name:"Silverthorn Resort — Houseboats.com",description:"Full-service marina on the Pit River Arm of Shasta Lake offering luxury houseboat rentals, small boat rentals, moorage and boat slips.",url:"https://houseboats.com/silverthorn",image:"https://houseboats.com/og-silverthorn.jpg",telephone:"+18003323044",email:"[email protected]",priceRange:"$$$$",parentOrganization:{"@id":"https://houseboats.com/#organization"},address:{"@type":"PostalAddress",streetAddress:"16250 Silverthorn Rd",addressLocality:"Redding",addressRegion:"CA",postalCode:"96003",addressCountry:"US"},geo:{"@type":"GeoCoordinates",latitude:40.7086,longitude:-122.2064},openingHours:"Mo-Su 08:00-17:00"},{"@type":"FAQPage","@id":"https://houseboats.com/#faq",mainEntity:[{"@type":"Question",name:"How far in advance should I book a Shasta Lake houseboat for the 2026 season?",acceptedA
31nswer:{"@type":"Answer",text:'For peak summer dates (late June through mid-August) and holiday weekends like Memorial Day or July 4th, we recommend booking 9 to 12 months in advance. Mid-week rentals in "Value Weeks" (May and September) typically have more flexibility and offer up to 30% savings compared to high-season rates.'}},{"@type":"Question",name:"Do I need a boating license or California Boater Card to rent a houseboat on Shasta Lake?",acceptedAnswer:{"@type":"Answer",text:"No. A boating license, boating permit, or California Boater Card is NOT required to rent or operate our boats. However, ALL guests acting as Charter Captain or Co-Captain must complete the Houseboats.com Boater Safety Test before departure. This is a mandatory internal safety policy with NO exemptions, including for guests who already hold a California Boater Card or any other boating certification. The test takes approximately 10 minutes. You'll still need a valid driver's license and must be at least 21 years old (25 for the Titan)."}},{"@type":"Question",name:"What additional costs should I budget for besides the rental price?",acceptedAnswer:{"@type":"Answer",text:"You should budget for three main items: Fuel (roughly $100–$150 per day depending on travel and generator use), a refundable security deposit (ranging from $750 to $5,000 depending on the model), and personal linens. Unlike a hotel, most houseboat rentals require you to bring your own sheets, pillows, and towels, though linen packages are available for an extra fee."}},{"@type":"Question",name:"Are pets allowed on the houseboats?",acceptedAnswer:{"@type":"Answer",text:"Yes! We are a pet-friendly fleet. Maximum 2 dogs per houseboat — 1st dog stays free, 2nd dog is a $50 non-refundable fee. Bringing your dog is a great way to enjoy the 365 miles of Shasta Lake shoreline together. We recommend bringing a canine life vest for their safety."}},{"@type":"Question",name:"Is a houseboat vacation safe for small children?",acceptedAnswer:{"@type":"Answer",text:'Absolutely. Our luxury houseboats are designed with families in mind, featuring sturdy perimeter railings and gated decks. By California law, children 12 and under must wear a Coast Guard-approved life jacket at all times while the boat is in motion. We recommend bringing "fitted" vests for toddlers to ensure maximum comfort and safety.'}},{"@type":"Question",name:"Is there Wi-Fi or cell service on Shasta Lake?",acceptedAnswer:{"@type":"Answer",text:'Cell service is generally strong near the main marinas (Jones Valley and Silverthorn) but can be spotty in the remote "arms" of the lake. The Titans are now equipped with Starlink Satellite Internet capability, allowing for streaming and communication even in secluded coves.'}},{"@type":"Question",name:"How much does it cost to rent a houseboat on Shasta Lake?",acceptedAnswer:{"@type":"Answer",text:"Shasta Lake houseboat rentals start at $2,392 for three low-season nights on the Senator and reach $7,087 for three low-season nights on the flagship Titan. A full seven nights starts at $3,592 on the Senator and $11,640 on the Titan. Every rental has a 3-night minimum, and all quoted prices include taxes and mandatory fees."}},{"@type":"Question",name:"How is Houseboats.com different from budget houseboat rentals?",acceptedAnswer:{"@type":"Answer",text:"Our fleet is a newer luxury fleet — hot tubs, waterslides, gourmet kitchens and private staterooms rather than basic bunk layouts. We operate two full-service marinas, Jones Valley Resort and Silverthorn Resort, both on the quieter Pit River Arm of Shasta Lake. Pricing is transparent: taxes and mandatory fees are in the quoted rate, with fuel and a refundable deposit disclosed up front. We have operated on Shasta Lake for more than 30 years."}},{"@type":"Question",name:"How many people does the largest houseboat sleep?",acceptedAnswer:{"@type":"Answer",text:"The Titan, our flagship 65-foot triple-deck houseboat at Jones Valley Resort, sleeps up to 22 guests (26 max) across 6 private staterooms with 3 bathrooms."}},{"@type":"Question",name:"Where is Shasta Lake located?",acceptedA
31nswer:{"@type":"Answer",text:"Shasta Lake is located in Northern California, approximately 10 miles north of Redding, CA. It is California's largest reservoir with 365 miles of shoreline."}},{"@type":"Question",name:"How far in advance should I book a houseboat on Shasta Lake?",acceptedAnswer:{"@type":"Answer",text:"We recommend booking 3 to 6 months in advance for summer weekends and holidays. The Titan and Escapade book earliest. Off-peak dates in May or September may be available with shorter notice."}}]}]},Ab=()=>{const t="index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1";return fm(Rb,"index"),f.useEffect(()=>{if(typeof window>"u")return;const e=window,r=()=>Xr();e.requestIdleCallback?e.requestIdleCallback(r):setTimeout(r,1500)},[]),c.jsxs("div",{className:"min-h-screen bg-background",children:[c.jsxs(Eu,{children:[c.jsx("title",{children:Xn}),c.jsx("meta",{name:"description",content:Yn}),c.jsx("link",{rel:"canonical",href:"https://houseboats.com/"}),c.jsx("link",{rel:"preload",as:"image",href:"https://houseboats.com/assets/titan-luxury-houseboat-aerial-view.jpg",type:"image/jpeg"}),c.jsx("meta",{name:"robots",content:t}),c.jsx("meta",{property:"og:type",content:"website"}),c.jsx("meta",{property:"og:site_name",content:"Houseboats.com"}),c.jsx("meta",{property:"og:url",content:"https://houseboats.com/"}),c.jsx("meta",{property:"og:title",content:Xn}),c.jsx("meta",{property:"og:description",content:Yn}),c.jsx("meta",{property:"og:image",content:"https://houseboats.com/assets/titan-luxury-houseboat-aerial-view.jpg"}),c.jsx("meta",{property:"og:image:width",content:"1200"}),c.jsx("meta",{property:"og:image:height",content:"630"}),c.jsx("meta",{property:"og:image:alt",content:"Titan luxury houseboat on Shasta Lake with waterslide and hot tub"}),c.jsx("meta",{property:"og:locale",content:"en_US"}),c.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),c.jsx("meta",{name:"twitter:site",content:"@houseboatscom"}),c.jsx("meta",{name:"twitter:title",content:Xn}),c.jsx("meta",{name:"twitter:description",content:Yn}),c.jsx("meta",{name:"twitter:image",content:"https://houseboats.com/assets/titan-luxury-houseboat-aerial-view.jpg"}),c.jsx("meta",{name:"twitter:image:alt",content:"Titan luxury houseboat on Shasta Lake with waterslide and hot tub"}),c.jsx("meta",{name:"twitter:creator",content:"@houseboatscom"}),c.jsx("meta",{property:"og:image:type",content:"image/jpeg"}),c.jsx("meta",{property:"og:image:secure_url",content:"https://houseboats.com/assets/titan-luxury-houseboat-aerial-view.jpg"}),c.jsx("meta",{name:"geo.region",content:"US-CA"}),c.jsx("meta",{name:"geo.placename",content:"Shasta Lake, California"}),c.jsx("meta",{name:"ICBM",content:"40.7421074, -122.2217146"})]}),c.jsx(pm,{}),c.jsxs("main",{children:[c.jsx(vm,{}),c.jsx(zm,{}),c.jsx(sg,{}),c.jsx(Vm,{}),c.jsxs(f.Suspense,{fallback:null,children:[c.jsx(wb,{}),c.jsx(Sb,{}),c.jsx(xb,{}),c.jsx(Tb,{}),c.jsx(kb,{}),c.jsx(_b,{}),c.jsx(Eb,{})]})]}),c.jsx(Kl,{})]})};function nr(t,e,{checkForDefaultPrevented:r=!0}={}){return function(s){if(t==null||t(s),r===!1||!s.defaultPrevented)return e==null?void 0:e(s)}}function Ri(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function Cb(...t){return e=>{let r=!1;const n=t.map(s=>{const o=Ri(s,e);return!r&&typeof o=="function"&&(r=!0),o});if(r)return()=>{for(let s=0;s<n.length;s++){const o=n[s];typeof o=="function"?o():Ri(t[s],null)}}}}function Ys(...t){return f.useCallback(Cb(...t),t)}function jb(t,e){const r=f.createContext(e);r.displayName=t+"Context";const n=o=>{const{children:i,...a}=o,l=f.useMemo(()=>a,Object.values(a));return c.jsx(r.Provider,{value:l,children:i})};n.displayName=t+"Provider";function s(o){const i=f.useContext(r);if(i)return i;if(e!==void 0)return e;throw new Error(`\`${o}\` must be used within \`${t}\``)}return[n,s]}function Pb(t,e=[]){let r=[];function n(o,i){const a=f.createContext(i);a.displayName=o+"Context";const l=r.length;r=[...r,i];const u=h=>{var x;const{scope:m,children:p,...v}=h,g=((x=m==null?void 0:m[t])==null?void 0:x[l])||a,y=f.useMemo(()=>v,Object.values(v));return c.jsx(g.Provider,{value:y,children:p})};u.displayName=o+"Provider";function d(h,m){var g;const p=((g=m==null?void 0:m[t])==null?void 0:g[l])||a,v=f.useContext(p);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=r.map(i=>f.createContext(i));return function(a){const l=(a==null?void 0:a[t])||o;return f.useMemo(()=>({[`__scope${t}`]:{...a,[t]:l}}),[a,l])}};return s.scopeName=t,[n,Ob(s,...e)]}function Ob(...t){const e=t[0];if(t.length===1)return e;const r=()=>{const n=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const i=n.reduce((a,{useScope:l,scopeName:u})=>{const h=l(o)[`__scope${u}`];return{...a,...h}},{});return f.useMemo(()=>({[`__scope${e.scopeName}`]:i}),[i])}};return r.scopeName=e.scopeName,r}var Nb=globalThis!=null&&globalThis.document?f.useLayoutEffect:()=>{},Ib=Bt[" useId ".trim().toString()]||(()=>{}),Lb=0;function Qn(t){const[e,r]=f.useState(Ib());return Nb(()=>{t||r(n=>n??String(Lb++))},[t]),t||(e?`radix-${e}
31`:"")}var $b=globalThis!=null&&globalThis.document?f.useLayoutEffect:()=>{},Db=Bt[" useInsertionEffect ".trim().toString()]||$b;function Mb({prop:t,defaultProp:e,onChange:r=()=>{},caller:n}){const[s,o,i]=Ub({defaultProp:e,onChange:r}),a=t!==void 0,l=a?t:s;{const d=f.useRef(t!==void 0);f.useEffect(()=>{const h=d.current;h!==a&&console.warn(`${n} is changing from ${h?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=a},[a,n])}const u=f.useCallback(d=>{var h;if(a){const m=Bb(d)?d(t):d;m!==t&&((h=i.current)==null||h.call(i,m))}else o(d)},[a,t,o,i]);return[l,u]}function Ub({defaultProp:t,onChange:e}){const[r,n]=f.useState(t),s=f.useRef(r),o=f.useRef(e);return Db(()=>{o.current=e},[e]),f.useEffect(()=>{var i;s.current!==r&&((i=o.current)==null||i.call(o,r),s.current=r)},[r,s]),[r,n,o]}function Bb(t){return typeof t=="function"}function Ai(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function Fb(...t){return e=>{let r=!1;const n=t.map(s=>{const o=Ai(s,e);return!r&&typeof o=="function"&&(r=!0),o});if(r)return()=>{for(let s=0;s<n.length;s++){const o=n[s];typeof o=="function"?o():Ai(t[s],null)}}}}function Hb(...t){return f.useCallback(Fb(...t),t)}var Vb=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Wb=Vb.reduce((t,e)=>{const r=qe(`Primitive.${e}`),n=f.forwardRef((s,o)=>{const{asChild:i,...a}=s,l=i?r:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...a,ref:o})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function Ci(t){const e=f.useRef(t);return f.useEffect(()=>{e.current=t}),f.useMemo(()=>(...r)=>{var n;return(n=e.current)==null?void 0:n.call(e,...r)},[])}var Zn="focusScope.autoFocusOnMount",es="focusScope.autoFocusOnUnmount",ji={bubbles:!1,cancelable:!0},qb="FocusScope",Jl=f.forwardRef((t,e)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...i}=t,[a,l]=f.useState(null),u=Ci(s),d=Ci(o),h=f.useRef(null),m=Hb(e,g=>l(g)),p=f.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;f.useEffect(()=>{if(n){let g=function(w){if(p.paused||!a)return;const _=w.target;a.contains(_)?h.current=_:Ze(h.current,{select:!0})},y=function(w){if(p.paused||!a)return;const _=w.relatedTarget;_!==null&&(a.contains(_)||Ze(h.current,{select:!0}))},x=function(w){if(document.activeElement===document.body)for(const S of w)S.removedNodes.length>0&&Ze(a)};document.addEventListener("focusin",g),document.addEventListener("focusout",y);const b=new MutationObserver(x);return a&&b.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",y),b.disconnect()}}},[n,a,p.paused]),f.useEffect(()=>{if(a){Oi.add(p);const g=document.activeElement;if(!a.contains(g)){const x=new CustomEvent(Zn,ji);a.addEventListener(Zn,u),a.dispatchEvent(x),x.defaultPrevented||(zb(Xb(Gl(a)),{select:!0}),document.activeElement===g&&Ze(a))}return()=>{a.removeEventListener(Zn,u),setTimeout(()=>{const x=new CustomEvent(es,ji);a.addEventListener(es,d),a.dispatchEvent(x),x.defaultPrevented||Ze(g??document.body,{select:!0}),a.removeEventListener(es,d),Oi.remove(p)},0)}}},[a,u,d,p]);const v=f.useCallback(g=>{if(!r&&!n||p.paused)return;const y=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,x=document.activeElement;if(y&&x){const b=g.currentTarget,[w,_]=Kb(b);w&&_?!g.shiftKey&&x===_?(g.preventDefault(),r&&Ze(w,{select:!0})):g.shiftKey&&x===w&&(g.preventDefault(),r&&Ze(_,{select:!0})):x===b&&g.preventDefault()}},[r,n,p.paused]);return c.jsx(Wb.div,{tabIndex:-1,...i,ref:m,onKeyDown:v})});Jl.displayName=qb;function zb(t,{select:e=!1}={}){const r=document.activeElement;for(const n of t)if(Ze(n,{select:e}),document.activeElement!==r)return}function Kb(t){const e=Gl(t),r=Pi(e,t),n=Pi(e.reverse(),t);return[r,n]}function Gl(t){const e=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)e.push(r.currentNode);return e}function Pi(t,e){for(const r of t)if(!Jb(r,{upTo:e}))return r}function Jb(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 Gb(t){return t instanceof HTMLInputElement&&"select"in t}function Ze(t,{select:e=!1}={}){if(t&&t.focus){const r=document.activeElement;t.focus({preventScroll:!0}),t!==r&&Gb(t)&&e&&t.select()}}var Oi=Yb();function Yb(){let t=[];return{add(e){const r=t[0];e!==r&&(r==null||r.pause()),t=Ni(t,e),t.unshift(e)},remove(e){var r;t=Ni(t,e),(r=t[0])==null||r.resume()}}}function Ni(t,e){const r=[...t],n=r.indexOf(e);return n!==-1&&r.splice(n,1),r}function Xb(t){return t.filter(e=>e.tagName!=="A")}var Ii=globalThis!=null&&globalThis.document?f.useLayoutEffect:()=>{};function Qb(t,e){return f.useReducer((r,n)=>e[r][n]??r,t)}var An=t=>{const{present:e,children:r}=t,n=Zb(e),s=typeof r=="function"?r({present:n.isPresent}):f.Children.only(r),o=ew(n.ref,tw(s));return typeof r=="function"||n.isPresent?f.cloneElement(s,{ref:o}):null};An.displayName="Presence";function Zb(t){const[e,r]=f.useState(),n=f.useRef(null),s=f.useRef(t),o=f.useRef("none"),i=t?"mounted":"unmounted",[a,l]=Qb(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{const u=Fr(n.current);o.current=a==="mounted"?u:"none"},[a]),Ii(()=>{const u=n.current,d=s.current;if(d!==t){const m=o.current,p=Fr(u);t?l("MOUNT"):p==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(d&&m!==p?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,l]),Ii(()=>
31{if(e){let u;const d=e.ownerDocument.defaultView??window,h=p=>{const g=Fr(n.current).includes(CSS.escape(p.animationName));if(p.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)})}},m=p=>{p.target===e&&(o.current=Fr(n.current))};return e.addEventListener("animationstart",m),e.addEventListener("animationcancel",h),e.addEventListener("animationend",h),()=>{d.clearTimeout(u),e.removeEventListener("animationstart",m),e.removeEventListener("animationcancel",h),e.removeEventListener("animationend",h)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:f.useCallback(u=>{n.current=u?getComputedStyle(u):null,r(u)},[])}}function Li(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function ew(...t){const e=f.useRef(t);return e.current=t,f.useCallback(r=>{const n=e.current;let s=!1;const o=n.map(i=>{const a=Li(i,r);return!s&&typeof a=="function"&&(s=!0),a});if(s)return()=>{for(let i=0;i<o.length;i++){const a=o[i];typeof a=="function"?a():Li(n[i],null)}}},[])}function Fr(t){return(t==null?void 0:t.animationName)||"none"}function tw(t){var n,s;let e=(n=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:n.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}var rw=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],wr=rw.reduce((t,e)=>{const r=qe(`Primitive.${e}`),n=f.forwardRef((s,o)=>{const{asChild:i,...a}=s,l=i?r:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...a,ref:o})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{}),Hr=0,Ce=null;function nw(){f.useEffect(()=>{Ce||(Ce={start:$i(),end:$i()});const{start:t,end:e}=Ce;return document.body.firstElementChild!==t&&document.body.insertAdjacentElement("afterbegin",t),document.body.lastElementChild!==e&&document.body.insertAdjacentElement("beforeend",e),Hr++,()=>{Hr===1&&(Ce==null||Ce.start.remove(),Ce==null||Ce.end.remove(),Ce=null),Hr=Math.max(0,Hr-1)}},[])}function $i(){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 Zr="right-scroll-bar-position",en="width-before-scroll-bar",sw="with-scroll-bars-hidden",ow="--removed-body-scroll-bar-size";function ts(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function iw(t,e){var r=f.useState(function(){return{value:t,callback:e,facade:{get current(){return r.value},set current(n){var s=r.value;s!==n&&(r.value=n,r.callback(n,s))}}}})[0];return r.callback=e,r.facade}var aw=typeof window<"u"?f.useLayoutEffect:f.useEffect,Di=new WeakMap;function lw(t,e){var r=iw(null,function(n){return t.forEach(function(s){return ts(s,n)})});return aw(function(){var n=Di.get(r);if(n){var s=new Set(n),o=new Set(t),i=r.current;s.forEach(function(a){o.has(a)||ts(a,null)}),o.forEach(function(a){s.has(a)||ts(a,i)})}Di.set(r,t)},[t]),r}function cw(t){return t}function uw(t,e){e===void 0&&(e=cw);var r=[],n=!1,s={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:t},useMedium:function(o){var i=e(o,n);return r.push(i),function(){r=r.filter(function(a){return a!==i})}},assignSyncMedium:function(o){for(n=!0;r.length;){var i=r;r=[],i.forEach(o)}r={push:function(a){return o(a)},filter:function(){return r}}},assignMedium:function(o){n=!0;var i=[];if(r.length){var a=r;r=[],a.forEach(o),i=r}var l=function(){var d=i;i=[],d.forEach(o)},u=function(){return Promise.resolve().then(l)};u(),r={push:function(d){i.push(d),u()},filter:function(d){return i=i.filter(d),r}}}};return s}function dw(t){t===void 0&&(t={});var e=uw(null);return e.options=Oe({async:!0,ssr:!1},t),e}var Yl=function(t){var e=t.sideCar,r=Wt(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=e.read();if(!n)throw new Error("Sidecar medium not found");return f.createElement(n,Oe({},r))};
31Yl.isSideCarExport=!0;function hw(t,e){return t.useMedium(e),Yl}var Xl=dw(),rs=function(){},Cn=f.forwardRef(function(t,e){var r=f.useRef(null),n=f.useState({onScrollCapture:rs,onWheelCapture:rs,onTouchMoveCapture:rs}),s=n[0],o=n[1],i=t.forwardProps,a=t.children,l=t.className,u=t.removeScrollBar,d=t.enabled,h=t.shards,m=t.sideCar,p=t.noRelative,v=t.noIsolation,g=t.inert,y=t.allowPinchZoom,x=t.as,b=x===void 0?"div":x,w=t.gapMode,_=Wt(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=m,k=lw([r,e]),E=Oe(Oe({},_),s);return f.createElement(f.Fragment,null,d&&f.createElement(S,{sideCar:Xl,removeScrollBar:u,shards:h,noRelative:p,noIsolation:v,inert:g,setCallbacks:o,allowPinchZoom:!!y,lockRef:r,gapMode:w}),i?f.cloneElement(f.Children.only(a),Oe(Oe({},E),{ref:k})):f.createElement(b,Oe({},E,{className:l,ref:k}),a))});Cn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Cn.classNames={fullWidth:en,zeroRight:Zr};var fw=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function pw(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=fw();return e&&t.setAttribute("nonce",e),t}function mw(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function gw(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var vw=function(){var t=0,e=null;return{add:function(r){t==0&&(e=pw())&&(mw(e,r),gw(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},yw=function(){var t=vw();return function(e,r){f.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&r])}},Ql=function(){var t=yw(),e=function(r){var n=r.styles,s=r.dynamic;return t(n,s),null};return e},bw={left:0,top:0,right:0,gap:0},ns=function(t){return parseInt(t||"",10)||0},ww=function(t){var e=window.getComputedStyle(document.body),r=e[t==="padding"?"paddingLeft":"marginLeft"],n=e[t==="padding"?"paddingTop":"marginTop"],s=e[t==="padding"?"paddingRight":"marginRight"];return[ns(r),ns(n),ns(s)]},xw=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return bw;var e=ww(t),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,n-r+e[2]-e[0])}},_w=Ql(),$t="data-scroll-locked",Ew=function(t,e,r,n){var s=t.left,o=t.top,i=t.right,a=t.gap;return r===void 0&&(r="margin"),`
32  .`.concat(sw,` {
33   overflow: hidden `).concat(n,`;
34   padding-right: `).concat(a,"px ").concat(n,`;
35  }
36  body[`).concat($t,`] {
37    overflow: hidden `).concat(n,`;
38    overscroll-behavior: contain;
39    `).concat([e&&"position: relative ".concat(n,";"),r==="margin"&&`
40    padding-left: `.concat(s,`px;
41    padding-top: `).concat(o,`px;
42    padding-right: `).concat(i,`px;
43    margin-left:0;
44    margin-top:0;
45    margin-right: `).concat(a,"px ").concat(n,`;
46    `),r==="padding"&&"padding-right: ".concat(a,"px ").concat(n,";")].filter(Boolean).join(""),`
47  }
48  
49  .`).concat(Zr,` {
50    right: `).concat(a,"px ").concat(n,`;
51  }
52  
53  .`).concat(en,` {
54    margin-right: `).concat(a,"px ").concat(n,`;
55  }
56  
57  .`).concat(Zr," .").concat(Zr,` {
58    right: 0 `).concat(n,`;
59  }
60  
61  .`).concat(en," .").concat(en,` {
62    margin-right: 0 `).concat(n,`;
63  }
64  
65  body[`).concat($t,`] {
66    `).concat(ow,": ").concat(a,`px;
67  }
68`)},Mi=function(){var t=parseInt(document.body.getAttribute($t)||"0",10);return isFinite(t)?t:0},Sw=function(){f.useEffect(function(){return document.body.setAttribute($t,(Mi()+1).toString()),function(){var t=Mi()-1;t<=0?document.body.removeAttribute($t):document.body.setAttribute($t,t.toString())}},[])},kw=function(t){var e=t.noRelative,r=t.noImportant,n=t.gapMode,s=n===void 0?"margin":n;Sw();var o=f.useMemo(function(){return xw(s)},[s]);return f.createElement(_w,{styles:Ew(o,!e,s,r?"":"!important")})},Cs=!1;if(typeof window<"u")try{var Vr=Object.defineProperty({},"passive",{get:function(){return Cs=!0,!0}});window.addEventListener("test",Vr,Vr),window.removeEventListener("test",Vr,Vr)}catch{Cs=!1}var Rt=Cs?{passive:!1}:!1,Tw=function(t){return t.tagName==="TEXTAREA"},Zl=function(t,e){if(!(t instanceof Element))return!1;var r=window.getComputedStyle(t);return r[e]!=="hidden"&&!(r.overflowY===r.overflowX&&!Tw(t)&&r[e]==="visible")},Rw=function(t){return Zl(t,"overflowY")},Aw=function(t){return Zl(t,"overflowX")},Ui=function(t,e){var r=e.ownerDocument,n=e;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var s=ec(t,n);if(s){var o=tc(t,n),i=o[1],a=o[2];if(i>a)return!0}n=n.parentNode}while(n&&n!==r.body);return!1}
vendor: 4,754 bytes, lines 68-71
68,Cw=function(t){var e=t.scrollTop,r=t.scrollHeight,n=t.clientHeight;return[e,r,n]},jw=function(t){var e=t.scrollLeft,r=t.scrollWidth,n=t.clientWidth;return[e,r,n]},ec=function(t,e){return t==="v"?Rw(e):Aw(e)},tc=function(t,e){return t==="v"?Cw(e):jw(e)},Pw=function(t,e){return t==="h"&&e==="rtl"?-1:1},Ow=function(t,e,r,n,s){var o=Pw(t,window.getComputedStyle(e).direction),i=o*n,a=r.target,l=e.contains(a),u=!1,d=i>0,h=0,m=0;do{if(!a)break;var p=tc(t,a),v=p[0],g=p[1],y=p[2],x=g-y-o*v;(v||x)&&ec(t,a)&&(h+=x,m+=v);var b=a.parentNode;a=b&&b.nodeType===Node.DOCUMENT_FRAGMENT_NODE?b.host:b}while(!l&&a!==document.body||l&&(e.contains(a)||e===a));return(d&&(Math.abs(h)<1||!s)||!d&&(Math.abs(m)<1||!s))&&(u=!0),u},Wr=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},Bi=function(t){return[t.deltaX,t.deltaY]},Fi=function(t){return t&&"current"in t?t.current:t},Nw=function(t,e){return t[0]===e[0]&&t[1]===e[1]},Iw=function(t){return`
69  .block-interactivity-`.concat(t,` {pointer-events: none;}
70  .allow-interactivity-`).concat(t,` {pointer-events: all;}
71`)},Lw=0,At=[];function $w(t){var e=f.useRef([]),r=f.useRef([0,0]),n=f.useRef(),s=f.useState(Lw++)[0],o=f.useState(Ql)[0],i=f.useRef(t);f.useEffect(function(){i.current=t},[t]),f.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(s));var g=ig([t.lockRef.current],(t.shards||[]).map(Fi),!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=f.useCallback(function(g,y){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!i.current.allowPinchZoom;var x=Wr(g),b=r.current,w="deltaX"in g?g.deltaX:b[0]-x[0],_="deltaY"in g?g.deltaY:b[1]-x[1],S,k=g.target,E=Math.abs(w)>Math.abs(_)?"h":"v";if("touches"in g&&E==="h"&&k.type==="range")return!1;var $=window.getSelection(),L=$&&$.anchorNode,B=L?L===k||L.contains(k):!1;if(B)return!1;var F=Ui(E,k);if(!F)return!0;if(F?S=E:(S=E==="v"?"h":"v",F=Ui(E,k)),!F)return!1;if(!n.current&&"changedTouches"in g&&(w||_)&&(n.current=S),!S)return!0;var M=n.current||S;return Ow(M,y,g,M==="h"?w:_,!0)},[]),l=f.useCallback(function(g){var y=g;if(!(!At.length||At[At.length-1]!==o)){var x="deltaY"in y?Bi(y):Wr(y),b=e.current.filter(function(S){return S.name===y.type&&(S.target===y.target||y.target===S.shadowParent)&&Nw(S.delta,x)})[0];if(b&&b.should){y.cancelable&&y.preventDefault();return}if(!b){var w=(i.current.shards||[]).map(Fi).filter(Boolean).filter(function(S){return S.contains(y.target)}),_=w.length>0?a(y,w[0]):!i.current.noIsolation;_&&y.cancelable&&y.preventDefault()}}},[]),u=f.useCallback(function(g,y,x,b){var w={name:g,delta:y,target:x,should:b,shadowParent:Dw(x)};e.current.push(w),setTimeout(function(){e.current=e.current.filter(function(_){return _!==w})},1)},[]),d=f.useCallback(function(g){r.current=Wr(g),n.current=void 0},[]),h=f.useCallback(function(g){u(g.type,Bi(g),g.target,a(g,t.lockRef.current))},[]),m=f.useCallback(function(g){u(g.type,Wr(g),g.target,a(g,t.lockRef.current))},[]);f.useEffect(function(){return At.push(o),t.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:m}),document.addEventListener("wheel",l,Rt),document.addEventListener("touchmove",l,Rt),document.addEventListener("touchstart",d,Rt),function(){At=At.filter(function(g){return g!==o}),document.removeEventListener("wheel",l,Rt),document.removeEventListener("touchmove",l,Rt),document.removeEventListener("touchstart",d,Rt)}},[]);var p=t.removeScrollBar,v=t.inert;return f.createElement(f.Fragment,null,v?f.createElement(o,{styles:Iw(s)}):null,p?f.createElement(kw,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function Dw(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const Mw=hw(Xl,$w);var rc=f.forwardRef(function(t,e){return f.createElement(Cn,Oe({},t,{ref:e,sideCar:Mw}))});rc.classNames=Cn.classNames;var Uw=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Ct=new WeakMap,qr=new WeakMap,zr={},ss=0,nc=function(t){return t&&(t.host||nc(t.parentNode))},Bw=function(t,e){return e.map(function(r){if(t.contains(r))return r;var n=nc(r);return n&&t.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",t,". Doing nothing"),null)}).filter(function(r){return!!r})},Fw=function(t,e,r,n){var s=Bw(e,Array.isArray(t)?t:[t]);zr[r]||(zr[r]=new WeakMap);var o=zr[r],i=[],a=new Set,l=new Set(s),u=function(h){!h||a.has(h)||(a.add(h),u(h.parentNode))};
71s.forEach(u);var d=function(h){!h||l.has(h)||Array.prototype.forEach.call(h.children,function(m){if(a.has(m))d(m);else try{var p=m.getAttribute(n),v=p!==null&&p!=="false",g=(Ct.get(m)||0)+1,y=(o.get(m)||0)+1;Ct.set(m,g),o.set(m,y),i.push(m),g===1&&v&&qr.set(m,!0),y===1&&m.setAttribute(r,"true"),v||m.setAttribute(n,"true")}catch(x){console.error("aria-hidden: cannot operate on ",m,x)}})};return d(e),a.clear(),ss++,function(){i.forEach(function(h){var m=Ct.get(h)-1,p=o.get(h)-1;Ct.set(h,m),o.set(h,p),m||(qr.has(h)||h.removeAttribute(n),qr.delete(h)),p||h.removeAttribute(r)}),ss--,ss||(Ct=new WeakMap,Ct=new WeakMap,qr=new WeakMap,zr={})}},Hw=function(t,e,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(t)?t:[t]),s=Uw(t);return s?(n.push.apply(n,Array.from(s.querySelectorAll("[aria-live]"))),Fw(n,s,r,"aria-hidden")):function(){return null}},jn="Dialog",[sc,zx]=Pb(jn),[Vw,Ae]=sc(jn),oc=t=>{const{__scopeDialog:e,children:r,open:n,defaultOpen:s,onOpenChange:o,modal:i=!0}=t,a=f.useRef(null),l=f.useRef(null),[u,d]=Mb({prop:n,defaultProp:s??!1,onChange:o,caller:jn});return c.jsx(Vw,{scope:e,triggerRef:a,contentRef:l,contentId:Qn(),titleId:Qn(),descriptionId:Qn(),open:u,onOpenChange:d,onOpenToggle:f.useCallback(()=>d(h=>!h),[d]),modal:i,children:r})};oc.displayName=jn;var ic="DialogTrigger",Ww=f.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,s=Ae(ic,r),o=Ys(e,s.triggerRef);return c.jsx(wr.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":Zs(s.open),...n,ref:o,onClick:nr(t.onClick,s.onOpenToggle)})});Ww.displayName=ic;var Xs="DialogPortal",[qw,ac]=sc(Xs,{forceMount:void 0}),lc=t=>{const{__scopeDialog:e,forceMount:r,children:n,container:s}=t,o=Ae(Xs,e);return c.jsx(qw,{scope:e,forceMount:r,children:f.Children.map(n,i=>c.jsx(An,{present:r||o.open,children:c.jsx(cl,{asChild:!0,container:s,children:i})}))})};lc.displayName=Xs;var vn="DialogOverlay",cc=f.forwardRef((t,e)=>{const r=ac(vn,t.__scopeDialog),{forceMount:n=r.forceMount,...s}=t,o=Ae(vn,t.__scopeDialog);return o.modal?c.jsx(An,{present:n||o.open,children:c.jsx(Kw,{...s,ref:e})}):null});cc.displayName=vn;var zw=qe("DialogOverlay.RemoveScroll"),Kw=f.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,s=Ae(vn,r);return c.jsx(rc,{as:zw,allowPinchZoom:!0,shards:[s.contentRef],children:c.jsx(wr.div,{"data-state":Zs(s.open),...n,ref:e,style:{pointerEvents:"auto",...n.style}})})}),gt="DialogContent",uc=f.forwardRef((t,e)=>{const r=ac(gt,t.__scopeDialog),{forceMount:n=r.forceMount,...s}=t,o=Ae(gt,t.__scopeDialog);return c.jsx(An,{present:n||o.open,children:o.modal?c.jsx(Jw,{...s,ref:e}):c.jsx(Gw,{...s,ref:e})})});uc.displayName=gt;var Jw=f.forwardRef((t,e)=>{const r=Ae(gt,t.__scopeDialog),n=f.useRef(null),s=Ys(e,r.contentRef,n);return f.useEffect(()=>{const o=n.current;if(o)return Hw(o)},[]),c.jsx(dc,{...t,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:nr(t.onCloseAutoFocus,o=>{var i;o.preventDefault(),(i=r.triggerRef.current)==null||i.focus()}),onPointerDownOutside:nr(t.onPointerDownOutside,o=>{const i=o.detail.originalEvent,a=i.button===0&&i.ctrlKey===!0;(i.button===2||a)&&o.preventDefault()}),onFocusOutside:nr(t.onFocusOutside,o=>o.preventDefault())})}),Gw=f.forwardRef((t,e)=>{const r=Ae(gt,t.__scopeDialog),n=f.useRef(!1),s=f.useRef(!1);return c.jsx(dc,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var i,a;(i=t.onCloseAutoFocus)==null||i.call(t,o),o.defaultPrevented||(n.current||(a=r.triggerRef.current)==null||a.focus(),o.preventDefault()),n.current=!1,s.current=!1},onInteractOutside:o=>{var l,u;(l=t.onInteractOutside)==null||l.call(t,o),o.defaultPrevented||(n.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const i=o.target;((u=r.triggerRef.current)==null?void 0:u.contains(i))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),dc=f.forwardRef((t,e)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:s,onCloseAutoFocus:o,...i}=t,a=Ae(gt,r),l=f.useRef(null),u=Ys(e,l);return nw(),c.jsxs(c.Fragment,{children:[c.jsx(Jl,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:s,onUnmountAutoFocus:o,children:c.jsx(Ls,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":Zs(a.open),...i,ref:u,onDismiss:()=>a.onOpenChange(!1)})}),c.jsxs(c.Fragment,{children:[c.jsx(Yw,{titleId:a.titleId}),c.jsx(Qw,{contentRef:l,descriptionId:a.descriptionId})]})]})}),Qs="DialogTitle",hc=f.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,s=Ae(Qs,r);return c.jsx(wr.h2,{id:s.titleId,...n,ref:e})});hc.displayName=Qs;var fc="DialogDescription",pc=f.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,s=Ae(fc,r);return c.jsx(wr.p,{id:s.descriptionId,...n,ref:e})});pc.displayName=fc;var mc="DialogClose",gc=f.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,s=Ae(mc,r);return c.jsx(wr.button,{type:"button",...n,ref:e,onClick:nr(t.onClick,()=>s.onOpenChange(!1))})});gc.displayName=mc;function Zs(t){return t?"open":"closed"}var vc="DialogTitleWarning",[Kx,yc]=jb(vc,{contentName:gt,titleName:Qs,docsSlug:"dialog"}),Yw=({titleId:t})=>{const e=yc(vc),r=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users.
72
73If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component.
74
75For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return f.useEffect(()=>{t&&(document.getElementById(t)||console.error(r))},[r,t]),null},Xw="DialogDescriptionWarning",Qw=({contentRef:t,descriptionId:e})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${yc(Xw).contentName}}.`;return f.useEffect(()=>{var o;const s=(o=t.current)==null?void 0:o.getAttribute("aria-describedby");e&&s&&(document.getElementById(e)||console.warn(n))},[n,t,e]),null},Zw=oc,e0=lc,bc=cc,wc=uc,xc=hc,_c=pc,t0=gc;const r0=Zw,n0=e0,Ec=f.forwardRef(({className:t,...e},r)=>c.jsx(bc,{ref:r,className:ue("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}));Ec.displayName=bc.displayName;const Sc=f.forwardRef(({className:t,children:e,...r},n)=>c.jsxs(n0,{children:[c.jsx(Ec,{}),c.jsxs(wc,{ref:n,className:ue("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rou
75nded-lg",t),...r,children:[e,c.jsxs(t0,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[c.jsx(gr,{className:"h-4 w-4"}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Sc.displayName=wc.displayName;const s0=({className:t,...e})=>c.jsx("div",{className:ue("flex flex-col space-y-1.5 text-center sm:text-left",t),...e});s0.displayName="DialogHeader";const kc=f.forwardRef(({className:t,...e},r)=>c.jsx(xc,{ref:r,className:ue("text-lg font-semibold leading-none tracking-tight",t),...e}));kc.displayName=xc.displayName;const o0=f.forwardRef(({className:t,...e},r)=>c.jsx(_c,{ref:r,className:ue("text-sm text-muted-foreground",t),...e}));o0.displayName=_c.displayName;const os="newsletter_popup_dismissed";function i0(){const[t,e]=f.useState(!1),[r,n]=f.useState(""),[s,o]=f.useState("idle"),[i,a]=f.useState("");f.useEffect(()=>{if(localStorage.getItem(os))return;const d=setTimeout(()=>e(!0),33e3);return()=>clearTimeout(d)},[]);const l=()=>{e(!1),localStorage.setItem(os,"true")},u=async d=>{if(d.preventDefault(),!!r){o("loading");try{const{data:h,error:m}=await Gs.functions.invoke("subscribe-newsletter",{body:{email:r,source:"popup"}});if(m){o("error"),a("Something went wrong. Please try again.");return}h!=null&&h.success?(o("success"),a(h.message),localStorage.setItem(os,"true")):(o("error"),a((h==null?void 0:h.error)||"Subscription failed."))}catch{o("error"),a("Something went wrong. Please try again.")}}};return c.jsx(r0,{open:t,onOpenChange:d=>{d||l()},children:c.jsxs(Sc,{className:"sm:max-w-md border-0 bg-gradient-to-br from-lake-blue-dark via-primary to-lake-blue-dark text-primary-foreground p-0 overflow-hidden",children:[c.jsx("button",{onClick:l,className:"absolute right-3 top-3 z-10 rounded-full p-1 text-primary-foreground/60 hover:text-primary-foreground transition-colors",children:c.jsx(gr,{className:"w-5 h-5"})}),c.jsxs("div",{className:"p-8 text-center",children:[c.jsx("div",{className:"mx-auto mb-4 flex h-14 w-14 items-center justify-center rounded-full bg-accent/20",children:c.jsx(Qi,{className:"h-7 w-7 text-accent"})}),c.jsx(kc,{className:"text-2xl font-bold mb-2",children:"Don't Miss Our Best Deals"}),c.jsx("p",{className:"text-primary-foreground/70 mb-6 text-sm",children:"Get exclusive Shasta Lake houseboat offers, seasonal promotions, and trip planning tips delivered to your inbox."}),s==="success"?c.jsxs("div",{className:"flex items-center justify-center gap-2 text-accent font-semibold py-4",children:[c.jsx(Gi,{className:"w-5 h-5"}),i]}):c.jsxs("form",{onSubmit:u,className:"space-y-3",children:[c.jsx(Ks,{type:"email",placeholder:"Enter your email",value:r,onChange:d=>n(d.target.value),required:!0,className:"bg-primary-foreground/10 border-primary-foreground/20 text-primary-foreground placeholder:text-primary-foreground/40 h-12"}),c.jsx(me,{type:"submit",disabled:s==="loading",className:"w-full h-12 bg-accent text-accent-foreground hover:bg-accent/90 font-bold text-base",children:s==="loading"?"Subscribing...":"Subscribe for Deals"}),s==="error"&&c.jsx("p",{className:"text-red-300 text-sm",children:i}),c.jsx("p",{className:"text-[11px] text-primary-foreground/40",children:"No spam, ever. Unsubscribe anytime."})]})]})]})})}const Hi=t=>{if(!(t instanceof HTMLElement))return!1;const e=t.tagName;return e==="INPUT"||e==="TEXTAREA"||e==="SELECT"||t.isContentEditable?!0:!!t.closest("input, textarea, select, [contenteditable='true']")},a0=()=>(f.useEffect(()=>{let t=0;const e=()=>{const s=Date.now();s-t<2e3||(t=s,th("Content is protected",{description:"This site's text and images cannot be copied or downloaded.",duration:2500}))},r=s=>{Hi(s.target)||(s.preventDefault(),s.type!=="selectstart"&&e())},n=s=>{const o=Hi(s.target),i=s.ctrlKey||s.metaKey;if(i&&["s","u","p"].includes(s.key.toLowerCase())){s.preventDefault(),e();return}if(s.key==="F12"){s.preventDefault(),e();return}if(i&&s.shiftKey&&["i","j","c"].includes(s.key.toLowerCase())){s.preventDefault(),e();return}i&&!o&&["c","x","a"].includes(s.key.toLowerCase())&&(s.preventDefault(),e())};return document.addEventListener("contextmenu",r),document.addEventListener("copy",r),document.addEventListener("cut",r),document.addEventListener("dragstart",r),document.addEventListener("selectstart",r),document.addEventListener("keydown",n),()=>{document.removeEventListener("contextmenu",r),document.removeEventListener("copy",r),document.removeEventListener("cut",r),document.removeEventListener("dragstart",r),document.removeEventListener("selectstart",r),document.removeEventListener("keydown",n)}},[]),null);function l0(){const[t,e]=f.useState(()=>mb()==="unset"?"first":"hidden"),r=f.useRef(null);if(f.useEffect(()=>{const o=()=>e("settings"),i=()=>e("hidden");return window.addEventListener(Ur.open,o),window.addEventListener(Ur.change,i),()=>{window.removeEventListener(Ur.open,o),window.removeEventListener(Ur.change,i)}},[]),f.useEffect(()=>{if(t!=="hidden"){const o=window.setTimeout(()=>{var i;return(i=r.current)==null?void 0:i.focus()},0);return()=>window.clearTimeout(o)}},[t]),f.useEffect(()=>{if(t!=="settings")return;const o=i=>{i.key==="Escape"&&e("hidden")};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[t]),t==="hidden")return null;const n=()=>Ti("accepted"),s=()=>Ti("rejected");return c.jsx("div",{role:"dialog","aria-modal":"false","aria-labelledby":"
75cookie-consent-title","aria-describedby":"cookie-consent-desc",className:"fixed inset-x-0 bottom-0 z-[60] p-3 sm:p-4 motion-safe:animate-in motion-safe:slide-in-from-bottom-4 motion-safe:fade-in motion-safe:duration-300",children:c.jsx("div",{className:"mx-auto max-w-4xl rounded-xl border border-border bg-background/95 backdrop-blur shadow-xl p-4 sm:p-5",children:c.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start gap-4",children:[c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsx("h2",{ref:r,id:"cookie-consent-title",tabIndex:-1,className:"text-base font-semibold text-foreground outline-none",children:"We use cookies"}),c.jsxs("p",{id:"cookie-consent-desc",className:"mt-1 text-sm text-muted-foreground",children:["We use cookies and similar tech to analyze site traffic, improve your experience, and personalize ads (Google Analytics & Google Ads). You can opt out of non-essential cookies anytime. See our"," ",c.jsx(ee,{to:"/privacy",className:"underline underline-offset-2 hover:text-foreground",children:"Privacy Policy"}),"."]})]}),c.jsxs("div",{className:"flex flex-col-reverse sm:flex-row sm:items-center gap-2 sm:gap-3 sm:shrink-0",children:[c.jsx(me,{type:"button",variant:"outline",size:"sm",onClick:s,className:"w-full sm:w-auto",children:"Reject Non-Essential"}),c.jsx(me,{type:"button",size:"sm",onClick:n,className:"w-full sm:w-auto",children:"Accept All"})]}),t==="settings"&&c.jsx("button",{type:"button",onClick:()=>e("hidden"),"aria-label":"Close cookie settings",className:"absolute top-2 right-2 inline-flex items-center justify-center w-9 h-9 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:c.jsx(gr,{className:"w-4 h-4","aria-hidden":"true"})})]})})})}const c0="/assets/boatie-mascot-ntQIaML9.png",u0=f.lazy(()=>R(()=>import("./BoatieChat-DLW-UGZ0.js"),__vite__mapDeps([21,1,2,3])));function d0(){const[t,e]=f.useState(!1),[r,n]=f.useState(!1),{pathname:s}=Ft(),o=s.startsWith("/admin")||s.startsWith("/embed");return f.useEffect(()=>{t&&n(!0)},[t]),o?null:c.jsxs(c.Fragment,{children:[!t&&c.jsxs("button",{onClick:()=>e(!0),"aria-label":"Open Boatie chat assistant",className:"fixed bottom-4 right-4 z-[9998] group flex items-center gap-2 bg-primary text-primary-foreground rounded-full pl-1.5 pr-4 py-1.5 shadow-2xl hover:shadow-primary/40 transition-all hover:scale-105",children:[c.jsx("img",{src:c0,alt:"","aria-hidden":"true",width:48,height:48,loading:"lazy",decoding:"async",className:"w-12 h-12 object-contain boatie-bob"}),c.jsx("span",{className:"font-semibold text-sm whitespace-nowrap",children:r?"Chat with Boatie":"Ask Boatie 👋"})]}),t&&c.jsx(f.Suspense,{fallback:null,children:c.jsx(u0,{onClose:()=>e(!1)})})]})}function h0(){try{let t=sessionStorage.getItem("pv_sid");return t||(t=`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`,sessionStorage.setItem("pv_sid",t)),t}catch{return"no-storage"}}function f0(){const t=Ft(),e=f.useRef("");f.useEffect(()=>{if(typeof window>"u"||t.pathname.startsWith("/admin")||navigator.doNotTrack==="1")return;const r=t.pathname+t.search;if(r===e.current)return;e.current=r;const n=new URLSearchParams(t.search),s={path:t.pathname,referrer:document.referrer||"",utm_source:n.get("utm_source")||void 0,utm_medium:n.get("utm_medium")||void 0,utm_campaign:n.get("utm_campaign")||void 0,session_id:h0()};Gs.functions.invoke("track-pageview",{body:s}).catch(()=>{})},[t.pathname,t.search])}function p0(){return f0(),null}const m0="https://bgkojpcsuertduonjubz.supabase.co",Vi=`${m0}/functions/v1/track-web-vitals`;function g0(){try{let t=sessionStorage.getItem("pv_sid");return t||(t=`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`,sessionStorage.setItem("pv_sid",t)),t}catch{return"no-storage"}}function v0(){f.useEffect(()=>{if(typeof window>"u"||window.location.pathname.startsWith("/admin")||navigator.doNotTrack==="1")return;const t=[];let e=!1;const r=()=>{if(e||t.length===0)return;e=!0;const o={path:window.location.pathname,session_id:g0(),metrics:t.splice(0)};try{const i=new Blob([JSON.stringify(o)],{type:"application/json"});navigator.sendBeacon?navigator.sendBeacon(Vi,i):fetch(Vi,{method:"POST",body:i,keepalive:!0}
75).catch(()=>{})}catch{}},n=()=>{document.visibilityState==="hidden"&&r()};let s=!1;return R(async()=>{const{onLCP:o,onCLS:i,onINP:a,onFCP:l,onTTFB:u}=await import("./web-vitals-Cj4M6-2c.js");return{onLCP:o,onCLS:i,onINP:a,onFCP:l,onTTFB:u}},[]).then(({onLCP:o,onCLS:i,onINP:a,onFCP:l,onTTFB:u})=>{if(s)return;const d=h=>{t.push({name:h.name,value:h.value,rating:h.rating})};o(d),i(d),a(d),l(d),u(d)}).catch(()=>{}),document.addEventListener("visibilitychange",n),window.addEventListener("pagehide",r),()=>{s=!0,document.removeEventListener("visibilitychange",n),window.removeEventListener("pagehide",r),r()}},[])}function y0(){return v0(),null}const b0=new Set(["/axis-t220r-wakeboard","/air-warrior-wakeboard","/tahoe-deck-boat","/centurion-t5-wakeboard","/supercruiser-party-boat","/party-cruiser-ii","/patio-boat-30","/deluxe-patio-boat","/bennington-pontoon","/fishing-boat","/kayak","/stand-up-paddle-board","/axis-t220r-wakeboard-silverthorn","/centurion-t5-wakeboard-silverthorn","/tahoe-deck-boat-silverthorn","/patio-boat-silverthorn","/sun-tracker-pontoon-silverthorn","/party-cruiser-i-silverthorn","/fishing-boat-silverthorn","/kayak-silverthorn","/stand-up-paddle-board-silverthorn"]);function w0(){const{pathname:t}=Ft(),e=t.replace(/\/$/,"");return b0.has(e)?c.jsx("div",{className:"bg-background border-b border-border mt-16",children:c.jsx("div",{className:"section-container py-4",children:c.jsxs(ee,{to:ae.url,className:"flex flex-col sm:flex-row items-center justify-between gap-3 rounded-xl bg-gradient-to-r from-summer-teal via-summer-coral to-sunset-gold px-4 py-3 text-white shadow-lg transition-transform hover:scale-[1.005]",children:[c.jsxs("div",{className:"flex flex-col sm:flex-row items-center gap-2 sm:gap-3 text-center sm:text-left",children:[c.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-white/20 px-2.5 py-1 text-xs font-extrabold uppercase tracking-wider backdrop-blur-sm",children:[c.jsx(yu,{className:"h-3 w-3"})," ",ae.name]}),c.jsxs("span",{className:"text-sm sm:text-base font-semibold",children:[ae.discountPercent,"% off this boat with code"," ",c.jsx("strong",{className:"font-extrabold tracking-wide",children:ae.code})," ","through ",ae.travelShort]})]}),c.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-white px-3 py-1.5 text-xs font-bold text-summer-coral shadow-sm",children:[c.jsx(bu,{className:"h-3.5 w-3.5"}),"See Sale Details",c.jsx(wu,{className:"h-3.5 w-3.5"})]})]})})}):null}const Wi=j(()=>R(()=>import("./CompareHouseboats-RLEbsLc_.js"),__vite__mapDeps([22,1,2,23,3,24,10,5]))),x0=j(()=>R(()=>import("./EndOfSummerSale-CBVzE0Tf.js"),__vite__mapDeps([25,1,2,26,3,8,7,24,10]))),_0=j(()=>R(()=>import("./HouseboatDetail-BBUxyNSq.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]))),E0=j(()=>R(()=>import("./Pricing-D4zeJcg-.js"),__vite__mapDeps([27,1,2,23,9,10,11,3,6]))),S0=j(()=>R(()=>import("./EmbedHero-DuNzbxGV.js"),__vite__mapDeps([28,1,2,3]))),k0=j(()=>R(()=>import("./NotFound-CwbeFM_r.js"),__vite__mapDeps([29,1,2]))),T0=j(()=>R(()=>import("./Privacy-C6p9vBUw.js"),__vite__mapDeps([30,1,2,26,3,31]))),R0=j(()=>R(()=>import("./Terms-Da4B9BWi.js"),__vite__mapDeps([32,1,2,26,3,31]))),A0=j(()=>R(()=>import("./FAQ-D0CSW6Rz.js"),__vite__mapDeps([33,1,2,23,8,7,3,26]))),C0=j(()=>R(()=>import("./ContactUs-BiUWzufH.js"),__vite__mapDeps([34,1,2,35,26,3]))),j0=j(()=>R(()=>import("./MarinaStore-B6SnIEe0.js"),__vite__mapDeps([36,1,2,35,26,3]))),P0=j(()=>R(()=>import("./BoatSlipsStorage-CM1HAfRh.js"),__vite__mapDeps([37,1,2,35,8,7,3,26]))),O0=j(()=>R(()=>import("./JonesValleyBoatSlips-B6dhwL3M.js"),__vite__mapDeps([38,1,2,35,39,26,3]))),N0=j(()=>R(()=>import("./SilverthornBoatSlips-DVq5H5aW.js"),__vite__mapDeps([40,1,2,35,39,26,3]))),I0=j(()=>R(()=>import("./SugarloafBoatSlips-CDRlPb-6.js"),__vite__mapDeps([41,1,2,35,39,26,3]))),L0=j(()=>R(()=>import("./LakeShasta-CYdWaBm0.js"),__vite__mapDeps([42,1,2,8,7,3,26,43]))),$0=j(()=>R(()=>import("./WeatherReports-Cydd2512.js"),__vite__mapDeps([44,1,2,45,3,35,14,8,7,43,26]))),D0=j(()=>R(()=>import("./LiveWeatherCam-DLZXVPU3.js"),__vite__mapDeps([46,1,2,43,3,45,26,8,7,35,47]))),M0=j(()=>R(()=>
75import("./LakeLevels-BfcPH96P.js"),__vite__mapDeps([48,1,2,45,3,35,14,8,7,26,49,50,51,52,53]))),U0=j(()=>R(()=>import("./MapsLocations-CddYq0Z7.js"),__vite__mapDeps([54,1,2,8,7,3,26,35,43]))),B0=j(()=>R(()=>import("./Fishing-Bkaah-Oa.js"),__vite__mapDeps([55,1,2,4,5,3,35,56,14,8,7,26,43]))),F0=j(()=>R(()=>import("./JonesValleyBoatRentals-Dn7Lwf0k.js"),__vite__mapDeps([57,1,2,58,59,35,26,3,60,7,16,61]))),H0=j(()=>R(()=>import("./SilverthornBoatRentals-BthQM_La.js"),__vite__mapDeps([62,1,2,35,26,3,60,7,61,63]))),V0=j(()=>R(()=>import("./JonesValleyResort-DVwvdBME.js"),__vite__mapDeps([64,1,2,35,8,7,3,26,11]))),W0=j(()=>R(()=>import("./SilverthornResort-Amv0f7NA.js"),__vite__mapDeps([65,1,2,35,8,7,3,26]))),q0=j(()=>R(()=>import("./JonesValleyHub-DUpX89DZ.js"),__vite__mapDeps([66,1,2,35,8,7,3,26,59]))),z0=j(()=>R(()=>import("./SilverthornHub-iDy5LDge.js"),__vite__mapDeps([67,1,2,4,5,3,35,8,7,26,63]))),K0=j(()=>R(()=>import("./Kayak-DA-xgf67.js"),__vite__mapDeps([68,1,2,56,3,26,8,7,39,35,69,58,59,61,4,5,70]))),J0=j(()=>R(()=>import("./StandUpPaddleBoard-B9o53TFg.js"),__vite__mapDeps([71,1,2,56,3,26,8,7,39,35,69,58,59,61]))),G0=j(()=>R(()=>import("./WaterToys-CFkU1AwQ.js"),__vite__mapDeps([72,1,2,56,3,26,8,7,39,35,69,58,59,61]))),Y0=j(()=>R(()=>import("./JetSkis-BnbOczkA.js"),__vite__mapDeps([73,1,2,56,3,26,8,7,39,35,69,58,59,61,4,5]))),X0=j(()=>R(()=>import("./AxisT220R-DB2vD9k2.js"),__vite__mapDeps([74,1,2,56,3,26,8,7,39,35,69,58,59,61,4,5]))),Q0=j(()=>R(()=>import("./AirWarrior-CExA_3Vo.js"),__vite__mapDeps([75,1,2,4,5,3,56,26,8,7,39,35,69,58,59,61]))),Z0=j(()=>R(()=>import("./TahoeDeckBoat-CPDwd-Pp.js"),__vite__mapDeps([76,1,2,4,5,3,56,26,8,7,39,35,69,58,59,61]))),ex=j(()=>R(()=>import("./CenturionT5-D2FRmsdf.js"),__vite__mapDeps([77,1,2,4,5,3,56,26,8,7,39,35,69,58,59,61]))),tx=j(()=>R(()=>import("./SupercruiserPartyBoat-DO7eipDH.js"),__vite__mapDeps([78,1,2,56,3,26,8,7,39,35,69,58,59,61,4,5]))),rx=j(()=>R(()=>import("./PartyCruiserII-CHGEU2PJ.js"),__vite__mapDeps([79,1,2,56,3,26,8,7,39,35,4,5,69,58,59,61]))),nx=j(()=>R(()=>import("./PatioBoat30-Ct7kOFcu.js"),__vite__mapDeps([80,1,2,56,3,26,8,7,39,35,69,58,59,61,4,5]))),sx=j(()=>R(()=>import("./DeluxePatioBoat-CJzE6Hkw.js"),__vite__mapDeps([81,1,2,56,3,26,8,7,39,35,69,58,59,61,4,5]))),ox=j(()=>R(()=>import("./BenningtonPontoon-DyouRbQm.js"),__vite__mapDeps([82,1,2,56,3,26,8,7,39,35,69,58,59,61,4,5]))),ix=j(()=>R(()=>import("./FishingBoat-CY73bCuT.js"),__vite__mapDeps([83,1,2,56,3,26,8,7,39,35,69,58,59,61,4,5]))),ax=j(()=>R(()=>import("./GatheringYourGroup-DnJI29yh.js"),__vite__mapDeps([84,1,2,26,3,8,7,4,5]))),lx=j(()=>R(()=>import("./WhatToBring-BiCS0jgt.js"),__vite__mapDeps([85,1,2,26,3,4,5]))),cx=j(()=>R(()=>import("./GroupEvents-7pm4O2wq.js"),__vite__mapDeps([86,1,2,8,7,3,26,4,5]))),ux=j(()=>R(()=>import("./PetPolicy-Bgnlfjef.js"),__vite__mapDeps([87,1,2,4,5,3,8,7,26]))),dx=j(()=>R(()=>import("./MattressSizes-D55W0Kmy.js"),__vite__mapDeps([88,1,2,26,3]))),hx=j(()=>R(()=>import("./PriorToArrival-a7zFNmng.js"),__vite__mapDeps([89,1,2,26,3]))),fx=j(()=>R(()=>import("./GuestInformation-ClgrkTDW.js"),__vite__mapDeps([90,1,2,26,3]))),px=j(()=>R(()=>import("./JetSkisSilverthorn-Ch9tOpCL.js"),__vite__mapDeps([91,1,2,56,3,26,8,7,39,35,4,5,92]))),mx=j(()=>R(()=>import("./AxisT220RSilverthorn-B0otuXKO.js"),__vite__mapDeps([93,1,2,56,3,26,8,7,39,35,4,5,92]))),gx=j(()=>R(()=>import("./CenturionT5Silverthorn-BcdVQvu1.js"),__vite__mapDeps([94,1,2,56,3,26,8,7,39,35,4,5,92]))),vx=j(()=>R(()=>import("./TahoeDeckBoatSilverthorn-Ck39rqtH.js"),__vite__mapDeps([95,1,2,56,3,26,8,7,39,35,4,5,92]))),yx=j(()=>R(()=>import("./PatioBoatSilverthorn-DkmBnBeO.js"),__vite__mapDeps([96,1,2,56,3,26,8,7,39,35,4,5,92]))),bx=j(()=>R(()=>import("./SunTrackerPontoonSilverthorn-BTKex2L1.js"),__vite__mapDeps([97,1,2,56,3,26,8,7,39,35,4,5,92]))),wx=j(()=>R(()=>import("./PartyCruiserISilverthorn-XJki4NtS.js"),__vite__mapDeps([98,1,2,56,3,26,8,7,39,35,4,5,92]))),xx=j(()=>R(()=>import("./FishingBoatSilverthorn-C7gYxK5Z.js"),__vite__mapDeps([99,1,2,56,3,26,8,7,39,35,92,4,5]))),_x=j(()=>R(()=>
75import("./KayakSilverthorn-BLn4Guex.js"),__vite__mapDeps([100,1,2,56,3,26,8,7,39,35,4,5,92,61,70]))),Ex=j(()=>R(()=>import("./StandUpPaddleBoardSilverthorn-rxPslUrF.js"),__vite__mapDeps([101,1,2,56,3,26,8,7,39,35,92,4,5]))),Sx=j(()=>R(()=>import("./AccessibilityStatement-C_UKB2fE.js"),__vite__mapDeps([102,1,2,23,26,3,31]))),kx=j(()=>R(()=>import("./AdminLogin-C6zEuCiK.js"),__vite__mapDeps([103,1,2,35,3]))),Tx=j(()=>R(()=>import("./AdminLayout-t0zoVzlR.js"),__vite__mapDeps([104,1,2,3]))),Rx=j(()=>R(()=>import("./AdminOverview-B3O7GFsO.js"),__vite__mapDeps([105,1,2,35,3]))),Ax=j(()=>R(()=>import("./AdminBoatie-CZEyQX0p.js"),__vite__mapDeps([106,1,2,35,49,3,107,108,52,109,50,51,110]))),Cx=j(()=>R(()=>import("./AdminBoatieCost-fijCWJGW.js"),__vite__mapDeps([111,1,2,35,49,3,107,108,52,109,53]))),jx=j(()=>R(()=>import("./AdminBoatieAbuse-B5Ce99Z5.js"),__vite__mapDeps([112,1,2,35,3]))),Px=j(()=>R(()=>import("./AdminBoatieStaff-BzpSCevS.js"),__vite__mapDeps([113,1,2,114,3]))),Ox=j(()=>R(()=>import("./AdminTraffic-BJrUsKXL.js"),__vite__mapDeps([115,1,2,35,114,116,3,49,51,109,47,110,108]))),Nx=j(()=>R(()=>import("./AdminSEO-AmlvUMeb.js"),__vite__mapDeps([117,1,2,35,114,116,3,49,51,109]))),Ix=new Lc,Lx=()=>c.jsx($c,{client:Ix,children:c.jsxs(om,{children:[c.jsx(Ld,{}),c.jsx(ph,{}),c.jsxs(Dc,{children:[c.jsx(cm,{}),c.jsx(p0,{}),c.jsx(y0,{}),c.jsx(a0,{}),c.jsx(hm,{}),c.jsx(um,{}),c.jsx(lm,{}),c.jsx(i0,{}),c.jsx(l0,{}),c.jsx(d0,{}),c.jsx(w0,{}),c.jsx(f.Suspense,{fallback:c.jsx("div",{className:"flex min-h-[50vh] items-center justify-center",children:c.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-primary border-t-transparent","aria-label":"Loading"})}),children:c.jsxs(Mc,{children:[c.jsx(C,{path:"/",element:c.jsx(Ab,{})}),c.jsx(C,{path:"/end-of-summer-sale-shasta-lake",element:c.jsx(x0,{})}),c.jsx(C,{path:"/compare-houseboats",element:c.jsx(Wi,{})}),c.jsx(C,{path:"/houseboats",element:c.jsx(Wi,{})}),c.jsx(C,{path:"/houseboats/:id",element:c.jsx(_0,{})}),c.jsx(C,{path:"/houseboat-rental-prices",element:c.jsx(E0,{})}),c.jsx(C,{path:"/prices",element:c.jsx(Ln,{to:"/houseboat-rental-prices",replace:!0})}),c.jsx(C,{path:"/faq",element:c.jsx(A0,{})}),c.jsx(C,{path:"/contact-us",element:c.jsx(C0,{})}),c.jsx(C,{path:"/marina-store",element:c.jsx(j0,{})}),c.jsx(C,{path:"/boat-slips-storage",element:c.jsx(P0,{})}),c.jsx(C,{path:"/jones-valley-boat-slips",element:c.jsx(O0,{})}),c.jsx(C,{path:"/silverthorn-boat-slips",element:c.jsx(N0,{})}),c.jsx(C,{path:"/sugarloaf-boat-slips",element:c.jsx(I0,{})}),c.jsx(C,{path:"/shasta-lake-info",element:c.jsx(Ln,{to:"/shasta-lake-info/lake-shasta",replace:!0})}),c.jsx(C,{path:"/shasta-lake-info/lake-shasta",element:c.jsx(L0,{})}),c.jsx(C,{path:"/shasta-lake-info/weather-reports",element:c.jsx($0,{})}),c.jsx(C,{path:"/shasta-lake-info/live-weather-cam",element:c.jsx(D0,{})}),c.jsx(C,{path:"/shasta-lake-info/maps-locations",element:c.jsx(U0,{})}),c.jsx(C,{path:"/shasta-lake-info/fishing",element:c.jsx(B0,{})}),c.jsx(C,{path:"/lake-levels",element:c.jsx(M0,{})}),c.jsx(C,{path:"/jones-valley-boat-rentals-shasta-lake",element:c.jsx(F0,{})}),c.jsx(C,{path:"/silverthorn-boat-rentals-shasta-lake",element:c.jsx(H0,{})}),c.jsx(C,{path:"/jones-valley-resort-houseboats",element:c.jsx(V0,{})}),c.jsx(C,{path:"/silverthorn-houseboats",element:c.jsx(W0,{})}),c.jsx(C,{path:"/jones-valley",element:c.jsx(q0,{})}),c.jsx(C,{path:"/silverthorn",element:c.jsx(z0,{})}),c.jsx(C,{path:"/trip-preparation",element:c.jsx(Ln,{to:"/trip-preparation/gathering-your-group",replace:!0})}),c.jsx(C,{path:"/trip-preparation/gathering-your-group",element:c.jsx(ax,{})}),c.jsx(C,{path:"/trip-preparation/what-to-bring",element:c.jsx(lx,{})}),c.jsx(C,{path:"/trip-preparation/group-events",element:c.jsx(cx,{})}),c.jsx(C,{path:"/trip-preparation/pet-policy",element:c.jsx(ux,{})}),c.jsx(C,{path:"/trip-preparation/mattress-sizes",element:c.jsx(dx,{})}),c.jsx(C,{path:"/trip-preparation/prior-to-arrival",element:c.jsx(hx,{})}),c.jsx(C,{path:"/trip-preparation/guest-information",element:c.jsx(fx,{})}),c.jsx(C,{path:"/kayak",element:c.jsx(K0,{})}),c.jsx(C,{path:"/stand-up-paddle-board",element:c.jsx(J0,{})}),c.jsx(C,{path:"/water-toys",element:c.jsx(G0,{})}),c.jsx(C,{path:"/jet-skis",element:c.jsx(Y0,{})}),c.jsx(C,{path:"/axis-t220r-wakeboard",element:c.jsx(X0,{})}),c.jsx(C,{path:"/air-warrior-wakeboard",element:c.jsx(Q0,{})}),c.jsx(C,{path:"/tahoe-deck-boat",element:c.jsx(Z0,{})}),c.jsx(C,{path:"/centurion-t5-wakeboard",element:c.jsx(ex,{})}),c.jsx(C,{path:"/supercruiser-party-boat",element:c.jsx(tx,{})}),c.jsx(C,{path:"/party-cruiser-ii",element:c.jsx(rx,{})}),c.jsx(C,{path:"/patio-boat-30",element:c.jsx(nx,{})}),c.jsx(C,{path:"/deluxe-patio-boat",element:c.jsx(sx,{})}),c.jsx(C,{path:"/bennington-pontoon",element:c.jsx(ox,{})}),c.jsx(C,{path:"/fishing-boat",element:c.jsx(ix,{})}),c.jsx(C,{path:"/jet-skis-silverthorn",element:c.jsx(px,{})}),c.jsx(C,{path:"/axis-t220r-wakeboard-silverthorn",element:c.jsx(mx,{})}),c.jsx(C,{path:"/centurion-t5-wakeboard-silverthorn",element:c.jsx(gx,{})}),c.jsx(C,{path:"/tahoe-deck-boat-silverthorn",element:c.jsx(vx,{})}),c.jsx(C,{path:"/patio-boat-silverthorn",element:c.jsx(yx,{})}),c.jsx(C,{path:"/sun-tracker-pontoon-silverthorn",element:c.jsx(bx,{})}),c.jsx(C,{path:"/party-cruiser-i-silverthorn",element:c.jsx(wx,{})}),c.jsx(C,{path:"/fishing-boat-silverthorn",element:c.jsx(xx,{})}),c.jsx(C,{path:"/kayak-silverthorn",element:c.jsx(_x,{})}),c.jsx(C,{path:"/stand-up-paddle-board-silverthorn",element:c.jsx(Ex,{})}),c.jsx(C,{path:"/embed/hero",element:c.jsx(S0,{})}),c.jsx(C,{path:"/privacy",element:c.jsx(T0,{})}),c.jsx(C,{path:"/terms",element:c.jsx(R0,{})}),c.jsx(C,{path:"/accessibility-statement",element:c.jsx(Sx,{})}),c.jsx(C,{path:"/admin/login",element:c.jsx(kx,{})}),c.jsxs(C,{path:"/admin",element:c.jsx(Tx,{}),children:[c.jsx(C,{index:!0,element:c.jsx(Rx,{})}),c.jsx(C,{path:"boatie",element:c.jsx(Ax,{})}),c.jsx(C,{path:"boatie-cost",element:c.jsx(Cx,{})}),c.jsx(C,{path:"boatie-abuse",element:c.jsx(jx,{})}),c.jsx(C,{path:"boatie-staff",element:c.jsx(Px,{})}),c.jsx(C,{path:"traffic",element:c.jsx(Ox,{})}),c.jsx(C,{path:"seo",element:c.jsx(Nx,{})})]}),c.jsx(C,{path:"*",element:c.jsx(k0,{})})]})})]})]})});Zi(document.getElementById("root")).render(c.jsx(Su,{children:c.jsx(Lx,{})}));export{im as A,me as B,vm as C,r0 as D,ae as E,Kl as F,mm as G,Eu as H,Vm as I,Gs as J,Nu as K,Wx as L,Mm as M,pm as N,Km as O,$e as P,qe as Q,Ks as R,wh as S,om as T,th as U,dm as V,c0 as W,qx as X,R as _,Sc as a,s0 as b,kc as c,ta as d,ft as e,he as f,la as g,Dm as h,cd as i,ue as j,ln as k,fm as l,ng as m,bm as n,_m as o,gm as p,Nm as q,wm as r,xm as s,Im as t,sr as u,ym as v,Fu as w,pt as x,Hx as y,Vx as z};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.