PageSourceSearch

https://littlechapters.app/assets/index_SWRF64zM.js

js littlechapters.app collected 2026-10-02 01:14:01 UTC 633,651 bytes, 240 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/web_CtGH_Ddt.js","assets/vendor-react_DA5Tp51z.js","assets/vendor-supabase_peh8412e.js","assets/vendor-sentry_ionc-ycS.js","assets/vendor-motion_Cx3YYs0B.js","assets/web_BjSAsgK6.js","assets/web_Cj5M3Oc1.js","assets/web_TYP2Iql_.js","assets/web-PpQmeXfA_BSFXDTqk.js","assets/web_D6f5pbhk.js","assets/web_uExlBUxt.js","assets/web_DuzEcwTW.js","assets/web_BD-zp1Yw.js","assets/index.esm_DA0SSHSa.js","assets/web_DwYkotl1.js","assets/web_B9DG_y3K.js","assets/Plus_By6paUpx.js","assets/accordion_DttvZIgm.js","assets/index_AfnTNEaX.js","assets/PlusPromoLanding_Cm6PQC7D.js","assets/web_BENEsIOX.js","assets/web_DdAVD5Y-.js","assets/web_YDgqXPhE.js","assets/web_aw3cizDB.js","assets/Home_BIlZ7US9.js","assets/HeaderBar_BiiWrVkJ.js","assets/useOwnChildren_CtUg_Ujo.js","assets/buddyRoles_U2v661XE.js","assets/use-mobile_DFT-Nh5F.js","assets/birthdayYearUtils_DvVX4Q-u.js","assets/dateOnly_BEk_jueR.js","assets/plus_MKMgjmzn.js","assets/camera_Vh43LU7l.js","assets/book-open_s7BsNNZ3.js","assets/sparkles_CCLTuRMw.js","assets/users_Du-U8RcZ.js","assets/pencil_DzAfIqRa.js","assets/accountSetup_H4zr5uQh.js","assets/chevron-left_DAE9IcyL.js","assets/chevron-right_BK3A0dBH.js","assets/badge_BxLihz5g.js","assets/types_B6_hS6a2.js","assets/Home_D8Md-CES.css","assets/OnboardingRedirect_D0EJ9qj0.js","assets/NotFound_Cci1WwuO.js","assets/Auth_CI1kXNaK.js","assets/Trans_DEOMyMfM.js","assets/form_DBBUJSYx.js","assets/input_o9kSrJt_.js","assets/mail_D2c6j_cJ.js","assets/AuthCallback_C0AgRxVh.js","assets/CheckEmail_DrcXFNoL.js","assets/InviteAccept_Cu5cIdam.js","assets/InviteCodeEntry_DITEE0Jo.js","assets/profileIdentity_E_z75fZG.js","assets/utils_Ba_Ddzym.js","assets/copy_BV3dgkFJ.js","assets/PhotobookEditor_DEPWFFxS.js","assets/photobookService_BIovPY7n.js","assets/designTokens_NOlPXS3W.js","assets/pricingService_bRpNHVnQ.js","assets/usePhotobookPhotoActions_nrmAQOvv.js","assets/BookOpenIcon_BwxjCEsZ.js","assets/calendarSpec_B1lIx289.js","assets/_FullInternals__Tn846QF.js","assets/photoUploadWorker_CdoVI8_C.js","assets/image_Cnx-Q10l.js","assets/ToggleSwitch_By1tY_tG.js","assets/SelectableRow_CCukUu22.js","assets/info_DEuLDM6x.js","assets/minus_CwRlhQKk.js","assets/index_B_ijfGr_.js","assets/CloudflareImageUploadMobile_BNWBVIJo.js","assets/usePhotoLibraryPermission_D4aFWwBi.js","assets/PricingOverviewModal_VDHKvkX6.js","assets/PlusGateDialog_B5a-orjF.js","assets/eye_BzCNbtvj.js","assets/undo-2_BT8tfSiE.js","assets/usePhotobook_BU94sF-A.js","assets/usePhotobookPhotoActions_CY7QE2aC.css","assets/sortable.esm_DILJrNvh.js","assets/trash-2_CEPMqQvn.js","assets/useGoToAppHome_ttoK23PW.js","assets/tutorialVideos_D7AHyLjp.js","assets/CalendarEditor_BeW_9hom.js","assets/useCalendar_t6Rlgi4k.js","assets/calendarService_DdGSD6oo.js","assets/CalendarCheckout_q5sm4Wr8.js","assets/BookSelectionScreen_BCd2liNS.js","assets/user_D8CriCQz.js","assets/DesignLibraryScreen_DCT4rBe4.js","assets/BookMockup_D3f8fscQ.js","assets/bookLabel_DRgukbAC.js","assets/CheckoutPreview_KSsgOThd.js","assets/useFastPreviewPages_CXZqVaHI.js","assets/previewStyles_DUtbo2Wb.css","assets/useCheckoutDiscountSuggestions_nKG4kLwl.js","assets/usePricing_B2gW-kIY.js","assets/tag_BewKjcGj.js","assets/clock_BwamcZrs.js","assets/CheckoutBookSelection_DoXCeRyf.js","assets/star_C1NTcZTo.js","assets/CheckoutSummary_GSZ-J91U.js","assets/SupportSheet_C5dlCAlW.js","assets/flask-conical_aQ6vcgPw.js","assets/life-buoy_DFDB4vFw.js","assets/CheckoutSuccess_P86Mg9k-.js","assets/circle-check-big_BBR7gnJv.js","assets/NativeLanding_CG5nC1qx.js","assets/ExpectingLanding_BAQ0NqNb.js","assets/PrivacyPolicy_BnJlnv6m.js","assets/Terms_RtkxDopB.js","assets/DeleteAccountRequest_CjMxJMgI.js","assets/textarea_CC67RV9U.js","assets/WinbackWhy_CLs6rxb_.js","assets/EmailUnsubscribe_DfRAkBxT.js","assets/Support_DuApj4SA.js","assets/Beveiliging_4-CzGwyH.js","assets/Influencers_CdajvZky.js","assets/Contact_C2VwRJR_.js","assets/AboutUs_BL4dFLy_.js","assets/Yearbook_BLXayZlx.js","assets/GiftCardLanding_5A3dwTEd.js","assets/shapes_BEoXrPP4.js","assets/palette_DIra3vMg.js","assets/giftCard_BsaojPax.js","assets/CadeaubonShapes_DLoTeOS7.js","assets/CadeaubonShapes_XQzTPRfz.css","assets/GiftCardThanks_Cj4--OsW.js","assets/GiftCardDesign_C6EBmzJ6.js","assets/GiftCardContribute_DXf6eiCI.js","assets/GiftCardShareButtons_Cow_YcQX.js","assets/GiftCardPrintCard_BV1y0A2K.js","assets/GiftCardContributeThanks_BPU9VXXN.js","assets/GiftCardRedeemInfo_C0ma96rk.js","assets/Download_FFV4Mx2r.js","assets/AdminDashboard_BncUEfAQ.js","assets/skeleton_DQCxzJS6.js","assets/tiny-invariant_CW8T2kQN.js","assets/external-link_B-Le5Nb_.js","assets/truck__2PItyQK.js","assets/megaphone_DAH9p-ux.js","assets/ShareImport_u4xr_dTD.js","assets/useQuickPhotoUpload_puTnn-Uc.js","assets/Links_BtdhuhfM.js","assets/gift_BBNwRNE2.js","assets/index_Bcf4XSlG.js","assets/web_CqbCfZ8I.js"])))=>i.map(i=>d[i]);
2var P2=Object.defineProperty;var Tu=e=>{throw TypeError(e)};
2var k2=(e,t,n)=>t in e?P2(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Le=(e,t,n)=>k2(e,typeof t!="symbol"?t+"":t,n),fi=(e,t,n)=>t.has(e)||Tu("Cannot "+n);var S=(e,t,n)=>(fi(e,t,"read from private field"),n?n.call(e):t.get(e)),W=(e,t,n)=>t.has(e)?Tu("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),F=(e,t,n,r)=>(fi(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),te=(e,t,n)=>(fi(e,t,"access private method"),n);var wo=(e,t,n,r)=>({set _(s){F(e,t,s,n)},get _(){return S(e,t,r)}});import{r as m,j as u,b as L,m as I2,d as R2,u as T2,e as He,f as tt,N as lt,R as xc,h as Cc,i as S1,k as O2,L as j2,B as L2,l as V,n as M2,o as D2}from"./vendor-react_DA5Tp51z.js";import{c as F2,s as U2,S as B2}from"./vendor-supabase_peh8412e.js";import{w as A1,a as N1,c as $2,r as z2,i as V2,s as P1,b as H2,l as W2,d as q2,e as Ou,f as G2,S as K2,g as Q2,h as k1,j as Y2,E as X2,k as Z2}from"./vendor-sentry_ionc-ycS.js";import{A as J2,m as Mt,u as e3,a as t3,b as fs,c as n3}from"./vendor-motion_Cx3YYs0B.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"1.37"};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="bf04b936-3189-4a71-a0cf-8a5890e8f974",e._sentryDebugIdIdentifier="sentry-dbid-bf04b936-3189-4a71-a0cf-8a5890e8f974")}catch{}})();(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();const r3="modulepreload",s3=function(e){return"/"+e},ju={},B=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),i=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));s=Promise.allSettled(n.map(l=>{if(l=s3(l),l in ju)return;ju[l]=!0;const c=l.endsWith(".css"),d=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${d}`))return;const f=document.createElement("link");if(f.rel=c?"stylesheet":r3,c||(f.as="script"),f.crossOrigin="",f.href=l,i&&f.setAttribute("nonce",i),document.head.appendChild(f),c)return new Promise((h,p)=>{f.addEventListener("load",h),f.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${l}`)))})}))}function o(a){const i=new Event("vite:preloadError",{cancelable:!0});if(i.payload=a,window.dispatchEvent(i),!i.defaultPrevented)throw a}return s.then(a=>{for(const i of a||[])i.status==="rejected"&&o(i.reason);return t().catch(o)})};var as=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},qn,wn,Br,p1,o3=(p1=class extends as{constructor(){super();W(this,qn);W(this,wn);W(this,Br);F(this,Br,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){S(this,wn)||this.setEventListener(S(this,Br))}onUnsubscribe(){var t;this.hasListeners()||((t=S(this,wn))==null||t.call(this),F(this,wn,void 0))}setEventListener(t){var n;F(this,Br,t),(n=S(this,wn))==null||n.call(this),F(this,wn,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){S(this,qn)!==t&&(F(this,qn,t),this.onFocus())}onFocus(){const t=this.isFocused();
2this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof S(this,qn)=="boolean"?S(this,qn):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},qn=new WeakMap,wn=new WeakMap,Br=new WeakMap,p1),ao=new o3,a3={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},xn,wc,m1,i3=(m1=class{constructor(){W(this,xn,a3);W(this,wc,!1)}setTimeoutProvider(e){F(this,xn,e)}setTimeout(e,t){return S(this,xn).setTimeout(e,t)}clearTimeout(e){S(this,xn).clearTimeout(e)}setInterval(e,t){return S(this,xn).setInterval(e,t)}clearInterval(e){S(this,xn).clearInterval(e)}},xn=new WeakMap,wc=new WeakMap,m1),Jt=new i3;function l3(e){setTimeout(e,0)}var c3=typeof window>"u"||"Deno"in globalThis;function Me(){}function u3(e,t){return typeof e=="function"?e(t):e}function el(e){return typeof e=="number"&&e>=0&&e!==1/0}function I1(e,t){return Math.max(e+(t||0)-Date.now(),0)}function In(e,t){return typeof e=="function"?e(t):e}function rt(e,t){return typeof e=="function"?e(t):e}function Lu(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:o,queryKey:a,stale:i}=e;if(a){if(r){if(t.queryHash!==_c(a,t.options))return!1}else if(!Bs(t.queryKey,a))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof i=="boolean"&&t.isStale()!==i||s&&s!==t.state.fetchStatus||o&&!o(t))}function Mu(e,t){const{exact:n,status:r,predicate:s,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(ir(t.options.mutationKey)!==ir(o))return!1}else if(!Bs(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function _c(e,t){return((t==null?void 0:t.queryKeyHashFn)||ir)(e)}function ir(e){return JSON.stringify(e,(t,n)=>tl(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function Bs(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Bs(e[n],t[n])):!1}var d3=Object.prototype.hasOwnProperty;function R1(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=Du(e)&&Du(t);if(!r&&!(tl(e)&&tl(t)))return t;const o=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),i=a.length,l=r?new Array(i):{};let c=0;for(let d=0;d<i;d++){const f=r?d:a[d],h=e[f],p=t[f];if(h===p){l[f]=h,(r?d<o:d3.call(e,f))&&c++;continue}if(h===null||p===null||typeof h!="object"||typeof p!="object"){l[f]=p;continue}const g=R1(h,p,n+1);l[f]=g,g===h&&c++}return o===i&&c===o?e:l}function ta(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Du(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function tl(e){if(!Fu(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Fu(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Fu(e){return Object.prototype.toString.call(e)==="[object Object]"}function f3(e){return new Promise(t=>{Jt.setTimeout(t,e)})}function nl(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?R1(e,t):t}function mP(e){return e}function h3(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function p3(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Ec=Symbol();function T1(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Ec?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Sc(e,t){return typeof e=="function"?e(...t):!!e}function m3(e,t,n){let r=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??(s=t()),r||(r=!0,s.aborted?n():s.addEventListener("abort",n,{once:!0})),s)}),e}var $s=(()=>{let e=()=>c3;return{isServer(){return e()},setIsServer(t){e=t}}})();function rl(){let e,t;const n=new Promise((s,o)=>{e=s,t=o});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),e(s)},n.reject=s=>{r({status:"rejected",reason:s}),t(s)},n}function g3(e){var n;let t;if((n=e.then(r=>(t=r,r),Me))==null||n.catch(Me),t!==void 0)return{data:t}}function O1(e){return e}function y3(e){return{mutationKey:e.options.mutationKey,state:e.state,...e.options.scope&&{scope:e.options.scope},...e.meta&&{meta:e.meta}}}function v3(e,t,n){const r=()=>{var o;
2const s=(o=e.promise)==null?void 0:o.then(t).catch(a=>n(a)?Promise.reject(new Error("redacted")):Promise.reject(a));return s==null||s.catch(Me),s};return{dehydratedAt:Date.now(),state:{...e.state,...e.state.data!==void 0&&{data:t(e.state.data)}},queryKey:e.queryKey,queryHash:e.queryHash,...e.state.status==="pending"&&{promise:r()},...e.meta&&{meta:e.meta},...e.queryType&&{queryType:e.queryType}}}function b3(e){return e.state.isPaused}function w3(e){return e.state.status==="success"}function x3(e){return!0}function C3(e,t={}){var l,c,d,f;const n=t.shouldDehydrateMutation??((l=e.getDefaultOptions().dehydrate)==null?void 0:l.shouldDehydrateMutation)??b3,r=e.getMutationCache().getAll().flatMap(h=>n(h)?[y3(h)]:[]),s=t.shouldDehydrateQuery??((c=e.getDefaultOptions().dehydrate)==null?void 0:c.shouldDehydrateQuery)??w3,o=t.shouldRedactErrors??((d=e.getDefaultOptions().dehydrate)==null?void 0:d.shouldRedactErrors)??x3,a=t.serializeData??((f=e.getDefaultOptions().dehydrate)==null?void 0:f.serializeData)??O1,i=e.getQueryCache().getAll().flatMap(h=>s(h)?[v3(h,a,o)]:[]);return{mutations:r,queries:i}}function _3(e,t,n){var l,c;if(typeof t!="object"||t===null)return;const r=e.getMutationCache(),s=e.getQueryCache(),o=((l=n==null?void 0:n.defaultOptions)==null?void 0:l.deserializeData)??((c=e.getDefaultOptions().hydrate)==null?void 0:c.deserializeData)??O1,a=t.mutations||[],i=t.queries||[];a.forEach(({state:d,...f})=>{var h,p;r.build(e,{...(h=e.getDefaultOptions().hydrate)==null?void 0:h.mutations,...(p=n==null?void 0:n.defaultOptions)==null?void 0:p.mutations,...f},d)}
2),i.forEach(({queryKey:d,state:f,queryHash:h,meta:p,promise:g,dehydratedAt:y,queryType:v})=>{var N,E;const x=g?g3(g):void 0,C=f.data===void 0?x==null?void 0:x.data:f.data,_=C===void 0?C:o(C);let b=s.get(h);const w=(b==null?void 0:b.state.status)==="pending",P=(b==null?void 0:b.state.fetchStatus)==="fetching";if(b){const A=x&&y!==void 0&&y>b.state.dataUpdatedAt;if(f.dataUpdatedAt>b.state.dataUpdatedAt||A){const{fetchStatus:k,...T}=f;b.setState({...T,data:_,...f.status==="pending"&&_!==void 0&&{status:"success",dataUpdatedAt:y??Date.now(),...!P&&{fetchStatus:"idle"}}})}}else b=s.build(e,{...(N=e.getDefaultOptions().hydrate)==null?void 0:N.queries,...(E=n==null?void 0:n.defaultOptions)==null?void 0:E.queries,queryKey:d,queryHash:h,meta:p,_type:v},{...f,data:_,fetchStatus:"idle",status:f.status==="pending"&&_!==void 0?"success":f.status,...f.status==="pending"&&_!==void 0&&{dataUpdatedAt:y??Date.now()}});g&&!x&&!w&&!P&&(y===void 0||y>b.state.dataUpdatedAt)&&b.fetch(void 0,{initialPromise:Promise.resolve(g).then(o)}).catch(Me)})}var E3=l3;function S3(){let e=[],t=0,n=i=>{i()},r=i=>{i()},s=E3;const o=i=>{t?e.push(i):s(()=>{n(i)})},a=()=>{const i=e;e=[],i.length&&s(()=>{r(()=>{i.forEach(l=>{n(l)})})})};return{batch:i=>{let l;t++;try{l=i()}finally{t--,t||a()}return l},batchCalls:i=>(...l)=>{o(()=>{i(...l)})},schedule:o,setNotifyFunction:i=>{n=i},setBatchNotifyFunction:i=>{r=i},setScheduler:i=>{s=i}}}var De=S3(),$r,Cn,zr,g1,A3=(g1=class extends as{constructor(){super();W(this,$r,!0);W(this,Cn);W(this,zr);F(this,zr,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){S(this,Cn)||this.setEventListener(S(this,zr))}onUnsubscribe(){var t;this.hasListeners()||((t=S(this,Cn))==null||t.call(this),F(this,Cn,void 0))}setEventListener(t){var n;F(this,zr,t),(n=S(this,Cn))==null||n.call(this),F(this,Cn,t(this.setOnline.bind(this)))}setOnline(t){S(this,$r)!==t&&(F(this,$r,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return S(this,$r)}},$r=new WeakMap,Cn=new WeakMap,zr=new WeakMap,g1),zs=new A3;function N3(e){return Math.min(1e3*2**e,3e4)}function j1(e){return(e??"online")==="online"?zs.isOnline():!0}var sl=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function L1(e){let t=!1,n=0,r;const s=rl(),o=()=>s.status!=="pending",a=y=>{var v;if(!o()){const x=new sl(y);h(x),(v=e.onCancel)==null||v.call(e,x)}},i=()=>{t=!0},l=()=>{t=!1},c=()=>ao.isFocused()&&(e.networkMode==="always"||zs.isOnline())&&e.canRun(),d=()=>j1(e.networkMode)&&e.canRun(),f=y=>{o()||(r==null||r(),s.resolve(y))},h=y=>{o()||(r==null||r(),s.reject(y))},p=()=>new Promise(y=>{var v;r=x=>{(o()||c())&&y(x)},(v=e.onPause)==null||v.call(e)}).then(()=>{var y;r=void 0,o()||(y=e.onContinue)==null||y.call(e)}),g=()=>{if(o())return;let y;const v=n===0?e.initialPromise:void 0;try{y=v??e.fn()}catch(x){y=Promise.reject(x)}Promise.resolve(y).then(f).catch(x=>{var P;if(o())return;const C=e.retry??($s.isServer()?0:3),_=e.retryDelay??N3,b=typeof _=="function"?_(n,x):_,w=C===!0||typeof C=="number"&&n<C||typeof C=="function"&&C(n,x);if(t||!w){h(x);return}n++,(P=e.onFail)==null||P.call(e,n,x),f3(b).then(()=>c()?void 0:p()).then(()=>{t?h(x):g()})})};return{promise:s,status:()=>s.status,cancel:a,continue:()=>(r==null||r(),s),cancelRetry:i,continueRetry:l,canStart:d,start:()=>(d()?g():p().then(g),s)}}var Gn,y1,M1=(y1=class{constructor(){W(this,Gn)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),el(this.gcTime)&&F(this,Gn,Jt.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??($s.isServer()?1/0:5*60*1e3))}clearGcTimeout(){S(this,Gn)!==void 0&&(Jt.clearTimeout(S(this,Gn)),F(this,Gn,void 0))}},Gn=new WeakMap,y1);function P3(e){return{onFetch:(t,n)=>{var d,f,h,p,g;const r=t.options,s=(h=(f=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:f.fetchMore)==null?void 0:h.direction,o=((p=t.state.data)==null?void 0:p.pages)||[],a=((g=t.state.data)==null?void 0:g.pageParams)||[];let i={pages:[],pageParams:[]},l=0;const c=async()=>{let y=!1;const v=_=>{m3(_,()=>t.signal,()=>y=!0)},x=T1(t.options,t.fetchOptions),C=async(_,b,w)=>{if(y)return Promise.reject(t.signal.reason);if(b==null&&_.pages.length)return Promise.resolve(_);const N=(()=>{const T={client:t.client,queryKey:t.queryKey,pageParam:b,direction:w?"backward":"forward",meta:t.options.meta};return v(T),T})(),E=await x(N),{maxPages:A}=t.options,k=w?p3:h3;return{pages:k(_.pages,E,A),pageParams:k(_.pageParams,b,A)}};if(s&&o.length){const _=s==="backward",b=_?k3:Uu,w={pages:o,pageParams:a},P=b(r,w);i=await C(w,P,_)}else{const _=e??o.length;do{const b=l===0?a[0]??r.initialPageParam:Uu(r,i);if(l>0&&b==null)break;
2i=await C(i,b),l++}while(l<_)}return i};t.options.persister?t.fetchFn=()=>{var y,v;return(v=(y=t.options).persister)==null?void 0:v.call(y,c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function Uu(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function k3(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var Vr,Kn,Hr,ct,Qn,Ue,to,Yn,nt,D1,Gt,v1,I3=(v1=class extends M1{constructor(t){super();W(this,nt);W(this,Vr);W(this,Kn);W(this,Hr);W(this,ct);W(this,Qn);W(this,Ue);W(this,to);W(this,Yn);F(this,Yn,!1),F(this,to,t.defaultOptions),this.setOptions(t.options),this.observers=[],F(this,Qn,t.client),F(this,ct,S(this,Qn).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,F(this,Kn,$u(this.options)),this.state=t.state??S(this,Kn),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return S(this,Vr)}get promise(){var t;return(t=S(this,Ue))==null?void 0:t.promise}setOptions(t){if(this.options={...S(this,to),...t},t!=null&&t._type&&F(this,Vr,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=$u(this.options);n.data!==void 0&&(this.setState(Bu(n.data,n.dataUpdatedAt)),F(this,Kn,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&S(this,ct).remove(this)}setData(t,n){const r=nl(this.state.data,t,this.options);return te(this,nt,Gt).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t){te(this,nt,Gt).call(this,{type:"setState",state:t})}cancel(t){var r,s;const n=(r=S(this,Ue))==null?void 0:r.promise;return(s=S(this,Ue))==null||s.cancel(t),n?n.then(Me).catch(Me):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return S(this,Kn)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>rt(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Ec||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>In(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!I1(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=S(this,Ue))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=S(this,Ue))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),S(this,ct).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(S(this,Ue)&&(S(this,Yn)||te(this,nt,D1).call(this)?S(this,Ue).cancel({revert:!0}):S(this,Ue).cancelRetry()),this.scheduleGc()),S(this,ct).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||te(this,nt,Gt).call(this,{type:"invalidate"})}async fetch(t,n){var c,d,f,h,p,g,y,v,x,C,_;if(this.state.fetchStatus!=="idle"&&((c=S(this,Ue))==null?void 0:c.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(S(this,Ue))return S(this,Ue).continueRetry(),S(this,Ue).promise}if(t&&this.setOptions(t),!this.options.queryFn){const b=this.observers.find(w=>w.options.queryFn);b&&this.setOptions(b.options)}const r=new AbortController,s=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(F(this,Yn,!0),r.signal)})},o=()=>{const b=T1(this.options,n),P=(()=>{const N={client:S(this,Qn),queryKey:this.queryKey,meta:this.meta};return s(N),N})();return F(this,Yn,!1),this.options.persister?this.options.persister(b,P,this):b(P)},i=(()=>{const b={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:S(this,Qn),state:this.state,fetchFn:o};return s(b),b})(),l=S(this,Vr)==="infinite"?P3(this.options.pages):this.options.behavior;l==null||l.onFetch(i,this),F(this,Hr,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=i.fetchOptions)==null?void 0:d.meta))&&te(this,nt,Gt).call(this,{type:"fetch",meta:(f=i.fetchOptions)==null?void 0:f.meta}),F(this,Ue,L1({initialPromise:n==null?void 0:n.initialPromise,fn:i.fetchFn,onCancel:b=>{b instanceof sl&&b.revert&&this.setState({...S(this,Hr),fetchStatus:"idle"}),r.abort()},onFail:(b,w)=>{te(this,nt,Gt).call(this,{type:"failed",failureCount:b,error:w})},onPause:()=>{te(this,nt,Gt).call(this,{type:"pause"})},onContinue:()=>{te(this,nt,Gt).call(this,{type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0}));try{const b=await S(this,Ue).start();if(b===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(b),(p=(h=S(this,ct).config).onSuccess)==null||p.call(h,b,this),(y=(g=S(this,ct).config).onSettled)==null||y.call(g,b,this.state.error,this),b}catch(b){if(b instanceof sl){if(b.silent)return S(this,Ue).promise;if(b.revert){if(this.state.data===void 0)throw b;return this.state.data}}throw te(this,nt,Gt).call(this,{type:"error",error:b}),(x=(v=S(this,ct).config).onError)==null||x.call(v,b,this),(_=(C=S(this,ct).config).onSettled)==null||_.call(C,this.state.data,b,this),b}finally{this.scheduleGc()}}},Vr=new WeakMap,Kn=new WeakMap,Hr=new WeakMap,ct=new WeakMap,Qn=new WeakMap,Ue=new WeakMap,to=new WeakMap,Yn=new WeakMap,nt=new WeakSet,D1=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Gt=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...F1(r.data,this.options),fetchMeta:t.meta??null};case"success":const s={...r,...Bu(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return F(this,Hr,t.manual?s:void 0),s;case"error":const o=t.error;
vendor: 4,214 bytes, line 2
2return{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),De.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),S(this,ct).notify({query:this,type:"updated",action:t})})},v1);function F1(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:j1(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Bu(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function $u(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Ze,ae,no,qe,Xn,Wr,Kt,_n,ro,qr,Gr,Zn,Jn,En,Kr,le,Ps,ol,al,il,ll,cl,ul,dl,U1,b1,R3=(b1=class extends as{constructor(t,n){super();W(this,le);W(this,Ze);W(this,ae);W(this,no);W(this,qe);W(this,Xn);W(this,Wr);W(this,Kt);W(this,_n);W(this,ro);W(this,qr);W(this,Gr);W(this,Zn);W(this,Jn);W(this,En);W(this,Kr,new Set);this.options=n,F(this,Ze,t),F(this,_n,null),F(this,Kt,rl()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(S(this,ae).addObserver(this),zu(S(this,ae),this.options)?te(this,le,Ps).call(this):this.updateResult(),te(this,le,ll).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return fl(S(this,ae),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return fl(S(this,ae),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,te(this,le,cl).call(this),te(this,le,ul).call(this),S(this,ae).removeObserver(this)}setOptions(t){const n=this.options,r=S(this,ae);if(this.options=S(this,Ze).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof rt(this.options.enabled,S(this,ae))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");te(this,le,dl).call(this),S(this,ae).setOptions(this.options),n._defaulted&&!ta(this.options,n)&&S(this,Ze).getQueryCache().notify({type:"observerOptionsUpdated",query:S(this,ae),observer:this});const s=this.hasListeners();s&&Vu(S(this,ae),r,this.options,n)&&te(this,le,Ps).call(this),this.updateResult(),s&&(S(this,ae)!==r||rt(this.options.enabled,S(this,ae))!==rt(n.enabled,S(this,ae))||In(this.options.staleTime,S(this,ae))!==In(n.staleTime,S(this,ae)))&&te(this,le,ol).call(this);const o=te(this,le,al).call(this);s&&(S(this,ae)!==r||rt(this.options.enabled,S(this,ae))!==rt(n.enabled,S(this,ae))||o!==S(this,En))&&te(this,le,il).call(this,o)}getOptimisticResult(t){const n=S(this,Ze).getQueryCache().build(S(this,Ze),t),r=this.createResult(n,t);return O3(this,r)&&(F(this,qe,r),F(this,Wr,this.options),F(this,Xn,S(this,ae).state)),r}getCurrentResult(){return S(this,qe)}trackResult(t,n){return new Proxy(t,{get:(r,s)=>(this.trackProp(s),n==null||n(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&S(this,Kt).status==="pending"&&S(this,Kt).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,s))})}trackProp(t){S(this,Kr).add(t)}getCurrentQuery(){return S(this,ae)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=S(this,Ze).defaultQueryOptions(t),r=S(this,Ze).getQueryCache().build(S(this,Ze),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return te(this,le,Ps).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),S(this,qe)))}createResult(t,n){var A;const r=S(this,ae),s=this.options,o=S(this,qe),a=S(this,Xn),i=S(this,Wr),c=t!==r?t.state:S(this,no),{state:d}=t;let f={...d},h=!1,p;
2if(n._optimisticResults){const k=this.hasListeners(),T=!k&&zu(t,n),I=k&&Vu(t,r,n,s);(T||I)&&(f={...f,...F1(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:g,errorUpdatedAt:y,status:v}=f;p=f.data;let x=!1;if(n.placeholderData!==void 0&&p===void 0&&v==="pending"){let k;o!=null&&o.isPlaceholderData&&n.placeholderData===(i==null?void 0:i.placeholderData)?(k=o.data,x=!0):k=typeof n.placeholderData=="function"?n.placeholderData((A=S(this,Gr))==null?void 0:A.state.data,S(this,Gr)):n.placeholderData,k!==void 0&&(v="success",p=nl(o==null?void 0:o.data,k,n),h=!0)}if(n.select&&p!==void 0&&!x)if(o&&p===(a==null?void 0:a.data)&&n.select===S(this,ro))p=S(this,qr);else try{F(this,ro,n.select),p=n.select(p),p=nl(o==null?void 0:o.data,p,n),F(this,qr,p),F(this,_n,null)}catch(k){F(this,_n,k)}S(this,_n)&&(g=S(this,_n),p=S(this,qr),y=Date.now(),v="error");const C=f.fetchStatus==="fetching",_=v==="pending",b=v==="error",w=_&&C,P=p!==void 0,E={status:v,fetchStatus:f.fetchStatus,isPending:_,isSuccess:v==="success",isError:b,isInitialLoading:w,isLoading:w,data:p,dataUpdatedAt:f.dataUpdatedAt,error:g,errorUpdatedAt:y,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:f.dataUpdateCount>c.dataUpdateCount||f.errorUpdateCount>c.errorUpdateCount,isFetching:C,isRefetching:C&&!_,isLoadingError:b&&!P,isPaused:f.fetchStatus==="paused",isPlaceholderData:h,isRefetchError:b&&P,isStale:Ac(t,n),refetch:this.refetch,promise:S(this,Kt),isEnabled:rt(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const k=E.data!==void 0,T=E.status==="error"&&!k,I=M=>{T?M.reject(E.error):k&&M.resolve(E.data)},R=()=>{const M=F(this,Kt,E.promise=rl());I(M)},O=S(this,Kt);switch(O.status){case"pending":t.queryHash===r.queryHash&&I(O);break;case"fulfilled":(T||E.data!==O.value)&&R();break;case"rejected":(!T||E.error!==O.reason)&&R();break}}return E}updateResult(){const t=S(this,qe),n=this.createResult(S(this,ae),this.options);if(F(this,Xn,S(this,ae).state),F(this,Wr,this.options),S(this,Xn).data!==void 0&&F(this,Gr,S(this,ae)),ta(n,t))return;F(this,qe,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,o=typeof s=="function"?s():s;if(o==="all"||!o&&!S(this,Kr).size)return!0;const a=new Set(o??S(this,Kr));return this.options.throwOnError&&a.add("error"),Object.keys(S(this,qe)).some(i=>{const l=i;return S(this,qe)[l]!==t[l]&&a.has(l)})};te(this,le,U1).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&te(this,le,ll).call(this)}},Ze=new WeakMap,ae=new WeakMap,no=new WeakMap,qe=new WeakMap,Xn=new WeakMap,Wr=new WeakMap,Kt=new WeakMap,_n=new WeakMap,ro=new WeakMap,qr=new WeakMap,Gr=new WeakMap,Zn=new WeakMap,Jn=new WeakMap,En=new WeakMap,Kr=new WeakMap,le=new WeakSet,Ps=function(t){te(this,le,dl).call(this);let n=S(this,ae).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Me)),n},ol=function(){te(this,le,cl).call(this);const t=In(this.options.staleTime,S(this,ae));if($s.isServer()||S(this,qe).isStale||!el(t))return;const r=I1(S(this,qe).dataUpdatedAt,t)+1;F(this,Zn,Jt.setTimeout(()=>{S(this,qe).isStale||this.updateResult()},r))},al=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(S(this,ae)):this.options.refetchInterval)??!1},il=function(t){te(this,le,ul).call(this),F(this,En,t),!($s.isServer()||rt(this.options.enabled,S(this,ae))===!1||!el(S(this,En))||S(this,En)===0)&&F(this,Jn,Jt.setInterval(()=>{(this.options.refetchIntervalInBackground||ao.isFocused())&&te(this,le,Ps).call(this)},S(this,En)))},ll=function(){te(this,le,ol).call(this),te(this,le,il).call(this,te(this,le,al).call(this))},cl=function(){S(this,Zn)!==void 0&&(Jt.clearTimeout(S(this,Zn)),F(this,Zn,void 0))},ul=function(){S(this,Jn)!==void 0&&(Jt.clearInterval(S(this,Jn)),F(this,Jn,void 0))},dl=function(){const t=S(this,Ze).getQueryCache().build(S(this,Ze),this.options);if(t===S(this,ae))return;const n=S(this,ae);F(this,ae,t),F(this,no,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},U1=function(t){De.batch(()=>
2{t.listeners&&this.listeners.forEach(n=>{n(S(this,qe))}),S(this,Ze).getQueryCache().notify({query:S(this,ae),type:"observerResultsUpdated"})})},b1);function T3(e,t){return rt(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&rt(t.retryOnMount,e)===!1)}function zu(e,t){return T3(e,t)||e.state.data!==void 0&&fl(e,t,t.refetchOnMount)}function fl(e,t,n){if(rt(t.enabled,e)!==!1&&In(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Ac(e,t)}return!1}function Vu(e,t,n,r){return(e!==t||rt(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Ac(e,n)}function Ac(e,t){return rt(t.enabled,e)!==!1&&e.isStaleByTime(In(t.staleTime,e))}function O3(e,t){return!ta(e.getCurrentResult(),t)}var so,Rt,Ve,er,Tt,yn,w1,j3=(w1=class extends M1{constructor(t){super();W(this,Tt);W(this,so);W(this,Rt);W(this,Ve);W(this,er);F(this,so,t.client),this.mutationId=t.mutationId,F(this,Ve,t.mutationCache),F(this,Rt,[]),this.state=t.state||B1(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){S(this,Rt).includes(t)||(S(this,Rt).push(t),this.clearGcTimeout(),S(this,Ve).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){F(this,Rt,S(this,Rt).filter(n=>n!==t)),this.scheduleGc(),S(this,Ve).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){S(this,Rt).length||(this.state.status==="pending"?this.scheduleGc():S(this,Ve).remove(this))}continue(){var t;return((t=S(this,er))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var a,i,l,c,d,f,h,p,g,y,v,x,C,_,b,w,P,N;const n=()=>{te(this,Tt,yn).call(this,{type:"continue"})},r={client:S(this,so),meta:this.options.meta,mutationKey:this.options.mutationKey};F(this,er,L1({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(E,A)=>{te(this,Tt,yn).call(this,{type:"failed",failureCount:E,error:A})},onPause:()=>{te(this,Tt,yn).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>S(this,Ve).canRun(this)}));const s=this.state.status==="pending",o=!S(this,er).canStart();try{if(s)n();else{te(this,Tt,yn).call(this,{type:"pending",variables:t,isPaused:o}),S(this,Ve).config.onMutate&&await S(this,Ve).config.onMutate(t,this,r);const A=await((i=(a=this.options).onMutate)==null?void 0:i.call(a,t,r));A!==this.state.context&&te(this,Tt,yn).call(this,{type:"pending",context:A,variables:t,isPaused:o})}const E=await S(this,er).start();return await((c=(l=S(this,Ve).config).onSuccess)==null?void 0:c.call(l,E,t,this.state.context,this,r)),await((f=(d=this.options).onSuccess)==null?void 0:f.call(d,E,t,this.state.context,r)),await((p=(h=S(this,Ve).config).onSettled)==null?void 0:p.call(h,E,null,this.state.variables,this.state.context,this,r)),await((y=(g=this.options).onSettled)==null?void 0:y.call(g,E,null,t,this.state.context,r)),te(this,Tt,yn).call(this,{type:"success",data:E}),E}catch(E){try{await((x=(v=S(this,Ve).config).onError)==null?void 0:x.call(v,E,t,this.state.context,this,r))}catch(A){Promise.reject(A)}try{await((_=(C=this.options).onError)==null?void 0:_.call(C,E,t,this.state.context,r))}catch(A){Promise.reject(A)}try{await((w=(b=S(this,Ve).config).onSettled)==null?void 0:w.call(b,void 0,E,this.state.variables,this.state.context,this,r))}catch(A){Promise.reject(A)}try{await((N=(P=this.options).onSettled)==null?void 0:N.call(P,void 0,E,t,this.state.context,r))}catch(A){Promise.reject(A)}throw te(this,Tt,yn).call(this,{type:"error",error:E}),E}finally{S(this,Ve).runNext(this)}}},so=new WeakMap,Rt=new WeakMap,Ve=new WeakMap,er=new WeakMap,Tt=new WeakSet,yn=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPau
2sed,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),De.batch(()=>{S(this,Rt).forEach(r=>{r.onMutationUpdate(t)}),S(this,Ve).notify({mutation:this,type:"updated",action:t})})},w1);function B1(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Qt,vt,oo,x1,L3=(x1=class extends as{constructor(t={}){super();W(this,Qt);W(this,vt);W(this,oo);this.config=t,F(this,Qt,new Set),F(this,vt,new Map),F(this,oo,0)}build(t,n,r){const s=new j3({client:t,mutationCache:this,mutationId:++wo(this,oo)._,options:t.defaultMutationOptions(n),state:r});return this.add(s),s}add(t){S(this,Qt).add(t);const n=xo(t);if(typeof n=="string"){const r=S(this,vt).get(n);r?r.push(t):S(this,vt).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(S(this,Qt).delete(t)){const n=xo(t);if(typeof n=="string"){const r=S(this,vt).get(n);if(r)if(r.length>1){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}else r[0]===t&&S(this,vt).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=xo(t);if(typeof n=="string"){const r=S(this,vt).get(n),s=r==null?void 0:r.find(o=>o.state.status==="pending");return!s||s===t}else return!0}runNext(t){var r;const n=xo(t);if(typeof n=="string"){const s=(r=S(this,vt).get(n))==null?void 0:r.find(o=>o!==t&&o.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){De.batch(()=>{S(this,Qt).forEach(t=>{this.notify({type:"removed",mutation:t})}),S(this,Qt).clear(),S(this,vt).clear()})}getAll(){return Array.from(S(this,Qt))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Mu(n,r))}findAll(t={}){return this.getAll().filter(n=>Mu(t,n))}notify(t){De.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return De.batch(()=>Promise.all(t.map(n=>n.continue().catch(Me))))}},Qt=new WeakMap,vt=new WeakMap,oo=new WeakMap,x1);function xo(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Yt,Sn,Je,Xt,rn,zo,hl,C1,M3=(C1=class extends as{constructor(n,r){super();W(this,rn);W(this,Yt);W(this,Sn);W(this,Je);W(this,Xt);F(this,Yt,n),this.setOptions(r),this.bindMethods(),te(this,rn,zo).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var s;const r=this.options;this.options=S(this,Yt).defaultMutationOptions(n),ta(this.options,r)||S(this,Yt).getMutationCache().notify({type:"observerOptionsUpdated",mutation:S(this,Je),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&ir(r.mutationKey)!==ir(this.options.mutationKey)?this.reset():((s=S(this,Je))==null?void 0:s.state.status)==="pending"&&S(this,Je).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=S(this,Je))==null||n.removeObserver(this)}onMutationUpdate(n){te(this,rn,zo).call(this),te(this,rn,hl).call(this,n)}getCurrentResult(){return S(this,Sn)}reset(){var n;(n=S(this,Je))==null||n.removeObserver(this),F(this,Je,void 0),te(this,rn,zo).call(this),te(this,rn,hl).call(this)}mutate(n,r){var s;return F(this,Xt,r),(s=S(this,Je))==null||s.removeObserver(this),F(this,Je,S(this,Yt).getMutationCache().build(S(this,Yt),this.options)),S(this,Je).addObserver(this),S(this,Je).execute(n)}},Yt=new WeakMap,Sn=new WeakMap,Je=new WeakMap,Xt=new WeakMap,rn=new WeakSet,zo=function(){var r;const n=((r=S(this,Je))==null?void 0:r.state)??B1();F(this,Sn,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},hl=function(n){De.batch(()=>{var r,s,o,a,i,l,c,d;if(S(this,Xt)&&this.hasListeners()){const f=S(this,Sn).variables,h=S(this,Sn).context,p={client:S(this,Yt),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(s=(r=S(this,Xt)).onSuccess)==null||s.call(r,n.data,f,h,p)}catch(g){Promise.reject(g)}try{(a=(o=S(this,Xt)).onSettled)==null||a.call(o,n.data,null,f,h,p)}catch(g){Promise.reject(g)}}else if((n==null?void 0:n.type)==="error"){try{(l=(i=S(this,Xt)).onError)==null||l.call(i,n.error,f,h,p)}catch(g){Promise.reject(g)}try{(d=(c=S(this,Xt)).onSettled)==null||d.call(c,void 0,n.error,f,h,p)}catch(g){Promise.reject(g)}}}
2this.listeners.forEach(f=>{f(S(this,Sn))})})},C1),Ot,_1,D3=(_1=class extends as{constructor(t={}){super();W(this,Ot);this.config=t,F(this,Ot,new Map)}build(t,n,r){const s=n.queryKey,o=n.queryHash??_c(s,n);let a=this.get(o);return a||(a=new I3({client:t,queryKey:s,queryHash:o,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(s)}),this.add(a)),a}add(t){S(this,Ot).has(t.queryHash)||(S(this,Ot).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=S(this,Ot).get(t.queryHash);n&&(t.destroy(),n===t&&S(this,Ot).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){De.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return S(this,Ot).get(t)}getAll(){return[...S(this,Ot).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Lu(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Lu(t,r)):n}notify(t){De.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){De.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){De.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Ot=new WeakMap,_1),Ae,An,Nn,Qr,Yr,Pn,Xr,Zr,E1,F3=(E1=class{constructor(e={}){W(this,Ae);W(this,An);W(this,Nn);W(this,Qr);W(this,Yr);W(this,Pn);W(this,Xr);W(this,Zr);F(this,Ae,e.queryCache||new D3),F(this,An,e.mutationCache||new L3),F(this,Nn,e.defaultOptions||{}),F(this,Qr,new Map),F(this,Yr,new Map),F(this,Pn,0)}mount(){wo(this,Pn)._++,S(this,Pn)===1&&(F(this,Xr,ao.subscribe(async e=>{e&&(await this.resumePausedMutations(),S(this,Ae).onFocus())})),F(this,Zr,zs.subscribe(async e=>{e&&(await this.resumePausedMutations(),S(this,Ae).onOnline())})))}unmount(){var e,t;wo(this,Pn)._--,S(this,Pn)===0&&((e=S(this,Xr))==null||e.call(this),F(this,Xr,void 0),(t=S(this,Zr))==null||t.call(this),F(this,Zr,void 0))}isFetching(e){return S(this,Ae).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return S(this,An).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=S(this,Ae).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=S(this,Ae).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(In(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return S(this,Ae).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=S(this,Ae).get(r.queryHash),o=s==null?void 0:s.state.data,a=u3(t,o);if(a!==void 0)return S(this,Ae).build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return De.batch(()=>S(this,Ae).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=S(this,Ae).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=S(this,Ae);De.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=S(this,Ae);return De.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=De.batch(()=>S(this,Ae).findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then(Me).catch(Me)}invalidateQueries(e,t={}){return De.batch(()=>(S(this,Ae).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=De.batch(()=>S(this,Ae).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let o=s.fetch(void 0,n);return n.throwOnError||(o=o.catch(Me)),s.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(Me)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=S(this,Ae).build(this,t);return n.isStaleByTime(In(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Me).catch(Me)}
2fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Me).catch(Me)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return zs.isOnline()?S(this,An).resumePausedMutations():Promise.resolve()}getQueryCache(){return S(this,Ae)}getMutationCache(){return S(this,An)}getDefaultOptions(){return S(this,Nn)}setDefaultOptions(e){F(this,Nn,e)}setQueryDefaults(e,t){S(this,Qr).set(ir(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...S(this,Qr).values()],n={};return t.forEach(r=>{Bs(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){S(this,Yr).set(ir(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...S(this,Yr).values()],n={};return t.forEach(r=>{Bs(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...S(this,Nn).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=_c(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Ec&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...S(this,Nn).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){S(this,Ae).clear(),S(this,An).clear()}},Ae=new WeakMap,An=new WeakMap,Nn=new WeakMap,Qr=new WeakMap,Yr=new WeakMap,Pn=new WeakMap,Xr=new WeakMap,Zr=new WeakMap,E1),$1=m.createContext(void 0),ut=e=>{const t=m.useContext($1);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},U3=({client:e,children:t})=>(m.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),u.jsx($1.Provider,{value:e,children:t})),z1=m.createContext(!1),B3=()=>m.useContext(z1),$3=z1.Provider;function z3(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var V3=m.createContext(z3()),H3=()=>m.useContext(V3),W3=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?Sc(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},q3=e=>{m.useEffect(()=>{e.clearReset()},[e])},G3=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(s&&e.data===void 0||Sc(n,[e.error,r])),K3=e=>{if(e.suspense){const n=s=>s==="static"?s:Math.max(s??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...s)=>n(r(...s)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Q3=(e,t)=>e.isLoading&&e.isFetching&&!t,Y3=(e,t)=>
2(e==null?void 0:e.suspense)&&t.isPending,Hu=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function X3(e,t,n){var p,g,y,v;const r=B3(),s=H3(),o=ut(),a=o.defaultQueryOptions(e);(g=(p=o.getDefaultOptions().queries)==null?void 0:p._experimental_beforeQuery)==null||g.call(p,a);const i=o.getQueryCache().get(a.queryHash),l=e.subscribed!==!1;a._optimisticResults=r?"isRestoring":l?"optimistic":void 0,K3(a),W3(a,s,i),q3(s);const c=!o.getQueryCache().get(a.queryHash),[d]=m.useState(()=>new t(o,a)),f=d.getOptimisticResult(a),h=!r&&l;if(m.useSyncExternalStore(m.useCallback(x=>{const C=h?d.subscribe(De.batchCalls(x)):Me;return d.updateResult(),C},[d,h]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),m.useEffect(()=>{d.setOptions(a)},[a,d]),Y3(a,f))throw Hu(a,d,s);if(G3({result:f,errorResetBoundary:s,throwOnError:a.throwOnError,query:i,suspense:a.suspense}))throw f.error;if((v=(y=o.getDefaultOptions().queries)==null?void 0:y._experimental_afterQuery)==null||v.call(y,a,f),a.experimental_prefetchInRender&&!$s.isServer()&&Q3(f,r)){const x=c?Hu(a,d,s):i==null?void 0:i.promise;x==null||x.catch(Me).finally(()=>{d.updateResult()})}return a.notifyOnChangeProps?f:d.trackResult(f)}function hr(e,t){return X3(e,R3)}function na(e,t){const n=ut(),[r]=m.useState(()=>new M3(n,e));m.useEffect(()=>{r.setOptions(e)},[r,e]);const s=m.useSyncExternalStore(m.useCallback(a=>r.subscribe(De.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=m.useCallback((a,i)=>{r.mutate(a,i).catch(Me)},[r]);if(s.error&&Sc(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:o,mutateAsync:s.mutate}}var Z3=["added","removed","updated"];function Wu(e){return Z3.includes(e)}async function J3({queryClient:e,persister:t,maxAge:n=1e3*60*60*24,buster:r="",hydrateOptions:s}){try{const o=await t.restoreClient();if(o)if(o.timestamp){const a=Date.now()-o.timestamp>n,i=o.buster!==r;if(a||i)return t.removeClient();_3(e,o.clientState,s)}else return t.removeClient()}catch(o){throw await t.removeClient(),o}}async function qu({queryClient:e,persister:t,buster:n="",dehydrateOptions:r}){const s={buster:n,timestamp:Date.now(),clientState:C3(e,r)};await t.persistClient(s)}function e5(e){const t=e.queryClient.getQueryCache().subscribe(r=>{Wu(r.type)&&qu(e)}),n=e.queryClient.getMutationCache().subscribe(r=>{Wu(r.type)&&qu(e)});return()=>{t(),n()}}var t5=({children:e,persistOptions:t,onSuccess:n,onError:r,...s})=>{const[o,a]=m.useState(!0),i=m.useRef({persistOptions:t,onSuccess:n,onError:r}),l=m.useRef(!1);return m.useEffect(()=>{i.current={persistOptions:t,onSuccess:n,onError:r}}),m.useEffect(()=>{const c={...i.current.persistOptions,queryClient:s.client};return l.current||(l.current=!0,J3(c).then(()=>{var d,f;return(f=(d=i.current).onSuccess)==null?void 0:f.call(d)}).catch(()=>{var d,f;return(f=(d=i.current).onError)==null?void 0:f.call(d)}).finally(()=>{a(!1)})),o?void 0:e5(c)},[s.client,o]),u.jsx(U3,{...s,children:u.jsx($3,{value:o,children:e})})};/*! Capacitor: https://capacitorjs.com/ - MIT License */var Jr;(function(e){e.Unimplemented="UNIMPLEMENTED",e.Unavailable="UNAVAILABLE"})(Jr||(Jr={}));class hi extends Error{constructor(t,n,r){super(t),this.message=t,this.code=n,this.data=r}}const n5=e=>{var t,n;return e!=null&&e.androidBridge?"android":!((n=(t=e==null?void 0:e.webkit)===null||t===void 0?void 0:t.messageHandlers)===null||n===void 0)&&n.bridge?"ios":"web"},r5=e=>{const t=e.CapacitorCustomPlatform||null,n=e.Capacitor||{},r=n.Plugins=n.Plugins||{},s=()=>t!==null?t.name:n5(e),o=()=>s()!=="web",a=f=>{const h=c.get(f);return!!(h!=null&&h.platforms.has(s())||i(f))},i=f=>{var h;return(h=n.PluginHeaders)===null||h===void 0?void 0:h.find(p=>p.name===f)},l=f=>e.console.error(f),c=new Map,d=(f,h={})=>{const p=c.get(f);if(p)return console.warn(`Capacitor plugin "${f}" already registered. Cannot register plugins twice.`),p.proxy;const g=s(),y=i(f);let v;const x=async()=>(!v&&g in h?v=typeof h[g]=="function"?v=await h[g]():v=h[g]:t!==null&&!v&&"web"in h&&(v=typeof h.web=="function"?v=await h.web():v=h.web),v),C=(E,A)=>{var k,T;if(y){const I=y==null?void 0:y.methods.find(R=>A===R.name);if(I)return I.rtype==="promise"?R=>n.nativePromise(f,A.toString(),R):(R,O)=>n.nativeCallback(f,A.toString(),R,O);if(E)return(k=E[A])===null||k===void 0?void 0:k.bind(E)}else{if(E)return(T=E[A])===null||T===void 0?void 0:T.bind(E);throw new hi(`"${f}" plugin is not implemented on ${g}`,Jr.Unimplemented)}},_=E=>{let A;
2const k=(...T)=>{const I=x().then(R=>{const O=C(R,E);if(O){const M=O(...T);return A=M==null?void 0:M.remove,M}else throw new hi(`"${f}.${E}()" is not implemented on ${g}`,Jr.Unimplemented)});return E==="addListener"&&(I.remove=async()=>A()),I};return k.toString=()=>`${E.toString()}() { [capacitor code] }`,Object.defineProperty(k,"name",{value:E,writable:!1,configurable:!1}),k},b=_("addListener"),w=_("removeListener"),P=(E,A)=>{const k=b({eventName:E},A),T=async()=>{const R=await k;w({eventName:E,callbackId:R},A)},I=new Promise(R=>k.then(()=>R({remove:T})));return I.remove=async()=>{console.warn("Using addListener() without 'await' is deprecated."),await T()},I},N=new Proxy({},{get(E,A){switch(A){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return y?P:b;case"removeListener":return w;default:return _(A)}}});return r[f]=N,c.set(f,{name:f,proxy:N,platforms:new Set([...Object.keys(h),...y?[g]:[]])}),N};return n.convertFileSrc||(n.convertFileSrc=f=>f),n.getPlatform=s,n.handleError=l,n.isNativePlatform=o,n.isPluginAvailable=a,n.registerPlugin=d,n.Exception=hi,n.DEBUG=!!n.DEBUG,n.isLoggingEnabled=!!n.isLoggingEnabled,n},s5=e=>e.Capacitor=r5(e),j=s5(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),we=j.registerPlugin;class Nc{constructor(){this.listeners={},this.retainedEventArguments={},this.windowListeners={}}addListener(t,n){let r=!1;this.listeners[t]||(this.listeners[t]=[],r=!0),this.listeners[t].push(n);const o=this.windowListeners[t];o&&!o.registered&&this.addWindowListener(o),r&&this.sendRetainedArgumentsForEvent(t);const a=async()=>this.removeListener(t,n);return Promise.resolve({remove:a})}async removeAllListeners(){this.listeners={};for(const t in this.windowListeners)this.removeWindowListener(this.windowListeners[t]);this.windowListeners={}}notifyListeners(t,n,r){const s=this.listeners[t];if(!s){if(r){let o=this.retainedEventArguments[t];o||(o=[]),o.push(n),this.retainedEventArguments[t]=o}return}s.forEach(o=>o(n))}hasListeners(t){var n;return!!(!((n=this.listeners[t])===null||n===void 0)&&n.length)}registerWindowListener(t,n){this.windowListeners[n]={registered:!1,windowEventName:t,pluginEventName:n,handler:r=>{this.notifyListeners(n,r)}}}unimplemented(t="not implemented"){return new j.Exception(t,Jr.Unimplemented)}unavailable(t="not available"){return new j.Exception(t,Jr.Unavailable)}async removeListener(t,n){const r=this.listeners[t];if(!r)return;const s=r.indexOf(n);this.listeners[t].splice(s,1),this.listeners[t].length||this.removeWindowListener(this.windowListeners[t])}addWindowListener(t){window.addEventListener(t.windowEventName,t.handler),t.registered=!0}removeWindowListener(t){t&&(window.removeEventListener(t.windowEventName,t.handler),t.registered=!1)}sendRetainedArgumentsForEvent(t){const n=this.retainedEventArguments[t];n&&(delete this.retainedEventArguments[t],n.forEach(r=>{this.notifyListeners(t,r)}))}}const Gu=e=>encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),Ku=e=>e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class o5 extends Nc{async getCookies(){const t=document.cookie,n={};return t.split(";").forEach(r=>{if(r.length<=0)return;let[s,o]=r.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");s=Ku(s).trim(),o=Ku(o).trim(),n[s]=o}),n}async setCookie(t){try{const n=Gu(t.key),r=Gu(t.value),s=`; expires=${(t.expires||"").replace("expires=","")}`,o=(t.path||"/").replace("path=",""),a=t.url!=null&&t.url.length>0?`domain=${t.url}`:"";document.cookie=`${n}=${r||""}${s}; path=${o}; ${a};`}catch(n){return Promise.reject(n)}}async deleteCookie(t){try{document.cookie=`${t.key}=; Max-Age=0`}catch(n){return Promise.reject(n)}}async clearCookies(){try{const t=document.cookie.split(";")||[];for(const n of t)document.cookie=n.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`)}catch(t){return Promise.reject(t)}}async clearAllCookies(){try{await this.clearCookies()}catch(t){return Promise.reject(t)}}}we("CapacitorCookies",{web:()=>new o5});const a5=async e=>new Promise((t,n)=>{const r=new FileReader;r.onload=()=>{const s=r.result;t(s.indexOf(",")>=0?s.split(",")[1]:s)},r.onerror=s=>
2n(s),r.readAsDataURL(e)}),i5=(e={})=>{const t=Object.keys(e);return Object.keys(e).map(s=>s.toLocaleLowerCase()).reduce((s,o,a)=>(s[o]=e[t[a]],s),{})},l5=(e,t=!0)=>e?Object.entries(e).reduce((r,s)=>{const[o,a]=s;let i,l;return Array.isArray(a)?(l="",a.forEach(c=>{i=t?encodeURIComponent(c):c,l+=`${o}=${i}&`}),l.slice(0,-1)):(i=t?encodeURIComponent(a):a,l=`${o}=${i}`),`${r}&${l}`},"").substr(1):null,c5=(e,t={})=>{const n=Object.assign({method:e.method||"GET",headers:e.headers},t),s=i5(e.headers)["content-type"]||"";if(typeof e.data=="string")n.body=e.data;else if(s.includes("application/x-www-form-urlencoded")){const o=new URLSearchParams;for(const[a,i]of Object.entries(e.data||{}))o.set(a,i);n.body=o.toString()}else if(s.includes("multipart/form-data")||e.data instanceof FormData){const o=new FormData;if(e.data instanceof FormData)e.data.forEach((i,l)=>{o.append(l,i)});else for(const i of Object.keys(e.data))o.append(i,e.data[i]);n.body=o;const a=new Headers(n.headers);a.delete("content-type"),n.headers=a}else(s.includes("application/json")||typeof e.data=="object")&&(n.body=JSON.stringify(e.data));return n};class u5 extends Nc{async request(t){const n=c5(t,t.webFetchExtra),r=l5(t.params,t.shouldEncodeUrlParams),s=r?`${t.url}?${r}`:t.url,o=await fetch(s,n),a=o.headers.get("content-type")||"";let{responseType:i="text"}=o.ok?t:{};a.includes("application/json")&&(i="json");let l,c;switch(i){case"arraybuffer":case"blob":c=await o.blob(),l=await a5(c);break;case"json":l=await o.json();break;case"document":case"text":default:l=await o.text()}const d={};return o.headers.forEach((f,h)=>{d[h]=f}),{data:l,headers:d,status:o.status,url:o.url}}async get(t){return this.request(Object.assign(Object.assign({},t),{method:"GET"}))}async post(t){return this.request(Object.assign(Object.assign({},t),{method:"POST"}))}async put(t){return this.request(Object.assign(Object.assign({},t),{method:"PUT"}))}async patch(t){return this.request(Object.assign(Object.assign({},t),{method:"PATCH"}))}async delete(t){return this.request(Object.assign(Object.assign({},t),{method:"DELETE"}))}}we("CapacitorHttp",{web:()=>new u5});var Qu;(function(e){e.Dark="DARK",e.Light="LIGHT",e.Default="DEFAULT"})(Qu||(Qu={}));var Yu;(function(e){e.StatusBar="StatusBar",e.NavigationBar="NavigationBar"})(Yu||(Yu={}));class d5 extends Nc{async setStyle(){this.unavailable("not available for web")}async setAnimation(){this.unavailable("not available for web")}async show(){this.unavailable("not available for web")}async hide(){this.unavailable("not available for web")}}const yP=we("SystemBars",{web:()=>new d5});function f5(e){e.CapacitorUtils.Synapse=new Proxy({},{get(t,n){return new Proxy({},{get(r,s){return(o,a,i)=>{const l=e.Capacitor.Plugins[n];if(l===void 0){i(new Error(`Capacitor plugin ${n} not found`));return}if(typeof l[s]!="function"){i(new Error(`Method ${s} not found in Capacitor plugin ${n}`));return}(async()=>{try{const c=await l[s](o);a(c)}catch(c){i(c)}})()}}})}})}function h5(e){e.CapacitorUtils.Synapse=new Proxy({},{get(t,n){return e.cordova.plugins[n]}})}function p5(e=!1){typeof window>"u"||(window.CapacitorUtils=window.CapacitorUtils||{},window.Capacitor!==void 0&&!e?f5(window):window.cordova!==void 0&&h5(window))}var Pe;(function(e){e.Documents="DOCUMENTS",e.Data="DATA",e.Library="LIBRARY",e.Cache="CACHE",e.External="EXTERNAL",e.ExternalStorage="EXTERNAL_STORAGE",e.ExternalCache="EXTERNAL_CACHE",e.LibraryNoCloud="LIBRARY_NO_CLOUD",e.Temporary="TEMPORARY"})(Pe||(Pe={}));var Tn;(function(e){e.UTF8="utf8",e.ASCII="ascii",e.UTF16="utf16"})(Tn||(Tn={}));const m5=Pe,g5=Tn,Ne=we("Filesystem",{web:()=>B(()=>import("./web_CtGH_Ddt.js"),__vite__mapDeps([0,1,2,3,4])).then(e=>new e.FilesystemWeb)});p5();const y5=Object.freeze(Object.defineProperty({__proto__:null,get Directory(){return Pe},get Encoding(){return Tn},Filesystem:Ne,FilesystemDirectory:m5,FilesystemEncoding:g5},Symbol.toStringTag,{value:"Module"}));function pl(){}function v5(e,{interval:t=1e3,onError:n=pl}={}){if(typeof e!="function")throw new Error("argument is not function.");let r=0,s=null,o=!1,a=!1;return async(...i)=>{if(s=i,!a){for(a=!0;o;)await new Promise(l=>Jt.setTimeout(l,t));for(;Date.now()<r;)await new Promise(l=>Jt.setTimeout(l,r-Date.now()));a=!1,o=!0;try{await e(...s)}catch(l){try{n(l)}catch{}}r=Date.now()+t,o=!1}}}var b5=({storage:e,key:t="REACT_QUERY_OFFLINE_CACHE",throttleTime:n=1e3,serialize:r=JSON.stringify,deserialize:s=JSON.parse,retry:o})=>{if(e){const a=async i=>{try{const l=await r(i);await e.setItem(t,l);return}catch(l){return l}};return{persistClient:v5(async i=>{let l=i,c=await a(l),d=0;for(;c&&l;)d++,l=await(o==null?void 0:o({persistedClient:l,error:c,errorCount:d})),l&&(c=await a(l))},{interval:n}),restoreClient:async()=>{const i=await e.getItem(t);if(i)return await s(i)},removeClient:()=>e.removeItem(t)}}return{persistClient:pl,restoreClient:()=>Promise.resolve(void 0),removeClient:pl}};const w5="https://tkikltxfggzcqlwlegkf.supabase.co",x5="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InRraWtsdHhmZ2d6Y3Fsd2xlZ2tmIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NTUwMDI3NTMsImV4cCI6MjA3MDU3ODc1M30.4Z2e6agUUhQK49WQzVtAyWWHTW6jVIkiADWAmjVrhjo",z=F2(w5,x5,{auth:{storage:localStorage,persistSession:!0,autoRefreshToken:!0}}),C5=Object.freeze(Object.defineProperty({__proto__:null,supabase:z},Symbol.toStringTag,{value:"Module"})),_5="https://telemetry.invalid",E5=new Set(["access_token","apikey","api_key","authorization","code","invite","invite_code","refresh_token","token"]),S5=new Set(["accesstoken","apikey","authorization","code","invite","invitecode","refreshtoken","token"]),A5=e=>e.toLowerCase().replace(/[^a-z0-9]/g,""),V1=e=>S5.has(A5(e)),is=e=>/^\/invite\/[^/]+(?:\/|$)/i.test(e),ra=e=>is(e)?"/invite":e,H1=e=>{for(const t of[...e.keys()])E5.has(t.toLowerCase())&&e.delete(t)},za=e=>{try{const t=new URL(e,_5);t.pathname=ra(t.pathname),H1(t.searchParams);const n=t.searchParams.toString();return`${t.pathname}${n?`?${n}`:""}`}catch{return ra(e.split(/[?#]/,1)[0]||"/")}},W1=e=>{try{const t=new URL(e);return t.pathname=ra(t.pathname),H1(t.searchParams),t.hash="",t.toString()}catch{return za(e)}},q1="https://b00117278f9261c82b37aa4380044221@o4511177953837056.ingest.de.sentry.io/4511177965240400".trim(),io=!!q1&&
2!0,N5="https://tkikltxfggzcqlwlegkf.supabase.co",Xu="production".trim()||"production",P5="1.37".trim()||"0.0.0",k5=.15,I5=0,R5=1,ml=j.isNativePlatform()?"native":"web",Zu=j.getPlatform(),gl="[REDACTED]",T5=new Set(["access_token","apikey","api_key","authorization","code","refresh_token","token"]),O5=/token|secret|password|authorization|cookie|session|email|phone|name|username|caption|description|note|story|text|image|photo|cover|avatar|url|path|address/i;let Ju=!1;const Pc=(e,t)=>{const n=Number(e);return Number.isFinite(n)?n:t},j5=Pc("0.15",k5),Co=Pc("0",I5),_o=Pc("1",R5),L5=/\b(?:Instagram|FBAN|FBAV)\b/i,G1=/Error invoking (?:postMessage|enableDidUserTypeOnKeyboardLogging): Java object is gone/i,M5=/Failed to fetch(?! dynamically)|Unable to resolve host|Failed to connect to server|Software caused connection abort|NetworkError when attempting|Load failed|The Internet connection appears to be offline|net::ERR_(?:INTERNET_DISCONNECTED|NAME_NOT_RESOLVED|NETWORK_CHANGED|CONNECTION_(?:RESET|ABORTED|TIMED_OUT))/i,D5=/^(?:\w*Error: )?cancell?ed\.?$/i,K1=e=>{try{const t=new URL(e);t.pathname=ra(t.pathname);for(const n of T5)t.searchParams.has(n)&&t.searchParams.set(n,gl);return t.toString()}catch{return e}},Vs=(e,t,n=0)=>t==null?t:n>2?Array.isArray(t)?`[Array(${t.length})]`:typeof t=="object"?"[Object]":t:O5.test(e)?typeof t=="string"?t.length>0?`[Filtered string length=${t.length}]`:gl:Array.isArray(t)?`[Filtered array length=${t.length}]`:typeof t=="object"?"[Filtered object]":gl:typeof t=="string"?t.startsWith("http")?K1(t):t.slice(0,500):typeof t=="number"||typeof t=="boolean"?t:Array.isArray(t)?t.slice(0,20).map(r=>Vs(e,r,n+1)):typeof t=="object"?Object.entries(t).reduce((r,[s,o])=>(r[s]=Vs(s,o,n+1),r),{}):String(t),sa=e=>{if(e)return Object.entries(e).reduce((t,[n,r])=>(t[n]=Vs(n,r),t),{})},F5=(e,t,n)=>Vs(t,n),U5=(e,t)=>{if(e instanceof Error)return e;const n=t.action?` (${t.action})`:"";return typeof e=="string"?new Error(`${t.area}${n}: ${e}`):new Error(`${t.area}${n}: unexpected non-Error exception`)},B5=e=>{var n;const t=new Set;typeof e.message=="string"&&t.add(e.message);for(const r of((n=e.exception)==null?void 0:n.values)??[])typeof r.value=="string"&&t.add(r.value),typeof r.type=="string"&&t.add(r.type);return[...t]},$5=e=>{var n,r;if(ml!=="web")return!1;const t=((r=(n=e.contexts)==null?void 0:n.browser)==null?void 0:r.name)??(typeof navigator<"u"?navigator.userAgent:"");return L5.test(t)?B5(e).some(s=>G1.test(s)):!1},z5=e=>{var t;return $5(e)?null:((t=e.request)!=null&&t.url&&(e.request.url=K1(e.request.url)),e.breadcrumbs&&(e.breadcrumbs=e.breadcrumbs.map(n=>(n.data&&(n.data=sa(n.data)),typeof n.message=="string"&&(n.message=n.message.slice(0,500)),n))),e.extra&&(e.extra=sa(e.extra)),e)},V5={startInactiveSpan:Y2,captureException:k1,addBreadcrumb:N1,SEMANTIC_ATTRIBUTE_SENTRY_OP:Q2,SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN:K2},H5=()=>{const e=U2(z,V5,{tracing:!0,breadcrumbs:!0,errors:!0,sanitizeBody:F5}),t=(z==null?void 0:z.constructor)??B2;return{...e,setupOnce(...n){var s,o;if(typeof((s=t==null?void 0:t.prototype)==null?void 0:s.from)!="function"){console.warn("[sentry] Skipping Supabase integration: client prototype.from is unavailable");return}try{(o=e.setupOnce)==null||o.call(e,...n)}catch(a){console.warn("[sentry] Supabase integration setup failed; continuing without Supabase instrumentation",a)}}}},W5=()=>{if(Ju||!io)return;Ju=!0;const e=[z2({useEffect:L.useEffect,useLocation:He,useNavigationType:T2,createRoutesFromChildren:R2,matchRoutes:I2,shouldCreateSpanForRequest:t=>!t.startsWith(`${N5}/rest`)}),H5()];V2({dsn:q1,environment:Xu,release:P5,tracesSampleRate:j5,integrations:e,ignoreErrors:[/ResizeObserver loop limit exceeded/i,/Non-Error promise rejection captured/i,G1,M5,D5],replaysSessionSampleRate:Co,replaysOnErrorSampleRate:_o,beforeSend:z5}),P1({runtime:ml,platform:Zu,app_version:"0.0.0",replay_mode:Co>0?"sampled_sessions":_o>0?"on_error":"off"}),H2("app",{runtime:ml,platform:Zu,environment:Xu,version:"0.0.0",replaysSessionSampleRate:Co,replaysOnErrorSampleRate:_o}),(Co>0||_o>0)&&W2("replayIntegration").then(t=>{q2(t({maskAllText:!0,maskAllInputs:!0,blockAllMedia:!0}))}).catch(()=>{})},Ce=(e,t)=>{if(!io)return;const n=U5(e,t);A1(r=>{var o;if(r.setLevel(t.level??"error"),r.setTag("handled","true"),r.setTag("area",t.area),t.action&&r.setTag("action",t.action),t.tags)for(const[a,i]of Object.entries(t.tags))i!=null&&r.setTag(a,String(i));const s=sa(t.extra);s&&r.setExtras(s),e instanceof Error||r.setExtra("original_error",Vs("original_error",e)),(o=t.fingerprint)!=null&&o.length&&r.setFingerprint(t.fingerprint),k1(n)})},ed=e=>
2{if(io){if(!e){Ou(null),G2("auth_provider","anonymous");return}Ou({id:e.id,email:e.email??void 0,username:e.username??void 0}),P1({auth_provider:e.provider??"unknown",user_language:e.language??"unknown"})}},q5=.1,G5=e=>{if(e.permissionStatus!=="granted")return!0;const t=e.nativeDiagnostics;if(!t)return!1;const n=typeof t.monthsCount=="number"?t.monthsCount:-1,r=typeof t.chipCount=="number"?t.chipCount:-1;return t.chipBarSelfHealed===!0||t.chipBarOffsetClamped===!0||n>0&&r===0},vP=e=>{io&&(lr("media picker session",e,"media_picker"),!(!G5(e)&&Math.random()>=q5)&&A1(t=>{t.setLevel("info"),t.setTag("area","media_picker"),t.setTag("picker_permission",e.permissionStatus),t.setTag("picker_source",e.source),t.setTag("picker_cancelled",String(e.cancelled)),t.setExtras({initial_month_key:e.initialMonthKey,selection_count:e.selectionCount,selection_created_at:e.selectionCreatedAt,native_diagnostics:e.nativeDiagnostics??null}),t.setFingerprint(["media-picker-diagnostics"]),$2("media picker diagnostics")}))},lr=(e,t,n="app")=>{io&&N1({category:n,message:e,data:sa(t)})},K5=14*24*60*60*1e3,Q5="v1",pi=e=>`${e.replace(/[^a-zA-Z0-9_-]/g,"_")}.json`,Y5={getItem:async e=>{try{const t=await Ne.readFile({path:pi(e),directory:Pe.Data,encoding:Tn.UTF8});return typeof t.data=="string"?t.data:null}catch{return null}},setItem:async(e,t)=>{await Ne.writeFile({path:pi(e),directory:Pe.Data,data:t,encoding:Tn.UTF8})},removeItem:async e=>{try{await Ne.deleteFile({path:pi(e),directory:Pe.Data})}catch{}}},X5="lc-query-cache",yl="kv";let hs=null;const Z5=()=>(hs||(hs=new Promise((e,t)=>{const n=window.indexedDB.open(X5,1);n.onupgradeneeded=()=>n.result.createObjectStore(yl),n.onsuccess=()=>e(n.result),n.onerror=()=>t(n.error)}),hs.catch(()=>{hs=null})),hs),Eo=(e,t)=>Z5().then(n=>new Promise((r,s)=>{const o=t(n.transaction(yl,e).objectStore(yl));o.onsuccess=()=>r(o.result),o.onerror=()=>s(o.error)})),td=new Set,mi=(e,t)=>{lr(`query cache ${e} failed`,void 0,"query-persister"),!td.has(e)&&(td.add(e),Ce(t,{area:"query-persister",action:e,level:"warning",fingerprint:["query-persister",e]}))},J5={getItem:async e=>{try{const t=await Eo("readonly",r=>r.get(e));if(typeof t=="string")return t;const n=window.localStorage.getItem(e);return n!==null&&(Eo("readwrite",r=>r.put(n,e)).catch(()=>{}),window.localStorage.removeItem(e)),n}catch(t){return mi("restore",t),null}},setItem:async(e,t)=>{try{await Eo("readwrite",n=>n.put(t,e))}catch(n){mi("persist",n)}},removeItem:async e=>{try{window.localStorage.removeItem(e),await Eo("readwrite",t=>t.delete(e))}catch(t){mi("remove",t)}}},Q1=b5({storage:j.isNativePlatform()?Y5:J5,throttleTime:2e3}),e4=async()=>{try{await Q1.removeClient()}catch(e){console.debug("[queryPersister] failed to clear persisted cache",e)}},Ge=we("App",{web:()=>B(()=>import("./web_BjSAsgK6.js"),__vite__mapDeps([5,1,2,3,4])).then(e=>new e.AppWeb)});var nd;(function(e){e.UNKNOWN_ERROR="0",e.PURCHASE_CANCELLED_ERROR="1",e.STORE_PROBLEM_ERROR="2",e.PURCHASE_NOT_ALLOWED_ERROR="3",e.PURCHASE_INVALID_ERROR="4",e.PRODUCT_NOT_AVAILABLE_FOR_PURCHASE_ERROR="5",e.PRODUCT_ALREADY_PURCHASED_ERROR="6",e.RECEIPT_ALREADY_IN_USE_ERROR="7",e.INVALID_RECEIPT_ERROR="8",e.MISSING_RECEIPT_FILE_ERROR="9",e.NETWORK_ERROR="10",e.INVALID_CREDENTIALS_ERROR="11",e.UNEXPECTED_BACKEND_RESPONSE_ERROR="12",e.RECEIPT_IN_USE_BY_OTHER_SUBSCRIBER_ERROR="13",e.INVALID_APP_USER_ID_ERROR="14",e.OPERATION_ALREADY_IN_PROGRESS_ERROR="15",e.UNKNOWN_BACKEND_ERROR="16",e.INVALID_APPLE_SUBSCRIPTION_KEY_ERROR="17",e.INELIGIBLE_ERROR="18",e.INSUFFICIENT_PERMISSIONS_ERROR="19",e.PAYMENT_PENDING_ERROR="20",e.INVALID_SUBSCRIBER_ATTRIBUTES_ERROR="21",e.LOG_OUT_ANONYMOUS_USER_ERROR="22",e.CONFIGURATION_ERROR="23",e.UNSUPPORTED_ERROR="24",e.EMPTY_SUBSCRIBER_ATTRIBUTES_ERROR="25",e.PRODUCT_DISCOUNT_MISSING_IDENTIFIER_ERROR="26",e.PRODUCT_DISCOUNT_MISSING_SUBSCRIPTION_GROUP_IDENTIFIER_ERROR="28",e.CUSTOMER_INFO_ERROR="29",e.SYSTEM_INFO_ERROR="30",e.BEGIN_REFUND_REQUEST_ERROR="31",e.PRODUCT_REQUEST_TIMED_OUT_ERROR="32",e.API_ENDPOINT_BLOCKED="33",e.INVALID_PROMOTIONAL_OFFER_ERROR="34",e.OFFLINE_CONNECTION_ERROR="35",e.TEST_STORE_SIMULATED_PURCHASE_ERROR="42"})(nd||(nd={}));var Y1=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var o in s)Object.prototype.hasOwnProperty.call(s,o)&&(r[o]=s[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}
2t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(e){Y1(t,e);function t(){var n=e.call(this,"There is no singleton instance. Make sure you configure Purchases before trying to get the default instance. More info here: https://errors.rev.cat/configuring-sdk")||this;return Object.setPrototypeOf(n,t.prototype),n}return t})(Error);(function(e){Y1(t,e);function t(){var n=e.call(this,"This method is not available in the current platform.")||this;return Object.setPrototypeOf(n,t.prototype),n}return t})(Error);var rd;(function(e){e.UNKNOWN="UNKNOWN",e.CUSTOM="CUSTOM",e.LIFETIME="LIFETIME",e.ANNUAL="ANNUAL",e.SIX_MONTH="SIX_MONTH",e.THREE_MONTH="THREE_MONTH",e.TWO_MONTH="TWO_MONTH",e.MONTHLY="MONTHLY",e.WEEKLY="WEEKLY"})(rd||(rd={}));var sd;(function(e){e[e.INTRO_ELIGIBILITY_STATUS_UNKNOWN=0]="INTRO_ELIGIBILITY_STATUS_UNKNOWN",e[e.INTRO_ELIGIBILITY_STATUS_INELIGIBLE=1]="INTRO_ELIGIBILITY_STATUS_INELIGIBLE",e[e.INTRO_ELIGIBILITY_STATUS_ELIGIBLE=2]="INTRO_ELIGIBILITY_STATUS_ELIGIBLE",e[e.INTRO_ELIGIBILITY_STATUS_NO_INTRO_OFFER_EXISTS=3]="INTRO_ELIGIBILITY_STATUS_NO_INTRO_OFFER_EXISTS"})(sd||(sd={}));var od;(function(e){e.NON_SUBSCRIPTION="NON_SUBSCRIPTION",e.SUBSCRIPTION="SUBSCRIPTION",e.UNKNOWN="UNKNOWN"})(od||(od={}));var ad;(function(e){e.CONSUMABLE="CONSUMABLE",e.NON_CONSUMABLE="NON_CONSUMABLE",e.NON_RENEWABLE_SUBSCRIPTION="NON_RENEWABLE_SUBSCRIPTION",e.AUTO_RENEWABLE_SUBSCRIPTION="AUTO_RENEWABLE_SUBSCRIPTION",e.PREPAID_SUBSCRIPTION="PREPAID_SUBSCRIPTION",e.UNKNOWN="UNKNOWN"})(ad||(ad={}));var id;(function(e){e[e.UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY=0]="UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY",e[e.IMMEDIATE_WITH_TIME_PRORATION=1]="IMMEDIATE_WITH_TIME_PRORATION",e[e.IMMEDIATE_AND_CHARGE_PRORATED_PRICE=2]="IMMEDIATE_AND_CHARGE_PRORATED_PRICE",e[e.IMMEDIATE_WITHOUT_PRORATION=3]="IMMEDIATE_WITHOUT_PRORATION",e[e.DEFERRED=6]="DEFERRED",e[e.IMMEDIATE_AND_CHARGE_FULL_PRICE=5]="IMMEDIATE_AND_CHARGE_FULL_PRICE"})(id||(id={}));var ld;(function(e){e.WITHOUT_PRORATION="WITHOUT_PRORATION",e.WITH_TIME_PRORATION="WITH_TIME_PRORATION",e.CHARGE_FULL_PRICE="CHARGE_FULL_PRICE",e.CHARGE_PRORATED_PRICE="CHARGE_PRORATED_PRICE",e.DEFERRED="DEFERRED"})(ld||(ld={}));var cd;(function(e){e[e.INFINITE_RECURRING=1]="INFINITE_RECURRING",e[e.FINITE_RECURRING=2]="FINITE_RECURRING",e[e.NON_RECURRING=3]="NON_RECURRING"})(cd||(cd={}));var ud;(function(e){e.FREE_TRIAL="FREE_TRIAL",e.SINGLE_PAYMENT="SINGLE_PAYMENT",e.DISCOUNTED_RECURRING_PAYMENT="DISCOUNTED_RECURRING_PAYMENT"})(ud||(ud={}));var dd;(function(e){e.DAY="DAY",e.WEEK="WEEK",e.MONTH="MONTH",e.YEAR="YEAR",e.UNKNOWN="UNKNOWN"})(dd||(dd={}));var fd;(function(e){e.INAPP="inapp",e.SUBS="subs"})(fd||(fd={}));var hd;(function(e){e[e.SUBSCRIPTIONS=0]="SUBSCRIPTIONS",e[e.SUBSCRIPTIONS_UPDATE=1]="SUBSCRIPTIONS_UPDATE",e[e.IN_APP_ITEMS_ON_VR=2]="IN_APP_ITEMS_ON_VR",e[e.SUBSCRIPTIONS_ON_VR=3]="SUBSCRIPTIONS_ON_VR",e[e.PRICE_CHANGE_CONFIRMATION=4]="PRICE_CHANGE_CONFIRMATION"})(hd||(hd={}));var pd;(function(e){e[e.SUCCESS=0]="SUCCESS",e[e.USER_CANCELLED=1]="USER_CANCELLED",e[e.ERROR=2]="ERROR"})(pd||(pd={}));var md;(function(e){e.VERBOSE="VERBOSE",e.DEBUG="DEBUG",e.INFO="INFO",e.WARN="WARN",e.ERROR="ERROR"})(md||(md={}));var gd;(function(e){e[e.BILLING_ISSUE=0]="BILLING_ISSUE",e[e.PRICE_INCREASE_CONSENT=1]="PRICE_INCREASE_CONSENT",e[e.GENERIC=2]="GENERIC",e[e.WIN_BACK_OFFER=3]="WIN_BACK_OFFER"})(gd||(gd={}));var yd;(function(e){e.DISABLED="DISABLED",e.INFORMATIONAL="INFORMATIONAL"})(yd||(yd={}));var vd;(function(e){e.NOT_REQUESTED="NOT_REQUESTED",e.VERIFIED="VERIFIED",e.FAILED="FAILED",e.VERIFIED_ON_DEVICE="VERIFIED_ON_DEVICE"})(vd||(vd={}));var tr;(function(e){e.NOT_PRESENTED="NOT_PRESENTED",e.ERROR="ERROR",e.CANCELLED="CANCELLED",e.PURCHASED="PURCHASED",e.RESTORED="RESTORED"})(tr||(tr={}));var bd;(function(e){e.STOREKIT_1="STOREKIT_1",e.STOREKIT_2="STOREKIT_2",e.DEFAULT="DEFAULT"})(bd||(bd={}));var wd;(function(e){e.MY_APP="MY_APP",e.REVENUECAT="REVENUECAT"})(wd||(wd={}));var xd;(function(e){e.SUCCESS="SUCCESS",e.ERROR="ERROR",e.PURCHASE_BELONGS_TO_OTHER_USER="PURCHASE_BELONGS_TO_OTHER_USER",e.INVALID_TOKEN="INVALID_TOKEN",e.EXPIRED="EXPIRED"})(xd||(xd={}));const t4=we("Purchases",{web:()=>B(()=>import("./web_Cj5M3Oc1.js"),__vite__mapDeps([6,1,2,3,4])).then(e=>new e.PurchasesWeb)});function n4(e){var t;const n=e==null?void 0:e.offering,r={};if((e==null?void 0:e.paywallId)!=null&&(r.paywallId=e.paywallId),n!=null){r.offeringId=n.identifier;const s=(t=n.availablePackages[0])===null||t===void 0?void 0:t.presentedOfferingContext;s!=null&&(r.presentedOfferingContext=s)}else(e==null?void 0:e.offeringId)!=null&&(r.offeringId=e.offeringId);return r}const Pr=new Proxy(t4,{get(e,t,n){return t==="trackCustomPaywallImpression"?r=>e.trackCustomPaywallImpression(n4(r)):Reflect.get(e,t,n)}});var Hs;(function(e){e.SUCCESS="SUCCESS",e.CANCELLATION="CANCELLATION",e.ERROR="ERROR"})(Hs||(Hs={}));const X1={FULL_SCREEN:"FULL_SCREEN",SHEET:"SHEET"},r4={FULL_SCREEN:"FULL_SCREEN"};var Cd=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n};const ve=we("RevenueCatUI",{web:()=>B(()=>import("./web_TYP2Iql_.js"),__vite__mapDeps([7,1,2,3,4])).then(e=>new e.RevenueCatUIWeb)});function _d(e){if(e===void 0)return;if(typeof e!="object"||e===null)throw new Error("Invalid presentationConfiguration: expected an object or undefined.");const{ios:t,android:n}=e,r=Object.values(X1),s=Object.values(r4);if(t!==void 0&&!r.includes(t))throw new Error(`Invalid presentationConfiguration.ios "${String(t)}
2". Expected one of: ${r.join(", ")}.`);if(n!==void 0&&!s.includes(n))throw new Error(`Invalid presentationConfiguration.android "${String(n)}". Expected one of: ${s.join(", ")}.`)}function Ed(e){return e?e.ios===X1.FULL_SCREEN?{useFullScreenPresentation:!0}:{}:{}}function Sd(e){return e.result===Hs.ERROR&&"error"in e&&e.error?{result:e.result,error:{code:e.error.code,message:e.error.message}}:{result:e.result}}async function Ad(e,t,n,r){const s=[];try{if(n){if(n.onPurchaseStarted){const i=n.onPurchaseStarted;s.push(await ve.addListener("onPurchaseStarted",l=>{var c;i({packageBeingPurchased:(c=l.packageBeingPurchased)!==null&&c!==void 0?c:l})}))}if(n.onPurchaseCompleted){const i=n.onPurchaseCompleted;s.push(await ve.addListener("onPurchaseCompleted",l=>{i({customerInfo:l.customerInfo,storeTransaction:l.storeTransaction})}))}if(n.onPurchaseError){const i=n.onPurchaseError;s.push(await ve.addListener("onPurchaseError",l=>{var c;i({error:(c=l.error)!==null&&c!==void 0?c:l})}))}if(n.onPurchaseCancelled){const i=n.onPurchaseCancelled;s.push(await ve.addListener("onPurchaseCancelled",()=>{i()}))}if(n.onRestoreStarted){const i=n.onRestoreStarted;s.push(await ve.addListener("onRestoreStarted",()=>{i()}))}if(n.onRestoreCompleted){const i=n.onRestoreCompleted;s.push(await ve.addListener("onRestoreCompleted",l=>{var c;i({customerInfo:(c=l.customerInfo)!==null&&c!==void 0?c:l})}))}if(n.onRestoreError){const i=n.onRestoreError;s.push(await ve.addListener("onRestoreError",l=>{var c;i({error:(c=l.error)!==null&&c!==void 0?c:l})}))}}const o=n==null?void 0:n.onPurchaseInitiated;s.push(await ve.addListener("onPurchaseInitiated",i=>{var l;const c=i.requestId,d=(l=i.package)!==null&&l!==void 0?l:i.packageBeingPurchased;o?o({packageBeingPurchased:d,resumable:{resume(f=!0){ve.resumePurchaseInitiated({requestId:c,shouldProceed:f})}}}):ve.resumePurchaseInitiated({requestId:c,shouldProceed:!0})})),r&&(s.push(await ve.addListener("onPerformPurchaseRequest",async i=>{var l,c,d;const f=i.requestId,h=(c=(l=i.package)!==null&&l!==void 0?l:i.packageBeingPurchased)!==null&&c!==void 0?c:i.packageToPurchase;try{const p=await r.performPurchase({packageToPurchase:h});await ve.resumePurchaseLogicPurchase(Object.assign({requestId:f},Sd(p)))}catch(p){await ve.resumePurchaseLogicPurchase({requestId:f,result:Hs.ERROR,error:{message:(d=p==null?void 0:p.message)!==null&&d!==void 0?d:"Unknown error"}})}})),s.push(await ve.addListener("onPerformRestoreRequest",async i=>{var l;const c=i.requestId;try{const d=await r.performRestore();await ve.resumePurchaseLogicRestore(Object.assign({requestId:c},Sd(d)))}catch(d){await ve.resumePurchaseLogicRestore({requestId:c,result:Hs.ERROR,error:{message:(l=d==null?void 0:d.message)!==null&&l!==void 0?l:"Unknown error"}})}})));const a=Object.assign(Object.assign({},t),{hasPaywallListener:!!n,hasPurchaseLogic:!!r});return delete a.listener,delete a.purchaseLogic,await e(a)}finally{for(const o of s)await o.remove()}}const Z1={async presentPaywall(e){_d(e==null?void 0:e.presentationConfiguration);const t=e??{},{presentationConfiguration:n,listener:r,purchaseLogic:s}=t,o=Cd(t,["presentationConfiguration","listener","purchaseLogic"]),a=Object.assign(Object.assign({},o),Ed(n));return!r&&!s?ve.presentPaywall(a):Ad(i=>ve.presentPaywall(i),a,r,s)},async presentPaywallIfNeeded(e){_d(e==null?void 0:e.presentationConfiguration);const{presentationConfiguration:t,listener:n,purchaseLogic:r}=e,s=Cd(e,["presentationConfiguration","listener","purchaseLogic"]),o=Object.assign(Object.assign({},s),Ed(t));return!n&&!r?ve.presentPaywallIfNeeded(o):Ad(a=>ve.presentPaywallIfNeeded(a),o,n,r)},async presentCustomerCenter(){return ve.presentCustomerCenter()},setMockWebResults:ve.setMockWebResults?async e=>ve.setMockWebResults(e):void 0,addListener(e,t){return ve.addListener(e,t)},removeAllListeners(){return ve.removeAllListeners()}},K=e=>typeof e=="string",ps=()=>{let e,t;const n=new Promise((r,s)=>{e=r,t=s});return n.resolve=e,n.reject=t,n},Nd=e=>e==null?"":""+e,s4=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},o4=/###/g,Pd=e=>e&&e.indexOf("###")>-1?e.replace(o4,"."):e,kd=e=>!e||K(e),Os=(e,t,n)=>{const r=K(t)?t.split("."):t;let s=0;for(;s<r.length-1;){if(kd(e))return{};const o=Pd(r[s]);!e[o]&&n&&(e[o]=new n),Object.prototype.hasOwnProperty.call(e,o)?e=e[o]:e={},++s}return kd(e)?{}:{obj:e,k:Pd(r[s])}},Id=(e,t,n)=>{const{obj:r,k:s}=Os(e,t,Object);if(r!==void 0||t.length===1){r[s]=n;return}let o=t[t.length-1],a=t.slice(0,t.length-1),i=Os(e,a,Object);for(;i.obj===void 0&&a.length;)o=`${a[a.length-1]}.${o}`,a=a.slice(0,a.length-1),i=Os(e,a,Object),i!=null&&i.obj&&typeof i.obj[`${i.k}.${o}`]<"u"&&(i.obj=void 0);i.obj[`${i.k}.${o}`]=n},a4=(e,t,n,r)=>{const{obj:s,k:o}=Os(e,t,Object);s[o]=s[o]||[],s[o].push(n)},oa=(e,t)=>{const{obj:n,k:r}=Os(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]}
vendor: 4,221 bytes, line 2
2,i4=(e,t,n)=>{const r=oa(e,n);return r!==void 0?r:oa(t,n)},J1=(e,t,n)=>{for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?K(e[r])||e[r]instanceof String||K(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):J1(e[r],t[r],n):e[r]=t[r]);return e},vr=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var l4={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const c4=e=>K(e)?e.replace(/[&<>"'\/]/g,t=>l4[t]):e;class u4{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}const d4=[" ",",","?","!",";"],f4=new u4(20),h4=(e,t,n)=>{t=t||"",n=n||"";const r=d4.filter(a=>t.indexOf(a)<0&&n.indexOf(a)<0);if(r.length===0)return!0;const s=f4.getRegExp(`(${r.map(a=>a==="?"?"\\?":a).join("|")})`);let o=!s.test(e);if(!o){const a=e.indexOf(n);a>0&&!s.test(e.substring(0,a))&&(o=!0)}return o},vl=(e,t,n=".")=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const r=t.split(n);let s=e;for(let o=0;o<r.length;){if(!s||typeof s!="object")return;let a,i="";for(let l=o;l<r.length;++l)if(l!==o&&(i+=n),i+=r[l],a=s[i],a!==void 0){if(["string","number","boolean"].indexOf(typeof a)>-1&&l<r.length-1)continue;o+=l-o+1;break}s=a}return s},Ws=e=>e==null?void 0:e.replace("_","-"),p4={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){var n,r;(r=(n=console==null?void 0:console[e])==null?void 0:n.apply)==null||r.call(n,console,t)}};class aa{constructor(t,n={}){this.init(t,n)}init(t,n={}){this.prefix=n.prefix||"i18next:",this.logger=t||p4,this.options=n,this.debug=n.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,n,r,s){return s&&!this.debug?null:(K(t[0])&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new aa(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new aa(this.logger,t)}}var Dt=new aa;class Va{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const s=this.observers[r].get(n)||0;this.observers[r].set(n,s+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}emit(t,...n){this.observers[t]&&Array.from(this.observers[t].entries()).forEach(([s,o])=>{for(let a=0;a<o;a++)s(...n)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([s,o])=>{for(let a=0;a<o;a++)s.apply(s,[t,...n])})}}class Rd extends Va{constructor(t,n={ns:["translation"],defaultNS:"translation"}){super(),this.data=t||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,r,s={}){var c,d;const o=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,a=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let i;t.indexOf(".")>-1?i=t.split("."):(i=[t,n],r&&(Array.isArray(r)?i.push(...r):K(r)&&o?i.push(...r.split(o)):i.push(r)));const l=oa(this.data,i);return!l&&!n&&!r&&t.indexOf(".")>-1&&(t=i[0],n=i[1],r=i.slice(2).join(".")),l||!a||!K(r)?l:vl((d=(c=this.data)==null?void 0:c[t])==null?void 0:d[n],r,o)}addResource(t,n,r,s,o={silent:!1}){const a=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator;let i=[t,n];r&&(i=i.concat(a?r.split(a):r)),t.indexOf(".")>-1&&(i=t.split("."),s=n,n=i[1]),this.addNamespaces(n),Id(this.data,i,s),o.silent||this.emit("added",t,n,r,s)}addResources(t,n,r,s={silent:!1}){for(const o in r)(K(r[o])||Array.isArray(r[o]))&&this.addResource(t,n,o,r[o],{silent:!0});
2s.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,s,o,a={silent:!1,skipCopy:!1}){let i=[t,n];t.indexOf(".")>-1&&(i=t.split("."),s=r,r=n,n=i[1]),this.addNamespaces(n);let l=oa(this.data,i)||{};a.skipCopy||(r=JSON.parse(JSON.stringify(r))),s?J1(l,r,o):l={...l,...r},Id(this.data,i,l),a.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(s=>n[s]&&Object.keys(n[s]).length>0)}toJSON(){return this.data}}var ep={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,s){return e.forEach(o=>{var a;t=((a=this.processors[o])==null?void 0:a.process(t,n,r,s))??t}),t}};const tp=Symbol("i18next/PATH_KEY");function m4(){const e=[],t=Object.create(null);let n;return t.get=(r,s)=>{var o;return(o=n==null?void 0:n.revoke)==null||o.call(n),s===tp?e:(e.push(s),n=Proxy.revocable(r,t),n.proxy)},Proxy.revocable(Object.create(null),t).proxy}function bl(e,t){const{[tp]:n}=e(m4());return n.join((t==null?void 0:t.keySeparator)??".")}const Td={},gi=e=>!K(e)&&typeof e!="boolean"&&typeof e!="number";class ia extends Va{constructor(t,n={}){super(),s4(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","
2i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Dt.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t,n={interpolation:{}}){const r={...n};if(t==null)return!1;const s=this.resolve(t,r);if((s==null?void 0:s.res)===void 0)return!1;const o=gi(s.res);return!(r.returnObjects===!1&&o)}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const s=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let o=n.ns||this.options.defaultNS||[];const a=r&&t.indexOf(r)>-1,i=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!h4(t,r,s);if(a&&!i){const l=t.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:t,namespaces:K(o)?[o]:o};const c=t.split(r);(r!==s||r===s&&this.options.ns.indexOf(c[0])>-1)&&(o=c.shift()),t=c.join(s)}return{key:t,namespaces:K(o)?[o]:o}}translate(t,n,r){let s=typeof n=="object"?{...n}:n;if(typeof s!="object"&&this.options.overloadTranslationOptionHandler&&(s=this.options.overloadTranslationOptionHandler(arguments)),typeof s=="object"&&(s={...s}),s||(s={}),t==null)return"";typeof t=="function"&&(t=bl(t,{...this.options,...s})),Array.isArray(t)||(t=[String(t)]);const o=s.returnDetails!==void 0?s.returnDetails:this.options.returnDetails,a=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,{key:i,namespaces:l}=this.extractFromKey(t[t.length-1],s),c=l[l.length-1];let d=s.nsSeparator!==void 0?s.nsSeparator:this.options.nsSeparator;d===void 0&&(d=":");const f=s.lng||this.language,h=s.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((f==null?void 0:f.toLowerCase())==="cimode")return h?o?{res:`${c}${d}${i}`,usedKey:i,exactUsedKey:i,usedLng:f,usedNS:c,usedParams:this.getUsedParamsDetails(s)}:`${c}${d}${i}`:o?{res:i,usedKey:i,exactUsedKey:i,usedLng:f,usedNS:c,usedParams:this.getUsedParamsDetails(s)}:i;const p=this.resolve(t,s);let g=p==null?void 0:p.res;const y=(p==null?void 0:p.usedKey)||i,v=(p==null?void 0:p.exactUsedKey)||i,x=["[object Number]","[object Function]","[object RegExp]"],C=s.joinArrays!==void 0?s.joinArrays:this.options.joinArrays,_=!this.i18nFormat||this.i18nFormat.handleAsObject,b=s.count!==void 0&&!K(s.count),w=ia.hasDefaultValue(s),P=b?this.pluralResolver.getSuffix(f,s.count,s):"",N=s.ordinal&&b?this.pluralResolver.getSuffix(f,s.count,{ordinal:!1}):"",E=b&&!s.ordinal&&s.count===0,A=E&&s[`defaultValue${this.options.pluralSeparator}zero`]||s[`defaultValue${P}`]||s[`defaultValue${N}`]||s.defaultValue;let k=g;_&&!g&&w&&(k=A);const T=gi(k),I=Object.prototype.toString.apply(k);if(_&&k&&T&&x.indexOf(I)<0&&!(K(C)&&Array.isArray(k))){if(!s.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const R=this.options.returnedObjectHandler?this.options.returnedObjectHandler(y,k,{...s,ns:l}):`key '${i} (${this.language})' returned an object instead of string.`;return o?(p.res=R,p.usedParams=this.getUsedParamsDetails(s),p):R}if(a){const R=Array.isArray(k),O=R?[]:{},M=R?v:y;for(const D in k)if(Object.prototype.hasOwnProperty.call(k,D)){const $=`${M}${a}${D}`;w&&!g?O[D]=this.translate($,{...s,defaultValue:gi(A)?A[D]:void 0,joinArrays:!1,ns:l}):O[D]=this.translate($,{...s,joinArrays:!1,ns:l}),O[D]===$&&(O[D]=k[D])}g=O}}else if(_&&K(C)&&Array.isArray(g))g=g.join(C),g&&(g=this.extendTranslation(g,t,s,r));else{let R=!1,O=!1;!this.isValidLookup(g)&&w&&(R=!0,g=A),this.isValidLookup(g)||(O=!0,g=i);const D=(s.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&O?void 0:g,$=w&&A!==g&&this.options.updateMissing;if(O||R||$){if(this.logger.log($?"updateKey":"missingKey",f,c,i,$?A:g),a){const J=this.resolve(i,{...s,keySeparator:!1});J&&J.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let H=[];const U=this.languageUtils.getFallbackCodes(this.options.fallbackLng,s.lng||this.language);if(this.options.saveMissingTo==="fallback"&&U&&U[0])for(let J=0;J<U.length;J++)H.push(U[J]);else this.options.saveMissingTo==="all"?H=this.languageUtils.toResolveHierarchy(s.lng||this.language):H.push(s.lng||this.language);const re=(J,Q,ee)=>{var he;const oe=w&&ee!==g?ee:D;this.options.missingKeyHandler?this.options.missingKeyHandler(J,c,Q,oe,$,s):(he=this.backendConnector)!=null&&he.saveMissing&&this.backendConnector.saveMissing(J,c,Q,oe,$,s),this.emit
vendor: 28,948 bytes, line 2
2("missingKey",J,c,Q,g)};this.options.saveMissing&&(this.options.saveMissingPlurals&&b?H.forEach(J=>{const Q=this.pluralResolver.getSuffixes(J,s);E&&s[`defaultValue${this.options.pluralSeparator}zero`]&&Q.indexOf(`${this.options.pluralSeparator}zero`)<0&&Q.push(`${this.options.pluralSeparator}zero`),Q.forEach(ee=>{re([J],i+ee,s[`defaultValue${ee}`]||A)})}):re(H,i,A))}g=this.extendTranslation(g,t,s,p,r),O&&g===i&&this.options.appendNamespaceToMissingKey&&(g=`${c}${d}${i}`),(O||R)&&this.options.parseMissingKeyHandler&&(g=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}${d}${i}`:i,R?g:void 0,s))}return o?(p.res=g,p.usedParams=this.getUsedParamsDetails(s),p):g}extendTranslation(t,n,r,s,o){var l,c;if((l=this.i18nFormat)!=null&&l.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const d=K(t)&&(((c=r==null?void 0:r.interpolation)==null?void 0:c.skipOnVariables)!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let f;if(d){const p=t.match(this.interpolator.nestingRegexp);f=p&&p.length}let h=r.replace&&!K(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(h={...this.options.interpolation.defaultVariables,...h}),t=this.interpolator.interpolate(t,h,r.lng||this.language||s.usedLng,r),d){const p=t.match(this.interpolator.nestingRegexp),g=p&&p.length;f<g&&(r.nest=!1)}!r.lng&&s&&s.res&&(r.lng=this.language||s.usedLng),r.nest!==!1&&(t=this.interpolator.nest(t,(...p)=>(o==null?void 0:o[0])===p[0]&&!r.context?(this.logger.warn(`It seems you are nesting recursively key: ${p[0]} in key: ${n[0]}`),null):this.translate(...p,n),r)),r.interpolation&&this.interpolator.reset()}const a=r.postProcess||this.options.postProcess,i=K(a)?[a]:a;return t!=null&&(i!=null&&i.length)&&r.applyPostProcessor!==!1&&(t=ep.handle(i,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...s,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),t}resolve(t,n={}){let r,s,o,a,i;return K(t)&&(t=[t]),t.forEach(l=>{if(this.isValidLookup(r))return;const c=this.extractFromKey(l,n),d=c.key;s=d;let f=c.namespaces;this.options.fallbackNS&&(f=f.concat(this.options.fallbackNS));const h=n.count!==void 0&&!K(n.count),p=h&&!n.ordinal&&n.count===0,g=n.context!==void 0&&(K(n.context)||typeof n.context=="number")&&n.context!=="",y=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);f.forEach(v=>{var x,C;this.isValidLookup(r)||(i=v,!Td[`${y[0]}-${v}`]&&((x=this.utils)!=null&&x.hasLoadedNamespace)&&!((C=this.utils)!=null&&C.hasLoadedNamespace(i))&&(Td[`${y[0]}-${v}`]=!0,this.logger.warn(`key "${s}" for languages "${y.join(", ")}" won't get resolved as namespace "${i}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),y.forEach(_=>{var P;if(this.isValidLookup(r))return;a=_;const b=[d];if((P=this.i18nFormat)!=null&&P.addLookupKeys)this.i18nFormat.addLookupKeys(b,d,_,v,n);else{let N;h&&(N=this.pluralResolver.getSuffix(_,n.count,n));const E=`${this.options.pluralSeparator}zero`,A=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(h&&(n.ordinal&&N.indexOf(A)===0&&b.push(d+N.replace(A,this.options.pluralSeparator)),b.push(d+N),p&&b.push(d+E)),g){const k=`${d}${this.options.contextSeparator||"_"}${n.context}`;b.push(k),h&&(n.ordinal&&N.indexOf(A)===0&&b.push(k+N.replace(A,this.options.pluralSeparator)),b.push(k+N),p&&b.push(k+E))}}let w;for(;w=b.pop();)this.isValidLookup(r)||(o=w,r=this.getResource(_,v,w,n))}))})}),{res:r,usedKey:s,exactUsedKey:o,usedLng:a,usedNS:i}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r,s={}){var o;return(o=this.i18nFormat)!=null&&o.getResource?this.i18nFormat.getResource(t,n,r,s):this.resourceStore.getResource(t,n,r,s)}getUsedParamsDetails(t={}){const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&!K(t.replace);let s=r?t.replace:t;if(r&&typeof t.count<"u"&&(s.count=t.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!r){s={...s};for(const o of n)delete s[o]}return s}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}}class Od{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Dt.create("languageUtils")}getScriptPartFromCode(t){if(t=Ws(t),!t||t.indexOf("-")<0)return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=Ws(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(K(t)&&t.indexOf("-")>-1){let n;try{n=Intl.getCanonicalLocales(t)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const s=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(s))&&(n=s)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const s=this.getScriptPartFromCode(r);if(this.isSupportedCode(s))return n=s;const o=this.getLanguagePartFromCode(r);if(this.isSupportedCode(o))return n=o;n=this.options.supportedLngs.find(a=>{if(a===o)return a;if(!(a.indexOf("-")<0&&o.indexOf("-")<0)&&(a.indexOf("-")>0&&o.indexOf("-")<0&&a.substring(0,a.indexOf("-"))===o||a.indexOf(o)===0&&o.length>1))return a})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),K(t)&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes((n===!1?[]:n)||this.options.fallbackLng||[],t),s=[],o=a=>{a&&(this.isSupportedCode(a)?s.push(a):this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`))};return K(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&o(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&o(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&o(this.getLanguagePartFromCode(t))):K(t)&&o(this.formatLanguageCode(t)),r.forEach(a=>{s.indexOf(a)<0&&o(this.formatLanguageCode(a))}),s}}const jd={zero:0,one:1,two:2,few:3,many:4,other:5},Ld={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class g4{constructor(t,n={}){this.languageUtils=t,this.options=n,this.logger=Dt.create("pluralResolver"),this.pluralRulesCache={}}addRule(t,n){this.rules[t]=n}clearCache(){this.pluralRulesCache={}}getRule(t,n={}){const r=Ws(t==="dev"?"en":t),s=n.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:r,type:s});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];let a;try{a=new Intl.PluralRules(r,{type:s})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),Ld;if(!t.match(/-|_/))return Ld;const l=this.languageUtils.getLanguagePartFromCode(t);a=this.getRule(l,n)}return this.pluralRulesCache[o]=a,a}needsPlural(t,n={}){let r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),(r==null?void 0:r.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(t,n,r={}){return this.getSuffixes(t,r).map(s=>`${n}${s}`)}getSuffixes(t,n={}){let r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),r?r.resolvedOptions().pluralCategories.sort((s,o)=>jd[s]-jd[o]).map(s=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${s}`):[]}getSuffix(t,n,r={}){const s=this.getRule(t,r);return s?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${s.select(n)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",n,r))}}const Md=(e,t,n,r=".",s=!0)=>{let o=i4(e,t,n);return!o&&s&&K(n)&&(o=vl(e,n,r),o===void 0&&(o=vl(t,n,r))),o},yi=e=>e.replace(/\$/g,"$$$$");class Dd{constructor(t={}){var n;this.logger=Dt.create("interpolator"),this.options=t,this.format=((n=t==null?void 0:t.interpolation)==null?void 0:n.format)||(r=>r),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:s,prefix:o,prefixEscaped:a,suffix:i,suffixEscaped:l,formatSeparator:c,unescapeSuffix:d,unescapePrefix:f,nestingPrefix:h,nestingPrefixEscaped:p,nestingSuffix:g,nestingSuffixEscaped:y,nestingOptionsSeparator:v,maxReplaces:x,alwaysFormat:C}=t.interpolation;this.escape=n!==void 0?n:c4,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=o?vr(o):a||"{{",this.suffix=i?vr(i):l||"}}",this.formatSeparator=c||",",this.unescapePrefix=d?"":f||"-",this.unescapeSuffix=this.unescapePrefix?"":d||"",this.nestingPrefix=h?vr(h):p||vr("$t("),this.nestingSuffix=g?vr(g):y||vr(")"),this.nestingOptionsSeparator=v||",",this.maxReplaces=x||1e3,this.alwaysFormat=C!==void 0?C:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,r)=>(n==null?void 0:n.source)===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(t,n,r,s){var p;let o,a,i;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=g=>{if(g.indexOf(this.formatSeparator)<0){const C=Md(n,l,g,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(C,void 0,r,{...s,...n,interpolationkey:g}):C}const y=g.split(this.formatSeparator),v=y.shift().trim(),x=y.join(this.formatSeparator).trim();return this.format(Md(n,l,v,this.options.keySeparator,this.options.ignoreJSONStructure),x,r,{...s,...n,interpolationkey:v})};this.resetRegExp();const d=(s==null?void 0:s.missingInterpolationHandler)||this.options.missingInterpolationHandler,f=((p=s==null?void 0:s.interpolation)==null?void 0:p.skipOnVariables)!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:g=>yi(g)},{regex:this.regexp,safeValue:g=>this.escapeValue?yi(this.escape(g)):yi(g)}].forEach(g=>{for(i=0;o=g.regex.exec(t);){const y=o[1].trim();if(a=c(y),a===void 0)if(typeof d=="function"){const x=d(t,o,s);a=K(x)?x:""}else if(s&&Object.prototype.hasOwnProperty.call(s,y))a="";else if(f){a=o[0];continue}else this.logger.warn(`missed to pass in variable ${y} for interpolating ${t}`),a="";else!K(a)&&!this.useRawValueToEscape&&(a=Nd(a));const v=g.safeValue(a);if(t=t.replace(o[0],v),f?(g.regex.lastIndex+=a.length,g.regex.lastIndex-=o[0].length):g.regex.lastIndex=0,i++,i>=this.maxReplaces)break}}),t}nest(t,n,r={}){let s,o,a;const i=(l,c)=>{const d=this.nestingOptionsSeparator;if(l.indexOf(d)<0)return l;const f=l.split(new RegExp(`${d}[ ]*{`));let h=`{${f[1]}`;l=f[0],h=this.interpolate(h,a);const p=h.match(/'/g),g=h.match(/"/g);(((p==null?void 0:p.length)??0)%2===0&&!g||g.length%2!==0)&&(h=h.replace(/'/g,'"'));try{a=JSON.parse(h),c&&(a={...c,...a})}catch(y){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,y),`${l}${d}${h}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,l};for(;s=this.nestingRegexp.exec(t);){let l=[];a={...r},a=a.replace&&!K(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;const c=/{.*}/.test(s[1])?s[1].lastIndexOf("}")+1:s[1].indexOf(this.formatSeparator);if(c!==-1&&(l=s[1].slice(c).split(this.formatSeparator).map(d=>d.trim()).filter(Boolean),s[1]=s[1].slice(0,c)),o=n(i.call(this,s[1].trim(),a),a),o&&s[0]===t&&!K(o))return o;K(o)||(o=Nd(o)),o||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${t}`),o=""),l.length&&(o=l.reduce((d,f)=>this.format(d,f,r.lng,{...r,interpolationkey:s[1].trim()}),o.trim())),t=t.replace(s[0],o),this.regexp.lastIndex=0}return t}}const y4=e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const s=r[1].substring(0,r[1].length-1);t==="currency"&&s.indexOf(":")<0?n.currency||(n.currency=s.trim()):t==="relativetime"&&s.indexOf(":")<0?n.range||(n.range=s.trim()):s.split(";").forEach(a=>{if(a){const[i,...l]=a.split(":"),c=l.join(":").trim().replace(/^'+|'+$/g,""),d=i.trim();n[d]||(n[d]=c),c==="false"&&(n[d]=!1),c==="true"&&(n[d]=!0),isNaN(c)||(n[d]=parseInt(c,10))}})}return{formatName:t,formatOptions:n}},Fd=e=>{const t={};return(n,r,s)=>{let o=s;s&&s.interpolationkey&&s.formatParams&&s.formatParams[s.interpolationkey]&&s[s.interpolationkey]&&(o={...o,[s.interpolationkey]:void 0});const a=r+JSON.stringify(o);let i=t[a];return i||(i=e(Ws(r),s),t[a]=i),i(n)}},v4=e=>(t,n,r)=>e(Ws(n),r)(t);class b4{constructor(t={}){this.logger=Dt.create("formatter"),this.options=t,this.init(t)}init(t,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const r=n.cacheInBuiltFormats?Fd:v4;this.formats={number:r((s,o)=>{const a=new Intl.NumberFormat(s,{...o});return i=>a.format(i)}),currency:r((s,o)=>{const a=new Intl.NumberFormat(s,{...o,style:"currency"});return i=>a.format(i)}),datetime:r((s,o)=>{const a=new Intl.DateTimeFormat(s,{...o});return i=>a.format(i)}),relativetime:r((s,o)=>{const a=new Intl.RelativeTimeFormat(s,{...o});return i=>a.format(i,o.range||"day")}),list:r((s,o)=>{const a=new Intl.ListFormat(s,{...o});return i=>a.format(i)})}}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=Fd(n)}format(t,n,r,s={}){const o=n.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find(i=>i.indexOf(")")>-1)){const i=o.findIndex(l=>l.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,i)].join(this.formatSeparator)}return o.reduce((i,l)=>{var f;const{formatName:c,formatOptions:d}=y4(l);if(this.formats[c]){let h=i;try{const p=((f=s==null?void 0:s.formatParams)==null?void 0:f[s.interpolationkey])||{},g=p.locale||p.lng||s.locale||s.lng||r;h=this.formats[c](i,g,{...d,...s,...p})}catch(p){this.logger.warn(p)}return h}else this.logger.warn(`there was no format function for ${c}`);return i},t)}}const w4=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class x4 extends Va{constructor(t,n,r,s={}){var o,a;super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=s,this.logger=Dt.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],(a=(o=this.backend)==null?void 0:o.init)==null||a.call(o,r,s.backend,s)}queueLoad(t,n,r,s){const o={},a={},i={},l={};return t.forEach(c=>{let d=!0;n.forEach(f=>{const h=`${c}|${f}`;!r.reload&&this.store.hasResourceBundle(c,f)?this.state[h]=2:this.state[h]<0||(this.state[h]===1?a[h]===void 0&&(a[h]=!0):(this.state[h]=1,d=!1,a[h]===void 0&&(a[h]=!0),o[h]===void 0&&(o[h]=!0),l[f]===void 0&&(l[f]=!0)))}),d||(i[c]=!0)}),(Object.keys(o).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(o),pending:Object.keys(a),toLoadLanguages:Object.keys(i),toLoadNamespaces:Object.keys(l)}}loaded(t,n,r){const s=t.split("|"),o=s[0],a=s[1];n&&this.emit("failedLoading",o,a,n),!n&&r&&this.store.addResourceBundle(o,a,r,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&r&&(this.state[t]=0);const i={};this.queue.forEach(l=>{a4(l.loaded,[o],a),w4(l,t),n&&l.errors.push(n),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(c=>{i[c]||(i[c]={});const d=l.loaded[c];d.length&&d.forEach(f=>{i[c][f]===void 0&&(i[c][f]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",i),this.queue=this.queue.filter(l=>!l.done)}read(t,n,r,s=0,o=this.retryTimeout,a){if(!t.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:s,wait:o,callback:a});return}this.readingCalls++;const i=(c,d)=>{if(this.readingCalls--,this.waitingReads.length>0){const f=this.waitingReads.shift();this.read(f.lng,f.ns,f.fcName,f.tried,f.wait,f.callback)}if(c&&d&&s<this.maxRetries){setTimeout(()=>{this.read.call(this,t,n,r,s+1,o*2,a)},o);return}a(c,d)},l=this.backend[r].bind(this.backend);if(l.length===2){try{const c=l(t,n);c&&typeof c.then=="function"?c.then(d=>i(null,d)).catch(i):i(null,c)}catch(c){i(c)}return}return l(t,n,i)}prepareLoading(t,n,r={},s){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();K(t)&&(t=this.languageUtils.toResolveHierarchy(t)),K(n)&&(n=[n]);const o=this.queueLoad(t,n,r,s);if(!o.toLoad.length)return o.pending.length||s(),null;o.toLoad.forEach(a=>{this.loadOne(a)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t,n=""){const r=t.split("|"),s=r[0],o=r[1];this.read(s,o,"read",void 0,void 0,(a,i)=>{a&&this.logger.warn(`${n}loading namespace ${o} for language ${s} failed`,a),!a&&i&&this.logger.log(`${n}loaded namespace ${o} for language ${s}`,i),this.loaded(t,a,i)})}saveMissing(t,n,r,s,o,a={},i=()=>{}){var l,c,d,f,h;if((c=(l=this.services)==null?void 0:l.utils)!=null&&c.hasLoadedNamespace&&!((f=(d=this.services)==null?void 0:d.utils)!=null&&f.hasLoadedNamespace(n))){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if((h=this.backend)!=null&&h.create){const p={...a,isUpdate:o},g=this.backend.create.bind(this.backend);if(g.length<6)try{let y;g.length===5?y=g(t,n,r,s,p):y=g(t,n,r,s),y&&typeof y.then=="function"?y.then(v=>i(null,v)).catch(i):i(null,y)}catch(y){i(y)}else g(t,n,r,s,i,p)}!t||!t[0]||this.store.addResource(t[0],n,r,s)}}}const Ud=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),K(e[1])&&(t.defaultValue=e[1]),K(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(r=>{t[r]=n[r]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),Bd=e=>{var t,n;return K(e.ns)&&(e.ns=[e.ns]),K(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),K(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),((n=(t=e.supportedLngs)==null?void 0:t.indexOf)==null?void 0:n.call(t,"cimode"))<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),typeof e.initImmediate=="boolean"&&(e.initAsync=e.initImmediate),e},So=()=>{},C4=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class js extends Va{constructor(t={},n){if(super(),this.options=Bd(t),this.services={},this.logger=Dt,this.modules={external:[]},C4(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(t={},n){this.isInitializing=!0,typeof t=="function"&&(n=t,t={}),t.defaultNS==null&&t.ns&&(K(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const r=Ud();this.options={...r,...this.options,...Bd(t)},this.options.interpolation={...r.interpolation,...this.options.interpolation},t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=r.overloadTranslationOptionHandler);const s=c=>c?typeof c=="function"?new c:c:null;if(!this.options.isClone){this.modules.logger?Dt.init(s(this.modules.logger),this.options):Dt.init(null,this.options);let c;this.modules.formatter?c=this.modules.formatter:c=b4;const d=new Od(this.options);this.store=new Rd(this.options.resources,this.options);const f=this.services;f.logger=Dt,f.resourceStore=this.store,f.languageUtils=d,f.pluralResolver=new g4(d,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),c&&(!this.options.interpolation.format||this.options.interpolation.format===r.interpolation.format)&&(f.formatter=s(c),f.formatter.init&&f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new Dd(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new x4(s(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",(p,...g)=>{this.emit(p,...g)}),this.modules.languageDetector&&(f.languageDetector=s(this.modules.languageDetector),f.languageDetector.init&&f.languageDetector.init(f,this.options.detection,this.options)),this.modules.i18nFormat&&(f.i18nFormat=s(this.modules.i18nFormat),f.i18nFormat.init&&f.i18nFormat.init(this)),this.translator=new ia(this.services,this.options),this.translator.on("*",(p,...g)=>{this.emit(p,...g)}),this.modules.external.forEach(p=>{p.init&&p.init(this)})}if(this.format=this.options.interpolation.format,n||(n=So),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const c=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);c.length>0&&c[0]!=="dev"&&(this.options.lng=c[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(c=>{this[c]=(...d)=>this.store[c](...d)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(c=>{this[c]=(...d)=>(this.store[c](...d),this)});const i=ps(),l=()=>{const c=(d,f)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),i.resolve(f),n(d,f)};if(this.languages&&!this.isInitialized)return c(null,this.t.bind(this));this.changeLanguage(this.options.lng,c)};return this.options.resources||!this.options.initAsync?l():setTimeout(l,0),i}loadResources(t,n=So){var o,a;let r=n;const s=K(t)?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if((s==null?void 0:s.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const i=[],l=c=>{if(!c||c==="cimode")return;this.services.languageUtils.toResolveHierarchy(c).forEach(f=>{f!=="cimode"&&i.indexOf(f)<0&&i.push(f)})};s?l(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(d=>l(d)),(a=(o=this.options.preload)==null?void 0:o.forEach)==null||a.call(o,c=>l(c)),this.services.backendConnector.load(i,this.options.ns,c=>{!c&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(c)})}else r(null)}reloadResources(t,n,r){const s=ps();return typeof t=="function"&&(r=t,t=void 0),typeof n=="function"&&(r=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),r||(r=So),this.services.backendConnector.reload(t,n,o=>{s.resolve(),r(o)}),s}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&ep.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1)){for(let n=0;n<this.languages.length;n++){const r=this.languages[n];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}!this.resolvedLanguage&&this.languages.indexOf(t)<0&&this.store.hasLanguageSomeTranslations(t)&&(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(t,n){this.isLanguageChangingTo=t;const r=ps();this.emit("languageChanging",t);const s=i=>{this.language=i,this.languages=this.services.languageUtils.toResolveHierarchy(i),this.resolvedLanguage=void 0,this.setResolvedLanguage(i)},o=(i,l)=>{l?this.isLanguageChangingTo===t&&(s(l),this.translator.changeLanguage(l),this.isLanguageChangingTo=void 0,this.emit("languageChanged",l),this.logger.log("languageChanged",l)):this.isLanguageChangingTo=void 0,r.resolve((...c)=>this.t(...c)),n&&n(i,(...c)=>this.t(...c))},a=i=>{var d,f;!t&&!i&&this.services.languageDetector&&(i=[]);const l=K(i)?i:i&&i[0],c=this.store.hasLanguageSomeTranslations(l)?l:this.services.languageUtils.getBestMatchFromCodes(K(i)?[i]:i);c&&(this.language||s(c),this.translator.language||this.translator.changeLanguage(c),(f=(d=this.services.languageDetector)==null?void 0:d.cacheUserLanguage)==null||f.call(d,c)),this.loadResources(c,h=>{o(h,c)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(t),r}getFixedT(t,n,r){const s=(o,a,...i)=>{let l;typeof a!="object"?l=this.options.overloadTranslationOptionHandler([o,a].concat(i)):l={...a},l.lng=l.lng||s.lng,l.lngs=l.lngs||s.lngs,l.ns=l.ns||s.ns,l.keyPrefix!==""&&(l.keyPrefix=l.keyPrefix||r||s.keyPrefix);const c=this.options.keySeparator||".";let d;return l.keyPrefix&&Array.isArray(o)?d=o.map(f=>(typeof f=="function"&&(f=bl(f,{...this.options,...a})),`${l.keyPrefix}${c}${f}`)):(typeof o=="function"&&(o=bl(o,{...this.options,...a})),d=l.keyPrefix?`${l.keyPrefix}${c}${o}`:o),this.t(d,l)};return K(t)?s.lng=t:s.lngs=t,s.ns=n,s.keyPrefix=r,s}t(...t){var n;return(n=this.translator)==null?void 0:n.translate(...t)}exists(...t){var n;return(n=this.translator)==null?void 0:n.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,n={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;
2if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],s=this.options?this.options.fallbackLng:!1,o=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const a=(i,l)=>{const c=this.services.backendConnector.state[`${i}|${l}`];return c===-1||c===0||c===2};if(n.precheck){const i=n.precheck(this,a);if(i!==void 0)return i}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(r,t)&&(!s||a(o,t)))}loadNamespaces(t,n){const r=ps();return this.options.ns?(K(t)&&(t=[t]),t.forEach(s=>{this.options.ns.indexOf(s)<0&&this.options.ns.push(s)}),this.loadResources(s=>{r.resolve(),n&&n(s)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=ps();K(t)&&(t=[t]);const s=this.options.preload||[],o=t.filter(a=>s.indexOf(a)<0&&this.services.languageUtils.isSupportedCode(a));return o.length?(this.options.preload=s.concat(o),this.loadResources(a=>{r.resolve(),n&&n(a)}),r):(n&&n(),Promise.resolve())}dir(t){var s,o;if(t||(t=this.resolvedLanguage||(((s=this.languages)==null?void 0:s.length)>0?this.languages[0]:this.language)),!t)return"rtl";try{const a=new Intl.Locale(t);if(a&&a.getTextInfo){const i=a.getTextInfo();if(i&&i.direction)return i.direction}}catch{}const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=((o=this.services)==null?void 0:o.languageUtils)||new Od(Ud());return t.toLowerCase().indexOf("-latn")>1?"ltr":n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},n){const r=new js(t,n);return r.createInstance=js.createInstance,r}cloneInstance(t={},n=So){const r=t.forkResourceStore;r&&delete t.forkResourceStore;const s={...this.options,...t,isClone:!0},o=new js(s);if((t.debug!==void 0||t.prefix!==void 0)&&(o.logger=o.logger.clone(t)),["store","services","language"].forEach(i=>{o[i]=this[i]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},r){const i=Object.keys(this.store.data).reduce((l,c)=>(l[c]={...this.store.data[c]},l[c]=Object.keys(l[c]).reduce((d,f)=>(d[f]={...l[c][f]},d),l[c]),l),{});o.store=new Rd(i,s),o.services.resourceStore=o.store}return t.interpolation&&(o.services.interpolator=new Dd(s)),o.translator=new ia(o.services,s),o.translator.on("*",(i,...l)=>{o.emit(i,...l)}),o.init(s,n),o.translator.options=s,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const pe=js.createInstance();pe.createInstance;pe.dir;pe.init;pe.loadResources;pe.reloadResources;pe.use;pe.changeLanguage;pe.getFixedT;pe.t;pe.exists;pe.setDefaultNamespace;pe.hasLoadedNamespace;pe.loadNamespaces;pe.loadLanguages;const _4=(e,t,n,r)=>{var o,a,i,l;const s=[n,{code:t,...r||{}}];if((a=(o=e==null?void 0:e.services)==null?void 0:o.logger)!=null&&a.forward)return e.services.logger.forward(s,"warn","react-i18next::",!0);nr(s[0])&&(s[0]=`react-i18next:: ${s[0]}`),(l=(i=e==null?void 0:e.services)==null?void 0:i.logger)!=null&&l.warn?e.services.logger.warn(...s):console!=null&&console.warn&&console.warn(...s)},$d={},wl=(e,t,n,r)=>{nr(n)&&$d[n]||(nr(n)&&($d[n]=new Date),_4(e,t,n,r))},np=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},xl=(e,t,n)=>{e.loadNamespaces(t,np(e,n))},zd=(e,t,n,r)=>{if(nr(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return xl(e,n,r);n.forEach(s=>{e.options.ns.indexOf(s)<0&&e.options.ns.push(s)}),e.loadLanguages(t,np(e,r))},E4=(e,t,n={})=>
2!t.languages||!t.languages.length?(wl(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(r,s)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!s(r.isLanguageChangingTo,e))return!1}}),nr=e=>typeof e=="string",S4=e=>typeof e=="object"&&e!==null,A4=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,N4={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},P4=e=>N4[e],k4=e=>e.replace(A4,P4);let Cl={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:k4};const I4=(e={})=>{Cl={...Cl,...e}},R4=()=>Cl;let rp;const T4=e=>{rp=e},O4=()=>rp,j4={type:"3rdParty",init(e){I4(e.options.react),T4(e)}},L4=m.createContext();class M4{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const D4=(e,t)=>{const n=m.useRef();return m.useEffect(()=>{n.current=e},[e,t]),n.current},sp=(e,t,n,r)=>e.getFixedT(t,n,r),F4=(e,t,n,r)=>m.useCallback(sp(e,t,n,r),[e,t,n,r]),_e=(e,t={})=>{var b,w,P,N;const{i18n:n}=t,{i18n:r,defaultNS:s}=m.useContext(L4)||{},o=n||r||O4();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new M4),!o){wl(o,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const E=(k,T)=>nr(T)?T:S4(T)&&nr(T.defaultValue)?T.defaultValue:Array.isArray(k)?k[k.length-1]:k,A=[E,{},!1];return A.t=E,A.i18n={},A.ready=!1,A}(b=o.options.react)!=null&&b.wait&&wl(o,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const a={...R4(),...o.options.react,...t},{useSuspense:i,keyPrefix:l}=a;let c=s||((w=o.options)==null?void 0:w.defaultNS);c=nr(c)?[c]:c||["translation"],(N=(P=o.reportNamespaces).addUsedNamespaces)==null||N.call(P,c);const d=(o.isInitialized||o.initializedStoreOnce)&&c.every(E=>E4(E,o,a)),f=F4(o,t.lng||null,a.nsMode==="fallback"?c:c[0],l),h=()=>f,p=()=>sp(o,t.lng||null,a.nsMode==="fallback"?c:c[0],l),[g,y]=m.useState(h);let v=c.join();t.lng&&(v=`${t.lng}${v}`);const x=D4(v),C=m.useRef(!0);m.useEffect(()=>{const{bindI18n:E,bindI18nStore:A}=a;C.current=!0,!d&&!i&&(t.lng?zd(o,t.lng,c,()=>{C.current&&y(p)}):xl(o,c,()=>{C.current&&y(p)})),d&&x&&x!==v&&C.current&&y(p);const k=()=>{C.current&&y(p)};return E&&(o==null||o.on(E,k)),A&&(o==null||o.store.on(A,k)),()=>{C.current=!1,o&&E&&(E==null||E.split(" ").forEach(T=>o.off(T,k))),A&&o&&A.split(" ").forEach(T=>o.store.off(T,k))}},[o,v]),m.useEffect(()=>{C.current&&d&&y(h)},[o,l,d]);const _=[g,o,d];if(_.t=g,_.i18n=o,_.ready=d,d||!d&&!i)return _;throw new Promise(E=>{t.lng?zd(o,t.lng,c,()=>E()):xl(o,c,()=>E())})},{slice:U4,forEach:B4}=[];function $4(e){return B4.call(U4.call(arguments,1),t=>{if(t)for(const n in t)e[n]===void 0&&(e[n]=t[n])}),e}
vendor: 6,620 bytes, line 2
2function z4(e){return typeof e!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(n=>n.test(e))}const Vd=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,V4=function(e,t){const r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},s=encodeURIComponent(t);let o=`${e}=${s}`;if(r.maxAge>0){const a=r.maxAge-0;if(Number.isNaN(a))throw new Error("maxAge should be a Number");o+=`; Max-Age=${Math.floor(a)}`}if(r.domain){if(!Vd.test(r.domain))throw new TypeError("option domain is invalid");o+=`; Domain=${r.domain}`}if(r.path){if(!Vd.test(r.path))throw new TypeError("option path is invalid");o+=`; Path=${r.path}`}if(r.expires){if(typeof r.expires.toUTCString!="function")throw new TypeError("option expires is invalid");o+=`; Expires=${r.expires.toUTCString()}`}if(r.httpOnly&&(o+="; HttpOnly"),r.secure&&(o+="; Secure"),r.sameSite)switch(typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite){case!0:o+="; SameSite=Strict";break;case"lax":o+="; SameSite=Lax";break;case"strict":o+="; SameSite=Strict";break;case"none":o+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return r.partitioned&&(o+="; Partitioned"),o},Hd={create(e,t,n,r){let s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};n&&(s.expires=new Date,s.expires.setTime(s.expires.getTime()+n*60*1e3)),r&&(s.domain=r),document.cookie=V4(e,t,s)},read(e){const t=`${e}=`,n=document.cookie.split(";");for(let r=0;r<n.length;r++){let s=n[r];for(;s.charAt(0)===" ";)s=s.substring(1,s.length);if(s.indexOf(t)===0)return s.substring(t.length,s.length)}return null},remove(e,t){this.create(e,"",-1,t)}};var H4={name:"cookie",lookup(e){let{lookupCookie:t}=e;if(t&&typeof document<"u")return Hd.read(t)||void 0},cacheUserLanguage(e,t){let{lookupCookie:n,cookieMinutes:r,cookieDomain:s,cookieOptions:o}=t;n&&typeof document<"u"&&Hd.create(n,e,r,s,o)}},W4={name:"querystring",lookup(e){var r;let{lookupQuerystring:t}=e,n;if(typeof window<"u"){let{search:s}=window.location;!window.location.search&&((r=window.location.hash)==null?void 0:r.indexOf("?"))>-1&&(s=window.location.hash.substring(window.location.hash.indexOf("?")));const a=s.substring(1).split("&");for(let i=0;i<a.length;i++){const l=a[i].indexOf("=");l>0&&a[i].substring(0,l)===t&&(n=a[i].substring(l+1))}}return n}},q4={name:"hash",lookup(e){var s;let{lookupHash:t,lookupFromHashIndex:n}=e,r;if(typeof window<"u"){const{hash:o}=window.location;if(o&&o.length>2){const a=o.substring(1);if(t){const i=a.split("&");for(let l=0;l<i.length;l++){const c=i[l].indexOf("=");c>0&&i[l].substring(0,c)===t&&(r=i[l].substring(c+1))}}if(r)return r;if(!r&&n>-1){const i=o.match(/\/([a-zA-Z-]*)/g);return Array.isArray(i)?(s=i[typeof n=="number"?n:0])==null?void 0:s.replace("/",""):void 0}}}return r}};let br=null;const Wd=()=>{if(br!==null)return br;try{if(br=typeof window<"u"&&window.localStorage!==null,!br)return!1;const e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch{br=!1}return br};var G4={name:"localStorage",lookup(e){let{lookupLocalStorage:t}=e;if(t&&Wd())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:n}=t;n&&Wd()&&window.localStorage.setItem(n,e)}};let wr=null;const qd=()=>{if(wr!==null)return wr;try{if(wr=typeof window<"u"&&window.sessionStorage!==null,!wr)return!1;const e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch{wr=!1}return wr};var K4={name:"sessionStorage",lookup(e){let{lookupSessionStorage:t}=e;if(t&&qd())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:n}=t;n&&qd()&&window.sessionStorage.setItem(n,e)}},Q4={name:"navigator",lookup(e){const t=[];if(typeof navigator<"u"){const{languages:n,userLanguage:r,language:s}=navigator;if(n)for(let o=0;o<n.length;o++)t.push(n[o]);r&&t.push(r),s&&t.push(s)}return t.length>0?t:void 0}},Y4={name:"htmlTag",lookup(e){let{htmlTag:t}=e,n;const r=t||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},X4={name:"path",lookup(e){var s;let{lookupFromPathIndex:t}=e;if(typeof window>"u")return;const n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(n)?(s=n[typeof t=="number"?t:0])==null?void 0:s.replace("/",""):void 0}},Z4={name:"subdomain",lookup(e){var s,o;let{lookupFromSubdomainIndex:t}=e;const n=typeof t=="number"?t+1:1,r=typeof window<"u"&&((o=(s=window.location)==null?void 0:s.hostname)==null?void 0:o.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));if(r)return r[n]}};let op=!1;try{document.cookie,op=!0}catch{}const ap=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];op||ap.splice(1,1);const J4=()=>({order:ap,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:e=>e});let ip=class{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(t,n)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=t,this.options=$4(n,this.options||{},J4()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=s=>s.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=r,this.addDetector(H4),this.addDetector(W4),this.addDetector(G4),this.addDetector(K4),this.addDetector(Q4),this.addDetector(Y4),this.addDetector(X4),this.addDetector(Z4),this.addDetector(q4)}addDetector(t){return this.detectors[t.name]=t,this}detect(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,n=[];return t.forEach(r=>{if(this.detectors[r]){let s=this.detectors[r].lookup(this.options);s&&typeof s=="string"&&(s=[s]),s&&(n=n.concat(s))}}),n=n.filter(r=>r!=null&&!z4(r)).map(r=>this.options.convertDetectedLanguage(r)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}
2cacheUserLanguage(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;n&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(t)>-1||n.forEach(r=>{this.detectors[r]&&this.detectors[r].cacheUserLanguage(t,this.options)}))}};ip.type="languageDetector";const lp=["en","nl"],kc="en",e7={en:()=>B(()=>import("./en_CeHQBu_Q.js"),[]),nl:()=>B(()=>import("./nl_QJxjwiHx.js"),[])},Ic=e=>{const t=(e??"").toLowerCase().split("-")[0];return lp.includes(t)?t:kc},Gd=new Set,la=async e=>{if(Gd.has(e))return;const t=await e7[e]();pe.addResourceBundle(e,"translation",t.default,!0,!0),Gd.add(e)};let ks=null;const cp=()=>ks||(ks=(async()=>{await pe.use(ip).use(j4).init({resources:{},fallbackLng:kc,supportedLngs:[...lp],nonExplicitSupportedLngs:!0,debug:!1,interpolation:{escapeValue:!1},detection:{order:["localStorage","navigator","htmlTag"],lookupLocalStorage:"i18nextLng",caches:["localStorage"]}}),await la(Ic(pe.resolvedLanguage??pe.language))})(),ks),t7=async()=>{await ks,await la(kc),await la(Ic(pe.resolvedLanguage??pe.language))};pe.on("languageChanged",e=>{la(Ic(e))});cp();const n7={en:"en-US",nl:"nl-NL"},r7=e=>n7[(e||"").split("-")[0].toLowerCase()]??null,up=()=>{const e=j.getPlatform();return(e==="ios"?"appl_NNMOJasoqOkbBtxtLxcJPXARZvK":void 0)||(e==="android"?"goog_bdfuMbEjxJWEAiVsGVWZpGaSdlu":void 0)||void 0||null},s7=()=>j.isNativePlatform()&&!!up();let kr=null;const dp=async e=>{try{await Pr.overridePreferredUILocale({locale:r7(e)})}catch(t){Ce(t,{area:"plus",action:"revenuecat_locale_override",level:"warning",extra:{language:e}})}};pe.on("languageChanged",e=>{kr&&kr.then(()=>dp(e)).catch(()=>{})});const Rc=()=>s7()?(kr||(kr=(async()=>{await Pr.configure({apiKey:up()}),await dp(pe.language)})().catch(e=>{throw kr=null,e})),kr):null,o7=async e=>{const t=Rc();if(t)try{if(await t,e){const{appUserID:n}=await Pr.getAppUserID();n!==e&&await Pr.logIn({appUserID:e})}else{const{isAnonymous:n}=await Pr.isAnonymous();n||await Pr.logOut()}}catch(n){Ce(n,{area:"plus",action:"revenuecat_identity_sync",level:"warning",extra:{hasUser:!!e}})}},a7=async()=>{const e=Rc();if(!e)return tr.NOT_PRESENTED;try{await e;const{result:t}=await Z1.presentPaywall({displayCloseButton:!0});return t}catch(t){return Ce(t,{area:"plus",action:"present_paywall"}),tr.ERROR}},wP=async()=>{const e=Rc();if(!e)return!1;try{return await e,await Z1.presentCustomerCenter(),!0}catch(t){return Ce(t,{area:"plus",action:"present_customer_center"}),!1}},i7={ok:1500,info:3e3,error:4500};let ca=null,Rr=null,l7=0;const _l=new Set,fp=()=>_l.forEach(e=>e()),hp=()=>{Rr&&clearTimeout(Rr),Rr=null,ca&&(ca=null,fp())},vi=(e,t,n)=>{Rr&&clearTimeout(Rr),ca={id:++l7,tone:e,title:t,description:n},fp(),Rr=setTimeout(hp,i7[e])},Tr={ok:e=>vi("ok",e),info:(e,t)=>vi("info",e,t),error:(e,t)=>vi("error",e,t)},c7=e=>(_l.add(e),()=>{_l.delete(e)}),Kd=()=>ca,u7=()=>m.useSyncExternalStore(c7,Kd,Kd);function d7(e){e.CapacitorUtils.Synapse=new Proxy({},{get(t,n){return new Proxy({},{get(r,s){return(o,a,i)=>{const l=e.Capacitor.Plugins[n];if(l===void 0){i(new Error(`Capacitor plugin ${n} not found`));return}if(typeof l[s]!="function"){i(new Error(`Method ${s} not found in Capacitor plugin ${n}`));return}(async()=>{try{const c=await l[s](o);a(c)}catch(c){i(c)}})()}}})}})}function f7(e){e.CapacitorUtils.Synapse=new Proxy({},{get(t,n){return e.cordova.plugins[n]}})}function h7(e=!1){typeof window>"u"||(window.CapacitorUtils=window.CapacitorUtils||{},window.Capacitor!==void 0&&!e?d7(window):window.cordova!==void 0&&f7(window))}const El=we("FileTransfer",{web:()=>B(()=>import("./web-PpQmeXfA_BSFXDTqk.js"),__vite__mapDeps([8,1,2,3,4])).then(e=>new e.FileTransferWeb)});h7();const ms={visible:2,thumbnail:1,prefetch:0};class p7{constructor(t=6,n=4,r=2){Le(this,"jobs",new Map);Le(this,"scheduled",!1);this.concurrency=t,this.backgroundConcurrency=n,this.prefetchConcurrency=r}has(t){return this.jobs.has(t)}keys(){return this.jobs.keys()}request(t,n,r={}){var a;if((a=r.signal)!=null&&a.aborted)return Promise.resolve(!1);let s=this.jobs.get(t);s||(s={run:n,active:!1,consumers:new Set},this.jobs.set(t,s));const o=s;return new Promise(i=>{var d;const l={priority:r.priority??"visible",finish:f=>{var h;(h=r.signal)==null||h.removeEventListener("abort",c),o.consumers.delete(l),i(f)}},c=()=>{l.finish(!1),!o.active&&o.consumers.size===0&&this.jobs.delete(t),this.schedule()};o.consumers.add(l),(d=r.signal)==null||d.addEventListener("abort",c,{once:!0}),this.schedule()})}priority(t){return Math.max(0,...Array.from(t.consumers,n=>ms[n.priority]))}schedule(){this.scheduled||(this.scheduled=!0,queueMicrotask(()=>{this.scheduled=!1,this.drain()}))}drain(){const t=[...this.jobs.values()].filter(a=>a.active);let n=this.concurrency-t.length,r=t.filter(a=>this.priority(a)<ms.visible).length,s=t.filter(a=>this.priority(a)===ms.prefetch).length;const o=[...this.jobs].filter(([,a])=>!a.active).sort((a,i)=>this.priority(i[1])-this.priority(a[1]));for(const[a,i]of o){if(n<=0)break;const l=this.priority(i)<ms.visible,c=this.priority(i)===ms.prefetch;l&&r>=this.backgroundConcurrency||c&&s>=this.prefetchConcurrency||(n--,l&&r++,c&&s++,i.active=!0,Promise.resolve().then(i.run).catch(()=>!1).then(d=>{this.jobs.delete(a);for(const f of[...i.consumers])f.finish(d);this.schedule()}))}}}const ua=we("Network",{web:()=>B(()=>import("./web_D6f5pbhk.js"),__vite__mapDeps([9,1,2,3,4])).then(e=>new e.NetworkWeb)}),m7={connected:typeof navigator<"u"?navigator.onLine!==!1:!0,connectionType:"unknown"};let Ls=m7,Qd=!1;const Sl=new Set,g7=e=>{Ls.connected===e.connected&&Ls.connectionType===e.connectionType||(Ls=e,Sl.forEach(t=>t()))},gs=e=>{g7({connected:e.connected,connectionType:e.connectionType??"unknown"})},y7=()=>
2{if(Qd||typeof window>"u")return;Qd=!0,(async()=>{try{const t=await ua.getStatus();gs(t)}catch{gs({connected:navigator.onLine!==!1,connectionType:"unknown"})}try{const t=await ua.addListener("networkStatusChange",gs);window.addEventListener("beforeunload",()=>{t.remove().catch(()=>{})})}catch{const t=()=>gs({connected:!0,connectionType:"unknown"}),n=()=>gs({connected:!1,connectionType:"none"});window.addEventListener("online",t),window.addEventListener("offline",n),window.addEventListener("beforeunload",()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)})}})()},v7=e=>(Sl.add(e),y7(),()=>{Sl.delete(e)}),Yd=()=>Ls,Xd=()=>Ls;function Ha(){return m.useSyncExternalStore(v7,Yd,Yd)}const b7="w5MfMLcE-v66znvWhi7dNQ",Zt={thumb80:80,thumb:320,card:720,md:960,phone:1080,lg:1280,public:1366,xl:1920},w7=["thumb80","thumb","card","md","phone","lg","xl"],pp=["card","md","phone","lg","xl"],mp=2,Ao={deliveryMode:"public",enableSignedUploads:!1},x7=(e,t)=>`https://imagedelivery.net/${b7}/${e}/${t}`,xP=(e,t=w7)=>t.map(n=>{const r=e[n];return r?`${r} ${Zt[n]}w`:null}).filter(Boolean).join(", "),Tc=(e,t)=>{const n=new Set,r=[];for(const s of e&&e.length>0?e:t)n.has(s)||(n.add(s),r.push(s));return r},C7=(e=mp)=>{if(typeof window>"u")return 1;const t=window.devicePixelRatio||1;return Math.max(1,Math.min(t,e))},_7=(e,t)=>{const n=e.trim(),r=/^([\d.]+)px$/.exec(n);if(r)return parseFloat(r[1]);const s=/^([\d.]+)vw$/.exec(n);return s?parseFloat(s[1])/100*t:null},E7=e=>{if(typeof window>"u")return 0;const t=window.innerWidth||0;if(!e)return t;for(const n of e.split(",")){const r=n.trim();if(!r)continue;const s=r.lastIndexOf(")"),o=s>=0?r.slice(0,s+1).trim():"",a=s>=0?r.slice(s+1):r;if(o)try{if(!window.matchMedia(o).matches)continue}catch{continue}const i=_7(a,t);if(i!==null)return i}return t},S7=(e,t=pp)=>{const n=[...t].sort((r,s)=>Zt[r]-Zt[s]);return n.find(r=>Zt[r]>=e)??n[n.length-1]},CP=(e,t=pp,n=mp)=>{const r=E7(e);return S7(r*C7(n),t)},On="cf-image-cache",gp=`${On}/index.json`,yp=2,Al=500*1024*1024,vp=12*1024*1024,A7=1e4,N7=3e4,P7=2,k7=1e4,I7=1500,R7="image/webp,image/*,*/*;q=0.8",T7="image/avif,image/webp,image/*,*/*;q=0.8",O7="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A=";let me=null,Rn=0,jn=null,bp=R7;const Oc=new p7,bi=new Set,Nl=[];let wi=0,No=null;const Vo=new Map,qs=(e,t)=>`${e}::${t}`,da=e=>e.replace(/[^a-zA-Z0-9_-]/g,"_"),jc=e=>`${On}/${da(e)}`,wp=e=>`${jn}/${da(e)}`,_P=()=>!!(me&&jn),Wa=async()=>{if(me)try{await Ne.writeFile({path:gp,directory:Pe.Cache,data:JSON.stringify({version:yp,entries:[...me]}),encoding:Tn.UTF8,recursive:!0})}catch(e){console.debug("[imageByteCache] failed to persist index",e)}},xp=(e=k7)=>{No&&clearTimeout(No),No=setTimeout(()=>{No=null,Wa()},e)},Cp=e=>{const t=Vo.get(e);if(t)for(const n of t)try{n()}catch{}},EP=(e,t)=>{let n=Vo.get(e);return n||(n=new Set,Vo.set(e,n)),n.add(t),()=>{n.delete(t),n.size===0&&Vo.delete(e)}},Pl=async e=>{try{await Ne.deleteFile({path:jc(e),directory:Pe.Cache})}catch{}},_p=async e=>{if(!me)return;const t=me.get(e);t&&(me.delete(e),Rn-=t.size),await Pl(e)},Ep=(e,t)=>{if(!me)return;const n=me.get(e);n&&(Rn-=n.size),me.set(e,{size:t,lastAccess:Date.now()}),Rn+=t,xp(I7),Rn>Al&&j7()},j7=async()=>{if(!me||Rn<=Al)return;const e=[...me.entries()].sort((t,n)=>t[1].lastAccess-n[1].lastAccess);for(const[t]of e){if(Rn<=Al)break;await _p(t)}Wa()},L7=async()=>{if(me)try{const{files:e}=await Ne.readdir({path:On,directory:Pe.Cache}),t=new Set([...me.keys()].map(da).concat(["index.json"]));for(const n of e)if(!t.has(n.name)&&![...Oc.keys()].some(r=>da(r)===n.name))try{await Ne.deleteFile({path:`${On}/${n.name}`,directory:Pe.Cache})}catch{}}catch{}},M7=()=>new Promise(e=>{if(typeof Image>"u"){e(!1);return}const t=new Image;t.onload=()=>e(t.width>0&&t.height>0),t.onerror=()=>e(!1),t.src=O7}),D7=async()=>
2{if(!j.isNativePlatform()||me)return;const e=new Map;let t=!1;try{await Ne.mkdir({path:On,directory:Pe.Cache,recursive:!0}).catch(()=>{});const[n,r]=await Promise.all([Ne.getUri({path:On,directory:Pe.Cache}),Ne.readFile({path:gp,directory:Pe.Cache,encoding:Tn.UTF8}).catch(()=>null)]);if(jn=n.uri,r&&typeof r.data=="string"){const s=JSON.parse(r.data);if(s.version===yp&&Array.isArray(s.entries))for(const[o,a]of s.entries)typeof(a==null?void 0:a.size)=="number"&&typeof(a==null?void 0:a.lastAccess)=="number"&&e.set(o,a);else t=!0}}catch(n){console.debug("[imageByteCache] init failed; starting with empty cache",n)}jn&&(me=e,Rn=[...e.values()].reduce((n,r)=>n+r.size,0),t&&Wa(),M7().then(n=>{n&&(bp=T7)}),setTimeout(()=>void L7(),5e3))},SP=(e,t,n)=>{if(!me||!jn||!e)return null;const r=t.filter(i=>me.has(qs(e,i)));if(r.length===0)return null;const s=[...r].sort((i,l)=>Zt[i]-Zt[l]);let o;if(n){const i=Zt[n];o=s.find(l=>Zt[l]>=i)??[...s].reverse().find(l=>Zt[l]*2>=i)}else o=s[s.length-1];if(!o)return null;const a=qs(e,o);return me.get(a).lastAccess=Date.now(),xp(),{src:j.convertFileSrc(wp(a)),variant:o}},F7=(e,t,n,r={})=>{if(!me||!jn||!e||!n.startsWith("http"))return Promise.resolve(!1);const s=qs(e,t);return me.has(s)?Promise.resolve(!0):Xd().connected?Oc.request(s,async()=>{try{if(!me||!jn||!Xd().connected)return!1;await El.downloadFile({url:n,path:wp(s),headers:{Accept:bp},connectTimeout:A7,readTimeout:N7});const o=await Ne.stat({path:jc(s),directory:Pe.Cache}),a=Number(o.size)||0;return a<=0||a>vp?(await Pl(s),!1):(Ep(s,a),!0)}catch(o){return console.debug("[imageByteCache] native download failed",e,t,o),await Pl(s),!1}finally{Cp(e)}},r):Promise.resolve(!1)},AP=(e,t,n)=>{F7(e,t,n,{priority:"prefetch"})},U7=e=>new Promise((t,n)=>{const r=new FileReader;r.onerror=()=>n(r.error),r.onload=()=>{const s=r.result;t(s.slice(s.indexOf(",")+1))},r.readAsDataURL(e)}),Sp=()=>{for(;wi<P7&&Nl.length>0;){const e=Nl.shift();wi+=1,e().finally(()=>{wi-=1,Sp()})}},B7=(e,t,n)=>{if(!me||!jn||!e||n.size===0||n.size>vp)return;const r=qs(e,t);me.get(r)||bi.has(r)||Oc.has(r)||(bi.add(r),Nl.push(async()=>{try{await Ne.writeFile({path:jc(r),directory:Pe.Cache,data:await U7(n),recursive:!0}),Ep(r,n.size),Cp(e)}catch(s){console.debug("[imageByteCache] failed to seed image",e,t,s)}finally{bi.delete(r)}}),Sp())},NP=(e,t)=>_p(qs(e,t)).then(()=>Wa()),$7=async()=>{if(j.isNativePlatform()){me=me&&new Map,Rn=0;try{await Ne.rmdir({path:On,directory:Pe.Cache,recursive:!0})}catch{}try{await Ne.mkdir({path:On,directory:Pe.Cache,recursive:!0})}catch{}}},Ap=m.createContext(void 0);function ge(){const e=m.useContext(Ap);if(!e)throw new Error("useAuth must be used within AuthProvider");return e}const z7=["invalid refresh token","refresh token not found","refresh token has been revoked","session not found","session from session_id claim in jwt does not exist"],kl="lc:native-had-auth-session",V7=e=>{const n=(e instanceof Error?e.message:String(e??"")).toLowerCase();return z7.some(r=>n.includes(r))},Zd=()=>{try{return Object.keys(localStorage).some(e=>e.startsWith("sb-")&&e.endsWith("-auth-token"))}catch{return!1}},Jd=e=>{if(j.isNativePlatform())try{e?localStorage.setItem(kl,"true"):localStorage.removeItem(kl)}catch{}},xi=()=>{if(!j.isNativePlatform())return!1;try{return localStorage.getItem(kl)==="true"}catch{return!1}},H7=({children:e})=>{const t=tt(),[n,r]=m.useState(null),[s,o]=m.useState(null),[a,i]=m.useState(!0),l=m.useRef(null),c=m.useRef(null),d=m.useRef(!1),f=m.useRef(!1),h=m.useRef(null),p=m.useRef({userId:null,value:null,resolved:!1}),g=m.useCallback(w=>{l.current=w,o(w),r((w==null?void 0:w.user)??null),w&&(Jd(!0),d.current=!1)},[]),y=m.useCallback((w=!1)=>{g(null),Jd(!1),h.current=null,p.current={userId:null,value:null,resolved:!1},w&&!d.current&&(d.current=!0,t("/auth",{replace:!0}),window.setTimeout(()=>{Tr.error(pe.t("auth.sessionEndedTitle","You've been signed out"),pe.t("auth.sessionEndedDescription","Please log in again."))},300))},[g,t]),v=m.useCallback(async()=>{try{await z.auth.signOut({scope:"local"})}catch(w){console.debug("[Auth] Local sign out after stale session skipped:",w)}},[]),x=m.useCallback(async()=>{f.current=!0;try{const{error:w}=await z.auth.signOut({scope:"local"});w&&(console.error("Sign out error:",w),Ce(w,{area:"auth",action:"sign_out",tags:{flow:"manual_sign_out"}}))}catch(w){console.error("Sign out error:",w),Ce(w,{area:"auth",action:"sign_out",tags:{flow:"manual_sign_out"}})}finally{y(),e4(),$7(),window.setTimeout(()=>{f.current=!1},5e3)}},[y]),C=m.useCallback(async()=>{var N;const w=(N=n==null?void 0:n.user_metadata)==null?void 0:N.username;if(!n)return null;const P=p.current;return P.userId===n.id&&P.resolved?P.value:(h.current||(h.current=(async()=>{const{data:E,error:A}=await z.from("user_settings").select("username").eq("user_id",n.id).maybeSingle();if(A&&A.code!=="PGRST116")return console.warn("Failed to resolve username",A),p.current={userId:n.id,value:w??null,resolved:!!w},w??null;
2const k=(E==null?void 0:E.username)??null;return p.current={userId:n.id,value:k,resolved:k!==null},k})().finally(()=>{h.current=null})),h.current)},[n]);m.useEffect(()=>{const w=(n==null?void 0:n.id)??null;p.current.userId!==w&&(h.current=null,p.current={userId:w,value:null,resolved:!1})},[n==null?void 0:n.id]);const _=m.useCallback(async w=>{var N,E;if(!((N=w.user_metadata)==null?void 0:N.language)){const A=pe.language||((E=navigator.language)==null?void 0:E.split("-")[0])||"en";try{await z.auth.updateUser({data:{language:A}}),console.log("Synced language preference:",A)}catch(k){console.error("Failed to sync language preference:",k),Ce(k,{area:"auth",action:"sync_language_preference",level:"warning",tags:{user_id:w.id},extra:{language:A}})}}},[]);m.useEffect(()=>{const w=async()=>{const{data:{session:k}}=await z.auth.getSession();return k?(g(k),!0):!1},P=async k=>{if(c.current)return c.current;const T=l.current;if(!T){if(await w())return;(k==="resume"||k==="focus")&&(Zd()||xi())&&(y(!0),await v());return}return c.current=(async()=>{var O;const{data:I,error:R}=await z.auth.getUser();if(R||!I.user){const M=l.current;if(M&&M.access_token!==T.access_token||await w()&&((O=l.current)==null?void 0:O.access_token)!==T.access_token)return;if(R&&!V7(R)){Ce(R,{area:"auth",action:"validate_stored_session",level:"warning",tags:{source:k}});return}lr("Cleared stale Supabase session",{source:k},"auth"),y(!0),await v();return}await w()})().finally(()=>{c.current=null}),c.current},{data:{subscription:N}}=z.auth.onAuthStateChange((k,T)=>{const I=!!l.current||xi();k==="SIGNED_OUT"?f.current?(f.current=!1,y()):I?y(!0):g(null):g(T),lr("Supabase auth state changed",{event:k,hasSession:!!T},"auth"),k==="SIGNED_IN"&&(T!=null&&T.user)&&window.setTimeout(()=>{_(T.user)},0)});(async()=>{const k=Zd()||xi(),{data:{session:T}}=await z.auth.getSession();g(T),i(!1),T!=null&&T.user?(_(T.user),await P("startup")):k&&y(!0)})();let A;if(j.isNativePlatform())Ge.addListener("appStateChange",({isActive:k})=>{k&&P("resume")}).then(k=>{A=()=>{k.remove()}}).catch(k=>{Ce(k,{area:"auth",action:"register_app_state_listener",level:"warning"})});
2else{const k=()=>{P("focus")},T=()=>{document.visibilityState==="visible"&&P("focus")};window.addEventListener("focus",k),document.addEventListener("visibilitychange",T),A=()=>{window.removeEventListener("focus",k),document.removeEventListener("visibilitychange",T)}}return()=>{N.unsubscribe(),A==null||A()}},[g,v,y,_]),m.useEffect(()=>{var E;let w=!1;if(!n){ed(null);return}const P=A=>{var k,T,I;w||ed({id:n.id,email:n.email??null,username:A??((k=n.user_metadata)==null?void 0:k.username)??null,provider:typeof((T=n.app_metadata)==null?void 0:T.provider)=="string"?n.app_metadata.provider:null,language:typeof((I=n.user_metadata)==null?void 0:I.language)=="string"?n.user_metadata.language:null})},N=typeof((E=n.user_metadata)==null?void 0:E.username)=="string"?n.user_metadata.username:null;return N?(P(N),()=>{w=!0}):(C().then(A=>{P(A)}).catch(A=>{Ce(A,{area:"auth",action:"resolve_username_for_sentry",level:"warning",tags:{user_id:n.id}}),P(null)}),()=>{w=!0})},[C,n]);const b=m.useMemo(()=>({user:n,session:s,loading:a,signOut:x,resolveUsername:C}),[n,s,a,x,C]);return u.jsx(Ap.Provider,{value:b,children:e})};let Or=null,xr=null,Ci=null;const Lc=async()=>{var n;const{data:{session:e}}=await z.auth.getSession(),t=(n=e==null?void 0:e.user)==null?void 0:n.id;return t?Or&&Ci===t?Or:(xr&&Ci===t||(Ci=t,xr=(async()=>{const{data:r,error:s}=await z.rpc("ensure_account_bootstrap");if(s)return console.error("Account bootstrap failed:",s),xr=null,null;const o=r;return Or=o,xr=null,o})()),xr):null},Gs="lc:account-setup-complete",PP=()=>{Or&&(Or={...Or,completed:!0}),window.dispatchEvent(new Event(Gs))};/**
3 * @license lucide-react v0.462.0 - ISC
4 *
5 * This source code is licensed under the ISC license.
6 * See the LICENSE file in the root directory of this source tree.
7 */const W7=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Np=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
8 * @license lucide-react v0.462.0 - ISC
9 *
10 * This source code is licensed under the ISC license.
11 * See the LICENSE file in the root directory of this source tree.
12 */var q7={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
13 * @license lucide-react v0.462.0 - ISC
14 *
15 * This source code is licensed under the ISC license.
16 * See the LICENSE file in the root directory of this source tree.
17 */const G7=m.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:o,iconNode:a,...i},l)=>m.createElement("svg",{ref:l,...q7,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Np("lucide",s),...i},[...a.map(([c,d])=>m.createElement(c,d)),...Array.isArray(o)?o:[o]]));/**
18 * @license lucide-react v0.462.0 - ISC
19 *
20 * This source code is licensed under the ISC license.
21 * See the LICENSE file in the root directory of this source tree.
22 */const de=(e,t)=>{const n=m.forwardRef(({className:r,...s},o)=>m.createElement(G7,{ref:o,iconNode:t,className:Np(`lucide-${W7(e)}`,r),...s}));return n.displayName=`${e}`,n};/**
23 * @license lucide-react v0.462.0 - ISC
24 *
25 * This source code is licensed under the ISC license.
26 * See the LICENSE file in the root directory of this source tree.
27 */const K7=de("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
28 * @license lucide-react v0.462.0 - ISC
29 *
30 * This source code is licensed under the ISC license.
31 * See the LICENSE file in the root directory of this source tree.
32 */const Pp=de("BadgeCheck",[["path",{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",key:"3c2336"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
33 * @license lucide-react v0.462.0 - ISC
34 *
35 * This source code is licensed under the ISC license.
36 * See the LICENSE file in the root directory of this source tree.
37 */const kp=de("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
38 * @license lucide-react v0.462.0 - ISC
39 *
40 * This source code is licensed under the ISC license.
41 * See the LICENSE file in the root directory of this source tree.
42 */const Q7=de("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
43 * @license lucide-react v0.462.0 - ISC
44 *
45 * This source code is licensed under the ISC license.
46 * See the LICENSE file in the root directory of this source tree.
47 */const Y7=de("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
48 * @license lucide-react v0.462.0 - ISC
49 *
50 * This source code is licensed under the ISC license.
51 * See the LICENSE file in the root directory of this source tree.
52 */const Il=de("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
53 * @license lucide-react v0.462.0 - ISC
54 *
55 * This source code is licensed under the ISC license.
56 * See the LICENSE file in the root directory of this source tree.
57 */const ef=de("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
58 * @license lucide-react v0.462.0 - ISC
59 *
60 * This source code is licensed under the ISC license.
61 * See the LICENSE file in the root directory of this source tree.
62 */const X7=de("CloudUpload",[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]]);/**
63 * @license lucide-react v0.462.0 - ISC
64 *
65 * This source code is licensed under the ISC license.
66 * See the LICENSE file in the root directory of this source tree.
67 */const Z7=de("Dot",[["circle",{cx:"12.1",cy:"12.1",r:"1",key:"18d7e5"}]]);/**
68 * @license lucide-react v0.462.0 - ISC
69 *
70 * This source code is licensed under the ISC license.
71 * See the LICENSE file in the root directory of this source tree.
72 */const tf=de("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/**
73 * @license lucide-react v0.462.0 - ISC
74 *
75 * This source code is licensed under the ISC license.
76 * See the LICENSE file in the root directory of this source tree.
77 */const Mc=de("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
78 * @license lucide-react v0.462.0 - ISC
79 *
80 * This source code is licensed under the ISC license.
81 * See the LICENSE file in the root directory of this source tree.
82 */const J7=de("LockKeyhole",[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{x:"3",y:"10",width:"18",height:"12",rx:"2",key:"6s8ecr"}],["path",{d:"M7 10V7a5 5 0 0 1 10 0v3",key:"1pqi11"}]]);/**
83 * @license lucide-react v0.462.0 - ISC
84 *
85 * This source code is licensed under the ISC license.
86 * See the LICENSE file in the root directory of this source tree.
87 */const ey=de("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
88 * @license lucide-react v0.462.0 - ISC
89 *
90 * This source code is licensed under the ISC license.
91 * See the LICENSE file in the root directory of this source tree.
92 */const ty=de("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
93 * @license lucide-react v0.462.0 - ISC
94 *
95 * This source code is licensed under the ISC license.
96 * See the LICENSE file in the root directory of this source tree.
97 */const ny=de("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/**
98 * @license lucide-react v0.462.0 - ISC
99 *
100 * This source code is licensed under the ISC license.
101 * See the LICENSE file in the root directory of this source tree.
102 */const ry=de("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
103 * @license lucide-react v0.462.0 - ISC
104 *
105 * This source code is licensed under the ISC license.
106 * See the LICENSE file in the root directory of this source tree.
107 */const nf=de("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
108 * @license lucide-react v0.462.0 - ISC
109 *
110 * This source code is licensed under the ISC license.
111 * See the LICENSE file in the root directory of this source tree.
112 */const sy=de("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
113 * @license lucide-react v0.462.0 - ISC
114 *
115 * This source code is licensed under the ISC license.
116 * See the LICENSE file in the root directory of this source tree.
117 */const oy=de("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
118 * @license lucide-react v0.462.0 - ISC
119 *
120 * This source code is licensed under the ISC license.
121 * See the LICENSE file in the root directory of this source tree.
122 */const rf=de("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",ke
vendor: 9,669 bytes, lines 122-162
122y:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
123 * @license lucide-react v0.462.0 - ISC
124 *
125 * This source code is licensed under the ISC license.
126 * See the LICENSE file in the root directory of this source tree.
127 */const Ip=de("Smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);/**
128 * @license lucide-react v0.462.0 - ISC
129 *
130 * This source code is licensed under the ISC license.
131 * See the LICENSE file in the root directory of this source tree.
132 */const ay=de("Ticket",[["path",{d:"M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z",key:"qn84l0"}],["path",{d:"M13 5v2",key:"dyzc3o"}],["path",{d:"M13 17v2",key:"1ont0d"}],["path",{d:"M13 11v2",key:"1wjjxi"}]]);/**
133 * @license lucide-react v0.462.0 - ISC
134 *
135 * This source code is licensed under the ISC license.
136 * See the LICENSE file in the root directory of this source tree.
137 */const iy=de("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
138 * @license lucide-react v0.462.0 - ISC
139 *
140 * This source code is licensed under the ISC license.
141 * See the LICENSE file in the root directory of this source tree.
142 */const ly=de("Volume2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]);/**
143 * @license lucide-react v0.462.0 - ISC
144 *
145 * This source code is licensed under the ISC license.
146 * See the LICENSE file in the root directory of this source tree.
147 */const sf=de("VolumeX",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]]);/**
148 * @license lucide-react v0.462.0 - ISC
149 *
150 * This source code is licensed under the ISC license.
151 * See the LICENSE file in the root directory of this source tree.
152 */const Rp=de("WifiOff",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
153 * @license lucide-react v0.462.0 - ISC
154 *
155 * This source code is licensed under the ISC license.
156 * See the LICENSE file in the root directory of this source tree.
157 */const cy=de("Wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]);/**
158 * @license lucide-react v0.462.0 - ISC
159 *
160 * This source code is licensed under the ISC license.
161 * See the LICENSE file in the root directory of this source tree.
162 */const cr=de("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function Tp(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=Tp(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Op(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=Tp(e))&&(r&&(r+=" "),r+=t);return r}const Dc="-",uy=e=>{const t=fy(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{const i=a.split(Dc);return i[0]===""&&i.length!==1&&i.shift(),jp(i,t)||dy(a)},getConflictingClassGroupIds:(a,i)=>{const l=n[a]||[];return i&&r[a]?[...l,...r[a]]:l}}},jp=(e,t)=>{var a;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?jp(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const o=e.join(Dc);return(a=t.validators.find(({validator:i})=>i(o)))==null?void 0:a.classGroupId},of=/^\[(.+)\]$/,dy=e=>{if(of.test(e)){const t=of.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},fy=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return py(Object.entries(e.classGroups),n).forEach(([o,a])=>{Rl(a,r,o,t)}),r},Rl=(e,t,n,r)=>{e.forEach(s=>{if(typeof s=="string"){const o=s===""?t:af(t,s);o.classGroupId=n;return}if(typeof s=="function"){if(hy(s)){Rl(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([o,a])=>{Rl(a,af(t,o),n,r)})})},af=(e,t)=>{let n=e;return t.split(Dc).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},hy=e=>e.isThemeGetter,py=(e,t)=>t?e.map(([n,r])=>{const s=r.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([a,i])=>[t+a,i])):o);return[n,s]}):e,my=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const s=(o,a)=>{n.set(o,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(o){let a=n.get(o);if(a!==void 0)return a;if((a=r.get(o))!==void 0)return s(o,a),a},set(o,a){n.has(o)?n.set(o,a):s(o,a)}}},Lp="!",gy=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,s=t[0],o=t.length,a=i=>{const l=[];let c=0,d=0,f;for(let v=0;v<i.length;v++){let x=i[v];if(c===0){if(x===s&&(r||i.slice(v,v+o)===t)){l.push(i.slice(d,v)),d=v+o;continue}if(x==="/"){f=v;continue}}x==="["?c++:x==="]"&&c--}const h=l.length===0?i:i.substring(d),p=h.startsWith(Lp),g=p?h.substring(1):h,y=f&&f>d?f-d:void 0;return{modifiers:l,hasImportantModifier:p,baseClassName:g,maybePostfixModifierPosition:y}};return n?i=>n({className:i,parseClassName:a}):a},yy=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},vy=e=>({cache:my(e.cacheSize),parseClassName:gy(e),...uy(e)}),by=/\s+/,wy=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,o=[],a=e.trim().split(by);let i="";for(let l=a.length-1;l>=0;l-=1){const c=a[l],{modifiers:d,hasImportantModifier:f,baseClassName:h,maybePostfixModifierPosition:p}=n(c);let g=!!p,y=r(g?h.substring(0,p):h);if(!y){if(!g){i=c+(i.length>0?" "+i:i);continue}if(y=r(h),!y){i=c+(i.length>0?" "+i:i);continue}g=!1}const v=yy(d).join(":"),x=f?v+Lp:v,C=x+y;if(o.includes(C))continue;o.push(C);const _=s(y,g);for(let b=0;b<_.length;++b){const w=_[b];o.push(x+w)}i=c+(i.length>0?" "+i:i)}return i};function xy(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Mp(t))&&(r&&(r+=" "),r+=n);return r}const Mp=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Mp(e[r]))&&(n&&(n+=" "),n+=t);return n};function Cy(e,...t){let n,r,s,o=a;function a(l){const c=t.reduce((d,f)=>f(d),e());return n=vy(c),r=n.cache.get,s=n.cache.set,o=i,i(l)}function i(l){const c=r(l);if(c)return c;const d=wy(l,n);return s(l,d),d}return function(){return o(xy.apply(null,arguments))}}const ye=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Dp=/^\[(?:([a-z-]+):)?(.+)\]$/i,_y=/^\d+\/\d+$/,Ey=new Set(["px","full","screen"]),Sy=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ay=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Ny=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Py=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ky=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Vt=e=>jr(e)||Ey.has(e)||_y.test(e),dn=e=>ls(e,"length",Dy),jr=e=>!!e&&!Number.isNaN(Number(e)),_i=e=>ls(e,"number",jr),ys=e=>!!e&&Number.isInteger(Number(e)),Iy=e=>e.endsWith("%")&&jr(e.slice(0,-1)),ne=e=>Dp.test(e),fn=e=>Sy.test(e),Ry=new Set(["length","size","percentage"]),Ty=e=>ls(e,Ry,Fp),Oy=e=>ls(e,"position",Fp),jy=new Set(["image","url"]),Ly=e=>ls(e,jy,Uy),My=e=>ls(e,"",Fy),vs=()=>!0,ls=(e,t,n)=>{const r=Dp.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},Dy=e=>Ay.test(e)&&!Ny.test(e),Fp=()=>!1,Fy=e=>Py.test(e),Uy=e=>ky.test(e),By=()=>{const e=ye("colors"),t=ye("spacing"),n=ye("blur"),r=ye("brightness"),s=ye("borderColor"),o=ye("borderRadius"),a=ye("borderSpacing"),i=ye("borderWidth"),l=ye("contrast"),c=ye("grayscale"),d=ye("hueRotate"),f=ye("invert"),h=ye("gap"),p=ye("gradientColorStops"),g=ye("gradientColorStopPositions"),y=ye("inset"),v=ye("margin"),x=ye("opacity"),C=ye("padding"),_=ye("saturate"),b=ye("scale"),w=ye("sepia"),P=ye("skew"),N=ye("space"),E=ye("translate"),A=()=>["auto","contain","none"],k=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto",ne,t],I=()=>[ne,t],R=()=>["",Vt,dn],O=()=>["auto",jr,ne],M=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],D=()=>["solid","dashed","dotted","double","none"],$=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],H=()=>["start","end","center","between","around","evenly","stretch"],U=()=>["","0",ne],re=()=>["auto","avoid","all","avoid-page","page","left","right","column"],J=()=>[jr,ne];return{cacheSize:500,separator:":",theme:{colors:[vs],spacing:[Vt,dn],blur:["none","",fn,ne],brightness:J(),borderColor:[e],borderRadius:["n
162one","","full",fn,ne],borderSpacing:I(),borderWidth:R(),contrast:J(),grayscale:U(),hueRotate:J(),invert:U(),gap:I(),gradientColorStops:[e],gradientColorStopPositions:[Iy,dn],inset:T(),margin:T(),opacity:J(),padding:I(),saturate:J(),scale:J(),sepia:U(),skew:J(),space:I(),translate:I()},classGroups:{aspect:[{aspect:["auto","square","video",ne]}],container:["container"],columns:[{columns:[fn]}],"break-after":[{"break-after":re()}],"break-before":[{"break-before":re()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...M(),ne]}],overflow:[{overflow:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-x":[{"inset-x":[y]}],"inset-y":[{"inset-y":[y]}],start:[{start:[y]}],end:[{end:[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ys,ne]}],basis:[{basis:T()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ne]}],grow:[{grow:U()}],shrink:[{shrink:U()}],order:[{order:["first","last","none",ys,ne]}],"grid-cols":[{"grid-cols":[vs]}],"col-start-end":[{col:["auto",{span:["full",ys,ne]},ne]}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":[vs]}],"row-start-end":[{row:["auto",{span:[ys,ne]},ne]}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ne]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ne]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...H()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...H(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...H(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[C]}],px:[{px:[C]}],py:[{py:[C]}],ps:[{ps:[C]}],pe:[{pe:[C]}],pt:[{pt:[C]}],pr:[{pr:[C]}],pb:[{pb:[C]}],pl:[{pl:[C]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[N]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[N]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ne,t]}],"min-w":[{"min-w":[ne,t,"min","max","fit"]}],"max-w":[{"max-w":[ne,t,"none","full","min","max","fit","prose",{screen:[fn]},fn]}],h:[{h:[ne,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ne,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ne,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ne,t,"auto","min","max","fit"]}],"font-size":[{text:["base",fn,dn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",_i]}],"font-family":[{font:[vs]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",ne]}],"line-clamp":[{"line-clamp":["none",jr,_i]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Vt,ne]}],"list-image":[{"list-image":["none",ne]}],"list-style-type":[{list:["none","disc","decimal",ne]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[x]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[x]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...D(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Vt,dn]}],"underline-offset":[{"underline-offset":["auto",Vt,ne]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ne]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ne]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[x]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...M(),Oy]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Ty]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Ly]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[g]}
vendor: 5,180 bytes, line 162
162],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[i]}],"border-w-x":[{"border-x":[i]}],"border-w-y":[{"border-y":[i]}],"border-w-s":[{"border-s":[i]}],"border-w-e":[{"border-e":[i]}],"border-w-t":[{"border-t":[i]}],"border-w-r":[{"border-r":[i]}],"border-w-b":[{"border-b":[i]}],"border-w-l":[{"border-l":[i]}],"border-opacity":[{"border-opacity":[x]}],"border-style":[{border:[...D(),"hidden"]}],"divide-x":[{"divide-x":[i]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[i]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[x]}],"divide-style":[{divide:D()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...D()]}],"outline-offset":[{"outline-offset":[Vt,ne]}],"outline-w":[{outline:[Vt,dn]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:R()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[x]}],"ring-offset-w":[{"ring-offset":[Vt,dn]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",fn,My]}],"shadow-color":[{shadow:[vs]}],opacity:[{opacity:[x]}],"mix-blend":[{"mix-blend":[...$(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":$()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",fn,ne]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[f]}],saturate:[{saturate:[_]}],sepia:[{sepia:[w]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[x]}],"backdrop-saturate":[{"backdrop-saturate":[_]}],"backdrop-sepia":[{"backdrop-sepia":[w]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ne]}],duration:[{duration:J()}],ease:[{ease:["linear","in","out","in-out",ne]}],delay:[{delay:J()}],animate:[{animate:["none","spin","ping","pulse","bounce",ne]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[b]}],"scale-x":[{"scale-x":[b]}],"scale-y":[{"scale-y":[b]}],rotate:[{rotate:[ys,ne]}],"translate-x":[{"translate-x":[E]}],"translate-y":[{"translate-y":[E]}],"skew-x":[{"skew-x":[P]}],"skew-y":[{"skew-y":[P]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ne]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ne]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}
162],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ne]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Vt,dn,_i]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},$y=Cy(By);function G(...e){return $y(Op(e))}const zy=we("SplashScreen",{web:()=>B(()=>import("./web_uExlBUxt.js"),__vite__mapDeps([10,1,2,3,4])).then(e=>new e.SplashScreenWeb)});let Tl=!1;const Up=()=>{Tl||(Tl=!0,j.isNativePlatform()&&zy.hide({fadeOutDuration:150}).catch(()=>{}))},Vy=(e=!0)=>{m.useEffect(()=>{if(!e||Tl)return;let t=requestAnimationFrame(()=>{t=requestAnimationFrame(()=>Up())});return()=>cancelAnimationFrame(t)},[e])},Hy=e=>{j.isNativePlatform()&&setTimeout(Up,e)},fa=({title:e,subtitle:t,className:n})=>{Vy();const{t:r}=_e(),{connected:s}=Ha(),o=r("common.offline.title","Waiting for network"),a=r("common.offline.subtitle","We'll keep trying - make sure you're connected to Wi-Fi or mobile data.");return u.jsx("div",{className:G("min-h-screen bg-[#FDF8F3] flex items-center justify-center px-6",n),style:{paddingTop:"var(--safe-area-inset-top)"},children:u.jsxs("div",{className:"flex flex-col items-center gap-5",children:[u.jsxs("div",{className:"relative",children:[u.jsx("img",{src:"/logos/LC_beeldmerkt_cirkel_orange.svg",alt:"Little Chapters",className:"h-20 w-20 animate-[lc-loading-pulse_1.6s_ease-in-out_infinite]"}),!s&&u.jsx("span",{className:"absolute -bottom-1 -right-1 flex h-7 w-7 items-center justify-center rounded-full bg-[#111111] text-[#FDF8F3] ring-2 ring-[#FDF8F3]",children:u.jsx(Rp,{className:"h-3.5 w-3.5"})})]}),s?u.jsxs("div",{className:"text-center",children:[e?u.jsx("h3",{className:"text-[16px] font-semibold text-[#111111]",children:e}):u.jsxs("p",{className:"text-[14px] font-medium tracking-[0.04em] text-[#111111]/55",children:[r("common.loading","Loading"),u.jsx("span",{className:"animate-[lc-loading-dots_1.4s_steps(4,end)_infinite]",children:"..."})]}),t&&u.jsx("p",{className:"mt-1 text-[14px] text-[#111111]/55",children:t})]}):u.jsxs("div",{className:"max-w-[280px] text-center",children:[u.jsx("h3",{className:"text-[16px] font-semibold text-[#111111]",children:o}),u.jsx("p",{className:"mt-1 text-[14px] leading-[1.4] text-[#111111]/55",children:a})]})]})})},it=({children:e,loadingTitle:t,loadingSubtitle:n})=>{const{session:r,loading:s,user:o}=ge(),a=He(),[i,l]=m.useState(!0);return m.useEffect(()=>{let c=!0;return s||(async()=>
162{if(!o){c&&l(!1);return}await Lc(),c&&l(!1)})(),()=>{c=!1}},[o,s]),s||r&&i?u.jsx(fa,{title:t,subtitle:n}):r?e:u.jsx(lt,{to:"/auth",replace:!0,state:{from:a}})},Po=({children:e})=>e,Re=we("Preferences",{web:()=>B(()=>import("./web_DuzEcwTW.js"),__vite__mapDeps([11,1,2,3,4])).then(e=>new e.PreferencesWeb)}),lf=/cancell?ed|permission denied|not implemented|unimplemented|not available|unavailable/i,Wy=e=>{const t=e instanceof Error?e.message:String(e),n=(e==null?void 0:e.code)??"";return lf.test(t)||lf.test(n)},qy=(e,t)=>new Proxy(e,{get(n,r){const s=Reflect.get(n,r);return typeof s!="function"||typeof r!="string"?s:(...o)=>{const a=s.apply(n,o);return a instanceof Promise?a.catch(i=>{throw Wy(i)||Ce(i,{area:"native-plugin",action:`${t}.${r}`,tags:{plugin:t,plugin_method:r}}),i}):a}}}),cf=qy(we("MonthMediaPicker"),"MonthMediaPicker"),Gy="month-photo-added",ha=async e=>{if(typeof crypto>"u"||!crypto.subtle)return null;try{const t=await e.arrayBuffer(),n=await crypto.subtle.digest("SHA-256",t);return Array.from(new Uint8Array(n)).map(s=>s.toString(16).padStart(2,"0")).join("")}catch(t){return console.warn("[fileHash] Failed to compute hash",t),null}},pa="shared_files",Ho="/SharedImages/",Bp=`/cache/${pa}/`,$p="lc.shareTargetDir",Ky=7*24*60*60*1e3,Fc=e=>!!e&&(e.includes(Bp)||e.includes(Ho)),Qy=e=>{const t=e.slice(e.lastIndexOf("/")+1);try{return decodeURIComponent(t)}catch{return t}},Uc=()=>B(()=>Promise.resolve().then(()=>y5),void 0),zp=async e=>{if(!j.isNativePlatform())return null;try{if(j.getPlatform()==="android"){if(!e.startsWith("/")||!e.includes(Bp))return null;const{Filesystem:t,Directory:n}=await Uc(),r=e.slice(e.lastIndexOf("/")+1),s=r.lastIndexOf("."),o=s>0?r.slice(s).replace(/[^.a-z0-9]/gi,""):"",a=`${pa}/${crypto.randomUUID()}${o}`;await t.rename({from:`${pa}/${r}`,to:a,directory:n.Cache,toDirectory:n.Cache});const{uri:i}=await t.getUri({path:a,directory:n.Cache});return i}if(!e.startsWith("file://")||!e.includes(Ho))return null;try{const t=e.slice(0,e.indexOf(Ho)+Ho.length);localStorage.setItem($p,t)}catch{}return e}catch(t){return console.warn("[ShareTarget] Could not claim shared file",t),null}},Bc=async e=>{const t=Array.from(e).filter(Fc);if(t.length===0||!j.isNativePlatform())return;const{Filesystem:n}=await Uc();await Promise.all(t.map(r=>n.deleteFile({path:r}).catch(()=>{})))},Yy=async e=>{if(!j.isNativePlatform())return;const{Filesystem:t,Directory:n}=await Uc(),r=new Set(Array.from(e,Qy));let s;try{if(j.getPlatform()==="android")s=await t.readdir({path:pa,directory:n.Cache});else{const i=localStorage.getItem($p);if(!i)return;s=await t.readdir({path:i})}}catch{return}const o=Date.now()-Ky,a=s.files.filter(i=>i.type==="file"&&i.mtime<o&&!r.has(i.name));await Promise.all(a.map(i=>t.deleteFile({path:i.uri}).catch(()=>{})))},Xy=Object.freeze(Object.defineProperty({__proto__:null,claimSharedFileUri:zp,deleteShareTargetFiles:Bc,isShareTargetFileUri:Fc,sweepShareTargetFiles:Yy},Symbol.toStringTag,{value:"Module"}));async function Zy(e,t){const{maxWidth:n,maxHeight:r,fit:s="contain",quality:o=.85,mimeType:a="image/jpeg",avoidUpscale:i=!0}=t,l=await e6(e),c=await t6(l),d=c.naturalWidth||c.width,f=c.naturalHeight||c.height;if(i&&d<=n&&f<=r)return e;const h=document.createElement("canvas"),p=h.getContext("2d");if(!p)throw new Error("Canvas 2D context not available");if(s==="contain"){const x=Math.min(n/d,r/f,1),C=Math.floor(d*x),_=Math.floor(f*x);h.width=Math.max(1,C),h.height=Math.max(1,_),p.imageSmoothingQuality="high",p.drawImage(c,0,0,h.width,h.height)}else{const x=Math.min(d/n,f/r),C=Math.floor(n*x),_=Math.floor(r*x),b=Math.max(0,Math.floor((d-C)/2)),w=Math.max(0,Math.floor((f-_)/2));h.width=Math.max(1,Math.floor(Math.min(n,d))),h.height=Math.max(1,Math.floor(Math.min(r,f))),p.imageSmoothingQuality="high",p.drawImage(c,b,w,C,_,0,0,h.width,h.height)}const g=await new Promise((x,C)=>{h.toBlob(_=>_?x(_):C(new Error("Canvas toBlob failed")),a,o)}),y=a==="image/png"?"png":a==="image/webp"?"webp":"jpg",v=(e.name.replace(/\.[^.]+$/,"")||"image")+`.${y}`;return new File([g],v,{type:a,lastModified:Date.now()})}async function Jy(e,t,n=.7){if(typeof createImageBitmap!="function")return null;let r;try{r=await createImageBitmap(e,{imageOrientation:"from-image"})}catch{return null}try{const{width:s,height:o}=r,a=Math.min(s,o),i=Math.max(1,Math.min(t,a)),l=document.createElement("canvas");l.width=i,l.height=i;const c=l.getContext("2d",{alpha:!1});if(!c)return{width:s,height:o,thumbnail:null};c.imageSmoothingQuality="high",c.drawImage(r,Math.floor((s-a)/2),Math.floor((o-a)/2),a,a,0,0,i,i);const d=await new Promise(f=>{l.toBlob(f,"image/jpeg",n)});return{width:s,height:o,thumbnail:d}}finally{r.close()}}function e6(e){return new Promise((t,n)=>{const r=new FileReader;r.onload=()=>
162t(r.result),r.onerror=n,r.readAsDataURL(e)})}function t6(e){return new Promise((t,n)=>{const r=new Image;r.onload=()=>t(r),r.onerror=n,r.src=e})}const Vp=e=>e&&typeof e=="object"?e:{},Ol=(e,t)=>{const n=e[t];return n&&typeof n=="object"?n:{}},n6=(e,t)=>{if(t!=null)return t;const n=Vp(e),r=Ol(n,"context"),s=Ol(n,"response");return n.status??n.statusCode??r.status??r.statusCode??s.status??s.statusCode??null},r6=(e,t)=>{if(t!=null)return t;const n=Vp(e),r=Ol(n,"context");return n.code??r.code??null},s6=e=>{const t=typeof e=="number"?e:typeof e=="string"?Number.parseInt(e,10):NaN;if(Number.isFinite(t))return`${Math.floor(t/100)}xx`},o6=()=>"production".trim()||"production",Cr=(e,t)=>{const n=n6(e,t.status),r=r6(e,t.code),s=s6(n),o=o6();Ce(e,{area:"supabase",action:t.action,level:t.level??"error",tags:{operation:t.operation,supabase_operation:t.operation,supabase_function:t.functionName,supabase_rpc:t.rpcName,supabase_table:t.table,supabase_bucket:t.bucket,supabase_status:n,supabase_status_class:s,supabase_code:r,production_signal:o==="production"},extra:{...t.extra,status:n,statusClass:s,code:r,environment:o},fingerprint:t.fingerprint??["supabase",t.operation,t.functionName??t.rpcName??t.table??t.bucket??t.action,String(n??r??"unknown")]})},a6=(e,t,n)=>{const r=new Error(e);return r.status=t.status,r.statusText=t.statusText,r.url=t.url,r.extra=n,r},i6=1080,l6=2160,Ei="cf_mobile_upload_queue_v1",c6="cf_uploads",bs="cloudflare-mobile-upload-v2",Hp=6,Wp=24*60*60*1e3,u6=10,d6=6e4,f6=5,h6=350,p6=[/missing required quick finalize fields/i,/unable to determine the destination month/i,/upload user mismatch/i,/missing image data/i,/file does not exist/i,/no such file/i,/enoent/i,/permission denied/i],m6=e=>Math.floor(e*(.9+Math.random()*.2)),g6=e=>{const r=Math.min(6e5,1500*2**Math.min(e,8));return m6(r)},y6=(e,t,n)=>t>=Hp||Date.now()-e.createdAt>Wp?!0:p6.some(r=>r.test(n)),Lr=e=>typeof e=="number"&&Number.isFinite(e),uf=e=>typeof e.child_id=="string"&&e.child_id.length>0&&Lr(e.quick_birthday_year??e.year)&&Lr(e.quick_month_number??e.month)&&Lr(e.quick_calendar_year),v6=e=>new Promise((t,n)=>{const r=new FileReader;r.onerror=()=>n(r.error??new Error("Failed to read file")),r.onload=()=>{const s=r.result;if(typeof s!="string"){n(new Error("Unexpected FileReader result type"));return}const o=s.indexOf(",");t(o>=0?s.slice(o+1):s)},r.readAsDataURL(e)}),b6=e=>e.includes("/cache/month-media-picker/"),w6=e=>{if(typeof e!="string")return e;try{return JSON.parse(e)}catch{return e}},hn=e=>{try{return JSON.stringify(e)}catch{return String(e)}},ko=e=>e instanceof Error?{name:e.name,message:e.message,stack:e.stack,code:e.code}:{message:String(e)},df=e=>{const t=e.match(/\b(?:HTTP error:|status)\s*(\d{3})\b/i);return t?Number.parseInt(t[1],10):void 0},ff=e=>{const t={was_compressed:e.wasCompressed,original_size:e.originalSize,content_type:e.mime};return e.width&&(t.width=e.width),e.height&&(t.height=e.height),e.originalWidth&&(t.original_width=e.originalWidth),e.originalHeight&&(t.original_height=e.originalHeight),e.contentHash&&(t.content_hash=e.contentHash),e.nativeAssetId&&(t.native_asset_id=e.nativeAssetId),Object.keys(t).length>0?t:null};class x6{constructor(){Le(this,"processing",!1);Le(this,"listeners",new Set);Le(this,"initStarted",!1);Le(this,"active",new Set);Le(this,"activeBytes",0);Le(this,"recentFailureTimestamps",[]);Le(this,"ewmaBytesPerSec",null);Le(this,"lock",Promise.resolve());Le(this,"progressListener",null);Le(this,"uploadUrlToId",new Map);Le(this,"sessionObjectUrls",new Map);Le(this,"mintCache",new Map);Le(this,"finalizePending",[]);Le(this,"finalizeFlushTimer",null)}async withLock(t){const n=this.lock;let r=null;this.lock=new Promise(s=>{r=s}),await n;try{return await t()}finally{r==null||r()}}init(){!j.isNativePlatform()||this.initStarted||(this.initStarted=!0,El.addListener("progress",t=>{this.handleProgress(t)}).then(t=>{this.progressListener=t}).catch(t=>{console.warn("[CloudflareMobileUploadManager] Failed to attach progress listener",t)}),ua.addListener("networkStatusChange",t=>{t.connected&&this.processQueue()}),Ge.addListener("appStateChange",t=>{t.isActive&&this.processQueue()}),this.processQueue())}subscribe(t){return this.listeners.add(t),()=>this.listeners.delete(t)}async getSnapshot(t){await this.pruneExpiredQueueItems();const n=await this.readQueue(),r=t!=null&&t.finalizeMode?n.filter(s=>s.finalizeMode===t.finalizeMode):n;return{total:r.length,queued:r.filter(s=>s.status==="queued").length,uploading:r.filter(s=>s.status==="uploading").length,errored:r.filter(s=>s.status==="error").length}}async cancelErroredUploads(t){if(!j.isNativePlatform())return 0;
162const n=t!=null&&t.ids?new Set(t.ids):null;let r=[];return await this.withLock(async()=>{const o=await this.readQueue();if(r=o.filter(i=>!(i.status!=="error"||t!=null&&t.finalizeMode&&i.finalizeMode!==t.finalizeMode||n&&!n.has(i.id))),r.length===0)return;const a=new Set(r.map(i=>i.id));await this.writeQueue(o.filter(i=>!a.has(i.id)))}),r.length===0?0:(new Set(r.map(o=>o.id)).forEach(o=>{this.active.delete(o),this.sessionObjectUrls.delete(o),this.mintCache.delete(o),this.uploadUrlToId.forEach((a,i)=>{a===o&&this.uploadUrlToId.delete(i)})}),await Promise.all(r.map(o=>this.cleanupQueueItemFile(o))),r.forEach(o=>this.emit({type:"remove",id:o.id})),r.length)}async requireSessionUserId(){var r,s;const{data:t}=await z.auth.getSession(),n=(s=(r=t.session)==null?void 0:r.user)==null?void 0:s.id;if(!n)throw new Error("No active session. Please sign in and try again.");return n}async resolveUploadLocalFile(t,n){if(n.nativeAssetId&&n.isNativePreview)return{localUri:n.sourceFileUri??""};if(n.sourceFileUri&&!n.isNativePreview)return{localUri:n.sourceFileUri};if(n.nativeAssetId){const a=await cf.exportImage({id:n.nativeAssetId,maxDimension:4096,jpegQuality:.92,purpose:"upload"});if(a.fileUri)return{localUri:a.fileUri,sizeBytes:a.sizeBytes,width:a.width,height:a.height,mime:a.mimeType,fileName:a.fileName}}const r=await v6(n.file),s=`${c6}/${t}`;return{localUri:(await Ne.writeFile({path:s,directory:Pe.Data,recursive:!0,data:r})).uri,storagePath:s}}async measureDimensionsFromLocalUri(t){try{const n=await fetch(j.convertFileSrc(t));if(!n.ok)return;const r=await n.blob(),s=await createImageBitmap(r,{imageOrientation:"from-image"}).catch(()=>createImageBitmap(r)),o={width:s.width,height:s.height};return s.close(),o}catch(n){console.warn("[CloudflareMobileUploadManager] dimension measure failed",{localUri:t,error:n});return}}async computeContentHashFromLocalUri(t){try{const n=await fetch(j.convertFileSrc(t));return n.ok?await ha(await n.blob())??void 0:void 0}catch(n){console.warn("[CloudflareMobileUploadManager] content hash failed",{localUri:t,error:n});return}}async enqueue(t){var s,o,a,i;if(!j.isNativePlatform()||t.length===0)return;const n=await this.requireSessionUserId(),r=Date.now();for(const l of t){if(l.user_id!==n)throw new Error("Upload user mismatch. Please sign in again and retry.");const c=await this.resolveUploadLocalFile(l.id,l.preparedFile),d={id:l.id,user_id:l.user_id,child_id:l.child_id,storybook_id:l.storybook_id,month:l.month,year:l.year,sort_order:l.sort_order,is_cover:l.is_cover,is_public:l.is_public,is_timeline_hidden:l.is_timeline_hidden===!0,originalName:l.preparedFile.originalName||"upload.jpg",mime:c.mime||l.preparedFile.file.type||"image/jpeg",sizeBytes:c.sizeBytes??l.preparedFile.file.size,width:c.width??((s=l.preparedFile.dimensions)==null?void 0:s.width),height:c.height??((o=l.preparedFile.dimensions)==null?void 0:o.height),originalWidth:(a=l.preparedFile.originalDimensions)==null?void 0:a.width,originalHeight:(i=l.preparedFile.originalDimensions)==null?void 0:i.height,contentHash:l.preparedFile.contentHash,wasCompressed:l.preparedFile.wasCompressed,originalSize:l.preparedFile.originalSize,nativeAssetId:l.preparedFile.nativeAssetId,isNativePreview:l.preparedFile.isNativePreview,capturedAtMs:l.preparedFile.capturedTimestamp,storagePath:c.storagePath,localUri:c.localUri,finalizeMode:"timeline",status:"queued",attempts:0,nextAttemptAt:r,createdAt:r,updatedAt:r};let f=!1;await this.withLock(async()=>{const h=await this.readQueue();h.some(p=>p.id===d.id)||(await this.writeQueue([...h,d]),f=!0)}),f&&(l.preparedFile.objectUrl&&this.sessionObjectUrls.set(d.id,l.preparedFile.objectUrl),this.emit({type:"status",id:d.id,status:"pending"})),this.processQueue()}}async enqueueQuickUploads(t){if(!j.isNativePlatform()||t.length===0)return;const n=await this.requireSessionUserId(),r=Date.now();for(const d of t)if(!Lr(d.birthdayYear)||!Lr(d.monthNumber)||!Lr(d.calendarYear))throw new Error("Unable to determine the destination month for a shared photo.");const s=new Array(t.length);let o=0;const a=async()=>{for(;;){const d=o;if(d>=t.length)return;o+=1,s[d]=await this.resolveUploadLocalFile(t[d].id,t[d].preparedFile)}};await Promise.all(Array.from({length:Math.min(t.length,3)},a));const i=t.map((d,f)=>{var p,g,y,v;const h=s[f];return{id:d.id,batch_id:d.batchId,user_id:n,child_id:d.childId,storybook_id:null,month:d.monthNumber,year:d.birthdayYear,sort_order:0,is_cover:!1,is_public:!0,originalName:d.preparedFile.originalName||"upload.jpg",mime:h.mime||d.preparedFile.file.type||"image/jpeg",sizeBytes:h.sizeBytes??d.preparedFile.file.size,width:h.width??((p=d.preparedFile.dimensions)==null?void 0:p.width),height:h.height??((g=d.preparedFile.dimensions)==null?void 0:g.height),originalWidth:(y=d.preparedFile.originalDimensions)==null?void 0:y.width,originalHeight:(v=d.preparedFile.originalDimensions)==null?void 0:v.height,contentHash:d.preparedFile.contentHash,wasCompressed:d.preparedFile.wasCompressed,originalSize:d.preparedFile.originalSize,nativeAssetId:d.preparedFile.nativeAssetId,isNativePreview:d.preparedFile.isNativePreview,capturedAtMs:d.preparedFile.capturedTimestamp,storagePath:h.storagePath,localUri:h.localUri,finalizeMode:"quick",quick_birthday_year:d.birthdayYear,quick_month_number:d.monthNumber,quick_calendar_year:d.calendarYear,analytics_source:d.analyticsSource,initial_photo_count:d.initialPhotoCount,should_track_first_photo_milestone:d.shouldTrackFirstPhotoMilestone,status:"queued",attempts:0,nextAttemptAt:r,createdAt:r,updatedAt:r}});let l=[];await this.withLock(async()=>{const d=await this.readQueue(),f=new Set(d.map(h=>h.id));l=i.filter(h=>!f.has(h.id)),l.length!==0&&await this.writeQueue([...d,...l])});const c=new Map(t.map(d=>[d.id,d.preparedFile.objectUrl]));for(const d of l){const f=c.get(d.id);
162f&&this.sessionObjectUrls.set(d.id,f),this.emit({type:"status",id:d.id,status:"pending"})}l.length>0&&this.processQueue()}async processQueue(t){var r,s;if(!j.isNativePlatform()||this.processing)return;this.processing=!0;const n=t!=null&&t.maxMs?Date.now()+t.maxMs:void 0;try{if(await this.pruneExpiredQueueItems(),n&&Date.now()>=n)return;const{data:o}=await z.auth.getSession(),a=(s=(r=o.session)==null?void 0:r.user)==null?void 0:s.id;if(!a)return;const i=await ua.getStatus();if(!i.connected)return;const l=this.computeMaxConcurrent(i.connectionType);if(this.active.size>=l)return;for(let c=0;c<l;c+=1){if(n&&Date.now()>=n||this.active.size>=l)return;const d=await this.reserveNextEligible(a);if(!d)return;this.active.add(d.id),this.activeBytes+=d.sizeBytes,this.uploadOne(d).finally(()=>{this.active.delete(d.id),this.activeBytes=Math.max(0,this.activeBytes-d.sizeBytes),this.processQueue(t)})}}finally{this.processing=!1}}computeMaxConcurrent(t){const n=Date.now();if(this.recentFailureTimestamps=this.recentFailureTimestamps.filter(s=>n-s<3e4),this.recentFailureTimestamps.length>=2)return 1;const r=this.ewmaBytesPerSec??0;return t==="wifi"?this.ewmaBytesPerSec===null||r>2e6?3:2:t==="cellular"?2:t==="unknown"?this.ewmaBytesPerSec===null||r>12e5?3:2:1}emit(t){for(const n of this.listeners)n(t)}async getQueuedLocalUris(){return j.isNativePlatform()?(await this.readQueue()).map(t=>t.localUri):[]}async cleanupQueueItemFile(t){try{Fc(t.localUri)?(await this.readQueue()).some(r=>r.id!==t.id&&r.localUri===t.localUri)||await Ne.deleteFile({path:t.localUri}):t.storagePath?await Ne.deleteFile({path:t.storagePath,directory:Pe.Data}):b6(t.localUri)&&await Ne.deleteFile({path:t.localUri})}catch{}}handleProgress(t){if(t.type!=="upload")return;const n=this.uploadUrlToId.get(t.url);if(!n)return;const r=t.lengthComputable?t.contentLength:void 0,s=r&&r>0?Math.max(0,Math.min(1,t.bytes/r)):void 0;this.emit({type:"progress",id:n,progress:{bytes:t.bytes,total:r,percent:s}})}async reserveNextEligible(t){return this.withLock(async()=>{const n=await this.readQueue(),r=Date.now(),s=18*1024*1024,o=n.filter(l=>l.user_id===t).filter(l=>l.status!=="uploading").filter(l=>l.nextAttemptAt<=r).filter(l=>!this.active.has(l.id)).sort((l,c)=>l.nextAttemptAt-c.nextAttemptAt)[0];if(!o||o.sizeBytes>=8*1024*1024&&this.active.size>0||this.activeBytes+o.sizeBytes>s)return null;const a=n.findIndex(l=>l.id===o.id);if(a===-1)return null;const i=[...n];return i[a]={...i[a],status:"uploading",updatedAt:r},await this.writeQueue(i),this.emit({type:"status",id:o.id,status:"uploading"}),i[a]})}async resolveQueueItemUploadFile(t){if(t.nativeAssetId&&t.isNativePreview){const n=await cf.exportImage({id:t.nativeAssetId,maxDimension:4096,jpegQuality:.92,purpose:"upload"});if(n.fileUri)return{localUri:n.fileUri,sizeBytes:n.sizeBytes,width:n.width,height:n.height,mime:n.mimeType,fileName:n.fileName}}return{localUri:t.localUri,storagePath:t.storagePath,sizeBytes:t.sizeBytes,mime:t.mime,fileName:t.originalName}}async flushFinalizeBatch(){this.finalizeFlushTimer&&(clearTimeout(this.finalizeFlushTimer),this.finalizeFlushTimer=null);const t=this.finalizePending.splice(0);if(t.length!==0)try{const{data:n,error:r}=await z.functions.invoke(bs,{body:{action:"finalize",uploads:t.map(o=>o.payload)}});if(r)throw r;const s=new Map(((n==null?void 0:n.results)??[]).map(o=>[o.id,o]));for(const o of t)o.resolve(s.get(o.payload.id))}catch(n){for(const r of t)r.reject(n)}}enqueueFinalize(t){return new Promise((n,r)=>{this.finalizePending.push({payload:t,resolve:n,reject:r}),this.finalizePending.length>=f6||this.active.size<=1?this.flushFinalizeBatch():this.finalizeFlushTimer||(this.finalizeFlushTimer=setTimeout(()=>{this.finalizeFlushTimer=null,this.flushFinalizeBatch()},h6))})}takeCachedMint(t){const n=this.mintCache.get(t);return!n||(this.mintCache.delete(t),n.expiresAtMs&&n.expiresAtMs-Date.now()<d6)?null:n}async acquireMint(t,n){const r=this.takeCachedMint(t.id);if(r)return r;const o=(await this.readQueue()).filter(c=>c.id!==t.id&&c.status!=="error"&&!this.mintCache.has(c.id)&&!c.cfImageId).slice(0,u6-1),{data:a,error:i}=await z.functions.invoke(bs,{body:{action:"mint",files:[{id:t.id,name:n.fileName||t.originalName||"upload",size:n.sizeBytes??t.sizeBytes,mime:n.mime??t.mime},...o.map(c=>({id:c.id,name:c.originalName||"upload",size:c.sizeBytes,mime:c.mime}))]}});if(i)throw Cr(i,{operation:"edge-function",action:"mobile-photo-upload-mint",functionName:bs,extra:{finalizeMode:t.finalizeMode,attempts:t.attempts,fileSize:n.sizeBytes??t.sizeBytes,mime:n.mime??t.mime,batchSize:o.length+1}}),i;let l=null;for(const c of(a==null?void 0:a.results)??[]){if(!c.uploadURL)continue;const d={uploadURL:c.uploadURL,cfUploadId:c.cfUploadId,requireSignedURLs:c.requireSignedURLs,expiresAtMs:c.expiresAt?Date.parse(c.expiresAt):void 0};c.fileId===t.id?l=d:this.mintCache.set(c.fileId,d)}if(!l)throw new Error("Missing Cloudflare upload URL");return l}async performDirectUpload(t,n,r,s){var g,y,v,x;const o=await this.acquireMint(t,n),a=o.uploadURL.split("?")[0];console.info(`[CloudflareMobileUploadManager] upload start ${hn({id:t.id,sizeBytes:n.sizeBytes??t.sizeBytes,statSize:s,mime:n.mime??t.mime,uploadUrl:a,localUri:t.localUri,uploadPath:r,isFileTransferAvailable:(g=j.isPluginAvailable)==null?void 0:g.call(j,"FileTransfer")})}`),this.uploadUrlToId.set(o.uploadURL,t.id);const i=async C=>El.uploadFile({url:o.uploadURL,path:r,fileKey:"file",fileName:n.fileName||t.originalName||"upload.jpg",mimeType:n.mime??t.mime,chunkedMode:C,progress:!0});let l;try{l=await i(!1)}catch(C){const _=C instanceof Error?C.message:String(C);if(_.includes("HTTP error: 400")){console.warn(`[CloudflareMobileUploadManager] upload retry with chunked ${hn({id:t.id,error:ko(C)})}`);try{l=await i(!0)}catch(b){throw Cr(b,{operation:"direct-upload",action:"mobile-photo-cloudflare-upload",status:df(b instanceof Error?b.message:String(b)),extra:{finalizeMode:t.finalizeMode,attempts:t.attempts,fileSize:n.sizeBytes??t.sizeBytes,mime:n.mime??t.mime,retriedWithChunkedMode:!0}}),b}}else throw Cr(C,{operation:"direct-upload",action:"mobile-photo-cloudflare-upload",status:df(_),extra:{finalizeMode:t.finalizeMode,attempts:t.attempts,fileSize:n.sizeBytes??t.sizeBytes,mime:n.mime??t.mime,retriedWithChunkedMode:!1}}
162),console.error(`[CloudflareMobileUploadManager] upload threw ${hn({id:t.id,error:ko(C)})}`),C}this.uploadUrlToId.delete(o.uploadURL);const c=Number.parseInt(String(l.responseCode??""),10),d=typeof l.response=="string"&&l.response.length>0?l.response.slice(0,500):null;if(console.info(`[CloudflareMobileUploadManager] upload result ${hn({id:t.id,responseCode:l.responseCode,bytesSent:l.bytesSent,responseSnippet:d,headerKeys:l.headers?Object.keys(l.headers).slice(0,10):[]})}`),!Number.isFinite(c)||c>=400){const C=a6(`Upload failed: ${l.responseCode??"unknown"} ${d?`- ${d}`:""}`,{status:Number.isFinite(c)?c:0,statusText:"",url:a});throw Cr(C,{operation:"direct-upload",action:"mobile-photo-cloudflare-upload",status:Number.isFinite(c)?c:null,extra:{finalizeMode:t.finalizeMode,attempts:t.attempts,fileSize:n.sizeBytes??t.sizeBytes,mime:n.mime??t.mime,responseSnippet:d}}),C}const f=w6(l.response),h=typeof f=="object"&&f!==null?f:{},p=((y=h.result)==null?void 0:y.id)??h.id??((x=(v=h.result)==null?void 0:v.image)==null?void 0:x.id)??o.cfUploadId;if(!p)throw console.error(`[CloudflareMobileUploadManager] missing cf image id ${hn({id:t.id,responseSnippet:d})}`),new Error("Cloudflare response missing image id");return{cfImageId:p,requireSignedURLs:o.requireSignedURLs===!0}}async uploadOne(t){const n=Date.now();try{const r=await this.resolveQueueItemUploadFile(t);let s,o=r.localUri;try{if(r.storagePath){s=(await Ne.stat({path:r.storagePath,directory:Pe.Data})).size;const w=await Ne.getUri({path:r.storagePath,directory:Pe.Data});w!=null&&w.uri&&(o=w.uri)}else s=(await Ne.stat({path:r.localUri})).size}catch(b){console.warn("[CloudflareMobileUploadManager] stat failed",{id:t.id,error:b})}let a=t.cfImageId,i=t.cfRequireSignedURLs===!0;if(a)console.info(`[CloudflareMobileUploadManager] re-finalizing with persisted image ${hn({id:t.id,cfImageId:a})}`);else{const b=await this.performDirectUpload(t,r,o,s);a=b.cfImageId,i=b.requireSignedURLs,await this.withLock(async()=>{const w=await this.readQueue(),P=w.findIndex(N=>N.id===t.id);P!==-1&&(w[P]={...w[P],cfImageId:a,cfRequireSignedURLs:i,updatedAt:Date.now()},await this.writeQueue(w))})}const l=t.contentHash||!o?t:{...t,contentHash:await this.computeContentHashFromLocalUri(o)};let c;(!(r.width??l.width)||!(r.height??l.height))&&(c=o?await this.measureDimensionsFromLocalUri(o):void 0);const d={...l,width:r.width??l.width??(c==null?void 0:c.width),height:r.height??l.height??(c==null?void 0:c.height),sizeBytes:r.sizeBytes??l.sizeBytes,mime:r.mime??l.mime,originalName:r.fileName??l.originalName},f=d.finalizeMode==="quick"?{id:d.id,cfImageId:a,filename:d.originalName,sizeBytes:d.sizeBytes,childId:d.child_id,finalizeMode:"quick",birthdayYear:d.quick_birthday_year??d.year,monthNumber:d.quick_month_number??d.month,calendarYear:d.quick_calendar_year??d.year,contentType:d.mime,width:d.width??null,height:d.height??null,capturedAt:d.capturedAtMs?new Date(d.capturedAtMs).toISOString():null,metadata:ff(d),requireSignedURLs:i}:{id:d.id,cfImageId:a,filename:d.originalName,sizeBytes:d.sizeBytes,childId:d.child_id,storybookId:d.storybook_id,month:d.month,year:d.year,sortOrder:d.sort_order,isCover:d.is_cover,isPublic:d.is_public,isTimelineHidden:d.is_timeline_hidden===!0,finalizeMode:"timeline",contentType:d.mime,width:d.width??null,height:d.height??null,capturedAt:d.capturedAtMs?new Date(d.capturedAtMs).toISOString():null,metadata:ff(d),requireSignedURLs:i};let h;try{h=await this.enqueueFinalize(f)}catch(b){throw Cr(b,{operation:"edge-function",action:"mobile-photo-upload-finalize",functionName:bs,extra:{finalizeMode:d.finalizeMode,attempts:d.attempts,fileSize:d.sizeBytes,mime:d.mime,month:d.month,year:d.year}}),b}if(h!=null&&h.error){const b=new Error(h.error);throw b.permanent=h.permanent===!0,Cr(b,{operation:"edge-function",action:"mobile-photo-upload-finalize-result",functionName:bs,extra:{finalizeMode:d.finalizeMode,attempts:d.attempts,fileSize:d.sizeBytes,mime:d.mime,month:d.month,year:d.year}}),b}const p=h==null?void 0:h.record,g=h==null?void 0:h.quickResult;if(t.finalizeMode==="quick"&&!g)throw new Error("Quick finalize response missing result payload");const y=this.sessionObjectUrls.get(t.id);p&&y&&(p._transientBlobUrl=y),g!=null&&g.photo&&y&&(g.photo._localBlobUrl=y);const v=(r.mime??t.mime).toLowerCase();if(!!t.nativeAssetId&&v==="image/jpeg"&&(d.width??0)>0&&(d.height??0)>0&&Math.max(d.width??0,d.height??0)<=4096)try{const b=await(await fetch(j.convertFileSrc(o))).blob(),w=await Zy(new File([b],"seed.jpg",{type:"image/jpeg"}),{maxWidth:i6,maxHeight:l6,fit:"contain",quality:.85});B7(a,"phone",w)}catch(b){console.debug("[CloudflareMobileUploadManager] byte cache seed skipped",{id:t.id,error:ko(b)})}await this.withLock(async()=>{const b=(await this.readQueue()).filter(w=>w.id!==t.id);await this.writeQueue(b)}
162),await this.cleanupQueueItemFile(t),p&&this.emit({type:"persisted",id:t.id,persisted:p}),g&&(this.emit({type:"quick-persisted",id:t.id,detail:g,analytics:{userId:t.user_id,batchId:t.batch_id,source:t.analytics_source,initialPhotoCount:t.initial_photo_count,shouldTrackFirstPhotoMilestone:t.should_track_first_photo_milestone}}),typeof window<"u"&&window.dispatchEvent(new CustomEvent(Gy,{detail:g}))),this.emit({type:"remove",id:t.id}),this.sessionObjectUrls.delete(t.id);const C=Math.max(.05,(Date.now()-n)/1e3),_=t.sizeBytes/C;this.recentFailureTimestamps=[],this.ewmaBytesPerSec=this.ewmaBytesPerSec===null?_:.7*this.ewmaBytesPerSec+.3*_}catch(r){this.uploadUrlToId.forEach((c,d)=>{c===t.id&&this.uploadUrlToId.delete(d)}),console.error(`[CloudflareMobileUploadManager] upload error ${hn({id:t.id,error:ko(r)})}`);const s=r instanceof Error?r.message:String(r),o=(t.attempts??0)+1,a=Date.now()+g6(o);this.recentFailureTimestamps.push(Date.now());const l=(r==null?void 0:r.permanent)===!0||y6(t,o,s);await this.withLock(async()=>{const c=await this.readQueue(),d=c.findIndex(f=>f.id===t.id);if(d!==-1){if(l){await this.writeQueue(c.filter(f=>f.id!==t.id));return}c[d]={...c[d],status:"error",attempts:o,nextAttemptAt:a,lastError:s,updatedAt:Date.now()},await this.writeQueue(c)}}),l?(console.warn(`[CloudflareMobileUploadManager] dropping failed upload ${hn({id:t.id,attempts:o,ageMs:Date.now()-t.createdAt,error:s})}`),await this.cleanupQueueItemFile(t),this.emit({type:"remove",id:t.id}),this.sessionObjectUrls.delete(t.id),this.mintCache.delete(t.id)):this.emit({type:"status",id:t.id,status:"error",error:s})}}async readQueue(){const{value:t}=await Re.get({key:Ei});if(!t)return[];try{const n=JSON.parse(t);if(!Array.isArray(n))return[];const r=Date.now();return n.map(s=>({...s,finalizeMode:s.finalizeMode==="quick"?"quick":"timeline",status:s.status==="uploading"&&!this.active.has(s.id)?"queued":s.status,nextAttemptAt:s.status==="uploading"&&!this.active.has(s.id)?r:s.nextAttemptAt})).filter(s=>s.finalizeMode!=="quick"||uf(s))}catch{return[]}}async pruneExpiredQueueItems(){await this.withLock(async()=>{const{value:t}=await Re.get({key:Ei});if(!t)return;let n;try{const a=JSON.parse(t);if(!Array.isArray(a))return;n=a}catch{return}const r=Date.now(),s=[],o=[];for(const a of n){const i=a.attempts??0,l=r-(a.createdAt??r)>Wp,c=i>=Hp,d=a.finalizeMode==="quick"&&!uf(a);l||c||d?o.push(a):s.push(a)}o.length!==0&&(await this.writeQueue(s),await Promise.all(o.map(a=>this.cleanupQueueItemFile(a))))})}async writeQueue(t){await Re.set({key:Ei,value:JSON.stringify(t)})}}const rr=new x6,qp=()=>{rr.init()},C6=Object.freeze(Object.defineProperty({__proto__:null,cloudflareMobileUploadManager:rr,initCloudflareMobileUploads:qp},Symbol.toStringTag,{value:"Module"})),Mr=new Map,Gp=new Set,qa=e=>typeof e=="string"&&e.startsWith("blob:"),Kp=e=>{try{URL.revokeObjectURL(e)}catch{}},_6=e=>{qa(e)&&Mr.set(e,(Mr.get(e)??0)+1)},E6=e=>{if(!qa(e))return;const t=Mr.get(e)??0;if(t<=1){Mr.delete(e),Gp.delete(e)&&Kp(e);return}Mr.set(e,t-1)},kP=(e,t=12e4)=>{qa(e)&&(_6(e),setTimeout(()=>E6(e),t))},S6=e=>{if(qa(e)){if((Mr.get(e)??0)>0){Gp.add(e);return}Kp(e)}};var hf;(function(e){e.AdPersonalization="AD_PERSONALIZATION",e.AdStorage="AD_STORAGE",e.AdUserData="AD_USER_DATA",e.AnalyticsStorage="ANALYTICS_STORAGE",e.FunctionalityStorage="FUNCTIONALITY_STORAGE",e.PersonalizationStorage="PERSONALIZATION_STORAGE"})(hf||(hf={}));var pf;(function(e){e.Granted="GRANTED",e.Denied="DENIED"})(pf||(pf={}));const Wo=we("FirebaseAnalytics",{web:()=>B(()=>import("./web_BD-zp1Yw.js"),__vite__mapDeps([12,13,1,2,3,4])).then(e=>new e.FirebaseAnalyticsWeb)}),ma=we("MetaAppEvents"),Qp=()=>j.isNativePlatform()&&j.isPluginAvailable("MetaAppEvents"),A6=e=>{if(!e)return;const t=Object.entries(e).filter(([,n])=>n!=null);if(t.length!==0)return Object.fromEntries(t)},pn=(e,t)=>{const n=e==null?void 0:e[t];return typeof n=="number"?n:void 0},mn=(e,t)=>{const n=e==null?void 0:e[t];return typeof n=="string"?n:void 0},N6=(e,t)=>{switch(e){case"onboarding_completed":return[{name:"fb_mobile_complete_registration",params:{fb_registration_method:mn(t,"registration_method")??"app_onboarding",yearbook_type:mn(t,"yearbook_type")??"unknown",onboarding_path:mn(t,"path")??"library"}}];case"photobook_checkout_started":return[{name:"fb_mobile_initiated_checkout",valueToSum:pn(t,"total_price_eur"),params:{fb_currency:mn(t,"currency")??"EUR",fb_content_type:"photobook",fb_num_items:pn(t,"quantity")??1,book_type:mn(t,"book_type")??"classic",page_count:pn(t,"page_count")??0}}];case"photobook_ordered":return[{name:"fb_mobile_purchase",valueToSum:pn(t,"total_price_eur"),params:{fb_currency:mn(t,"currency")??"EUR",fb_content_type:"photobook",fb_num_items:pn(t,"quantity")??1,book_type:mn(t,"book_type")??"classic",page_count:pn(t,"page_count")??0}}];case"first_photo_uploaded":case"photos_uploaded_20":case"photos_uploaded_100":return[{name:"fb_mobile_achievement_unlocked",params:{achievement_id:e,source:mn(t,"source")??"unknown",total_photos:pn(t,"total_photos")??0,milestone:pn(t,"milestone")??1}}];default:return[]}},mf=async(e,t,n)=>{await ma.logEvent({name:e,params:t,valueToSum:n})},P6=async(e,t,n)=>{if(!Qp())return;const r=A6(t);try{await mf(e,r,n);for(const s of N6(e,r))await mf(s.name,s.params,s.valueToSum)}catch(s){console.warn("[MetaAppEvents] Failed to log event",{name:e,params:t,valueToSum:n,error:s}),Ce(s,{area:"native-plugin",action:"MetaAppEvents.logEvent",level:"warning",tags:{plugin:"MetaAppEvents",event_name:e}})}},Yp=()=>j.getPlatform()==="ios"&&Qp(),IP=async()=>
162{if(!Yp())return"unavailable";try{return(await ma.getTrackingPermissionStatus()).status}catch(e){return console.warn("[MetaAppEvents] Failed to get tracking permission status",{error:e}),"unavailable"}},RP=async()=>{if(!Yp())return"unavailable";try{const e=await ma.getTrackingPermissionStatus();return e.status!=="notDetermined"?e.status:(await ma.requestTrackingPermission()).status}catch(e){return console.warn("[MetaAppEvents] Failed to request tracking permission",{error:e}),"unavailable"}},Xp="2359534501199878".trim()??"",gf="meta-pixel-script";let yf=!1;const $c=()=>typeof window<"u"&&!j.isNativePlatform()&&!is(window.location.pathname)&&Xp.length>0,k6=e=>{if(!e)return;const t=Object.entries(e).filter(([,n])=>n!=null);if(t.length!==0)return Object.fromEntries(t)},I6=()=>{if(!$c())return;if(typeof window.fbq=="function")return window.fbq;const e=(...t)=>{if(typeof e.callMethod=="function"){e.callMethod(...t);return}e.queue=e.queue??[],e.queue.push(t)};return e.queue=[],e.loaded=!1,e.version="2.0",e.push=(...t)=>(e.queue=e.queue??[],e.queue.push(t),e.queue.length),window.fbq=e,window._fbq=e,e},R6=()=>{if(!$c()||document.getElementById(gf))return;const e=document.createElement("script");e.id=gf,e.async=!0,e.referrerPolicy="origin",e.src="https://connect.facebook.net/en_US/fbevents.js",document.head.appendChild(e)},Zp=(e,t,n,r)=>{if(!Ga())return;const s=window.fbq;if(s){if(r){s(e,t,n??{},{eventID:r});return}if(n&&Object.keys(n).length>0){s(e,t,n);return}s(e,t)}},It=(e,t)=>
162{const n=e==null?void 0:e[t];return typeof n=="number"?n:void 0},Ee=(e,t)=>{const n=e==null?void 0:e[t];return typeof n=="string"?n:void 0},T6=(e,t,n)=>{switch(e){case"onboarding_completed":return[{method:"track",name:"CompleteRegistration",eventId:n?`complete_registration:${n}`:void 0,params:{content_name:"website_account_creation",status:"completed",registration_method:Ee(t,"registration_method")??"website_onboarding",yearbook_type:Ee(t,"yearbook_type")??"unknown",path:Ee(t,"path")??"library",child_count:It(t,"child_count")??0,has_first_moment_photo:It(t,"has_first_moment_photo")??0}}];case"photobook_checkout_started":return[{method:"track",name:"InitiateCheckout",params:{currency:Ee(t,"currency")??"EUR",value:It(t,"total_price_eur")??0,num_items:It(t,"quantity")??1,content_type:"photobook",content_name:Ee(t,"book_type")??"classic"}}];case"photobook_ordered":{const r=Ee(t,"order_id");return[{method:"track",name:"Purchase",eventId:r?`purchase:${r}`:void 0,params:{currency:Ee(t,"currency")??"EUR",value:It(t,"total_price_eur")??0,num_items:It(t,"quantity")??1,content_type:"photobook",content_name:Ee(t,"book_type")??"classic"}}]}case"gift_card_checkout_started":return[{method:"track",name:"InitiateCheckout",params:{currency:Ee(t,"currency")??"EUR",value:It(t,"value")??0,num_items:1,content_type:"gift_card",content_name:"cadeaubon"}}];case"gift_card_purchased":{const r=Ee(t,"gift_card_id");return[{method:"track",name:"Purchase",eventId:r?`gift_card_purchase:${r}`:void 0,params:{currency:Ee(t,"currency")??"EUR",value:It(t,"value")??0,num_items:1,content_type:"gift_card",content_name:"cadeaubon"}}]}case"gift_card_contribution_started":return[{method:"track",name:"InitiateCheckout",params:{currency:Ee(t,"currency")??"EUR",value:It(t,"value")??0,num_items:1,content_type:"gift_card_contribution",content_name:"cadeaubon_bijdrage"}}];case"gift_card_contribution_purchased":{const r=Ee(t,"contribution_id");return[{method:"track",name:"Purchase",eventId:r?`gift_card_contribution:${r}`:void 0,params:{currency:Ee(t,"currency")??"EUR",value:It(t,"value")??0,num_items:1,content_type:"gift_card_contribution",content_name:"cadeaubon_bijdrage"}}]}case"website_app_store_click":return[...Ee(t,"placement")==="mobile"?[{method:"track",name:"Lead",params:{content_name:"mobile_app_store_click",content_category:Ee(t,"platform")??"unknown",source:Ee(t,"source")??"website",placement:Ee(t,"placement")??"unknown",destination:Ee(t,"destination")??"app_store"}}]:[],{method:"trackCustom",name:"WebsiteAppStoreClick",params:{platform:Ee(t,"platform")??"unknown",source:Ee(t,"source")??"website",placement:Ee(t,"placement")??"unknown",destination:Ee(t,"destination")??"app_store"}}];default:return[]}},Ga=()=>{if(!$c())return!1;const e=I6();return e?(R6(),yf||(e("init",Xp),yf=!0),!0):!1},O6=()=>{Ga()&&Zp("track","PageView")},j6=async()=>{var e,t;try{const{data:n}=await z.auth.getSession();return(t=(e=n.session)==null?void 0:e.user)==null?void 0:t.id}catch{return}},L6=async(e,t)=>{const n=k6(t);if(!Ga())return;const r=e==="onboarding_completed"?await j6():void 0;for(const s of T6(e,n,r))Zp(s.method,s.name,s.params,s.eventId)},Jp="G-GB61PE1037",vf="google-analytics-script";let bf=!1;const em=()=>typeof window<"u"&&["localhost","127.0.0.1"].includes(window.location.hostname),zc=()=>typeof window<"u"&&!j.isNativePlatform(),M6=()=>{zc()&&(window.dataLayer=window.dataLayer||[],typeof window.gtag!="function"&&(window.gtag=function(){window.dataLayer.push(arguments)}))},D6=()=>{if(!zc()||document.getElementById(vf))return;const e=document.createElement("script");e.id=vf,e.async=!0,e.referrerPolicy="origin",e.src=`https://www.googletagmanager.com/gtag/js?id=${Jp}`,document.head.appendChild(e)},tm=()=>zc()?(M6(),D6(),bf||(window.gtag("js",new Date),window.gtag("config",Jp,{send_page_view:!1,debug_mode:em(),page_location:W1(window.location.href)}),bf=!0),!0):!1,F6=e=>{if(!tm())return;const t=za(e??window.location.pathname),n=new URL(t,window.location.origin).toString();window.gtag("event","page_view",{page_path:t,page_location:n,page_title:document.title,debug_mode:em()})},U6=e=>{if(!e)return;const t=Object.entries(e).filter(([n,r])=>!V1(n)&&r!==null&&r!==void 0);if(t.length!==0)return Object.fromEntries(t)},wf=e=>({...e,page_path:za(`${window.location.pathname}${window.location.search}`),page_location:W1(window.location.href)}),_r=(e,t)=>{const n=e==null?void 0:e[t];return typeof n=="number"?n:void 0},Ht=(e,t)=>
162{const n=e==null?void 0:e[t];return typeof n=="string"?n:void 0},B6=(e,t)=>{switch(e){case"onboarding_completed":return[{name:"sign_up",params:{method:Ht(t,"registration_method")??"email",yearbook_type:Ht(t,"yearbook_type")??"unknown",path:Ht(t,"path")??"library"}}];case"photobook_checkout_started":return[{name:"begin_checkout",params:{currency:Ht(t,"currency")??"EUR",value:_r(t,"total_price_eur")??0,items:[{item_name:"photobook",item_category:Ht(t,"book_type")??"classic",quantity:_r(t,"quantity")??1,price:_r(t,"total_price_eur")??0}]}}];case"photobook_ordered":return[{name:"purchase",params:{transaction_id:Ht(t,"order_id")??`order_${Date.now()}`,currency:Ht(t,"currency")??"EUR",value:_r(t,"total_price_eur")??0,items:[{item_name:"photobook",item_category:Ht(t,"book_type")??"classic",quantity:_r(t,"quantity")??1,price:_r(t,"total_price_eur")??0}]}}];case"profile_shared":return[{name:"share",params:{method:Ht(t,"method")??"link",content_type:"profile"}}];default:return[]}},$6=(e,t)=>{if(!tm())return;const n=U6(t);window.gtag("event",e,wf(n));for(const r of B6(e,n))window.gtag("event",r.name,wf(r.params))},nm=we("TiktokAppEvents");let ws=null,Si=null;const z6=()=>j.isNativePlatform()&&j.isPluginAvailable("TiktokAppEvents"),V6=e=>{if(!e)return;const t=Object.entries(e).filter(([,n])=>n!=null);if(t.length!==0)return Object.fromEntries(t)},jl=(e,t)=>{const n=e==null?void 0:e[t];return typeof n=="number"?n:void 0},Vn=(e,t)=>{const n=e==null?void 0:e[t];return typeof n=="string"?n:void 0},Ai=e=>{const t=Vn(e,"book_type")??"classic";return{content_id:t,content_type:"product",content_name:t==="layflat"?"layflat_photobook":"classic_photobook"}},Ni=(e,t)=>({contents:[e],content_type:e.content_type,value:jl(t,"total_price_eur")??0,currency:Vn(t,"currency")??"EUR"}),H6=(e,t)=>{switch(e){case"onboarding_completed":return[{name:"Registration",properties:{registration_method:Vn(t,"registration_method")??"app_onboarding",yearbook_type:Vn(t,"yearbook_type")??"unknown",onboarding_path:Vn(t,"path")??"library"}}];case"photobook_checkout_viewed":return[{name:"ViewContent",properties:Ni(Ai(t),t)}];case"photobook_checkout_started":return[{name:"Checkout",properties:Ni(Ai(t),t)}];case"photobook_ordered":{const n=Vn(t,"order_id");return[{name:"Purchase",properties:Ni(Ai(t),t),eventId:n?`purchase:${n}`:void 0}]}case"first_photo_uploaded":case"photos_uploaded_20":case"photos_uploaded_100":return[{name:"UnlockAchievement",properties:{achievement_id:e,source:Vn(t,"source")??"unknown",total_photos:jl(t,"total_photos")??0,milestone:jl(t,"milestone")??1}}];default:return[]}},W6=async()=>{if(ws){await ws;return}ws=(async()=>{var s;const{data:e}=await z.auth.getSession(),t=(s=e.session)==null?void 0:s.user;if(!t){Si=null;return}const n=`${t.id}:${t.email??""}:${t.phone??""}`;if(n===Si)return;const r={externalId:t.id};t.email&&(r.email=t.email.trim().toLowerCase()),t.phone&&(r.phoneNumber=t.phone.replace(/[^\d+]/g,"")),await nm.identify(r),Si=n})().finally(()=>{ws=null}),await ws},q6=async(e,t)=>{if(!z6())return;const n=V6(t),r=H6(e,n);if(r.length!==0)try{await W6();for(const s of r)await nm.logEvent({name:s.name,properties:s.properties,eventId:s.eventId})}catch(s){console.warn("[TiktokAppEvents] Failed to log event",{name:e,params:t,error:s}),Ce(s,{area:"native-plugin",action:"TiktokAppEvents.logEvent",level:"warning",tags:{plugin:"TiktokAppEvents",event_name:e}})}},G6="D7CFJ1RC77U75VFHB1CG",rm="tiktok-pixel-script";let Ll=!1,xs=null,Pi=null;const sm=()=>typeof window<"u"&&!j.isNativePlatform()&&!is(window.location.pathname),K6=()=>{if(!sm())return;if(typeof window.ttq=="function")return window.ttq;const e=window.ttq=window.ttq||[],t=["page","track","identify","instances","debug","on","off","once","ready","alias","group","enableCookie","disableCookie","holdConsent","revokeConsent","grantConsent"];window.TiktokAnalyticsObject="ttq",e.methods=t,e.setAndDefer=(n,r)=>{n[r]=(...s)=>e.push([r,...s])};for(const n of t)e.setAndDefer(e,n);return e.instance=n=>{var s;e._i=e._i||{};const r=e._i[n]||[];for(const o of t)(s=e.setAndDefer)==null||s.call(e,r,o);return r},e.load=(n,r)=>{var i;const s="https://analytics.tiktok.com/i18n/pixel/events.js",o=document.createElement("script");e._i=e._i||{},e._i[n]=e._i[n]||[],e._t=e._t||{},e._t[n]=Date.now(),e._o=e._o||{},e._o[n]=r||{},o.id=rm,o.type="text/javascript",o.async=!0,o.referrerPolicy="origin",o.src=`${s}?sdkid=${n}&lib=ttq`;const a=document.getElementsByTagName("script")[0];(i=a==null?void 0:a.parentNode)==null||i.insertBefore(o,a)},e},Q6=e=>(e==null?void 0:e.trim().toLowerCase())??"",Y6=e=>(e==null?void 0:e.replace(/[^\d+]/g,""))??"",X6=e=>(e==null?void 0:e.trim())??"",qo=async e=>{var r;if(!e||!((r=window.crypto)!=null&&r.subtle))return"";const t=new TextEncoder().encode(e),n=await window.crypto.subtle.digest("SHA-256",t);return Array.from(new Uint8Array(n)).map(s=>s.toString(16).padStart(2,"0")).join("")},Hn=(e,t)=>{const n=e==null?void 0:e[t];return typeof n=="string"?n:void 0},om=(e,t)=>{const n=e==null?void 0:e[t];return typeof n=="number"?n:void 0},Z6=e=>{if(!e)return;const t=Object.entries(e).filter(([,n])=>n!=null);if(t.length!==0)return Object.fromEntries(t)},ki=e=>{const t=Hn(e,"book_type")??"classic";return{content_id:t,content_type:"product",content_name:t==="layflat"?"layflat_photobook":"classic_photobook"}},Ii=(e,t,n=0)=>({contents:[e],value:om(t,"total_price_eur")??n,currency:Hn(t,"currency")??"EUR"}),J6=(e,t,n)=>{switch(e){case"photobook_checkout_viewed":{const r=ki(t);return[{name:"ViewContent",payload:Ii(r,t),eventIdSource:`view_content:${Hn(t,"storybook_id")??r.content_id}:${Hn(t,"book_type")??"classic"}`}]}case"photobook_checkout_started":{const r=ki(t);return[{name:"InitiateCheckout",payload:Ii(r,t),eventIdSource:`initiate_checkout:${Date.now()}:${Hn(t,"book_type")??"classic"}:${om(t,"quantity")??1}`}]}case"photobook_ordered":{const r=ki(t),s=Hn(t,"order_id")??`${Date.now()}`,o=Ii(r,t);return[{name:"PlaceAnOrder",payload:o,eventIdSource:`place_order:${s}`},{name:"Purchase",payload:o,eventId:`purchase:${s}`}]}case"onboarding_completed":{const r=Hn(t,"yearbook_type")??"unknown";return[{name:"CompleteRegistration",payload:{contents:[{content_id:r,content_type:"product",content_name:"website_account_creation"}],value:0,currency:"EUR"},...n?{eventId:`complete_registration:${n}`}:{eventIdSource:`complete_registration:${Date.now()}:${r}`}}]}default:return[]}},am=async()=>{var n;const{data:e,error:t}=await z.auth.getSession();return t?(console.warn("[TikTokPixel] Failed to resolve current user",t),null):((n=e.session)==null?void 0:n.user)??null},ev=async e=>{if(!e)return null;const[t,n,r]=await Promise.all([qo(Q6(e.email)),qo(Y6(e.phone)),qo(X6(e.id))]),s={};return t&&(s.email=t),n&&(s.phone_number=n),r&&(s.external_id=r),Object.keys(s).length>0?s:null},tv=async()=>
162{if(Vc()){if(xs){await xs;return}xs=(async()=>{var r;const e=await am();if(!e){Pi=null;return}const t=`${e.id}:${e.email??""}:${e.phone??""}`;if(t===Pi)return;const n=await ev(e);n&&((r=window.ttq)==null||r.identify(n),Pi=t)})().finally(()=>{xs=null}),await xs}},nv=async e=>{var n,r;const t=e.eventId??(e.eventIdSource?await qo(e.eventIdSource)||e.eventIdSource:void 0);if(t){(n=window.ttq)==null||n.track(e.name,e.payload,{event_id:t});return}(r=window.ttq)==null||r.track(e.name,e.payload)},Vc=()=>{var t;if(!sm())return!1;const e=K6();return e?(Ll||(document.getElementById(rm)||(t=e.load)==null||t.call(e,G6),Ll=!0),!0):!1},rv=()=>{var e;Vc()&&Ll&&((e=window.ttq)==null||e.page())},sv=async(e,t)=>{var o;if(!Vc())return;const n=Z6(t),r=e==="onboarding_completed"?(o=await am())==null?void 0:o.id:void 0,s=J6(e,n,r);if(s.length!==0){await tv();for(const a of s)await nv(a)}},Ml=new Set,im=()=>j.isNativePlatform()&&j.isPluginAvailable("FirebaseAnalytics"),ov=e=>{if(e)return Object.entries(e).reduce((t,[n,r])=>(r==null||V1(n)||(t[n]=r),t),{})},je=async(e,t)=>{const n=ov(t);if(im())try{await Wo.logEvent({name:e,params:n})}catch(r){console.warn("[FirebaseAnalytics] Failed to log event",{name:e,error:r})}await Promise.allSettled([P6(e,n),L6(e,n),q6(e,n),sv(e,n)]),$6(e,n)},lm=(e,t)=>`firebase_milestone:${e}:${t}`,av=e=>{if(typeof window>"u")return!1;try{return window.localStorage.getItem(e)==="1"}catch{return!1}},iv=e=>{if(!(typeof window>"u"))try{window.localStorage.setItem(e,"1")}catch{}},lv=(e,t)=>{if(!t)return!1;const n=lm(e,t);if(Ml.has(n))return!0;const r=av(n);return r&&Ml.add(n),r},cm=async(e,t,n)=>{if(!im()||!t||lv(e,t))return!1;await je(e,n);const r=lm(e,t);return Ml.add(r),iv(r),!0},cv=async(e,t,n,r)=>{if(!e||t==null||n==null||n<=t)return;const s=[20,100];for(const o of s)t>=o||n<o||await cm(`photos_uploaded_${o}`,e,{source:r,total_photos:n,milestone:o})},uv=we("InAppReview",{web:()=>B(()=>import("./web_DwYkotl1.js"),__vite__mapDeps([14,1,2,3,4])).then(e=>new e.InAppReviewWeb)}),TP=3,dv=10,OP=2e3,fv=3,hv=28,pv=90,Ri=100,mv=1500,jP=12,um="in_app_review:request_times",gv="in_app_review:last_requested_at",dm="in_app_review:gate_declined_at",yv="in_app_review:milestone:",Go=24*60*60*1e3,Hc=()=>!1,LP=Hc,ga=async e=>{const{value:t}=await Re.get({key:e});return t},Wc=(e,t)=>Re.set({key:e,value:t}),fm=e=>`${yv}${e}`,MP=(e,t)=>!e||t===void 0||t===null?null:`grid_archive:${e}:${t}`,DP=e=>e.reduce((t,n)=>{var r;return(((r=n.photos)==null?void 0:r.length)??0)>=dv?t+1:t},0),hm=async()=>{const e=await ga(um);if(e)try{const r=JSON.parse(e);if(Array.isArray(r))return r.filter(s=>Number.isFinite(s))}catch{}const t=await ga(gv),n=t?Number(t):0;return Number.isFinite(n)&&n>0?[n]:[]},vv=async()=>{const e=Date.now(),t=e-365*Go,n=(await hm()).filter(r=>r>t);n.push(e),await Wc(um,JSON.stringify(n))},bv=()=>Wc(dm,String(Date.now())),pm=e=>Wc(fm(e),"true"),mm=async({milestoneId:e,ignoreGateDecline:t=!1})=>{const n=j.isNativePlatform(),r=Hc();if(!n&&!r)return{eligible:!1,reason:"not-native"};if(n&&!j.isPluginAvailable("InAppReview"))return{eligible:!1,reason:"plugin-unavailable"};const[s,o,a]=await Promise.all([ga(fm(e)),hm(),ga(dm)]);if(s==="true")return{eligible:!1,reason:"milestone-already-attempted"};const i=Date.now(),l=o.filter(d=>d>i-365*Go);if(l.length>=fv)return{eligible:!1,reason:"yearly-budget-exhausted"};const c=Math.max(0,...l);if(c>0&&i-c<hv*Go)return{eligible:!1,reason:"cooldown"};if(!t){const d=a?Number(a):0;if(Number.isFinite(d)&&d>0&&i-d<pv*Go)return{eligible:!1,reason:"gate-declined-cooldown"}}return{eligible:!0}},gm=async e=>{je("review_native_requested",{trigger:e.trigger}),Hc()&&!j.isNativePlatform()?console.info("[in-app-review] Debug request skipped native UI",e):await uv.requestReview(),await vv()},FP=async e=>{const{eligible:t,reason:n}=await mm({milestoneId:e.milestoneId,ignoreGateDecline:!0});return t?(await pm(e.milestoneId),await gm(e),{requested:!0}):(je("review_prompt_suppressed",{trigger:e.trigger,reason:n}),{requested:!1,reason:n})};let Ms=null,Ko=null;const wv=e=>{if(Ms=e,Ko){const t=Ko;Ko=null,e(t)}return()=>{Ms===e&&(Ms=null)}},xv=e=>{Ms?Ms(e):Ko=e},Cv=(e,t)=>{e!=null&&t!=null&&(e>=Ri||t<Ri||setTimeout(()=>{xv({milestoneId:`photo_count:${Ri}`,trigger:"photo_count"})},mv))},ym=m.createContext(null),_v=4500,Dl="batch:",Ti=e=>Math.max(0,Math.min(1,typeof e=="number"?e:0)),$n=e=>`${Dl}${e}`,Cs=(e,t)=>{const n=new Set(t.map(s=>s.preparedFile.objectUrl));new Set(e.map(s=>
162s.preparedFile.objectUrl)).forEach(s=>{!s||n.has(s)||S6(s)})},UP=e=>[e.batchId,e.childId,e.fileId,e.birthdayYear,e.monthNumber,e.calendarYear].join(":"),BP=(e="upload")=>{const t=typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():Math.random().toString(36).slice(2);return`${e}-${t}`};function Ev({children:e}){const[t,n]=m.useState([]),[r,s]=m.useState(0),o=m.useRef(new Map),a=m.useRef(new Map),i=m.useCallback(()=>{s(w=>w+1);let b=!1;return()=>{b||(b=!0,s(w=>Math.max(0,w-1)))}},[]),l=m.useCallback(b=>{const w=o.current.get(b);w&&(clearTimeout(w),o.current.delete(b))},[]),c=m.useCallback(b=>{l(b),n(w=>{const P=w.filter(E=>E.id===b),N=w.filter(E=>E.id!==b);return P.forEach(E=>{N.some(A=>A.batchId===E.batchId)||l($n(E.batchId))}),Cs(P,N),N})},[l]),d=m.useCallback(b=>{const w=$n(b);if(o.current.has(w))return;const P=setTimeout(()=>{o.current.delete(w),n(N=>{const E=N.filter(k=>k.batchId===b),A=N.filter(k=>k.batchId!==b);return Cs(E,A),A})},_v);o.current.set(w,P)},[]),f=m.useCallback(b=>{if(b.length===0)return;const w=Date.now();n(P=>{const N=new Map(P.map(E=>[E.id,E]));return b.forEach(E=>{const A=N.get(E.id);N.set(E.id,{...A,...E,status:E.status??(A==null?void 0:A.status)??"queued",progress:Ti(E.progress??(A==null?void 0:A.progress)??0),createdAt:(A==null?void 0:A.createdAt)??w,updatedAt:w})}),Array.from(N.values()).sort((E,A)=>E.createdAt-A.createdAt)})},[]),h=m.useCallback((b,w)=>{n(P=>P.map(N=>{if(N.id!==b)return N;const E=w.status??N.status,A=Ti(w.progress??(E==="done"?1:N.progress));return{...N,...w,status:E,progress:E==="done"?1:Math.max(N.progress,A),updatedAt:Date.now()}}))},[]),p=m.useCallback((b,w)=>{n(P=>P.map(N=>{if(N.batchId!==b)return N;const E=w.status??N.status,A=Ti(w.progress??(E==="done"?1:N.progress));return{...N,...w,status:E,progress:E==="done"?1:Math.max(N.progress,A),updatedAt:Date.now()}}))},[]),g=m.useCallback((b,w)=>{l($n(b)),n(P=>P.map(N=>N.batchId!==b||N.status==="done"||N.status==="error"?N:{...N,status:"error",error:w,updatedAt:Date.now()}))},[l]),y=m.useCallback(b=>{if(b.length===0)return;const w=new Set(b);n(P=>{const N=P.filter(k=>w.has(k.id)&&k.status==="error");
162if(N.length===0)return P;const E=new Set(N.map(k=>k.id)),A=P.filter(k=>!E.has(k.id));return N.forEach(k=>{l(k.id),A.some(T=>T.batchId===k.batchId)||l($n(k.batchId))}),Cs(N,A),A})},[l]),v=m.useCallback(b=>{n(w=>{const P=w.filter(E=>E.id===b&&E.status!=="done");if(P.length===0)return w;const N=w.filter(E=>E.id!==b);return P.forEach(E=>{l(E.id),N.some(A=>A.batchId===E.batchId)||l($n(E.batchId))}),Cs(P,N),N})},[l]),x=m.useCallback(async b=>{const w=Array.from(new Set(b)).filter(Boolean);if(w.length!==0){if(j.isNativePlatform())try{await rr.cancelErroredUploads({ids:w})}catch(P){console.warn("[UploadQueue] Failed to cancel queued upload retries",P);return}y(w)}},[y]),C=m.useCallback(b=>{l($n(b)),n(w=>{const P=w.filter(E=>E.batchId===b),N=w.filter(E=>E.batchId!==b);return P.forEach(E=>l(E.id)),Cs(P,N),N})},[l]);m.useEffect(()=>{const b=new Set(t.map(w=>w.batchId));b.forEach(w=>{const P=t.filter(E=>E.batchId===w);P.length>0&&P.every(E=>E.status==="done")?d(w):l($n(w))}),Array.from(o.current.keys()).forEach(w=>{if(!w.startsWith(Dl))return;const P=w.slice(Dl.length);b.has(P)||l(w)})},[l,t,d]),m.useEffect(()=>{if(j.isNativePlatform())return rr.subscribe(b=>{if(b.type==="status"){const w=b.status==="error"?"error":b.status==="uploading"?"uploading":"queued";h(b.id,{status:w,progress:w==="uploading"?.25:.05,error:b.error});return}if(b.type==="progress"){h(b.id,{status:"uploading",progress:b.progress.percent??.35});return}if(b.type==="quick-persisted"||b.type==="persisted"){if(h(b.id,{status:"done",progress:1}),b.type==="quick-persisted"){const w=b.analytics,P=(w==null?void 0:w.source)??"quick_add";if(je("photo_upload_completed",{source:P,count:1,mode:"background_queue"}),w!=null&&w.shouldTrackFirstPhotoMilestone&&cm("first_photo_uploaded",w.userId,{source:P}),w!=null&&w.userId&&w.initialPhotoCount!==null&&w.initialPhotoCount!==void 0){const N=w.batchId??b.id,E=(a.current.get(N)??0)+1;a.current.set(N,E),cv(w.userId,w.initialPhotoCount,w.initialPhotoCount+E,P),Cv(w.initialPhotoCount,w.initialPhotoCount+E)}}return}b.type==="remove"&&v(b.id)})},[v,h]),m.useEffect(()=>()=>{o.current.forEach(b=>clearTimeout(b)),o.current.clear()},[]);const _=m.useMemo(()=>({items:t,enqueueItems:f,updateItem:h,updateBatch:p,failUnfinishedBatch:g,cancelFailedItems:x,dismissItem:c,dismissBatch:C,isTraySuppressed:r>0,acquireTraySuppression:i}),[i,C,c,f,g,x,t,r,p,h]);return u.jsx(ym.Provider,{value:_,children:e})}const Ka=()=>{const e=m.useContext(ym);if(!e)throw new Error("useUploadQueue must be used within UploadQueueProvider");return e},$P=e=>{const{acquireTraySuppression:t}=Ka();m.useEffect(()=>{if(e)return t()},[e,t])},zP=(e,t,n)=>{const{items:r}=Ka();return m.useMemo(()=>r.filter(s=>s.childId===e&&s.birthdayYear===t&&s.monthNumber===n&&s.status!=="done"),[t,e,r,n])},VP=e=>{const{items:t}=Ka();return m.useMemo(()=>t.filter(n=>n.batchId===e),[e,t])},xf={total:0,queued:0,uploading:0,errored:0},Sv=2500,Av=()=>{const[e,t]=m.useState(xf),[n,r]=m.useState(0),s=m.useRef(null),o=m.useCallback(c=>{c<=0||(r(d=>d+c),s.current!==null&&window.clearTimeout(s.current),s.current=window.setTimeout(()=>{r(0),s.current=null},Sv))},[]),a=m.useCallback(async()=>{if(!j.isNativePlatform()){t(xf),r(0);return}try{const c=await rr.getSnapshot({finalizeMode:"quick"});t(c)}catch(c){console.warn("[useQuickPhotoBackgroundUploads] Failed to read queue snapshot",c)}},[]),i=m.useCallback(async()=>{if(!j.isNativePlatform())return 0;try{const c=await rr.cancelErroredUploads({finalizeMode:"quick"});return await a(),c}catch(c){return console.warn("[useQuickPhotoBackgroundUploads] Failed to cancel queued retries",c),0}},[a]);m.useEffect(()=>{if(a(),!j.isNativePlatform())return;const c=rr.subscribe(d=>{d.type==="quick-persisted"&&o(1),a()});return()=>{c(),s.current!==null&&window.clearTimeout(s.current)}},[a,o]);const l=e.total>0;return m.useEffect(()=>{if(!j.isNativePlatform()||!l)return;const c=window.setInterval(()=>{a()},2e3);return()=>window.clearInterval(c)},[l,a]),{...e,completed:n,cancelRetrying:i,hasActive:e.total>0||n>0}},Nv="/logos/LC_beeldmerkt_cirkel_orange.svg",Pv={xs:"h-6 w-6",sm:"h-8 w-8",md:"h-12 w-12",lg:"h-20 w-20"},qc=({className:e,logoClassName:t,size:n="md"})=>u.jsx("div",{className:G("flex h-full w-full items-center justify-center bg-[#FCF6E8]",e),"aria-hidden":"true",children:u.jsx("img",{src:Nv,alt:"",draggable:!1,
162className:G(Pv[n],"animate-[lc-loading-pulse_1.6s_ease-in-out_infinite]",t)})}),Cf=e=>e?"loading":"error",HP=({src:e,className:t,wrapperClassName:n,wrapperStyle:r,loaderClassName:s,loaderLogoClassName:o,loaderSize:a="md",suppressLoader:i=!1,onReady:l,onLoad:c,onError:d,...f})=>{const h=m.useRef(null),p=m.useRef(null),[g,y]=m.useState(()=>({src:e,status:Cf(e)})),v=g.src===e?g.status:Cf(e);m.useEffect(()=>{if(!e){p.current=null,y({src:e,status:"error"});return}const C=h.current;if(C!=null&&C.complete){const _=C.naturalWidth>0;y({src:e,status:_?"loaded":"error"}),_&&p.current!==e&&(p.current=e,l==null||l(C));return}y({src:e,status:"loading"})},[l,e]);const x=v!=="loaded";return u.jsxs("div",{className:G("relative h-full w-full overflow-hidden",n),style:r,children:[x&&!i&&u.jsx(qc,{className:G("absolute inset-0",s),logoClassName:o,size:a}),e&&v!=="error"&&u.jsx("img",{ref:h,...f,src:e,className:G("transition-opacity duration-200",v==="loaded"?"opacity-100":"opacity-0",t),onLoad:C=>{y({src:e,status:"loaded"}),e&&p.current!==e&&(p.current=e,l==null||l(C.currentTarget)),c==null||c(C)},onError:C=>{e&&p.current===e&&(p.current=null),y({src:e,status:"error"}),d==null||d(C)}})]})};function Oe(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e==null||e(s),n===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function _f(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function lo(...e){return t=>{let n=!1;const r=e.map(s=>{const o=_f(s,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let s=0;s<r.length;s++){const o=r[s];typeof o=="function"?o():_f(e[s],null)}}}}function Ke(...e){return m.useCallback(lo(...e),e)}function kv(e,t){const n=m.createContext(t),r=o=>{const{children:a,...i}=o,l=m.useMemo(()=>i,Object.values(i));return u.jsx(n.Provider,{value:l,children:a})};r.displayName=e+"Provider";function s(o){const a=m.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,s]}function co(e,t=[]){let n=[];function r(o,a){const i=m.createContext(a),l=n.length;n=[...n,a];const c=f=>{var x;const{scope:h,children:p,...g}=f,y=((x=h==null?void 0:h[e])==null?void 0:x[l])||i,v=m.useMemo(()=>g,Object.values(g));return u.jsx(y.Provider,{value:v,children:p})};c.displayName=o+"Provider";function d(f,h){var y;const p=((y=h==null?void 0:h[e])==null?void 0:y[l])||i,g=m.useContext(p);if(g)return g;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${o}\``)}return[c,d]}const s=()=>{const o=n.map(a=>m.createContext(a));return function(i){const l=(i==null?void 0:i[e])||o;return m.useMemo(()=>({[`__scope${e}`]:{...i,[e]:l}}),[i,l])}};return s.scopeName=e,[r,Iv(s,...t)]}function Iv(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const a=r.reduce((i,{useScope:l,scopeName:c})=>{const f=l(o)[`__scope${c}`];return{...i,...f}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}var Ln=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},Rv=xc[" useId ".trim().toString()]||(()=>{}),Tv=0;function Ds(e){const[t,n]=m.useState(Rv());return Ln(()=>{n(r=>r??String(Tv++))},[e]),e||(t?`radix-${t}`:"")}var Ov=xc[" useInsertionEffect ".trim().toString()]||Ln;function Qa({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,o,a]=jv({defaultProp:t,onChange:n}),i=e!==void 0,l=i?e:s;{const d=m.useRef(e!==void 0);m.useEffect(()=>{const f=d.current;f!==i&&console.warn(`${r} is changing from ${f?"controlled":"uncontrolled"} to ${i?"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=i},[i,r])}const c=m.useCallback(d=>{var f;if(i){const h=Lv(d)?d(e):d;h!==e&&((f=a.current)==null||f.call(a,h))}else o(d)},[i,e,o,a]);return[l,c]}function jv({defaultProp:e,onChange:t}){const[n,r]=m.useState(e),s=m.useRef(n),o=m.useRef(t);return Ov(()=>{o.current=t},[t]),m.useEffect(()=>{var a;s.current!==n&&((a=o.current)==null||a.call(o,n),s.current=n)},[n,s]),[n,r,o]}function Lv(e){return typeof e=="function"}function Mv(e){const t=Dv(e),n=m.forwardRef((r,s)=>{const{children:o,...a}=r,i=m.Children.toArray(o),l=i.find(Uv);if(l){const c=l.props.children,d=i.map(f=>f===l?m.Children.count(c)>1?m.Children.only(null):m.isValidElement(c)?c.props.children:null:f);return u.jsx(t,{...a,ref:s,children:m.isValidElement(c)?m.cloneElement(c,void 0,d):null})}return u.jsx(t,{...a,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}function Dv(e){const t=m.forwardRef((n,r)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const a=$v(s),i=Bv(o,s.props);return s.type!==m.Fragment&&(i.ref=r?lo(r,a):a),m.cloneElement(s,i)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Fv=Symbol("radix.slottable");function Uv(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Fv}function Bv(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...i)=>{const l=o(...i);return s(...i),l}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}
vendor: 13,289 bytes, line 162
162:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function $v(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var zv=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Be=zv.reduce((e,t)=>{const n=Mv(`Primitive.${t}`),r=m.forwardRef((s,o)=>{const{asChild:a,...i}=s,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(l,{...i,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Vv(e,t){e&&Cc.flushSync(()=>e.dispatchEvent(t))}function es(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Hv(e,t=globalThis==null?void 0:globalThis.document){const n=es(e);m.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Wv="DismissableLayer",Fl="dismissableLayer.update",qv="dismissableLayer.pointerDownOutside",Gv="dismissableLayer.focusOutside",Ef,vm=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ya=m.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:a,onDismiss:i,...l}=e,c=m.useContext(vm),[d,f]=m.useState(null),h=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=m.useState({}),g=Ke(t,N=>f(N)),y=Array.from(c.layers),[v]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),x=y.indexOf(v),C=d?y.indexOf(d):-1,_=c.layersWithOutsidePointerEventsDisabled.size>0,b=C>=x,w=Yv(N=>{const E=N.target,A=[...c.branches].some(k=>k.contains(E));!b||A||(s==null||s(N),a==null||a(N),N.defaultPrevented||i==null||i())},h),P=Xv(N=>{const E=N.target;[...c.branches].some(k=>k.contains(E))||(o==null||o(N),a==null||a(N),N.defaultPrevented||i==null||i())},h);return Hv(N=>{C===c.layers.size-1&&(r==null||r(N),!N.defaultPrevented&&i&&(N.preventDefault(),i()))},h),m.useEffect(()=>{if(d)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Ef=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(d)),c.layers.add(d),Sf(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=Ef)}},[d,h,n,c]),m.useEffect(()=>()=>{d&&(c.layers.delete(d),c.layersWithOutsidePointerEventsDisabled.delete(d),Sf())},[d,c]),m.useEffect(()=>{const N=()=>p({});return document.addEventListener(Fl,N),()=>document.removeEventListener(Fl,N)},[]),u.jsx(Be.div,{...l,ref:g,style:{pointerEvents:_?b?"auto":"none":void 0,...e.style},onFocusCapture:Oe(e.onFocusCapture,P.onFocusCapture),onBlurCapture:Oe(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:Oe(e.onPointerDownCapture,w.onPointerDownCapture)})});Ya.displayName=Wv;var Kv="DismissableLayerBranch",Qv=m.forwardRef((e,t)=>{const n=m.useContext(vm),r=m.useRef(null),s=Ke(t,r);return m.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),u.jsx(Be.div,{...e,ref:s})});Qv.displayName=Kv;function Yv(e,t=globalThis==null?void 0:globalThis.document){const n=es(e),r=m.useRef(!1),s=m.useRef(()=>{});return m.useEffect(()=>{const o=i=>{if(i.target&&!r.current){let l=function(){bm(qv,n,c,{discrete:!0})};const c={originalEvent:i};i.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=l,t.addEventListener("click",s.current,{once:!0})):l()}else t.removeEventListener("click",s.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",o),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Xv(e,t=globalThis==null?void 0:globalThis.document){const n=es(e),r=m.useRef(!1);return m.useEffect(()=>{const s=o=>{o.target&&!r.current&&bm(Gv,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Sf(){const e=new CustomEvent(Fl);document.dispatchEvent(e)}function bm(e,t,n,{discrete:r}){const s=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?Vv(s,o):s.dispatchEvent(o)}var Oi="focusScope.autoFocusOnMount",ji="focusScope.autoFocusOnUnmount",Af={bubbles:!1,cancelable:!0},Zv="FocusScope",Gc=m.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...a}=e,[i,l]=m.useState(null),c=es(s),d=es(o),f=m.useRef(null),h=Ke(t,y=>l(y)),p=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(r){let y=function(_){if(p.paused||!i)return;const b=_.target;i.contains(b)?f.current=b:vn(f.current,{select:!0})},v=function(_){if(p.paused||!i)return;const b=_.relatedTarget;b!==null&&(i.contains(b)||vn(f.current,{select:!0}))},x=function(_){if(document.activeElement===document.body)for(const w of _)w.removedNodes.length>0&&vn(i)};document.addEventListener("focusin",y),document.addEventListener("focusout",v);const C=new MutationObserver(x);return i&&C.observe(i,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",v),C.disconnect()}}},[r,i,p.paused]),m.useEffect(()=>{if(i){Pf.add(p);const y=document.activeElement;if(!i.contains(y)){const x=new CustomEvent(Oi,Af);i.addEventListener(Oi,c),i.dispatchEvent(x),x.defaultPrevented||(Jv(sb(wm(i)),{select:!0}),document.activeElement===y&&vn(i))}return()=>{i.removeEventListener(Oi,c),setTimeout(()=>{const x=new CustomEvent(ji,Af);i.addEventListener(ji,d),i.dispatchEvent(x),x.defaultPrevented||vn(y??document.body,{select:!0}),i.removeEventListener(ji,d),Pf.remove(p)},0)}}},[i,c,d,p]);const g=m.useCallback(y=>{if(!n&&!r||p.paused)return;const v=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,x=document.activeElement;if(v&&x){const C=y.currentTarget,[_,b]=eb(C);_&&b?!y.shiftKey&&x===b?(y.preventDefault(),n&&vn(_,{select:!0})):y.shiftKey&&x===_&&(y.preventDefault(),n&&vn(b,{select:!0})):x===C&&y.preventDefault()}},[n,r,p.paused]);return u.jsx(Be.div,{tabIndex:-1,...a,ref:h,onKeyDown:g})});Gc.displayName=Zv;function Jv(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(vn(r,{select:t}),document.activeElement!==n)return}function eb(e){const t=wm(e),n=Nf(t,e),r=Nf(t.reverse(),e);return[n,r]}function wm(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Nf(e,t){for(const n of e)if(!tb(n,{upTo:t}))return n}function tb(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function nb(e){return e instanceof HTMLInputElement&&"select"in e}function vn(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&nb(e)&&t&&e.select()}}var Pf=rb();function rb(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=kf(e,t),e.unshift(t)},remove(t){var n;e=kf(e,t),(n=e[0])==null||n.resume()}}}function kf(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function sb(e){return e.filter(t=>t.tagName!=="A")}var ob="Portal",Kc=m.forwardRef((e,t)=>{var i;const{container:n,...r}=e,[s,o]=m.useState(!1);Ln(()=>o(!0),[]);const a=n||s&&((i=globalThis==null?void 0:globalThis.document)==null?void 0:i.body);return a?S1.createPortal(u.jsx(Be.div,{...r,ref:t}),a):null});Kc.displayName=ob;function ab(e,t){return m.useReducer((n,r)=>t[n][r]??n,e)}var pr=e=>{const{present:t,children:n}=e,r=ib(t),s=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),o=Ke(r.ref,lb(s));return typeof n=="function"||r.isPresent?m.cloneElement(s,{ref:o}):null};pr.displayName="Presence";function ib(e){const[t,n]=m.useState(),r=m.useRef(null),s=m.useRef(e),o=m.useRef("none"),a=e?"mounted":"unmounted",[i,l]=ab(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const c=Io(r.current);o.current=i==="mounted"?c:"none"},[i]),Ln(()=>{const c=r.current,d=s.current;if(d!==e){const h=o.current,p=Io(c);e?l("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(d&&h!==p?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,l]),Ln(()=>{if(t){let c;const d=t.ownerDocument.defaultView??window,f=p=>{const y=Io(r.current).includes(CSS.escape(p.animationName));if(p.target===t&&y&&(l("ANIMATION_END"),!s.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",c=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},h=p=>{p.target===t&&(o.current=Io(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{d.clearTimeout(c),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:m.useCallback(c=>{r.current=c?getComputedStyle(c):null,n(c)},[])}}function Io(e){return(e==null?void 0:e.animationName)||"none"}function lb(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Li=0;function xm(){m.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??If()),document.body.insertAdjacentElement("beforeend",e[1]??If()),Li++,()=>{Li===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Li--}},[])}function If(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var jt=function(){return jt=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},jt.apply(this,arguments)};function Cm(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function cb(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,o;r<s;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var Qo="right-scroll-bar-position",Yo="width-before-scroll-bar",ub="with-scroll-bars-hidden",db="--removed-body-scroll-bar-size";function Mi(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function fb(e,t){var n=m.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=t,n.facade}var hb=typeof window<"u"?m.useLayoutEffect:m.useEffect,Rf=new WeakMap;function pb(e,t){var n=fb(null,function(r){return e.forEach(function(s){return Mi(s,r)})});return hb(function(){var r=Rf.get(n);if(r){var s=new Set(r),o=new Set(e),a=n.current;s.forEach(function(i){o.has(i)||Mi(i,null)}),o.forEach(function(i){s.has(i)||Mi(i,a)})}Rf.set(n,e)},[e]),n}function mb(e){return e}function gb(e,t){t===void 0&&(t=mb);var n=[],r=!1,s={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var a=t(o,r);return n.push(a),function(){n=n.filter(function(i){return i!==a})}},assignSyncMedium:function(o){for(r=!0;n.length;){var a=n;n=[],a.forEach(o)}n={push:function(i){return o(i)},filter:function(){return n}}},assignMedium:function(o){r=!0;var a=[];if(n.length){var i=n;n=[],i.forEach(o),a=n}var l=function(){var d=a;a=[],d.forEach(o)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(d){a.push(d),c()},filter:function(d){return a=a.filter(d),n}}}};return s}function yb(e){e===void 0&&(e={});var t=gb(null);return t.options=jt({async:!0,ssr:!1},e),t}var _m=function(e){var t=e.sideCar,n=Cm(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");
vendor: 9,409 bytes, lines 162-202
162return m.createElement(r,jt({},n))};_m.isSideCarExport=!0;function vb(e,t){return e.useMedium(t),_m}var Em=yb(),Di=function(){},Xa=m.forwardRef(function(e,t){var n=m.useRef(null),r=m.useState({onScrollCapture:Di,onWheelCapture:Di,onTouchMoveCapture:Di}),s=r[0],o=r[1],a=e.forwardProps,i=e.children,l=e.className,c=e.removeScrollBar,d=e.enabled,f=e.shards,h=e.sideCar,p=e.noRelative,g=e.noIsolation,y=e.inert,v=e.allowPinchZoom,x=e.as,C=x===void 0?"div":x,_=e.gapMode,b=Cm(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),w=h,P=pb([n,t]),N=jt(jt({},b),s);return m.createElement(m.Fragment,null,d&&m.createElement(w,{sideCar:Em,removeScrollBar:c,shards:f,noRelative:p,noIsolation:g,inert:y,setCallbacks:o,allowPinchZoom:!!v,lockRef:n,gapMode:_}),a?m.cloneElement(m.Children.only(i),jt(jt({},N),{ref:P})):m.createElement(C,jt({},N,{className:l,ref:P}),i))});Xa.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Xa.classNames={fullWidth:Yo,zeroRight:Qo};var bb=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function wb(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=bb();return t&&e.setAttribute("nonce",t),e}function xb(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Cb(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var _b=function(){var e=0,t=null;return{add:function(n){e==0&&(t=wb())&&(xb(t,n),Cb(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Eb=function(){var e=_b();return function(t,n){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Sm=function(){var e=Eb(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},Sb={left:0,top:0,right:0,gap:0},Fi=function(e){return parseInt(e||"",10)||0},Ab=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[Fi(n),Fi(r),Fi(s)]},Nb=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Sb;var t=Ab(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Pb=Sm(),Dr="data-scroll-locked",kb=function(e,t,n,r){var s=e.left,o=e.top,a=e.right,i=e.gap;return n===void 0&&(n="margin"),`
163  .`.concat(ub,` {
164   overflow: hidden `).concat(r,`;
165   padding-right: `).concat(i,"px ").concat(r,`;
166  }
167  body[`).concat(Dr,`] {
168    overflow: hidden `).concat(r,`;
169    overscroll-behavior: contain;
170    `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
171    padding-left: `.concat(s,`px;
172    padding-top: `).concat(o,`px;
173    padding-right: `).concat(a,`px;
174    margin-left:0;
175    margin-top:0;
176    margin-right: `).concat(i,"px ").concat(r,`;
177    `),n==="padding"&&"padding-right: ".concat(i,"px ").concat(r,";")].filter(Boolean).join(""),`
178  }
179  
180  .`).concat(Qo,` {
181    right: `).concat(i,"px ").concat(r,`;
182  }
183  
184  .`).concat(Yo,` {
185    margin-right: `).concat(i,"px ").concat(r,`;
186  }
187  
188  .`).concat(Qo," .").concat(Qo,` {
189    right: 0 `).concat(r,`;
190  }
191  
192  .`).concat(Yo," .").concat(Yo,` {
193    margin-right: 0 `).concat(r,`;
194  }
195  
196  body[`).concat(Dr,`] {
197    `).concat(db,": ").concat(i,`px;
198  }
199`)},Tf=function(){var e=parseInt(document.body.getAttribute(Dr)||"0",10);return isFinite(e)?e:0},Ib=function(){m.useEffect(function(){return document.body.setAttribute(Dr,(Tf()+1).toString()),function(){var e=Tf()-1;e<=0?document.body.removeAttribute(Dr):document.body.setAttribute(Dr,e.toString())}},[])},Rb=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;Ib();var o=m.useMemo(function(){return Nb(s)},[s]);return m.createElement(Pb,{styles:kb(o,!t,s,n?"":"!important")})},Ul=!1;if(typeof window<"u")try{var Ro=Object.defineProperty({},"passive",{get:function(){return Ul=!0,!0}});window.addEventListener("test",Ro,Ro),window.removeEventListener("test",Ro,Ro)}catch{Ul=!1}var Er=Ul?{passive:!1}:!1,Tb=function(e){return e.tagName==="TEXTAREA"},Am=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Tb(e)&&n[t]==="visible")},Ob=function(e){return Am(e,"overflowY")},jb=function(e){return Am(e,"overflowX")},Of=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=Nm(e,r);if(s){var o=Pm(e,r),a=o[1],i=o[2];if(a>i)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Lb=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Mb=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Nm=function(e,t){return e==="v"?Ob(t):jb(t)},Pm=function(e,t){return e==="v"?Lb(t):Mb(t)},Db=function(e,t){return e==="h"&&t==="rtl"?-1:1},Fb=function(e,t,n,r,s){var o=Db(e,window.getComputedStyle(t).direction),a=o*r,i=n.target,l=t.contains(i),c=!1,d=a>0,f=0,h=0;do{if(!i)break;var p=Pm(e,i),g=p[0],y=p[1],v=p[2],x=y-v-o*g;(g||x)&&Nm(e,i)&&(f+=x,h+=g);var C=i.parentNode;i=C&&C.nodeType===Node.DOCUMENT_FRAGMENT_NODE?C.host:C}while(!l&&i!==document.body||l&&(t.contains(i)||t===i));return(d&&Math.abs(f)<1||!d&&Math.abs(h)<1)&&(c=!0),c},To=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},jf=function(e){return[e.deltaX,e.deltaY]},Lf=function(e){return e&&"current"in e?e.current:e},Ub=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Bb=function(e){return`
200  .block-interactivity-`.concat(e,` {pointer-events: none;}
201  .allow-interactivity-`).concat(e,` {pointer-events: all;}
202`)},$b=0,Sr=[];function zb(e){var t=m.useRef([]),n=m.useRef([0,0]),r=m.useRef(),s=m.useState($b++)[0],o=m.useState(Sm)[0],a=m.useRef(e);m.useEffect(function(){a.current=e},[e]),m.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var y=cb([e.lockRef.current],(e.shards||[]).map(Lf),!0).filter(Boolean);return y.forEach(function(v){return v.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),y.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var i=m.useCallback(function(y,v){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!a.current.allowPinchZoom;var x=To(y),C=n.current,_="deltaX"in y?y.deltaX:C[0]-x[0],b="deltaY"in y?y.deltaY:C[1]-x[1],w,P=y.target,N=Math.abs(_)>Math.abs(b)?"h":"v";if("touches"in y&&N==="h"&&P.type==="range")return!1;var E=window.getSelection(),A=E&&E.anchorNode,k=A?A===P||A.contains(P):!1;if(k)return!1;var T=Of(N,P);if(!T)return!0;if(T?w=N:(w=N==="v"?"h":"v",T=Of(N,P)),!T)return!1;if(!r.current&&"changedTouches"in y&&(_||b)&&(r.current=w),!w)return!0;var I=r.current||w;return Fb(I,v,y,I==="h"?_:b)},[]),l=m.useCallback(function(y){var v=y;if(!(!Sr.length||Sr[Sr.length-1]!==o)){var x="deltaY"in v?jf(v):To(v),C=t.current.filter(function(w){return w.name===v.type&&(w.target===v.target||v.target===w.shadowParent)&&Ub(w.delta,x)})[0];if(C&&C.should){v.cancelable&&v.preventDefault();return}if(!C){var _=(a.current.shards||[]).map(Lf).filter(Boolean).filter(function(w){return w.contains(v.target)}),b=_.length>0?i(v,_[0]):!a.current.noIsolation;b&&v.cancelable&&v.preventDefault()}}},[]),c=m.useCallback(function(y,v,x,C){var _={name:y,delta:v,target:x,should:C,shadowParent:Vb(x)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(b){return b!==_})},1)},[]),d=m.useCallback(function(y){n.current=To(y),r.current=void 0},[]),f=m.useCallback(function(y){c(y.type,jf(y),y.target,i(y,e.lockRef.current))},[]),h=m.useCallback(function(y){c(y.type,To(y),y.target,i(y,e.lockRef.current))},[]);m.useEffect(function(){return Sr.push(o),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",l,Er),document.addEventListener("touchmove",l,Er),document.addEventListener("touchstart",d,Er),function(){Sr=Sr.filter(function(y){return y!==o}),document.removeEventListener("wheel",l,Er),document.removeEventListener("touchmove",l,Er),document.removeEventListener("touchstart",d,Er)}},[]);var p=e.removeScrollBar,g=e.inert;return m.createElement(m.Fragment,null,g?m.createElement(o,{styles:Bb(s)}):null,p?m.createElement(Rb,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Vb(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Hb=vb(Em,zb);var Qc=m.forwardRef(function(e,t){return m.createElement(Xa,jt({},e,{ref:t,sideCar:Hb}))});Qc.classNames=Xa.classNames;var Wb=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ar=new WeakMap,Oo=new WeakMap,jo={},Ui=0,km=function(e){return e&&(e.host||km(e.parentNode))},qb=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=km(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Gb=function(e,t,n,r){var s=qb(t,Array.isArray(e)?e:[e]);jo[n]||(jo[n]=new WeakMap);var o=jo[n],a=[],i=new Set,l=new Set(s),c=function(f){!f||i.has(f)||(i.add(f),c(f.parentNode))};
vendor: 8,442 bytes, lines 202-206
202s.forEach(c);var d=function(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,function(h){if(i.has(h))d(h);else try{var p=h.getAttribute(r),g=p!==null&&p!=="false",y=(Ar.get(h)||0)+1,v=(o.get(h)||0)+1;Ar.set(h,y),o.set(h,v),a.push(h),y===1&&g&&Oo.set(h,!0),v===1&&h.setAttribute(n,"true"),g||h.setAttribute(r,"true")}catch(x){console.error("aria-hidden: cannot operate on ",h,x)}})};return d(t),i.clear(),Ui++,function(){a.forEach(function(f){var h=Ar.get(f)-1,p=o.get(f)-1;Ar.set(f,h),o.set(f,p),h||(Oo.has(f)||f.removeAttribute(r),Oo.delete(f)),p||f.removeAttribute(n)}),Ui--,Ui||(Ar=new WeakMap,Ar=new WeakMap,Oo=new WeakMap,jo={})}},Im=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=Wb(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),Gb(r,s,n,"aria-hidden")):function(){return null}};function Kb(e){const t=Qb(e),n=m.forwardRef((r,s)=>{const{children:o,...a}=r,i=m.Children.toArray(o),l=i.find(Xb);if(l){const c=l.props.children,d=i.map(f=>f===l?m.Children.count(c)>1?m.Children.only(null):m.isValidElement(c)?c.props.children:null:f);return u.jsx(t,{...a,ref:s,children:m.isValidElement(c)?m.cloneElement(c,void 0,d):null})}return u.jsx(t,{...a,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}function Qb(e){const t=m.forwardRef((n,r)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const a=Jb(s),i=Zb(o,s.props);return s.type!==m.Fragment&&(i.ref=r?lo(r,a):a),m.cloneElement(s,i)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Yb=Symbol("radix.slottable");function Xb(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Yb}function Zb(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...i)=>{const l=o(...i);return s(...i),l}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function Jb(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Za="Dialog",[Rm,WP]=co(Za),[e8,xt]=Rm(Za),Tm=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:o,modal:a=!0}=e,i=m.useRef(null),l=m.useRef(null),[c,d]=Qa({prop:r,defaultProp:s??!1,onChange:o,caller:Za});return u.jsx(e8,{scope:t,triggerRef:i,contentRef:l,contentId:Ds(),titleId:Ds(),descriptionId:Ds(),open:c,onOpenChange:d,onOpenToggle:m.useCallback(()=>d(f=>!f),[d]),modal:a,children:n})};Tm.displayName=Za;var Om="DialogTrigger",jm=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=xt(Om,n),o=Ke(t,s.triggerRef);return u.jsx(Be.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Zc(s.open),...r,ref:o,onClick:Oe(e.onClick,s.onOpenToggle)})});jm.displayName=Om;var Yc="DialogPortal",[t8,Lm]=Rm(Yc,{forceMount:void 0}),Mm=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,o=xt(Yc,t);return u.jsx(t8,{scope:t,forceMount:n,children:m.Children.map(r,a=>u.jsx(pr,{present:n||o.open,children:u.jsx(Kc,{asChild:!0,container:s,children:a})}))})};Mm.displayName=Yc;var ya="DialogOverlay",Dm=m.forwardRef((e,t)=>{const n=Lm(ya,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=xt(ya,e.__scopeDialog);return o.modal?u.jsx(pr,{present:r||o.open,children:u.jsx(r8,{...s,ref:t})}):null});Dm.displayName=ya;var n8=Kb("DialogOverlay.RemoveScroll"),r8=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=xt(ya,n);return u.jsx(Qc,{as:n8,allowPinchZoom:!0,shards:[s.contentRef],children:u.jsx(Be.div,{"data-state":Zc(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),ur="DialogContent",Fm=m.forwardRef((e,t)=>{const n=Lm(ur,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=xt(ur,e.__scopeDialog);return u.jsx(pr,{present:r||o.open,children:o.modal?u.jsx(s8,{...s,ref:t}):u.jsx(o8,{...s,ref:t})})});Fm.displayName=ur;var s8=m.forwardRef((e,t)=>{const n=xt(ur,e.__scopeDialog),r=m.useRef(null),s=Ke(t,n.contentRef,r);return m.useEffect(()=>{const o=r.current;if(o)return Im(o)},[]),u.jsx(Um,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Oe(e.onCloseAutoFocus,o=>{var a;o.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Oe(e.onPointerDownOutside,o=>{const a=o.detail.originalEvent,i=a.button===0&&a.ctrlKey===!0;(a.button===2||i)&&o.preventDefault()}),onFocusOutside:Oe(e.onFocusOutside,o=>o.preventDefault())})}),o8=m.forwardRef((e,t)=>{const n=xt(ur,e.__scopeDialog),r=m.useRef(!1),s=m.useRef(!1);return u.jsx(Um,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var a,i;(a=e.onCloseAutoFocus)==null||a.call(e,o),o.defaultPrevented||(r.current||(i=n.triggerRef.current)==null||i.focus(),o.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:o=>{var l,c;(l=e.onInteractOutside)==null||l.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=o.target;((c=n.triggerRef.current)==null?void 0:c.contains(a))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),Um=m.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:o,...a}=e,i=xt(ur,n),l=m.useRef(null),c=Ke(t,l);return xm(),u.jsxs(u.Fragment,{children:[u.jsx(Gc,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:o,children:u.jsx(Ya,{role:"dialog",id:i.contentId,"aria-describedby":i.descriptionId,"aria-labelledby":i.titleId,"data-state":Zc(i.open),...a,ref:c,onDismiss:()=>i.onOpenChange(!1)})}),u.jsxs(u.Fragment,{children:[u.jsx(a8,{titleId:i.titleId}),u.jsx(l8,{contentRef:l,descriptionId:i.descriptionId})]})]})}),Xc="DialogTitle",Bm=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=xt(Xc,n);return u.jsx(Be.h2,{id:s.titleId,...r,ref:t})});Bm.displayName=Xc;var $m="DialogDescription",zm=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=xt($m,n);return u.jsx(Be.p,{id:s.descriptionId,...r,ref:t})});zm.displayName=$m;var Vm="DialogClose",Hm=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=xt(Vm,n);return u.jsx(Be.button,{type:"button",...r,ref:t,onClick:Oe(e.onClick,()=>s.onOpenChange(!1))})});Hm.displayName=Vm;function Zc(e){return e?"open":"closed"}var Wm="DialogTitleWarning",[qP,qm]=kv(Wm,{contentName:ur,titleName:Xc,docsSlug:"dialog"}),a8=({titleId:e})=>{const t=qm(Wm),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
203
204If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
205
206For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return m.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},i8="DialogDescriptionWarning",l8=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${qm(i8).contentName}}.`;return m.useEffect(()=>{var o;const s=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},c8=Tm,GP=jm,u8=Mm,Jc=Dm,eu=Fm,va=Bm,Gm=zm,d8=Hm;const f8=c8,Km=u8,Qm=m.forwardRef(({className:e,...t},n)=>u.jsx(Jc,{ref:n,className:G("fixed inset-0 z-50 bg-gray-900/70 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Qm.displayName=Jc.displayName;const h8=m.forwardRef(({className:e,children:t,onOpenAutoFocus:n,...r},s)=>u.jsxs(Km,{children:[u.jsx(Qm,{}),u.jsxs(eu,{ref:s,className:G("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%] rounded-lg",e),onOpenAutoFocus:n||(o=>o.preventDefault()),...r,children:[t,u.jsxs(d8,{className:"absolute right-4 top-4 roun
206ded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[u.jsx(cr,{className:"h-4 w-4"}),u.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));h8.displayName=eu.displayName;const p8=({className:e,...t})=>u.jsx("div",{className:G("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});p8.displayName="DialogHeader";const m8=m.forwardRef(({className:e,...t},n)=>u.jsx(va,{ref:n,className:G("text-lg font-semibold leading-none tracking-tight",e),...t}));m8.displayName=va.displayName;const g8=m.forwardRef(({className:e,...t},n)=>u.jsx(Gm,{ref:n,className:G("text-sm text-muted-foreground",e),...t}));g8.displayName=Gm.displayName;const y8="M0.00147778 42.5382C-0.0105162 41.5227 0.0543361 40.0894 0.0577524 38.8915C0.0727493 33.8735 0.117705 32.0141 0.143202 27.4738C0.181074 20.7419 0.0958364 0.762218 0.546387 0.761719C0.546398 0.761719 0.54641 0.761719 0.546421 0.761719C0.550838 0.761724 0.555307 0.763652 0.559829 0.767525C0.645663 0.837558 0.739367 2.53691 0.836441 2.78911C0.933551 3.04088 1.56048 2.85209 1.59572 5.2657C1.64217 8.76528 1.48142 17.1603 1.48854 19.0267C1.49345 20.3028 1.55044 21.8738 1.56056 23.5054C1.59318 28.7663 1.5515 31.5191 1.70632 36.2589C1.62473 38.1548 1.54315 40.0507 1.46156 41.9467C1.49939 44.4203 1.3918 48.1694 1.39772 49.6722C1.4026 50.9051 1.46711 51.6276 1.47011 52.9126C1.47384 54.3538 1.4042 56.5671 1.41469 59.1886C1.43156 63.4863 1.59986 64.251 1.62123 66.8296C1.6345 68.4334 1.6069 70.5713 1.59547 72.7617L1 72.1663C2.46171 72.1739 3.94675 72.1743 5.31232 72.1506C5.74026 72.1321 6.1682 72.1136 6.59613 72.0951C6.28954 72.0532 5.98294 72.0113 5.67634 71.9695C7.39484 71.95 8.13391 72.0358 9.71299 72.0373C11.5711 72.0392 12.5188 71.9579 13.7692 71.9582C14.7933 71.9586 16.1821 72.0238 17.51 72.0198C19.4462 72.0141 19.0228 71.92 20.0646 71.9023C20.4804 71.8955 28.1659 71.8435 28.5995 71.8428C31.8971 71.839 32.1843 71.968 34.8137 71.9792C42.1068 72.01 49.5933 71.9058 56.3393 71.8664C59.3516 71.8488 62.4947 71.8563 65.4982 71.8769C60.7673 72.2069 71.237 72.4636 67.3215 71.9474C70.6633 72.0208 73.0328 71.8814 76.2009 71.905C78.2499 71.9204 79.668 71.992 82.5939 71.9901C87.7854 71.9863 93.4642 71.7828 94.9574 72.1506C101.052 72.0858 106.33 72.2192 108.527 71.8945C110.098 71.8747 114.126 72.0681 115.888 72.0943C117.555 72.1191 130.345 72.2064 132.438 72.2113C134.53 72.2162 138.193 72.2215 139.955 72.193C142.169 72.1577 143.716 71.821 147.658 72.2147C152.241 72.1828 153.874 72.1941 158.137 72.2399C158.908 72.2481 158.996 72.3066 159.446 72.3066C160.375 72.3066 161.955 72.2634 163.613 72.2582C166.339 72.2495 167.895 72.3725 167.591 72.1847C169.389 72.1532 171.186 72.1217 172.983 72.0902C173.614 72.1264 174.244 72.1627 174.875 72.199C175.836 72.1594 176.797 72.1199 177.758 72.0804C176.629 72.3523 183.392 72.1918 181.196 72.0359C184.68 72.0921 188.165 72.1483 191.649 72.2046C191.162 72.5135 199.299 72.2402 198.614 72.0723C199.012 72.0725 199.411 72.0727 199.81 72.073C203.3 72.1551 206.505 72.0879 210.759 72.1431C215.013 72.1982 214.614 72.2282 215.908 72.3703C216.909 72.3622 217.91 72.3541 218.911 72.3459C224.163 71.9564 223.235 72.6308 232.23 72.332C235.104 72.5769 242.188 72.4482 246.885 72.374C247.431 72.3654 247.44 72.3179 248.168 72.3032C249.948 72.268 254.489 72.3291 254.334 72.1758C255.906 72.2201 257.478 72.2645 259.05 72.3088C260.335 72.281 261.62 72.2531 262.904 72.2252C262.898 72.1774 262.891 72.1295 262.885 72.0816C265.472 72.2447 269.538 72.1821 271.543 72.2211C271.942 72.229 272.029 72.295 273.269 72.313C274.719 72.3343 277.421 72.3148 279.149 72.3354C279.82 72.2623 280.492 72.1892 281.164 72.1161C284.253 72.0764 285.339 72.2694 287.154 72.2844C287.48 72.287 293.44 72.2731 293.761 72.269C296.39 72.2364 295.645 72.0719 303.248 72.1072C304.602 72.1135 305.697 72.1704 306.921 72.1727C309.083 72.1768 315.597 72.0478 316.109 71.9286C318.731 72.0778 325.746 72.0168 327.813 72.0599C328.436 72.0732 328.577 72.1682 330.494 72.1885C332.048 72.205 336.05 72.1288 338.021 72.1416C340.114 72.1555 340.861 72.2353 341.798 72.241C342.684 72.2462 343.5 72.1817 344.707 72.1821C348.474 72.1844 351.886 72.2881 354.864 72.29C354.909 72.2901 354.955 72.2901 355 72.2901L354.528 72.7617C354.527 68.5114 354.34 64.7497 354.256 61.1847C354.268 60.2904 354.309 59.4117 354.309 58.4741C354.315 46.8751 354.351 33.7907 354.391 22.1571C354.41 16.7564 354.669 3.32617 354.237 6.91079C354.208 6.18407 354.216 3.69281 354.237 0.761719L355 1.52465C350.361 1.49115 344.62 1.42509 343.03 1.42348C340.435 1.42088 338.377 1.49839 336.338 1.49953C33
2060.182 1.5029 325.847 1.44705 318.355 1.51454C316.419 1.53219 314.346 1.62401 313.2 1.62294C311.82 1.62144 310.334 1.53264 308.546 1.52699C304.283 1.51425 296.339 1.54346 292.25 1.52809C291.503 1.52509 291.241 1.44712 290.173 1.42275C286.014 1.32752 281.353 1.33578 282.177 1.58473C276.847 1.44339 271.916 1.57232 266.977 1.58022C256.532 1.59634 237.506 1.53823 228.407 1.64284C222.67 1.70883 222.817 1.82049 214.37 1.72414C212.495 1.70277 210.628 1.67395 208.354 1.64845C203.023 1.58847 198.133 1.38219 194.07 1.63075C188.149 1.56629 183.434 1.61201 179.041 1.39943C178.523 1.45042 178.005 1.5014 177.488 1.55239C176.762 1.55365 176.036 1.55491 175.31 1.55617C175.084 1.50754 174.857 1.45892 174.631 1.4103C169.431 1.3972 162.834 1.59706 158.432 1.5956C151.052 1.59335 132.045 1.51571 125.047 1.45009C121.332 1.41525 121.132 1.51939 119.005 1.30531C118.174 1.32021 117.343 1.3351 116.512 1.34999C115.992 1.39687 115.472 1.44374 114.952 1.49062C110.186 1.49249 104.532 1.41968 99.9915 1.42043C91.7175 1.42193 79.2929 1.55094 70.9841 1.4662C68.9007 1.44484 66.2965 1.34817 64.2563 1.34926C61.287 1.35076 60.5654 1.51118 56.7973 1.51418C50.303 1.51905 38.2086 1.33269 32.0703 1.34694C30.2472 1.35107 29.3965 1.41076 28.1377 1.41713C22.8589 1.4445 18.525 1.43964 13.4633 1.53188C8.02839 1.37815 8.49791 1.17973 6.81358 0.979508C5.5371 0.828393 1.62298 0.478188 1.06735 0.345839C0.677056 0.252857 2.13429 0.133247 1.58737 0.0308974C8.09892 -0.050838 10.8345 0.0391419 16.1219 0.183119C25.8864 0.177382 35.6509 0.171645 45.4154 0.165907C46.3037 0.221775 47.1921 0.277643 48.0805 0.33351C48.0805 0.333632 48.0805 0.333754 48.0805 0.333877C51.8304 0.398352 53.4196 0.254475 55.442 0.221816C74.8032 -0.0908871 112.91 0.153856 134.225 0.189101C138.818 0.196597 153.759 0.121315 156.911 0.21205C157.727 0.235681 157.954 0.321827 158.822 0.325576C166.578 0.274347 174.334 0.223118 182.09 0.171889C198.039 0.305743 214.527 0.195196 230.598 0.174574C272.421 0.120838 313.842 0.0559621 355 0.0694472L355.691 0.067826L355.692 0.761719C355.692 2.39255 355.691 4.02297 355.69 5.65299C355.686 13.9184 355.751 24.4073 355.709 32.499C355.692 35.8761 355.553 37.2832 355.657 41.7197C355.619 41.7662 355.582 41.8128 355.545 41.8594C355.59 45.731 355.675 48.2052 355.683 52.5458C355.69 56.2011 355.696 65.8719 355.682 69.102C355.674 70.7774 355.605 70.1532 355.605 71.7151C355.605 72.0256 355.607 72.3771 355.609 72.7617L355.611 73.3694L355 73.3709C352.073 73.3891 347.231 73.4643 343.969 73.4643C340.627 73.4643 334.991 73.3841 332.421 73.3957C323.166 73.437 313.085 73.5559 303.222 73.524C300.498 73.515 296.993 73.4247 296.14 73.4272C294.474 73.4325 293.977 73.5202 292.858 73.5315C287.171 73.5885 278.307 73.4842 272.733 73.4801C254.57 73.4666 235.328 73.5049 217.243 73.4888C205.818 73.4786 186.831 73.4941 176.282 73.4281C174.007 73.4138 174.614 73.3177 172.704 73.3177C170.586 73.3178 169.439 73.3827 168.449 73.3879C161.598 73.4247 146.475 73.4903 140.007 73.4239C138.775 73.4112 137.882 73.3359 137.144 73.3362C136.771 73.3362 135.927 73.3876 134.755 73.3928C124.406 73.4393 116.86 73.4093 106.72 73.3917C87.298 73.3583 64.7945 73.4539 44.3918 73.4022C39.9466 73.391 36.8981 73.242 36.273 73.2435C34.9013 73.2465 34.0233 73.3467 31.2451 73.3714C22.0842 73.4521 9.7727 73.3476 1 73.3949L0.368316 73.3964L0.366826 72.7617C0.366433 72.6887 0.366029 72.6159 0.365614 72.5434C0.340871 68.2028 0.2137 62.2381 0.18556 57.9665C0.163066 54.5549 0.212951 46.4976 0.157118 44.9855C0.123385 44.0655 0.0150412 43.6399 0.00147778 42.5382ZM85.7107 72.0737C85.103 72.2469 91.4904 72.103 89.0941 72.01C88.5545 71.9891 85.8678 72.0287 85.7107 72.0737ZM354.613 42.9515C354.563 43.01 354.514 43.0685 354.464 43.127C354.485 43.9655 354.506 44.804 354.526 45.6426C354.556 45.1713 354.586 44.7 354.615 44.2288C354.614 43.803 354.614 43.3772 354.613 42.9515Z",v8="M0.00147778 11.3529C-0.0105162 11.0955 0.0543361 10.7321 0.0577524 10.4284C0.0727493 9.15625 0.117705 8.68485 0.143202 7.5338C0.181074 5.8271 0.0958364 0.76185 0.546387 0.761719C0.546398 0.761719 0.54641 0.761719 0.546421 0.761719C0.550838 0.761716 0.555307 0.762207 0.559829 0.763192C0.645663 0.780946 0.739367 1.21176 0.836441 1.2757C0.933551 1.33954 1.56048 1.29166 1.59572 1.90358C1.64217 2.79079 1.48142 4.91909 1.48854 5.39229C1.49345 5.71579 1.55044 6.11406 1.56056 6.52773C1.593
20618 7.86148 1.5515 8.55937 1.70632 9.76101C1.62473 10.2417 1.54315 10.7223 1.46156 11.203C1.49939 11.8301 1.3918 12.7806 1.39772 13.1616C1.4026 13.4741 1.46711 13.6573 1.47011 13.9831C1.47384 14.3484 1.4042 14.9096 1.41469 15.5742C1.43156 16.6637 1.59986 16.8576 1.62123 17.5113C1.64335 18.1892 1.55188 19.2435 1.6111 20.1085C1.62961 20.217 1.64813 20.3255 1.66664 20.434C1.70851 20.3562 1.75038 20.2785 1.79225 20.2008C1.81174 20.6365 1.72594 20.8238 1.72438 21.2242C1.72251 21.6952 1.80386 21.9355 1.80348 22.2525C1.80311 22.5121 1.73787 22.8642 1.74196 23.2009C1.74758 23.6917 1.84177 23.5844 1.85939 23.8485C1.86624 23.9539 1.91821 25.9024 1.91896 26.0123C1.92268 26.8483 1.79376 26.9211 1.78249 27.5877C1.75174 29.4367 1.85591 31.3347 1.89528 33.0449C1.91289 33.8086 1.9054 34.6054 1.88478 35.3669C1.55485 34.1675 1.29807 36.8218 1.81435 35.8291C1.7409 36.6764 1.88027 37.2771 1.85671 38.0802C1.84133 38.5997 1.76975 38.9592 1.77162 39.701C1.77264 40.0533 1.78796 40.4144 1.8028 40.7617L1 39.9589C1.95015 39.9183 2.79648 39.8813 3.07369 40.1506C4.61875 40.0858 5.95694 40.2192 6.51379 39.8945C6.91223 39.8747 7.93325 40.0681 8.3801 40.0943C8.80272 40.1191 12.0453 40.2064 12.5758 40.2113C13.1063 40.2162 14.0349 40.2215 14.4816 40.193C15.0429 40.1577 15.4352 39.821 16.4345 40.2147C17.5964 40.1828 18.0103 40.1941 19.091 40.2399C19.2866 40.2481 19.3087 40.3066 19.423 40.3066C19.6585 40.3066 20.0591 40.2634 20.4794 40.2582C21.1705 40.2495 21.565 40.3725 21.4879 40.1847C21.9436 40.1532 22.3992 40.1217 22.8549 40.0902C23.0147 40.1264 23.1746 40.1627 23.3344 40.199C23.5781 40.1594 23.8217 40.1199 24.0653 40.0804C23.7792 40.3523 25.4938 40.1918 24.9371 40.0359C25.8204 40.0921 26.7037 40.1483 27.587 40.2046C27.4637 40.5135 29.5264 40.2402 29.3528 40.0723C29.4538 40.0725 29.5549 40.0727 29.656 40.073C30.5408 40.1551 31.3534 40.0879 32.432 40.1431C33.5104 40.1982 33.4092 40.2282 33.7371 40.3703C33.9909 40.3622 34.2447 40.3541 34.4985 40.3459C35.8302 39.9564 35.5948 40.6308 37.8752 40.332C38.6037 40.5769 40.3997 40.4482 41.5905 40.374C41.729 40.3654 41.7314 40.3179 41.9159 40.3032C42.3671 40.268 43.5184 40.3291 43.479 40.1758C43.8775 40.2201 44.2761 40.2645 44.6746 40.3088C45.0003 40.2809 45.3261 40.2531 45.6518 40.2252C45.6502 40.1774 45.6485 40.1295 45.6469 40.0816C46.3028 40.2447 47.3335 40.1821 47.842 40.2211C47.9431 40.229 47.965 40.295 48.2795 40.313C48.6471 40.3343 49.3321 40.3148 49.7701 40.3354C49.9404 40.2623 50.1107 40.1892 50.2809 40.1161C51.0642 40.0764 51.3396 40.2694 51.7995 40.2844C51.8824 40.287 53.3933 40.2731 53.4747 40.269C54.1411 40.2364 53.9523 40.0719 55.8799 40.1072C56.2231 40.1135 56.5007 40.1704 56.8109 40.1727C57.359 40.1768 59.0105 40.0478 59.1403 39.9286C59.8051 40.0778 61.5836 40.0168 62.1075 40.0599C62.2656 40.0732 62.3013 40.1682 62.7872 40.1885C63.1812 40.205 64.1959 40.1288 64.6956 40.1416C65.226 40.1555 65.4154 40.2353 65.653 40.241C65.8775 40.2462 66.0845 40.1817 66.3905 40.1821C67.3456 40.1844 68.2105 40.2881 68.9654 40.29C68.977 40.2901 68.9885 40.2901 69 40.2901L68.5283 40.7617C68.5273 39.6842 68.3396 38.7305 68.2557 37.8267C68.2681 37.6 68.3091 37.3772 68.3094 37.1395C68.3154 34.1989 68.3506 30.8818 68.3915 27.9324C68.4102 26.5632 68.6693 23.1583 68.237 24.0671C68.1613 23.5913 68.3356 20.1315 68.3382 19.4734C68.3408 18.8155 68.2633 18.294 68.2622 17.7769C68.2588 16.2163 68.3147 15.1174 68.2472 13.2178C68.2295 12.7272 68.1377 12.2015 68.1388 11.911C68.1403 11.5611 68.2291 11.1844 68.2347 10.7311C68.2475 9.65039 68.2183 7.63643 68.2336 6.59965C68.2366 6.41035 68.3146 6.34386 68.339 6.07312C68.4342 5.01882 68.4259 3.83704 68.177 4.04614C68.2969 2.8995 68.2223 1.82577 68.1921 0.761719L69 1.56966C68.81 1.57505 68.6204 1.57902 68.4307 1.58022C65.7827 1.59634 60.9593 1.53823 58.6526 1.64284C57.1981 1.70883 57.2353 1.82049 55.0938 1.72414C54.6184 1.70277 54.1452 1.67395 53.5686 1.64845C52.2172 1.58847 50.9774 1.38219 49.9473 1.63075C48.4463 1.56629 47.2509 1.61201 46.1372 1.39943C46.0059 1.45042 45.8746 1.5014 45.7433 1.55239C45.5593 1.55365 45.3753 1.55491 45.1913 1.55617C45.1339 1.50754 45.0765 1.45892 45.0191 1.4103C43.7008 1.3972 42.0282 1.59706 40.9124 1.5956C39.0414 1.59335 34.2226 1.51571 32.4485 1.45009C31.5066 1.41525 31.4559 1.51939 30.9167 1.30531C30.706 1.32021 30.4954 1.3351 30.2847 1.34999C30.1529 1.39687 30.021 1.44374 29.8892 1.49062C28.6808 1.49249 27.2476 1.41968 26.0964 1.42043C23.9988 1.42193 20.8489 1.55094 18.7425 1.4662C18.2143 1.44484 17.554 1.34817 17.0368 1.34926C16.284 1.35076 16.1011 1.51118 15.1458 1.51418C13.4994 1.51905 10.4332 1.33269 8.87698 1.34694C8.41478 1.35107 8.19912 1.41076 7.87997 1.41713C6.5417 1.4445 5.44297 1.43964 4.15972 1.53188C2.78185 1.37815 2.90088 1.17973 2.47386 0.979508C2.15025 0.828393 1.15794 0.478188 1.01
206708 0.345839C0.918127 0.252857 1.28757 0.133247 1.14891 0.0308974C2.79973 -0.050838 3.49326 0.0391419 4.83373 0.183119C7.30923 0.177382 9.78473 0.171645 12.2602 0.165907C12.4855 0.221775 12.7107 0.277643 12.9359 0.33351C12.9359 0.333632 12.9359 0.333754 12.9359 0.333877C13.8866 0.398352 14.2895 0.254475 14.8022 0.221816C19.7107 -0.0908871 29.3716 0.153856 34.7754 0.189101C35.9398 0.196597 39.7277 0.121315 40.5267 0.21205C40.7336 0.235681 40.7911 0.321827 41.0112 0.325576C42.9775 0.274347 44.9438 0.223118 46.9101 0.171889C50.9535 0.305743 55.1337 0.195196 59.2079 0.174574C62.4813 0.157985 65.745 0.140333 69 0.124253L69.6315 0.118406L69.6375 0.761719C69.6755 8.46788 69.7048 16.1255 69.6903 23.7482C69.6862 25.8437 69.7507 28.5028 69.7091 30.5543C69.6918 31.4104 69.5535 31.7672 69.6566 32.8919C69.6193 32.9037 69.5821 32.9155 69.5448 32.9273C69.5898 33.9089 69.6746 34.5361 69.6832 35.6366C69.6903 36.5633 69.6959 39.015 69.6816 39.8339C69.6745 40.2587 69.6049 40.1004 69.6052 40.4964C69.6053 40.5751 69.6068 40.6642 69.6092 40.7617L69.6147 41.3652L69 41.3709C68.2579 41.3891 67.0303 41.4643 66.2035 41.4643C65.356 41.4643 63.9274 41.3841 63.2759 41.3957C60.9295 41.437 58.3737 41.5559 55.8733 41.524C55.1825 41.515 54.2941 41.4247 54.0778 41.4272C53.6553 41.4325 53.5294 41.5202 53.2456 41.5315C51.804 41.5885 49.5567 41.4842 48.1435 41.4801C43.5388 41.4666 38.6607 41.5049 34.0758 41.4888C31.1792 41.4786 26.3655 41.4941 23.6912 41.4281C23.1145 41.4138 23.2683 41.3177 22.784 41.3177C22.2471 41.3178 21.9563 41.3827 21.7054 41.3879C19.9686 41.4247 16.1346 41.4903 14.4948 41.4239C14.1825 41.4112 13.9559 41.3359 13.7689 41.3362C13.6743 41.3362 13.4604 41.3876 13.1633 41.3928C10.5396 41.4393 8.62656 41.4093 6.05566 41.3917C4.43917 41.3808 2.73843 41.3837 1 41.3908L0.376825 41.3965L0.370947 40.7617C0.356483 37.205 0.32476 33.4903 0.359511 30.016C0.370759 28.889 0.519702 28.1162 0.518203 27.9577C0.515198 27.6099 0.415018 27.3873 0.390273 26.683C0.308935 24.3412 0.415836 21.1873 0.365614 18.9599C0.340871 17.8594 0.2137 16.3473 0.18556 15.2643C0.163066 14.3994 0.212951 12.3567 0.157118 11.9734C0.123385 11.7402 0.0150412 11.6322 0.00147778 11.3529ZM1.68801 40.4912C1.6321 40.4415 1.60923 40.5765 1.60702 40.7617L1 40.1547C1.38872 40.1593 1.99868 40.073 1.58724 40.01C1.50399 39.9973 1.2192 40.007 1 40.0266L1.73507 40.7617C1.72241 40.6207 1.70561 40.5068 1.68801 40.4912ZM68.6128 33.2042C68.5633 33.219 68.5138 33.2338 68.4643 33.2487C68.4849 33.4613 68.5055 33.6739 68.5261 33.8864C68.5559 33.767 68.5856 33.6475 68.6153 33.528C68.6145 33.4201 68.6136 33.3121 68.6128 33.2042Z",b8="M0.00147778 40.9691C-0.0105162 39.9918 0.0543361 38.6123 0.0577524 37.4594C0.0727493 32.6299 0.117705 30.8403 0.143202 26.4706C0.181074 19.9914 0.0958364 0.762196 0.546387 0.761719C0.546398 0.761719 0.54641 0.761719 0.546421 0.761719C0.550838 0.761721 0.555307 0.763584 0.559829 0.767306C0.645663 0.834716 0.739367 2.47024 0.836441 2.71296C0.933551 2.95529 1.56048 2.77357 1.59572 5.09654C1.64217 8.46468 1.48142 16.5443 1.48854 18.3407C1.49345 19.5688 1.55044 21.0808 1.56056 22.6512C1.59318 27.7145 1.5515 30.3639 1.70632 34.9257C1.62473 36.7504 1.54315 38.5751 1.46156 40.3998C1.49939 42.7805 1.3918 46.3888 1.39772 47.8352C1.4026 49.0218 1.46711 49.7172 1.47011 50.9539C1.47372 52.2981 1.40843 54.3404 1.41394 56.7617L1 56.3478C1.07712 56.3476 1.15455 56.3474 1.23242 56.347C5.36875 56.3302 6.10468 56.1619 8.58648 56.1405C11.1601 56.1184 15.1623 56.2098 18.4461 56.1506C18.858 56.1321 19.2698 56.1136 19.6817 56.0951C19.3866 56.0532 19.0916 56.0113 18.7965 55.9695C20.4504 55.95 21.1617 56.0358 22.6815 56.0373C24.4697 56.0392 25.3821 55.9579 26.5853 55.9582C27.571 55.9586 28.9076 56.0238 30.1857 56.0198C32.0491 56.0141 31.6416 55.9199 32.6444 55.9023C33.0445 55.8955 40.4413 55.8435 40.8587 55.8428C44.0324 55.839 44.3088 55.968 46.8395 55.9792C53.8587 56.01 61.0639 55.9058 67.5566 55.8664C70.4558 55.8488 73.4808 55.8563 76.3715 55.8769C71.8184 56.2069 81.8948 56.4636 78.1263 55.9474C81.3426 56.0208 83.6232 55.8814 86.6722 55.905C88.6442 55.9204 90.0091 55.992 92.8251 55.9901C97.8216 55.9863 103.287 55.7828 104.724 56.1506C110.59 56.0858 115.67 56.2192 117.784 55.8945C119.296 55.8747 123.173 56.0681 124.869 56.0943C126.473 56.1191 138.783 56.2064 140.797 56.2113C142.811 56.2162 146.336 56.2215 148.032 56.193C150.163 56.1577 151.652 55.821 155.446 56.2147C159.857 56.1828 161.428 56.1941 165.531 56.2399C166.273 56.2481 166.357 56.3066 166.791 56.3066C167.685 56.3066 169.206 56.2634 170.801 56.2582C173.425 56.2495 174.923 56.3725 174.63 56.1847C176.36 56.1532 178.09 56.1217 179.819 56.0902C180.426 56.1264 181.033 56.1627 181.64 56.199C182.565 56.1594 183.49 56.1199 184.415 56.0804C183.328 56.3523 189.838 56.1918 
206187.724 56.0359C191.077 56.0921 194.431 56.1483 197.784 56.2046C197.316 56.5135 205.147 56.2402 204.487 56.0723C204.871 56.0725 205.255 56.0727 205.638 56.073C208.998 56.1551 212.082 56.0879 216.177 56.1431C220.271 56.1982 219.887 56.2282 221.132 56.3703C222.095 56.3622 223.059 56.3541 224.022 56.3459C229.078 55.9564 228.184 56.6308 236.841 56.332C239.607 56.5769 246.425 56.4482 250.945 56.374C251.471 56.3654 251.48 56.3179 252.181 56.3032C253.894 56.268 258.264 56.3291 258.115 56.1758C259.628 56.2201 261.141 56.2645 262.654 56.3088C263.89 56.2809 265.127 56.2531 266.363 56.2252C266.357 56.1774 266.351 56.1295 266.345 56.0816C268.835 56.2447 272.748 56.1821 274.678 56.2211C275.062 56.229 275.145 56.295 276.339 56.313C277.734 56.3343 280.335 56.3148 281.997 56.3354C282.644 56.2623 283.29 56.1892 283.937 56.1161C286.911 56.0764 287.956 56.2694 289.702 56.2844C290.016 56.287 295.752 56.2731 296.061 56.269C298.591 56.2364 297.875 56.0719 305.192 56.1072C306.495 56.1135 307.549 56.1704 308.727 56.1727C310.807 56.1768 317.077 56.0478 317.57 55.9286C320.093 56.0778 326.845 56.0168 328.834 56.0599C329.434 56.0732 329.57 56.1682 331.415 56.1885C332.91 56.205 336.762 56.1288 338.659 56.1416C340.673 56.1555 341.392 56.2353 342.294 56.241C343.146 56.2462 343.932 56.1817 345.094 56.1821C348.719 56.1844 352.003 56.2881 354.869 56.29C354.913 56.2901 354.956 56.2901 355 56.2901L354.528 56.7617C354.527 52.671 354.34 49.0506 354.256 45.6195C354.268 44.7588 354.309 43.9131 354.309 43.0107C354.315 31.8473 354.351 19.2544 354.391 8.05778C354.398 6.23134 354.434 3.45074 354.46 0.761719L355 1.30188C350.036 1.25479 345.385 1.24431 347.622 1.52468C345.816 1.60037 332.682 1.4261 330.183 1.42348C327.686 1.42088 325.706 1.49839 323.743 1.49953C317.818 1.5029 313.647 1.44705 306.435 1.51454C304.573 1.53219 302.577 1.62401 301.474 1.62294C300.146 1.62144 298.716 1.53264 296.995 1.52699C292.892 1.51425 285.247 1.54346 281.311 1.52809C280.592 1.52509 280.34 1.44712 279.312 1.42275C275.309 1.32752 270.823 1.33578 271.617 1.58473C266.487 1.44339 261.741 1.57232 256.987 1.58022C246.935 1.59634 228.623 1.53823 219.866 1.64284C214.345 1.70883 214.486 1.82049 206.356 1.72414C204.551 1.70277 202.755 1.67395 200.566 1.64845C195.436 1.58847 190.729 1.38219 186.818 1.63075C181.12 1.56629 176.582 1.61201 172.354 1.39943C171.856 1.45042 171.357 1.5014 170.859 1.55239C170.16 1.55365 169.462 1.55491 168.763 1.55617C168.545 1.50754 168.327 1.45892 168.109 1.4103C163.105 1.3972 156.755 1.59706 152.519 1.5956C145.416 1.59335 127.123 1.51571 120.388 1.45009C116.812 1.41525 116.62 1.51939 114.573 1.30531C113.773 1.32021 112.973 1.3351 112.173 1.34999C111.673 1.39687 111.172 1.44374 110.672 1.49062C106.085 1.49249 100.644 1.41968 96.2735 1.42043C88.3102 1.42193 76.3524 1.55094 68.3556 1.4662C66.3505 1.44484 63.844 1.34817 61.8805 1.34926C59.0227 1.35076 58.3282 1.51118 54.7016 1.51418C48.4513 1.51905 36.8111 1.33269 30.9034 1.34694C29.1487 1.35107 28.33 1.41076 27.1184 1.41713C22.0379 1.4445 17.8668 1.43964 12.9952 1.53188C7.76442 1.37815 8.2163 1.17973 6.59523 0.979508C5.36669 0.828393 1.59958 0.478188 1.06482 0.345839C0.689185 0.252857 2.09169 0.133247 1.56531 0.0308974C7.83229 -0.050838 10.4652 0.0391419 15.554 0.183119C24.9517 0.177382 34.3494 0.171645 43.7472 0.165907C44.6022 0.221775 45.4572 0.277643 46.3122 0.33351C46.3122 0.333632 46.3122 0.333754 46.3122 0.333877C49.9212 0.398352 51.4508 0.254475 53.3972 0.221816C72.0313 -0.0908871 108.707 0.153856 129.221 0.189101C133.642 0.196597 148.022 0.121315 151.055 0.21205C151.84 0.235681 152.059 0.321827 152.894 0.325576C160.359 0.274347 167.824 0.223118 175.288 0.171889C190.638 0.305743 206.507 0.195196 221.975 0.174574C263.821 0.118708 305.25 0.0508035 346.412 0.0714248C349.089 0.0728127 352.008 0.066425 355 0.0589235L355.701 0.0572136L355.703 0.761719C355.718 6.66125 355.737 12.8441 355.709 18.0113C355.692 21.2615 355.553 22.6158 355.657 26.8856C355.619 26.9304 355.582 26.9752 355.545 27.0201C355.59 30.7463 355.675 33.1275 355.683 37.3051C355.69 40.8231 355.696 50.1307 355.682 53.2394C355.674 54.8519 355.605 54.2512 355.605 55.7544C355.605 56.0533 355.607 56.3916 355.609 56.7617L355.611 57.3694L355 57.3709C352.183 57.3891 347.522 57.4643 344.383 57.4643C341.166 57.4643 335.743 57.3841 333.27 57.3957C324.362 57.437 314.659 57.5559 305.167 57.524C302.545 57.515 299.172 57.4247 298.351 57.4272C296.747 57.4325 296.269 57.5202 295.192 57.5315C289.719 57.5885 281.187 57.4842 275.823 57.4801C258.342 57.4666 239.823 57.5049 222.417 57.4888C211.421 57.4786 193.147 57.4941 182.994 57.4281C180.805 57.4138 181.389 57.3177 179.55 57.3177C177.512 57.3178 176.408 57.3827 175.456 57.3879C168.862 57.4247 154.307 57.4903 
206148.082 57.4239C146.897 57.4112 146.036 57.3359 145.326 57.3362C144.967 57.3362 144.155 57.3876 143.027 57.3928C133.067 57.4393 125.805 57.4093 116.045 57.3917C97.3525 57.3583 75.6943 57.4539 56.0579 57.4022C51.7796 57.391 48.8456 57.242 48.244 57.2435C46.9238 57.2465 46.0788 57.3467 43.4049 57.3714C34.5146 57.4528 22.5416 57.3459 14.0856 57.3961C10.219 57.419 5.01325 57.5297 1 57.5683L0.195378 57.5703L0.193406 56.7617C0.190298 56.439 0.187655 56.124 0.18556 55.818C0.163066 52.5345 0.212951 44.7799 0.157118 43.3245C0.123385 42.4391 0.0150412 42.0295 0.00147778 40.9691ZM95.8249 56.0737C95.2399 56.2469 101.387 56.103 99.0812 56.01C98.5618 55.9891 95.9761 56.0287 95.8249 56.0737ZM354.613 28.0711C354.563 28.1274 354.514 28.1837 354.464 28.24C354.485 29.047 354.506 29.8541 354.526 30.6611C354.556 30.2076 354.586 29.754 354.615 29.3004C354.614 28.8906 354.614 28.4809 354.613 28.0711Z",w8="M2.33661 0.0101698C3.58063 -0.015883 5.21135 0.0119737 6.45068 0.0502087C6.83908 0.0620673 6.6424 0.115075 6.91052 0.125648C7.43491 0.146258 7.92345 0.120261 8.44165 0.144813C8.61339 0.153209 8.39962 0.237174 8.57969 0.244056C9.56649 0.281163 10.5 0.259777 11.4997 0.277625C16.4236 0.365685 21.2637 0.397205 26.2478 0.435461C27.8912 0.448004 29.889 0.524206 31.5865 0.490881C31.7846 0.486916 31.6665 0.413216 31.7042 0.407141C32.2955 0.31415 32.0989 0.462935 32.485 0.482702C34.0174 0.560754 35.7214 0.567542 37.1961 0.539099C37.8235 0.526782 37.1944 0.380395 37.8262 0.462561C37.87 0.468112 37.7108 0.546377 37.8829 0.554724C38.2731 0.573498 39.0134 0.559509 39.3158 0.56571C39.8986 0.578057 39.995 0.577269 40.5463 0.578161C41.2999 0.580061 42.1962 0.618966 43.0047 0.601232C43.1773 0.597215 42.9488 0.516985 43.2241 0.503332C43.4996 0.489702 44.2283 0.496505 44.474 0.515417C44.7198 0.534339 44.6152 0.597399 44.6587 0.611852C45.0165 0.733849 45.8595 0.564884 45.9679 0.560705C47.9456 0.489506 49.6415 0.58576 51.4979 0.585485C52.9072 0.585073 54.4142 0.553296 55.7551 0.557653C57.3527 0.563155 58.7067 0.606631 60.2588 0.599157C60.4225 0.598461 60.2306 0.504129 60.4307 0.503088C62.5561 0.492111 64.6667 0.502394 66.783 0.566076C66.9952 0.572546 66.7217 0.655368 66.9337 0.666784C68.232 0.734849 70.2861 0.898357 71.0571 0.537756C71.9365 0.551837 73.0041 0.566385 73.7908 0.639074C74.298 0.685858 73.8054 0.776084 74.4285 0.737585C74.569 0.729007 74.3863 0.649991 74.597 0.643102C75.4476 0.615373 76.3736 0.637827 77.222 0.603773L77.6147 0.600236L77.6183 1C77.6197 1.03665 77.6213 1.07315 77.623 1.10949C77.6315 1.28804 77.7023 1.23928 77.715 1.28988C77.8183 1.71504 77.6476 2.42281 77.6352 2.57711C77.5427 3.75203 77.5791 4.61006 77.5769 5.70458C77.5763 5.95858 77.6714 5.65834 77.6743 5.90275C77.6879 7.17035 77.6797 8.48345 77.6375 9.72465C77.6279 10.0007 77.5469 9.74684 77.5382 9.87878C77.5006 10.4605 77.6536 10.5895 77.6206 11.1474C77.6138 11.265 77.5444 11.1987 77.5368 11.2202C77.4173 11.556 77.5867 11.8478 77.5904 11.9341C77.6415 13.0266 77.4647 13.725 77.4897 14.7804C77.4929 14.9067 77.5806 14.622 77.5842 14.9769C77.6084 17.3415 77.5843 19.8423 77.5141 22.1829C77.5033 22.5468 77.4374 22.287 77.4293 22.3099C77.3023 22.6831 77.4724 22.9246 77.4788 23.0433C77.525 23.9794 77.3823 24.8538 77.5849 25.4899C77.5285 28.671 77.5906 31.8404 77.5236 35L77.5263 35.2988L77.222 35.3015C76.444 35.285 75.6665 35.2607 74.8896 35.2248C74.8396 35.2227 74.9292 35.1389 74.8295 35.1351C73.6286 35.0881 73.8592 35.2183 73.0646 35.3775C72.8644 35.4175 72.2555 35.2252 72.2017 35.2111C72.0054 35.1592 72.209 35.0346 72.1432 35.0245C71.5993 34.9455 71.688 35.3577 70.9542 35.3579C70.9313 35.3572 71.0277 35.2813 70.9661 35.2738C70.7748 35.2501 70.5851 35.2802 70.3978 35.2541C69.9694 35.
2061937 69.8167 34.9934 69.1623 35.11C69.0794 35.1251 69.2059 35.3589 68.5508 35.3479C68.2897 35.3433 67.1337 35.3473 66.8097 35.3321C66.4861 35.317 66.7083 35.2416 66.6852 35.2384C65.8133 35.1387 66.1439 35.0974 65.7071 34.9499C65.2703 34.803 65.3914 35.1535 65.2133 35.1926C65.035 35.2316 64.3957 35.1494 64.2386 35.1208C64.0816 35.0922 64.2774 35.0443 64.1378 35.0282C63.2121 34.9225 63.7315 35.2021 63.4264 35.2578C62.7073 35.3895 62.1472 35.1296 61.4888 35.1041C61.3107 35.0972 61.456 35.1564 61.2974 35.162C60.6692 35.1831 60.2913 35.102 59.5766 35.1764C59.4597 35.1885 58.8819 35.3448 58.5079 35.2301C58.4549 35.2135 58.6054 35.1488 58.3376 35.1342C57.9377 35.1125 57.217 35.0983 56.787 35.12C56.4696 35.136 56.8335 35.2427 56.4339 35.2096C56.2563 35.1948 56.5854 35.1323 56.2518 35.1097C55.92 35.0871 55.0715 35.0899 54.7486 35.092C54.4264 35.0942 54.6028 35.1752 54.5767 35.1806C54.4191 35.2119 53.8006 35.2509 53.7459 35.2508C50.989 35.2607 48.4468 35.1242 45.7626 35.1694C45.5519 35.1728 45.6922 35.2582 45.6601 35.2596C44.9389 35.2954 45.5075 35.0684 45.0038 34.9924C45.0766 35.1657 44.7792 35.1343 44.2712 35.1533C44.0264 35.1626 44.1597 35.2297 44.1374 35.2365C43.7744 35.3384 43.5216 35.2068 43.4565 35.1799C43.2161 35.0809 42.9545 35.1979 42.7909 35.1317C42.6274 35.066 43.0037 34.9686 42.5165 34.9698C42.3799 35.0318 42.7416 35.1939 42.3717 35.2202C40.9762 35.3195 38.3711 35.1924 37.249 35.1792C36.1292 35.166 35.7675 35.1774 35.1149 35.155C33.9362 35.1145 34.3682 35.2347 33.6363 35.2898C32.9023 35.3448 33.2591 35.0489 33.1536 34.9853C33.05 34.9217 32.9369 34.9872 32.8081 34.9522C32.6796 34.9173 32.9577 34.874 32.6556 34.8609C32.3534 34.8478 31.5272 34.9609 31.4201 35.0274C31.1936 35.1683 31.5659 35.3162 30.7663 35.2642C30.7203 35.2612 30.8695 35.1834 30.6934 35.1755C29.2948 35.1156 27.8417 35.1119 26.4447 35.0589C26.2526 35.0515 26.4244 34.965 26.3126 34.9597C25.1482 34.9043 25.5645 35.0503 24.9263 35.2124C25.0696 34.9966 24.7167 34.8646 23.833 34.8634C23.3018 34.8625 23.3932 34.9567 23.0496 35.0232C22.9466 35.0432 22.5707 34.9785 22.5026 35.0228C22.278 35.1676 22.632 35.3298 21.7209 35.2652C21.6809 35.2622 21.8082 35.1829 21.6701 35.1781C20.7773 35.1466 20.6705 35.2981 19.7054 35.3165C18.9489 35.3309 17.6035 35.2385 16.7422 35.2235C16.7603 34.9809 15.9467 35.0365 15.6167 35.2037C15.0577 35.1969 14.454 35.2063 13.9137 35.1832C13.7277 35.1753 13.8499 35.1051 13.8264 35.0975C13.4669 34.9785 13.2239 35.1412 13.1032 35.1475C11.7955 35.2096 10.7301 35.0862 9.48202 35.2068C9.43773 35.2111 9.36598 35.3796 9.03234 35.2566C9.01076 35.2481 9.42295 35.1714 8.83587 35.1655C8.24869 35.1595 7.14177 35.0692 6.32662 35.1473C6.12934 35.1661 5.63038 35.3029 5.22992 35.196C5.17656 35.1815 5.23496 35.1332 5.15794 35.1063C4.90898 35.0206 4.77305 35.1909 4.48044 35.0462C4.18784 34.9016 3.57916 34.7932 2.75708 34.893C2.73088 34.8959 2.53628 35.0309 2.27775 35.0288C1.86504 35.0252 1.27918 34.9971 0.848245 34.998C0.641913 34.9985 0.773964 35.0823 0.738151 35.0838C0.560164 35.0899 0.388765 35.0939 0.222046 35.0962L0.126679 35.0971L0.125805 35C0.109729 33.8672 0.170132 32.9508 0.198399 31.6553C0.20451 31.3828 0.0902186 30.5999 0.180577 30.0725C0.279491 29.4933 0.690959 30.0884 0.592929 28.7573C0.55372 28.2204 0.0316989 27.5406 0.302159 26.5758C0.23514 24.7045 0.373561 22.9739 0.277867 21.0974C0.273627 21.013 0.127935 20.7462 0.129918 20.5478C0.133144 20.2533 0.201238 20.0916 0.205723 19.8813C0.226234 19.0001 0.167975 18.1937 0.177037 17.3441C0.180329 17.0215 0.250738 17.1343 0.254673 16.7496C0.258543 16.3651 0.165828 16.1087 0.210606 15.5877C0.244738 15.1942 0.434244 14.8008 0.456333 14.2784C0.269406 14.2585 0.273256 13.8998 0.223912 13.2622C0.214338 13.1396 0.149277 13.2711 0.141393 13.2131C0.10786 12.9771 0.161781 12.7588 0.125279 12.5347C0.116513 12.4802 0.0526758 12.4777 0.0419055 12.4331C-0.052106 12.0543 0.0914884 11.4301 0.11649 11.3229C0.211442 10.912 0.128415 10.72 0.165807 10.4049C0.203193 10.0903 0.24993 10.5607 0.272618 10.1932C0.319545 9.43136 0.309235 8.45253 0.312168 7.67882C0.312945 7.37011 0.227732 7.58073 0.225865 7.53655C0.204253 6.8982 0.294894 6.25266 0.125157 5.89871C0.564034 5.45612 0.0825886 5.51377 0.170445 4.60132C0.177551 4.52944 0.385092 4.43801 0.415562 4.71395C0.446002 4.98988 0.381127 5.40832 0.428623 5.79116C0.439769 5.88183 0.634249 6.40118 0.64603 6.47204C0.7381 7.02711 0.427957 7.10576 0.410923 7.13514C0.227092 7.46815 0.436607 8.10281 0.451084 8.26994C0.517419 9.03451 0.473803 9.68409 0.521152 10.3236C0.551
206754 10.7418 0.754909 10.7827 0.74869 11.1112C0.728137 12.2029 0.444735 12.584 0.690463 13.6128C0.742872 13.8334 0.964914 13.6142 0.790316 14.4046C0.779309 14.4543 0.619584 15.0411 0.720614 15.3802C0.733353 15.4228 0.798064 15.4214 0.8035 15.4776C0.838663 15.854 0.78711 16.105 0.811801 16.515C0.836491 16.925 0.8733 17.418 0.851351 17.8861C0.838227 18.1682 0.717661 18.5301 0.688144 18.6652C0.603112 19.0465 0.742528 19.4554 0.63956 19.6916C0.536073 19.9298 0.378912 19.4641 0.312046 20.0888C0.48017 20.1119 0.652732 20.1651 0.82181 20.2023C0.815891 21.5712 0.761527 22.9182 0.768954 24.2918C0.770043 24.462 0.860427 24.2879 0.863924 24.4705C0.878283 25.2406 0.813852 25.9134 0.83951 26.7121C0.859718 27.3304 0.955415 28.0083 0.979525 28.6548C0.787143 29.0497 0.852452 30.009 0.834872 30.7059C0.828797 30.95 0.777416 30.9337 0.760653 31.1073C0.698658 31.7623 0.868664 31.4554 0.895418 31.6349C1.0096 32.4053 0.624803 32.4712 0.634311 33.3795C0.634684 33.4276 0.839799 34.0158 0.852572 34.0968C0.935863 34.6115 0.781179 34.182 0.766024 34.5041C0.75767 34.6815 0.74738 34.8426 0.738729 35L0.222046 34.4833C0.58648 34.5033 0.931181 34.5146 1.4131 34.4726C1.61433 34.4548 2.09701 34.327 2.48778 34.4259C2.53918 34.4388 2.51077 34.5066 2.55214 34.5106C3.30108 34.5768 3.32079 34.3637 3.74876 34.2916C4.17682 34.2195 4.83793 34.3665 4.97247 34.4089C5.32446 34.5185 4.70277 34.4558 4.68369 34.4665C4.45977 34.5946 4.94195 34.5725 5.31037 34.5833C5.36373 34.7922 5.87892 34.7797 5.69231 34.5937C5.67108 34.5734 5.38436 34.5929 5.31037 34.5833C5.63377 34.3784 6.2 34.3522 6.82542 34.5437C7.11817 34.6334 6.84142 34.7381 7.73071 34.6998C8.1343 34.6825 7.97836 34.5387 8.33453 34.4995C9.14823 34.41 10.2056 34.5442 11.0445 34.523C11.349 34.5154 11.0524 34.4366 11.2604 34.4287C11.8127 34.4073 12.2997 34.4664 12.8542 34.4361C12.9045 34.4333 12.7817 34.3509 12.9542 34.3498C14.2616 34.3402 15.4 34.393 16.7651 34.3945C17.4246 34.3952 18.6038 34.3497 19.287 34.3589C20.4712 34.3742 21.9279 34.494 22.9396 34.4649C23.5993 34.4463 23.4546 34.3639 23.7373 34.3077C24.2828 34.1988 25.2485 34.3938 25.3785 34.424C25.3825 34.425 24.8148 34.4445 25.1177 34.4868C25.2938 34.5749 25.3721 34.4244 25.3785 34.424C25.4639 34.4435 26.5981 34.4623 26.8233 34.4465C26.9456 34.4379 26.8772 34.3598 26.941 34.3568C28.4576 34.2869 29.9768 34.267 31.5149 34.3036C31.542 34.3051 31.5012 34.3925 31.5649 34.3951C32.4553 34.4339 33.0255 34.3271 33.7599 34.2636C34.4942 34.2002 35.0766 34.2215 35.5113 34.3714C36.0653 34.3525 36.8602 34.4188 37.3176 34.4591C37.775 34.4993 37.8389 34.3293 37.8791 34.3259C39.1344 34.2183 39.8601 34.3156 41.1624 34.3308C41.7815 34.3383 43.0097 34.3136 43.6801 34.295C44.2099 34.28 44.5291 34.3199 45.0173 34.2944C45.0833 34.291 45.0166 34.2153 45.0368 34.2124C45.5816 34.1218 45.3198 34.3
206069 45.4323 34.3399C45.8401 34.4601 46.0921 34.5242 46.7898 34.4676C46.9507 34.4547 47.4195 34.1882 47.7129 34.1726C48.0943 34.1528 47.9503 34.2483 48.3497 34.2252C48.3839 34.2233 48.3768 34.1644 48.6233 34.167C49.7674 34.1782 51.0148 34.2125 52.2038 34.2066C52.3662 34.2061 52.158 34.1126 52.3927 34.1102C53.4938 34.0991 54.7006 34.1026 55.7733 34.1463C56.0374 34.1574 55.8718 34.2228 55.9292 34.2423C56.2811 34.3599 56.7801 34.189 56.8624 34.1858C58.8265 34.1037 60.3296 34.2583 62.3315 34.1847C62.4404 34.1803 63.2792 33.9972 63.6534 34.1543C63.679 34.1647 64.0493 34.3254 64.3766 34.2155C64.397 34.2087 64.1663 34.1259 64.5689 34.1344C64.9715 34.1428 65.6194 34.0875 66.1728 34.1784C66.348 34.2071 66.7621 34.3674 67.2848 34.2396C67.3188 34.2307 68.1256 33.9417 68.4136 34.1411C68.4603 34.1739 68.4115 34.3849 69.0352 34.2767C69.1544 34.2557 68.9381 34.2087 69.252 34.1793C69.7331 34.134 70.3705 34.1905 70.9619 34.0965C71.065 34.0799 71.504 33.9367 71.8561 34.0454C71.9113 34.0624 71.8065 34.1328 71.9925 34.1407C72.8768 34.1785 73.8028 34.1314 74.7008 34.1801C75.0188 34.1973 74.8562 34.3111 75.1877 34.3416C75.5193 34.3721 76.1873 34.4015 76.5342 34.3495C76.8812 34.2974 76.5022 34.1159 77.022 34.1014C77.0887 34.0995 77.1554 34.0978 77.222 34.0963L76.3183 35C76.2666 32.8079 76.3673 30.6347 76.3824 28.4446C76.3847 28.1099 76.3198 28.3874 76.3186 27.8941C76.3137 26.0756 76.2529 22.936 76.3908 21.358C76.5014 20.0937 76.5855 21.6848 76.6305 20.7186C76.6519 20.2524 76.4409 19.748 76.4343 19.6355C76.3668 18.5361 76.4603 17.772 76.4316 16.7824C76.4257 16.5781 76.3401 16.7785 76.336 16.6046C76.3212 16.0105 76.3594 15.3862 76.3524 14.8185C76.3491 14.5639 76.2837 14.6108 76.2888 14.3765C76.3001 13.8158 76.3275 13.32 76.3888 12.7734C76.3943 12.7235 76.4756 13.0595 76.4786 12.6446C76.4833 11.9732 76.5436 11.1399 76.4813 10.3674C76.4625 10.1382 76.3133 10.1292 76.4164 9.63657C76.4379 9.53323 76.6171 9.66508 76.4622 9.09119C76.4365 8.99468 76.2276 8.03063 76.3623 7.55752C76.3977 7.43271 76.5444 7.11415 76.5213 6.83853C76.5177 6.80116 76.4375 6.95089 76.4297 6.72251C76.4035 5.91761 76.412 5.07404 76.3869 4.24713C76.3801 4.02631 76.2971 4.3552 76.2895 4.0261C76.2685 3.12106 76.2897 1.99111 76.3156 1.10611C76.317 1.06082 76.3195 1.02617 76.3228 1L77.222 1.89926C77.0597 1.87878 77.2241 1.82691 77.2037 1.82047C76.8219 1.69882 76.5961 1.86302 76.4694 1.87259C75.6813 1.92992 75.0812 1.85279 74.3548 1.8732C74.1543 1.87863 74.2965 1.95692 74.2566 1.9639C73.8427 2.03211 74.151 1.89151 73.889 1.87601C73.1551 1.83212 72.337 1.83842 71.5949 1.84842C71.3223 1.85221 71.6287 1.94299 71.384 1.94534C69.936 1.96099 68.4307 1.9523 67.0176 1.90225C66.7515 1.89267 66.9189 1.82276 66.8634 1.80679C66.4812 1.69509 65.9211 1.84746 65.7922 1.86197C65.2061 1.92824 64.9785 1.86642 64.4609 1.87796C61.9326 1.93541 58.8108 1.89447 56.4241 1.86917C53.3142 1.83662 50.9009 1.77012 47.9352 1.78739C47.7467 1.7884 47.9368 1.88139 47.7743 1.88345C45.6765 1.90587 43.6112 1.86953 41.5092 1.89639C41.3367 1.89843 41.5853 1.98659 41.3085 1.99283C40.7406 2.00624 40.0212 2.00145 39.4471 1.9733C39.167 1.95974 39.5426 1.88409 39.2607 1.87198C38.6044 1.84362 37.9008 1.83734 37.2266 1.85147C36.9397 1.85768 37.3725 1.94784 36.9996 1.94888C34.4593 1.95783 31.9644 1.97336 29.3973 1.8566C29.2213 1.84858 29.0669 1.66533 28.6927 1.70047C28.6645 1.75133 28.6661 1.81115 28.6538 1.86551C24.9557 1.89479 21.2954 1.83127 17.5869 1.82144C17.4306 1.82105 17.7008 1.91815 17.3981 1.91788C15.6461 1.91644 13.9447 1.94334 12.1526 1.84683C11.9748 1.8374 12.066 1.66658 11.542 1.69242C11.4496 1.69713 10.6604 1.71991 10.4563 1.75699C10.4286 1.76258 10.5726 1.84231 10.3183 1.84464C8.84042 1.85674 7.29169 1.83854 5.81637 1.78983C5.57827 1.78181 5.83183 1.69691 5.66224 1.69046C4.45926 1.64539 3.15076 1.70993 2.00125 1.63285C1.23181 1.58094 1.51668 1.43417 1.10781 1.28971C1.04998 1.26932 0.573516 1.26609 0.548877 1.18204C0.485621 0.970681 0.716403 0.739242 0.621707 0.513952C0.601701 0.465427 -0.0364035 0.517692 0.341395 0.400427C0.367788 0.392579 0.830417 0.35366 0.944363 0.31388C1.0237 0.286376 0.880735 0.200894 1.0426 0.165687C1.20445 0.130513 1.3823 0.202169 1.65065 0.160804C1.91887 0.118927 1.80093 0.0216813 2.33661 0.0101698ZM39.3772 34.6389C39.8007 34.7205 39.8632 34.4215 39.4051 34.493C39.383 34.4968 39.3553 34.6349 39.3772 34.6389ZM0.535923 22.9105C0.404001 23.4642 0.597978 23.8431 0.699862 23.4525C0.801637 23.062 0.575913 22.7418 0.535923 22.9105ZM0.439609 17.1688C0.335595 17.8159 0.759723 17.9178 0.673984 17.2247C0.669138 17.1844 0.445649 17.131 0.439609 17.1688ZM3.00394 1.24857C2.99809 1.2446 2.65559 1.24073 2.64741 1.24466C2.46503 1.33965 3.14989 1.34733 3.00394 1.24857ZM0.334751 11.4711C0.277379 11.6731 0.343608 12.2548 0.414951 12.0038C0.472344 11.8017 0.406119 11.2195 0.334751 11.4711ZM61.471 34.9581C61.4777 34.9626 61.7233 34.9666 61.7183 34.9414C61.7017 34.8602 61.3599 34.8831 61.471 34.9581ZM0.329868 1.78719C0.313904 3.21794 -0.0364464 4.08542 0.0030873 2.52735C0.0102401 2.2452 0.114811 3.13545 0.146397 2.77632C0.203942 2.11921 -0.016035 1.68288 0.101842 1.01231C0.123417 0.890919 0.331558 1.70557 0.330357 1.78973C0.330194 1.78888 0.330031 1.78803 0.329868 1.78719ZM39.6211 34.9981C39.6296 35.
2060021 39.9695 35.0058 39.9776 35.0019C40.1617 34.907 39.4769 34.8994 39.6211 34.9981ZM75.7991 35.143C75.8179 35.1515 76.6067 35.1593 76.6325 35.1516C77.044 34.9963 75.4492 34.9799 75.7991 35.143ZM16.7286 35.217C16.3577 35.3125 15.9141 35.3238 15.6184 35.2038C15.987 35.2102 16.358 35.2111 16.7286 35.217Z",x8="M9.71627 0.0101698C15.2555 -0.015883 22.5166 0.0119737 28.0349 0.0502087C29.7644 0.0620673 28.8886 0.115075 30.0825 0.125648C32.4174 0.146258 34.5927 0.120261 36.9001 0.144813C37.6648 0.153209 36.7129 0.237174 37.5148 0.244056C41.9087 0.281163 46.0655 0.259777 50.5166 0.277625C72.4412 0.365685 93.9926 0.397205 116.185 0.435461C123.503 0.448004 132.398 0.524206 139.957 0.490881C140.839 0.486916 140.313 0.413216 140.481 0.407141C143.114 0.31415 142.238 0.462935 143.958 0.482702C150.781 0.560754 158.368 0.567542 164.935 0.539099C167.728 0.526782 164.927 0.380395 167.74 0.462561C167.936 0.468112 167.227 0.546377 167.993 0.554724C169.73 0.573498 173.027 0.559509 174.373 0.56571C176.968 0.578057 177.398 0.577269 179.852 0.578161C183.208 0.580061 187.199 0.618966 190.799 0.601232C191.567 0.597215 190.55 0.516985 191.775 0.503332C193.002 0.489702 196.247 0.496505 197.341 0.515417C198.435 0.534339 197.969 0.597399 198.163 0.611852C199.756 0.733849 203.51 0.564884 203.993 0.560705C212.799 0.489506 220.35 0.58576 228.616 0.585485C234.892 0.585073 241.601 0.553296 247.572 0.557653C254.686 0.563155 260.715 0.606631 267.626 0.599157C268.355 0.598461 267.5 0.504129 268.391 0.503088C271.367 0.499637 274.335 0.498287 277.301 0.500038L277.8 0.499029L277.801 1C277.797 7.46615 277.778 13.9148 277.735 20.3752C277.728 21.3202 277.645 20.1023 277.634 21.0464C277.566 26.8269 277.402 35.9733 277.763 39.4065C277.749 43.3221 277.734 48.0758 277.662 51.5787C277.615 53.8373 277.525 51.6437 277.563 54.4182C277.572 55.0439 277.651 54.2302 277.658 55.1686C277.687 59.1195 277.661 63.436 277.702 67.3446C277.71 68.1395 277.781 67.9225 277.794 68.1477C277.897 70.0409 277.726 73.1923 277.714 73.8794C277.621 79.1109 277.658 82.9314 277.656 87.805C277.655 88.936 277.75 87.5991 277.753 88.6874C277.767 94.3316 277.758 100.179 277.716 105.705C277.707 106.935 277.626 105.804 277.617 106.391C277.579 108.982 277.732 109.556 277.699 112.04C277.693 112.564 277.623 112.269 277.616 112.364C277.496 113.86 277.665 115.159 277.669 115.543C277.72 120.408 277.543 123.517 277.568 128.217C277.572 128.779 277.659 127.511 277.663 129.092C277.687 139.621 277.663 150.756 277.593 161.178C277.582 162.798 277.516 161.641 277.508 161.743C277.381 163.405 277.551 164.481 277.558 165.009C277.604 169.177 277.461 173.071 277.664 175.903C277.607 190.067 277.669 204.18 277.602 218.248L277.603 218.549L277.301 218.55C273.836 218.533 270.374 218.509 266.915 218.473C266.693 218.471 267.091 218.387 266.647 218.384C261.3 218.336 262.327 218.467 258.789 218.626C257.898 218.666 255.186 218.474 254.947 218.46C254.073 218.408 254.979 218.283 254.686 218.273C252.265 218.194 252.659 218.606 249.392 218.606C249.29 218.606 249.719 218.53 249.445 218.522C248.593 218.498 247.748 218.529 246.915 218.503C245.007 218.442 244.327 218.242 241.413 218.358C241.044 218.373 241.608 218.607 238.691 218.596C237.528 218.592 232.38 218.596 230.938 218.581C229.497 218.565 230.486 218.49 230.383 218.487C226.501 218.387 227.973 218.346 226.028 218.198C224.083 218.051 224.623 218.402 223.83 218.441C223.036 218.48 220.189 218.398 219.49 218.369C218.79 218.341 219.662 218.293 219.041 218.277C214.919 218.171 217.231 218.451 215.873 218.506C212.671 218.638 210.177 218.378 207.246 218.353C206.452 218.346 207.1 218.405 206.393 218.41C203.596 218.432 201.914 218.35 198.731 218.425C198.211 218.437 195.638 218.593 193.972 218.478C193.736 218.462 194.407 218.397 193.214 218.383C191.434 218.361 188.225 218.347 186.31 218.368C184.897 218.384 186.517 218.491 184.738 218.458C183.947 218.443 185.412 218.381 183.927 218.358C182.449 218.336 178.671 218.338 177.234 218.34C175.799 218.343 176.584 218.424 176.468 218.429C175.766 218.46 173.012 218.499 172.769 218.499C160.493 218.509 149.173 218.373 137.221 218.418C136.284 218.421 136.908 218.507 136.765 218.508C133.554 218.544 136.086 218.317 133.843 218.241C134.167 218.414 132.843 218.383 130.581 218.402C129.491 218.411 130.085 218.478 129.985 218.485C128.369 218.587 127.243 218.455 126.953 218.428C125.883 218.329 124.718 218.446 123.99 218.38C123.262 218.314 124.937 218.217 122.768 218.218C122.16 218.28 123.77 218.442 122.123 218.469C115.909 218.568 104.31 218.441 99.3134 218.428C94.327 218.414 92.7165 218.426 89.8109 218.403C84.5625 218.363 86.4859 218.483 83.227 218.538C79.9586 218.593 81.5475 218.297 81.0777 218.234C80.6165 218.17 80.1129 218.236 79.5392 218.201C78.9673 218.166 80.2053 218.122 78.8604 218.109C77.5147 218.096 73.8358 218.209 73.3588 218.276C72.3505 218.417 74.0083 218.565 70.4477 218.513C70.243 218.51 70.9075 218.432 70.1234 218.424C63.8955 218.364 57.4255 218.36 51.2052 218.307C50.3499 218.3 51.1147 218.213 50.617 218.208C45.4323 218.153 47.2857 218.299 44.4441 218.461C45.0821 218.245 43.5108 218.113 39.576 218.112C37.2106 218.111 37.6178 218.205 36.088 218.272C35.6289 218.292 33.9553 218.227 33.652 218.271C32.6519 218.416 34.2284 218.578 30.1715 218.514C29.9936 218.511 30.5603 218.431 29.9453 218.426C25.9699 218.395 25.4942 218.547 21.197 218.565C17.8286 218.579 11.8382 218.487 8.00287 218.472C8.08351 218.229 4.46093 218.285 2.99146 218.452C2.11233 218.45 1.20839 218.449 0.300781 218.449L0.100795 218.449L0.100389 218.248C0.101313 216.586 0.102638 214.912 0.117589 213.356C0.12547 212.528 0.195694 213.072 0.203282 212.968C0.322312 211.367 0.159612 210.284 0.153234 209.747C0.0912295 203.924 0.214543 199.18 0.0940296 193.623C0.0896891 193.426 -0.0787932 193.106 0.0442251 191.621C0.052705 191.525 0.129361 193.36 0.135289 190.746C0.14123 188.132 0.231549 183.203 0.153478 179.573C0.134682 178.695 -0.00209114 176.473 0.104772 174.69C0.
206119283 174.452 0.167604 174.712 0.194493 174.369C0.280172 173.261 0.109878 172.656 0.254552 171.353C0.399218 170.05 0.507563 167.34 0.407749 163.679C0.404847 163.563 0.269873 162.696 0.272008 161.545C0.27553 159.707 0.303648 157.098 0.302769 155.18C0.3023 154.261 0.218487 154.849 0.216954 154.689C0.169989 148.512 0.244707 144.116 0.277135 137.498C0.283245 136.285 0.168954 132.799 0.259312 130.451C0.358227 127.872 0.769694 130.522 0.671665 124.595C0.632455 122.204 0.110434 119.177 0.380894 114.881C0.313876 106.549 0.452296 98.8429 0.356602 90.4874C0.352362 90.1117 0.20667 88.9235 0.208653 88.0402C0.211879 86.7288 0.279973 86.0089 0.284459 85.0725C0.30497 81.1488 0.246711 77.5582 0.255772 73.7751C0.259065 72.3389 0.329473 72.8411 0.333409 71.128C0.337278 69.416 0.244563 68.2744 0.289342 65.9544C0.323473 64.2023 0.512979 62.4504 0.535068 60.1248C0.348141 60.036 0.351991 58.4388 0.302647 55.5998C0.293073 55.054 0.228013 55.6392 0.220128 55.3811C0.186595 54.3305 0.240517 53.3582 0.204015 52.3606C0.195248 52.1179 0.131411 52.1065 0.120641 51.9081C0.0266293 50.2212 0.170224 47.4419 0.195226 46.9646C0.290177 45.1351 0.20715 44.2802 0.244542 42.877C0.281928 41.4761 0.328665 43.5708 0.351353 41.9343C0.39828 38.5422 0.38797 34.1838 0.390904 30.7387C0.39168 29.3641 0.306468 30.3019 0.3046 30.1052C0.282988 27.2628 0.373629 24.3885 0.203893 22.8125C0.642769 20.8417 0.161324 21.0984 0.249181 17.0356C0.256286 16.7155 0.463828 16.3084 0.494297 17.5371C0.524737 18.7657 0.459863 20.6288 0.507358 22.3336C0.518505 22.7373 0.712984 25.0498 0.724765 25.3653C0.816835 27.8368 0.506693 28.187 0.489658 28.3179C0.305827 29.8006 0.515342 32.6266 0.529819 33.3708C0.596155 36.7752 0.552538 39.6676 0.599887 42.515C0.63049 44.3773 0.833645 44.5595 0.827426 46.0219C0.806872 50.8831 0.52347 52.58 0.769198 57.1609C0.821607 58.1431 1.04365 57.167 0.869052 60.6866C0.858045 60.9077 0.698319 63.5208 0.79935 65.0306C0.812088 65.2202 0.876799 65.2142 0.882235 65.4642C0.917398 67.1401 0.865845 68.2578 0.890536 70.0835C0.915227 71.909 0.952035 74.1041 0.930087 76.1885C0.916962 77.4445 0.796396 79.0563 0.766879 79.6576C0.681847 81.3555 0.821264 83.176 0.718295 84.2279C0.614808 85.2886 0.457647 83.2149 0.390782 85.9964C0.558906 86.0994 0.731468 86.336 0.900546 86.5017C0.894626 92.5973 0.840262 98.595 0.847689 104.711C0.848778 105.469 0.939162 104.694 0.94266 105.507C0.957019 108.936 0.892587 111.932 0.918246 115.488C0.938453 118.241 1.03415 121.26 1.05826 124.138C0.865879 125.897 0.931188 130.168 0.913607 133.271C0.907532 134.358 0.856151 134.286 0.839389 135.059C0.777394 137.975 0.947399 136.608 0.974154 137.408C1.08834 140.838 0.703539 141.132 0.713046 145.176C0.71342 145.39 0.918534 148.009 0.931307 148.37C1.0146 150.662 0.859915 148.749 0.84476 150.183C0.817064 152.802 0.76808 154.622 0.828158 157.695C0.845953 158.591 0.973799 160.74 0.874911 162.48C0.861962 162.709 0.794165 162.582 0.790194 162.767C0.724011 166.101 0.93704 166.189 1.00919 168.095C1.08132 170.001 0.934263 172.944 0.891879 173.544C0.782234 175.111 0.845021 172.343 0.834262 172.258C0.706215 171.261 0.72826 173.408 0.717441 175.048C0.508563 175.286 0.521101 177.58 0.707065 176.749C0.727377 176.654 0.707898 175.378 0.717441 175.048C0.922378 176.488 0.948625 179.009 0.757113 181.794C0.66
2067355 183.098 0.562701 181.865 0.600986 185.825C0.618269 187.622 0.762092 186.928 0.801303 188.514C0.890767 192.137 0.756604 196.845 0.777743 200.58C0.785418 201.936 0.864145 200.615 0.872103 201.542C0.893468 204.001 0.834397 206.169 0.864657 208.639C0.867499 208.862 0.94991 208.316 0.950961 209.084C0.956195 212.268 0.942777 215.226 0.929304 218.248L0.300781 217.62C2.80418 217.631 5.35085 217.642 8.10468 217.643C11.0414 217.644 16.2919 217.598 19.3342 217.607C24.6069 217.623 31.0934 217.742 35.5977 217.713C38.5356 217.695 37.8911 217.612 39.1499 217.556C41.579 217.447 45.8787 217.642 46.4577 217.672C46.4754 217.673 43.9474 217.693 45.2963 217.735C46.0806 217.823 46.4292 217.673 46.4577 217.672C46.8379 217.692 51.888 217.711 52.8907 217.695C53.4357 217.686 53.1309 217.608 53.4149 217.605C60.1676 217.535 66.9323 217.515 73.7811 217.552C73.9017 217.554 73.7201 217.641 74.0036 217.644C77.9686 217.682 80.5074 217.576 83.7776 217.512C87.0471 217.449 89.6402 217.47 91.5756 217.62C94.0426 217.601 97.5821 217.667 99.6188 217.707C101.655 217.748 101.94 217.578 102.119 217.574C107.708 217.467 110.939 217.564 116.738 217.579C119.495 217.587 124.964 217.562 127.949 217.543C130.308 217.528 131.729 217.568 133.903 217.543C134.197 217.539 133.9 217.464 133.99 217.461C136.416 217.37 135.25 217.555 135.751 217.588C137.567 217.709 138.689 217.773 141.795 217.716C142.512 217.703 144.599 217.437 145.906 217.421C147.604 217.401 146.963 217.497 148.741 217.474C148.893 217.472 148.862 217.413 149.959 217.415C155.054 217.427 160.608 217.461 165.902 217.455C166.626 217.454 165.698 217.361 166.743 217.359C171.646 217.348 177.02 217.351 181.796 217.395C182.972 217.406 182.235 217.471 182.49 217.491C184.057 217.608 186.279 217.437 186.646 217.434C195.391 217.352 202.084 217.507 210.998 217.433C211.483 217.429 215.218 217.246 216.884 217.403C216.998 217.413 218.646 217.574 220.104 217.464C220.195 217.457 219.167 217.374 220.96 217.383C222.753 217.391 225.638 217.336 228.102 217.427C228.882 217.455 230.726 217.616 233.053 217.488C233.205 217.479 236.797 217.19 238.08 217.389C238.288 217.422 238.07 217.633 240.847 217.525C241.378 217.504 240.415 217.457 241.813 217.428C243.955 217.382 246.793 217.439 249.426 217.345C249.885 217.328 251.84 217.185 253.408 217.294C253.654 217.311 253.187 217.381 254.015 217.389C257.953 217.427 262.076 217.38 266.074 217.429C267.49 217.446 266.766 217.56 268.242 217.59C269.719 217.621 272.693 217.65 274.238 217.598C275.783 217.546 274.095 217.364 276.41 217.35C276.707 217.348 277.004 217.346 277.301 217.345L276.397 218.248C276.345 208.488 276.446 198.811 276.461 189.059C276.463 187.569 276.399 188.804 276.397 186.608C276.392 178.511 276.332 164.531 276.47 157.505C276.58 151.875 276.664 158.96 276.709 154.658C276.731 152.582 276.52 150.336 276.513 149.835C276.446 144.94 276.539 141.537 276.51 137.131C276.504 136.221 276.419 137.114 276.415 136.339C276.4 133.694 276.438 130.914 276.431 128.387C276.428 127.253 276.362 127.462 276.368 126.418C276.379 123.922 276.406 121.714 276.467 119.28C276.473 119.058 276.554 120.554 276.557 118.707C276.562 115.717 276.622 112.007 276.56 108.567C276.541 107.547 276.392 107.507 276.495 105.313C276.517 104.853 276.696 105.44 276.541 102.885C276.515 102.455 276.306 98.1622 276.441 96.0556C276.476 95.4999 276.623 94.0814 276.6 92.8542C276.596 92.6878 276.516 93.3545 276.508 92.3376C276.482 88.7536 276.491 84.9975 276.466 81.3155C276.459 80.3322 276.376 81.7967 276.368 80.3313C276.347 76.3014 276.368 71.2701 276.394 67.3295C276.404 65.8767 276.473 66.8809 276.48 66.7752C276.602 65.0752 276.438 64.07 276.428 63.5059C276.371 59.9968 276.448 57.3246 276.428 54.0901C276.422 53.1975 276.344 53.8304 276.337 53.6527C276.269 51.8099 276.409 53.1826 276.425 52.0162C276.469 48.7484 276.462 45.1056 276.452 41.801C276.449 40.5871 276.358 41.9514 276.355 40.8621C276.34 34.4146 276.348 27.712 276.399 21.4197C276.408 20.2349 276.478 20.9803 276.494 20.7334C276.606 19.0315 276.453 16.5373 276.439 15.9633C276.373 13.3537 276.434 12.3401 276.423 10.0356C276.408 7.163 276.4 4.11838 276.396 1L277.301 1.90461C268.198 1.91553 258.466 1.88801 250.551 1.86917C236.703 1.83662 225.958 1.77012 212.753 1.78739C211.913 1.7884 212.759 1.88139 212.036 1.88345C202.695 1.90587 193.499 1.86953 184.139 1.89639C183.371 1.89843 184.479 1.98659 183.246 1.99283C180.717 2.00624 177.514 2.00145 174.958 1.9733C173.71 1.95974 175.383 1.88409 174.128 1.87198C171.205 1.84362 168.072 1.83734 165.07 1.85147C163.793 1.85768 165.72 1.94784 164.06 1.94888C152.749 1.95783 141.64 1.97336 130.209 1.8566C129.426 1.84858 128.738 1.66533 127.072 1.70047C126.946 1.75133 126.953 1.81115 126.898 1.86551C110.432 1.89479 94.1338 1.83127 77.6213 1.82144C76.9251 1.82105 78.1282 1.91815 76.7804 1.91788C68.9792 1.91644 61.4037 1.94334 53.4239 1.84683C52.6321 1.8374 53.0383 1.666
20658 50.7051 1.69242C50.2936 1.69713 46.7795 1.71991 45.8709 1.75699C45.7475 1.76258 46.3887 1.84231 45.2563 1.84464C38.6757 1.85674 31.7797 1.83854 25.2106 1.78983C24.1504 1.78181 25.2794 1.69691 24.5243 1.69046C19.1678 1.64539 13.3414 1.70993 8.22302 1.63285C4.79694 1.58094 6.06537 1.43417 4.2448 1.28971C3.9873 1.26932 1.86577 1.26609 1.75606 1.18204C1.4744 0.970681 2.502 0.739242 2.08035 0.513952C1.99127 0.465427 -0.850013 0.517692 0.832206 0.400427C0.949727 0.392579 3.00967 0.35366 3.51703 0.31388C3.87028 0.286376 3.23372 0.200894 3.95445 0.165687C4.67512 0.130513 5.46704 0.202169 6.6619 0.160804C7.85623 0.118927 7.33107 0.0216813 9.71627 0.0101698Z",C8=1.5;function _8(e,t){const r=2*(e+t),s=5,o=[],a=h=>.28*Math.sin(h/41)+.18*Math.sin(h/13+1.7),i=h=>{const p=C8+.22*Math.sin(h/57+.6),g=Math.min(1,h/48),y=Math.min(1,(r-h)/48),v=.45+.55*Math.min(g,y);return p*v},l=(h,p,g,y,v)=>o.push({x:h,y:p,nx:g,ny:y,t:i(v)});let c=0;for(let h=1.2;h<=e-1.2;h+=s,c+=s)l(h,1.2+a(c),0,-1,c);c=e;for(let h=1.2;h<=t-1.2;h+=s,c+=s)l(e-1.2+a(c),h,1,0,c);c=e+t;for(let h=e-1.2;h>=1.2;h-=s,c+=s)l(h,t-1.2+a(c),0,1,c);c=2*e+t;for(let h=t-1.2;h>=1.2;h-=s,c+=s)l(1.2+a(c),h,-1,0,c);const d=o.map(h=>`${(h.x+h.nx*h.t/2).toFixed(2)} ${(h.y+h.ny*h.t/2).toFixed(2)}`),f=o.map(h=>`${(h.x-h.nx*h.t/2).toFixed(2)} ${(h.y-h.ny*h.t/2).toFixed(2)}`);return`M${d.join(" L")} Z M${f.join(" L")} Z`}const E8={wide:"0 0 356 74",compact:"0 0 70 42",button:"0 0 356 58",card:"0 0 278 219",pill:"0 0 78 36"},S8={wide:y8,compact:v8,button:b8,card:x8,pill:w8},Mf={wide:356/74,compact:70/42,button:356/58,card:278/219,pill:78/36},sn=({variant:e="wide",color:t="#111111",className:n="",children:r,onClick:s,as:o="div",type:a="button",disabled:i=!1})=>{const l=m.useRef(null),[c,d]=m.useState(e==="auto"?"wide":e),[f,h]=m.useState(null);return m.useEffect(()=>{if(e==="tall"){const v=l.current;if(!v)return;const x=()=>{const{width:_,height:b}=v.getBoundingClientRect();_&&b&&h({width:Math.round(_),height:Math.round(b)})};x();const C=new ResizeObserver(x);return C.observe(v),()=>C.disconnect()}if(e!=="auto"){d(e);return}const p=l.current;if(!p)return;const g=()=>{const{width:v,height:x}=p.getBoundingClientRect();if(!v||!x)return;const C=v/x;let _="wide",b=1/0;Object.keys(Mf).forEach(w=>{const P=Math.abs(Math.log(C/Mf[w]));P<b&&(b=P,_=w)}),d(_)};g();const y=new ResizeObserver(g);return y.observe(p),()=>y.disconnect()},[e]),u.jsxs(o,{ref:l,className:`relative ${n}`,onClick:s,type:o==="button"?a:void 0,disabled:o==="button"?i:void 0,children:[e==="tall"?f&&u.jsx("svg",{viewBox:`0 0 ${f.width} ${f.height}`,preserveAspectRatio:"none",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"absolute inset-0 w-full h-full pointer-events-none","aria-hidden":"true",style:{transform:"translateZ(0)"},children:u.jsx("path",{d:_8(f.width,f.height),fill:t,fillRule:"evenodd"})}):u.jsx("svg",{viewBox:E8[c],preserveAspectRatio:"none",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"absolute inset-0 w-full h-full pointer-events-none","aria-hidden":"true",style:{transform:"translateZ(0)"},children:u.jsx("path",{d:S8[c],fill:t})}),r]})},A8={info:{icon:"/icons/info.svg",primaryBg:"bg-[#F9D39A]",primaryText:"text-[#111111]",secondaryColor:"#F9D39A",secondaryText:"text-[#111111]"},warning:{icon:"/icons/warning.svg",primaryBg:"bg-[#E75E30]",primaryText:"text-[#FFFEFB]",secondaryColor:"#E75E30",secondaryText:"text-[#E75E30]"},success:{icon:"/icons/success.svg",primaryBg:"bg-[#509B6C]",primaryText:"text-[#FFFEFB]",secondaryColor:"#509B6C",secondaryText:"text-[#509B6C]"}},Ym=L.forwardRef(({className:e,...t},n)=>u.jsx(Jc,{ref:n,className:G("fixed inset-0 z-50 bg-[#D4CBBE]/80","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Ym.displayName="ModalOverlay";function uo({open:e,onClose:t,title:n,children:r,variant:s="info",illustration:o,illustrationClassName:a,illustrationPosition:i="top",primaryAction:l,secondaryAction:c,dismissible:d=!0,className:f,overlayClassName:h}){const p=A8[s],g=i==="side"&&!!o,y=L.useRef(null),[v,x]=L.useState(!1),C=L.useCallback(()=>{const w=y.current;w&&x(w.scrollHeight-w.scrollTop-w.clientHeight>4)},[]);L.useEffect(()=>{if(!e)return;C();const w=y.current;if(!w)return;const P=new ResizeObserver(C);return P.observe(w),w.firstElementChild&&P.observe(w.firstElementChild),()=>P.disconnect()},[e,C]);const _=n?u.jsx(va,{className:"font-['DM_Sans',sans-serif] text-[24px] font-bold leading-[1.3] text-[#111111] pr-8",children:n}):u.jsx(va,{className:"sr-only",children:"Dialog"}),b=u.jsx("div",{className:"font-['DM_Sans',sans-serif] text-[18px] font-medium leading-[1.3] text-[#111111]",children:r});return u.jsx(f8,{open:e,onOpenChange:w=>{d&&(w||t())},children:u.jsxs(Km,{children:[u.jsx(Ym,{className:h}),u.jsx(eu,{"aria-describedby":void 0,className:G("fixed left-[50%] top-[50%] z-50 flex max-h-[calc(100dvh-48px-2*max(var(--safe-area-inset-top,0px),var(--safe-area-inset-bottom,0px)))] w-[calc(100%-48px)] max-w-[352px] translate-x-[-50%] translate-y-[-50%] flex-col 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%]","focus:outline-none",f),children:u.jsx(sn,{variant:"wide",color:"#111111",className:"flex min-h-0 w-full flex-col",children:u.jsxs("div",{className:"bg-[#FCF6E8] flex min-h-0 flex-col gap-8 pt-4 px-6 pb-4 relative",children:[d&&u.jsx("button",{onClick:t,className:"absolute right-4 top-4 z-20 flex size-8 items-center justify-center border border-black/20 bg-[#FCF6E8] text-[#111111] shadow-sm transition-colors hover:bg-[#F8EDDA]","aria-label":"Close",children:u.jsx(cr,{className:"h-4 w-4"})}),u.jsxs("div",{className:"relative flex min-h-0 flex-col",children:[u.jsx("div",{ref:y,onScroll:C,className:"min-h-0 overflow-y-auto overscroll-contain",children:g?u.jsxs("div",{className:"flex flex-row items-start gap-4",children:[u.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-2 pt-8",children:[_,b]}),u.jsx("div",{className:G("flex w-2/5 shrink-0 items-center justify-center",a),children:o})]}):u.jsxs("div",{className:"flex flex-col gap-4",children:[u.jsx("div",{className:G("flex justify-center pt-8 px-[33px] pb-[31px]",a),children:o??u.jsx("img",{src:p.icon,alt:"","aria-hidden":"true",className:"h-[70px] w-auto"})}),u.jsxs("div",{className:"flex flex-col gap-2",children:[_,b]})]})}),u.jsx("div",{"aria-hidden":"true",className:G("pointer-events-none absolute inset-x-0 bottom-0 flex h-14 items-end justify-center","bg-gradient-to-t from-[#FCF6E8] via-[#FCF6E8]/70 to-transparent","transition-opacity duration-200",v?"opacity-100":"opacity-0"),children:u.jsx(Q7,{className:"h-5 w-5 animate-bounce text-[#111111]/50"})})]}),(l||c)&&u.jsxs("div",{className:"flex flex-col gap-4",children:[l&&u.jsx("button",{onClick:l.onClick,className:G("flex h-14 w-full items-center justify-center px-6",'font-["DM_Sans",sans-serif] text-[18px] leading-[1.3]',"transition-opacity active:opacity-80",p.primaryBg,p.primaryText),children:l.label}),c&&u.jsx(sn,{variant:"button",color:p.secondaryColor,as:"button",onClick:c.onClick,className:G("flex w-full items-center justify-center p-4","transition-opacity active:opacity-80"),children:u.jsx("span",{className:G('font-["DM_Sans",sans-serif] text-[16px] leading-[1.2] relative',p.secondaryText),children:c.label})})]})]})})})]})})}const N8=e=>{const t=new Set(e.filter(n=>n.status!=="done"&&n.status!=="error").map(n=>n.batchId));return e.filter(n=>n.status!=="error"&&(t.size===0||t.has(n.batchId)))},Df=e=>e.status==="done"?1:(e.status==="error",e.progress),P8=e=>{const t=e.targetBookLabel??`Jaar ${e.birthdayYear}`,n=e.targetMonthLabel??`Maand ${e.monthNumber}`;return`${t}, ${n}`},k8=e=>e.childProfilePhotoUrl?e.childProfilePhotoUrl.startsWith("http")?e.childProfilePhotoUrl:z.storage.from("profile-pictures").getPublicUrl(e.childProfilePhotoUrl).data.publicUrl:null,I8=e=>e.trim().slice(0,1).toUpperCase()||"?";
206function R8({item:e,hasError:t}){const n=k8(e);return u.jsx("div",{className:`flex size-8 shrink-0 items-center justify-center overflow-hidden border bg-[#F1914A]/15 text-xs font-bold ${t?"border-[#E75E30]/40 text-[#E75E30]":"border-[#111111]/10 text-[#B86424]"}`,children:n?u.jsx("img",{src:n,alt:e.childName,className:"size-full object-cover"}):u.jsx("span",{children:I8(e.childName)})})}const T8=e=>{var t;return((t=e.find(n=>n.error))==null?void 0:t.error)??null};function O8(){const{t:e}=_e(),{items:t,cancelFailedItems:n,isTraySuppressed:r}=Ka(),s=Av(),[o,a]=m.useState(!1),i=m.useMemo(()=>N8(t),[t]),l=m.useMemo(()=>i.filter(R=>R.status!=="done"),[i]),c=m.useMemo(()=>t.filter(R=>R.status==="error"),[t]),d=l.length>0||c.length===0,f=d?i:c,h=m.useMemo(()=>{const R=d?i.length:0,O=c.length,M=d?i:c,D=M.length===0?0:M.reduce(($,H)=>$+Df(H),0)/M.length;return{uploadCount:R,errorCount:O,progress:D}},[c,d,i]),p=m.useMemo(()=>{const R=new Map;return f.forEach(O=>{const M=`${O.childId}-${O.birthdayYear}-${O.monthNumber}`,D=`${O.childName}: ${P8(O)}`,$=R.get(M);$?($.count+=1,$.items.push(O)):R.set(M,{label:D,count:1,items:[O]})}),Array.from(R.values())},[f]),g=f.length===0&&s.hasActive;if(r||f.length===0&&!g)return null;const y=e("uploadQueue.cancelFailedUploads","Cancel failed uploads"),v=h.errorCount>0&&h.uploadCount===0,x=s.queued>0||s.uploading>0,C=s.completed>0&&s.total===0,_=s.errored>0&&!x,b=C?e("quickPhoto.backgroundCompleted",{count:s.completed,defaultValue:s.completed===1?"1 photo uploaded.":`${s.completed} photos uploaded.`}):_?e("quickPhoto.backgroundRetryNeeded",{count:s.errored,defaultValue:s.errored===1?"1 photo upload will retry shortly.":`${s.errored} photo uploads will retry shortly.`}):e("quickPhoto.backgroundUploading",{count:s.total,defaultValue:s.total===1?"1 photo is uploading in background.":`${s.total} photos are uploading in background.`}),w=e("quickPhoto.backgroundBreakdown",{queued:s.queued,uploading:s.uploading,completed:s.completed,failed:s.errored,defaultValue:`Queued: ${s.queued} · Uploading: ${s.uploading} · Completed: ${s.completed} · Failed: ${s.errored}`}),P=g?b:v?e("uploadQueue.errorTitle",{count:h.errorCount,defaultValue:h.errorCount===1?"1 photo could not be uploaded":`${h.errorCount} photos could not be uploaded`}):e("uploadQueue.uploadingTitle",{count:h.uploadCount,defaultValue:h.uploadCount===1?"1 photo is being organized":`${h.uploadCount} photos are being organized`}),N=g?C||_?1:s.uploading>0?.55:.18:h.progress,E=s.total||s.completed||s.errored,A=g?C?"100%":e("uploadQueue.photoCount",{count:E,defaultValue:E===1?"1 photo":`${E} photos`}):`${Math.round(h.progress*100)}%`,k=N>=1&&!v&&!_,T=v||_?"warning":k?"success":"info",I=g?w:v?e("uploadQueue.modalErrorBody","A few photos could not be uploaded. You can keep using Little Chapters and try again later."):k?e("uploadQueue.modalDoneBody","Your photos were placed in the right chapters."):e("uploadQueue.modalUploadingBody","We are placing the selected photos in the right year and month.");return u.jsxs("div",{className:"fixed left-3 right-3 z-[45] md:left-auto md:right-5 md:w-[380px]",style:{bottom:"calc(var(--safe-area-inset-bottom, 0px) + 96px)"},children:[u.jsx(uo,{open:o,onClose:()=>a(!1),variant:T,title:P,primaryAction:k?{label:e("common.done","Done"),onClick:()=>a(!1)}:void 0,secondaryAction:v&&c.length>0?{label:y,onClick:()=>{n(c.map(R=>R.id)),a(!1)}}:_?{label:y,onClick:()=>{s.cancelRetrying(),a(!1)}}:void 0,children:u.jsxs("div",{className:"space-y-4 text-[14px] font-medium leading-[1.3]",children:[u.jsx("p",{className:"text-[18px]",children:I}),u.jsxs("div",{className:"space-y-2",children:[u.jsx("div",{className:"h-2 overflow-hidden bg-[#111111]/10",children:u.jsx("div",{className:`h-full transition-[width] duration-300 ${v||_?"bg-[#E75E30]":"bg-[#509B6C]"}`,style:{width:`${Math.round(N*100)}%`}})}),u.jsxs("div",{className:"flex justify-between text-xs font-semibold text-[#111111]/55",children:[u.jsx("span",{children:g?e("uploadQueue.photoCount",{count:E,defaultValue:E===1?"1 photo":`${E} photos`}):f.length>0?e("uploadQueue.photoCount",{count:f.length,defaultValue:f.length===1?"1 photo":`${f.length} photos`}):e("uploadQueue.preparing","Preparing...")}),u.jsx("span",{children:A})]})]}),u.jsx("div",{className:"max-h-[42vh] overflow-y-auto pr-1",children:g?u.jsx("div",{className:"border border-[#111111]/10 bg-white px-3 py-3",children:u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("div",{className:"flex size-8 shrink-0 items-center justify-center bg-[#F1914A]/15 text-[#E75E30]",children:C?u.jsx(ef,{className:"size-4 text-[#509B6C]"}):_?u.jsx(Il,{className:"size-4"}):u.jsx(X7,{className:"size-4"})}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsx("p",{className:"truncate text-sm font-semibold text-[#111111]",children:b}),u.jsx("p",{className:"text-xs text-[#111111]/55",children:w})]}),_&&u.jsx("button",{type:"button",onClick:()=>{s.cancelRetrying(),a(!1)},className:"flex size-8 shrink-0 items-center justify-center border border-[#
206E75E30]/25 bg-[#FFFEFB] text-[#E75E30] transition-colors hover:bg-[#E75E30]/10","aria-label":y,title:y,children:u.jsx(cr,{className:"size-4"})})]})}):u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"grid grid-cols-8 gap-1.5",children:f.slice(0,16).map(R=>u.jsxs("div",{className:"relative aspect-square overflow-hidden border border-[#111111]/15 bg-white",children:[u.jsx("img",{src:R.preparedFile.objectUrl,alt:R.preparedFile.originalName,className:"size-full object-cover"}),u.jsx("div",{className:"absolute inset-x-0 bottom-0 h-1 bg-[#111111]/15",children:u.jsx("div",{className:`h-full ${R.status==="error"?"bg-[#E75E30]":"bg-[#F1914A]"}`,style:{width:`${Math.round(Df(R)*100)}%`}})})]},R.id))}),u.jsx("div",{className:"mt-4 divide-y divide-[#111111]/10 border border-[#111111]/10 bg-white",children:p.map(R=>{const O=R.items.every($=>$.status==="error"),M=O?T8(R.items):null,D=R.items.filter($=>$.status==="error").map($=>$.id);return u.jsxs("div",{className:"flex items-center gap-3 px-3 py-3",children:[u.jsx(R8,{item:R.items[0],hasError:O}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsx("p",{className:"truncate text-sm font-semibold text-[#111111]",children:R.label}),u.jsx("p",{className:"text-xs text-[#111111]/55",children:e("uploadQueue.photoCount",{count:R.count,defaultValue:R.count===1?"1 photo":`${R.count} photos`})}),M&&u.jsx("p",{className:"mt-1 break-words text-xs leading-snug text-[#E75E30]",children:M})]}),O&&D.length>0&&u.jsx("button",{type:"button",onClick:()=>void n(D),className:"flex size-8 shrink-0 items-center justify-center border border-[#E75E30]/25 bg-[#FFFEFB] text-[#E75E30] transition-colors hover:bg-[#E75E30]/10","aria-label":y,title:y,children:u.jsx(cr,{className:"size-4"})})]},R.label)})})]})})]})}),u.jsxs("button",{type:"button",onClick:()=>a(R=>!R),className:"flex w-full items-center gap-3 border border-[#111111]/10 bg-[#FFFEFB] px-3 py-3 text-left text-[#111111] shadow-[0_10px_24px_rgba(17,17,17,0.10)] transition-colors hover:bg-[#FCF6E8]",children:[u.jsx("div",{className:`flex size-9 shrink-0 items-center justify-center ${v||_?"text-[#E75E30]":"bg-transparent"}`,children:v||_?u.jsx(Il,{className:"size-5"}):N>=1?u.jsx(ef,{className:"size-5 text-[#509B6C]"}):u.jsx(qc,{className:"size-6 bg-transparent",size:"xs"})}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsxs("div",{className:"flex items-center justify-between gap-3",children:[u.jsx("p",{className:"truncate text-sm font-semibold text-[#111111]",children:P}),u.jsx("span",{className:"text-xs font-semibold text-[#111111]/55",children:A})]}),u.jsx("div",{className:"mt-1.5 h-1 overflow-hidden bg-[#111111]/8",children:u.jsx("div",{className:`h-full ${v||_?"bg-[#E75E30]":"bg-[#509B6C]"}`,style:{width:`${Math.round(N*100)}%`}})})]}),u.jsx(Y7,{className:`size-4 shrink-0 text-[#111111]/50 transition-transform ${o?"rotate-180":""}`})]})]})}const Xm="/auth/callback",j8="https://littlechapters.app",L8="com.littlechapters.app://auth",M8=new Set(["littlechapters.app","www.littlechapters.app"]),D8=new Set(["signup","invite","magiclink","recovery","email_change","email"]),F8=Xm,KP=`${j8}${Xm}`,Ff=L8,U8="The login link is missing authentication details.",Zm=e=>{try{const t=new URL(e);return t.protocol==="com.littlechapters.app:"&&t.host==="auth"?!0:t.protocol==="https:"&&M8.has(t.host)&&t.pathname===F8}catch{return!1}},B8=e=>new URLSearchParams(e.hash.replace(/^#/,"")),zn=(e,t)=>e.searchParams.get(t)||B8(e).get(t),$8=e=>e&&D8.has(e)?e:"email",z8=async e=>{try{const t=new URL(e),n=zn(t,"error"),r=zn(t,"error_description");if(n)return{ok:!1,error:r||n};const s=zn(t,"token_hash");if(s){const{error:l}=await z.auth.verifyOtp({token_hash:s,type:$8(zn(t,"type"))});return l?{ok:!1,error:l.message}:{ok:!0}
206}const o=zn(t,"code");if(o){const{error:l}=await z.auth.exchangeCodeForSession(o);return l?{ok:!1,error:l.message}:{ok:!0}}const a=zn(t,"access_token"),i=zn(t,"refresh_token");if(a&&i){const{error:l}=await z.auth.setSession({access_token:a,refresh_token:i});return l?{ok:!1,error:l.message}:{ok:!0}}return{ok:!1,error:U8}}catch(t){return Ce(t,{area:"auth",action:"auth_callback_url_parse",extra:{callbackUrl:e}}),{ok:!1,error:"Unable to process this login link."}}},Mn=we("Browser",{web:()=>B(()=>import("./web_B9DG_y3K.js"),__vite__mapDeps([15,1,2,3,4])).then(e=>new e.BrowserWeb)}),V8=Object.freeze(Object.defineProperty({__proto__:null,Browser:Mn},Symbol.toStringTag,{value:"Module"})),QP=!0,H8="com.littlechapters.app://google-photos-callback",Bl="littlechapters:google-photos-callback",W8=e=>e.startsWith(H8),q8="google-photos-auth",G8="https://photospicker.googleapis.com/v1",Jm=5*60*1e3,Uf=30*60*1e3,K8=15*1e3,Q8=4,Y8=30*1e3,Bf=[1e3,3e3];class tu extends Error{constructor(){super("Google Photos connection expired"),this.name="GooglePhotosReconnectRequired"}}const Ks=new WeakMap,nu=e=>new Promise(t=>setTimeout(t,e)),$f=(e,t)=>{if(!e)return t;const n=Number.parseFloat(e);return Number.isFinite(n)&&n>0?n*1e3:t},fo=async(e,t)=>{const{data:n,error:r}=await z.functions.invoke(q8,{body:{action:e,...t}});if(r){const s=r.context;throw(s==null?void 0:s.status)===409?(Ja({connected:!1}),new tu):new Error(`Google Photos ${e} failed: ${r.message??"unknown error"}`)}return n},e0="google_photos_status_v1",Ja=e=>{Re.set({key:e0,value:JSON.stringify(e)}).catch(()=>{})},YP=async()=>{try{const{value:e}=await Re.get({key:e0});return e?JSON.parse(e):null}catch{return null}},Fs=async()=>{const e=await fo("status");return Ja(e),e};let Is=null;const t0=async()=>{if(Is&&Is.expiresAt-Date.now()>6e4)return Is.token;const{accessToken:e,expiresInSeconds:t}=await fo("token");return Is={token:e,expiresAt:Date.now()+t*1e3},e},X8=()=>{Is=null},n0="lcGooglePhotos",Z8=3500,J8=()=>{var o,a;const n=Math.max(0,Math.round(((((o=window.screen)==null?void 0:o.width)??520)-520)/2)),r=Math.max(0,Math.round(((((a=window.screen)==null?void 0:a.height)??720)-720)/2)),s=window.open("about:blank",n0,`popup=yes,width=520,height=720,left=${n},top=${r}`);if(s)try{s.document.title="Google Photos",s.document.body.style.cssText="margin:0;display:flex;align-items:center;justify-content:center;height:100vh;font-family:system-ui,sans-serif;color:#4b5563;background:#fcf6e8",s.document.body.textContent="Loading…"}catch{}return s},ew=async e=>{const{url:t}=await fo("start",{platform:"web"}),n=e&&!e.closed?e:J8();return n?(n.location.href=t,await new Promise(r=>{let s=!1;const o=[],a=d=>{if(!s){s=!0;for(const f of o)f();d.connected?(Ja({connected:!0}),Fs().catch(()=>{})):e!==n&&!n.closed&&n.close(),r(d)}},i=d=>{const f=d.data;!f||f.source!=="lc-google-photos"||(f.status==="connected"?a({connected:!0}):a({connected:!1,reason:f.reason??"error"}))};window.addEventListener("message",i),o.push(()=>window.removeEventListener("message",i));const l=Date.now(),c=setInterval(()=>{if(Date.now()-l>Jm){a({connected:!1,reason:"timeout"});return}if(n.closed){clearInterval(c),Fs().then(d=>a(d.connected?{connected:!0}:{connected:!1,reason:"window_closed"})).catch(()=>a({connected:!1,reason:"window_closed"}));return}Fs().then(d=>{d.connected&&a({connected:!0})}).catch(()=>{})},Z8);o.push(()=>clearInterval(c))})):{connected:!1,reason:"popup_blocked"}},XP=async(e={})=>{if(X8(),!j.isNativePlatform())return ew(e.webPopup??null);const{url:t}=await fo("start");let n=null,r;try{const s=await new Promise(o=>{const a=setTimeout(()=>o({connected:!1,reason:"timeout"}),Jm),i=l=>{clearTimeout(a),o(l)};n=l=>{var f;const c=((f=l.detail)==null?void 0:f.url)??"",d=new URLSearchParams(c.split("?")[1]??"");d.get("status")==="connected"?i({connected:!0}):i({connected:!1,reason:d.get("reason")??"error"})},window.addEventListener(Bl,n),Ge.addListener("appStateChange",({isActive:l})=>{l&&nu(700).then(()=>Fs()).then(c=>{c.connected&&i({connected:!0})}).catch(()=>{})}).then(l=>{r=l}),Mn.open({url:t})});return s.connected&&(Ja({connected:!0}),Fs().catch(()=>{})),s}finally{n&&window.removeEventListener(Bl,n),r==null||r.remove(),Mn.close().catch(()=>{})}},ts=async(e,t,n={})=>{const r=new AbortController;let s;const o=new Promise((i,l)=>{s=setTimeout(()=>{r.abort(),l(new TypeError(`Picker API ${e} network request timed out`))},K8)});let a;try{a=await Promise.race([fetch(`${G8}${e}`,{...n,signal:r.signal,headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/json",...n.headers}}),o])}finally{s&&clearTimeout(s)}if(!a.ok){const i=await a.text().catch(()=>"");throw new r0(`Picker API ${e} failed (${a.status}): ${i.slice(0,300)}`)}return await a.json()};
206class r0 extends Error{constructor(t){super(t),this.name="PickerApiResponseError"}}const tw=e=>{if(e instanceof r0)return!1;if(e instanceof TypeError)return!0;const t=e instanceof Error?e.message:typeof e=="object"&&e&&"message"in e?String(e.message):String(e);return/unable to resolve host|failed to fetch|network request failed|network error|load failed|err_(?:name_not_resolved|internet_disconnected|network_changed|connection)|timed? ?out|socket|connection (?:reset|closed|refused|aborted)/i.test(t)},Xo=e=>{try{const t=new URL(e);return t.pathname.endsWith("/autoclose")||(t.pathname=`${t.pathname.replace(/\/$/,"")}/autoclose`),t.toString()}catch{return e}},nw=async(e,t,n=!1,r=null)=>{var p,g;const s=j.isNativePlatform(),o=Math.max($f((p=e.pollingConfig)==null?void 0:p.pollInterval,3e3),1500),a=Math.min($f((g=e.pollingConfig)==null?void 0:g.timeoutIn,Uf),Uf),i=Date.now();let l=n?Date.now():null,c=0,d=s?await Ge.getState().then(({isActive:y})=>y).catch(()=>!0):!0;const f=s?await Mn.addListener("browserFinished",()=>{l=Date.now()}).catch(()=>{}):void 0,h=s?await Ge.addListener("appStateChange",({isActive:y})=>{d=y}).catch(()=>{}):void 0;try{for(;Date.now()-i<a;){if(await nu(o),l===null&&(r!=null&&r.closed)&&(l=Date.now()),!d)continue;let y;try{y=await ts(`/sessions/${e.id}`,t),c=0}catch(v){if(!tw(v))throw v;c+=1,console.warn(`Google Photos session poll temporarily failed; retrying (${c})`);continue}if(y.mediaItemsSet)return!0;if(l&&Date.now()-l>o*2+2e3)return!1}return!1}finally{f==null||f.remove(),h==null||h.remove()}},rw=async(e,t)=>{const n=[];let r;do{const s=new URLSearchParams({sessionId:e,pageSize:"100"});r&&s.set("pageToken",r);const o=await ts(`/mediaItems?${s}`,t);n.push(...o.mediaItems??[]),r=o.nextPageToken}while(r);return n};class s0 extends Error{constructor(t,n){super(t),this.status=n,this.name="GooglePhotosDownloadError"}}const sw=async(e,t,n,r,s)=>{var c,d,f;const o=(c=e.mediaFile)==null?void 0:c.baseUrl;if(!o)throw new Error("Picked media item is missing its baseUrl");let a;if(j.isNativePlatform()){const h=await fetch(`${o}=w${n}-h${n}`,{headers:{Authorization:`Bearer ${t}`},signal:s});if(!h.ok)throw new s0(`Google Photos download failed (${h.status})`,h.status);a=await h.blob()}else if(a=await fo("download",{baseUrl:o,maxDimension:n}),!(a instanceof Blob))throw new Error("Google Photos download proxy returned no image data");const i=e.createTime?Date.parse(e.createTime):Number.NaN,l=((f=(d=e.mediaFile)==null?void 0:d.filename)==null?void 0:f.trim())||`google-photos-${r+1}.jpg`;return new File([a],l,{type:a.type&&a.type.startsWith("image/")?a.type:"image/jpeg",lastModified:Number.isFinite(i)&&i>0?i:Date.now()})},ow=e=>e instanceof tu?!1:e instanceof s0?e.status===void 0||e.status===429||e.status>=500:!0,aw=async(e,t,n,r)=>{for(let s=0;;s+=1){const o=new AbortController,a=setTimeout(()=>o.abort(),Y8);try{return await sw(e,t,n,r,o.signal)}catch(i){if(!ow(i)||s>=Bf.length)throw i;await nu(Bf[s])}finally{clearTimeout(a)}}},o0=e=>JSON.stringify(e&&e>0?{pickingConfig:{maxItemCount:String(e)}}:{}),ZP=async(e={})=>{const t=await t0(),n=await ts("/sessions",t,{method:"POST",body:o0(e.maxItems)}),r={pickerUri:Xo(n.pickerUri)};return Ks.set(r,{accessToken:t,session:n}),r},JP=async e=>{const t=Ks.get(e);t&&(Ks.delete(e),await ts(`/sessions/${t.session.id}`,t.accessToken,{method:"DELETE"}).catch(()=>{}))},ek=async e=>{const t=e.preparation?Ks.get(e.preparation):void 0;if(e.preparation&&!t)throw new Error("Google Photos picker session is no longer available");e.preparation&&Ks.delete(e.preparation);const n=(t==null?void 0:t.accessToken)??await t0(),r=(t==null?void 0:t.session)??await ts("/sessions",n,{method:"POST",body:o0(e.maxItems)}),s=()=>{ts(`/sessions/${r.id}`,n,{method:"DELETE"}).catch(()=>{})};let o=!1,a=null;try{if(!e.pickerAlreadyPresented)if(j.isNativePlatform())await Mn.open({url:Xo(r.pickerUri)}),o=!0;else{const b=e.webPopup&&!e.webPopup.closed?e.webPopup:null;if(b?(b.location.href=Xo(r.pickerUri),a=b):a=window.open(Xo(r.pickerUri),n0),!a)throw new Error("Google Photos window was blocked by the browser")}if(!await nw(r,n,e.pickerAlreadyPresented===!0,a))return{cancelled:!0,files:[],skippedVideos:0,truncated:0,failedCount:0};const l=await rw(r.id,n),c=l.filter(b=>{var P;if(b.type&&b.type!=="PHOTO")return!1;const w=(P=b.mediaFile)==null?void 0:P.mimeType;return!w||w.startsWith("image/")}),d=l.length-c.length,f=c.slice(0,e.maxItems),h=f.length,p=new Array(h).fill(null);let g=0,y=0,v=null;const x=()=>{var b;return(b=e.onProgress)==null?void 0:b.call(e,{phase:"downloading",completed:g,failed:y,total:h})};h>0&&x();let C=0;const _=async()=>{for(;v===null;){const b=C;if(b>=h)return;C+=1;try{p[b]=await aw(f[b],n,e.maxDimension,b),g+=1}catch(w){if(w instanceof tu){v=w;return}y+=1,console.warn("Google Photos download failed after retries",
206w==null?void 0:w.message)}x()}};if(await Promise.all(Array.from({length:Math.min(Q8,h)},_)),v)throw v;return{cancelled:!1,files:p.filter(b=>b!==null),skippedVideos:d,truncated:c.length-f.length,failedCount:y}}finally{o&&await Mn.close().catch(()=>{}),a&&!a.closed&&a.close(),s()}},iw="lc:notification-debug-events";let zf=!1;const a0=()=>{if(!zf){zf=!0;try{localStorage.removeItem(iw)}catch{}}},be=(e,t={})=>{a0()},lw=async()=>{a0()};let Vf=!1,Lo=null;const cw=3e3,uw=e=>{try{const t=new URL(e);return`${t.pathname}${t.search}${t.hash}`}catch{const t=e.split(".app");return t.length>1?t[1]:null}},dw=()=>{const e=tt();return m.useEffect(()=>{let t=!0,n;const r=(s,o)=>{if(be("app_url_open_received",{}),Zm(s)){be("app_url_open_auth_callback_ignored",{});return}if(W8(s)){window.dispatchEvent(new CustomEvent(Bl,{detail:{url:s}}));return}if(Lo&&Lo.url===s&&Date.now()-Lo.at<cw){be("app_url_open_duplicate_ignored",{});return}const a=uw(s);be("app_url_open_navigate",{}),a&&a!=="/"&&(Lo={url:s,at:Date.now()},console.log("[AppUrlListener] Navigating to:",a),e(a))};return Vf||(Vf=!0,Ge.getLaunchUrl().then(s=>{t&&(s!=null&&s.url)&&(console.log("[AppUrlListener] Launch URL:",s.url),r(s.url))}).catch(s=>{console.warn("[AppUrlListener] Failed to read launch URL:",s)})),Ge.addListener("appUrlOpen",s=>{console.log("[AppUrlListener] Deep link opened:",s.url),r(s.url)}).then(s=>{t?n=s:s.remove()}).catch(s=>{console.warn("[AppUrlListener] Failed to add appUrlOpen listener:",s)}),()=>{t=!1,n==null||n.remove()}},[e]),null},ba="lc:pending-invite-token",fw=7*24*60*60*1e3,hw=e=>{try{const t={token:e,storedAt:Date.now()};localStorage.setItem(ba,JSON.stringify(t))}catch{}},tk=()=>{try{const e=localStorage.getItem(ba);if(!e)return null;const t=JSON.parse(e);return!(t!=null&&t.token)||Date.now()-t.storedAt>fw?(localStorage.removeItem(ba),null):t.token}catch{return null}},nk=()=>{try{localStorage.removeItem(ba)}catch{}},Lt=e=>e.toUpperCase().replace(/[^A-Z0-9]/g,"").slice(0,24),i0=e=>!!e&&/^[A-Z0-9]{3,24}$/.test(Lt(e)),pw=()=>{const e=j.getPlatform();return e==="ios"||e==="android"?e:"web"};async function mw(e){const{data:t,error:n}=await z.rpc("get_plus_promo_code_preview",{p_code:Lt(e)});if(n)throw n;const r=t;return{status:r.status,code:r.code,durationDays:r.duration_days}}async function gw(e,t){const{data:n,error:r}=await z.rpc("redeem_plus_promo_code",{p_code:Lt(e),p_platform:pw(),p_source:t});if(r)throw r;const s=n;return{status:s.status,code:s.code,durationDays:s.duration_days,promoUntil:s.promo_until??null}}const wa="lc:pending-plus-promo-code",yw=30*24*60*60*1e3,$l="lc:plus-promo-settled",l0=e=>{const t=Lt(e);if(i0(t))try{const n={code:t,storedAt:Date.now()};localStorage.setItem(wa,JSON.stringify(n))}catch{}},c0=()=>{try{const e=localStorage.getItem(wa);if(!e)return null;const t=JSON.parse(e);return!(t!=null&&t.code)||Date.now()-t.storedAt>yw?(localStorage.removeItem(wa),null):t.code}catch{return null}},vw=()=>{try{localStorage.removeItem(wa)}catch{}window.dispatchEvent(new Event($l))},bw=we("InstallReferrer"),Hf="lc:install-referrer-checked",ww=/^[A-Za-z0-9]{8}$/,xw=async()=>{if(j.getPlatform()!=="android")return null;try{if(localStorage.getItem(Hf))return null;localStorage.setItem(Hf,"1")}catch{return null}try{const{referrer:e}=await bw.getReferrer();if(!e)return null;const t=new URLSearchParams(e),n=t.get("plus");n&&l0(n);const r=t.get("invite");if(!r||!ww.test(r))return null;const s=r.toUpperCase();return hw(s),s}catch{return null}};var Wf;(function(e){e.Dark="DARK",e.Light="LIGHT",e.Default="DEFAULT"})(Wf||(Wf={}));var zl;(function(e){e.Body="body",e.Ionic="ionic",e.Native="native",e.None="none"})(zl||(zl={}));const kn=we("Keyboard"),qf={isVisible:!1,keyboardHeight:0};function u0(){const[e,t]=m.useState(qf);return m.useEffect(()=>{if(!j.isNativePlatform())return;const n=()=>{t(i=>i.isVisible||i.keyboardHeight!==0?qf:i)},r=[kn.addListener("keyboardWillShow",i=>{t({isVisible:!0,keyboardHeight:i.keyboardHeight})}),kn.addListener("keyboardWillHide",n),kn.addListener("keyboardDidShow",i=>{t({isVisible:!0,keyboardHeight:i.keyboardHeight})}),kn.addListener("keyboardDidHide",n)];let s=null,o=!1;Ge.addListener("appStateChange",({isActive:i})=>{i||n()}).then(i=>{if(o){i.remove();return}s=i}).catch(()=>{});const a=()=>{document.visibilityState==="hidden"&&n()};return document.addEventListener("visibilitychange",a),()=>{o=!0,document.removeEventListener("visibilitychange",a),r.forEach(i=>
206i.then(l=>l.remove())),s&&s.remove()}},[]),e}function d0(e){const t=j.getPlatform()==="ios",{isVisible:n,keyboardHeight:r}=u0();m.useEffect(()=>{if(!e||!t)return;let o=null;return(async()=>{try{o=(await kn.getResizeMode()).mode}catch{o=null}try{await kn.setResizeMode({mode:zl.None})}catch{}})(),()=>{o&&kn.setResizeMode({mode:o}).catch(()=>{})}},[e,t]);const s=t&&n;return{isKeyboardVisible:s,keyboardHeight:r,keyboardPadding:s?`${r}px`:null}}const rk="profile-pictures",sk=[{value:"birth_date",titleKey:"addChildModal.startMode.birthDateTitle"},{value:"birth_month",titleKey:"addChildModal.startMode.birthMonthTitle"},{value:"calendar_year",titleKey:"addChildModal.startMode.calendarYearTitle"}],Gf="flex h-14 w-full items-center justify-center bg-[#F1914A] px-6 text-[18px] font-medium leading-[1.3] text-[#FFFEFB] transition-opacity hover:opacity-95",Cw="flex-shrink-0 px-6 pb-8 pt-2 bg-[#FCF6E8]",xa=e=>["plus-status",e];async function f0(){const{data:e,error:t}=await z.rpc("get_plus_status");if(t)throw t;const n=e;return{isPlus:n.is_plus===!0,status:n.status??"expired",comp:n.comp===!0,entitledUntil:n.entitled_until??null,plan:n.plan??null,bookDiscountPercent:n.book_discount_percent??0,source:n.source??null,promoCode:n.promo_code??null,promoUntil:n.promo_until??null}}function _w(){const{user:e}=ge(),{data:t,isLoading:n}=hr({queryKey:xa(e==null?void 0:e.id),enabled:!!e,staleTime:6e4,queryFn:f0});return{isPlus:(t==null?void 0:t.isPlus)??!1,bookDiscountPercent:(t==null?void 0:t.bookDiscountPercent)??0,plusStatus:t??null,isLoading:n}}const Kf=5,Qf=e=>["story-ai-free-uses",e];function ok(){const{user:e}=ge(),t=ut(),{isPlus:n,isLoading:r}=_w(),{data:s}=hr({queryKey:Qf(e==null?void 0:e.id),enabled:!!e&&!r&&!n,staleTime:3e4,queryFn:async()=>{const{data:a,error:i}=await z.rpc("get_story_ai_lifetime_used");if(i)throw i;return typeof a=="number"?a:0}}),o=m.useCallback(()=>{t.invalidateQueries({queryKey:Qf(e==null?void 0:e.id)})},[t,e==null?void 0:e.id]);return{freeUsesRemaining:n||s===void 0?null:Math.max(0,Kf-s),freeUseLimit:Kf,invalidateFreeUses:o}}function ak(){const{user:e}=ge(),t=ut(),[n,r]=m.useState(!1),s=m.useCallback(async()=>{for(let a=0;a<8;a++){try{const i=await f0();if(i.isPlus)return t.setQueryData(xa(e==null?void 0:e.id),i),!0}catch{}await new Promise(i=>setTimeout(i,2e3))}return!1},[t,e==null?void 0:e.id]);return{purchasePlus:m.useCallback(async()=>{r(!0);try{const a=await a7();if(a===tr.PURCHASED||a===tr.RESTORED){const i=await s();return t.invalidateQueries({queryKey:xa(e==null?void 0:e.id)}),i?"activated":"pending"}return a===tr.ERROR?"error":"cancelled"}catch(a){return Ce(a,{area:"plus",action:"purchase_plus"}),"error"}finally{r(!1)}},[t,e==null?void 0:e.id,s]),isPurchasing:n}}const Yf={invalid:"plus.promo.errors.invalid",expired:"plus.promo.errors.expired",already_redeemed:"plus.promo.errors.alreadyRedeemed",already_plus:"plus.promo.errors.alreadyPlus",rate_limited:"plus.promo.errors.rateLimited"},Ew=({isOpen:e,onClose:t,source:n,initialCode:r,onRedeemed:s,zIndexClassName:o="z-[95]"})=>{const{t:a,i18n:i}=_e(),{user:l}=ge(),c=ut(),[d,f]=m.useState("entry"),[h,p]=m.useState(r?Lt(r):""),[g,y]=m.useState(null),[v,x]=m.useState(!1),[C,_]=m.useState(!1),[b,w]=m.useState(null),[P,N]=m.useState(null),{keyboardPadding:E}=d0(e);m.useEffect(()=>{e&&(f("entry"),p(r?Lt(r):""),y(null),w(null),N(null),_(!1),je("plus_promo_sheet_shown",{source:n}))},[e,r,n]),m.useEffect(()=>{if(!e||!r)return;let O=!1;return x(!0),mw(r).then(M=>{O||(M.status==="ok"?y(M.durationDays??null):w(a(Yf[M.status])))}).catch(()=>{}).finally(()=>{O||x(!1)}),()=>{O=!0}},[e,r,a]);const A=()=>{C||t()},k=async()=>{const O=Lt(h);if(O.length<3){w(a("plus.promo.errors.invalid"));return}_(!0),w(null),je("plus_promo_redeem_started",{source:n});try{const M=await gw(O,n);M.status==="ok"?(N(M),f("success"),c.invalidateQueries({queryKey:xa(l==null?void 0:l.id)}),je("plus_promo_redeemed",{source:n,code:M.code??O,duration_days:M.durationDays??0}),s==null||s(M)):(w(a(Yf[M.status])),je("plus_promo_redeem_failed",{source:n,status:M.status}))}catch(M){Ce(M,{area:"plus",action:"redeem_promo_code"}),w(a("plus.promo.errors.generic"))}finally{_(!1)}},T=O=>{if(!O)return"";try{return new Date(O).toLocaleDateString(i.language,{day:"numeric",month:"long",year:"numeric"})}catch{return O.slice(0,10)}},I=d==="success",R=!!r&&!b;return Cc.createPortal(u.jsx(J2,{children:e&&u.jsxs(Mt.div,{initial:{opacity:0}
206,animate:{opacity:1},exit:{opacity:0},className:`fixed inset-0 ${o} flex items-end sm:items-center justify-center`,children:[u.jsx(Mt.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"absolute inset-0 bg-black/50",onClick:A}),u.jsxs(Mt.div,{initial:{opacity:0,y:100},animate:{opacity:1,y:0},exit:{opacity:0,y:100},transition:{type:"spring",damping:25,stiffness:300},role:"dialog","aria-modal":"true","aria-label":a("plus.promo.title"),className:"relative w-full sm:max-w-[402px] bg-[#FCF6E8] overflow-hidden flex flex-col transition-[padding] duration-200 ease-in-out",style:{maxHeight:"calc(100vh - var(--safe-area-inset-top, 0px) - 16px)",paddingBottom:E??"env(safe-area-inset-bottom, 0px)"},children:[u.jsxs("div",{className:"flex-1 overflow-y-auto px-6 pt-6 pb-4",children:[u.jsx("div",{className:"flex justify-end mb-2",children:u.jsx("button",{type:"button",onClick:A,disabled:C,className:"flex size-8 shrink-0 items-center justify-center border border-black/20 text-[#111111] transition-colors hover:bg-black/5 disabled:opacity-50","aria-label":a("common.close"),children:u.jsx(cr,{className:"h-4 w-4"})})}),u.jsx("div",{className:"flex justify-center mb-5",children:u.jsx("div",{className:`flex h-16 w-16 items-center justify-center rounded-full ${I?"bg-[#509B6C]/10":"bg-[#F1914A]/10"}`,children:I?u.jsx(kp,{className:"h-7 w-7 text-[#509B6C]"}):u.jsx(ay,{className:"h-7 w-7 text-[#F1914A]"})})}),I?u.jsxs("div",{className:"text-center space-y-2 mb-2",children:[u.jsx("h2",{className:"text-[24px] font-bold leading-[1.3] text-[#111111]",children:a("plus.promo.success.title")}),u.jsx("p",{className:"text-[16px] leading-[1.4] text-[#111111]",children:a("plus.promo.success.body",{days:(P==null?void 0:P.durationDays)??0,date:T(P==null?void 0:P.promoUntil)})})]}):u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"text-center space-y-2 mb-6",children:[u.jsx("h2",{className:"text-[24px] font-bold leading-[1.3] text-[#111111]",children:a("plus.promo.title")}),u.jsx("p",{className:"text-[16px] leading-[1.4] text-[#111111]",children:R?v||g===null?a("plus.promo.linkIntroGeneric",{code:h}):a("plus.promo.linkIntro",{code:h,days:g}):a("plus.promo.description")})]}),!R&&u.jsx("input",{type:"text",value:h,onChange:O=>{p(Lt(O.target.value)),b&&w(null)},onKeyDown:O=>{O.key==="Enter"&&k()},placeholder:a("plus.promo.placeholder"),autoCapitalize:"characters",autoCorrect:"off",autoComplete:"off",spellCheck:!1,inputMode:"text","aria-label":a("plus.promo.placeholder"),className:"mb-3 flex h-12 w-full rounded-none border border-[#111111]/25 bg-white px-3 text-center text-[18px] font-semibold uppercase tracking-[0.15em] text-[#111111] placeholder:font-normal placeholder:normal-case placeholder:tracking-normal placeholder:text-[#111111]/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#F1914A]"}),b&&u.jsx("p",{className:"text-center text-[14px] leading-[1.4] text-red-600 mb-2",children:b})]})]}),u.jsx("div",{className:`${Cw} space-y-3`,children:I?u.jsx("button",{type:"button",onClick:t,className:Gf,children:a("plus.promo.success.cta")}):u.jsxs(u.Fragment,{children:[u.jsx("button",{type:"button",onClick:()=>void k(),disabled:C||v||Lt(h).length<3,className:`${Gf} disabled:cursor-not-allowed disabled:opacity-60`,children:C?u.jsx(Mc,{className:"h-5 w-5 animate-spin"}):a("plus.promo.activate")}),u.jsx("button",{type:"button",onClick:A,disabled:C,className:"flex h-11 w-full items-center justify-center text-[16px] font-medium text-[#111111]/60 transition-colors hover:text-[#111111] disabled:opacity-50",children:a("plus.gate.notNow")})]})})]})]})}),document.body)};function Sw(){const{user:e,loading:t}=ge(),n=He(),[r,s]=m.useState(null),[o,a]=m.useState(!1),[i,l]=m.useState(0);return m.useEffect(()=>{const c=()=>l(d=>d+1);return window.addEventListener(Gs,c),()=>window.removeEventListener(Gs,c)},[]),m.useEffect(()=>{if(t||!e||o)return;const c=c0();if(!c)return;let d=!1;return Lc().then(f=>{d||f&&!f.completed||(s(c),a(!0))}),()=>{d=!0}},[t,e,o,i,n.pathname]),e?u.jsx(Ew,{isOpen:o,initialCode:r,source:"link",onClose:()=>{a(!1),vw()}}):null}const Xf=e=>{const t=e instanceof Error?`${e.name} ${e.message}`:typeof e=="string"?e:"";return/(Failed to fetch dynamically imported module|Importing a module script failed|ChunkLoadError|Loading chunk \d+ failed|Unable to preload CSS|error loading dynamically imported module)/i.test(t)},Zf="app:chunk-reload-state",Aw=2*60*1e3,Nw=3,Jf=[1e3,2500],Pw=e=>
206new Promise(t=>setTimeout(t,e)),h0=()=>{try{const e=Date.now(),t=sessionStorage.getItem(Zf),n=t?JSON.parse(t):null,r=n&&e-n.firstAt<Aw?n:{firstAt:e,count:0};return r.count>=Nw?!1:(sessionStorage.setItem(Zf,JSON.stringify({firstAt:r.firstAt,count:r.count+1})),window.location.reload(),!0)}catch{return!1}},kw=async e=>{var r;const n=(r=(e instanceof Error?e.message:"").match(/https?:\/\/[^\s'"]+\.m?js/))==null?void 0:r[0];if(!n)return null;try{return await B(()=>import(`${n}?cache-bust=${Date.now()}`),[])}catch{return null}};function Z(e){return L.lazy(async()=>{let t=null;for(let n=0;n<=Jf.length;n+=1)try{return n>0&&await Pw(Jf[n-1]),await e()}catch(r){if(t=r,!Xf(r))break}if(Xf(t)){const n=await kw(t);if(n&&"default"in n)return Ce(t,{area:"code_splitting",action:"cache_busted_chunk_import",level:"warning",tags:{environment:"production"}}),n;if(Ce(t,{area:"code_splitting",action:"recoverable_chunk_reload",level:"warning",tags:{environment:"production"}}),h0())return new Promise(()=>{})}throw t})}const Iw=Z(()=>B(()=>import("./Plus_By6paUpx.js"),__vite__mapDeps([16,1,17,18,4,2,3]))),Rw=Z(()=>B(()=>import("./PlusPromoLanding_Cm6PQC7D.js"),__vite__mapDeps([19,1,17,18,2,3,4])));function Tw(){const{code:e}=O2(),{user:t,loading:n,resolveUsername:r}=ge(),s=tt(),o=j.isNativePlatform(),a=e?Lt(e):"",i=i0(a)?a:null;return m.useEffect(()=>{i&&l0(i)},[i]),m.useEffect(()=>{if(!n){if(t){r().then(l=>{s(l?`/${l}`:"/onboarding",{replace:!0})});return}o&&s("/auth",{replace:!0,state:{intent:"get_started",source:"plus_promo_link"}})}},[n,t,o,s,r]),n||t||o?null:i?u.jsx(Rw,{code:i}):u.jsx(Iw,{})}const Ow=10,jw=4096,Lw=Math.max(Ow,1)*1024*1024,eh=Math.max(jw,512),Mw=new Set(["image/jpeg","image/png","image/webp","image/avif"]),Dw=.92,th=.6,Fw=.08,Uw=(e,t)=>`${e.replace(/\.[^/.]+$/,"")}.${t}`,Vl=async e=>{if(typeof window<"u"&&"createImageBitmap"in window){const r=await createImageBitmap(e,{imageOrientation:"from-image"});return{width:r.width,height:r.height,draw:(s,o,a)=>s.drawImage(r,0,0,o,a),cleanup:()=>r.close()}}const t=URL.createObjectURL(e),n=await new Promise((r,s)=>{const o=new Image;o.decoding="async",o.onload=()=>r(o),o.onerror=a=>{URL.revokeObjectURL(t),s(a)},o.src=t});return{width:n.naturalWidth,height:n.naturalHeight,draw:(r,s,o)=>r.drawImage(n,0,0,s,o),cleanup:()=>URL.revokeObjectURL(t)}},Bw=async e=>{let t=null;try{return t=await Vl(e),{width:t.width,height:t.height}}catch{return}finally{t==null||t.cleanup()}},$w=async(e,t)=>{if(!Mw.has(e.type)||e.size<=t){let r=null;try{try{r=await Vl(e)}catch{r=null}return{file:e,originalName:e.name,originalSize:e.size,wasCompressed:!1,dimensions:r?{width:r.width,height:r.height}:void 0,originalDimensions:r?{width:r.width,height:r.height}:void 0}}finally{r==null||r.cleanup()}}let n=null;try{n=await Vl(e);const r=Math.max(n.width,n.height),s=r>eh?eh/r:1,o=Math.max(Math.round(n.width*s),1),a=Math.max(Math.round(n.height*s),1),i=document.createElement("canvas");i.width=o,i.height=a;const l=i.getContext("2d",{alpha:!1});if(!l)throw new Error("Failed to prepare canvas context");l.imageSmoothingEnabled=!0,l.imageSmoothingQuality="high",n.draw(l,o,a);let c=Dw,d=null;for(let h=0;h<6&&(d=await new Promise(p=>i.toBlob(p,"image/jpeg",c)),!(!d||d.size<=t||c<=th));h+=1)c=Math.max(c-Fw,th);if(!d)throw new Error("Unable to prepare file for upload");return d.size>t?{file:e,originalName:e.name,originalSize:e.size,wasCompressed:!1,originalDimensions:{width:n.width,height:n.height},failedToReduce:!0}:{file:new File([d],Uw(e.name,"jpg"),{type:"image/jpeg",lastModified:e.lastModified}),originalName:e.name,originalSize:e.size,wasCompressed:!0,dimensions:{width:o,height:a},originalDimensions:{width:n.width,height:n.height}}}finally{n==null||n.cleanup()}},zw=65496,Vw=65505,Hw=19789,Ww=18761,qw=42,Gw=new Set([36867,36868,306]),Kw=Date.UTC(1980,0,1),Qw=7*24*60*60*1e3,sr=e=>Number.isFinite(e)&&e>=Kw&&e<=Date.now()+Qw,Hl=(e,t,n,r,s,o)=>{if(t<1||t>12||n<1||n>31||r>23||s>59||o>59)return null;const a=new Date(e,t-1,n,r,s,o);if(a.getFullYear()!==e||a.getMonth()!==t-1||a.getDate()!==n)return null;const i=a.getTime();return sr(i)?i:null},gn=e=>{if(typeof e=="number")return sr(e)?e:null;if(typeof e!="string"||!e.trim())return null;const t=Number(e);if(sr(t))return t;const n=Date.parse(e);return sr(n)?n:null},Yw=e=>gn(e.dateTakenMs)??gn(e.dateTaken)??gn(e.creationTimeMs)??gn(e.creationTime)??gn(e.lastModifiedMs)??gn(e.lastModified)??gn(e.modificationTimeMs)??gn(e.modificationTime),p0=e=>{const t=e.trim().replace(/\0+$/g,""),n=/^(\d{4}):(\d{2}):(\d{2})[ T](\d{2}):(\d{2}):(\d{2})/.exec(t);if(!n){const c=Date.parse(t);return sr(c)?c:null}const[,r,s,o,a,i,l]=n;return Hl(Number(r),Number(s),Number(o),Number(a),Number(i),Number(l))}
206,Wl=(e,t,n)=>{let r="";for(let s=0;s<n;s+=1){const o=e.getUint8(t+s);if(o===0)break;r+=String.fromCharCode(o)}return r},Xw=(e,t,n)=>{if(n<14||Wl(e,t,6)!=="Exif")return null;const r=t+6,s=e.getUint16(r,!1),o=s===Ww?!0:s===Hw?!1:null;if(o===null||e.getUint16(r+2,o)!==qw)return null;const a=e.getUint32(r+4,o),i=new Set,l=c=>{const d=r+c;if(i.has(d)||d<r||d+2>t+n)return null;i.add(d);const f=e.getUint16(d,o);for(let h=0;h<f;h+=1){const p=d+2+h*12;if(p+12>t+n)break;const g=e.getUint16(p,o),y=e.getUint16(p+2,o),v=e.getUint32(p+4,o),x=e.getUint32(p+8,o);if(Gw.has(g)&&y===2&&v>0){const C=v<=4?p+8:r+x;if(C>=r&&C+v<=t+n){const _=p0(Wl(e,C,v));if(_)return _}}if(g===34665&&y===4&&v===1){const C=l(x);if(C)return C}}return null};return l(a)},m0=e=>{const t=[/exif:DateTimeOriginal="([^"]+)"/i,/photoshop:DateCreated="([^"]+)"/i,/xmp:CreateDate="([^"]+)"/i,/<exif:DateTimeOriginal>([^<]+)<\/exif:DateTimeOriginal>/i,/<photoshop:DateCreated>([^<]+)<\/photoshop:DateCreated>/i,/<xmp:CreateDate>([^<]+)<\/xmp:CreateDate>/i];for(const n of t){const r=n.exec(e);if(!r)continue;const s=p0(r[1]);if(s)return s}return null},Zw=async e=>{const t=await e.slice(0,Math.min(e.size,524288)).arrayBuffer(),n=new DataView(t);if(n.byteLength<4||n.getUint16(0,!1)!==zw)return null;let r=2;for(;r+4<=n.byteLength&&n.getUint8(r)===255;){const s=n.getUint16(r,!1),o=n.getUint16(r+2,!1);if(o<2||r+2+o>n.byteLength)break;const a=r+4,i=o-2;if(s===Vw){const l=Xw(n,a,i);if(l)return l;const c=Wl(n,a,Math.min(i,64*1024)),d=m0(c);if(d)return d}r+=2+o}return null},Jw=e=>{const t=/(?:IMG|VID|PXL|Screenshot|signal|photo)[-_ ]?(\d{4})(\d{2})(\d{2})[-_ ]?(\d{2})?(\d{2})?(\d{2})?/i.exec(e);if(t){const[,r,s,o,a="0",i="0",l="0"]=t,c=Hl(Number(r),Number(s),Number(o),Number(a),Number(i),Number(l));if(c!==null)return c}const n=/(\d{4})[-_.](\d{2})[-_.](\d{2})(?:[-_ .](\d{2})[-_.](\d{2})(?:[-_.](\d{2}))?)?/.exec(e);if(n){const[,r,s,o,a="0",i="0",l="0"]=n,c=Hl(Number(r),Number(s),Number(o),Number(a),Number(i),Number(l));if(c!==null)return c}return null},g0=async(e,t,n)=>{if(n&&sr(n))return n;if(e.type==="image/jpeg"||e.type==="image/jpg"||/\.(jpe?g)$/i.test(t)){const r=await Zw(e);if(r)return r}if(e.type==="image/png"||/\.(png)$/i.test(t)){const r=m0(await e.slice(0,Math.min(e.size,262144)).text());if(r)return r}return Jw(t)},ik=["image/jpeg","image/png","image/gif","image/webp","image/avif"],lk=50,Bi=25,ck=100,uk=e=>`${(e/1024/1024).toFixed(e>=10*1024*1024?0:1)}MB`,dk=(e,t)=>e.length===0?t:e.length===1?e[0]:e.join(`
207`),fk=(e,t)=>{const n=atob(e),r=new Uint8Array(n.length);for(let s=0;s<n.length;s+=1)r[s]=n.charCodeAt(s);return new Blob([r],{type:t})},e9=async(e,t={})=>{const n=sr(e.lastModified)?e.lastModified:null;if(t.trustLastModified&&n)return n;try{return await g0(e,e.name)??n??void 0}catch{return n??void 0}},t9=async(e,t,n={})=>{const{deferProcessing:r=!1,deferHash:s=!1,sourceFileUri:o,nativeAssetId:a,isNativePreview:i}=n,l=n.capturedTimestamp??await e9(e,{trustLastModified:!!a});if(r){const h=URL.createObjectURL(e),p=s?null:await ha(e),g=a?void 0:n.dimensions===void 0?await Bw(e):n.dimensions??void 0;return{id:crypto.randomUUID(),file:e,sourceFileUri:o,nativeAssetId:a,isNativePreview:i,originalName:e.name,originalSize:e.size,wasCompressed:!1,objectUrl:h,dimensions:g,originalDimensions:g,contentHash:p??void 0,capturedTimestamp:l}}const c=await $w(e,t);if(c.failedToReduce)return null;const d=URL.createObjectURL(c.file),f=s?null:await ha(c.file);return{id:crypto.randomUUID(),file:c.file,sourceFileUri:c.file===e?o:void 0,nativeAssetId:a,isNativePreview:i,originalName:c.originalName,originalSize:c.originalSize,wasCompressed:c.wasCompressed,objectUrl:d,dimensions:c.dimensions,originalDimensions:c.originalDimensions,contentHash:f??void 0,capturedTimestamp:l}},ql="littlechapters:share-import-ready";let st=null;const Gl=new Set,y0=()=>{for(const e of Gl)e()},n9=e=>(Gl.add(e),()=>Gl.delete(e)),nh=()=>st,r9=()=>m.useSyncExternalStore(n9,nh,nh),s9=()=>st,Ca=new Map,_a=e=>{try{URL.revokeObjectURL(e)}catch{}},v0=(e,t=new Set)=>{const n=[];e.files.forEach(r=>{Ca.delete(r.id),!t.has(r.objectUrl)&&(_a(r.objectUrl),r.sourceFileUri&&n.push(r.sourceFileUri))}
207),e.thumbnailUrls.forEach(_a),Bc(n)},rh=e=>{st=e,y0()},hk=(e={})=>{st&&v0(st,new Set(e.preserveObjectUrls??[])),st=null,y0()},pk=e=>e.map(t=>{const n=t.contentHash??Ca.get(t.id);return n?{...t,contentHash:n}:t}),o9=new Set(["jpg","jpeg","png","gif","webp","avif","heic","heif"]),b0=e=>{const t=e.lastIndexOf(".");return t<0?"":e.slice(t+1).toLowerCase()},Kl=e=>(e==null?void 0:e.toLowerCase().startsWith("image/"))===!0,a9=e=>Kl(e.mimeType)?!0:o9.has(b0(e.name??"")),w0=e=>{if(e==="image/jpeg")return"jpg";const t=e.split("/")[1];return t&&/^[a-z0-9.+-]+$/i.test(t)?t.replace("jpeg","jpg"):"jpg"},i9=(e,t,n)=>{var s;const r=(s=e.name)==null?void 0:s.trim();return r||`shared-photo-${t+1}.${w0(n)}`},l9=e=>e.startsWith("http://")||e.startsWith("https://")||e.startsWith("data:")||e.startsWith("blob:")?e:j.convertFileSrc(e),c9=async e=>{const t=await fetch(l9(e.uri));if(!t.ok)throw new Error(`Unable to read shared file (${t.status})`);return t.blob()},u9=200,d9=3,f9=2,sh=async(e,t,n)=>{let r=0;const s=async()=>{for(;r<e.length;){const o=r;r+=1,await n(e[o],o)}};await Promise.all(Array.from({length:Math.min(t,e.length)},s))},h9=async(e,t)=>{const n=await zp(e.uri),r=await c9(n?{...e,uri:n}:e),s=Kl(e.mimeType)?e.mimeType:Kl(r.type)?r.type:`image/${w0(`image/${b0(e.name??"")}`)}`,o=i9(e,t,s),[a,i]=await Promise.all([g0(r,o,Yw(e)),Jy(r,u9)]),l=new File([r],o,{type:s,lastModified:a??Date.now()}),c=await t9(l,Lw,{deferProcessing:!0,deferHash:!0,sourceFileUri:n??void 0,capturedTimestamp:l.lastModified,dimensions:i?{width:i.width,height:i.height}:null});if(!c)throw new Error("The image is too large to prepare for upload.");return{file:c,thumbnailUrl:i!=null&&i.thumbnail?URL.createObjectURL(i.thumbnail):null}},p9=async e=>{const t=[],n=(h,p)=>{t.push({name:h.name||"Shared file",mimeType:h.mimeType||"unknown",reason:p})},r=e.files??[],s=[];r.slice(0,Bi).forEach(h=>{a9(h)?s.push(h):n(h,"Only image shares are supported.")}),r.slice(Bi).forEach(h=>{n(h,`Only ${Bi} photos can be imported at once.`)});const o=crypto.randomUUID(),a=Date.now(),i=new Array(s.length).fill(null);let l=0;const c=()=>(st==null?void 0:st.id)===o,d=()=>{const h=i.filter(p=>p!==null);return{id:o,title:e.title??"",texts:e.texts??[],files:h.map(p=>p.file),thumbnailUrls:new Map(h.flatMap(p=>p.thumbnailUrl?[[p.file.id,p.thumbnailUrl]]:[])),rejectedFiles:[...t],pendingFileCount:s.length-l,isPreparing:l<s.length,createdAt:a}};if(st&&v0(st),rh(d()),typeof window<"u"&&window.dispatchEvent(new CustomEvent(ql)),await sh(s,d9,async(h,p)=>{if(!c())return;let g=null;try{g=await h9(h,p)}catch(y){n(h,y instanceof Error?y.message:"Unable to read the shared image.")}if(!c()){g&&(_a(g.file.objectUrl),g.thumbnailUrl&&_a(g.thumbnailUrl),g.file.sourceFileUri&&Bc([g.file.sourceFileUri]));return}i[p]=g,l+=1,rh(d())}),!c())return st;const f=st;return sh((f==null?void 0:f.files)??[],f9,async h=>{if(!c()||Ca.has(h.id))return;const p=await ha(h.file);p&&c()&&Ca.set(h.id,p)}),f},m9=()=>{const e=tt(),t=He(),n=r9();return m.useEffect(()=>{const r=()=>{s9()&&t.pathname!=="/share-import"&&e("/share-import",{replace:!1})};return window.addEventListener(ql,r),r(),()=>{window.removeEventListener(ql,r)}},[t.pathname,e,n==null?void 0:n.id]),null},g9=300,y9=2500,x0=e=>{const[t,n]=m.useState(e);return m.useEffect(()=>{if(e){n(!0);return}const r=setTimeout(()=>n(!1),g9);return()=>clearTimeout(r)},[e]),{mounted:t,leaving:t&&!e}},C0=({leaving:e,onClick:t,children:n,className:r})=>u.jsx("div",{onClick:t,className:G("flex max-w-[calc(100vw-2rem)] items-start gap-2 bg-[#111111]/90 px-4 py-2 text-[13px] font-medium leading-[18px] text-[#FDF8F3] shadow-lg backdrop-blur-sm md:max-w-[420px]","duration-300 ease-out fill-mode-forwards",e?"animate-out fade-out slide-out-to-bottom-4":"animate-in fade-in slide-in-from-bottom-4",t&&"pointer-events-auto cursor-pointer select-none",r),children:n}),v9={ok:u.jsx(kp,{className:"mt-px h-3.5 w-3.5 shrink-0","aria-hidden":"true"}),info:null,error:u.jsx(Il,{className:"mt-px h-3.5 w-3.5 shrink-0 text-[#ee7673]","aria-hidden":"true"})},b9=()=>{const e=u7(),t=m.useRef(e);e&&(t.current=e);const{mounted:n,leaving:r}=x0(e!==null),s=t.current;return!n||!s?null:u.jsxs(C0,{leaving:r,onClick:s.tone==="error"?hp:void 0,children:[v9[s.tone],u.jsxs("div",{className:"min-w-0",children:[u.jsx("div",{children:s.title}),s.description&&u.jsx("div",{className:"font-normal text-[#FDF8F3]/75",children:s.description})]})]},s.id)},w9=()=>{const{t:e}=_e(),{connected:t}=Ha(),[n,r]=m.useState("hidden"),s=m.useRef("offline");m.useEffect(()=>{if(!t){r("offline");return}if(n==="offline"){r("backOnline");return}if(n==="backOnline"){const i=setTimeout(()=>r("hidden"),y9);return()=>clearTimeout(i)}},[t,n]),n!=="hidden"&&(s.current=n);const{mounted:o,leaving:a}=x0(n!=="hidden");return o?u.jsx(C0,{leaving:a,className:"items-center",children:s.current==="backOnline"?u.jsxs(u.Fragment,{children:[u.jsx(cy,{className:"h-3.5 w-3.5","aria-hidden":"true"}),e("common.offline.backOnline","Back online")]}):u.jsxs(u.Fragment,{children:[u.jsx(Rp,{className:"h-3.5 w-3.5","aria-hidden":"true"}),e("common.offline.banner","You're offline — showing saved memories")]})}):null},x9=()=>u.jsxs("div",{"aria-live":"polite",className:"pointer-events-none fixed inset-x-0 bottom-[calc(env(safe-area-inset-bottom)+96px)] z-[60] flex flex-col items-center gap-2 md:bottom-6",children:[u.jsx(b9,{}),u.jsx(w9,{})]});var C9=Object.defineProperty,Ea=Object.getOwnPropertySymbols,_0=Object.prototype.hasOwnProperty,E0=Object.prototype.propertyIsEnumerable,oh=(e,t,n)=>t in e?C9(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ql=(e,t)=>{for(var n in t||(t={}
207))_0.call(t,n)&&oh(e,n,t[n]);if(Ea)for(var n of Ea(t))E0.call(t,n)&&oh(e,n,t[n]);return e},Yl=(e,t)=>{var n={};for(var r in e)_0.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Ea)for(var r of Ea(e))t.indexOf(r)<0&&E0.call(e,r)&&(n[r]=e[r]);return n};/**
208 * @license QR Code generator library (TypeScript)
209 * Copyright (c) Project Nayuki.
210 * SPDX-License-Identifier: MIT
211 */var dr;(e=>{const t=class se{constructor(l,c,d,f){if(this.version=l,this.errorCorrectionLevel=c,this.modules=[],this.isFunction=[],l<se.MIN_VERSION||l>se.MAX_VERSION)throw new RangeError("Version value out of range");if(f<-1||f>7)throw new RangeError("Mask value out of range");this.size=l*4+17;let h=[];for(let g=0;g<this.size;g++)h.push(!1);for(let g=0;g<this.size;g++)this.modules.push(h.slice()),this.isFunction.push(h.slice());this.drawFunctionPatterns();const p=this.addEccAndInterleave(d);if(this.drawCodewords(p),f==-1){let g=1e9;for(let y=0;y<8;y++){this.applyMask(y),this.drawFormatBits(y);const v=this.getPenaltyScore();v<g&&(f=y,g=v),this.applyMask(y)}}s(0<=f&&f<=7),this.mask=f,this.applyMask(f),this.drawFormatBits(f),this.isFunction=[]}static encodeText(l,c){const d=e.QrSegment.makeSegments(l);return se.encodeSegments(d,c)}static encodeBinary(l,c){const d=e.QrSegment.makeBytes(l);return se.encodeSegments([d],c)}static encodeSegments(l,c,d=1,f=40,h=-1,p=!0){if(!(se.MIN_VERSION<=d&&d<=f&&f<=se.MAX_VERSION)||h<-1||h>7)throw new RangeError("Invalid value");let g,y;for(g=d;;g++){const _=se.getNumDataCodewords(g,c)*8,b=a.getTotalBits(l,g);if(b<=_){y=b;break}if(g>=f)throw new RangeError("Data too long")}for(const _ of[se.Ecc.MEDIUM,se.Ecc.QUARTILE,se.Ecc.HIGH])p&&y<=se.getNumDataCodewords(g,_)*8&&(c=_);let v=[];for(const _ of l){n(_.mode.modeBits,4,v),n(_.numChars,_.mode.numCharCountBits(g),v);for(const b of _.getData())v.push(b)}s(v.length==y);const x=se.getNumDataCodewords(g,c)*8;s(v.length<=x),n(0,Math.min(4,x-v.length),v),n(0,(8-v.length%8)%8,v),s(v.length%8==0);for(let _=236;v.length<x;_^=253)n(_,8,v);let C=[];for(;C.length*8<v.length;)C.push(0);return v.forEach((_,b)=>C[b>>>3]|=_<<7-(b&7)),new se(g,c,C,h)}getModule(l,c){return 0<=l&&l<this.size&&0<=c&&c<this.size&&this.modules[c][l]}getModules(){return this.modules}drawFunctionPatterns(){for(let d=0;d<this.size;d++)this.setFunctionModule(6,d,d%2==0),this.setFunctionModule(d,6,d%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const l=this.getAlignmentPatternPositions(),c=l.length;for(let d=0;d<c;d++)for(let f=0;f<c;f++)d==0&&f==0||d==0&&f==c-1||d==c-1&&f==0||this.drawAlignmentPattern(l[d],l[f]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(l){const c=this.errorCorrectionLevel.formatBits<<3|l;let d=c;for(let h=0;h<10;h++)d=d<<1^(d>>>9)*1335;const f=(c<<10|d)^21522;s(f>>>15==0);for(let h=0;h<=5;h++)this.setFunctionModule(8,h,r(f,h));this.setFunctionModule(8,7,r(f,6)),this.setFunctionModule(8,8,r(f,7)),this.setFunctionModule(7,8,r(f,8));for(let h=9;h<15;h++)this.setFunctionModule(14-h,8,r(f,h));for(let h=0;h<8;h++)this.setFunctionModule(this.size-1-h,8,r(f,h));for(let h=8;h<15;h++)this.setFunctionModule(8,this.size-15+h,r(f,h));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let l=this.version;for(let d=0;d<12;d++)l=l<<1^(l>>>11)*7973;const c=this.version<<12|l;s(c>>>18==0);for(let d=0;d<18;d++){const f=r(c,d),h=this.size-11+d%3,p=Math.floor(d/3);this.setFunctionModule(h,p,f),this.setFunctionModule(p,h,f)}}drawFinderPattern(l,c){for(let d=-4;d<=4;d++)for(let f=-4;f<=4;f++){const h=Math.max(Math.abs(f),Math.abs(d)),p=l+f,g=c+d;0<=p&&p<this.size&&0<=g&&g<this.size&&this.setFunctionModule(p,g,h!=2&&h!=4)}}drawAlignmentPattern(l,c){for(let d=-2;d<=2;d++)for(let f=-2;f<=2;f++)this.setFunctionModule(l+f,c+d,Math.max(Math.abs(f),Math.abs(d))!=1)}setFunctionModule(l,c,d){this.modules[c][l]=d,this.isFunction[c][l]=!0}addEccAndInterleave(l){const c=this.version,d=this.errorCorrectionLevel;if(l.length!=se.getNumDataCodewords(c,d))throw new RangeError("Invalid argument");const f=se.NUM_ERROR_CORRECTION_BLOCKS[d.ordinal][c],h=se.ECC_CODEWORDS_PER_BLOCK[d.ordinal][c],p=Math.floor(se.getNumRawDataModules(c)/8),g=f-p%f,y=Math.floor(p/f);let v=[];const x=se.reedSolomonComputeDivisor(h);for(let _=0,b=0;_<f;_++){let w=l.slice(b,b+y-h+(_<g?0:1));b+=w.length;const P=se.reedSolomonComputeRemainder(w,x);_<g&&w.push(0),v.push(w.concat(P))}let C=[];for(let _=0;_<v[0].length;_++)v.forEach((b,w)=>{(_!=y-h||w>=g)&&C.push(b[_])});return s(C.length==p),C}drawCodewords(l){if(l.length!=Math.floor(se.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let c=0;for(let d=this.size-1;d>=1;d-=2){d==6&&(d=5);for(let f=0;f<this.size;f++)for(let h=0;h<2;h++){const p=d-h,y=(d+1&2)==0?this.size-1-f:f;!this.isFunction[y][p]&&c<l.length*8&&(this.modules[y][p]=r(l[c>>>3],7-(c&7)),c++)}}s(c==l.length*8)}
211applyMask(l){if(l<0||l>7)throw new RangeError("Mask value out of range");for(let c=0;c<this.size;c++)for(let d=0;d<this.size;d++){let f;switch(l){case 0:f=(d+c)%2==0;break;case 1:f=c%2==0;break;case 2:f=d%3==0;break;case 3:f=(d+c)%3==0;break;case 4:f=(Math.floor(d/3)+Math.floor(c/2))%2==0;break;case 5:f=d*c%2+d*c%3==0;break;case 6:f=(d*c%2+d*c%3)%2==0;break;case 7:f=((d+c)%2+d*c%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[c][d]&&f&&(this.modules[c][d]=!this.modules[c][d])}}getPenaltyScore(){let l=0;for(let h=0;h<this.size;h++){let p=!1,g=0,y=[0,0,0,0,0,0,0];for(let v=0;v<this.size;v++)this.modules[h][v]==p?(g++,g==5?l+=se.PENALTY_N1:g>5&&l++):(this.finderPenaltyAddHistory(g,y),p||(l+=this.finderPenaltyCountPatterns(y)*se.PENALTY_N3),p=this.modules[h][v],g=1);l+=this.finderPenaltyTerminateAndCount(p,g,y)*se.PENALTY_N3}for(let h=0;h<this.size;h++){let p=!1,g=0,y=[0,0,0,0,0,0,0];for(let v=0;v<this.size;v++)this.modules[v][h]==p?(g++,g==5?l+=se.PENALTY_N1:g>5&&l++):(this.finderPenaltyAddHistory(g,y),p||(l+=this.finderPenaltyCountPatterns(y)*se.PENALTY_N3),p=this.modules[v][h],g=1);l+=this.finderPenaltyTerminateAndCount(p,g,y)*se.PENALTY_N3}for(let h=0;h<this.size-1;h++)for(let p=0;p<this.size-1;p++){const g=this.modules[h][p];g==this.modules[h][p+1]&&g==this.modules[h+1][p]&&g==this.modules[h+1][p+1]&&(l+=se.PENALTY_N2)}let c=0;for(const h of this.modules)c=h.reduce((p,g)=>p+(g?1:0),c);const d=this.size*this.size,f=Math.ceil(Math.abs(c*20-d*10)/d)-1;return s(0<=f&&f<=9),l+=f*se.PENALTY_N4,s(0<=l&&l<=2568888),l}getAlignmentPatternPositions(){if(this.version==1)return[];{const l=Math.floor(this.version/7)+2,c=this.version==32?26:Math.ceil((this.version*4+4)/(l*2-2))*2;let d=[6];for(let f=this.size-7;d.length<l;f-=c)d.splice(1,0,f);return d}}static getNumRawDataModules(l){if(l<se.MIN_VERSION||l>se.MAX_VERSION)throw new RangeError("Version number out of range");let c=(16*l+128)*l+64;if(l>=2){const d=Math.floor(l/7)+2;c-=(25*d-10)*d-55,l>=7&&(c-=36)}return s(208<=c&&c<=29648),c}static getNumDataCodewords(l,c){return Math.floor(se.getNumRawDataModules(l)/8)-se.ECC_CODEWORDS_PER_BLOCK[c.ordinal][l]*se.NUM_ERROR_CORRECTION_BLOCKS[c.ordinal][l]}static reedSolomonComputeDivisor(l){if(l<1||l>255)throw new RangeError("Degree out of range");let c=[];for(let f=0;f<l-1;f++)c.push(0);c.push(1);let d=1;for(let f=0;f<l;f++){for(let h=0;h<c.length;h++)c[h]=se.reedSolomonMultiply(c[h],d),h+1<c.length&&(c[h]^=c[h+1]);d=se.reedSolomonMultiply(d,2)}return c}static reedSolomonComputeRemainder(l,c){let d=c.map(f=>0);for(const f of l){const h=f^d.shift();d.push(0),c.forEach((p,g)=>d[g]^=se.reedSolomonMultiply(p,h))}return d}static reedSolomonMultiply(l,c){if(l>>>8||c>>>8)throw new RangeError("Byte out of range");let d=0;for(let f=7;f>=0;f--)d=d<<1^(d>>>7)*285,d^=(c>>>f&1)*l;return s(d>>>8==0),d}finderPenaltyCountPatterns(l){const c=l[1];s(c<=this.size*3);const d=c>0&&l[2]==c&&l[3]==c*3&&l[4]==c&&l[5]==c;return(d&&l[0]>=c*4&&l[6]>=c?1:0)+(d&&l[6]>=c*4&&l[0]>=c?1:0)}finderPenaltyTerminateAndCount(l,c,d){return l&&(this.finderPenaltyAddHistory(c,d),c=0),c+=this.size,this.finderPenaltyAddHistory(c,d),this.finderPenaltyCountPatterns(d)}finderPenaltyAddHistory(l,c){c[0]==0&&(l+=this.size),c.pop(),c.unshift(l)}};t.MIN_VERSION=1,t.MAX_VERSION=40,t.PENALTY_N1=3,t.PENALTY_N2=3,t.PENALTY_N3=40,t.PENALTY_N4=10,t.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],t.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=t;function n(i,l,c){if(l<0||l>31||i>>>l)throw new RangeError("Value out of range");for(let d=l-1;d>=0;d--)c.push(i>>>d&1)}function r(i,l){return(i>>>l&1)!=0}function s(i){if(!i)throw new Error("Assertion error")}const o=class Se{constructor(l,c,d){if(this.mode=l,this.numChars=c,this.bitData=d,c<0)throw new RangeError("Invalid argument");this.bitData=d.slice()}static makeBytes(l){let c=[];for(const d of l)n(d,8,c);return new Se(Se.Mode.BYTE,l.length,c)}static makeNumeric(l){if(!Se.isNumeric(l))throw new RangeError("String contains 
211non-numeric characters");let c=[];for(let d=0;d<l.length;){const f=Math.min(l.length-d,3);n(parseInt(l.substring(d,d+f),10),f*3+1,c),d+=f}return new Se(Se.Mode.NUMERIC,l.length,c)}static makeAlphanumeric(l){if(!Se.isAlphanumeric(l))throw new RangeError("String contains unencodable characters in alphanumeric mode");let c=[],d;for(d=0;d+2<=l.length;d+=2){let f=Se.ALPHANUMERIC_CHARSET.indexOf(l.charAt(d))*45;f+=Se.ALPHANUMERIC_CHARSET.indexOf(l.charAt(d+1)),n(f,11,c)}return d<l.length&&n(Se.ALPHANUMERIC_CHARSET.indexOf(l.charAt(d)),6,c),new Se(Se.Mode.ALPHANUMERIC,l.length,c)}static makeSegments(l){return l==""?[]:Se.isNumeric(l)?[Se.makeNumeric(l)]:Se.isAlphanumeric(l)?[Se.makeAlphanumeric(l)]:[Se.makeBytes(Se.toUtf8ByteArray(l))]}static makeEci(l){let c=[];if(l<0)throw new RangeError("ECI assignment value out of range");if(l<128)n(l,8,c);else if(l<16384)n(2,2,c),n(l,14,c);else if(l<1e6)n(6,3,c),n(l,21,c);else throw new RangeError("ECI assignment value out of range");return new Se(Se.Mode.ECI,0,c)}static isNumeric(l){return Se.NUMERIC_REGEX.test(l)}static isAlphanumeric(l){return Se.ALPHANUMERIC_REGEX.test(l)}getData(){return this.bitData.slice()}static getTotalBits(l,c){let d=0;for(const f of l){const h=f.mode.numCharCountBits(c);if(f.numChars>=1<<h)return 1/0;d+=4+h+f.bitData.length}return d}static toUtf8ByteArray(l){l=encodeURI(l);let c=[];for(let d=0;d<l.length;d++)l.charAt(d)!="%"?c.push(l.charCodeAt(d)):(c.push(parseInt(l.substring(d+1,d+3),16)),d+=2);return c}};o.NUMERIC_REGEX=/^[0-9]*$/,o.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,o.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";let a=o;e.QrSegment=o})(dr||(dr={}));(e=>{(t=>{const n=class{constructor(s,o){this.ordinal=s,this.formatBits=o}};n.LOW=new n(0,1),n.MEDIUM=new n(1,0),n.QUARTILE=new n(2,3),n.HIGH=new n(3,2),t.Ecc=n})(e.QrCode||(e.QrCode={}))})(dr||(dr={}));(e=>{(t=>{const n=class{constructor(s,o){this.modeBits=s,this.numBitsCharCount=o}numCharCountBits(s){return this.numBitsCharCount[Math.floor((s+7)/17)]}};n.NUMERIC=new n(1,[10,12,14]),n.ALPHANUMERIC=new n(2,[9,11,13]),n.BYTE=new n(4,[8,16,16]),n.KANJI=new n(8,[8,10,12]),n.ECI=new n(7,[0,0,0]),t.Mode=n})(e.QrSegment||(e.QrSegment={}))})(dr||(dr={}));var Ir=dr;/**
212 * @license qrcode.react
213 * Copyright (c) Paul O'Shannessy
214 * SPDX-License-Identifier: ISC
215 */var _9={L:Ir.QrCode.Ecc.LOW,M:Ir.QrCode.Ecc.MEDIUM,Q:Ir.QrCode.Ecc.QUARTILE,H:Ir.QrCode.Ecc.HIGH},S0=128,A0="L",N0="#FFFFFF",P0="#000000",k0=!1,I0=1,E9=4,S9=0,A9=.1;function R0(e,t=0){const n=[];return e.forEach(function(r,s){let o=null;r.forEach(function(a,i){if(!a&&o!==null){n.push(`M${o+t} ${s+t}h${i-o}v1H${o+t}z`),o=null;return}if(i===r.length-1){if(!a)return;o===null?n.push(`M${i+t},${s+t} h1v1H${i+t}z`):n.push(`M${o+t},${s+t} h${i+1-o}v1H${o+t}z`);return}a&&o===null&&(o=i)})}),n.join("")}function T0(e,t){return e.slice().map((n,r)=>r<t.y||r>=t.y+t.h?n:n.map((s,o)=>o<t.x||o>=t.x+t.w?s:!1))}function N9(e,t,n,r){if(r==null)return null;const s=e.length+n*2,o=Math.floor(t*A9),a=s/t,i=(r.width||o)*a,l=(r.height||o)*a,c=r.x==null?e.length/2-i/2:r.x*a,d=r.y==null?e.length/2-l/2:r.y*a,f=r.opacity==null?1:r.opacity;let h=null;if(r.excavate){let g=Math.floor(c),y=Math.floor(d),v=Math.ceil(i+c-g),x=Math.ceil(l+d-y);h={x:g,y,w:v,h:x}}const p=r.crossOrigin;return{x:c,y:d,h:l,w:i,excavation:h,opacity:f,crossOrigin:p}}function P9(e,t){return t!=null?Math.max(Math.floor(t),0):e?E9:S9}function O0({value:e,level:t,minVersion:n,includeMargin:r,marginSize:s,imageSettings:o,size:a,boostLevel:i}){let l=L.useMemo(()=>{const g=(Array.isArray(e)?e:[e]).reduce((y,v)=>(y.push(...Ir.QrSegment.makeSegments(v)),y),[]);return Ir.QrCode.encodeSegments(g,_9[t],n,void 0,void 0,i)},[e,t,n,i]);const{cells:c,margin:d,numCells:f,calculatedImageSettings:h}=L.useMemo(()=>{let p=l.getModules();const g=P9(r,s),y=p.length+g*2,v=N9(p,a,g,o);return{cells:p,margin:g,numCells:y,calculatedImageSettings:v}},[l,a,o,r,s]);return{qrcode:l,margin:d,cells:c,numCells:f,calculatedImageSettings:h}}var k9=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}(),I9=L.forwardRef(function(t,n){const r=t,{value:s,size:o=S0,level:a=A0,bgColor:i=N0,fgColor:l=P0,includeMargin:c=k0,minVersion:d=I0,boostLevel:f,marginSize:h,imageSettings:p}=r,y=Yl(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:v}=y,x=Yl(y,["style"]),C=p==null?void 0:p.src,_=L.useRef(null),b=L.useRef(null),w=L.useCallback(O=>{_.current=O,typeof n=="function"?n(O):n&&(n.current=O)},[n]),[P,N]=L.useState(!1),{margin:E,cells:A,numCells:k,calculatedImageSettings:T}=O0({value:s,level:a,minVersion:d,boostLevel:f,includeMargin:c,marginSize:h,imageSettings:p,size:o});L.useEffect(()=>{if(_.current!=null){const O=_.current,M=O.getContext("2d");if(!M)return;let D=A;const $=b.current,H=T!=null&&$!==null&&$.complete&&$.naturalHeight!==0&&$.naturalWi
215dth!==0;H&&T.excavation!=null&&(D=T0(A,T.excavation));const U=window.devicePixelRatio||1;O.height=O.width=o*U;const re=o/k*U;M.scale(re,re),M.fillStyle=i,M.fillRect(0,0,k,k),M.fillStyle=l,k9?M.fill(new Path2D(R0(D,E))):A.forEach(function(J,Q){J.forEach(function(ee,oe){ee&&M.fillRect(oe+E,Q+E,1,1)})}),T&&(M.globalAlpha=T.opacity),H&&M.drawImage($,T.x+E,T.y+E,T.w,T.h)}}),L.useEffect(()=>{N(!1)},[C]);const I=Ql({height:o,width:o},v);let R=null;return C!=null&&(R=L.createElement("img",{src:C,key:C,style:{display:"none"},onLoad:()=>{N(!0)},ref:b,crossOrigin:T==null?void 0:T.crossOrigin})),L.createElement(L.Fragment,null,L.createElement("canvas",Ql({style:I,height:o,width:o,ref:w,role:"img"},x)),R)});I9.displayName="QRCodeCanvas";var Qs=L.forwardRef(function(t,n){const r=t,{value:s,size:o=S0,level:a=A0,bgColor:i=N0,fgColor:l=P0,includeMargin:c=k0,minVersion:d=I0,boostLevel:f,title:h,marginSize:p,imageSettings:g}=r,y=Yl(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:v,cells:x,numCells:C,calculatedImageSettings:_}=O0({value:s,level:a,minVersion:d,boostLevel:f,includeMargin:c,marginSize:p,imageSettings:g,size:o});let b=x,w=null;g!=null&&_!=null&&(_.excavation!=null&&(b=T0(x,_.excavation)),w=L.createElement("image",{href:g.src,height:_.h,width:_.w,x:_.x+v,y:_.y+v,preserveAspectRatio:"none",opacity:_.opacity,crossOrigin:_.crossOrigin}));const P=R0(b,v);return L.createElement("svg",Ql({height:o,width:o,viewBox:`0 0 ${C} ${C}`,ref:n,role:"img"},y),!!h&&L.createElement("title",null,h),L.createElement("path",{fill:i,d:`M0,0 h${C}v${C}H0z`,shapeRendering:"crispEdges"}),L.createElement("path",{fill:l,d:P,shapeRendering:"crispEdges"}),w)});Qs.displayName="QRCodeSVG";async function R9(e){const t=e;if(t.context)try{const n=await t.context.clone().json();if(typeof(n==null?void 0:n.error)=="string")return n.error}catch{}return t.message??"Admin request failed"}async function Zo(e,t={}){const{data:n,error:r}=await z.functions.invoke("admin-rpc",{body:{rpc:e,args:t}});if(r)throw new Error(await R9(r));if(!n||!("data"in n))throw new Error("Admin request returned an invalid response");return n.data}const ah=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,ih=Op,j0=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return ih(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:o}=t,a=Object.keys(s).map(c=>{const d=n==null?void 0:n[c],f=o==null?void 0:o[c];if(d===null)return null;const h=ah(d)||ah(f);return s[c][h]}),i=n&&Object.entries(n).reduce((c,d)=>{let[f,h]=d;return h===void 0||(c[f]=h),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,d)=>{let{class:f,className:h,...p}=d;return Object.entries(p).every(g=>{let[y,v]=g;return Array.isArray(v)?v.includes({...o,...i}[y]):{...o,...i}[y]===v})?[...c,f,h]:c},[]);return ih(e,a,l,n==null?void 0:n.class,n==null?void 0:n.className)},T9=j0("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),Xl=m.forwardRef(({className:e,variant:t,...n},r)=>u.jsx("div",{ref:r,role:"alert",className:G(T9({variant:t}),e),...n}));Xl.displayName="Alert";const Zl=m.forwardRef(({className:e,...t},n)=>u.jsx("h5",{ref:n,className:G("mb-1 font-medium leading-none tracking-tight",e),...t}));Zl.displayName="AlertTitle";const Jl=m.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:G("text-sm [&_p]:leading-relaxed",e),...t}));Jl.displayName="AlertDescription";var O9=Symbol.for("react.lazy"),Sa=xc[" use ".trim().toString()];function j9(e){return typeof e=="object"&&e!==null&&"then"in e}function L0(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===O9&&"_payload"in e&&j9(e._payload)}function L9(e){const t=D9(e),n=m.forwardRef((r,s)=>{let{children:o,...a}=r;L0(o)&&typeof Sa=="function"&&(o=Sa(o._payload));const i=m.Children.toArray(o),l=i.find(U9);if(l){const c=l.props.children,d=i.map(f=>f===l?m.Children.count(c)>1?m.Children.only(null):m.isValidElement(c)?c.props.children:null:f);return u.jsx(t,{...a,ref:s,children:m.isValidElement(c)?m.cloneElement(c,void 0,d):null})}return u.jsx(t,{...a,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}var M9=L9("Slot");function D9(e){const t=m.forwardRef((n,r)=>{let{children:s,...o}=n;if(L0(s)&&typeof Sa=="function"&&(s=Sa(s._payload)),m.isValidElement(s)){const a=$9(s),i=B9(o,s.props);return s.type!==m.Fragment&&(i.ref=r?lo(r,a):a),m.cloneElement(s,i)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var F9=Symbol("radix.slottable");function U9(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===F9}function B9(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...i)=>{const l=o(...i);return s(...i),l}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}
215:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function $9(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const z9=j0("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors 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",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"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),Rs=m.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...s},o)=>{const a=r?M9:"button";return u.jsx(a,{className:G(z9({variant:t,size:n,className:e})),ref:o,...s})});Rs.displayName="Button";var V9=Object.defineProperty,H9=Object.defineProperties,W9=Object.getOwnPropertyDescriptors,Aa=Object.getOwnPropertySymbols,M0=Object.prototype.hasOwnProperty,D0=Object.prototype.propertyIsEnumerable,lh=(e,t,n)=>t in e?V9(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,q9=(e,t)=>{for(var n in t||(t={}))M0.call(t,n)&&lh(e,n,t[n]);if(Aa)for(var n of Aa(t))D0.call(t,n)&&lh(e,n,t[n]);return e},G9=(e,t)=>H9(e,W9(t)),K9=(e,t)=>{var n={};for(var r in e)M0.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Aa)for(var r of Aa(e))t.indexOf(r)<0&&D0.call(e,r)&&(n[r]=e[r]);return n};function Q9(e){let t=setTimeout(e,0),n=setTimeout(e,10),r=setTimeout(e,50);return[t,n,r]}function Y9(e){let t=m.useRef();return m.useEffect(()=>{t.current=e}),t.current}var X9=18,F0=40,Z9=`${F0}px`,J9=["[data-lastpass-icon-root]","com-1password-button","[data-dashlanecreated]",'[style$="2147483647 !important;"]'].join(",");function ex({containerRef:e,inputRef:t,pushPasswordManagerStrategy:n,isFocused:r}){let[s,o]=m.useState(!1),[a,i]=m.useState(!1),[l,c]=m.useState(!1),d=m.useMemo(()=>n==="none"?!1:(n==="increase-width"||n==="experimental-no-flickering")&&s&&a,[s,a,n]),f=m.useCallback(()=>{let h=e.current,p=t.current;if(!h||!p||l||n==="none")return;let g=h,y=g.getBoundingClientRect().left+g.offsetWidth,v=g.getBoundingClientRect().top+g.offsetHeight/2,x=y-X9,C=v;document.querySelectorAll(J9).length===0&&document.elementFromPoint(x,C)===h||(o(!0),c(!0))},[e,t,l,n]);return m.useEffect(()=>{let h=e.current;if(!h||n==="none")return;function p(){let y=window.innerWidth-h.getBoundingClientRect().right;i(y>=F0)}p();let g=setInterval(p,1e3);return()=>{clearInterval(g)}},[e,n]),m.useEffect(()=>{let h=r||document.activeElement===t.current;if(n==="none"||!h)return;let p=setTimeout(f,0),g=setTimeout(f,2e3),y=setTimeout(f,5e3),v=setTimeout(()=>{c(!0)},6e3);return()=>{clearTimeout(p),clearTimeout(g),clearTimeout(y),clearTimeout(v)}},[t,r,n,f]),{hasPWMBadge:s,willPushPWMBadge:d,PWM_BADGE_SPACE_WIDTH:Z9}}var U0=m.createContext({}),B0=m.forwardRef((e,t)=>{var n=e,{value:r,onChange:s,maxLength:o,textAlign:a="left",pattern:i,placeholder:l,inputMode:c="numeric",onComplete:d,pushPasswordManagerStrategy:f="increase-width",pasteTransformer:h,containerClassName:p,noScriptCSSFallback:g=tx,render:y,children:v}=n,x=K9(n,["value","onChange","maxLength","textAlign","pattern","placeholder","inputMode","onComplete","pushPasswordManagerStrategy","pasteTransformer","containerClassName","noScriptCSSFallback","render","children"]),C,_,b,w,P;let[N,E]=m.useState(typeof x.defaultValue=="string"?x.defaultValue:""),A=r??N,k=Y9(A),T=m.useCallback(q=>{s==null||s(q),E(q)},[s]),I=m.useMemo(()=>i?typeof i=="string"?new RegExp(i):i:null,[i]),R=m.useRef(null),O=m.useRef(null),M=m.useRef({value:A,onChange:T,isIOS:typeof window<"u"&&((_=(C=window==null?void 0:window.CSS)==null?void 0:C.supports)==null?void 0:_.call(C,"-webkit-touch-callout","none"))}),D=m.useRef({prev:[(b=R.current)==null?void 0:b.selectionStart,(w=R.current)==null?void 0:w.selectionEnd,(P=R.current)==null?void 0:P.selectionDirection]});m.useImperativeHandle(t,()=>R.current,[]),m.useEffect(()=>{let q=R.current,Y=O.current;if(!q||!Y)return;M.current.value!==q.value&&M.current.onChange(q.value),D.current.prev=[q.selectionStart,q.selectionEnd,q.selectionDirection];function Te(){if(document.activeElement!==q){Q(null),oe(null);return}let ie=q.selectionStart,ze=q.selectionEnd,Nt=q.selectionDirection,Qe=q.maxLength,We=q.value,ft=D.current.prev,Pt=-1,ke=-1,Ye;if(We.length!==0&&ie!==null&&ze!==null){let ui=ie===ze,vo=ie===We.length&&We.length<Qe;if(ui&&!vo){let ht=ie;if(ht===0)Pt=0,ke=1,Ye="forward";else if(ht===Qe)Pt=ht-1,ke=ht,Ye="backward";else if(Qe>1&&We.length>1){let kt=0;
215if(ft[0]!==null&&ft[1]!==null){Ye=ht<ft[1]?"backward":"forward";let bo=ft[0]===ft[1]&&ft[0]<Qe;Ye==="backward"&&!bo&&(kt=-1)}Pt=kt+ht,ke=kt+ht+1}}Pt!==-1&&ke!==-1&&Pt!==ke&&R.current.setSelectionRange(Pt,ke,Ye)}let go=Pt!==-1?Pt:ie,yo=ke!==-1?ke:ze,gr=Ye??Nt;Q(go),oe(yo),D.current.prev=[go,yo,gr]}if(document.addEventListener("selectionchange",Te,{capture:!0}),Te(),document.activeElement===q&&re(!0),!document.getElementById("input-otp-style")){let ie=document.createElement("style");if(ie.id="input-otp-style",document.head.appendChild(ie),ie.sheet){let ze="background: transparent !important; color: transparent !important; border-color: transparent !important; opacity: 0 !important; box-shadow: none !important; -webkit-box-shadow: none !important; -webkit-text-fill-color: transparent !important;";_s(ie.sheet,"[data-input-otp]::selection { background: transparent !important; color: transparent !important; }"),_s(ie.sheet,`[data-input-otp]:autofill { ${ze} }`),_s(ie.sheet,`[data-input-otp]:-webkit-autofill { ${ze} }`),_s(ie.sheet,"@supports (-webkit-touch-callout: none) { [data-input-otp] { letter-spacing: -.6em !important; font-weight: 100 !important; font-stretch: ultra-condensed; font-optical-sizing: none !important; left: -1px !important; right: 1px !important; } }"),_s(ie.sheet,"[data-input-otp] + * { pointer-events: all !important; }")}}let $e=()=>{Y&&Y.style.setProperty("--root-height",`${q.clientHeight}px`)};$e();let Fe=new ResizeObserver($e);return Fe.observe(q),()=>{document.removeEventListener("selectionchange",Te,{capture:!0}),Fe.disconnect()}},[]);let[$,H]=m.useState(!1),[U,re]=m.useState(!1),[J,Q]=m.useState(null),[ee,oe]=m.useState(null);m.useEffect(()=>{Q9(()=>{var q,Y,Te,$e;(q=R.current)==null||q.dispatchEvent(new Event("input"));let Fe=(Y=R.current)==null?void 0:Y.selectionStart,ie=(Te=R.current)==null?void 0:Te.selectionEnd,ze=($e=R.current)==null?void 0:$e.selectionDirection;Fe!==null&&ie!==null&&(Q(Fe),oe(ie),D.current.prev=[Fe,ie,ze])})},[A,U]),m.useEffect(()=>{k!==void 0&&A!==k&&k.length<o&&A.length===o&&(d==null||d(A))},[o,d,k,A]);let he=ex({containerRef:O,inputRef:R,pushPasswordManagerStrategy:f,isFocused:U}),dt=m.useCallback(q=>{let Y=q.currentTarget.value.slice(0,o);if(Y.length>0&&I&&!I.test(Y)){q.preventDefault();return}typeof k=="string"&&Y.length<k.length&&document.dispatchEvent(new Event("selectionchange")),T(Y)},[o,T,k,I]),ce=m.useCallback(()=>{var q;if(R.current){let Y=Math.min(R.current.value.length,o-1),Te=R.current.value.length;(q=R.current)==null||q.setSelectionRange(Y,Te),Q(Y),oe(Te)}re(!0)},[o]),zt=m.useCallback(q=>{var Y,Te;let $e=R.current;if(!h&&(!M.current.isIOS||!q.clipboardData||!$e))return;let Fe=q.clipboardData.getData("text/plain"),ie=h?h(Fe):Fe;q.preventDefault();let ze=(Y=R.current)==null?void 0:Y.selectionStart,Nt=(Te=R.current)==null?void 0:Te.selectionEnd,Qe=(ze!==Nt?A.slice(0,ze)+ie+A.slice(Nt):A.slice(0,ze)+ie+A.slice(ze)).slice(0,o);if(Qe.length>0&&I&&!I.test(Qe))return;$e.value=Qe,T(Qe);let We=Math.min(Qe.length,o-1),ft=Qe.length;$e.setSelectionRange(We,ft),Q(We),oe(ft)},[o,T,I,A]),Ct=m.useMemo(()=>({position:"relative",cursor:x.disabled?"default":"text",userSelect:"none",WebkitUserSelect:"none",pointerEvents:"none"}),[x.disabled]),_t=m.useMemo(()=>({position:"absolute",inset:0,width:he.willPushPWMBadge?`calc(100% + ${he.PWM_BADGE_SPACE_WIDTH})`:"100%",clipPath:he.willPushPWMBadge?`inset(0 ${he.PWM_BADGE_SPACE_WIDTH} 0 0)`:void 0,height:"100%",display:"flex",textAlign:a,opacity:"1",color:"transparent",pointerEvents:"all",background:"transparent",caretColor:"transparent",border:"0 solid transparent",outline:"0 solid transparent",boxShadow:"none",lineHeight:"1",letterSpacing:"-.5em",fontSize:"var(--root-height)",fontFamily:"monospace",fontVariantNumeric:"tabular-nums"}),[he.PWM_BADGE_SPACE_WIDTH,he.willPushPWMBadge,a]),Et=m.useMemo(()=>m.createElement("input",G9(q9({autoComplete:x.autoComplete||"one-time-code"},x),{"data-input-otp":!0,"data-input-otp-placeholder-shown":A.length===0||void 0,"data-input-otp-mss":J,"data-input-otp-mse":ee,inputMode:c,pattern:I==null?void 0:I.source,"aria-placeholder":l,style:_t,maxLength:o,value:A,ref:R,onPaste:q=>{var Y;zt(q),(Y=x.onPaste)==null||Y.call(x,q)},onChange:dt,onMouseOver:q=>{var Y;H(!0),(Y=x.onMouseOver)==null||Y.call(x,q)},onMouseLeave:q=>{var Y;H(!1),(Y=x.onMouseLeave)==null||Y.call(x,q)},onFocus:q=>{var Y;ce(),(Y=x.onFocus)==null||Y.call(x,q)},onBlur:q=>{var Y;re(!1),(Y=x.onBlur)==null||Y.call(x,q)}})),[dt,ce,zt,c,_t,o,ee,J,x,I==null?void 0:I.source,A]),St=m.useMemo(()=>({slots:Array.from({length:o}).map((q,Y)=>{var Te;let $e=U&&J!==null&&ee!==null&&(J===ee&&Y===J||Y>=J&&Y<ee),Fe=A[Y]!==void 0?A[Y]:null,ie=A[0]!==void 0?null:(Te=l==null?void 0:l[Y])!=null?Te:null;return{char:Fe,placeholderChar:ie,isActive:$e,hasFakeCaret:$e&&Fe===null}}),isFocused:U,isHovering:!x.disabled&&$}),[U,$,o,ee,J,x.disabled,A]),At=m.useMemo(()=>y?y(St):m.createElement(U0.Provider,{value:St},v),[v,St,y]);return m.createElement(m.Fragment,null,g!==null&&m.createElement("noscript",null,m.createElement("style",null,g)),m.createElement("div",{ref:O,"data-input-otp-container":!0,style:Ct,className:p},At,m.createElement("div",{style:{position:"absolute",inset:0,pointerEvents:"none"}},Et)))});B0.displayName="Input";function _s(e,t){try{e.insertRule(t)}catch{console.error("input-otp could not insert CSS rule:",t)}}var tx=`
216[data-input-otp] {
217  --nojs-bg: white !important;
218  --nojs-fg: black !important;
219
220  background-color: var(--nojs-bg) !important;
221  color: var(--nojs-fg) !important;
222  caret-color: var(--nojs-fg) !important;
223  letter-spacing: .25em !important;
224  text-align: center !important;
225  border: 1px solid var(--nojs-fg) !important;
226  border-radius: 4px !important;
227  width: 100% !important;
228}
229@media (prefers-color-scheme: dark) {
230  [data-input-otp] {
231    --nojs-bg: black !important;
232    --nojs-fg: white !important;
233  }
234}`;const ec=m.forwardRef(({className:e,containerClassName:t,...n},r)=>u.jsx(B0,{ref:r,containerClassName:G("flex items-center gap-2 has-[:disabled]:opacity-50",t),className:G("disabled:cursor-not-allowed",e),...n}));ec.displayName="InputOTP";const tc=m.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:G("flex items-center",e),...t}));tc.displayName="InputOTPGroup";const nc=m.forwardRef(({index:e,className:t,...n},r)=>{const s=m.useContext(U0),{char:o,hasFakeCaret:a,isActive:i}=s.slots[e];return u.jsxs("div",{ref:r,className:G("relative flex h-10 w-10 items-center justify-center border-y border-r border-input text-sm transition-all first:rounded-l-md first:border-l last:rounded-r-md",i&&"z-10 ring-2 ring-ring ring-offset-background",t),...n,children:[o,a&&u.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:u.jsx("div",{className:"h-4 w-px animate-caret-blink bg-foreground duration-1000"})})]})});nc.displayName="InputOTPSlot";const nx=m.forwardRef(({...e},t)=>u.jsx("div",{ref:t,role:"separator",...e,children:u.jsx(Z7,{})}));nx.displayName="InputOTPSeparator";function rx(e){const t=m.useRef({value:e,previous:e});return m.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function $0(e){const[t,n]=m.useState(void 0);return Ln(()=>
vendor: 5,136 bytes, line 234
234{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const o=s[0];let a,i;if("borderBoxSize"in o){const l=o.borderBoxSize,c=Array.isArray(l)?l[0]:l;a=c.inlineSize,i=c.blockSize}else a=e.offsetWidth,i=e.offsetHeight;n({width:a,height:i})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var ei="Switch",[sx]=co(ei),[ox,ax]=sx(ei),z0=m.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:s,defaultChecked:o,required:a,disabled:i,value:l="on",onCheckedChange:c,form:d,...f}=e,[h,p]=m.useState(null),g=Ke(t,_=>p(_)),y=m.useRef(!1),v=h?d||!!h.closest("form"):!0,[x,C]=Qa({prop:s,defaultProp:o??!1,onChange:c,caller:ei});return u.jsxs(ox,{scope:n,checked:x,disabled:i,children:[u.jsx(Be.button,{type:"button",role:"switch","aria-checked":x,"aria-required":a,"data-state":q0(x),"data-disabled":i?"":void 0,disabled:i,value:l,...f,ref:g,onClick:Oe(e.onClick,_=>{C(b=>!b),v&&(y.current=_.isPropagationStopped(),y.current||_.stopPropagation())})}),v&&u.jsx(W0,{control:h,bubbles:!y.current,name:r,value:l,checked:x,required:a,disabled:i,form:d,style:{transform:"translateX(-100%)"}})]})});z0.displayName=ei;var V0="SwitchThumb",H0=m.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,s=ax(V0,n);return u.jsx(Be.span,{"data-state":q0(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t})});H0.displayName=V0;var ix="SwitchBubbleInput",W0=m.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...s},o)=>{const a=m.useRef(null),i=Ke(a,o),l=rx(n),c=$0(t);return m.useEffect(()=>{const d=a.current;if(!d)return;const f=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(f,"checked").set;if(l!==n&&p){const g=new Event("click",{bubbles:r});p.call(d,n),d.dispatchEvent(g)}},[l,n,r]),u.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:i,style:{...s.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});W0.displayName=ix;function q0(e){return e?"checked":"unchecked"}var G0=z0,lx=H0;const K0=m.forwardRef(({className:e,...t},n)=>u.jsx(G0,{className:G("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:u.jsx(lx,{className:G("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));K0.displayName=G0.displayName;var cx=e=>{switch(e){case"success":return fx;case"info":return px;case"warning":return hx;case"error":return mx;default:return null}},ux=Array(12).fill(0),dx=({visible:e,className:t})=>L.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},L.createElement("div",{className:"sonner-spinner"},ux.map((n,r)=>L.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),fx=L.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},L.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"})),hx=L.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},L.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"})),px=L.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},L.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"})),mx=L.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},L.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"})),gx=L.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"},L.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),L.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),yx=()=>{let[e,t]=L.useState(document.hidden);return L.useEffect(()=>{let n=()=>{t(document.hidden)};
234return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},rc=1,vx=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,s=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:rc++,o=this.toasts.find(i=>i.id===s),a=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),o?this.toasts=this.toasts.map(i=>i.id===s?(this.publish({...i,...e,id:s,title:n}),{...i,...e,id:s,dismissible:a,title:n}):i):this.addToast({title:n,...r,dismissible:a,id:s}),s},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>
234this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),s=n!==void 0,o,a=r.then(async l=>{if(o=["resolve",l],L.isValidElement(l))s=!1,this.create({id:n,type:"default",message:l});else if(wx(l)&&!l.ok){s=!1;let c=typeof t.error=="function"?await t.error(`HTTP error! status: ${l.status}`):t.error,d=typeof t.description=="function"?await t.description(`HTTP error! status: ${l.status}`):t.description;this.create({id:n,type:"error",message:c,description:d})}else if(t.success!==void 0){s=!1;let c=typeof t.success=="function"?await t.success(l):t.success,d=typeof t.description=="function"?await t.description(l):t.description;this.create({id:n,type:"success",message:c,description:d})}}).catch(async l=>{if(o=["reject",l],t.error!==void 0){s=!1;let c=typeof t.error=="function"?await t.error(l):t.error,d=typeof t.description=="function"?await t.description(l):t.description;this.create({id:n,type:"error",message:c,description:d})}}).finally(()=>{var l;s&&(this.dismiss(n),n=void 0),(l=t.finally)==null||l.call(t)}),i=()=>new Promise((l,c)=>a.then(()=>o[0]==="reject"?c(o[1]):l(o[1])).catch(c));return typeof n!="string"&&typeof n!="number"?{unwrap:i}:Object.assign(n,{unwrap:i})},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||rc++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},et=new vx,bx=(e,t)=>{let n=(t==null?void 0:t.id)||rc++;return et.addToast({title:e,...t,id:n}),n},wx=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",xx=bx,Cx=()=>et.toasts,_x=()=>et.getActiveToasts(),$i=Object.assign(xx,{success:et.success,info:et.info,warning:et.warning,error:et.error,custom:et.custom,message:et.message,promise:et.promise,dismiss:et.dismiss,loading:et.loading},{getHistory:Cx,getToasts:_x});function Ex(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}Ex(`: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;
234left: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}
234: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%);
234--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%)}
235`);function Mo(e){return e.label!==void 0}var Sx=3,Ax="32px",Nx="16px",ch=4e3,Px=356,kx=14,Ix=20,Rx=200;function yt(...e){return e.filter(Boolean).join(" ")}function Tx(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var Ox=e=>{var t,n,r,s,o,a,i,l,c,d,f;let{invert:h,toast:p,unstyled:g,interacting:y,setHeights:v,visibleToasts:x,heights:C,index:_,toasts:b,expanded:w,removeToast:P,defaultRichColors:N,closeButton:E,style:A,cancelButtonStyle:k,actionButtonStyle:T,className:I="",descriptionClassName:R="",duration:O,position:M,gap:D,loadingIcon:$,expandByDefault:H,classNames:U,icons:re,closeButtonAriaLabel:J="Close toast",pauseWhenPageIsHidden:
235Q}=e,[ee,oe]=L.useState(null),[he,dt]=L.useState(null),[ce,zt]=L.useState(!1),[Ct,_t]=L.useState(!1),[Et,St]=L.useState(!1),[At,q]=L.useState(!1),[Y,Te]=L.useState(!1),[$e,Fe]=L.useState(0),[ie,ze]=L.useState(0),Nt=L.useRef(p.duration||O||ch),Qe=L.useRef(null),We=L.useRef(null),ft=_===0,Pt=_+1<=x,ke=p.type,Ye=p.dismissible!==!1,go=p.className||"",yo=p.descriptionClassName||"",gr=L.useMemo(()=>C.findIndex(X=>X.toastId===p.id)||0,[C,p.id]),ui=L.useMemo(()=>{var X;return(X=p.closeButton)!=null?X:E},[p.closeButton,E]),vo=L.useMemo(()=>p.duration||O||ch,[p.duration,O]),ht=L.useRef(0),kt=L.useRef(0),bo=L.useRef(0),yr=L.useRef(null),[E2,S2]=M.split("-"),Iu=L.useMemo(()=>C.reduce((X,ue,xe)=>xe>=gr?X:X+ue.height,0),[C,gr]),Ru=yx(),A2=p.invert||h,di=ke==="loading";kt.current=L.useMemo(()=>gr*D+Iu,[gr,Iu]),L.useEffect(()=>{Nt.current=vo},[vo]),L.useEffect(()=>{zt(!0)},[]),L.useEffect(()=>{let X=We.current;if(X){let ue=X.getBoundingClientRect().height;return ze(ue),v(xe=>[{toastId:p.id,height:ue,position:p.position},...xe]),()=>v(xe=>xe.filter(pt=>pt.toastId!==p.id))}},[v,p.id]),L.useLayoutEffect(()=>{if(!ce)return;let X=We.current,ue=X.style.height;X.style.height="auto";let xe=X.getBoundingClientRect().height;X.style.height=ue,ze(xe),v(pt=>pt.find(mt=>mt.toastId===p.id)?pt.map(mt=>mt.toastId===p.id?{...mt,height:xe}:mt):[{toastId:p.id,height:xe,position:p.position},...pt])},[ce,p.title,p.description,v,p.id]);let ln=L.useCallback(()=>{_t(!0),Fe(kt.current),v(X=>X.filter(ue=>ue.toastId!==p.id)),setTimeout(()=>{P(p)},Rx)},[p,P,v,kt]);L.useEffect(()=>{if(p.promise&&ke==="loading"||p.duration===1/0||p.type==="loading")return;let X;return w||y||Q&&Ru?(()=>{if(bo.current<ht.current){let ue=new Date().getTime()-ht.current;Nt.current=Nt.current-ue}bo.current=new Date().getTime()})():Nt.current!==1/0&&(ht.current=new Date().getTime(),X=setTimeout(()=>{var ue;(ue=p.onAutoClose)==null||ue.call(p,p),ln()},Nt.current)),()=>clearTimeout(X)},[w,y,p,ke,Q,Ru,ln]),L.useEffect(()=>{p.delete&&ln()},[ln,p.delete]);function N2(){var X,ue,xe;return re!=null&&re.loading?L.createElement("div",{className:yt(U==null?void 0:U.loader,(X=p==null?void 0:p.classNames)==null?void 0:X.loader,"sonner-loader"),"data-visible":ke==="loading"},re.loading):$?L.createElement("div",{className:yt(U==null?void 0:U.loader,(ue=p==null?void 0:p.classNames)==null?void 0:ue.loader,"sonner-loader"),"data-visible":ke==="loading"},$):L.createElement(dx,{className:yt(U==null?void 0:U.loader,(xe=p==null?void 0:p.classNames)==null?void 0:xe.loader),visible:ke==="loading"})}return L.createElement("li",{tabIndex:0,ref:We,className:yt(I,go,U==null?void 0:U.toast,(t=p==null?void 0:p.classNames)==null?void 0:t.toast,U==null?void 0:U.default,U==null?void 0:U[ke],(n=p==null?void 0:p.classNames)==null?void 0:n[ke]),"data-sonner-toast":"","data-rich-colors":(r=p.richColors)!=null?r:N,"data-styled":!(p.jsx||p.unstyled||g),"data-mounted":ce,"data-promise":!!p.promise,"data-swiped":Y,"data-removed":Ct,"data-visible":Pt,"data-y-position":E2,"data-x-position":S2,"data-index":_,"data-front":ft,"data-swiping":Et,"data-dismissible":Ye,"data-type":ke,"data-invert":A2,"data-swipe-out":At,"data-swipe-direction":he,"data-expanded":!!(w||H&&ce),style:{"--index":_,"--toasts-before":_,"--z-index":b.length-_,"--offset":`${Ct?$e:kt.current}px`,"--initial-height":H?"auto":`${ie}px`,...A,...p.style},onDragEnd:()=>{St(!1),oe(null),yr.current=null},onPointerDown:X=>{di||!Ye||(Qe.current=new Date,Fe(kt.current),X.target.setPointerCapture(X.pointerId),X.target.tagName!=="BUTTON"&&(St(!0),yr.current={x:X.clientX,y:X.clientY}))},onPointerUp:()=>{var X,ue,xe,pt;if(At||!Ye)return;yr.current=null;let mt=Number(((X=We.current)==null?void 0:X.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),cn=Number(((ue=We.current)==null?void 0:ue.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Bn=new Date().getTime()-((xe=Qe.current)==null?void 0:xe.getTime()),gt=ee==="x"?mt:cn,un=Math.abs(gt)/Bn;if(Math.abs(gt)>=Ix||un>.11){Fe(kt.current),(pt=p.onDismiss)==null||pt.call(p,p),dt(ee==="x"?mt>0?"right":"left":cn>0?"down":"up"),ln(),q(!0),Te(!1);return}St(!1),oe(null)},onPointerMove:X=>{var ue,xe,pt,mt;if(!yr.current||!Ye||((ue=window.getSelection())==null?void 0:ue.toString().length)>0)return;let cn=X.clientY-yr.current.y,Bn=X.clientX-yr.current.x,gt=(xe=e.swipeDirections)!=null?xe:Tx(M);!ee&&(Math.abs(Bn)>1||Math.abs(cn)>
2351)&&oe(Math.abs(Bn)>Math.abs(cn)?"x":"y");let un={x:0,y:0};ee==="y"?(gt.includes("top")||gt.includes("bottom"))&&(gt.includes("top")&&cn<0||gt.includes("bottom")&&cn>0)&&(un.y=cn):ee==="x"&&(gt.includes("left")||gt.includes("right"))&&(gt.includes("left")&&Bn<0||gt.includes("right")&&Bn>0)&&(un.x=Bn),(Math.abs(un.x)>0||Math.abs(un.y)>0)&&Te(!0),(pt=We.current)==null||pt.style.setProperty("--swipe-amount-x",`${un.x}px`),(mt=We.current)==null||mt.style.setProperty("--swipe-amount-y",`${un.y}px`)}},ui&&!p.jsx?L.createElement("button",{"aria-label":J,"data-disabled":di,"data-close-button":!0,onClick:di||!Ye?()=>{}:()=>{var X;ln(),(X=p.onDismiss)==null||X.call(p,p)},className:yt(U==null?void 0:U.closeButton,(s=p==null?void 0:p.classNames)==null?void 0:s.closeButton)},(o=re==null?void 0:re.close)!=null?o:gx):null,p.jsx||m.isValidElement(p.title)?p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title:L.createElement(L.Fragment,null,ke||p.icon||p.promise?L.createElement("div",{"data-icon":"",className:yt(U==null?void 0:U.icon,(a=p==null?void 0:p.classNames)==null?void 0:a.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||N2():null,p.type!=="loading"?p.icon||(re==null?void 0:re[ke])||cx(ke):null):null,L.createElement("div",{"data-content":"",className:yt(U==null?void 0:U.content,(i=p==null?void 0:p.classNames)==null?void 0:i.content)},L.createElement("div",{"data-title":"",className:yt(U==null?void 0:U.title,(l=p==null?void 0:p.classNames)==null?void 0:l.title)},typeof p.title=="function"?p.title():p.title),p.description?L.createElement("div",{"data-description":"",className:yt(R,yo,U==null?void 0:U.description,(c=p==null?void 0:p.classNames)==null?void 0:c.description)},typeof p.description=="function"?p.description():p.description):null),m.isValidElement(p.cancel)?p.cancel:p.cancel&&Mo(p.cancel)?L.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||k,onClick:X=>{var ue,xe;Mo(p.cancel)&&Ye&&((xe=(ue=p.cancel).onClick)==null||xe.call(ue,X),ln())},className:yt(U==null?void 0:U.cancelButton,(d=p==null?void 0:p.classNames)==null?void 0:d.cancelButton)},p.cancel.label):null,m.isValidElement(p.action)?p.action:p.action&&Mo(p.action)?L.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||T,onClick:X=>{var ue,xe;Mo(p.action)&&((xe=(ue=p.action).onClick)==null||xe.call(ue,X),!X.defaultPrevented&&ln())},className:yt(U==null?void 0:U.actionButton,(f=p==null?void 0:p.classNames)==null?void 0:f.actionButton)},p.action.label):null))};function uh(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function jx(e,t){let n={};return[e,t].forEach((r,s)=>{let o=s===1,a=o?"--mobile-offset":"--offset",i=o?Nx:Ax;function l(c){["top","right","bottom","left"].forEach(d=>{n[`${a}-${d}`]=typeof c=="number"?`${c}px`:c})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(c=>{r[c]===void 0?n[`${a}-${c}`]=i:n[`${a}-${c}`]=typeof r[c]=="number"?`${r[c]}px`:r[c]}):l(i)}),n}var Lx=m.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:s=["altKey","KeyT"],expand:o,closeButton:a,className:i,offset:l,mobileOffset:c,theme:d="light",richColors:f,duration:h,style:p,visibleToasts:g=Sx,toastOptions:y,dir:v=uh(),gap:x=kx,loadingIcon:C,icons:_,containerAriaLabel:b="Notifications",pauseWhenPageIsHidden:w}=e,[P,N]=L.useState([]),E=L.useMemo(()=>Array.from(new Set([r].concat(P.filter(Q=>Q.position).map(Q=>Q.position)))),[P,r]),[A,k]=L.useState([]),[T,I]=L.useState(!1),[R,O]=L.useState(!1),[M,D]=L.useState(d!=="system"?d:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),$=L.useRef(null),H=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),U=L.useRef(null),re=L.useRef(!1),J=L.useCallback(Q=>{N(ee=>{var oe;return(oe=ee.find(he=>he.id===Q.id))!=null&&oe.delete||et.dismiss(Q.id),ee.filter(({id:he})=>he!==Q.id)})},[]);return L.useEffect(()=>et.subscribe(Q=>{if(Q.dismiss){N(ee=>ee.map(oe=>oe.id===Q.id?{...oe,delete:!0}:oe));return}setTimeout(()=>{S1.flushSync(()=>{N(ee=>{let oe=ee.findIndex(he=>he.id===Q.id);return oe!==-1?[...ee.slice(0,oe),{...ee[oe],...Q},...ee.slice(oe+1)]:[Q,...ee]})})})}),[]),L.useEffect(()=>{if(d!=="system"){D(d);return}if(d==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?D("dark"):D("light")),typeof window>"u")return;let Q=window.matchMedia("(prefers-color-scheme: dark)");try{Q.addEventListener("change",({matches:ee})=>{D(ee?"dark":"light")})}catch{Q.addListener(({matches:oe})=>{try{D(oe?"dark":"light")}catch(he){console.error(he)}})}},[d]),L.useEffect(()=>{P.length<=1&&I(!1)},[P]),L.useEffect(()=>{let Q=ee=>{var oe,he;s.every(dt=>
235ee[dt]||ee.code===dt)&&(I(!0),(oe=$.current)==null||oe.focus()),ee.code==="Escape"&&(document.activeElement===$.current||(he=$.current)!=null&&he.contains(document.activeElement))&&I(!1)};return document.addEventListener("keydown",Q),()=>document.removeEventListener("keydown",Q)},[s]),L.useEffect(()=>{if($.current)return()=>{U.current&&(U.current.focus({preventScroll:!0}),U.current=null,re.current=!1)}},[$.current]),L.createElement("section",{ref:t,"aria-label":`${b} ${H}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},E.map((Q,ee)=>{var oe;let[he,dt]=Q.split("-");return P.length?L.createElement("ol",{key:Q,dir:v==="auto"?uh():v,tabIndex:-1,ref:$,className:i,"data-sonner-toaster":!0,"data-theme":M,"data-y-position":he,"data-lifted":T&&P.length>1&&!o,"data-x-position":dt,style:{"--front-toast-height":`${((oe=A[0])==null?void 0:oe.height)||0}px`,"--width":`${Px}px`,"--gap":`${x}px`,...p,...jx(l,c)},onBlur:ce=>{re.current&&!ce.currentTarget.contains(ce.relatedTarget)&&(re.current=!1,U.current&&(U.current.focus({preventScroll:!0}),U.current=null))},onFocus:ce=>{ce.target instanceof HTMLElement&&ce.target.dataset.dismissible==="false"||re.current||(re.current=!0,U.current=ce.relatedTarget)},onMouseEnter:()=>I(!0),onMouseMove:()=>I(!0),onMouseLeave:()=>{R||I(!1)},onDragEnd:()=>I(!1),onPointerDown:ce=>{ce.target instanceof HTMLElement&&ce.target.dataset.dismissible==="false"||O(!0)},onPointerUp:()=>O(!1)},P.filter(ce=>!ce.position&&ee===0||ce.position===Q).map((ce,zt)=>{var Ct,_t;return L.createElement(Ox,{key:ce.id,icons:_,index:zt,toast:ce,defaultRichColors:f,duration:(Ct=y==null?void 0:y.duration)!=null?Ct:h,className:y==null?void 0:y.className,descriptionClassName:y==null?void 0:y.descriptionClassName,invert:n,visibleToasts:g,closeButton:(_t=y==null?void 0:y.closeButton)!=null?_t:a,interacting:R,position:Q,style:y==null?void 0:y.style,unstyled:y==null?void 0:y.unstyled,classNames:y==null?void 0:y.classNames,cancelButtonStyle:y==null?void 0:y.cancelButtonStyle,actionButtonStyle:y==null?void 0:y.actionButtonStyle,removeToast:J,toasts:P.filter(Et=>Et.position==ce.position),heights:A.filter(Et=>Et.position==ce.position),setHeights:k,expandByDefault:o,gap:x,loadingIcon:C,expanded:T,pauseWhenPageIsHidden:w,swipeDirections:e.swipeDirections})})):null}))});const Q0=e=>{const t=e;return{is_admin_identity:(t==null?void 0:t.is_admin_identity)===!0,require_mfa:(t==null?void 0:t.require_mfa)===!0,has_verified_mfa:(t==null?void 0:t.has_verified_mfa)===!0,aal:(t==null?void 0:t.aal)==="aal2"?"aal2":"aal1",needs_mfa:(t==null?void 0:t.needs_mfa)===!0,policy_available:(t==null?void 0:t.policy_available)!==!1}},Y0=async()=>{try{const e=await Zo("get_admin_mfa_status");return Q0(e)}catch(e){const[t,n,r,s]=await Promise.allSettled([Zo("check_admin_identity"),Zo("check_admin_access"),z.auth.mfa.getAuthenticatorAssuranceLevel(),z.auth.mfa.listFactors()]);if(t.status==="rejected"&&n.status==="rejected")throw e;const o=t.status==="fulfilled"?t.value===!0:n.status==="fulfilled"&&n.value===!0,a=s.status==="rejected"||s.value.error?!1:s.value.data.all.some(d=>d.status==="verified"),i=r.status==="rejected"||r.value.error||r.value.data.currentLevel!=="aal2"?"aal1":"aal2",l=n.status==="fulfilled"&&n.value===!0,c=o&&a&&!l&&i!=="aal2";return{is_admin_identity:o,require_mfa:c,has_verified_mfa:a,aal:i,needs_mfa:c,policy_available:!1}}},dh=[0,1,2,3,4,5],fh="Little Chapters admin",Mx=(e,t)=>e.friendly_name?e.friendly_name:`Authenticator ${t+1}`,Dx=({mode:e,status:t,onStatusChange:n})=>{const[r,s]=m.useState([]),[o,a]=m.useState(null),[i,l]=m.useState(null),[c,d]=m.useState(""),[f,h]=m.useState(""),[p,g]=m.useState(!0),[y,v]=m.useState(!1),[x,C]=m.useState(null),_=m.useMemo(()=>r.find(I=>I.id===o)??r[0]??null,[r,o]),b=async()=>{const I=await Y0();return n(I),I},w=async()=>{g(!0);try{const{data:I,error:R}=await z.auth.mfa.listFactors();if(R)throw R;const O=I.totp.map(M=>({id:M.id,friendly_name:M.friendly_name,created_at:M.created_at}));s(O),a(M=>{var D;return M??((D=O[0])==null?void 0:D.id)??null})}catch(I){C(I instanceof Error?I.message:"Could not load MFA factors.")}finally{g(!1)}};m.useEffect(()=>{w()},[]);const P=async()=>{v(!0),C(null);try{const I=await z.auth.mfa.listFactors();if(I.error)throw I.error;const R=I.data.all.filter(D=>D.factor_type==="totp"&&D.status==="unverified"&&D.friendly_name===fh);for(const D of R){const{error:$}=await z.auth.mfa.unenroll({factorId:D.id});if($)throw $}const{data:O,error:M}=await z.auth.mfa.enroll({factorType:"totp",friendlyName:fh,issuer:"Little Chapters"});if(M)throw M;l({id:O.id,uri:O.totp.uri,secret:O.totp.secret}),h("")}catch(I){C(I instanceof Error?I.message:"Could not start MFA setup.")}finally{v(!1)}},N=async()=>
235{if(!(!i||f.length!==6)){v(!0),C(null);try{const I=await z.auth.mfa.challenge({factorId:i.id});if(I.error)throw I.error;const R=await z.auth.mfa.verify({factorId:i.id,challengeId:I.data.id,code:f});if(R.error)throw R.error;l(null),h(""),await w(),await b(),$i.success("Two-factor authentication is set up.")}catch(I){C(I instanceof Error?I.message:"Could not verify the setup code.")}finally{v(!1)}}},E=async()=>{if(!(!_||c.length!==6)){v(!0),C(null);try{const{error:I}=await z.auth.mfa.challengeAndVerify({factorId:_.id,code:c});if(I)throw I;d(""),await b(),$i.success("Admin session verified.")}catch(I){C(I instanceof Error?I.message:"Could not verify the authentication code.")}finally{v(!1)}}},A=async I=>{v(!0),C(null);try{const R=await Zo("set_admin_mfa_required",{p_required:I});n(Q0(R)),$i.success(I?"Admin two-factor enforcement is on.":"Admin two-factor enforcement is off.")}catch(R){C(R instanceof Error?R.message:"Could not update admin MFA enforcement.")}finally{v(!1)}},k=t.has_verified_mfa&&t.aal!=="aal2",T=!t.has_verified_mfa||i;return u.jsxs("div",{className:"bg-white border border-gray-200 rounded-lg p-4 space-y-4",children:[u.jsxs("div",{className:"flex items-start gap-3",children:[u.jsx("div",{className:"w-10 h-10 bg-terracotta/10 rounded-full flex items-center justify-center shrink-0",children:u.jsx(J7,{className:"h-5 w-5 text-terracotta"})}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsx("h2",{className:"text-base font-semibold text-gray-900",children:"Admin two-factor authentication"}),u.jsx("p",{className:"text-sm text-gray-500",children:"Protect admin access with an authenticator app. Enforcement applies only to `/admin`."})]}),u.jsx(Rs,{variant:"ghost",size:"icon",onClick:()=>void b(),disabled:y,children:u.jsx(sy,{className:"h-4 w-4"})})]}),x&&u.jsxs(Xl,{variant:"destructive",children:[u.jsx(iy,{className:"h-4 w-4"}),u.jsx(Zl,{children:"Action failed"}),u.jsx(Jl,{children:x})]}),e==="settings"&&u.jsxs("div",{className:"flex items-center justify-between gap-4 rounded-md border border-gray-100 bg-gray-50 p-3",children:[u.jsxs("div",{children:[u.jsx("p",{className:"text-sm font-medium text-gray-900",children:"Require 2FA for all admins"}),u.jsx("p",{className:"text-xs text-gray-500",children:t.policy_available?"You must verify this session with MFA before enabling enforcement.":"Apply the admin MFA migration before enabling enforcement."})]}),u.jsx(K0,{checked:t.require_mfa,disabled:y||!t.policy_available||(t.require_mfa?t.aal!=="aal2":t.aal!=="aal2"||!t.has_verified_mfa),onCheckedChange:I=>void A(I)})]}),t.aal==="aal2"&&t.has_verified_mfa&&u.jsxs(Xl,{children:[u.jsx(rf,{className:"h-4 w-4"}),u.jsx(Zl,{children:"Verified admin session"}),u.jsx(Jl,{children:"This browser session has completed two-factor verification."})]}),k&&u.jsxs("div",{className:"space-y-3",children:[u.jsxs("div",{children:[u.jsx("p",{className:"text-sm font-medium text-gray-900",children:"Verify your admin session"}),u.jsx("p",{className:"text-xs text-gray-500",children:"Enter the 6-digit code from your authenticator app."})]}),!p&&r.length>1&&u.jsx("select",{value:(_==null?void 0:_.id)??"",onChange:I=>a(I.target.value),className:"w-full rounded-md border border-gray-200 bg-white px-3 py-2 text-sm",children:r.map((I,R)=>u.jsx("option",{value:I.id,children:Mx(I,R)},I.id))}),u.jsx(ec,{maxLength:6,value:c,onChange:d,children:u.jsx(tc,{children:dh.map(I=>u.jsx(nc,{index:I},I))})}),u.jsxs(Rs,{onClick:()=>void E(),disabled:y||c.length!==6||!_,children:[u.jsx(tf,{className:"h-4 w-4"}),"Verify code"]})]}),T&&u.jsxs("div",{className:"space-y-3",children:[u.jsxs("div",{children:[u.jsx("p",{className:"text-sm font-medium text-gray-900",children:"Set up an authenticator app"}),u.jsx("p",{className:"text-xs text-gray-500",children:"Scan the QR code, then enter the generated code to finish setup."})]}),i?u.jsxs("div",{className:"space-y-3",children:[u.jsx("div",{className:"inline-flex rounded-md border border-gray-200 bg-white p-3",children:u.jsx(Qs,{value:i.uri,size:176,level:"M"})}),u.jsxs("div",{className:"rounded-md bg-gray-50 border border-gray-100 p-3",children:[u.jsx("p",{className:"text-xs font-medium text-gray-500",children:"Manual setup key"}),u.jsx("p",{className:"break-all font-mono text-sm text-gray-900",children:i.secret})]}
235),u.jsx(ec,{maxLength:6,value:f,onChange:h,children:u.jsx(tc,{children:dh.map(I=>u.jsx(nc,{index:I},I))})}),u.jsxs(Rs,{onClick:()=>void N(),disabled:y||f.length!==6,children:[u.jsx(rf,{className:"h-4 w-4"}),"Finish setup"]})]}):u.jsxs(Rs,{onClick:()=>void P(),disabled:y,children:[u.jsx(tf,{className:"h-4 w-4"}),"Start setup"]})]})]})},Fx=({children:e})=>{var r;const[t,n]=m.useState({loading:!0,status:null});return m.useEffect(()=>{(async()=>{try{const o=await Y0();n({loading:!1,status:o})}catch{n({loading:!1,status:null})}})()},[]),t.loading?u.jsx("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:u.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-gray-400"})}):(r=t.status)!=null&&r.is_admin_identity?t.status.needs_mfa?u.jsx("div",{className:"min-h-screen bg-gray-50 px-4 py-10 flex items-start justify-center",children:u.jsx("div",{className:"w-full max-w-xl",children:u.jsx(Dx,{mode:"gate",status:t.status,onStatusChange:s=>n({loading:!1,status:s})})})}):e:u.jsx(lt,{to:"/",replace:!0})},X0="from",Z0="app",hh="lc-opened-from-app",Ux=e=>{const t=new URL(e);return t.searchParams.set(X0,Z0),t.toString()},yk=()=>{try{return new URLSearchParams(window.location.search).get(X0)===Z0?(sessionStorage.setItem(hh,"1"),!0):sessionStorage.getItem(hh)==="1"}catch{return!1}},Bx=/^https:\/\/(www\.)?littlechapters\.app(\/|\?|$)/i,Na=e=>{if(typeof e!="string")return null;const t=e.trim();return t?t.startsWith("/")&&!t.startsWith("//")?{kind:"route",to:t}:Bx.test(t)?{kind:"url",url:t}:null:null},vk=e=>{const t=Na(e);return t?t.kind:"dismiss"},$x=async e=>{if(j.isNativePlatform()){const{Browser:t}=await B(async()=>{const{Browser:n}=await Promise.resolve().then(()=>V8);return{Browser:n}},void 0);await t.open({url:Ux(e)});return}window.open(e,"_blank","noopener")},bk=[{label:"In the app",options:[{value:"/",label:"Home"},{value:"/?quickPhoto=1",label:"Add photos"},{value:"/photobook",label:"Photobook flow"},{value:"/photobook/select",label:"Photobook: pick a book"},{value:"/?settings=main",label:"Settings"},{value:"/?settings=orders",label:"Orders"},{value:"/plus",label:"Plus"},{value:"/waarom",label:"Why Little Chapters"}]},{label:"Website (opens in browser)",options:[{value:"https://littlechapters.app/kraamcadeau",label:"Kraamcadeau / cadeaubon"},{value:"https://littlechapters.app/cadeau",label:"Cadeaubon verzilveren"},{value:"https://littlechapters.app/links",label:"Linktree"},{value:"https://littlechapters.app/over-ons",label:"Over ons"},{value:"https://littlechapters.app/support",label:"Support"}]}],Do={order_shipped:"order",order_in_production:"order",order_feedback_request:"order",feature_update:"feature",announcement:"announcement",promo:"promo",welcome:"message"},zx=(e,t,n)=>e&&Do[e]?Do[e]:t&&Do[t]?Do[t]:n?"announcement":"message",wk=e=>e.kind==="order"?e.primaryRoute??"/?settings=orders":e.kind==="message"?e.showOnLaunch&&e.campaignSlug?`/?campaign=${encodeURIComponent(e.campaignSlug)}`:e.primaryRoute:e.campaignSlug?`/?campaign=${encodeURIComponent(e.campaignSlug)}`:e.primaryRoute,Vx="id, title, body, data, created_at, read_at",Hx=["completed","failed"],Wx=["product_update","broadcast"],ph=e=>e&&typeof e=="object"&&!Array.isArray(e)?e:{},Wn=e=>typeof e=="string"&&e.trim().length>0?e.trim():null,qx=e=>{const t=Wn(e);return t&&/^https?:\/\//i.test(t)?t:null},Gx=async e=>{const{supabase:t}=await B(async()=>{const{supabase:o}=await Promise.resolve().then(()=>C5);return{supabase:o}},void 0),{data:n,error:r}=await t.from("notifications_outbox").select("id").eq("data->>campaign_id",e).is("read_at",null).limit(20);if(r||!n||n.length===0)return!1;const{error:s}=await t.rpc("mark_outbox_messages_read",{p_ids:n.map(o=>o.id)});return!s},Kx=e=>{const t=Wn(e);return t&&Na(t)?t.trim():null},Qx=e=>{const t=ph(e.data),n=Wn(t.campaign_id),r=ph(t.primary_action);return{id:e.id,title:e.title,body:e.body,createdAt:e.created_at??"",readAt:e.read_at,imageUrl:qx(t.image_url),campaignSlug:n,kind:zx(Wn(t.kind)??Wn(t.message_type),Wn(t.type),n),primaryRoute:Kx(r.to),showOnLaunch:t.show_on_launch===!0||t.show_on_launch==="true",minRelease:Wn(t.min_release),data:t}},Ie=we("LiveUpdate",{web:()=>B(()=>import("./web_BENEsIOX.js"),__vite__mapDeps([20,1,2,3,4])).then(e=>new e.LiveUpdateWeb)}),fe="[LiveUpdate]",J0="live-update:bundle-release-ids",eg="live-update:first-launch-bootstrap-done",tg="live-update:diagnostic-events",ng="live-update:track",zi="releaseId",mh=4e3,rg=20,Yx=Date.now(),ru=!1,Fr="production",Xx=["production","beta"];let Nr=null;const Zx=e=>typeof e=="string"&&Xx.includes(e),ho=async()=>
235{if(Nr)return Nr;if(!j.isNativePlatform())return Fr;try{const{value:e}=await Re.get({key:ng});Nr=Zx(e)?e:Fr}catch(e){console.warn(fe,"Failed to read track:",e),Nr=Fr}return Nr},Jx=async e=>{if(!j.isNativePlatform())return!1;const t=await ho();if(t===e)return!1;Nr=e;try{await Re.set({key:ng,value:e})}catch(n){console.warn(fe,"Failed to persist track:",n)}return lr("Live Update track changed",{from:t,to:e},"live-update"),console.info(fe,"Track changed:",{from:t,to:e}),!0},Ys=(e,t=Fr)=>`${t}-${e}`,Vi=async e=>{try{return await Ie.fetchLatestBundle({channel:e})}catch(t){return console.warn(fe,`fetchLatestBundle failed for ${e}:`,t),null}},eC=async e=>{const t=await ho(),n=Ys(e,"production");if(t!=="production"&&!ru){const r=Ys(e,t),s=await Vi(r);return s!=null&&s.bundleId?{track:t,channel:r,latestBundle:s,fellBack:!1}:(console.info(fe,`No bundle on ${r}; falling back to ${n}`),{track:t,channel:n,latestBundle:await Vi(n),fellBack:!0})}return{track:t,channel:n,latestBundle:await Vi(n),fellBack:!1}},sg=e=>{if(e instanceof Error)return e.message;if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}},og=async()=>{try{return(await Ie.getBlockedBundles()).bundleIds??[]}catch(e){return console.warn(fe,"Failed to read blocked bundles:",e),[]}},ag=async()=>{try{const[e,t]=await Promise.all([Ie.getVersionCode(),Ie.getVersionName()]);return{versionCode:e.versionCode??null,versionName:t.versionName??null}}catch(e){return console.warn(fe,"Failed to read version info:",e),{versionCode:null,versionName:null}}},ig=async()=>{if(!j.isNativePlatform())return[];try{const{value:e}=await Re.get({key:tg});if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.slice(-rg):[]}catch(e){return console.warn(fe,"Failed to read diagnostic events:",e),[]}},Pa=async e=>{if(j.isNativePlatform())try{const n=[...await ig(),e].slice(-rg);await Re.set({key:tg,value:JSON.stringify(n)})}catch(t){console.warn(fe,"Failed to persist diagnostic event:",t)}},lg=async()=>{try{const{value:e}=await Re.get({key:J0});if(!e)return{};const t=JSON.parse(e);return t&&typeof t=="object"?t:{}}catch(e){return console.error(fe,"Failed to read stored bundle release IDs:",e),{}}},tC=async(e,t)=>{try{const n=await lg();n[e]=t,await Re.set({key:J0,value:JSON.stringify(n)})}catch(n){console.error(fe,"Failed to store bundle release ID:",n)}},nC=async()=>{try{const{value:e}=await Re.get({key:eg});return e==="true"}catch(e){return console.error(fe,"Failed to read first-launch bootstrap state:",e),!1}},rC=async()=>{try{await Re.set({key:eg,value:"true"})}catch(e){console.error(fe,"Failed to persist first-launch bootstrap state:",e)}},sC=async()=>{if(!j.isNativePlatform()){console.info(fe,"Skipping - not on native platform");return}const e=Date.now();try{const t=await Ie.ready(),n=Date.now()-e,[r,s,o]=await Promise.all([og(),ag(),ho()]),a=s.versionCode?Ys(s.versionCode,o):null,i={type:t.rollback?"rollback":"ready",at:new Date().toISOString(),currentBundleId:t.currentBundleId,previousBundleId:t.previousBundleId,rollback:t.rollback,blockedBundleIds:r,versionCode:s.versionCode,versionName:s.versionName,channel:a,track:o,readyLatencyMs:n,moduleAgeMs:Date.now()-Yx};await Pa(i),lr(t.rollback?"Live Update rollback detected":"Live Update ready",i,"live-update"),t.rollback&&Ce(new Error("Live Update rolled back to the built-in bundle"),{area:"live-update",action:"live_update_ready_rollback",level:"warning",tags:{currentBundleId:t.currentBundleId,previousBundleId:t.previousBundleId,versionCode:s.versionCode,versionName:s.versionName,channel:a},extra:{blockedBundleIds:r,readyLatencyMs:n,moduleAgeMs:i.moduleAgeMs}}),console.info(fe,"Ready signal sent",i);const{bundleId:l}=await Ie.getCurrentBundle();console.info(fe,"Current bundle:",l??"built-in")}catch(t){console.error(fe,"Failed to initialize:",t)}},ka=async()=>{var e,t;if(!j.isNativePlatform())return!1;try{const{versionCode:n}=await Ie.getVersionCode(),{track:r,channel:s,latestBundle:o,fellBack:a}=await eC(n);console.info(fe,"Sync config:",{versionCode:n,track:r,channel:s,fellBack:a,devMode:ru});const i=await Ie.sync({channel:s}),[l,c]=await Promise.all([og(),Ie.getCurrentBundle()]),d=i.nextBundleId!=null;i.nextBundleId&&(o==null?void 0:o.bundleId)===i.nextBundleId&&((e=o.customProperties)!=null&&e[zi])&&await tC(i.nextBundleId,o.customProperties[zi]);const f={type:"sync",at:new Date().toISOString(),currentBundleId:c.bundleId??null,
235nextBundleId:i.nextBundleId??null,blockedBundleIds:l,versionCode:n,channel:s,track:r};return await Pa(f),console.info(fe,"Sync result:",{nextBundleId:i.nextBundleId??"none",hasUpdate:d,blockedBundleIds:l,releaseId:i.nextBundleId&&(o==null?void 0:o.bundleId)===i.nextBundleId?((t=o.customProperties)==null?void 0:t[zi])??null:null}),d}catch(n){const r=sg(n),[s,o]=await Promise.all([ag(),ho()]);return await Pa({type:"sync_failed",at:new Date().toISOString(),currentBundleId:null,versionCode:s.versionCode,versionName:s.versionName,channel:s.versionCode?Ys(s.versionCode,o):null,track:o,message:r}),console.error(fe,"Sync failed:",n),!1}},oC=async(e,t,n)=>{let r=null;try{return await Promise.race([e,new Promise((s,o)=>{r=setTimeout(()=>{o(new Error(n))},t)})])}finally{r&&clearTimeout(r)}},aC=async()=>{if(!(!j.isNativePlatform()||await nC())){console.info(fe,"Starting first-launch bootstrap sync");try{if(await rC(),await oC(ka(),mh,`First-launch sync timed out after ${mh}ms`)){console.info(fe,"Applying first-launch bundle immediately"),await Ie.reload();return}console.info(fe,"First-launch bootstrap found no update")}catch(t){await Pa({type:"first_launch_sync_failed",at:new Date().toISOString(),currentBundleId:null,message:sg(t)}),console.warn(fe,"First-launch bootstrap skipped:",t)}}},xk=async()=>{await Ie.reload()},cg=async()=>{if(!j.isNativePlatform())return null;try{const[e,t,n]=await Promise.all([Ie.getCurrentBundle(),Ie.getVersionCode(),Ie.getVersionName()]);return e.bundleId?(await lg())[e.bundleId]??e.bundleId:n.versionName||`1.${t.versionCode}`}catch(e){return console.error(fe,"Failed to resolve active release:",e),null}},iC=async()=>{if(!j.isNativePlatform())return null;try{const[e,t,n,r,s,o,a]=await Promise.all([Ie.getCurrentBundle(),Ie.getVersionCode(),Ie.getVersionName(),Ie.getBundles(),Ie.getBlockedBundles(),ig(),ho()]),i=await cg(),l={currentBundleId:e.bundleId??"built-in",activeReleaseId:i,versionCode:t.versionCode,versionName:n.versionName,track:a,channel:Ys(t.versionCode,a),devMode:ru,availableBundles:r.bundleIds,blockedBundles:s.bundleIds,recentDiagnosticEvents:o.slice(-5)};return console.info(fe,"Status:",l),l}catch(e){return console.error(fe,"Failed to get status:",e),null}},gh=e=>{const[t,...n]=e.split("-"),r=n.length?n.join("-"):null,s=o=>o.split(".").map(a=>Number.parseInt(a,10)||0);return{base:s(t),pre:r?s(r):null}},yh=(e,t)=>{const n=Math.max(e.length,t.length);for(let r=0;r<n;r++){const s=(e[r]??0)-(t[r]??0);if(s!==0)return s}return 0},lC=(e,t)=>{const n=gh(e),r=gh(t),s=yh(n.base,r.base);return s!==0?s:n.pre===null&&r.pre===null?0:n.pre===null?1:r.pre===null?-1:yh(n.pre,r.pre)};let Hi=null;const cC=()=>(Hi||(Hi=cg()),Hi),uC=(e,t)=>!e||!j.isNativePlatform()?!0:t?lC(t,e)>=0:!1,dC=50,Wi=e=>["notification-inbox",e];async function fC(e){const{data:t,error:n}=await z.from("notifications_outbox").select(Vx).eq("recipient_id",e).in("status",[...Hx]).in("notification_type",[...Wx]).not("data->>campaign_id","is",null).or("data->>suppress_inbox.is.null,data->>suppress_inbox.neq.true").order("created_at",{ascending:!1}).limit(dC);if(n)throw n;const r=await cC();return(t??[]).map(Qx).filter(s=>uC(s.minRelease,r))}const hC=()=>{const{user:e}=ge(),t=ut(),n=e==null?void 0:e.id,{data:r,isLoading:s,isFetching:o,refetch:a}=hr({queryKey:Wi(n),queryFn:()=>fC(n),enabled:!!n,staleTime:6e4,refetchOnWindowFocus:!0,refetchInterval:5*6e4}),i=r??[],l=i.filter(d=>!d.readAt).map(d=>d.id),c=m.useCallback(async d=>{if(!n||d.length===0)return[];const f=new Date().toISOString();t.setQueryData(Wi(n),p=>(p??[]).map(g=>d.includes(g.id)&&!g.readAt?{...g,readAt:f}:g));const{error:h}=await z.rpc("mark_outbox_messages_read",{p_ids:d});return h&&t.invalidateQueries({queryKey:Wi(n)}),d},[t,n]);return{messages:i,unreadIds:l,unreadCount:l.length,isLoading:s,isFetching:o,markRead:c,refetch:a}},vh="launch-message:baseline",bh=async()=>{try{const{value:t}=await Re.get({key:vh});if(t)return t}catch(t){console.warn("[LaunchMessage] Failed to read baseline:",t)}const e=new Date().toISOString();try{await Re.set({key:vh,value:e})}
235catch(t){console.warn("[LaunchMessage] Failed to persist baseline:",t)}return e};let Ts=null;const pC=new Promise(e=>{Ts=e}),Es=e=>{Ts==null||Ts(e),Ts=null},mC=(e=4e3)=>Promise.race([pC,new Promise(t=>{setTimeout(()=>t(!1),e)})]);function gC(){const{loading:e,user:t}=ge(),{messages:n,isLoading:r,isFetching:s}=hC(),o=tt(),a=He(),[i,l]=m.useState(!0),[c,d]=m.useState(0),f=m.useRef(!1);return m.useEffect(()=>ao.subscribe(h=>{h&&(l(!0),d(p=>p+1))}),[]),m.useEffect(()=>{const h=()=>{l(!0),d(p=>p+1)};return window.addEventListener(Gs,h),window.addEventListener($l,h),()=>{window.removeEventListener(Gs,h),window.removeEventListener($l,h)}},[]),m.useEffect(()=>{if(!i||f.current||e)return;if(!t){bh(),Es(!1);return}if(r||s)return;f.current=!0;let h=!1;(async()=>{try{if(new URLSearchParams(window.location.search).get("campaign")){Es(!1);return}const p=await Lc();if(p&&!p.completed){h=!0,Es(!1);return}if(c0()){h=!0,Es(!1);return}const g=await bh(),y=n.find(x=>x.showOnLaunch&&!x.readAt&&x.campaignSlug&&x.createdAt>g);if(Es(!!(y!=null&&y.campaignSlug)),!(y!=null&&y.campaignSlug))return;const v=new URLSearchParams(a.search);v.set("campaign",y.campaignSlug),o(`${a.pathname}?${v.toString()}${a.hash}`,{replace:!0})}finally{h||l(!1),f.current=!1}})()},[i,c,e,t,r,s,n,o,a]),null}const yC=/(^|\.)cloudflarestream\.com$/i,su=/(^|\.)videodelivery\.net$/i,ug=/\.(mp4|m4v|mov|webm)(?:$|[?#])/i,vC=/(?:\/manifest\/video\.(?:m3u8|mpd)|\.(?:m3u8|mpd))(?:$|[?#])/i,ou=e=>{try{return new URL(e)}catch{return null}},au=e=>{const t=ou(e);if(!t)return null;const n=yC.test(t.hostname),r=su.test(t.hostname);return!n&&!r?null:t.pathname.split("/").filter(Boolean)[0]??null},bC=e=>e?!!au(e.trim()):!1,wC=(e,t={})=>{const n=ou(e.trim()),r=au(e);if(!n||!r)return null;const s=new URLSearchParams(n.search);s.set("autoplay",String(t.autoplay??!0)),s.set("loop",String(t.loop??!0)),s.set("muted",String(t.muted??!0)),s.set("controls",String(t.controls??!1)),s.set("preload",t.preload??"auto");const o=su.test(n.hostname),a=o?"iframe.videodelivery.net":n.hostname,i=o?`/${r}`:`/${r}/iframe`;return`${n.protocol}//${a}${i}?${s.toString()}`},xC=e=>{const t=ou(e.trim()),n=au(e);if(!t||!n)return null;const r=su.test(t.hostname)?"videodelivery.net":t.hostname;return`${t.protocol}//${r}/${n}/manifest/video.m3u8`},Ck=(e,t="image")=>{const n=e==null?void 0:e.trim();return n?bC(n)||ug.test(n)||vC.test(n)?"video":t:null},dg="#loop",CC=e=>{const t=e==null?void 0:e.trim();return!!(t&&t.endsWith(dg)&&ug.test(t))},_k=(e,t)=>{const n=e.trim().replace(/#loop$/,"");return t&&n?`${n}${dg}`:n};function _C({src:e}){const t=m.useRef(null),n=m.useRef(null),[r,s]=m.useState(!1),[o,a]=m.useState(!1),[i,l]=m.useState(!1),[c,d]=m.useState(!1),[f,h]=m.useState(!1),[p,g]=m.useState(!1),[y,v]=m.useState(null),[x,C]=m.useState(!1);m.useEffect(()=>{const E=n.current;if(!E)return;h(!1),g(!1),s(!1),l(!1),v(null);let A=null,k=!1,T=!1;const I=()=>{k||C(!0)},R=async()=>{if(!(k||T||!E.paused)){T=!0,E.muted=!1;try{await E.play(),k||a(!1)}catch{E.muted=!0,k||(a(!0),l(!0));try{await E.play()}catch{k||s(!0)}}finally{T=!1}}},O=()=>{k||(g(!0),E.paused&&R())};E.addEventListener("canplay",O);const M=xC(e);return!M||E.canPlayType("application/vnd.apple.mpegurl")!==""?(E.addEventListener("error",I),E.src=M??e,R()):B(async()=>{const{default:D}=await import("./hls_DyTJdUDe.js");return{default:D}},[]).then(({default:D})=>{if(!k){if(!D.isSupported()){I();return}A=new D,A.on(D.Events.ERROR,($,H)=>{H.fatal&&I()}),A.loadSource(M),A.attachMedia(E),R()}},I),()=>{k=!0,E.removeEventListener("canplay",O),E.removeEventListener("error",I),A==null||A.destroy()}},[e]);const _=m.useCallback(()=>{const E=t.current;if(!E)return;E.style.position="fixed",E.style.left="0px",E.style.top="0px",E.style.width=`${window.innerWidth}px`,E.style.height=`${window.innerHeight}px`,E.style.zIndex="60";const A=E.getBoundingClientRect();(A.left!==0||A.top!==0)&&(E.style.left=`${-A.left}px`,E.style.top=`${-A.top}px`)},[]);m.useEffect(()=>{const E=t.current;if(!(!c||!E))return _(),window.addEventListener("resize",_),()=>{window.removeEventListener("resize",_),E.removeAttribute("style")}},[c,_]);const b=()=>{const E=n.current;E&&(E.paused?(E.ended&&(E.currentTime=0),E.play().catch(()=>{})):E.pause())},w=E=>{E.stopPropagation();const A=n.current;A&&(A.muted=i?!1:!A.muted,a(A.muted),l(!1),A.paused&&!A.ended&&A.play().catch(()=>{}))},P="flex size-9 items-center justify-center rounded-full bg-black/50 text-white backdrop-blur-sm transition-opacity active:opacity-70",N=x?wC(e,{autoplay:!0,muted:!1,controls:!0,loop:!1}):null;return N?u.jsx("div",{className:"relative h-[min(52dvh,400px)] w-full overflow-hidden bg-black",children:u.jsx("iframe",{src:N,title:"Video",className:"absolute inset-0 h-full w-full border-0",allow:"autoplay; encrypted-media; picture-in-picture"})}):u.jsxs("div",{ref:t,onClick:b,className:G("relative w-full cursor-pointer overflow-hidden bg-black transition-[height] duration-300",!c&&(y===!1?"h-64":"h-[min(52dvh,400px)]")),children:[u.jsx("video",{ref:n,playsInl
235ine:!0,preload:"auto",className:G("absolute inset-0 h-full w-full object-contain transition-opacity duration-300 ease-out",f?"visible opacity-100":"invisible opacity-0"),onLoadedMetadata:E=>{const{videoWidth:A,videoHeight:k}=E.currentTarget;A&&k&&v(k>A)},onPlay:()=>s(!1),onPlaying:()=>{h(!0),s(!1)},onPause:()=>s(!0)}),u.jsx(qc,{size:"lg",className:G("pointer-events-none absolute inset-0 z-10 transition-opacity duration-300 ease-out",f?"opacity-0":"opacity-100")}),!f&&p&&r?u.jsx("div",{className:"pointer-events-none absolute inset-0 z-20 flex items-center justify-center bg-[#FCF6E8]",children:u.jsx("span",{className:"flex size-14 items-center justify-center rounded-full bg-[#F1914A] text-white shadow-lg",children:u.jsx(nf,{className:"h-7 w-7 fill-current"})})}):null,f&&r?u.jsx("div",{className:"pointer-events-none absolute inset-0 z-20 flex items-center justify-center",children:u.jsx("span",{className:"flex size-14 items-center justify-center rounded-full bg-black/50 text-white",children:u.jsx(nf,{className:"h-7 w-7 fill-current"})})}):null,f&&i&&!r?u.jsx("button",{type:"button",onClick:w,"aria-label":"Play sound",className:"absolute inset-0 flex items-center justify-center",children:u.jsx("span",{className:"flex size-14 animate-pulse items-center justify-center rounded-full bg-black/50 text-white",children:u.jsx(sf,{className:"h-7 w-7"})})}):null,u.jsxs("div",{className:G("absolute z-20 flex gap-2 transition-opacity duration-200",f?"opacity-100":"pointer-events-none opacity-0",c?"right-4":"bottom-3 right-3"),style:c?{bottom:j.getPlatform()==="android"?"calc(2rem + var(--safe-area-inset-bottom, 0px))":"2rem"}:void 0,children:[u.jsx("button",{type:"button",onClick:w,"aria-label":o?"Unmute":"Mute",className:P,children:o?u.jsx(sf,{className:"h-4 w-4"}):u.jsx(ly,{className:"h-4 w-4"})}),u.jsx("button",{type:"button",onClick:E=>{E.stopPropagation(),d(A=>!A)},"aria-label":c?"Shrink video":"Enlarge video",className:P,children:c?u.jsx(ry,{className:"h-4 w-4"}):u.jsx(ey,{className:"h-4 w-4"})})]})]})}function EC({src:e,poster:t}){const n=m.useRef(null),[r,s]=m.useState(null);return m.useEffect(()=>{const o=n.current;o&&(o.muted=!0,o.defaultMuted=!0,o.play().catch(()=>{}))},[e]),u.jsx("video",{ref:n,src:e.replace(/#loop$/,""),poster:t??void 0,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,preload:"auto",disablePictureInPicture:!0,"aria-hidden":"true",onLoadedMetadata:o=>{const{videoWidth:a,videoHeight:i}=o.currentTarget;a&&i&&s(a/i)},className:"pointer-events-none block max-h-64 w-full bg-[#FCF6E8] object-cover",style:{aspectRatio:r??4/3}})}const sc="lc:notification-campaign-payload:",SC=80,AC=1e3,NC=3,PC=24*60*60*1e3,kC=/^[a-zA-Z0-9_.-]+$/,IC=new Set(["template_data","templateData","template_values","variables"]),iu=e=>e.length>0&&e.length<=SC&&kC.test(e),oc=e=>!!e&&typeof e=="object"&&!Array.isArray(e),RC=e=>{if(typeof e=="string")return e.slice(0,AC);if(typeof e=="number"||typeof e=="boolean")return e},Ia=(e,t=0)=>t>NC?{}:Object.fromEntries(Object.entries(e).filter(([n])=>iu(n)).map(([n,r])=>{const s=RC(r);if(s!==void 0)return[n,s];if(oc(r)){const o=Ia(r,t+1);if(Object.keys(o).length>0)return[n,o]}return null}).filter(n=>n!==null)),TC=e=>{if(oc(e))return Ia(e);if(typeof e!="string")return{};try{const t=JSON.parse(e);return oc(t)?Ia(t):{}}catch{return{}}},fg=e=>{if(!e||typeof e!="object")return{};const t=e;return{...Object.entries(t).reduce((r,[s,o])=>IC.has(s)?{...r,...TC(o)}:r,{}),...Ia(t)}},OC=(e,t)=>{if(!e||!iu(e)||typeof window>"u")return;const n=fg(t);if(Object.keys(n).length===0)return;const r={savedAt:Date.now(),values:n};try{window.sessionStorage.setItem(`${sc}${e}`,JSON.stringify(r))}catch{}},jC=e=>{if(!e||!iu(e))return{};if(typeof window>"u")return{};try{const t=window.sessionStorage.getItem(`${sc}${e}`);if(!t)return{};const n=JSON.parse(t);return!n.savedAt||Date.now()-n.savedAt>PC?(window.sessionStorage.removeItem(`${sc}${e}`),{}):fg(n.values)}catch{return{}}},qi=/\{\{\s*([a-zA-Z0-9_.-]+)(?:\s*\|\s*([a-zA-Z0-9_-]+))?\s*\}\}/g,LC=e=>!!e&&typeof e=="object"&&!Array.isArray(e),MC=(e,t)=>t.split(".").reduce((n,r)=>{if(LC(n))return n[r]},e),wh=e=>{if(e instanceof Date)return e;if(typeof e!="string"&&typeof e!="number")return null;const t=String(e).trim();if(!t)return null;const n=/^\d{4}-\d{2}-\d{2}$/.test(t)?new Date(`${t}T12:00:00`):new Date(t);return Number.isNaN(n.getTime())?null:n},DC=e=>e!=null&&e.toLowerCase().startsWith("nl")?"nl-NL":"en-GB",FC=(e,t,n)=>{if(e==null)return null;const r=DC(n);switch(t){case"date":{const s=wh(e);return s?new Intl.DateTimeFormat(r,{day:"numeric",month:"long",year:"numeric"}).format(s):null}case"datetime":{const s=wh(e);return s?new Intl.DateTimeFormat(r,{day:"numeric",month:"long",year:"numeric",hour:"2-digit",minute:"2-digit"}).format(s):null}case"number":{const s=Number(e);return Number.isFinite(s)?new Intl.NumberFormat(r).format(s):null}case"money":case"currency":{const s=Number(e);return Number.isFinite(s)?new Intl.NumberFormat(r,{style:"currency",currency:"EUR"}).format(s):null}case"uppercase":return String(e).toLocaleUpperCase(r);case"lowercase":return String(e).toLocaleLowerCase(r);default:return String(e)}},UC=(e,t,n)=>{let r=!1;const s=qi.test(e);return qi.lastIndex=0,{rendered:e.replace(qi,(a,i,l)=>{const c=FC(MC(t,i),l,n);return c===null?(r=!0,""):c}),missingValue:r,hadTemplate:s}},Fo=(e,t,n)=>e?e.split(`
236`).map(o=>UC(o,t,n)).filter(({rendered:o,missingValue:a,hadTemplate:i})=>a?!i&&o.trim().length>0:!0).map(({rendered:o})=>o).join(`
237`).replace(/\n{3,}/g,`
238
239`).trim():"",xh=async(e,t,n)=>{try{const{error:r}=await z.rpc("record_notification_campaign_event",{p_slug:e,p_event_type:t,p_metadata:{path:n}});if(r)throw r}catch(r){console.warn("[CampaignEvents] Failed to record",t,r),be("campaign_event_record_failed",{error:r instanceof Error?r.message:String(r)})}};function BC(){var A,k;const e=He(),t=tt(),n=ut(),{loading:r,user:s}=ge(),{i18n:o}=_e(),a=new URLSearchParams(e.search),i=a.get("campaign"),l=Na(a.get("campaignRoute")),[c,d]=m.useState(null),[f,h]=m.useState(!1),p=m.useRef(null),g=m.useMemo(()=>
239{if(!i)return null;const T=new URLSearchParams(e.search);T.delete("campaign"),T.delete("campaignRoute");const I=T.toString();return`${e.pathname}${I?`?${I}`:""}${e.hash}`},[i,e.hash,e.pathname,e.search]),y=m.useMemo(()=>jC(i),[i]);m.useEffect(()=>{let T=!1;if(!i){be("campaign_modal_no_slug",{}),h(!1),d(null);return}if(r||!s){be("campaign_modal_waiting_for_auth",{});return}return(async()=>{be("campaign_modal_load_started",{});const{data:R,error:O}=await z.rpc("get_notification_campaign",{p_slug:i});if(T)return;if(O){console.error("Failed to load notification campaign:",O),be("campaign_modal_load_error",{});return}if(!R){be("campaign_modal_load_empty",{});return}const M=R;d(M),h(!0),be("campaign_modal_opened",{campaign_id:M.id}),p.current!==i&&(p.current=i,xh(i,"opened",e.pathname),Gx(i).then(D=>{D&&n.invalidateQueries({queryKey:["notification-inbox"]})}))})(),()=>{T=!0}},[i,r,e.pathname,s]);const v=T=>{i&&xh(i,T,e.pathname),h(!1),g&&t(g,{replace:!0})},x=T=>{if(T!=="/photobook")return T;const I=y.entity_id;return y.entity_type==="storybook"&&typeof I=="string"&&/^[0-9a-f-]{36}$/i.test(I)?`/photobook/designs/${I}`:T},C=(T,I)=>{const R=I==="primary_clicked"?l:null,O=R??Na(T==null?void 0:T.to);if(v(I),!(!O||!(R||(T==null?void 0:T.type)==="route"||(T==null?void 0:T.type)==="url"))){if(O.kind==="url"){$x(O.url);return}t(x(O.to))}};if(!c)return null;const _=Fo(c.title,y,o.language),b=Fo(c.body,y,o.language).trim(),w=Fo(((A=c.primary_action)==null?void 0:A.label)??"OK",y,o.language),P=Fo((k=c.secondary_action)==null?void 0:k.label,y,o.language),N=c.media_url??c.image_url,E=N&&c.media_type==="video"?CC(N)?u.jsx(EC,{src:N,poster:c.image_url}):u.jsx(_C,{src:N}):N?u.jsx("img",{src:N,alt:"",className:"block max-h-64 w-full object-cover"}):void 0;return u.jsx(uo,{open:f,onClose:()=>v("dismissed"),title:_,illustration:E,illustrationClassName:E?"px-0 pt-0 pb-0 overflow-hidden":void 0,primaryAction:{label:w,onClick:()=>C(c.primary_action,"primary_clicked")},secondaryAction:P?{label:P,onClick:()=>C(c.secondary_action,"secondary_clicked")}:void 0,children:u.jsx("p",{className:"whitespace-pre-line",children:b})})}const or="https://apps.apple.com/app/id6754768991",tn="https://play.google.com/store/apps/details?id=com.littlechapters.app",Ek=e=>`${tn}&referrer=${encodeURIComponent(`invite=${e}`)}`,Sk=e=>`${tn}&referrer=${encodeURIComponent(`plus=${e}`)}`,Ak=()=>{if(typeof navigator>"u")return null;const e=navigator.userAgent;return/iPhone|iPad|iPod/i.test(e)?"ios":/Android/i.test(e)?"android":null},Xs="[StoreUpdate]",$C="store-update:dismissed",zC=e=>e==="android"||e==="ios",VC=e=>{const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>0?t:null},hg=e=>`${$C}:${e}`,HC=async()=>{if(!j.isNativePlatform())return null;const e=j.getPlatform();if(!zC(e))return null;try{const[{versionCode:t},{versionName:n}]=await Promise.all([Ie.getVersionCode(),Ie.getVersionName()]),r=VC(t);return r?{platform:e,versionCode:r,versionName:n||null}:(console.error(Xs,"Invalid native version code:",t),null)}catch(t){return console.error(Xs,"Failed to load native version info:",t),null}},WC=async e=>{const{data:t,error:n}=await z.from("app_version_policies").select("*").eq("platform",e).maybeSingle();return n?(console.error(Xs,"Failed to load store update policy:",n),null):t},qC=async()=>{const e=await HC();if(!e)return{kind:"none",versionInfo:null};const t=await WC(e.platform);if(!(t!=null&&t.latest_version_code))return{kind:"none",versionInfo:e};const n={...t,latest_version_code:t.latest_version_code};return e.versionCode>=n.latest_version_code?{kind:"none",versionInfo:e}:n.min_supported_version_code&&e.versionCode<n.min_supported_version_code?{kind:"hard",versionInfo:e,policy:n}:{kind:"soft",versionInfo:e,policy:n}},GC=async(e,t)=>{try{const{value:n}=await Re.get({key:hg(e)});return n===String(t)}catch(n){return console.error(Xs,"Failed to read dismissed prompt state:",n),!1}},Ch=async(e,t)=>{try{await Re.set({key:hg(e),value:String(t)})}catch(n){console.error(Xs,"Failed to persist dismissed prompt state:",n)}},KC=async e=>{const t=e==="android"?tn:or;if(j.isNativePlatform()){await Mn.open({url:t});return}window.open(t,"_blank","noopener,noreferrer")},QC=(e,t)=>t||e||null;function YC(){const{t:e}=_e(),[t,n]=m.useState({kind:"none",versionInfo:null});m.useEffect(()=>{if(!j.isNativePlatform())return;let l=!1;return(async()=>{const d=await qC();if(!(l||d.kind==="none")){if(d.kind==="soft"){const[f,h]=await Promise.all([GC(d.versionInfo.platform,d.policy.latest_version_code),mC()]);if(l||f||h)return}n(d)}})(),()=>{l=!0}},[]);const r=async()=>{t.kind!=="none"&&(t.kind==="soft"&&await Ch(t.versionInfo.platform,t.policy.latest_version_code),await KC(t.ver
239sionInfo.platform))},s=async()=>{t.kind==="soft"&&(await Ch(t.versionInfo.platform,t.policy.latest_version_code),n({kind:"none",versionInfo:t.versionInfo}))};if(t.kind==="none")return null;const o=QC(t.versionInfo.versionName,t.policy.latest_version_name),a=t.kind==="hard"?t.policy.hard_title||e("storeUpdate.requiredTitle",{version:o,defaultValue:o?"Update to {{version}} required":"Update required"}):t.policy.soft_title||e("storeUpdate.availableTitle",{version:o,defaultValue:o?"Version {{version}} is available":"A new version is available"}),i=t.kind==="hard"?t.policy.hard_message||e("storeUpdate.requiredMessage",{version:o,defaultValue:o?"To keep using Little Chapters safely, update to version {{version}} from the store.":"To keep using Little Chapters safely, update from the store."}):t.policy.soft_message||e("storeUpdate.availableMessage",{version:o,defaultValue:"A newer version of Little Chapters is available in the store."});return u.jsx(uo,{open:!0,onClose:t.kind==="hard"?()=>{}:()=>void s(),dismissible:t.kind!=="hard",variant:t.kind==="hard"?"warning":"info",title:a,primaryAction:{label:e("storeUpdate.updateNow"),onClick:()=>void r()},secondaryAction:t.kind==="soft"?{label:e("storeUpdate.later"),onClick:()=>void s()}:void 0,children:u.jsx("p",{children:i})})}let Ss=0,Xe=null;const pg=()=>!/Android/i.test(navigator.userAgent),XC=()=>{if(typeof window>"u"||typeof document>"u")return;const e=document.body,t=document.documentElement,n=window.scrollY,r=window.innerWidth-t.clientWidth;Xe={scrollY:n,bodyOverflow:e.style.overflow,bodyPosition:e.style.position,bodyTop:e.style.top,bodyLeft:e.style.left,bodyRight:e.style.right,bodyWidth:e.style.width,bodyPaddingRight:e.style.paddingRight,bodyOverscrollBehavior:e.style.overscrollBehavior,htmlOverflow:t.style.overflow,htmlOverscrollBehavior:t.style.overscrollBehavior},e.style.overflow="hidden",e.style.overscrollBehavior="none",pg()&&(e.style.position="fixed",e.style.top=`-${n}px`,e.style.left="0",e.style.right="0",e.style.width="100%",e.style.paddingRight=r>0?`${r}px`:e.style.paddingRight),t.style.overflow="hidden",t.style.overscrollBehavior="none"},ZC=()=>{if(typeof window>"u"||typeof document>"u"||!Xe)return;const e=document.body,t=document.documentElement;e.style.overflow=Xe.bodyOverflow,e.style.position=Xe.bodyPosition,e.style.top=Xe.bodyTop,e.style.left=Xe.bodyLeft,e.style.right=Xe.bodyRight,e.style.width=Xe.bodyWidth,e.style.paddingRight=Xe.bodyPaddingRight,e.style.overscrollBehavior=Xe.bodyOverscrollBehavior,t.style.overflow=Xe.htmlOverflow,t.style.overscrollBehavior=Xe.htmlOverscrollBehavior,pg()&&window.scrollTo({top:Xe.scrollY,behavior:"instant"}),Xe=null},JC=()=>{Ss+=1,Ss===1&&XC();let e=!1;return()=>{e||(e=!0,Ss=Math.max(0,Ss-1),Ss===0&&ZC())}},e_=e=>{m.useEffect(()=>{if(e)return JC()},[e])};var Ra;(function(e){e.Heavy="HEAVY",e.Medium="MEDIUM",e.Light="LIGHT"})(Ra||(Ra={}));var _h;(function(e){e.Success="SUCCESS",e.Warning="WARNING",e.Error="ERROR"})(_h||(_h={}));const ns=we("Haptics",{web:()=>B(()=>import("./web_DdAVD5Y-.js"),__vite__mapDeps([21,1,2,3,4])).then(e=>new e.HapticsWeb)});let ar=!1;function lu(){j.isNativePlatform()&&ns.impact({style:Ra.Light}).catch(()=>{})}function mr(){lu()}function Eh(){lu()}function Nk(){!j.isNativePlatform()||j.getPlatform()!=="ios"||ar||(ar=!0,ns.selectionStart().catch(()=>{ar=!1}))}function Pk(){!j.isNativePlatform()||j.getPlatform()!=="ios"||!ar||(ar=!1,ns.selectionEnd().catch(()=>{}))}function kk(){if(j.isNativePlatform()){if(j.getPlatform()==="ios"&&ar){ar=!1,ns.selectionChanged().catch(()=>{}).finally(()=>{ns.selectionEnd().catch(()=>{})});return}lu()}}async function Ik(){if(j.isNativePlatform())try{await ns.impact({style:Ra.Light})}catch{}}const t_=88,n_={type:"spring",damping:25,stiffness:300},Sh={type:"spring",damping:28,stiffness:360},r_=72,s_=120,o_=600,a_=({sheet:e,onClose:t,navHeight:n=t_,stacked:r=!1,elevated:s=!1,suppressEscape:o=!1})=>{const a=r?s?"z-[65]":"z-[45]":s?"z-[60]":"z-40",[i,l]=m.useState(null),[c,d]=m.useState(!1),f=e3(typeof window<"u"?window.innerHeight:800),h=t3(),p=P=>{h.start(P)},g=(P,N)=>{if(N.offset.y>s_||N.velocity.y>o_){mr(),t();return}fs(f,0,Sh)},y=m.useRef(!1),v=m.useRef(null),x=m.useRef(!1);e_(c);const{keyboardPadding:C}=d0(c),{isVisible:_}=u0(),b=C??(_?"0px":`calc(${n}px + var(--safe-area-inset-bottom, 0px))`),w=C!==null;return m.useEffect(()=>{y.current=c},[c]),m.useEffect(()=>{const P=typeof window<"u"?window.innerHeight:800;
239if(e===null){if(!y.current)return;fs(f,P,{duration:.25,ease:"easeInOut"}).then(()=>{d(!1),v.current=null});return}const N=v.current;if(v.current=e.key,!y.current){Eh(),l(e),d(!0),f.set(P),fs(f,0,n_);return}if(N===e.key){l(e);return}if(x.current){l(e);return}x.current=!0,Eh(),fs(f,r_,{duration:.14,ease:"easeOut"}).then(()=>(l(e),fs(f,0,Sh))).finally(()=>{x.current=!1})},[e,f]),m.useEffect(()=>{if(!c||o)return;const P=N=>{N.key==="Escape"&&(document.querySelector('[role="dialog"][data-state="open"]')||t())};return window.addEventListener("keydown",P),()=>window.removeEventListener("keydown",P)},[c,t,o]),u.jsxs(u.Fragment,{children:[i&&u.jsx(Mt.div,{className:`fixed inset-0 ${a} ${r?"bg-black/35":"bg-black/50"}`,initial:{opacity:0},animate:{opacity:c?1:0},transition:{duration:.2},style:{pointerEvents:c?"auto":"none"},"aria-hidden":!c,onClick:t}),c&&i&&u.jsx("div",{className:`fixed inset-0 ${a} flex items-end justify-center md:items-center pointer-events-none`,children:u.jsxs(Mt.div,{className:`pointer-events-auto w-full md:max-w-lg bg-[#FCF6E8] flex flex-col h-[var(--sheet-h)] md:h-auto md:min-h-[24rem] max-h-[calc(100vh-var(--safe-area-inset-top,0px)-16px)] md:max-h-[85vh]${r?" shadow-[0_-8px_32px_rgba(0,0,0,0.18)] md:max-w-md":""}`,style:{"--sheet-h":r?"86vh":"92vh",y:f},drag:"y",dragListener:!1,dragControls:h,dragConstraints:{top:0},dragElastic:{top:0,bottom:.4},dragMomentum:!1,onDragEnd:g,children:[u.jsx("div",{className:"shrink-0 flex justify-center py-3 cursor-grab active:cursor-grabbing md:hidden",style:{touchAction:"none"},onPointerDown:p,children:u.jsx("span",{"aria-hidden":"true",className:"block h-1 w-10 bg-[#111111]/20"})}),u.jsx("div",{className:`flex-1 overflow-y-auto overscroll-contain min-h-0 pb-[var(--sheet-pb)] md:pb-0${w?" transition-[padding] duration-200 ease-in-out":""}`,style:{"--sheet-pb":b},children:u.jsx("div",{className:"h-full",children:i.content})})]})})]})},i_=({className:e,...t})=>u.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,...t,children:[u.jsx("path",{d:"M1.75098 6.368L22.292 2.002",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),u.jsx("path",{d:"M13.6 0.782993L9.19999 1.71799C9.00677 1.75863 8.82348 1.83702 8.66062 1.94866C8.49777 2.06029 8.35855 2.20298 8.25097 2.36854C8.14338 2.5341 8.06954 2.71927 8.03368 2.91343C7.99782 3.1076 8.00064 3.30693 8.04199 3.49999L8.35399 4.96799L15.69 3.40799L15.378 1.94099C15.3373 1.74819 15.2591 1.56529 15.1477 1.40273C15.0363 1.24018 14.894 1.10117 14.7289 0.993627C14.5638 0.88609 14.3791 0.812138 14.1854 0.775996C13.9917 0.739855 13.7928 0.742233 13.6 0.782993Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),u.jsx("path",{d:"M10.751 18V10.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),u.jsx("path",{d:"M15.251 18V10.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),u.jsx("path",{d:"M18.626 6H21.251L19.866 21.874C19.8348 22.25 19.6631 22.6004 19.3851 22.8554C19.1071 23.1104 18.7432 23.2513 18.366 23.25H7.63098C7.25477 23.2498 6.89237 23.1082 6.61565 22.8533C6.33892 22.5985 6.16808 22.2489 6.13698 21.874L5.09998 9.377",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),l_={primary:"bg-[#f1914a]",secondary:"bg-[#93b3da]",danger:""},c_={s:"text-[18px] font-bold leading-[1.3]",m:"text-[20px] font-semibold leading-none",l:"text-[24px] font-semibold leading-none"},mg=({variant:e="primary",size:t="m",align:n="center",icon:r,children:s,onClick:o,className:a="",disabled:i=!1})=>{const l=e==="danger",c=g=>{i||(mr(),o==null||o(g))},f=`flex items-center ${n==="start"?"justify-start gap-3 px-4":"justify-center gap-2.5 p-6"} w-full h-14 transition-colors`,h=l?"text-[#e75e30]":"text-white",p=l?"text-[16px] font-medium leading-[1.3]":c_[t];if(l){const g=r??i_;return u.jsxs(sn,{variant:"button",color:"#e75e30",as:"button",onClick:c,className:`${f} active:opacity-80 ${a} ${i?"opacity-50 pointer-events-none":""}`,children:[u.jsx(g,{className:"h-6 w-6 text-[#e75e30] shrink-0 relative"}),u.jsx("span",{className:`text-[#e75e30] ${p} whitespace-nowrap text-center relative`,children:s})]})}return u.jsxs("button",{onClick:c,disabled:i,className:`${f} ${l_[e]} active:opacity-90 ${a} ${i?"opacity-50 pointer-events-none":""}`,children:[r&&u.jsx(r,{className:`h-6 w-6 ${h} shrink-0`}),u.jsx("span",{className:`${h} ${p} whitespace-nowrap text-center`,children:s})]})},gg=L.forwardRef(({label:e,error:t,suffix:n,className:r,...s},o)=>u.jsxs("div",{className:G("flex w-full flex-col gap-2",r),children:[e&&u.jsx("label",{className:"text-[16px] font-semibold leading-[1.3] text-[#111]",children:e}),u.jsxs("div",{className:"relative",children:[u.jsx("input",{ref:o,className:G("h-[56px] w-full bg-white px-4 text-[16px] font-medium leading-[1.3] text-[#111] placeholder:text-[#C8C3BB] focus:outline-none focus:ring-2 focus:ring-[#111]/20",n&&"pr-10",t&&"ring-2 ring-red-400"),...s}),n&&u.jsx("span",{className:"absolute right-4 top-1/2 -translate-y-1/2 text-[#111111]/40 text-sm pointer-events-none",children:n})]}),t&&u.jsx("p",{className:"text-[14px] font-medium text-red-500",children:t})]}));gg.displayName="LCInput";const Ta=["done","declined"],u_=(e,t)=>
239[...e].sort((n,r)=>{const s=Ta.includes(n.status)?1:0,o=Ta.includes(r.status)?1:0;return s!==o?s-o:t==="top"&&n.vote_count!==r.vote_count?r.vote_count-n.vote_count:r.created_at.localeCompare(n.created_at)}),d_=e=>e.toLowerCase().split(/[^\p{L}\p{N}]+/u).filter(t=>t.length>=4),f_=(e,t,n=3)=>{const r=d_(e);return r.length===0?[]:t.map(s=>{const o=`${s.title} ${s.body??""}`.toLowerCase(),a=r.filter(i=>o.includes(i)).length;return{topic:s,hits:a}}).filter(({hits:s})=>s>0).sort((s,o)=>o.hits-s.hits||o.topic.vote_count-s.topic.vote_count).slice(0,n).map(({topic:s})=>s)},yg="feedback-board",h_="feedback-comments",p_=e=>[yg,e],m_=async()=>{const{data:e,error:t}=await z.rpc("get_feedback_board");if(t)throw t;return e??[]},g_=()=>{const{user:e}=ge(),t=ut(),n=p_(e==null?void 0:e.id),r=hr({queryKey:n,queryFn:m_,enabled:!!e,staleTime:60*1e3}),s=na({mutationFn:async i=>{const{data:l,error:c}=await z.rpc("toggle_feedback_vote",{p_topic_id:i});if(c)throw c;return l},onMutate:async i=>{await t.cancelQueries({queryKey:n});const l=t.getQueryData(n);return t.setQueryData(n,c=>(c??[]).map(d=>d.id===i?{...d,voted:!d.voted,vote_count:d.vote_count+(d.voted?-1:1)}:d)),{previous:l}},onError:(i,l,c)=>{c!=null&&c.previous&&t.setQueryData(n,c.previous)},onSettled:()=>{t.invalidateQueries({queryKey:n})}}),o=na({mutationFn:async i=>{const{data:l,error:c}=await z.rpc("create_feedback_topic",{p_title:i.title,p_body:i.body||void 0});if(c)throw c;return l},onSuccess:()=>{t.invalidateQueries({queryKey:n})}}),a=m.useCallback(i=>s.mutate(i),[s]);return{topics:r.data??[],isLoading:r.isLoading,error:r.error,refetch:r.refetch,toggleVote:a,createTopic:o.mutateAsync,isCreating:o.isPending}},y_=async e=>{const{data:t,error:n}=await z.rpc("get_feedback_topic_comments",{p_topic_id:e});if(n)throw n;return t??[]},v_=e=>{const{user:t}=ge(),n=ut(),r=[h_,t==null?void 0:t.id,e],s=hr({queryKey:r,queryFn:()=>y_(e),enabled:!!t,staleTime:30*1e3}),o=()=>{n.invalidateQueries({queryKey:r}),n.invalidateQueries({queryKey:[yg]})},a=na({mutationFn:async l=>{const{data:c,error:d}=await z.rpc("add_feedback_comment",{p_topic_id:e,p_body:l});if(d)throw d;return c},onSuccess:o}),i=na({mutationFn:async l=>{const{error:c}=await z.rpc("delete_feedback_comment",{p_comment_id:l});if(c)throw c},onSuccess:o});return{comments:s.data??[],isLoading:s.isLoading,addComment:a.mutateAsync,isAdding:a.isPending,deleteComment:i.mutateAsync}},b_=(e,t)=>{const n=new Date(e);if(Number.isNaN(n.getTime()))return null;const r=n.getFullYear()!==new Date().getFullYear();try{return new Intl.DateTimeFormat(t,{day:"numeric",month:"short",...r?{year:"numeric"}:{}}).format(n)}catch{return null}},w_=e=>e?z.storage.from("profile-pictures").getPublicUrl(e).data.publicUrl:null,x_={planned:"bg-[#93B3DA] text-[#111111]",in_progress:"bg-[#F9D39A] text-[#111111]",done:"bg-[#509B6C] text-[#FFFEFB]",declined:"bg-[#111111]/10 text-[#111111]/70"};function vg({status:e}){const{t}=_e(),n=x_[e];return n?u.jsx("span",{className:G("inline-flex h-[20px] items-center px-2 text-[11px] font-bold uppercase tracking-wide",n),children:t(`feedback.status.${e}`)}):null}function C_({className:e}){const{t}=_e();return u.jsxs("span",{className:G("inline-flex h-[20px] shrink-0 items-center gap-1 bg-[#111111] px-2 text-[11px] font-bold uppercase tracking-wide text-[#FFFEFB]",e),children:[u.jsx(Pp,{className:"h-3 w-3",strokeWidth:2.5}),t("feedback.team")]})}function ac({name:e,photoPath:t,isMine:n,isTeam:r=!1,createdAt:s,className:o}){const{t:a,i18n:i}=_e(),l=w_(t),c=b_(s,i.language),d=n?a("feedback.you"):e;return u.jsxs("div",{className:G("flex min-w-0 items-center gap-2 text-[12px] text-[#111111]/45",o),children:[l?u.jsx("img",{src:l,alt:"",loading:"lazy",className:"h-5 w-5 shrink-0 rounded-full object-cover"}):null,u.jsxs("span",{className:"truncate",children:[d?`${a("feedback.by")} ${d}`:null,d&&c?" · ":null,c]}),r&&u.jsx(C_,{})]})}const __="0 0 48 56",E_="M3.4 2.9C10.8 2.1 19.6 2.7 27.9 2.3C33.8 2 39.9 2.6 45.1 2.2C45.9 9.4 45.3 16.9 45.6 24.4C45.9 33.8 45.2 43.6 45.9 53.1C38.6 53.9 30.9 53.2 23.4 53.6C16.4 54 9.1 53.3 2.6 53.8C2 46.2 2.7 38.4 2.3 30.6C2 21.4 2.8 12 2.1 3.2",S_="M3.1 9.6C5.4 6.9 7.8 4.4 10.3 2.4C12.6 4.6 14.9 7.1 17.2 9.9";function A_({fill:e,stroke:t}){return u.jsx("svg",{viewBox:__,preserveAspectRatio:"none",xmlns:"http://www.w3.org/2000/svg",className:"pointer-events-none absolute inset-0 h-full w-full","aria-hidden":"true",children:u.jsx("path",{d:E_,fill:e,stroke:t,strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke"})})}function N_({className:e}){return u.jsx("svg",{viewBox:"0 0 20 12",xmlns:"http://www.w3.org/2000/svg",className:e,"aria-hidden":"true",children:u.jsx("path",{d:S_,fill:"none",stroke:"currentColor",strokeWidth:"2.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function cu({topic:e,onToggle:t,size:n="m"}){const{t:r}=_e(),s=Ta.includes(e.status),o=e.voted?s?"#F9D39A":"#F1914A":s?"transparent":"#FFFFFF",a=s?"rgba(17,17,17,0.25)":"#111111";return u.jsxs("button",{type:"button",disabled:s,"aria-pressed":e.voted,"aria-label":s?r("feedback.closedIdea"):e.voted?r("feedback.unvoteAria"):r("feedback.voteAria"),onClick:i=>{i.stopPropagation(),mr(),t(e.id)},className:G("relative flex shrink-0 flex-col items-center justify-center gap-0.5 transition-transform active:scale-95",n==="m"?"h-14 w-12":"h-11 w-10",e.voted&&!s?"text-[#FFFEFB]":"text-[#111111]",s&&"text-[#111111]/40"),children:[u.jsx(A_,{fill:o,stroke:a}),u.jsx(N_,{className:G("relative shrink-0",n==="m"?"h-3 w-5":"h-2.5 w-4")}),u.jsx("span",{className:G("relative font-bold leading-none",n==="m"?"text-[15px]":"text-[13px]"),children:e.vote_count})]})}function P_({topic:e,onToggleVote:t,onOpen:n}){var o;const r=Ta.includes(e.status),s=!!((o=e.body)!=null&&o.trim());return u.jsx("li",{className:"border-b border-[#111111]/10 last:border-b-0",children:u.jsxs("div",{className:G("flex w-full items-start gap-4 py-4",r&&"opacity-70"),children:[u.jsx(cu,{topic:e,onToggle:t}),u.jsxs("button",{type:"button",onClick:()=>{mr(),n(e.id)},className:"min-w-0 flex-1 text-left",children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx("p",{className:"text-[16px] font-bold leading-[1.3] text-[#111111]",children:e.title}),u.jsx(vg,{status:e.status})]}),s&&u.jsx("p",{className:"mt-1 line-clamp-2 text-[14px] font-medium leading-[1.35] text-[#111111]/70",children:e.body}),u.jsxs("div",{className:"mt-2 flex items-center gap-3",children:[u.jsx(ac,{name:e.author_name,photoPath:e.author_photo_path,isMine:e.is_mine,createdAt:e.created_at,className:"min-w-0 flex-1"}),u.jsxs("span",{className:G("flex shrink-0 items-center gap-1 text-[12px] font-semibold",e.team_replied?"text-[#509B6C]":"text-[#111111]/45"),children:[e.team_replied&&u.jsx(Pp,{className:"h-3.5 w-3.5",
239strokeWidth:2.5}),u.jsx(ny,{className:"h-3.5 w-3.5"}),e.comment_count]})]})]})]})})}const Gi=80,Ah=500,Nh=1e3,k_=["top","new"];function I_({topics:e,isLoading:t,loadFailed:n,signedIn:r,onToggleVote:s,onCreate:o,isCreating:a,useTopicComments:i,onClose:l}){const{t:c}=_e(),[d,f]=m.useState({kind:"list"}),[h,p]=m.useState("top"),g=m.useMemo(()=>u_(e,h),[e,h]),y=()=>f({kind:"list"}),v=l?u.jsxs("div",{className:"flex shrink-0 items-start justify-between gap-4 px-6 pb-3 pt-6",children:[u.jsx("h2",{className:"text-[24px] font-bold leading-[1.3] text-[#111111]",children:d.kind==="form"?c("feedback.form.title"):c("feedback.title")}),u.jsx("button",{type:"button",onClick:l,className:"flex size-8 shrink-0 items-center justify-center border border-black/20 text-[#111111] transition-colors hover:bg-black/5","aria-label":c("common.close","Close"),children:u.jsx(cr,{className:"h-4 w-4"})})]}):null;if(d.kind==="form")return u.jsxs("div",{className:"flex h-full min-h-0 flex-col font-['DM_Sans',sans-serif]",children:[v,u.jsx(R_,{topics:e,onToggleVote:s,onCreate:o,isCreating:a,showTitle:!l,onCancel:y,onPosted:()=>{p("new"),y()}})]});if(d.kind==="topic"){const x=e.find(C=>C.id===d.topicId);return u.jsxs("div",{className:"flex h-full min-h-0 flex-col font-['DM_Sans',sans-serif]",children:[v,x?u.jsx(T_,{topic:x,onToggleVote:s,useTopicComments:i,onBack:y}):u.jsx(uu,{onBack:y})]})}return u.jsxs("div",{className:"flex h-full min-h-0 flex-col font-['DM_Sans',sans-serif]",children:[v,u.jsxs("div",{className:"flex shrink-0 items-end justify-between gap-4 px-6 pb-3 pt-4",children:[u.jsx("p",{className:"text-[15px] font-medium leading-[1.3] text-[#111111]/60",children:c("feedback.intro")}),u.jsx("div",{role:"tablist",className:"flex shrink-0 items-center gap-1 border border-[#111111]/15 p-0.5",children:k_.map(x=>u.jsx("button",{type:"button",role:"tab","aria-selected":h===x,onClick:()=>{h!==x&&(mr(),p(x))},className:G("h-8 px-3 text-[13px] font-bold leading-none transition-colors",h===x?"bg-[#111111] text-[#FFFEFB]":"text-[#111111]/60"),children:c(x==="top"?"feedback.sortTop":"feedback.sortNew")},x))})]}),u.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto overscroll-contain px-6",children:r?t?u.jsx(bg,{}):n?u.jsx(Ki,{title:c("feedback.loadError")}):g.length===0?u.jsx(Ki,{title:c("feedback.empty"),description:c("feedback.emptyDescription")}):u.jsx("ul",{children:g.map(x=>u.jsx(P_,{topic:x,onToggleVote:s,onOpen:C=>f({kind:"topic",topicId:C})},x.id))}):u.jsx(Ki,{title:c("feedback.signInToVote")})}),r&&u.jsx("div",{className:"shrink-0 px-6 pb-[max(1.5rem,env(safe-area-inset-bottom))] pt-3",children:u.jsx(mg,{size:"s",onClick:()=>f({kind:"form"}),children:c("feedback.addButton")})})]})}function bg(){return u.jsx("div",{className:"flex justify-center py-12",children:u.jsx(Mc,{className:"h-6 w-6 animate-spin text-[#111111]/40"})})}function Ki({title:e,description:t}){return u.jsxs("div",{className:"flex flex-col items-center gap-1 px-4 py-12 text-center",children:[u.jsx("p",{className:"text-[18px] font-bold leading-[1.3] text-[#111111]",children:e}),t&&u.jsx("p",{className:"text-[15px] font-medium leading-[1.35] text-[#111111]/60",children:t})]})}function uu({onBack:e,label:t,children:n}){const{t:r}=_e();return u.jsxs("div",{className:"flex shrink-0 items-center gap-3 px-6 pb-3 pt-4",children:[u.jsxs("button",{type:"button",onClick:()=>{mr(),e()},className:"flex h-8 items-center gap-1.5 border border-black/20 px-2.5 text-[13px] font-semibold text-[#111111] transition-colors hover:bg-black/5",children:[u.jsx(K7,{className:"h-4 w-4"}),t??r("feedback.form.back")]}),n]})}function R_({topics:e,onToggleVote:t,onCreate:n,isCreating:r,showTitle:s,onCancel:o,onPosted:a}){const{t:i}=_e(),[l,c]=m.useState(""),[d,f]=m.useState(""),h=m.useRef(!1),p=m.useMemo(()=>f_(l,e),[l,e]),g=l.trim().length>=3&&!r,y=async()=>{if(!(!g||h.current)){h.current=!0;try{await n({title:l.trim(),body:d.trim()}),Tr.ok(i("feedback.form.success")),a()}catch(v){const x=v==null?void 0:v.code;Tr.error(i(x==="54000"?"feedback.form.tooMany":"feedback.form.error"))}finally{h.current=!1}}};return u.jsxs("form",{className:"flex min-h-0 flex-1 flex-col",onSubmit:v=>{v.preventDefault(),y()},children:[u.jsx(uu,{onBack:o,children:s&&u.jsx("h3",{className:"text-[18px] font-bold leading-[1.3] text-[#111111]",children:i("feedback.form.title")})}),u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-5 overflow-y-auto overscroll-contain px-6 pb-4",children:[u.jsx(gg,{label:i("feedback.form.titleLabel"),value:l,onCh
239ange:v=>c(v.target.value.slice(0,Gi)),placeholder:i("feedback.form.titlePlaceholder"),maxLength:Gi,autoFocus:!0,suffix:`${l.length}/${Gi}`}),p.length>0&&u.jsxs("div",{className:"flex flex-col gap-2",children:[u.jsx("p",{className:"text-[13px] font-semibold text-[#111111]/60",children:i("feedback.form.similar")}),u.jsx("ul",{className:"flex flex-col gap-2",children:p.map(v=>u.jsxs("li",{className:"flex items-center gap-3",children:[u.jsx(cu,{topic:v,onToggle:t,size:"s"}),u.jsx("span",{className:"min-w-0 flex-1 truncate text-[15px] font-bold leading-[1.3] text-[#111111]",children:v.title})]},v.id))})]}),u.jsxs("div",{className:"flex flex-col gap-2",children:[u.jsx("label",{className:"text-[16px] font-semibold leading-[1.3] text-[#111]",children:i("feedback.form.bodyLabel")}),u.jsx("textarea",{value:d,onChange:v=>f(v.target.value.slice(0,Ah)),placeholder:i("feedback.form.bodyPlaceholder"),maxLength:Ah,rows:4,className:"w-full resize-none bg-white px-4 py-3 text-[16px] font-medium leading-[1.3] text-[#111] placeholder:text-[#C8C3BB] focus:outline-none focus:ring-2 focus:ring-[#111]/20"})]})]}),u.jsx("div",{className:"shrink-0 px-6 pb-[max(1.5rem,env(safe-area-inset-bottom))] pt-3",children:u.jsx(mg,{size:"s",disabled:!g,children:i(r?"feedback.form.submitting":"feedback.form.submit")})})]})}function T_({topic:e,onToggleVote:t,useTopicComments:n,onBack:r}){const{t:s}=_e(),{comments:o,isLoading:a,addComment:i,isAdding:l,deleteComment:c}=n(e.id),[d,f]=m.useState(""),h=m.useRef(!1),p=d.trim().length>0&&!l,g=async()=>{if(!(!p||h.current)){h.current=!0;try{await i(d.trim()),f("")}catch(v){const x=v==null?void 0:v.code;Tr.error(s(x==="54000"?"feedback.comments.tooMany":"feedback.comments.error"))}finally{h.current=!1}}},y=async v=>{try{await c(v),Tr.ok(s("feedback.comments.deleted"))}catch{Tr.error(s("feedback.comments.error"))}};return u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[u.jsx(uu,{onBack:r,label:s("feedback.detail.back")}),u.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto overscroll-contain px-6 pb-4",children:[u.jsxs("div",{className:"flex items-start gap-4",children:[u.jsx(cu,{topic:e,onToggle:t}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx("h3",{className:"text-[20px] font-bold leading-[1.25] text-[#111111]",children:e.title}),u.jsx(vg,{status:e.status})]}),u.jsxs("p",{className:"mt-1 flex flex-wrap items-center gap-2 text-[13px] font-semibold text-[#111111]/50",children:[s("feedback.detail.votes",{count:e.vote_count}),e.team_replied&&u.jsx("span",{className:"text-[#509B6C]",children:s("feedback.teamReplied")})]})]})]}),e.body&&u.jsx("p",{className:"mt-4 whitespace-pre-line text-[16px] font-medium leading-[1.4] text-[#111111]/80",children:e.body}),u.jsx(ac,{name:e.author_name,photoPath:e.author_photo_path,isMine:e.is_mine,createdAt:e.created_at,className:"mt-3"}),u.jsxs("h4",{className:"mt-6 border-t border-[#111111]/10 pt-4 text-[13px] font-bold uppercase tracking-wide text-[#111111]/50",children:[s("feedback.comments.title")," (",o.length,")"]}),a?u.jsx(bg,{}):o.length===0?u.jsx("p",{className:"py-4 text-[15px] font-medium leading-[1.35] text-[#111111]/60",children:s("feedback.comments.empty")}):u.jsx("ul",{className:"divide-y divide-[#111111]/10",children:o.map(v=>u.jsxs("li",{className:G("py-3",v.is_team&&"-mx-3 my-2 border-l-4 border-[#111111] bg-[#F9D39A]/40 px-3"),children:[u.jsxs("div",{className:"flex items-start justify-between gap-3",children:[u.jsx(ac,{name:v.author_name,photoPath:v.author_photo_path,isMine:v.is_mine,isTeam:v.is_team,createdAt:v.created_at,className:"min-w-0 flex-1"}),v.is_mine&&u.jsx("button",{type:"button",onClick:()=>void y(v.id),className:"shrink-0 text-[12px] font-semibold text-[#E75E30]",children:s("feedback.comments.delete")})]}),u.jsx("p",{className:"mt-1 whitespace-pre-line text-[15px] font-medium leading-[1.4] text-[#111111]",children:v.body})]},v.id))})]}),u.jsxs("form",{className:"flex shrink-0 items-end gap-2 px-6 pb-[max(1.5rem,env(safe-area-inset-bottom))] pt-3",onSubmit:v=>{v.preventDefault(),g()},children:[u.jsx("textarea",{value:d,onChange:v=>f(v.target.value.slice(0,Nh)),placeholder:s("feedback.comments.placeholder"),maxLength:Nh,rows:1,className:"min-h-14 w-full flex-1 resize-none bg-white px-4 py-4 text-[16px] font-medium leading-[1.3] text-[#111] placeholder:text-[#C8C3BB] focus:outline-none focus:ring-2 focus:ring-[#111]/20"}),u.jsx("button",{type:"submit",disabled:!p,"aria-label":s("feedback.comments.send"),onClick:()=>mr(),className:"flex h-14 w-14 shrink-0 items-center justify-center bg-[#F1914A] text-[#FFFEFB] transition-opacity active:opacity-90 disabled:opacity-50",children:l?u.jsx(Mc,{className:"h-5 w-5 animate-spin"}):u.jsx(oy,{className:"h-5 w-5"})})]})]})}function O_({onClose:e}){const{user:t}=ge(),{topics:n,isLoading:r,error:s,toggleVote:o,createTopic:a,isCreating:i}=g_();return u.jsx(I_,{topics:n,isLoading:r,loadFailed:!!s,signedIn:!!t,onToggleVote:o,onCreate:a,isCreating:i,useTopicComments:v_,onClose:e})}const j_=()=>{const{t:e}=_e(),[t,n]=m.useState(null),[r,s]=m.useState(!1),o=m.useRef(!1),a=m.useRef(!1);a.current=t!==null||r,m.useEffect(()=>wv(h=>{o.current||a.current||(o.current=!0,(async()=>{try{const{eligible:p,reason:g}=await mm({milestoneId:h.milestoneId});if(!p){je("review_prompt_suppressed",{trigger:h.trigger,reason:g});return}await pm(h.milestoneId),je("review_gate_shown",{trigger:h.trigger}),n(h)}catch(p){console.warn("[ReviewPromptGate] Failed to evaluate review gate",p)}finally{o.current=!1}})())}),[]);const i=m.useCallback(()=>{const h=t;n(null),h&&(je("review_gate_yes",{trigger:h.trigger}),gm(h).catch(p=>{console.warn("[ReviewPromptGate] Failed to request native review",p)}))},[t]),l=m.useCallback(()=>{const h=t;n(null),h&&je("review_gate_no",{trigger:h.trigger}),bv(),s(!0)},[t]),c=m.useCallback(()=>{const h=t;
239n(null),h&&je("review_gate_dismissed",{trigger:h.trigger})},[t]),d=m.useCallback(()=>s(!1),[]),f=m.useMemo(()=>r?{key:"review-gate-feedback",content:u.jsx(O_,{onClose:d}),snapPoints:["full"],initialSnap:"full"}:null,[d,r]);return u.jsxs(u.Fragment,{children:[u.jsxs(uo,{open:t!==null,onClose:c,title:e("reviewGate.title","Enjoying Little Chapters?"),children:[u.jsx("p",{children:e("reviewGate.body","You are building a beautiful memory book. We would love to hear how the app is working for you.")}),u.jsxs("div",{className:"mt-8 flex flex-col gap-3",children:[u.jsx("button",{type:"button",onClick:i,className:"flex h-14 w-full items-center justify-center bg-[#F1914A] px-6 text-[18px] font-medium leading-[1.3] text-[#FFFEFB] transition-opacity hover:opacity-95 active:opacity-80",children:e("reviewGate.yes","Yes, I love it!")}),u.jsx("button",{type:"button",onClick:l,className:"flex h-14 w-full items-center justify-center border border-black/20 px-6 text-[16px] font-semibold text-[#111111] transition-colors hover:bg-black/5 active:bg-black/10",children:e("reviewGate.no","It could be better")})]})]}),u.jsx(a_,{sheet:f,onClose:d})]})};var Ph;(function(e){e[e.Min=1]="Min",e[e.Low=2]="Low",e[e.Default=3]="Default",e[e.High=4]="High",e[e.Max=5]="Max"})(Ph||(Ph={}));var kh;(function(e){e[e.Secret=-1]="Secret",e[e.Private=0]="Private",e[e.Public=1]="Public"})(kh||(kh={}));const Wt=we("FirebaseMessaging",{web:()=>B(()=>import("./web_YDgqXPhE.js"),__vite__mapDeps([22,13,1,2,3,4])).then(e=>new e.FirebaseMessagingWeb)}),L_=250,Ih=e=>new Promise(t=>{window.setTimeout(t,e)}),M_=()=>{if(typeof document>"u")return;const e=document.activeElement;e instanceof HTMLElement&&e.blur()},ic=async(e={})=>{if(M_(),j.isNativePlatform())try{await Promise.race([kn.hide(),Ih(L_)])}catch{}e.settleDelayMs&&e.settleDelayMs>0&&await Ih(e.settleDelayMs)},D_=/^[a-zA-Z0-9_.-]{1,80}$/,qt=e=>{if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean")return String(e)},F_=e=>{if(!e||typeof e!="object")return{};const t=e,n={};for(const[r,s]of Object.entries(t)){if(!D_.test(r))continue;const o=qt(s);o!==void 0&&(n[r]=o)}return{...n,type:qt(t.type),notification_id:qt(t.notification_id),entity_id:qt(t.entity_id),entity_type:qt(t.entity_type),actor_id:qt(t.actor_id),month_detail_id:qt(t.month_detail_id),campaign_id:qt(t.campaign_id),deeplink:qt(t.deeplink)}};function U_(e){var t;if((t=e.deeplink)!=null&&t.startsWith("/")&&!e.deeplink.startsWith("//"))return{route:e.deeplink};if(e.campaign_id)return{route:`/?campaign=${encodeURIComponent(e.campaign_id)}`};if(!e.type)return null;switch(e.type){case"milestone_reminder":return{route:"/storybook"};case"memory_prompt":return{route:"/"};case"family_yearbook_reminder":return{route:"/"};case"product_update":case"broadcast":return{route:"/"};default:return{route:"/"}}}const B_=(e,t)=>{const n=m.useRef(!1),r=m.useRef(t);m.useEffect(()=>{r.current=t},[t]);const s=m.useCallback(async a=>{if(!e)return;const{error:i}=await z.from("push_tokens").upsert({user_id:e,token:a,platform:j.getPlatform(),device_info:{isNative:j.isNativePlatform(),tokenType:"fcm"},updated_at:new Date().toISOString()},{onConflict:"user_id,token"});i&&console.error("Failed to save push token:",i)},[e]),o=m.useCallback(async()=>{if(!j.isNativePlatform())return{success:!1,reason:"not-native"};try{j.getPlatform()==="android"&&await Wt.createChannel({id:"default",name:"Default Notifications",description:"Default notification channel",importance:4,visibility:1,sound:"default",vibration:!0});let a=await Wt.checkPermissions();if(a.receive==="prompt"&&(je("push_permission_prompt_shown",{source:"manual_register"}),a=await Wt.requestPermissions()),a.receive!=="granted")return a.receive==="denied"&&je("push_permission_denied",{source:"manual_register"}),{success:!1,reason:"permission-denied"};const{token:i}=await Wt.getToken();return console.log("FCM token received:",i),await s(i),await Wt.addListener("tokenReceived",async l=>{console.log("FCM token refreshed:",l.token),await s(l.token)}),je("push_notifications_enabled",{source:"manual_register"}),{success:!0}}catch(a){return console.error("Error registering for push notifications:",a),{success:!1,reason:"error"}}},[s]);return m.useEffect(()=>!j.isNativePlatform()||!e||n.current?void 0:(n.current=!0,(async()=>{be("push_listener_setup_started",{}),await Wt.addListener("notificationReceived",i=>{console.log("Push notification received:",i),be("push_notification_received_foreground",{})}),await Wt.addListener("notificationActionPerformed",i=>{var f;console.log("Push notification action:",i),be("push_notification_action_performed_raw",{action_id:i.actionId,notification:i.notification});const l=F_((f=i.notification)==null?void 0:f.data);be("push_notification_action_data_normalized",{action_id:i.actionId});const c=U_(l);be("push_notification_action_target",{action_id:i.actionId,has_tap_handler:!!r.current});const d=r.current;c&&d&&(console.log("Navigating to deep link:",c),(async()=>(be("push_notification_keyboard_dismiss_started",{action_id:i.actionId,route:c.route}),await ic({settleDelayMs:j.getPlatform()==="ios"?80:0}),be("push_notification_keyboard_dismiss_completed",{action_id:i.actionId,route:c.route}),d(c,l)))())});try{const i=await Wt.getDeliveredNotifications();be("push_delivered_notifications_snapshot",{count:i.notifications.length,notifications:i.notifications.slice(0,5)})}catch(i){be("push_delivered_notifications_snapshot_error",{error:i instanceof Error?i.message:String(i)})}be("push_listener_setup_completed",{})})().catch(i=>{be("push_listener_setup_error",{error:i instanceof Error?i.message:String(i)})}),()=>{j.isNativePlatform()&&(Wt.removeAllListeners(),n.current=!1)}),[e]),{registerPushNotifications:o}},As=we("FirebaseCrashlytics",{web:()=>B(()=>import("./web_aw3cizDB.js"),__vite__mapDeps([23,1,2,3,4])).then(e=>new e.FirebaseCrashlyticsWeb)}),Rh=1e3,Uo=()=>j.isNativePlatform()&&j.isPluginAvailable("FirebaseAnalytics")&&j.isPluginAvailable("FirebaseCrashlytics"),Th=e
239=>e.length>Rh?`${e.slice(0,Rh)}...`:e,$_=e=>!e||e==="/"?"home":za(e).replace(/^\//,"").replace(/\//g,"_").replace(/[^\w.-]/g,"_").slice(0,100),z_=e=>{if(e instanceof Error)return e.message||e.name;if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}},V_=(e,t)=>{m.useEffect(()=>{Uo()&&(Wo.setEnabled({enabled:!0}).catch(n=>{console.warn("[FirebaseTelemetry] Failed to enable Analytics",n)}),As.setEnabled({enabled:!0}).catch(n=>{console.warn("[FirebaseTelemetry] Failed to enable Crashlytics",n)}))},[]),m.useEffect(()=>{if(!Uo())return;const n=e??"";Wo.setUserId({userId:n}).catch(r=>{console.warn("[FirebaseTelemetry] Failed to set Analytics user ID",r)}),As.setUserId({userId:n}).catch(r=>{console.warn("[FirebaseTelemetry] Failed to set Crashlytics user ID",r)})},[e]),m.useEffect(()=>{if(!Uo())return;const n=$_(t);n&&(Wo.setCurrentScreen({screenName:n,screenClassOverride:"CapacitorWebView"}).catch(r=>{console.warn("[FirebaseTelemetry] Failed to set current screen",r)}),As.setCustomKey({key:"screen",value:n,type:"string"}).catch(r=>{console.warn("[FirebaseTelemetry] Failed to set Crashlytics screen key",r)}))},[t]),m.useEffect(()=>{if(!Uo())return;const n=s=>{const o=Th(s.error instanceof Error?s.error.message||s.error.name:s.message||"Unknown error");As.recordException({message:`[window.error] ${o}`}).catch(a=>{console.warn("[FirebaseTelemetry] Failed to record window error",a)})},r=s=>{const o=Th(z_(s.reason)||"Unknown rejection");As.recordException({message:`[window.unhandledrejection] ${o}`}).catch(a=>{console.warn("[FirebaseTelemetry] Failed to record unhandled rejection",a)})};return window.addEventListener("error",n),window.addEventListener("unhandledrejection",r),()=>{window.removeEventListener("error",n),window.removeEventListener("unhandledrejection",r)}},[])},Oa=e=>JSON.stringify(e.filter((t,n)=>n!==3));class H_{constructor(t){Le(this,"entries",new Map);Le(this,"pending",new Map);this.fresh=t}seed(t,n){if(!n||!this.fresh(n.expiresAt))return;const r=this.entries.get(t)??new Map;for(const s of Object.keys(n.urls))n.urls[s]&&r.set(s,n);this.entries.delete(t),this.entries.set(t,r),this.entries.size>2e3&&this.entries.delete(this.entries.keys().next().value)}read(t,n){const r=this.entries.get(t),s=n.map(o=>r==null?void 0:r.get(o));if(!(!s.length||s.some(o=>!o||!this.fresh(o.expiresAt))))return{...s[0],urls:Object.fromEntries(n.map((o,a)=>[o,s[a].urls[o]])),publicUrls:Object.fromEntries(n.map((o,a)=>[o,s[a].publicUrls[o]])),expiresAt:s.map(o=>o.expiresAt).sort((o,a)=>Date.parse(o)-Date.parse(a))[0],canFallbackToPublic:s.every(o=>o.canFallbackToPublic)}}async load(t,n,r){const s=this.read(t,n);if(s)return s;const o=this.pending.get(t)??new Map;this.pending.set(t,o);const a=n.filter(i=>!this.read(t,[i])&&!o.has(i));if(a.length){const i=Promise.resolve().then(()=>r(a)).then(l=>{this.seed(t,l)}).finally(()=>{for(const l of a)o.get(l)===i&&o.delete(l);o.size===0&&this.pending.delete(t)});for(const l of a)o.set(l,i)}return await Promise.all(new Set(n.map(i=>o.get(i)).filter(Boolean))),this.read(t,n)??null}}const du=90*24*60*60,fu=["cloudflare-signed-image"],wg=5*60*1e3,W_=30*24*60*60*1e3,xg=Math.min(du*1e3-W_-wg,2147483647),Cg=Math.min(du*1e3+5*60*1e3,2147483647),q_=16,G_=100,ja=new Map,hu=new Map,La=new Map,Rk=e=>{for(const t of e){const n=t.delivery;if(!n||!n.urls||!t.id)continue;const r={id:t.id,cfImageId:n.cf_image_id,publicCfImageId:n.public_cf_image_id,urls:n.urls,publicUrls:n.public_urls,expiresAt:n.expires_at??"",deliveryMode:n.delivery_mode,canFallbackToPublic:n.can_fallback_to_public};La.set(t.id,r),t.cf_image_id&&La.set(t.cf_image_id,r)}},_g=(e,t,n)=>{const r=La.get(e)??(t?La.get(t):void 0);if(!(!r||!cs(r.expiresAt)))return n.every(s=>!!r.urls[s])?r:void 0},cs=e=>{if(!e)return!0;const t=Date.parse(e);return Number.isNaN(t)?!0:t-wg>Date.now()},Us=new H_(e=>!!e&&Number.isFinite(Date.parse(e))&&cs(e)),lc=(e,t,n)=>{const r=Oa(t),s=Us.read(r,n);if(s)return s;for(const[,o]of e.getQueriesData({queryKey:fu,predicate:a=>Oa(a.queryKey)===r}))Us.seed(r,o);return Us.read(r,n)},K_=(e,t)=>e&&t?`share:${e}:${t}`:"auth",pu=e=>JSON.stringify(e),Q_=e=>{const t=hu.get(pu(e));return t&&(cs(t.expiresAt)?t:void 0)},Y_=e=>{const t=new Map;for(const n of e){const r=n.image.id||n.image.cfImageId,s=t.get(r);if(s){for(const o of n.variants)s.variants.add(o);continue}t.set(r,{id:n.image.id,cfImageId:n.image.cfImageId,variants:new Set(n.variants)})}return Array.from(t.values()).map(n=>({...n.id?{id:n.id}:{},cfImageId:n.cfImageId,variants:Array.from(n.variants)}))},Oh=async e=>{var s,o;const t=ja.get(e);if(!t)return;ja.delete(e);const n=t.items,r=n[0];if(r)try{const{data:a,error:i}=await z.functions.invoke("cloudflare-image-signer",{body:{images:Y_(n),ttlSeconds:du,...r.username&&r.shareToken?{username:r.username,shareToken:r.shareToken}:{}}});if(i)throw i;if(a!=null&&a.error)throw new Error(a.error);for(const l of n)l.resolve(((s=a==null?void 0:a.images)==null?void 0:s[l.requestKey])??((o=a==null?void 0:a.images)==null?void 0:o[l.image.cfImageId])??null)}catch(a){for(const i of n)i.reject(a)}},mu=e=>new Promise((t,n)=>{const r=K_(e.username,e.shareToken);let s=ja.get(r);if(s||(s={items:[],timer:null},ja.set(r,s)),s.items.push({...e,resolve:t,reject:n}),s.items.length>=G_){s.timer&&(clearTimeout(s.timer),s.timer=null),Oh(r);return}s.timer||(s.timer=setTimeout(()=>{Oh(r)},q_))}),Tk=async(e,t)=>{const n=Tc(t,["md"]),r=await mu({image:{...e.id?{id:e.id}:{},cfImageId:e.cfImageId,variants:n},requestKey:e.id||e.cfImageId,variants:n});
239return!(r!=null&&r.urls)||!cs(r.expiresAt)?null:r.urls},Eg=()=>{var r;const{session:e}=ge(),t=((r=e==null?void 0:e.user)==null?void 0:r.id)??null;return hr({queryKey:["image-delivery-rollout",t],enabled:!!t,staleTime:5*60*1e3,retry:!1,queryFn:async()=>{if(!t)return Ao;const s=z,{data:o,error:a}=await s.from("image_delivery_rollouts").select("delivery_mode, enable_signed_uploads").eq("user_id",t).maybeSingle();return a?(a.code!=="PGRST116"&&a.code!=="42P01"&&console.warn("[cloudflareImages] rollout lookup failed; using public delivery",a),Ao):o!=null&&o.delivery_mode?{deliveryMode:o.delivery_mode,enableSignedUploads:o.enable_signed_uploads===!0}:Ao}}).data??Ao},X_=(e,t)=>e?t.reduce((n,r)=>(n[r]=x7(e,r),n),{}):{},Sg=e=>e!=null&&e.username&&(e!=null&&e.shareToken)?`${e.username}:${e.shareToken}`:null,Ag=({imageId:e,deliveryMode:t,sessionUserId:n,ownerUserId:r,requireSignedURLs:s,deliveryContext:o})=>{const a=!!(o!=null&&o.username&&(o!=null&&o.shareToken));return!!e&&(t!=="public"||a||s===!0||!!(n&&r&&r!==n))},Ng=({requestKey:e,imageId:t,variantKey:n,deliveryMode:r,ownerUserId:s,requireSignedURLs:o,shareKey:a,viewerUserId:i})=>[...fu,e,t??null,n,r,s??null,o===!0,a,i],Z_=(e,t,n,r,s,o)=>{const a=r.photoId||t,i=n.join(","),l=Sg(r.deliveryContext),c=Ng({requestKey:a,imageId:t,variantKey:i,deliveryMode:s,ownerUserId:r.ownerUserId,requireSignedURLs:r.requireSignedURLs,shareKey:l,viewerUserId:o}),d=lc(e,c,n)??_g(a,t,n);if(d){e.getQueryData(c)===void 0&&e.setQueryData(c,d);return}e.prefetchQuery({queryKey:c,staleTime:xg,gcTime:Cg,queryFn:async()=>{const f=await Us.load(Oa(c),n,h=>{var p,g;return mu({image:{...r.photoId?{id:r.photoId}:{},cfImageId:t,variants:h},requestKey:a,variants:h,...(p=r.deliveryContext)!=null&&p.username&&((g=r.deliveryContext)!=null&&g.shareToken)?{username:r.deliveryContext.username,shareToken:r.deliveryContext.shareToken}:{}})});return hu.set(pu(c),f),f}})},Ok=(e,t,n={})=>{var w,P;const{session:r}=ge(),s=ut(),o=Eg(),a=m.useMemo(()=>Tc(t,["md"]),[t]),i=m.useMemo(()=>X_(e,a),[e,a]),l=n.enabled!==!1&&Ag({imageId:e,deliveryMode:o.deliveryMode,sessionUserId:(w=r==null?void 0:r.user)==null?void 0:w.id,ownerUserId:n.ownerUserId,requireSignedURLs:n.requireSignedURLs,deliveryContext:n.deliveryContext}),c=n.photoId||e||"",d=a.join(","),f=Sg(n.deliveryContext),h=Ng({requestKey:c,imageId:e,variantKey:d,deliveryMode:o.deliveryMode,ownerUserId:n.ownerUserId,requireSignedURLs:n.requireSignedURLs,shareKey:f,viewerUserId:((P=r==null?void 0:r.user)==null?void 0:P.id)??null}),p=hr({queryKey:h,enabled:l,staleTime:xg,gcTime:Cg,initialData:()=>n.enabled===!1?void 0:lc(s,h,a)??Q_(h)??_g(c,e,a),retry:1,queryFn:async()=>{if(!e)return null;lc(s,h,a);const N=await Us.load(Oa(h),a,E=>{var A,k;return mu({image:{...n.photoId?{id:n.photoId}:{},cfImageId:e,variants:E},requestKey:c,variants:E,...(A=n.deliveryContext)!=null&&A.username&&((k=n.deliveryContext)!=null&&k.shareToken)?{username:n.deliveryContext.username,shareToken:n.deliveryContext.shareToken}:{}})});return hu.set(pu(h),N),N}}),g=p.data,y=cs(g==null?void 0:g.expiresAt);m.useEffect(()=>{!l||!g||y||p.isFetching||p.refetch()},[l,g,p,y]);const v=(g==null?void 0:g.deliveryMode)??o.deliveryMode,x=n.requireSignedURLs===!0||v==="signed_enforced",C=(g==null?void 0:g.canFallbackToPublic)??!x,_=!!(y&&(g!=null&&g.urls)&&Object.keys(g.urls).length>0),b=x&&l&&!_&&!p.isError;return{urls:_?(g==null?void 0:g.urls)??i:C?i:{},publicUrls:i,deliveryMode:v,canFallbackToPublic:C,isSigned:_,isResolving:l&&p.isFetching,shouldHoldForSigned:b,error:p.error}},jk=(e,t,n={})=>{var l;const{session:r}=ge(),s=ut(),o=Eg(),a=m.useMemo(()=>Tc(t,["md"]),[t]),i=m.useMemo(()=>e.map(c=>[c.id??"",c.cf_image_id??"",c.user_id??"",c.cloudflare_require_signed_urls===!0?"1":"0",c.private_cf_image_id??""].join(":")).join("|"),[e]);m.useEffect(()=>{var c,d;if(n.enabled!==!1)for(const f of e){const h=f.cf_image_id;if(!h)continue;const p=f.cloudflare_require_signed_urls===!0||!!f.private_cf_image_id;Ag({imageId:h,deliveryMode:o.deliveryMode,sessionUserId:(c=r==null?void 0:r.user)==null?void 0:c.id,ownerUserId:f.user_id,requireSignedURLs:p,deliveryContext:n.deliveryContext})&&Z_(s,h,a,{photoId:f.id,ownerUserId:f.user_id,requireSignedURLs:p,deliveryContext:n.deliveryContext},o.deliveryMode,((d=r==null?void 0:r.user)==null?void 0:d.id)??null)}},[n.deliveryContext,n.enabled,i,e,s,a,o.deliveryMode,(l=r==null?void 0:r.user)==null?void 0:l.id])},J_=60*1e3,eE=()=>{const e=ut(),t=m.useRef(0);m.useEffect(()=>{const n=()=>{const o=Date.now();o-t.current<J_||(t.current=o,e.refetchQueries({type:"active",predicate:a=>{const[i]=a.queryKey;if(i!==fu[0])return!1;const l=a.state.data;return!cs(l==null?void 0:l.expiresAt)}}))},r=()=>{document.visibilityState==="visible"&&n()};window.addEventListener("focus",n),document.addEventListener("visibilitychange",r);let s;return j.isNativePlatform()&&Ge.addListener("appStateChange",({isActive:o})=>{o&&n()}).then(o=>{s=()=>{o.remove()}}),()=>{window.removeEventListener("focus",n),document.removeEventListener("visibilitychange",r),s==null||s()}},[e])},jh="client-capabilities:install-id",tE=6*60*60*1e3;let Lh=null,Mh=0;const nE=async()=>{const{value:e}=await Re.get({key:jh});if(e)return e;const t=crypto.randomUUID();return await Re.set({key:jh,value:t}),t},rE=async(e,t={})=>
239{if(!j.isNativePlatform())return;const n=Date.now();if(!t.force&&Lh===e&&n-Mh<tE)return;const[r,s]=await Promise.all([nE(),iC()]),o={signedCloudflareImages:!0,liveUpdate:s?{currentBundleId:s.currentBundleId,activeReleaseId:s.activeReleaseId,track:s.track,channel:s.channel,blockedBundles:s.blockedBundles,recentDiagnosticEvents:s.recentDiagnosticEvents}:null,reportedAt:new Date().toISOString()},{error:a}=await z.rpc("report_app_client_capabilities",{p_install_id:r,p_platform:j.getPlatform(),p_native_version_code:(s==null?void 0:s.versionCode)??null,p_native_version_name:(s==null?void 0:s.versionName)??null,p_live_update_bundle_id:(s==null?void 0:s.currentBundleId)??null,p_live_update_release_id:(s==null?void 0:s.activeReleaseId)??null,p_supports_signed_cf_images:!0,p_capabilities:o});if(a){console.warn("[ClientCapabilities] Failed to report capabilities",a);return}Lh=e,Mh=n},sE=e=>{m.useEffect(()=>{if(!e||!j.isNativePlatform())return;let t=!1,n;const r=async(s=!1)=>{try{t||await rE(e,{force:s})}catch(o){console.warn("[ClientCapabilities] Report failed",o)}};return r(),Ge.addListener("resume",()=>{r(!0)}).then(s=>{n=s}),()=>{t=!0,n==null||n.remove()}},[e])},Dh="[LiveUpdateTrack]",oE=(e,t)=>{m.useEffect(()=>{if(!j.isNativePlatform()||t)return;let n=!1;const r=async o=>{await Jx(o)&&!n&&ka()};return(async()=>{if(!e){await r(Fr);return}const{data:o,error:a}=await z.from("live_update_tracks").select("track").eq("user_id",e).maybeSingle();if(!n){if(a){console.warn(Dh,"Failed to load track",a);return}await r((o==null?void 0:o.track)==="beta"?"beta":Fr)}})().catch(o=>{console.warn(Dh,"Track sync failed",o)}),()=>{n=!0}},[e,t])};let Ns=null,Fh=null;const Qi=e=>{const t=document.cookie.match(new RegExp(`(?:^|; )${e}=([^;]*)`));return t?decodeURIComponent(t[1]):null},Pg=e=>{try{return new URLSearchParams(window.location.search).get(e)}catch{return null}},aE=()=>{const e=Pg("fbclid");return e?`fb.1.${Date.now()}.${e}`:null},Uh=async()=>{if(!(typeof window>"u"))return Ns||(Ns=(async()=>{var l,c;const{data:e}=await z.auth.getSession(),t=(c=(l=e.session)==null?void 0:l.user)==null?void 0:c.id;if(!t||t===Fh)return;const n={},r=Qi("_fbp"),s=Qi("_fbc")??aE(),o=Qi("_ttp"),a=Pg("ttclid");r&&(n.fbp=r),s&&(n.fbc=s),o&&(n.ttp=o),a&&(n.ttclid=a),navigator.userAgent&&(n.user_agent=navigator.userAgent),n.landing_url=window.location.origin+window.location.pathname;const{error:i}=await z.from("ad_attribution").upsert({user_id:t,...n,updated_at:new Date().toISOString()},{onConflict:"user_id"});if(i){console.warn("[AdAttribution] Failed to store attribution",i);return}Fh=t})().finally(()=>{Ns=null}),Ns)};var Bh=["light","dark"],iE="(prefers-color-scheme: dark)",lE=m.createContext(void 0),cE={setTheme:e=>{},themes:[]},uE=()=>{var e;return(e=m.useContext(lE))!=null?e:cE};m.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:s,defaultTheme:o,value:a,attrs:i,nonce:l})=>{let c=o==="system",d=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${i.map(g=>`'${g}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,f=s?Bh.includes(o)&&o?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${o}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",h=(g,y=!1,v=!0)=>{let x=a?a[g]:g,C=y?g+"|| ''":`'${x}'`,_="";return s&&v&&!y&&Bh.includes(g)&&(_+=`d.style.colorScheme = '${g}';`),n==="class"?y||x?_+=`c.add(${C})`:_+="null":x&&(_+=`d[s](n,${C})`),_},p=e?`!function(){${d}${h(e)}}()`:r?`!function(){try{${d}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${c})){var t='${iE}',m=window.matchMedia(t);if(m.media!==t||m.matches){${h("dark")}}else{${h("light")}}}else if(e){${a?`var x=${JSON.stringify(a)};`:""}${h(a?"x[e]":"e",!0)}}${c?"":"else{"+h(o,!1,!1)+"}"}${f}}catch(e){}}()`:`!function(){try{${d}var e=localStorage.getItem('${t}');if(e){${a?`var x=${JSON.stringify(a)};`:""}${h(a?"x[e]":"e",!0)}}else{${h(o,!1,!1)};}${f}}catch(t){}}();`;return m.createElement("script",{nonce:l,dangerouslySetInnerHTML:{__html:p}})});const dE=({...e})=>{const{theme:t="system"}=uE();return u.jsx(Lx,{theme:t,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"}},...e})},fE=["top","right","bottom","left"],Dn=Math.min,ot=Math.max,Ma=Math.round,Bo=Math.floor,Ut=e=>({x:e,y:e}
vendor: 25,679 bytes, line 239
239),hE={left:"right",right:"left",bottom:"top",top:"bottom"},pE={start:"end",end:"start"};function cc(e,t,n){return ot(e,Dn(t,n))}function on(e,t){return typeof e=="function"?e(t):e}function an(e){return e.split("-")[0]}function us(e){return e.split("-")[1]}function gu(e){return e==="x"?"y":"x"}function yu(e){return e==="y"?"height":"width"}const mE=new Set(["top","bottom"]);function Ft(e){return mE.has(an(e))?"y":"x"}function vu(e){return gu(Ft(e))}function gE(e,t,n){n===void 0&&(n=!1);const r=us(e),s=vu(e),o=yu(s);let a=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=Da(a)),[a,Da(a)]}function yE(e){const t=Da(e);return[uc(e),t,uc(t)]}function uc(e){return e.replace(/start|end/g,t=>pE[t])}const $h=["left","right"],zh=["right","left"],vE=["top","bottom"],bE=["bottom","top"];function wE(e,t,n){switch(e){case"top":case"bottom":return n?t?zh:$h:t?$h:zh;case"left":case"right":return t?vE:bE;default:return[]}}function xE(e,t,n,r){const s=us(e);let o=wE(an(e),n==="start",r);return s&&(o=o.map(a=>a+"-"+s),t&&(o=o.concat(o.map(uc)))),o}function Da(e){return e.replace(/left|right|bottom|top/g,t=>hE[t])}function CE(e){return{top:0,right:0,bottom:0,left:0,...e}}function kg(e){return typeof e!="number"?CE(e):{top:e,right:e,bottom:e,left:e}}function Fa(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function Vh(e,t,n){let{reference:r,floating:s}=e;const o=Ft(t),a=vu(t),i=yu(a),l=an(t),c=o==="y",d=r.x+r.width/2-s.width/2,f=r.y+r.height/2-s.height/2,h=r[i]/2-s[i]/2;let p;switch(l){case"top":p={x:d,y:r.y-s.height};break;case"bottom":p={x:d,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-s.width,y:f};break;default:p={x:r.x,y:r.y}}switch(us(t)){case"start":p[a]-=h*(n&&c?-1:1);break;case"end":p[a]+=h*(n&&c?-1:1);break}return p}const _E=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:o=[],platform:a}=n,i=o.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:s}),{x:d,y:f}=Vh(c,r,l),h=r,p={},g=0;for(let y=0;y<i.length;y++){const{name:v,fn:x}=i[y],{x:C,y:_,data:b,reset:w}=await x({x:d,y:f,initialPlacement:r,placement:h,strategy:s,middlewareData:p,rects:c,platform:a,elements:{reference:e,floating:t}});d=C??d,f=_??f,p={...p,[v]:{...p[v],...b}},w&&g<=50&&(g++,typeof w=="object"&&(w.placement&&(h=w.placement),w.rects&&(c=w.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:s}):w.rects),{x:d,y:f}=Vh(c,h,l)),y=-1)}return{x:d,y:f,placement:h,strategy:s,middlewareData:p}};async function Zs(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:o,rects:a,elements:i,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:h=!1,padding:p=0}=on(t,e),g=kg(p),v=i[h?f==="floating"?"reference":"floating":f],x=Fa(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(v)))==null||n?v:v.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(i.floating)),boundary:c,rootBoundary:d,strategy:l})),C=f==="floating"?{x:r,y:s,width:a.floating.width,height:a.floating.height}:a.reference,_=await(o.getOffsetParent==null?void 0:o.getOffsetParent(i.floating)),b=await(o.isElement==null?void 0:o.isElement(_))?await(o.getScale==null?void 0:o.getScale(_))||{x:1,y:1}:{x:1,y:1},w=Fa(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:C,offsetParent:_,strategy:l}):C);return{top:(x.top-w.top+g.top)/b.y,bottom:(w.bottom-x.bottom+g.bottom)/b.y,left:(x.left-w.left+g.left)/b.x,right:(w.right-x.right+g.right)/b.x}}const EE=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:o,platform:a,elements:i,middlewareData:l}=t,{element:c,padding:d=0}=on(e,t)||{};if(c==null)return{};const f=kg(d),h={x:n,y:r},p=vu(s),g=yu(p),y=await a.getDimensions(c),v=p==="y",x=v?"top":"left",C=v?"bottom":"right",_=v?"clientHeight":"clientWidth",b=o.reference[g]+o.reference[p]-h[p]-o.floating[g],w=h[p]-o.reference[p],P=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c));let N=P?P[_]:0;(!N||!await(a.isElement==null?void 0:a.isElement(P)))&&(N=i.floating[_]||o.floating[g]);const E=b/2-w/2,A=N/2-y[g]/2-1,k=Dn(f[x],A),T=Dn(f[C],A),I=k,R=N-y[g]-T,O=N/2-y[g]/2+E,M=cc(I,O,R),D=!l.arrow&&us(s)!=null&&O!==M&&o.reference[g]/2-(O<I?k:T)-y[g]/2<0,$=D?O<I?O-I:O-R:0;return{[p]:h[p]+$,data:{[p]:M,centerOffset:O-M-$,...D&&{alignmentOffset:$}},reset:D}}}),SE=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:o,rects:a,initialPlacement:i,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:y=!0,...v}=on(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const x=an(s),C=Ft(i),_=an(i)===i,b=await(l.isRTL==null?void 0:l.isRTL(c.floating)),w=h||(_||!y?[Da(i)]:yE(i)),P=g!=="none";!h&&P&&w.push(...xE(i,y,g,b));const N=[i,...w],E=await Zs(t,v),A=[];let k=((r=o.flip)==null?void 0:r.overflows)||[];if(d&&A.push(E[x]),f){const O=gE(s,a,b);A.push(E[O[0]],E[O[1]])}if(k=[...k,{placement:s,overflows:A}],!A.every(O=>O<=0)){var T,I;const O=(((T=o.flip)==null?void 0:T.index)||0)+1,M=N[O];if(M&&(!(f==="alignment"?C!==Ft(M):!1)||k.every(H=>Ft(H.placement)===C?H.overflows[0]>0:!0)))return{data:{index:O,overflows:k},reset:{placement:M}};let D=(I=k.filter($=>$.overflows[0]<=0).sort(($,H)=>$.overflows[1]-H.overflows[1])[0])==null?void 0:I.placement;if(!D)switch(p){case"bestFit":{var R;const $=(R=k.filter(H=>{if(P){const U=Ft(H.placement);return U===C||U==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(U=>U>0).reduce((U,re)=>U+re,0)]).sort((H,U)=>H[1]-U[1])[0])==null?void 0:R[0];$&&(D=$);break}case"initialPlacement":D=i;break}if(s!==D)return{reset:{placement:D}}}return{}}}};function Hh(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Wh(e){return fE.some(t=>e[t]>=0)}const AE=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...s}=on(e,t);switch(r){case"referenceHidden":{const o=await Zs(t,{...s,elementContext:"reference"}),a=Hh(o,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Wh(a)}}}case"escaped":{const o=await Zs(t,{...s,altBoundary:!0}),a=Hh(o,n.floating);return{data:{escapedOffsets:a,escaped:Wh(a)}}}default:return{}}}}},Ig=new Set(["left","top"]);async function NE(e,t){const{placement:n,platform:r,elements:s}=e,o=await(r.isRTL==null?void 0:r.isRTL(s.floating)),a=an(n),i=us(n),l=Ft(n)==="y",c=Ig.has(a)?-1:1,d=o&&l?-1:1,f=on(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return i&&typeof g=="number"&&(p=i==="end"?g*-1:g),l?{x:p*d,y:h*c}:{x:h*c,y:p*d}}const PE=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:o,placement:a,middlewareData:i}=t,l=await NE(t,e);return a===((n=i.offset)==null?void 0:n.placement)&&(r=i.arrow)!=null&&r.alignmentOffset?{}:{x:s+l.x,y:o+l.y,data:{...l,placement:a}}}}},kE=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:i={fn:v=>{let{x,y:C}=v;return{x,y:C}}},...l}=on(e,t),c={x:n,y:r},d=await Zs(t,l),f=Ft(an(s)),h=gu(f);let p=c[h],g=c[f];if(o){const v=h==="y"?"top":"left",x=h==="y"?"bottom":"right",C=p+d[v],_=p-d[x];p=cc(C,p,_)}if(a){const v=f==="y"?"top":"left",x=f==="y"?"bottom":"right",C=g+d[v],_=g-d[x];g=cc(C,g,_)}const y=i.fn({...t,[h]:p,[f]:g});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[h]:o,[f]:a}}}}}},IE=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:o,middlewareData:a}=t,{offset:i=0,mainAxis:l=!0,crossAxis:c=!0}=on(e,t),d={x:n,y:r},f=Ft(s),h=gu(f);let p=d[h],g=d[f];const y=on(i,t),v=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(l){const _=h==="y"?"height":"width",b=o.reference[h]-o.floating[_]+v.mainAxis,w=o.reference[h]+o.reference[_]-v.mainAxis;p<b?p=b:p>w&&(p=w)}if(c){var x,C;const _=h==="y"?"width":"height",b=Ig.has(an(s)),w=o.reference[f]-o.floating[_]+(b&&((x=a.offset)==null?void 0:x[f])||0)+(b?0:v.crossAxis),P=o.reference[f]+o.reference[_]+(b?0:((C=a.offset)==null?void 0:C[f])||0)-(b?v.crossAxis:0);g<w?g=w:g>P&&(g=P)}return{[h]:p,[f]:g}}}},RE=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:o,platform:a,elements:i}=t,{apply:l=()=>{},...c}=on(e,t),d=await Zs(t,c),f=an(s),h=us(s),p=Ft(s)==="y",{width:g,height:y}=o.floating;let v,x;f==="top"||f==="bottom"?(v=f,x=h===(await(a.isRTL==null?void 0:a.isRTL(i.floating))?"start":"end")?"left":"right"):(x=f,v=h==="end"?"top":"bottom");const C=y-d.top-d.bottom,_=g-d.left-d.right,b=Dn(y-d[v],C),w=Dn(g-d[x],_),P=!t.middlewareData.shift;let N=b,E=w;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(E=_),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(N=C),P&&!h){const k=ot(d.left,0),T=ot(d.right,0),I=ot(d.top,0),R=ot(d.bottom,0);p?E=g-2*(k!==0||T!==0?k+T:ot(d.left,d.right)):N=y-2*(I!==0||R!==0?I+R:ot(d.top,d.bottom))}await l({...t,availableWidth:E,availableHeight:N});const A=await a.getDimensions(i.floating);return g!==A.width||y!==A.height?{reset:{rects:!0}}:{}}}};function ti(){return typeof window<"u"}function ds(e){return Rg(e)?(e.nodeName||"").toLowerCase():"#document"}function at(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function $t(e){var t;return(t=(Rg(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Rg(e){return ti()?e instanceof Node||e instanceof at(e).Node:!1}function bt(e){return ti()?e instanceof Element||e instanceof at(e).Element:!1}function Bt(e){return ti()?e instanceof HTMLElement||e instanceof at(e).HTMLElement:!1}function qh(e){return!ti()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof at(e).ShadowRoot}const TE=new Set(["inline","contents"]);function po(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=wt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!TE.has(s)}const OE=new Set(["table","td","th"]);function jE(e){return OE.has(ds(e))}const LE=[":popover-open",":modal"];function ni(e){return LE.some(t=>{try{return e.matches(t)}catch{return!1}})}const ME=["transform","translate","scale","rotate","perspective"],DE=["transform","translate","scale","rotate","perspective","filter"],FE=["paint","layout","strict","content"];function bu(e){const t=wu(),n=bt(e)?wt(e):e;return ME.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||DE.some(r=>(n.willChange||"").includes(r))||FE.some(r=>(n.contain||"").includes(r))}function UE(e){let t=Fn(e);for(;Bt(t)&&!rs(t);){if(bu(t))return t;if(ni(t))return null;t=Fn(t)}return null}function wu(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const BE=new Set(["html","body","#document"]);function rs(e){return BE.has(ds(e))}function wt(e){return at(e).getComputedStyle(e)}function ri(e){return bt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Fn(e){if(ds(e)==="html")return e;const t=e.assignedSlot||e.parentNode||qh(e)&&e.host||$t(e);return qh(t)?t.host:t}function Tg(e){const t=Fn(e);return rs(t)?e.ownerDocument?e.ownerDocument.body:e.body:Bt(t)&&po(t)?t:Tg(t)}function Js(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=Tg(e),o=s===((r=e.ownerDocument)==null?void 0:r.body),a=at(s);if(o){const i=dc(a);return t.concat(a,a.visualViewport||[],po(s)?s:[],i&&n?Js(i):[])}return t.concat(s,Js(s,[],n))}function dc(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Og(e){const t=wt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=Bt(e),o=s?e.offsetWidth:n,a=s?e.offsetHeight:r,i=Ma(n)!==o||Ma(r)!==a;return i&&(n=o,r=a),{width:n,height:r,$:i}}function xu(e){return bt(e)?e:e.contextElement}function Ur(e){const t=xu(e);if(!Bt(t))return Ut(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:o}=Og(t);let a=(o?Ma(n.width):n.width)/r,i=(o?Ma(n.height):n.height)/s;return(!a||!Number.isFinite(a))&&(a=1),(!i||!Number.isFinite(i))&&(i=1),{x:a,y:i}}const $E=Ut(0);function jg(e){const t=at(e);return!wu()||!t.visualViewport?$E:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function zE(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==at(e)?!1:t}function fr(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),o=xu(e);let a=Ut(1);t&&(r?bt(r)&&(a=Ur(r)):a=Ur(e));const i=zE(o,n,r)?jg(o):Ut(0);let l=(s.left+i.x)/a.x,c=(s.top+i.y)/a.y,d=s.width/a.x,f=s.height/a.y;if(o){const h=at(o),p=r&&bt(r)?at(r):r;let g=h,y=dc(g);for(;y&&r&&p!==g;){const v=Ur(y),x=y.getBoundingClientRect(),C=wt(y),_=x.left+(y.clientLeft+parseFloat(C.paddingLeft))*v.x,b=x.top+(y.clientTop+parseFloat(C.paddingTop))*v.y;l*=v.x,c*=v.y,d*=v.x,f*=v.y,l+=_,c+=b,g=at(y),y=dc(g)}}return Fa({width:d,height:f,x:l,y:c})}function si(e,t){const n=ri(e).scrollLeft;return t?t.left+n:fr($t(e)).left+n}function Lg(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-si(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function VE(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const o=s==="fixed",a=$t(r),i=t?ni(t.floating):!1;if(r===a||i&&o)return n;let l={scrollLeft:0,scrollTop:0},c=Ut(1);const d=Ut(0),f=Bt(r);if((f||!f&&!o)&&((ds(r)!=="body"||po(a))&&(l=ri(r)),Bt(r))){const p=fr(r);c=Ur(r),d.x=p.x+r.clientLeft,d.y=p.y+r.clientTop}const h=a&&!f&&!o?Lg(a,l):Ut(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+d.x+h.x,y:n.y*c.y-l.scrollTop*c.y+d.y+h.y}}function HE(e){return Array.from(e.getClientRects())}function WE(e){const t=$t(e),n=ri(e),r=e.ownerDocument.body,s=ot(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=ot(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+si(e);const i=-n.scrollTop;return wt(r).direction==="rtl"&&(a+=ot(t.clientWidth,r.clientWidth)-s),{width:s,height:o,x:a,y:i}}const Gh=25;function qE(e,t){const n=at(e),r=$t(e),s=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,i=0,l=0;if(s){o=s.width,a=s.height;const d=wu();(!d||d&&t==="fixed")&&(i=s.offsetLeft,l=s.offsetTop)}const c=si(r);if(c<=0){const d=r.ownerDocument,f=d.body,h=getComputedStyle(f),p=d.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,g=Math.abs(r.clientWidth-f.clientWidth-p);g<=Gh&&(o-=g)}else c<=Gh&&(o+=c);return{width:o,height:a,x:i,y:l}}const GE=new Set(["absolute","fixed"]);function KE(e,t){const n=fr(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,o=Bt(e)?Ur(e):Ut(1),a=e.clientWidth*o.x,i=e.clientHeight*o.y,l=s*o.x,c=r*o.y;return{width:a,height:i,x:l,y:c}}function Kh(e,t,n){let r;if(t==="viewport")r=qE(e,n);else if(t==="document")r=WE($t(e));else if(bt(t))r=KE(t,n);else{const s=jg(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Fa(r)}function Mg(e,t){const n=Fn(e);return n===t||!bt(n)||rs(n)?!1:wt(n).position==="fixed"||Mg(n,t)}function QE(e,t){const n=t.get(e);if(n)return n;let r=Js(e,[],!1).filter(i=>bt(i)&&ds(i)!=="body"),s=null;const o=wt(e).position==="fixed";let a=o?Fn(e):e;for(;bt(a)&&!rs(a);){const i=wt(a),l=bu(a);!l&&i.position==="fixed"&&(s=null),(o?!l&&!s:!l&&i.position==="static"&&!!s&&GE.has(s.position)||po(a)&&!l&&Mg(e,a))?r=r.filter(d=>d!==a):s=i,a=Fn(a)}return t.set(e,r),r}function YE(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const a=[...n==="clippingAncestors"?ni(t)?[]:QE(t,this._c):[].concat(n),r],i=a[0],l=a.reduce((c,d)=>{const f=Kh(t,d,s);return c.top=ot(f.top,c.top),c.right=Dn(f.right,c.right),c.bottom=Dn(f.bottom,c.bottom),c.left=ot(f.left,c.left),c},Kh(t,i,s));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function XE(e){const{width:t,height:n}=Og(e);return{width:t,height:n}}function ZE(e,t,n){const r=Bt(t),s=$t(t),o=n==="fixed",a=fr(e,!0,o,t);let i={scrollLeft:0,scrollTop:0};const l=Ut(0);function c(){l.x=si(s)}if(r||!r&&!o)if((ds(t)!=="body"||po(s))&&(i=ri(t)),r){const p=fr(t,!0,o,t);l.x=p.x+t.clientLeft,l.y=p.y+t.clientTop}else s&&c();o&&!r&&s&&c();const d=s&&!r&&!o?Lg(s,i):Ut(0),f=a.left+i.scrollLeft-l.x-d.x,h=a.top+i.scrollTop-l.y-d.y;return{x:f,y:h,width:a.width,height:a.height}}function Yi(e){return wt(e).position==="static"}function Qh(e,t){if(!Bt(e)||wt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return $t(e)===n&&(n=n.ownerDocument.body),n}function Dg(e,t){const n=at(e);if(ni(e))return n;if(!Bt(e)){let s=Fn(e);for(;s&&!rs(s);){if(bt(s)&&!Yi(s))return s;s=Fn(s)}return n}let r=Qh(e,t);for(;r&&jE(r)&&Yi(r);)r=Qh(r,t);return r&&rs(r)&&Yi(r)&&!bu(r)?n:r||UE(e)||n}const JE=async function(e){const t=this.getOffsetParent||Dg,n=this.getDimensions,r=await n(e.floating);return{reference:ZE(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function eS(e){return wt(e).direction==="rtl"}const tS={convertOffsetParentRelativeRectToViewportRelativeRect:VE,getDocumentElement:$t,getClippingRect:YE,getOffsetParent:Dg,getElementRects:JE,getClientRects:HE,getDimensions:XE,getScale:Ur,isElement:bt,isRTL:eS};function Fg(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function nS(e,t){let n=null,r;const s=$t(e);function o(){var i;clearTimeout(r),(i=n)==null||i.disconnect(),n=null}function a(i,l){i===void 0&&(i=!1),l===void 0&&(l=1),o();const c=e.getBoundingClientRect(),{left:d,top:f,width:h,height:p}=c;if(i||t(),!h||!p)return;const g=Bo(f),y=Bo(s.clientWidth-(d+h)),v=Bo(s.clientHeight-(f+p)),x=Bo(d),_={rootMargin:-g+"px "+-y+"px "+-v+"px "+-x+"px",threshold:ot(0,Dn(1,l))||1};let b=!0;function w(P){const N=P[0].intersectionRatio;if(N!==l){if(!b)return a();N?a(!1,N):r=setTimeout(()=>{a(!1,1e-7)},1e3)}N===1&&!Fg(c,e.getBoundingClientRect())&&a(),b=!1}try{n=new IntersectionObserver(w,{..._,root:s.ownerDocument})}catch{n=new IntersectionObserver(w,_)}n.observe(e)}return a(!0),o}function rS(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:i=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=xu(e),d=s||o?[...c?Js(c):[],...Js(t)]:[];d.forEach(x=>{s&&x.addEventListener("scroll",n,{passive:!0}),o&&x.addEventListener("resize",n)});const f=c&&i?nS(c,n):null;let h=-1,p=null;a&&(p=new ResizeObserver(x=>{let[C]=x;C&&C.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var _;(_=p)==null||_.observe(t)})),n()}),c&&!l&&p.observe(c),p.observe(t));let g,y=l?fr(e):null;l&&v();function v(){const x=fr(e);y&&!Fg(y,x)&&n(),y=x,g=requestAnimationFrame(v)}return n(),()=>{var x;d.forEach(C=>{s&&C.removeEventListener("scroll",n),o&&C.removeEventListener("resize",n)}),f==null||f(),(x=p)==null||x.disconnect(),p=null,l&&cancelAnimationFrame(g)}}const sS=PE,oS=kE,aS=SE,iS=RE,lS=AE,Yh=EE,cS=IE,uS=(e,t,n)=>{const r=new Map,s={platform:tS,...n},o={...s.platform,_c:r};return _E(e,t,{...s,platform:o})};var dS=typeof document<"u",fS=function(){},Jo=dS?m.useLayoutEffect:fS;function Ua(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Ua(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const o=s[r];if(!(o==="_owner"&&e.$$typeof)&&!Ua(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function Ug(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Xh(e,t){const n=Ug(e);return Math.round(t*n)/n}function Xi(e){const t=m.useRef(e);return Jo(()=>{t.current=e}),t}function hS(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:o,floating:a}={},transform:i=!0,whileElementsMounted:l,open:c}=e,[d,f]=m.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=m.useState(r);Ua(h,r)||p(r);const[g,y]=m.useState(null),[v,x]=m.useState(null),C=m.useCallback(H=>{H!==P.current&&(P.current=H,y(H))},[]),_=m.useCallback(H=>{H!==N.current&&(N.current=H,x(H))},[]),b=o||g,w=a||v,P=m.useRef(null),N=m.useRef(null),E=m.useRef(d),A=l!=null,k=Xi(l),T=Xi(s),I=Xi(c),R=m.useCallback(()=>{if(!P.current||!N.current)return;const H={placement:t,strategy:n,middleware:h};T.current&&(H.platform=T.current),uS(P.current,N.current,H).then(U=>{const re={...U,isPositioned:I.current!==!1};O.current&&!Ua(E.current,re)&&(E.current=re,Cc.flushSync(()=>{f(re)}))})},[h,t,n,T,I]);Jo(()=>{c===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,f(H=>({...H,isPositioned:!1})))},[c]);const O=m.useRef(!1);Jo(()=>(O.current=!0,()=>{O.current=!1}),[]),Jo(()=>{if(b&&(P.current=b),w&&(N.current=w),b&&w){if(k.current)return k.current(b,w,R);R()}},[b,w,R,k,A]);const M=m.useMemo(()=>({reference:P,floating:N,setReference:C,setFloating:_}),[C,_]),D=m.useMemo(()=>({reference:b,floating:w}),[b,w]),$=m.useMemo(()=>{const H={position:n,left:0,top:0};if(!D.floating)return H;const U=Xh(D.floating,d.x),re=Xh(D.floating,d.y);return i?{...H,transform:"translate("+U+"px, "+re+"px)",...Ug(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:U,top:re}},[n,i,D.floating,d.x,d.y]);return m.useMemo(()=>({...d,update:R,refs:M,elements:D,floatingStyles:$}),[d,R,M,D,$])}const pS=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:s}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Yh({element:r.current,padding:s}).fn(n):{}:r?Yh({element:r,padding:s}).fn(n):{}}}},mS=(e,t)=>({...sS(e),options:[e,t]}),gS=(e,t)=>({...oS(e),options:[e,t]}),yS=(e,t)=>({...cS(e),options:[e,t]}),vS=(e,t)=>({...aS(e),options:[e,t]}),bS=(e,t)=>({...iS(e),options:[e,t]}),wS=(e,t)=>({...lS(e),options:[e,t]}),xS=(e,t)=>({...pS(e),options:[e,t]});var CS="Arrow",Bg=m.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...o}=e;return u.jsx(Be.svg,{...o,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:u.jsx("polygon",{points:"0,0 30,0 15,10"})})});Bg.displayName=CS;var _S=Bg,Cu="Popper",[$g,oi]=co(Cu),[ES,zg]=$g(Cu),Vg=e=>{const{__scopePopper:t,children:n}=e,[r,s]=m.useState(null);return u.jsx(ES,{scope:t,anchor:r,onAnchorChange:s,children:n})};Vg.displayName=Cu;var Hg="PopperAnchor",Wg=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,o=zg(Hg,n),a=m.useRef(null),i=Ke(t,a),l=m.useRef(null);return m.useEffect(()=>{const c=l.current;l.current=(r==null?void 0:r.current)||a.current,c!==l.current&&o.onAnchorChange(l.current)}),r?null:u.jsx(Be.div,{...s,ref:i})});Wg.displayName=Hg;var _u="PopperContent",[SS,AS]=$g(_u),qg=m.forwardRef((e,t)=>{var ce,zt,Ct,_t,Et,St;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:o="center",alignOffset:a=0,arrowPadding:i=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:h=!1,updatePositionStrategy:p="optimized",onPlaced:g,...y}=e,v=zg(_u,n),[x,C]=m.useState(null),_=Ke(t,At=>C(At)),[b,w]=m.useState(null),P=$0(b),N=(P==null?void 0:P.width)??0,E=(P==null?void 0:P.height)??0,A=r+(o!=="center"?"-"+o:""),k=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},T=Array.isArray(c)?c:[c],I=T.length>0,R={padding:k,boundary:T.filter(PS),altBoundary:I},{refs:O,floatingStyles:M,placement:D,isPositioned:$,middlewareData:H}=hS({strategy:"fixed",placement:A,whileElementsMounted:(...At)=>rS(...At,{animationFrame:p==="always"}),elements:{reference:v.anchor},middleware:[mS({mainAxis:s+E,alignmentAxis:a}),l&&gS({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?yS():void 0,...R}),l&&vS({...R}),bS({...R,apply:({elements:At,rects:q,availableWidth:Y,availableHeight:Te})=>{const{width:$e,height:Fe}=q.reference,ie=At.floating.style;ie.setProperty("--radix-popper-available-width",`${Y}px`),ie.setProperty("--radix-popper-available-height",`${Te}px`),ie.setProperty("--radix-popper-anchor-width",`${$e}px`),ie.setProperty("--radix-popper-anchor-height",`${Fe}px`)}}),b&&xS({element:b,padding:i}),kS({arrowWidth:N,arrowHeight:E}),h&&wS({strategy:"referenceHidden",...R})]}),[U,re]=Qg(D),J=es(g);Ln(()=>{$&&(J==null||J())},[$,J]);const Q=(ce=H.arrow)==null?void 0:ce.x,ee=(zt=H.arrow)==null?void 0:zt.y,oe=((Ct=H.arrow)==null?void 0:Ct.centerOffset)!==0,[he,dt]=m.useState();return Ln(()=>{x&&dt(window.getComputedStyle(x).zIndex)},[x]),u.jsx("div",{ref:O.setFloating,"data-radix-popper-content-wrapper":"",style:{...M,transform:$?M.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:he,"--radix-popper-transform-origin":[(_t=H.transformOrigin)==null?void 0:_t.x,(Et=H.transformOrigin)==null?void 0:Et.y].join(" "),...((St=H.hide)==null?void 0:St.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:u.jsx(SS,{scope:n,placedSide:U,onArrowChange:w,arrowX:Q,arrowY:ee,shouldHideArrow:oe,children:u.jsx(Be.div,{"data-side":U,"data-align":re,...y,ref:_,style:{...y.style,animation:$?void 0:"none"}})})})});qg.displayName=_u;var Gg="PopperArrow",NS={top:"bottom",right:"left",bottom:"top",left:"r
239ight"},Kg=m.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,o=AS(Gg,r),a=NS[o.placedSide];return u.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[a]: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:u.jsx(_S,{...s,ref:n,style:{...s.style,display:"block"}})})});Kg.displayName=Gg;function PS(e){return e!==null}var kS=e=>({name:"transformOrigin",options:e,fn(t){var v,x,C;const{placement:n,rects:r,middlewareData:s}=t,a=((v=s.arrow)==null?void 0:v.centerOffset)!==0,i=a?0:e.arrowWidth,l=a?0:e.arrowHeight,[c,d]=Qg(n),f={start:"0%",center:"50%",end:"100%"}[d],h=(((x=s.arrow)==null?void 0:x.x)??0)+i/2,p=(((C=s.arrow)==null?void 0:C.y)??0)+l/2;let g="",y="";return c==="bottom"?(g=a?f:`${h}px`,y=`${-l}px`):c==="top"?(g=a?f:`${h}px`,y=`${r.floating.height+l}px`):c==="right"?(g=`${-l}px`,y=a?f:`${p}px`):c==="left"&&(g=`${r.floating.width+l}px`,y=a?f:`${p}px`),{data:{x:g,y}}}});function Qg(e){const[t,n="center"]=e.split("-");return[t,n]}var Yg=Vg,Eu=Wg,Xg=qg,Zg=Kg,IS=Symbol("radix.slottable");function RS(e){const t=({children:n})=>u.jsx(u.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=IS,t}var TS=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"}),OS="VisuallyHidden",Jg=m.forwardRef((e,t)=>u.jsx(Be.span,{...e,ref:t,style:{...TS,...e.style}}));Jg.displayName=OS;var jS=Jg,[ai]=co("Tooltip",[oi]),ii=oi(),e2="TooltipProvider",LS=700,fc="tooltip.open",[MS,Su]=ai(e2),t2=e=>{const{__scopeTooltip:t,delayDuration:n=LS,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:o}=e,a=m.useRef(!0),i=m.useRef(!1),l=m.useRef(0);return m.useEffect(()=>{const c=l.current;return()=>window.clearTimeout(c)},[]),u.jsx(MS,{scope:t,isOpenDelayedRef:a,delayDuration:n,onOpen:m.useCallback(()=>{window.clearTimeout(l.current),a.current=!1},[]),onClose:m.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>a.current=!0,r)},[r]),isPointerInTransitRef:i,onPointerInTransitChange:m.useCallback(c=>{i.current=c},[]),disableHoverableContent:s,children:o})};t2.displayName=e2;var eo="Tooltip",[DS,li]=ai(eo),n2=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:s,onOpenChange:o,disableHoverableContent:a,delayDuration:i}=e,l=Su(eo,e.__scopeTooltip),c=ii(t),[d,f]=m.useState(null),h=Ds(),p=m.useRef(0),g=a??l.disableHoverableContent,y=i??l.delayDuration,v=m.useRef(!1),[x,C]=Qa({prop:r,defaultProp:s??!1,onChange:N=>{N?(l.onOpen(),document.dispatchEvent(new CustomEvent(fc))):l.onClose(),o==null||o(N)},caller:eo}),_=m.useMemo(()=>x?v.current?"delayed-open":"instant-open":"closed",[x]),b=m.useCallback(()=>{window.clearTimeout(p.current),p.current=0,v.current=!1,C(!0)},[C]),w=m.useCallback(()=>{window.clearTimeout(p.current),p.current=0,C(!1)},[C]),P=m.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{v.current=!0,C(!0),p.current=0},y)},[y,C]);return m.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),u.jsx(Yg,{...c,children:u.jsx(DS,{scope:t,contentId:h,open:x,stateAttribute:_,trigger:d,onTriggerChange:f,onTriggerEnter:m.useCallback(()=>{l.isOpenDelayedRef.current?P():b()},[l.isOpenDelayedRef,P,b]),onTriggerLeave:m.useCallback(()=>{g?w():(window.clearTimeout(p.current),p.current=0)},[w,g]),onOpen:b,onClose:w,disableHoverableContent:g,children:n})})};n2.displayName=eo;var hc="TooltipTrigger",r2=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=li(hc,n),o=Su(hc,n),a=ii(n),i=m.useRef(null),l=Ke(t,i,s.onTriggerChange),c=m.useRef(!1),d=m.useRef(!1),f=m.useCallback(()=>c.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),u.jsx(Eu,{asChild:!0,...a,children:u.jsx(Be.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:l,onPointerMove:Oe(e.onPointerMove,h=>{h.pointerType!=="touch"&&!d.current&&!o.isPointerInTransitRef.current&&(s.onTriggerEnter(),d.current=!0)}),onPointerLeave:Oe(e.onPointerLeave,()=>{s.onTriggerLeave(),d.current=!1}),onPointerDown:Oe(e.onPointerDown,()=>{s.open&&s.onClose(),c.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:Oe(e.onFocus,()=>{c.current||s.onOpen()}),onBlur:Oe(e.onBlur,s.onClose),onClick:Oe(e.onClick,s.onClose)})})});r2.displayName=hc;var FS="TooltipPortal",[Lk,US]=ai(FS,{forceMount:void 0}),ss="TooltipContent",s2=m.forwardRef((e,t)=>
vendor: 4,283 bytes, line 239
239{const n=US(ss,e.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...o}=e,a=li(ss,e.__scopeTooltip);return u.jsx(pr,{present:r||a.open,children:a.disableHoverableContent?u.jsx(o2,{side:s,...o,ref:t}):u.jsx(BS,{side:s,...o,ref:t})})}),BS=m.forwardRef((e,t)=>{const n=li(ss,e.__scopeTooltip),r=Su(ss,e.__scopeTooltip),s=m.useRef(null),o=Ke(t,s),[a,i]=m.useState(null),{trigger:l,onClose:c}=n,d=s.current,{onPointerInTransitChange:f}=r,h=m.useCallback(()=>{i(null),f(!1)},[f]),p=m.useCallback((g,y)=>{const v=g.currentTarget,x={x:g.clientX,y:g.clientY},C=WS(x,v.getBoundingClientRect()),_=qS(x,C),b=GS(y.getBoundingClientRect()),w=QS([..._,...b]);i(w),f(!0)},[f]);return m.useEffect(()=>()=>h(),[h]),m.useEffect(()=>{if(l&&d){const g=v=>p(v,d),y=v=>p(v,l);return l.addEventListener("pointerleave",g),d.addEventListener("pointerleave",y),()=>{l.removeEventListener("pointerleave",g),d.removeEventListener("pointerleave",y)}}},[l,d,p,h]),m.useEffect(()=>{if(a){const g=y=>{const v=y.target,x={x:y.clientX,y:y.clientY},C=(l==null?void 0:l.contains(v))||(d==null?void 0:d.contains(v)),_=!KS(x,a);C?h():_&&(h(),c())};return document.addEventListener("pointermove",g),()=>document.removeEventListener("pointermove",g)}},[l,d,a,c,h]),u.jsx(o2,{...e,ref:o})}),[$S,zS]=ai(eo,{isInside:!1}),VS=RS("TooltipContent"),o2=m.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:o,onPointerDownOutside:a,...i}=e,l=li(ss,n),c=ii(n),{onClose:d}=l;return m.useEffect(()=>(document.addEventListener(fc,d),()=>document.removeEventListener(fc,d)),[d]),m.useEffect(()=>{if(l.trigger){const f=h=>{const p=h.target;p!=null&&p.contains(l.trigger)&&d()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[l.trigger,d]),u.jsx(Ya,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:f=>f.preventDefault(),onDismiss:d,children:u.jsxs(Xg,{"data-state":l.stateAttribute,...c,...i,ref:t,style:{...i.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:[u.jsx(VS,{children:r}),u.jsx($S,{scope:n,isInside:!0,children:u.jsx(jS,{id:l.contentId,role:"tooltip",children:s||r})})]})})});s2.displayName=ss;var a2="TooltipArrow",HS=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=ii(n);return zS(a2,n).isInside?null:u.jsx(Zg,{...s,...r,ref:t})});HS.displayName=a2;function WS(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,r,s,o)){case o:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function qS(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function GS(e){const{top:t,right:n,bottom:r,left:s}=e;return[{x:s,y:t},{x:n,y:t},{x:n,y:r},{x:s,y:r}]}function KS(e,t){const{x:n,y:r}=e;let s=!1;for(let o=0,a=t.length-1;o<t.length;a=o++){const i=t[o],l=t[a],c=i.x,d=i.y,f=l.x,h=l.y;d>r!=h>r&&n<(f-c)*(r-d)/(h-d)+c&&(s=!s)}return s}function QS(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),YS(t)}function YS(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const s=e[r];for(;t.length>=2;){const o=t[t.length-1],a=t[t.length-2];if((o.x-a.x)*(s.y-a.y)>=(o.y-a.y)*(s.x-a.x))t.pop();else break}t.push(s)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const s=e[r];for(;n.length>=2;){const o=n[n.length-1],a=n[n.length-2];if((o.x-a.x)*(s.y-a.y)>=(o.y-a.y)*(s.x-a.x))n.pop();else break}n.push(s)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var XS=t2,ZS=n2,JS=r2,i2=s2;const eA=XS,Mk=ZS,Dk=JS,tA=m.forwardRef(({className:e,sideOffset:t=4,...n},r)=>
239u.jsx(i2,{ref:r,sideOffset:t,className:G("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));tA.displayName=i2.displayName;const nA=({children:e})=>u.jsxs(eA,{children:[u.jsx(dE,{}),e]});function Zh(e,t){return t}const pc={portraitBook:Zh(void 0,!1),calendar:Zh(void 0,!1)},Fk=pc.portraitBook||pc.calendar,en=({source:e,platform:t,placement:n})=>{je("website_app_store_click",{source:e,platform:t,placement:n,destination:t==="android"?"google_play":"app_store"})};function rA(){return typeof navigator<"u"&&/Android/i.test(navigator.userAgent)?"android":"ios"}function l2({open:e,onClose:t,onContinueWeb:n,playStoreUrl:r}){const{t:s}=_e(),[o,a]=m.useState("ios");m.useEffect(()=>{a(rA())},[]);const i=()=>{en({source:"app_store_modal",platform:o,placement:"mobile"});const l=o==="android"?r??tn:or;window.open(l,"_blank","noopener,noreferrer"),t()};return u.jsx(uo,{open:e,onClose:t,variant:"info",title:s("landing.appStoreModal.title"),illustration:u.jsx("div",{className:"flex items-center justify-center w-[70px] h-[70px] rounded-2xl bg-[#F1914A]/10",children:u.jsx(Ip,{className:"w-9 h-9 text-[#F1914A]"})}),primaryAction:{label:s(o==="android"?"landing.appStoreModal.downloadAndroid":"landing.appStoreModal.downloadIos"),onClick:i},secondaryAction:{label:s("landing.appStoreModal.continueWeb"),onClick:n},children:u.jsx("p",{children:s("landing.appStoreModal.body")})})}function Au(){const[e,t]=m.useState(!1);return m.useEffect(()=>{const n=/Android|iPhone|iPad|iPod|Opera Mini|IEMobile|WPDesktop/i.test(navigator.userAgent);t(n||navigator.maxTouchPoints>1)},[]),e}const Jh={en:"/photo-book",nl:"/fotoboek"},Nu=e=>e.toLowerCase().startsWith("en")?Jh.en:Jh.nl,sA=({collapseOnScroll:e=!0,collapseAt:t=24,transparent:n=!1,hamburgerOnly:r=!1})=>{const[s,o]=m.useState(!1),[a,i]=m.useState(!1),[l,c]=m.useState(()=>typeof document<"u"&&document.documentElement.dataset.lcNavTint==="light");m.useEffect(()=>{const I=()=>c(document.documentElement.dataset.lcNavTint==="light");return window.addEventListener("lc:nav-tint",I),()=>window.removeEventListener("lc:nav-tint",I)},[]);const d=l&&!s,[f,h]=m.useState(!1),p=Au(),{user:g,resolveUsername:y}=ge(),v=tt(),x=He(),{t:C,i18n:_}=_e(),b=Nu(_.language),w=_.language.toLowerCase().startsWith("en")?"/about":"/over-ons";m.useEffect(()=>{if(!e)return;const I=()=>document.body.scrollTop||window.scrollY||0,R=()=>i(I()>t);return R(),document.body.addEventListener("scroll",R,{passive:!0}),window.addEventListener("scroll",R,{passive:!0}),window.addEventListener("resize",R),()=>{document.body.removeEventListener("scroll",R),window.removeEventListener("scroll",R),window.removeEventListener("resize",R)}},[e,t]);const P=a?"":" md:pt-6",N=a?"":" md:pb-10",E=a?"":" md:h-[77px]",A=async()=>{if(g){const I=await y();v(I?`/${I}`:"/onboarding")}else v("/auth",{state:{from:{pathname:"/"},intent:"get_started",source:"navbar_cta"}})},k=()=>{p?h(!0):A()},T=I=>{var R;x.pathname==="/"?(R=document.getElementById(I))==null||R.scrollIntoView({behavior:"smooth"}):v(`/?scroll=${I}`),o(!1)};return u.jsxs("nav",{className:`fixed top-0 left-0 right-0 z-50 transition-[padding] duration-300 ease-out pb-[10px]${N}`,style:{background:n&&!s?"transparent":"rgba(253, 248, 243, 0.9)",backdropFilter:n&&!s?"none":"blur(20px)"},children:[u.jsxs("div",{className:`max-w-7xl mx-auto px-6 md:px-12 flex items-end justify-between transition-[padding] duration-300 ease-out pt-3${P}`,children:[u.jsx("div",{className:"flex items-center cursor-pointer",onClick:()=>v("/"),children:u.jsx("img",{src:"/LC_Logo_hori.svg",alt:"Little Chapters",className:`w-auto transition-[height,filter] duration-300 ease-out h-[40px]${E}${d?" brightness-0 invert":""}`})}),u.jsxs("div",{className:r?"hidden":"hidden md:flex items-center gap-8",children:[u.jsx("button",{onClick:()=>T("hoe-werkt-het"),className:"font-['DM_Sans'] font-semibold text-[18px] text-[#333] hover:text-terracotta transition-colors",children:C("landing.navbar.howItWorks")}),u.jsx("button",{onClick:()=>{v(b),o(!1)},className:"font-['DM_Sans'] font-semibold text-[18px] text-[#333] hover:text-terracotta transition-colors",children:C("landing.navbar.yearbooks")}),u.jsx("button",{onClick:()=>{v("/plus"),o(!1)},className:"font-['DM_Sans'] font-semibold text-[18px] text-[#333] hover:text-terracotta transition-colors",children:C("landing.navbar.plus")}),u.jsx("button",{onClick:()=>{v("/kraamcadeau"),o(!1)},className:"font-['DM_Sans'] font-semibold text-[18px] text-[#333] hover:text-terracotta transition-colors",children:C("giftCardPage.linkLabel")}),u.jsx("button",{onClick:()=>{v(w),o(!1)},className:"font-['DM_Sans'] font-semibold text-[18px] text-[#333] hover:text-terracotta transition-colors",children:C("landing.navbar.aboutUs")}),u.jsx("button",{className:"bg-[#F5BA50] hover:bg-[#e5ab42] text-white font-['DM_Sans'] font-medium text-[18px] h-[48px] px-6 transition-colors",onClick:k,children:C(g?"landing.navbar.myStories":"landing.navbar.getStarted")})]}),u.jsx("button",{className:`p-2 ${r?"":"md:hidden"}`,onClick:()=>o(!s),"aria-label":"Menu","aria-expanded":s,children:s?u.jsx(cr,{className:"w-6 h-6 text-[#333]"}):u.jsx(ty,{className:`w-6 h-6 transition-colors duration-300 ${d?"text-[#FFFEFB]":"text-[#333]"}`})})]}),s&&u.jsx("div",{className:`${r?"":"md:hidden"} absolute top-full left-0 right-0 bg-[#FDF8F3]/95 backdrop-blur-xl py-6 px-6`,children:u.jsxs("div",{className:"flex flex-col gap-4 max-w-7xl mx-auto md:px-6",children:[u.jsx("button",{onClick:()=>T("hoe-werkt-het"),className:"font-['DM_Sans'] font-semibold text-[18px] text-[#333] hover:text-terracotta transition-colors text-left py-2",children:C("landing.navbar.howItWorks")}),u.jsx("button",{onClick:()=>{v(b),o(!1)},className:"font-['DM_Sans'] font-semibold text-[18px] text-[#333] hover:text-terracotta transition-colors text-left py-2",children:C("landing.navbar.yearbooks")}),u.jsx("button",{onClick:()=>{v("/plus"),o(!1)},className:"font-['DM_Sans'] font-semibold text-[18px] text-[#333] hover:text-terracotta transition-colors text-left py-2",children:C("landing.navbar.plus")}),u.jsx("button",{onClick:()=>{v("/kraamcadeau"),o(!1)},className:"font-['DM_Sans'] font-semibold text-[18px] text-[#333] hover:text-terracotta transition-colors text-left py-2",children:C("giftCardPage.linkLabel")}),u.jsx("button",{onClick:()=>{v(w),o(!1)},className:"font-['DM_Sans'] font-semibold text-[18px] text-[#333] hover:text-terracotta transition-colors text-left py-2",children:C("landing.navbar.aboutUs")}),u.jsx("button",{className:"bg-[#F5BA50] hover:bg-[#e5ab42] text-white font-['DM_Sans'] font-medium text-[18px] h-[48px] px-6 mt-2 w-full transition-colors",onClick:k,children:C(g?"landing.navbar.myStories":"landing.navbar.getStarted")})]})}),u.jsx(l2,{open:f,onClose:()=>h(!1),onContinueWeb:()=>{h(!1),A()}})]})};function oA(e){const t=aA(e),n=m.forwardRef((r,s)=>{const{children:o,...a}=r,i=m.Children.toArray(o),l=i.find(lA);if(l){const c=l.props.children,d=i.map(f=>f===l?m.Children.count(c)>1?m.Children.only(null):m.isValidElement(c)?c.props.children:null:f);return u.jsx(t,{...a,ref:s,children:m.isValidElement(c)?m.cloneElement(c,void 0,d):null})}return u.jsx(t,{...a,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}function aA(e){const t=m.forwardRef((n,r)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const a=uA(s),i=cA(o,s.props);return s.type!==m.Fragment&&(i.ref=r?lo(r,a):a),m.cloneElement(s,i)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var iA=Symbol("radix.slottable");function lA(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===iA}function cA(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...i)=>{const l=o(...i);return s(...i),l}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}
vendor: 4,527 bytes, line 239
239:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function uA(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ci="Popover",[c2]=co(ci,[oi]),mo=oi(),[dA,Un]=c2(ci),u2=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:s,onOpenChange:o,modal:a=!1}=e,i=mo(t),l=m.useRef(null),[c,d]=m.useState(!1),[f,h]=Qa({prop:r,defaultProp:s??!1,onChange:o,caller:ci});return u.jsx(Yg,{...i,children:u.jsx(dA,{scope:t,contentId:Ds(),triggerRef:l,open:f,onOpenChange:h,onOpenToggle:m.useCallback(()=>h(p=>!p),[h]),hasCustomAnchor:c,onCustomAnchorAdd:m.useCallback(()=>d(!0),[]),onCustomAnchorRemove:m.useCallback(()=>d(!1),[]),modal:a,children:n})})};u2.displayName=ci;var d2="PopoverAnchor",fA=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Un(d2,n),o=mo(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:i}=s;return m.useEffect(()=>(a(),()=>i()),[a,i]),u.jsx(Eu,{...o,...r,ref:t})});fA.displayName=d2;var f2="PopoverTrigger",h2=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Un(f2,n),o=mo(n),a=Ke(t,s.triggerRef),i=u.jsx(Be.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":v2(s.open),...r,ref:a,onClick:Oe(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?i:u.jsx(Eu,{asChild:!0,...o,children:i})});h2.displayName=f2;var Pu="PopoverPortal",[hA,pA]=c2(Pu,{forceMount:void 0}),p2=e=>{const{__scopePopover:t,forceMount:n,children:r,container:s}=e,o=Un(Pu,t);return u.jsx(hA,{scope:t,forceMount:n,children:u.jsx(pr,{present:n||o.open,children:u.jsx(Kc,{asChild:!0,container:s,children:r})})})};p2.displayName=Pu;var os="PopoverContent",m2=m.forwardRef((e,t)=>{const n=pA(os,e.__scopePopover),{forceMount:r=n.forceMount,...s}=e,o=Un(os,e.__scopePopover);return u.jsx(pr,{present:r||o.open,children:o.modal?u.jsx(gA,{...s,ref:t}):u.jsx(yA,{...s,ref:t})})});m2.displayName=os;var mA=oA("PopoverContent.RemoveScroll"),gA=m.forwardRef((e,t)=>{const n=Un(os,e.__scopePopover),r=m.useRef(null),s=Ke(t,r),o=m.useRef(!1);return m.useEffect(()=>{const a=r.current;if(a)return Im(a)},[]),u.jsx(Qc,{as:mA,allowPinchZoom:!0,children:u.jsx(g2,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Oe(e.onCloseAutoFocus,a=>{var i;a.preventDefault(),o.current||(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:Oe(e.onPointerDownOutside,a=>{const i=a.detail.originalEvent,l=i.button===0&&i.ctrlKey===!0,c=i.button===2||l;o.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:Oe(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),yA=m.forwardRef((e,t)=>{const n=Un(os,e.__scopePopover),r=m.useRef(!1),s=m.useRef(!1);return u.jsx(g2,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var a,i;(a=e.onCloseAutoFocus)==null||a.call(e,o),o.defaultPrevented||(r.current||(i=n.triggerRef.current)==null||i.focus(),o.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:o=>{var l,c;(l=e.onInteractOutside)==null||l.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=o.target;((c=n.triggerRef.current)==null?void 0:c.contains(a))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),g2=m.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:d,...f}=e,h=Un(os,n),p=mo(n);return xm(),u.jsx(Gc,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:o,children:u.jsx(Ya,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:d,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>h.onOpenChange(!1),children:u.jsx(Xg,{"data-state":v2(h.open),role:"dialog",id:h.contentId,...p,...f,ref:t,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),y2="PopoverClose",vA=m.forwardRef((e,t)=>
239{const{__scopePopover:n,...r}=e,s=Un(y2,n);return u.jsx(Be.button,{type:"button",...r,ref:t,onClick:Oe(e.onClick,()=>s.onOpenChange(!1))})});vA.displayName=y2;var bA="PopoverArrow",wA=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=mo(n);return u.jsx(Zg,{...s,...r,ref:t})});wA.displayName=bA;function v2(e){return e?"open":"closed"}var xA=u2,CA=h2,_A=p2,b2=m2;const mc=xA,gc=CA,Ba=m.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},s)=>u.jsx(_A,{children:u.jsx(b2,{ref:s,align:t,sideOffset:n,className:G("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));Ba.displayName=b2.displayName;const EA="https://littlechapters.app/download",SA=["/landing/Vector begin.svg","/landing/Vector-1.svg","/landing/Vector-2.svg","/landing/Vector-3.svg","/landing/Vector-4.svg","/landing/Vector-5.svg","/landing/Vector-6.svg","/landing/Vector end.svg"],AA=Array.from({length:8},(e,t)=>SA.map((n,r)=>({src:n,_key:`${t}-${r}`}))).flat(),NA=()=>{const{user:e,resolveUsername:t}=ge(),n=tt(),{t:r}=_e(),s=Au(),[o,a]=m.useState(!1),[i,l]=m.useState(!1),c=async()=>{if(e){const f=await t();n(f?`/${f}`:"/onboarding")}else n("/auth",{state:{from:{pathname:"/"},intent:"start_story",source:"hero_cta"}})},d=()=>{s?l(!0):c()};return u.jsxs(u.Fragment,{children:[u.jsx("section",{className:"min-h-screen lg:min-h-0 flex items-center relative overflow-hidden bg-lc-gradient",children:u.jsx("div",{className:"max-w-7xl mx-auto px-6 md:px-12 py-32 pt-40 lg:pb-16 relative z-10 w-full",children:u.jsxs("div",{className:"grid lg:grid-cols-[456fr_824fr] gap-12 lg:gap-0 items-center lg:items-start",children:[u.jsxs("div",{className:"flex flex-col gap-[32px] lg:pr-[80px] lc-animate-in",children:[u.jsx("h1",{className:"font-['Poppins',sans-serif] text-[40px] font-semibold text-[#333] leading-[1.2]",children:r("landing.hero.title")}),u.jsxs("div",{className:"flex flex-col gap-[20px]",children:[u.jsxs("div",{className:"font-['DM_Sans',sans-serif] font-normal text-[18px] text-[#111] leading-[1.5] whitespace-pre-wrap lc-animate-in lc-delay-2",children:[u.jsx("p",{children:r("landing.hero.body1")}),u.jsx("p",{className:"mt-4",children:r("landing.hero.body2")})]}),u.jsx("button",{onClick:d,className:"h-[48px] w-[257px] flex items-center justify-center bg-[#F1914A] cursor-pointer transition-transform hover:scale-[1.02] lc-animate-in lc-delay-3",children:u.jsx("span",{className:"font-['DM_Sans',sans-serif] font-medium text-[18px] text-white text-center leading-[1.3]",children:r("landing.hero.cta")})}),u.jsx("div",{className:"flex items-center gap-3 lc-animate-in lc-delay-4",children:s?u.jsxs("div",{className:"flex items-center gap-4",children:[u.jsx("span",{className:"font-['DM_Sans',sans-serif] text-[14px] text-[#666]",children:r("landing.footer.availableFor")}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("a",{href:or,target:"_blank",rel:"noopener noreferrer","aria-label":"Download on the App Store",onClick:()=>en({source:"hero_store_row",platform:"ios",placement:"mobile"}),children:u.jsx("img",{src:"/icons/apple-logo.svg",alt:"iOS",className:"w-5 h-5 opacity-60 hover:opacity-100 transition-opacity"})}),u.jsx("a",{href:tn,target:"_blank",rel:"noopener noreferrer","aria-label":"Get it on Google Play",onClick:()=>en({source:"hero_store_row",platform:"android",placement:"mobile"}),children:u.jsx("img",{src:"/icons/android-logo.svg",alt:"Android",className:"w-5 h-5 opacity-60 hover:opacity-100 transition-opacity"})})]})]}):u.jsxs(mc,{open:o,onOpenChange:a,children:[u.jsx(gc,{asChild:!0,children:u.jsxs("button",{className:"flex items-center gap-2 group cursor-pointer",children:[u.jsx(Ip,{className:"w-4 h-4 text-[#999] group-hover:text-[#F1914A] transition-colors"}),u.jsx("span",{className:"font-['DM_Sans',sans-serif] text-[14px] text-[#999] group-hover:text-[#F1914A] transition-colors underline underline-offset-2 decoration-dotted",children:r("landing.footer.availableFor")})]})}),u.jsxs(Ba,{className:"w-56 bg-[#E75E30] border-none rounded-2xl p-5 flex flex-col items-center text-center shadow-xl",sideOffset:8,align:"start",children:[u.jsx("p",{className:"font-sans text-sm font-semibold text-[#FFFEFB] mb-1",children:r("landing.footer.scanToDownload")}),u.jsx("p",{className:"font-sans text-[11px] text-[#F9D39A] mb-3",children:r("landing.footer.mobileOnlyDescription")}),u.jsx("div",{className:"bg-[#FFFEFB] rounded-xl p-3",children:u.jsx(Qs,{value:EA,size:120,level:"M",fgColor:"#E75E30",bgColor:"#FFFEFB"})}),u.jsxs("div",{className:"flex items-center gap-4 mt-3",children:[u.jsxs("a",{href:or,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 font-['DM_Sans',sans-serif] text-[12px] text-[#F9D39A] hover:text-[#FFFEFB] transition-colors",onClick:()=>en({source:"hero_qr_popover",platform:"ios",placement:"desktop"}),children:[u.jsx("img",{src:"/icons/apple-logo.svg",alt:"",className:"w-3.5 h-3.5"}),"iOS"]}),u.jsx("span",{className:"text-[#F9D39A]/40",children:"|"}),u.jsxs("a",{href:tn,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 font-['DM_Sans',sans-serif] text-[12px] text-[#F9D39A] hover:text-[#FFFEFB] transition-colors whitespace-nowrap",onClick:()=>en({source:"hero_qr_popover",platform:"android",placement:"desktop"}),children:[u.jsx("img",{src:"/icons/android-logo.svg",alt:"",className:"w-3.5 h-3.5"}),"Android"]})]})]})]})})]})]}),u.jsxs("div",{className:"relative min-w-0 lc-animate-in lc-delay-2",children:[u.jsx(sn,{variant:"card",color:"#111111",className:"relative overflow-hidden p-[10px]",children:u.jsx("div",{style:{backgroundColor:"#B3D9E0"},children:u.jsx("img",{src:"/landing/hero-book-mockup.webp",alt:"Little Chapters fotoboek",className:"w-full h-auto block",style:{transform:"scale(1.3) translateX(-5%)"},decoding:"async"})})}),u.jsx("div",{className:"absolute z-10 animate-gentle-float",style:{bottom:"-12%",right:"0%",width:"22%",transform:"rotate(5.3deg)"},children:u.jsx("img",{src:"/landing/phone-mockup.webp",alt:"Little Chapters app on phone",className:"w-full h-auto",loading:"lazy",decoding:"async",style:{filter:"drop-shadow(0 8px 24px rgba(0,0,0,0.15))"}})})]})]})})}),u.jsx("div",{className:"w-full overflow-hidden bg-lc-gradient",children:u.jsx("div",{className:"flex items-center",children:AA.map(f=>u.jsx("div",{className:"flex-shrink-0 flex items-center justify-center",style:{width:134,height:214,paddingTop:40,paddingBottom:40}
239,children:u.jsx("img",{src:f.src,alt:"",draggable:!1,className:"w-[55%] h-[55%] object-contain"})},f._key))})}),u.jsx(l2,{open:i,onClose:()=>l(!1),onContinueWeb:()=>{l(!1),c()}})]})};function nn({children:e,className:t="",direction:n="up",delay:r=0}){const s=m.useRef(null),o=n3(s,{once:!0,margin:"-80px"}),a={opacity:0,x:n==="left"?-60:n==="right"?60:0,y:n==="up"?40:0};return u.jsx(Mt.div,{ref:s,className:t,initial:a,animate:o?{opacity:1,x:0,y:0}:a,transition:{duration:.7,delay:r,ease:[.25,.1,.25,1]},children:e})}const PA="/landing/phone-screen-left.webp",kA="/landing/phone-screen-center.webp",IA="/landing/phone-screen-right.webp",RA=()=>{const{user:e,resolveUsername:t}=ge(),n=tt(),{t:r}=_e(),s=async()=>{if(e){const o=await t();n(o?`/${o}`:"/onboarding")}else n("/auth",{state:{from:{pathname:"/"},intent:"get_started",source:"empathy_cta"}})};return u.jsx("section",{className:"py-20 bg-lc-cream",children:u.jsx("div",{className:"max-w-[1280px] mx-auto px-6 md:px-[80px]",children:u.jsxs("div",{className:"flex flex-col-reverse lg:flex-row items-center gap-[80px]",children:[u.jsx(nn,{direction:"left",className:"flex-shrink-0 w-full lg:w-[688px]",children:u.jsx(sn,{variant:"card",color:"#111111",className:"relative overflow-hidden p-[10px]",children:u.jsxs("div",{className:"relative overflow-hidden flex items-center justify-center w-full h-[420px] lg:h-[514px]",style:{backgroundColor:"#8CC2A1"},children:[u.jsx("img",{src:kA,alt:"",className:"flex-shrink-0 w-[45%] lg:w-[30.2%] object-contain relative z-2",style:{minWidth:"160px",height:"85%"}}),u.jsx("img",{src:PA,alt:"",className:"absolute hidden lg:block object-contain",style:{left:"2.3%",top:"25%",width:"30.2%",minWidth:"140px",height:"85%",zIndex:1}}),u.jsx("img",{src:IA,alt:"",className:"absolute hidden lg:block object-contain",style:{left:"67.5%",top:"25%",width:"30.2%",minWidth:"140px",height:"85%",zIndex:1}})]})})}),u.jsxs("div",{className:"flex flex-col gap-6 lg:w-[512px]",children:[u.jsx(nn,{direction:"right",children:u.jsx("h2",{className:"font-semibold text-[#333] leading-[1.2]",style:{fontFamily:"'Poppins', sans-serif",fontSize:"32px"},children:r("landing.empathy.title")})}),u.jsx(nn,{direction:"right",delay:.15,children:u.jsxs("div",{className:"flex flex-col gap-10",children:[u.jsxs("p",{style:{fontFamily:"'DM Sans', sans-serif",fontSize:"18px",lineHeight:1.5,color:"#111"},children:[r("landing.empathy.body1")," ",r("landing.empathy.body2")]}),u.jsx(sn,{as:"button",onClick:s,className:"flex items-center justify-center w-fit px-6 py-3",children:u.jsx("span",{style:{fontFamily:"'DM Sans', sans-serif",fontWeight:500,fontSize:"16px",color:"#111"},children:r("landing.empathy.cta")})})]})})]})]})})})},TA="/images/landing/stap1.webp",OA="/images/landing/stap2.webp",jA="/images/landing/stap3.webp",LA="/images/landing/stap4.webp",MA="/icons/calendar-streamline.svg",DA="/icons/nav-family.svg",FA="/icons/boek.svg",UA=[TA,OA,jA,LA],BA=[u.jsx("img",{src:"/icons/nav-boekenkast.svg",alt:"",className:"w-6 h-6"}),u.jsx("img",{src:MA,alt:"",className:"w-6 h-6"}),u.jsx("img",{src:DA,alt:"",className:"w-6 h-6"}),u.jsx("img",{src:FA,alt:"",className:"w-6 h-6"})],$A=["step1","step2","step3","step4"],zA=()=>{const{t:e}=_e();return u.jsx("section",{id:"hoe-werkt-het",className:"py-20 bg-lc-cream",children:u.jsxs("div",{className:"max-w-[1280px] mx-auto px-6 md:px-[80px]",children:[u.jsx(nn,{children:u.jsx("h2",{className:"font-['Poppins',sans-serif] font-semibold text-[32px] text-[#333] text-center leading-none mb-10",children:e("landing.howItWorks.title")})}),u.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-4 gap-4 md:gap-6",children:$A.map((t,n)=>u.jsx(nn,{delay:n*.1,children:u.jsxs("div",{className:"flex flex-col h-full",children:[u.jsx("div",{className:"h-[200px] overflow-hidden flex-shrink-0",children:u.jsx("img",{src:UA[n],alt:e(`landing.howItWorks.${t}.title`),className:"w-full h-full object-cover"})}),u.jsxs("div",{className:"flex-1 flex flex-col gap-6 bg-[#F9D39A] p-6",children:[u.jsxs("div",{className:"flex items-center gap-2.5",children:[BA[n],u.jsx("span",{className:"text-[18px] font-bold text-[#111] leading-none",style:{fontFamily:"'DM Sans', sans-serif"},children:e(`landing.howItWorks.${t}.label`)})]}),u.jsxs("div",{className:"flex flex-col gap-2",children:[u.jsx("h3",{className:"text-[24px] text-[#111] uppercase leading-none",style:{fontFamily:"'Froople', sans-serif",letterSpacing:"0.96px"},children:e(`landing.howItWorks.${t}.title`)}),u.jsx("p",{className:"font-['Poppins',sans-serif] text-[16px] text-[#111] leading-[1.2]",children:e(`landing.howItWorks.${t}.description`)})]})]})]})},t))})]})})},VA="/landing/Vector-3.svg",HA="/landing/Vector-4.svg",WA="/landing/Vector-1.svg",qA="/landing/Vector-5.svg",GA=()=>{const{t:e,i18n:t}=_e(),n=tt(),r=Nu(t.language);return u.jsxs("section",{className:"relative overflow-hidden py-20 md:py-24",style:{backgroundColor:"#B2D9E0"},children:[u.jsx(Mt.div,{className:"absolute -left-8 -top-4 w-[180px] h-[180px] md:w-[289px] md:h-[289px] rotate-90 pointer-events-none select-none",animate:{y:[0,-16,0],rotate:[90,100,90]},transition:{duration:7,repeat:1/0,ease:"easeInOut"},children:u.jsx("img",{src:VA,alt:"",className:"w-full h-full object-contain"})}),u.jsx(Mt.div,{className:"absolute -right-4 -top-10 w-[180px] h-[180px] md:w-[300px] md:h-[303px] pointer-events-none select-none",animate:{y:[0,-12,0],scale:[1,1.06,1]},transition:{duration:6,repeat:1/0,ease:"easeInOut",delay:1},children:u.jsx("img",{src:WA,alt:"",className:"w-full h-full object-contain"})}),u.jsx(Mt.div,{className:"absolute left-[14%] -bottom-4 w-[180px] h-[150px] md:w-[246px] md:h-[202px] pointer-events-none select-none hidden sm:block",animate:{y:[0,-10,0],rotate:[0,8,0]},transition:{duration:8,repeat:1/0,ease:"easeInOut",delay:.5},children:u.jsx("img",{src:HA,alt:"",className:"w-full h-full object-contain"})}),u.jsx(Mt.div,{className:"absolute right-[4%] -bottom-4 w-[170px] h-[160px] md:w-[238px] md:h-[201px] pointer-events-none select-none hidden sm:block",animate:{y:[0,-14,0],rotate:[-138,-128,-138]},transition:{duration:6,repeat:1/0,ease:"easeInOut",delay:2},children:u.jsx("img",{src:qA,alt:"",className:"w-full h-full object-contain"})}),u.jsxs("div",{className:"relative z-10 max-w-[700px] mx-auto px-6 text-center flex flex-col items-center gap-10",children:[u.jsx(nn,{children:u.jsxs("div",{className:"flex flex-col gap-4",children:[u.jsx("h2",{className:"font-sans font-semibold text-3xl md:text-[36px] leading-[1.3] text-[#333333]",children:e("landing.highlight.title")}),u.jsx("p",{className:"font-sans font-medium text-xl md:text-[24px] leading-[1.5] text-[#111111]",children:e("landing.highlight.subtitle")})]})}),u.jsx(nn,{delay:.2,children:u.jsx(sn,{as:"button",variant:"button",color:"#111111",className:"px-8 py-3 font-sans font-semibold text-[20px] text-[#111111] whitespace-nowrap cursor-pointer hover:opacity-70 transition-opacity duration-200",onClick:()=>n(r),children:e("landing.highlight.cta")})})]})]})},KA=()=>{const{t:e}=_e(),t=e("landing.testimonials.items",{returnObjects:!0});return u.jsx("section",{className:"py-28 md:py-32 bg-lc-cream overflow-hidden",children:u.jsxs("div",{className:"max-w-7xl mx-auto px-6 md:px-12 lg:px-20",children:[u.jsx(nn,{className:"text-center mb-10",children:u.jsx("h2",{className:"font-['Poppins',sans-serif] text-[28px] md:text-[40px] font-semibold text-[#333] leading-none",children:e("landing.testimonials.title")})}),u.jsx("div",{className:"flex gap-6 overflow-x-auto pb-4 -mx-6 px-6 md:-mx-12 md:px-12 lg:-mx-20 lg:px-20 scrollbar-hide",children:t.map((n,r)=>u.jsx(nn,{delay:r*.1,children:u.jsx(sn,{variant:"card",color:"#111111",className:"shrink-0 w-[277px]",children:u.jsxs("div",{className:"relative z-10 flex flex-col gap-4 p-6",children:[u.jsx("img",{src:"/icons/quote-marks.svg",alt:"",className:"w-[19px] h-[14px]","aria-hidden":"true"}),u.jsx("p",{className:"font-['Poppins',sans-serif] text-[16px] text-[#111] leading-[1.2] line-clamp-5",children:n.quote}),u.jsx("p",{className:"font-froople text-[24px] text-[#111] uppercase tracking-[0.96px] leading-none",children:n.author})]})})},r))})]})})},QA=()=>{const{user:e,resolveUsername:t}=ge(),n=tt(),r=He(),{t:s,i18n:o}=_e(),a=Nu(o.language),i=Au(),[l,c]=m.useState(null),d=[{title:s("landing.footer.product"),links:[{label:s("landing.footer.howItWorks"),href:"#hoe-werkt-het"},{label:s("landing.footer.yearbook"),href:a},{label:s("landing.footer.plus"),href:"/plus"},{label:s("giftCardPage.linkLabel"),href:"/kraamcadeau"},{label:s("landing.footer.faq"),href:"/support"}]},{title:s("landing.footer.company"),links:[{label:s("landing.footer.aboutUs"),href:"/about"},{label:s("landing.footer.contact"),href:"/contact"},{label:s("landing.footer.influencers"),href:"/influencers"}]},{title:s("landing.footer.legal"),links:[{label:s("landing.footer.privacy"),href:"/privacy-policy"},{label:s("landing.footer.terms"),href:"/voorwaarden"},{label:s("landing.footer.security"),href:"/security"}]}],f=p=>{var g;if(p.startsWith("#")){const y=p.slice(1);r.pathname==="/"?(g=document.getElementById(y))==null||g.scrollIntoView({behavior:"smooth"}):n(`/?scroll=${y}`)}},h=async()=>
239{if(e){const p=await t();n(`/${p}`)}else n("/auth",{state:{from:{pathname:"/"},intent:"start_story",source:"footer_cta"}})};return u.jsxs("footer",{className:"bg-[#E75E30] text-[#FFFEFB] relative overflow-hidden",children:[u.jsx("div",{className:"max-w-7xl mx-auto px-6 md:px-12 lg:px-20 pt-16 md:pt-20",children:u.jsxs("div",{className:"flex flex-col lg:flex-row justify-between gap-12 lg:gap-16 mb-16",children:[u.jsx("div",{className:"grid grid-cols-2 md:flex md:flex-wrap gap-8 md:gap-9",children:d.map((p,g)=>u.jsxs("div",{className:"md:w-[171px]",children:[u.jsx("p",{className:"font-froople text-[21px] text-[#FFFEFB] mb-3",children:p.title}),u.jsx("div",{className:"flex flex-col gap-[9px]",children:p.links.map((y,v)=>y.href.startsWith("/")?u.jsx(j2,{to:y.href,className:"font-sans text-[18px] text-[#FFFEFB] underline hover:text-[#F9D39A] transition-colors",children:y.label},v):u.jsx("button",{onClick:()=>f(y.href),className:"font-sans text-[18px] text-[#FFFEFB] underline hover:text-[#F9D39A] transition-colors text-left",children:y.label},v))})]},g))}),u.jsxs("div",{className:"flex flex-col items-start lg:items-end gap-6",children:[u.jsxs("h2",{className:"font-['Poppins',sans-serif] text-[28px] md:text-[38px] font-semibold leading-[1.2] lg:text-right max-w-[454px]",children:["They say it's a phase.",u.jsx("br",{}),"We say it's a"," ",u.jsx("span",{className:"italic text-[#F9D39A]",children:"story"}),"."]}),u.jsxs("div",{className:"flex flex-col items-start lg:items-end gap-2",children:[u.jsx(sn,{as:"button",variant:"button",color:"#FFFEFB",className:"h-12 px-6 flex items-center justify-center hover:bg-[#FFFEFB]/10 transition-colors",onClick:h,children:u.jsx("span",{className:"relative z-10 font-sans font-medium text-[16px] text-[#FFFEFB] whitespace-nowrap leading-[1.3]",children:s("landing.footer.cta")})}),u.jsxs("div",{className:"flex flex-col items-start lg:items-end gap-1",children:[u.jsx("p",{className:"font-sans text-[14px] text-[#F9D39A] leading-[1.5]",children:s("landing.footer.availableFor")}),u.jsx("div",{className:"flex gap-2 items-center",children:i?u.jsxs(u.Fragment,{children:[u.jsx("a",{href:or,target:"_blank",rel:"noopener noreferrer","aria-label":"Download on the App Store",onClick:()=>en({source:"footer_store_row",platform:"ios",placement:"mobile"}),children:u.jsx("img",{src:"/icons/apple-logo.svg",alt:"iOS",className:"w-4 h-4 hover:opacity-80 transition-opacity"})}),u.jsx("a",{href:tn,target:"_blank",rel:"noopener noreferrer","aria-label":"Get it on Google Play",onClick:()=>en({source:"footer_store_row",platform:"android",placement:"mobile"}),children:u.jsx("img",{src:"/icons/android-logo.svg",alt:"Android",className:"w-4 h-4 hover:opacity-80 transition-opacity"})})]}):u.jsxs(u.Fragment,{children:[u.jsxs(mc,{open:l==="apple",onOpenChange:p=>c(p?"apple":null),children:[u.jsx(gc,{asChild:!0,children:u.jsx("button",{"aria-label":"Download on the App Store",className:"cursor-pointer",children:u.jsx("img",{src:"/icons/apple-logo.svg",alt:"iOS",className:"w-4 h-4 hover:opacity-80 transition-opacity"})})}),u.jsxs(Ba,{className:"w-56 bg-[#E75E30] border-none rounded-2xl p-5 flex flex-col items-center text-center shadow-xl",sideOffset:8,children:[u.jsx("p",{className:"font-sans text-sm font-semibold text-[#FFFEFB] mb-1",children:s("landing.footer.scanToDownload")}),u.jsx("p",{className:"font-sans text-[11px] text-[#F9D39A] mb-3",children:s("landing.footer.mobileOnlyDescription")}),u.jsx("div",{className:"bg-[#FFFEFB] rounded-xl p-3",children:u.jsx(Qs,{value:or,size:120,level:"M",fgColor:"#E75E30",bgColor:"#FFFEFB"})}),u.jsx("a",{href:or,target:"_blank",rel:"noopener noreferrer",className:"font-sans text-[11px] text-[#F9D39A] underline hover:text-[#FFFEFB] transition-colors mt-3",onClick:()=>en({source:"footer_qr_popover",platform:"ios",placement:"desktop"}),children:s("landing.footer.visitAppStore")})]})]}),u.jsxs(mc,{open:l==="google",onOpenChange:p=>c(p?"google":null),children:[u.jsx(gc,{asChild:!0,children:u.jsx("button",{"aria-label":"Get it on Google Play",className:"cursor-pointer",children:u.jsx("img",{src:"/icons/android-logo.svg",alt:"Android",className:"w-4 h-4 hover:opacity-80 transition-opacity"})})}),u.jsxs(Ba,{className:"w-56 bg-[#E75E30] border-none rounded-2xl p-5 flex flex-col items-center text-center shadow-xl",sideOffset:8,children:[u.jsx("p",{className:"font-sans text-sm font-semibold text-[#FFFEFB] mb-1",children:s("landing.footer.scanToDownload")}),u.jsx("p",{className:"font-sans text-[11px] text-[#F9D39A] mb-3",children:s("landing.footer.mobileOnlyDescription")}),u.jsx("div",{className:"bg-[#FFFEFB] rounded-xl p-3",children:u.jsx(Qs,{value:tn,size:120,level:"M",fgColor:"#E75E30",bgColor:"#FFFEFB"})}),u.jsx("a",{href:tn,target:"_blank",rel:"noopener noreferrer",className:"font-sans text-[11px] text-[#F9D39A] underline hover:text-[#FFFEFB] transition-colors mt-3",onClick:()=>en({source:"footer_qr_popover",platform:"android",placement:"desktop"}),children:s("landing.footer.visitPlayStore")})]})]})]})})]})]})]})]})}),u.jsx("div",{className:"w-full pb-8 flex justify-center px-6 md:px-12 lg:px-0",children:u.jsx("img",{src:"/footer-logo-large.svg",alt:"Little Chapters",className:"w-full max-w-[1383px] h-auto"})})]})},YA=["sheet","settings","campaign","modal","quickPhoto"];function e1(){const e=He(),t=tt(),{session:n,loading:r,resolveUsername:s}=ge(),o=YA.some(a=>new URLSearchParams(e.search).has(a));return m.useEffect(()=>{if(!o||r||!n)return;let a=!1;return(async()=>{const i=await s();a||!i||t(`/${i}${e.search}${e.hash}`,{replace:!0})})(),()=>{a=!0}},[o,r,n,s,t,e.search,e.hash]),m.useEffect(()=>{const i=new URLSearchParams(e.search).get("scroll");
239if(i){const l=document.getElementById(i);l&&l.scrollIntoView({behavior:"smooth"})}},[e.search]),u.jsxs("div",{className:"min-h-screen font-sans overflow-hidden relative",style:{background:"linear-gradient(180deg, #FDF8F3 0%, #F9F1E8 50%, #FDF8F3 100%)"},children:[u.jsx("div",{className:"lc-texture-overlay"}),u.jsx(sA,{}),u.jsx(NA,{}),u.jsx(zA,{}),u.jsx(RA,{}),u.jsx(GA,{}),u.jsx(KA,{}),u.jsx(QA,{})]})}const $o=Z(()=>B(()=>import("./Home_BIlZ7US9.js").then(e=>e.H),__vite__mapDeps([24,1,25,26,27,28,29,30,4,31,32,33,34,35,36,37,38,39,40,41,42]))),XA=Z(()=>B(()=>import("./OnboardingRedirect_D0EJ9qj0.js"),__vite__mapDeps([43,1,2,3,4]))),ZA=Z(()=>B(()=>import("./NotFound_Cci1WwuO.js"),__vite__mapDeps([44,1]))),JA=Z(()=>B(()=>import("./Auth_CI1kXNaK.js"),__vite__mapDeps([45,1,46,47,48,49,2,3,4]))),eN=Z(()=>B(()=>import("./AuthCallback_C0AgRxVh.js"),__vite__mapDeps([50,1,2,3,4]))),tN=Z(()=>B(()=>import("./CheckEmail_DrcXFNoL.js"),__vite__mapDeps([51,1,48,49,2,3,4]))),t1=Z(()=>B(()=>import("./InviteAccept_Cu5cIdam.js"),__vite__mapDeps([52,1,53,48,54,32,55,37,35,56,2,3,4]))),n1=Z(()=>B(()=>import("./PhotobookEditor_DEPWFFxS.js"),__vite__mapDeps([57,1,58,59,60,61,62,63,30,64,28,65,66,67,4,68,31,69,70,71,36,72,73,74,75,34,35,76,77,78,79,80,25,81,41,26,82,83,2,3]))),nN=Z(()=>B(()=>import("./CalendarEditor_BeW_9hom.js"),__vite__mapDeps([84,1,25,61,62,58,59,63,30,64,28,65,66,67,4,68,31,69,70,71,36,72,73,74,75,34,35,60,76,77,78,79,85,86,29,82,2,3]))),rN=Z(()=>B(()=>import("./CalendarCheckout_q5sm4Wr8.js"),__vite__mapDeps([87,1,25,85,86,58,59,63,29,30,78,60,70,31,2,3,4]))),sN=Z(()=>B(()=>import("./BookSelectionScreen_BCd2liNS.js"),__vite__mapDeps([88,1,25,27,89,31,2,3,4]))),oN=Z(()=>B(()=>import("./DesignLibraryScreen_DCT4rBe4.js"),__vite__mapDeps([90,1,25,91,58,59,64,4,82,86,63,29,30,27,92,2,3]))),aN=u.jsx("div",{className:"min-h-screen",style:{background:"linear-gradient(180deg, #FDF8F3 0%, #F9F1E8 55%, #FDF8F3 100%)"}}),iN=Z(()=>B(()=>import("./CheckoutPreview_KSsgOThd.js"),__vite__mapDeps([93,1,62,58,59,63,30,25,94,95,78,26,96,60,97,76,98,99,2,3,4]))),lN=Z(()=>B(()=>import("./CheckoutBookSelection_DoXCeRyf.js"),__vite__mapDeps([100,1,25,78,58,59,97,60,74,75,4,34,35,33,101,69,2,3]))),cN=Z(()=>B(()=>import("./CheckoutSummary_GSZ-J91U.js"),__vite__mapDeps([102,1,25,78,58,59,97,60,96,91,64,4,103,39,2,3,104,34,33,70,31,98,105]))),uN=Z(()=>B(()=>import("./CheckoutSuccess_P86Mg9k-.js"),__vite__mapDeps([106,1,60,78,58,59,91,64,4,104,107,33,2,3]))),r1=Z(()=>B(()=>import("./NativeLanding_CG5nC1qx.js"),__vite__mapDeps([108,1,2,3,4]))),s1=Z(()=>B(()=>import("./ExpectingLanding_BAQ0NqNb.js"),__vite__mapDeps([109,1,2,3,4]))),dN=Z(()=>B(()=>import("./PrivacyPolicy_BnJlnv6m.js"),__vite__mapDeps([110,1,4,2,3]))),o1=Z(()=>B(()=>import("./Terms_RtkxDopB.js"),__vite__mapDeps([111,1,4,2,3]))),fN=Z(()=>B(()=>import("./DeleteAccountRequest_CjMxJMgI.js"),__vite__mapDeps([112,1,47,48,113,2,3,4]))),hN=Z(()=>B(()=>import("./WinbackWhy_CLs6rxb_.js"),__vite__mapDeps([114,1,2,3,4]))),pN=Z(()=>B(()=>import("./EmailUnsubscribe_DfRAkBxT.js"),__vite__mapDeps([115,1,2,3,4]))),mN=Z(()=>B(()=>import("./Support_DuApj4SA.js"),__vite__mapDeps([116,1,17,18,49,2,3,4]))),gN=Z(()=>B(()=>import("./Beveiliging_4-CzGwyH.js"),__vite__mapDeps([117,1,17,18,2,3,4]))),yN=Z(()=>B(()=>import("./Influencers_CdajvZky.js"),__vite__mapDeps([118,1,17,18,2,3,4]))),vN=Z(()=>B(()=>import("./Contact_C2VwRJR_.js"),__vite__mapDeps([119,1,2,3,4]))),a1=Z(()=>B(()=>import("./AboutUs_BL4dFLy_.js"),__vite__mapDeps([120,1,4,2,3]))),Zi=Z(()=>B(()=>import("./Yearbook_BLXayZlx.js"),__vite__mapDeps([121,1,17,18,83,60,4,2,3])));Z(()=>B(()=>import("./GiftCardLanding_5A3dwTEd.js"),__vite__mapDeps([122,1,123,124,125,2,3,4])));const bN=Z(()=>B(()=>import("./CadeaubonShapes_DLoTeOS7.js"),__vite__mapDeps([126,1,123,124,125,2,3,4,127]))),wN=Z(()=>B(()=>import("./GiftCardThanks_Cj4--OsW.js"),__vite__mapDeps([128,1,129,123,125,130,2,3,4,131]))),xN=Z(()=>B(()=>import("./GiftCardPrintCard_BV1y0A2K.js"),__vite__mapDeps([132,1,129,123,125,130,2,3,4]))),CN=Z(()=>B(()=>import("./GiftCardContribute_DXf6eiCI.js"),__vite__mapDeps([130,1,125,2,3,4]))),_N=Z(()=>B(()=>import("./GiftCardContributeThanks_BPU9VXXN.js"),__vite__mapDeps([133,1,131,125,130,2,3,4]))),i1=Z(()=>B(()=>import("./GiftCardRedeemInfo_C0ma96rk.js"),__vite__mapDeps([134,1,2,3,4]))),EN=Z(()=>B(()=>import("./Plus_By6paUpx.js"),__vite__mapDeps([16,1,17,18,4,2,3]))),SN=Z(()=>B(()=>import("./Download_FFV4Mx2r.js"),__vite__mapDeps([135,1,2,3,4]))),AN=Z(()=>B(()=>import("./AdminDashboard_BncUEfAQ.js").then(e=>e.A),__vite__mapDeps([136,1,137,35,36,32,76,33,138,49,48,18,66,56,139,140,101,81,99,39,98,40,141,34,69,113,31]))),NN=Z(()=>B(()=>import("./ShareImport_u4xr_dTD.js"),__vite__mapDeps([142,1,25,68,4,26,27,143,41,92,29,30,39,2,3]))),l1=Z(()=>B(()=>import("./Links_BtdhuhfM.js"),__vite__mapDeps([144,1,4,145,2,3]))),PN=new F3({defaultOptions:{queries:{gcTime:24*60*60*1e3}}}),bn=j.isNativePlatform(),kN=u.jsx("div",{className:"min-h-screen bg-[#FCF6E8]","aria-hidden":"true"}),IN=bn?kN:u.jsx(fa,{}),RN=1500,TN=({children:e})=>{const[t,n]=m.useState(!1);return m.useEffect(()=>{const r=window.setTimeout(()=>n(!0),RN);return()=>window.clearTimeout(r)},[]),t?u.jsx(u.Fragment,{children:e}):null},ON=Z2(M2),jN=()=>{const{user:e}=ge(),t=tt();return m.useEffect(()=>{e!=null&&e.id&&(lw(),be("push_initializer_authenticated",{user_id:e.id}))},[e==null?void 0:e.id]),B_(e==null?void 0:e.id,(n,r)=>{OC(r.campaign_id,r),be("push_initializer_navigate",{route:n.route,params:n.params??null,campaign_id:r.campaign_id??null}),t(n.route)}),null},LN=()=>{const e=tt(),t=He(),n=m.useRef(t.pathname);return n.current=t.pathname,m.useEffect(()=>{xw().then(r=>{r&&!n.current.startsWith("/invite")&&e(`/invite/${r}`,{replace:!0})})},[e]),null},MN=()=>{const{user:e}=ge(),t=He();return V_(e==null?void 0:e.id,t.pathname),null},DN=()=>{const{user:e,loading:t}=ge();return m.useEffect(()=>{t||o7((e==null?void 0:e.id)??null)},[e==null?void 0:e.id,t]),null},FN=()=>(eE(),null),UN=()=>{const{user:e}=ge();return sE(e==null?void 0:e.id),null},BN=()=>{const{user:e,loading:t}=ge();return oE(e==null?void 0:e.id,t),null},$N=()=>{const{connected:e}=Ha();return m.useEffect(()=>{zs.setOnline(e)},[e]),null},zN=()=>(m.useEffect(()=>{if(!j.isNativePlatform())return;let e=!1,t=null;return Ge.addListener("appStateChange",({isActive:n})=>{ao.setFocused(n)}).then(n=>{e?n.remove():t=n}),()=>{e=!0,t&&t.remove()}},[]),null),VN=()=>(m.useEffect(()=>{if(!j.isNativePlatform())return;let e=null,t=!1;Ge.addListener("appStateChange",({isActive:r})=>{r||ic()}).then(r=>{if(t){r.remove();return}e=r}).catch(()=>{});const n=()=>{document.visibilityState==="hidden"&&ic()};
239return document.addEventListener("visibilitychange",n),()=>{t=!0,document.removeEventListener("visibilitychange",n),e&&e.remove()}},[]),null),HN=()=>{const e=He();return m.useEffect(()=>{is(e.pathname)||O6()},[e.pathname,e.search]),null},WN=()=>{const e=He();return m.useEffect(()=>{F6(e.pathname+e.search)},[e.pathname,e.search]),null},qN=()=>{const e=He();return m.useEffect(()=>{is(e.pathname)||rv()},[e.pathname,e.search]),null},GN=()=>(m.useEffect(()=>{Uh();const{data:e}=z.auth.onAuthStateChange(t=>{t==="SIGNED_IN"&&Uh()});return()=>{e.subscription.unsubscribe()}},[]),null),KN=()=>{const e=He();return m.useEffect(()=>{be("route_changed",{pathname:e.pathname,search:e.search,hash:e.hash})},[e.pathname,e.search,e.hash]),null},QN=30*60*1e3,YN=()=>(m.useEffect(()=>{if(!j.isNativePlatform())return;let e=Date.now();ka();let t=!1,n=null;return Ge.addListener("appStateChange",({isActive:r})=>{r&&(Date.now()-e<QN||(e=Date.now(),ka()))}).then(r=>{t?r.remove():n=r}),()=>{t=!0,n&&n.remove()}},[]),null),XN=()=>{const e=He(),{t}=_e(),{connected:n}=Ha(),r=m.useRef(e.pathname+e.search);m.useEffect(()=>{n&&(r.current=e.pathname+e.search)},[n,e.pathname,e.search]);const s=e.pathname+e.search,o=!n&&s!==r.current,a=t("shareImport.loadingTitle"),i=e.pathname==="/share-import"?u.jsx(fa,{title:a}):IN;return!bn&&o?u.jsx(fa,{}):u.jsx(u.Fragment,{children:u.jsx(m.Suspense,{fallback:i,children:u.jsxs(ON,{location:e,children:[u.jsx(V,{path:"/",element:bn?u.jsx(r1,{}):u.jsx(e1,{})}),u.jsx(V,{path:"/landing",element:u.jsx(e1,{})}),u.jsx(V,{path:"/expecting",element:u.jsx(s1,{})}),u.jsx(V,{path:"/zwanger",element:u.jsx(s1,{})}),u.jsx(V,{path:"/privacy-policy",element:u.jsx(dN,{})}),u.jsx(V,{path:"/voorwaarden",element:u.jsx(o1,{})}),u.jsx(V,{path:"/terms",element:u.jsx(o1,{})}),u.jsx(V,{path:"/support",element:u.jsx(mN,{})}),u.jsx(V,{path:"/security",element:u.jsx(gN,{})}),u.jsx(V,{path:"/influencers",element:u.jsx(yN,{})}),u.jsx(V,{path:"/contact",element:u.jsx(vN,{})}),u.jsx(V,{path:"/about",element:u.jsx(a1,{})}),u.jsx(V,{path:"/over-ons",element:u.jsx(a1,{})}),u.jsx(V,{path:"/jaarboeken",element:bn?u.jsx(lt,{to:"/photobook/select",replace:!0}):u.jsx(Zi,{})}),u.jsx(V,{path:"/fotoboek",element:bn?u.jsx(lt,{to:"/photobook/select",replace:!0}):u.jsx(Zi,{})}),u.jsx(V,{path:"/photo-book",element:bn?u.jsx(lt,{to:"/photobook/select",replace:!0}):u.jsx(Zi,{})}),u.jsx(V,{path:"/photobook",element:u.jsx(lt,{to:"/photobook/select",replace:!0})}),u.jsx(V,{path:"/kraamcadeau",element:bn?u.jsx(lt,{to:"/",replace:!0}):u.jsx(bN,{})}),u.jsx(V,{path:"/cadeaubon",element:bn?u.jsx(lt,{to:"/",replace:!0}):u.jsx(lt,{to:"/kraamcadeau",replace:!0})}),!1,u.jsx(V,{path:"/cadeaubon/bedankt",element:u.jsx(wN,{})}),u.jsx(V,{path:"/cadeaubon/kaart",element:u.jsx(xN,{})}),u.jsx(V,{path:"/geef/:token",element:u.jsx(CN,{})}),u.jsx(V,{path:"/geef/:token/bedankt",element:u.jsx(_N,{})}),u.jsx(V,{path:"/cadeau",element:u.jsx(i1,{})}),u.jsx(V,{path:"/cadeau/:code",element:u.jsx(i1,{})}),u.jsx(V,{path:"/plus",element:u.jsx(EN,{})}),u.jsx(V,{path:"/plus/:code",element:u.jsx(Tw,{})}),u.jsx(V,{path:"/links",element:u.jsx(l1,{})}),u.jsx(V,{path:"/moekes",element:u.jsx(l1,{})}),u.jsx(V,{path:"/download",element:u.jsx(SN,{})}),u.jsx(V,{path:"/delete-account",element:u.jsx(fN,{})}),u.jsx(V,{path:"/waarom",element:u.jsx(hN,{})}),u.jsx(V,{path:"/afmelden",element:u.jsx(pN,{})}),u.jsx(V,{path:"/auth",element:u.jsx(JA,{})}),u.jsx(V,{path:"/auth/callback",element:u.jsx(eN,{})}),u.jsx(V,{path:"/check-email",element:u.jsx(tN,{})}),u.jsx(V,{path:"/native-landing",element:u.jsx(r1,{})}),u.jsx(V,{path:"/onboarding",element:u.jsx(XA,{})}),u.jsx(V,{path:"/share-import",element:u.jsx(it,{loadingTitle:a,children:u.jsx(NN,{})})}),!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,u.jsx(V,{path:"/home",element:u.jsx(lt,{to:"/",replace:!0})}),u.jsx(V,{path:"/settings",element:u.jsx(lt,{to:"/",replace:!0})}),u.jsx(V,{path:"/photobook/select",element:u.jsx(it,{children:u.jsx(sN,{})})}),u.jsx(V,{path:"/photobook/designs/:storybookId",element:u.jsx(it,{children:u.jsx(m.Suspense,{fallback:aN,children:u.jsx(oN,{})})})}),u.jsx(V,{path:"/photobook/editor/:storybookId",element:u.jsx(it,{children:u.jsx(n1,{})})}),u.jsx(V,{path:"/photobook/editor/:storybookId/:photobookId",element:u.jsx(it,{children:u.jsx(n1,{})})}),pc.calendar&&u.jsxs(u.Fragment,{children:[u.jsx(V,{path:"/calendar/editor/:year",element:u.jsx(it,{children:u.jsx(nN,{})})}),u.jsx(V,{path:"/calendar/checkout/:year",element:u.jsx(it,{children:u.jsx(rN,{})})})]}),u.jsx(V,{path:"/photobook/checkout/:storybookId/preview",element:u.jsx(it,{children:u.jsx(iN,{})})}),u.jsx(V,{path:"/photobook/checkout/:storybookId",element:u.jsx(it,{children:u.jsx(lN,{})})}),u.jsx(V,{path:"/photobook/checkout/:storybookId/summary",element:u.jsx(it,{children:u.jsx(cN,{})})}),u.jsx(V,{path:"/photobook/success",element:u.jsx(it,{children:u.jsx(uN,{})})}),u.jsx(V,{path:"/photobook/:childId/:year",element:u.jsx(lt,{to:"/photobook/select",replace:!0})}),u.jsx(V,{path:"/admin",element:u.jsx(it,{children:u.jsx(Fx,{children:u.jsx(AN,{})})})}),u.jsx(V,{path:"/invite",element:u.jsx(t1,{})}),u.jsx(V,{path:"/invite/:token",element:u.jsx(t1,{})}),u.jsx(V,{path:"/profile/:username",element:u.jsx(Po,{children:u.jsx($o,{})})}),u.jsx(V,{path:"/u/:username",element:u.jsx(Po,{children:u.jsx($o,{})})}),u.jsx(V,{path:":username/:shareToken",element:u.jsx(Po,{children:u.jsx($o,{})})}),u.jsx(V,{path:":username",element:u.jsx(Po,{children:u.jsx($o,{})})}),u.jsx(V,{path:"*",element:u.jsx(ZA,{})})]})})})},ZN=()=>(m.useEffect(()=>{lr("Rendered app-level crash fallback",{pathname:window.location.pathname},"ui.crash")},[]),u.jsx("div",{className:"min-h-screen bg-lc-cream px-6 py-12 flex items-center justify-center",children:u.jsxs("div",{className:"max-w-md text-center space-y-4",children:[u.jsx("h1",{className:"font-poppins text-2xl font-semibold text-[#111]",children:"Something went wrong"}),u.jsx("p",{className:"font-sans text-sm text-[#111]/70",children:"We logged the problem so it is easier to investigate. Reloading usually gets you back on track."}),u.jsx("button",{type:"button",onClick:()=>window.location.reload(),className:"inline-flex items-center justify-center bg-[#F1914A] px-4 py-2 font-sans text-sm font-semibold text-white transition-colors hover:bg-[#df7d35]",children:"Reload app"})]})})),JN=({children:e})=>u.jsx(t5,{client:PN,persistOptions:{persister:Q1,maxAge:K5,buster:Q5,dehydrateOptions:{shouldDehydrateQuery:t=>t.state.status==="success"&&t.queryKey[0]!=="cloudflare-signed-image"}},children:u.jsx(nA,{children:e})}),eP=()=>u.jsx(H7,{children:u.jsx(Ev,{children:u.jsxs(X2,{fallback:u.jsx(ZN,{}),children:[u.jsx(dw,{}),u.jsx(LN,{}),u.jsx(jN,{}),u.jsx(BC,{}),u.jsx(FN,{}),u.jsx($N,{}),u.jsx(zN,{}),u.jsx(VN,{}),u.jsx(Sw,{}),u.jsx(m9,{}),u.jsx(XN,{}),u.jsxs(TN,{children:[u.jsx(KN,{}),u.jsx(MN,{}),u.jsx(DN,{}),u.jsx(UN,{}),u.jsx(BN,{}),u.jsx(HN,{}),u.jsx(WN,{}),u.jsx(qN,{}),u.jsx(GN,{}),u.jsx(YN,{}),u.jsx(gC,{}),u.jsx(YC,{}),u.jsx(j_,{})]}),u.jsx(x9,{}),u.jsx(O8,{})]})})}),tP=()=>u.jsx(JN,{children:u.jsx(L2,{children:u.jsx(eP,{})})}),w2=j.isNativePlatform();let yc=!1;const Uk=()=>{yc=!0},nP=async()=>
239{if(yc){yc=!1;try{await Mn.close()}catch(e){console.debug("[Auth] Browser.close() skipped:",e)}}};w2&&Ge.addListener("appUrlOpen",async({url:e})=>{if(!(!e||!Zm(e))){console.info("[Auth] Received appUrlOpen callback",e);try{const t=await z8(e);t.ok||(console.error("[Auth] Failed to handle auth callback:",t.error),Ce(new Error(t.error),{area:"auth",action:"auth_callback_error",level:"warning",extra:{redirectUri:Ff,callbackUrl:e}}))}catch(t){console.error("[Auth] Unexpected error handling auth callback:",t),Ce(t,{area:"auth",action:"oauth_callback_handler",extra:{redirectUri:Ff}})}finally{await nP()}}});const Bk=()=>w2;var c1;(function(e){e.Dark="DARK",e.Light="LIGHT",e.Default="DEFAULT"})(c1||(c1={}));var u1;(function(e){e.None="NONE",e.Slide="SLIDE",e.Fade="FADE"})(u1||(u1={}));const d1=we("StatusBar"),rP=2e4;let f1=!1;const sP=()=>{f1||!j.isNativePlatform()||(f1=!0,B(async()=>{const{CapacitorShareTarget:e}=await import("./index_Bcf4XSlG.js");return{CapacitorShareTarget:e}},__vite__mapDeps([146,1,2,3,4])).then(({CapacitorShareTarget:e})=>e.addListener("shareReceived",t=>{var r,s;je("share_target_received",{platform:j.getPlatform(),file_count:((r=t.files)==null?void 0:r.length)??0,text_count:((s=t.texts)==null?void 0:s.length)??0,has_title:t.title?1:0});const n=performance.now();p9(t).then(o=>{o&&je("share_target_prepared",{platform:j.getPlatform(),accepted_file_count:o.files.length,rejected_file_count:o.rejectedFiles.length,text_count:o.texts.length,has_title:o.title?1:0,prepare_ms:Math.round(performance.now()-n)})}).catch(o=>{var a,i;je("share_target_prepare_failed",{platform:j.getPlatform(),file_count:((a=t.files)==null?void 0:a.length)??0,text_count:((i=t.texts)==null?void 0:i.length)??0,error_message:o instanceof Error?o.message.slice(0,100):"unknown"}),console.warn("[ShareTarget] Failed to prepare shared content",o)})})).catch(e=>{console.warn("[ShareTarget] Failed to initialize share target listener",e)}),setTimeout(()=>{Promise.all([B(()=>Promise.resolve().then(()=>Xy),void 0),B(()=>Promise.resolve().then(()=>C6),void 0)]).then(async([{sweepShareTargetFiles:e},{cloudflareMobileUploadManager:t}])=>e(await t.getQueuedLocalUris())).catch(e=>{console.warn("[ShareTarget] Shared file sweep failed",e)})},rP))},ku=we("ScreenOrientation",{web:()=>B(()=>import("./web_CqbCfZ8I.js"),__vite__mapDeps([147,1,2,3,4])).then(e=>new e.ScreenOrientationWeb)}),h1=[0,250,600,1200,2500];let ea=0,vc=0,Ji=Promise.resolve();const x2=()=>j.isNativePlatform(),bc=()=>ea>0?"landscape-primary":"portrait-primary",C2=(e,t)=>t.startsWith("landscape")?e.startsWith("landscape"):e.startsWith("portrait"),oP=e=>new Promise(t=>setTimeout(t,e));async function _2(){try{return(await ku.orientation()).type}catch{return null}}async function aP(e){for(const t of h1){if(e!==vc||(t&&await oP(t),e!==vc))return;const n=bc();try{await ku.lock({orientation:n});const r=await _2();if(r===null||C2(r,n))return}catch(r){console.warn(`Orientation lock ${n} failed, retrying`,r)}}console.warn(`Orientation lock ${bc()} gave up after ${h1.length} attempts`)}function $a(){if(!x2())return Promise.resolve();const e=++vc;return Ji=Ji.then(()=>aP(e)).catch(()=>{}),Ji}function $k(){ea+=1,$a();let e=!1;return()=>{e||(e=!0,ea=Math.max(0,ea-1),$a())}}function iP(){if(!x2())return;$a();const e=async()=>{const t=await _2();t!==null&&!C2(t,bc())&&$a()};ku.addListener("screenOrientationChange",()=>{e()}).catch(()=>{}),Ge.addListener("appStateChange",({isActive:t})=>{t&&e()}).catch(()=>{})}function lP(){try{if(j.isNativePlatform()||typeof window>"u"||!("serviceWorker"in navigator))return;window.addEventListener("load",()=>{navigator.serviceWorker.register("/sw.js").catch(()=>{})})}catch{}}const cP=4e3;window.addEventListener("vite:preloadError",e=>{Ce(e.payload,{area:"code_splitting",action:"vite_preload_error_reload",level:"warning"}),h0()&&e.preventDefault()});(async()=>{var n;W5(),is(window.location.pathname)||Ga(),Hy(cP);const e=sC(),t=[cp()];if(j.isNativePlatform()&&(t.push(D7()),j.getPlatform()==="android")){const r=Number((n=/Android (\d+)/.exec(navigator.userAgent))==null?void 0:n[1]);if(r&&r<15)for(const s of["top","right","bottom","left"])document.documentElement.style.setProperty(`--safe-area-inset-${s}
239`,"0px");t.push(Promise.all([d1.setOverlaysWebView({overlay:!1}),d1.setBackgroundColor({color:"#FCF6E8"})]).catch(s=>{console.debug("StatusBar setup skipped:",s)}))}await Promise.all(t),D2(document.getElementById("root")).render(u.jsx(tP,{})),t7(),lP(),j.isNativePlatform()&&(qp(),sP(),iP(),e.then(()=>aC()))})();export{Ge as $,hr as A,Rs as B,eu as C,f8 as D,Lc as E,na as F,je as G,sn as H,SP as I,_P as J,F7 as K,mg as L,a_ as M,AP as N,Jc as O,u8 as P,NP as Q,c8 as R,Ok as S,va as T,x7 as U,j as V,d1 as W,cr as X,c1 as Y,yP as Z,B as _,u0 as a,Zt as a$,CP as a0,pp as a1,jk as a2,HP as a3,Mc as a4,IP as a5,RP as a6,uo as a7,Wt as a8,Vy as a9,Ke as aA,qP as aB,Oe as aC,co as aD,GP as aE,z9 as aF,b7 as aG,jP as aH,xv as aI,Ha as aJ,Xd as aK,Nk as aL,Pk as aM,iy as aN,i_ as aO,e_ as aP,ey as aQ,ry as aR,Ym as aS,Il as aT,sy as aU,Q7 as aV,Y7 as aW,Fk as aX,pc as aY,Cr as aZ,qc as a_,fa as aa,Mn as ab,tk as ac,Bk as ad,Ff as ae,pe as af,Uk as ag,KP as ah,z8 as ai,U8 as aj,we as ak,ef as al,tf as am,K7 as an,Ak as ao,hw as ap,nk as aq,or as ar,tn as as,Ek as at,PP as au,Ik as av,kk as aw,kn as ax,zl as ay,WP as az,hC as b,Be as b$,EP as b0,_w as b1,sv as b2,Au as b3,l2 as b4,en as b5,mc as b6,gc as b7,Ip as b8,Ba as b9,dk as bA,J8 as bB,YP as bC,Fs as bD,XP as bE,ek as bF,eh as bG,ck as bH,tu as bI,cf as bJ,fk as bK,QP as bL,Re as bM,ZP as bN,vP as bO,JP as bP,ak as bQ,s7 as bR,Cw as bS,Gf as bT,Ew as bU,lr as bV,$k as bW,Tk as bX,gg as bY,cC as bZ,Qa as b_,Qs as ba,nn as bb,sA as bc,QA as bd,oy as be,M9 as bf,Nu as bg,L6 as bh,yk as bi,wl as bj,R4 as bk,O4 as bl,nr as bm,_4 as bn,S4 as bo,L4 as bp,rk as bq,a6 as br,Bw as bs,Lw as bt,$w as bu,uk as bv,ik as bw,Bi as bx,lk as by,t9 as bz,de as c,d0 as c$,Ds as c0,pr as c1,lo as c2,mw as c3,Ga as c4,Op as c5,Zo as c6,Yg as c7,oi as c8,rx as c9,pk as cA,sr as cB,Ka as cC,cm as cD,cv as cE,Cv as cF,BP as cG,lv as cH,UP as cI,rr as cJ,e9 as cK,ha as cL,Gy as cM,nf as cN,Nc as cO,Sk as cP,c5 as cQ,Tn as cR,vd as cS,xd as cT,pd as cU,tr as cV,pf as cW,hf as cX,Ra as cY,_h as cZ,sk as c_,TS as ca,Eu as cb,Kc as cc,Im as cd,xm as ce,Qc as cf,Gc as cg,Ya as ch,Xg as ci,Zg as cj,Mk as ck,Dk as cl,tA as cm,$i as cn,Ck as co,rf as cp,Na as cq,bk as cr,bC as cs,vk as ct,_k as cu,mP as cv,Y0 as cw,Dx as cx,r9 as cy,hk as cz,Eh as d,w7 as d0,DP as d1,OP as d2,Rp as d3,TP as d4,MP as d5,LP as d6,O_ as d7,Jg as d8,ok as d9,q3 as dA,Me as dB,Y3 as dC,Hu as dD,G3 as dE,FP as dF,$P as da,Rk as db,kP as dc,zP as dd,VP as de,ho as df,qC as dg,ka as dh,xk as di,KC as dj,$x as dk,wP as dl,ay as dm,wk as dn,OC as dp,xP as dq,as as dr,De as ds,ta as dt,R1 as du,R3 as dv,B3 as dw,H3 as dx,K3 as dy,W3 as dz,L9 as e,es as f,Ln as g,G as h,Km as i,kp as j,d8 as k,Z as l,j0 as m,Gm as n,h8 as o,p8 as p,m8 as q,Ce as r,ny as s,mr as t,_e as u,z as v,ge as w,Tr as x,Zy as y,ut as z};
240//# sourceMappingURL=index_SWRF64zM.js.map

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.