PageSourceSearch

https://explainify-ailearniverse-96.vercel.app/assets/index-DcqdSvcx.js

js explainify-ailearniverse-96.vercel.app collected 2026-10-03 06:55:08 UTC 715,664 bytes, 732 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/browser-CDKG8DYR.js","assets/vendor-Bx9_K3id.js","assets/pdf-C1rwW0z_.js","assets/_commonjs-dynamic-modules-TDtrdbi3.js","assets/index-BZU9upL2.js"])))=>i.map(i=>d[i]);
2var sc=e=>{throw TypeError(e)};var hi=(e,t,r)=>t.has(e)||sc("Cannot "+r);var D=(e,t,r)=>(hi(e,t,"read from private field"),r?r.call(e):t.get(e)),me=(e,t,r)=>t.has(e)?sc("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),oe=(e,t,r,s)=>(hi(e,t,"write to private field"),s?s.call(e,r):t.set(e,r),r),De=(e,t,r)=>(hi(e,t,"access private method"),r);var Dn=(e,t,r,s)=>({set _(a){oe(e,t,a,r)},get _(){return D(e,t,s)}});import{r as f,a as Cs,e as B,G as Wl,R as Fp,L as ne,g as Mp,c as ot,u as gt,b as Mt,N as nc,B as Op,d as Lp,f as Le}from"./vendor-Bx9_K3id.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))s(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&s(o)}).observe(document,{childList:!0,subtree:!0});function r(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(a){if(a.ep)return;a.ep=!0;const i=r(a);fetch(a.href,i)}})();var Yl={exports:{}},va={};/**
3 * @license React
4 * react-jsx-runtime.production.min.js
5 *
6 * Copyright (c) Facebook, Inc. and its affiliates.
7 *
8 * This source code is licensed under the MIT license found in the
9 * LICENSE file in the root directory of this source tree.
10 */var $p=f,Up=Symbol.for("react.element"),zp=Symbol.for("react.fragment"),Bp=Object.prototype.hasOwnProperty,qp=$p.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Hp={key:!0,ref:!0,__self:!0,__source:!0};function Kl(e,t,r){var s,a={},i=null,o=null;r!==void 0&&(i=""+r),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(o=t.ref);for(s in t)Bp.call(t,s)&&!Hp.hasOwnProperty(s)&&(a[s]=t[s]);if(e&&e.defaultProps)for(s in t=e.defaultProps,t)a[s]===void 0&&(a[s]=t[s]);return{$$typeof:Up,type:e,key:i,ref:o,props:a,_owner:qp.current}}va.Fragment=zp;va.jsx=Kl;va.jsxs=Kl;Yl.exports=va;var n=Yl.exports,Wi={},ac=Cs;Wi.createRoot=ac.createRoot,Wi.hydrateRoot=ac.hydrateRoot;const Vp=1,Gp=1e6;let mi=0;function Wp(){return mi=(mi+1)%Number.MAX_SAFE_INTEGER,mi.toString()}const pi=new Map,ic=e=>{if(pi.has(e))return;const t=setTimeout(()=>{pi.delete(e),Ks({type:"REMOVE_TOAST",toastId:e})},Gp);pi.set(e,t)},Yp=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Vp)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(r=>r.id===t.toast.id?{...r,...t.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=t;return r?ic(r):e.toasts.forEach(s=>{ic(s.id)}),{...e,toasts:e.toasts.map(s=>
10s.id===r||r===void 0?{...s,open:!1}:s)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(r=>r.id!==t.toastId)}}},Kn=[];let Qn={toasts:[]};function Ks(e){Qn=Yp(Qn,e),Kn.forEach(t=>{t(Qn)})}function Kp({...e}){const t=Wp(),r=a=>Ks({type:"UPDATE_TOAST",toast:{...a,id:t}}),s=()=>Ks({type:"DISMISS_TOAST",toastId:t});return Ks({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:a=>{a||s()}}}),{id:t,dismiss:s,update:r}}function wa(){const[e,t]=f.useState(Qn);return f.useEffect(()=>(Kn.push(t),()=>{const r=Kn.indexOf(t);r>-1&&Kn.splice(r,1)}),[e]),{...e,toast:Kp,dismiss:r=>Ks({type:"DISMISS_TOAST",toastId:r})}}function H(e,t,{checkForDefaultPrevented:r=!0}={}){return function(a){if(e==null||e(a),r===!1||!a.defaultPrevented)return t==null?void 0:t(a)}}function Qp(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function _a(...e){return t=>e.forEach(r=>Qp(r,t))}function he(...e){return f.useCallback(_a(...e),e)}function Jp(e,t=[]){let r=[];function s(i,o){const u=f.createContext(o),c=r.length;r=[...r,o];function l(h){const{scope:m,children:p,...x}=h,g=(m==null?void 0:m[e][c])||u,b=f.useMemo(()=>x,Object.values(x));return n.jsx(g.Provider,{value:b,children:p})}function d(h,m){const p=(m==null?void 0:m[e][c])||u,x=f.useContext(p);if(x)return x;if(o!==void 0)return o;throw new Error(`\`${h}\` must be used within \`${i}\``)}return l.displayName=i+"Provider",[l,d]}const a=()=>{const i=r.map(o=>f.createContext(o));return function(u){const c=(u==null?void 0:u[e])||i;return f.useMemo(()=>({[`__scope${e}`]:{...u,[e]:c}}),[u,c])}};return a.scopeName=e,[s,Zp(a,...t)]}function Zp(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const s=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const o=s.reduce((u,{useScope:c,scopeName:l})=>{const h=c(i)[`__scope${l}`];return{...u,...h}},{});return f.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}var pr=f.forwardRef((e,t)=>{const{children:r,...s}=e,a=f.Children.toArray(r),i=a.find(Xp);if(i){const o=i.props.children,u=a.map(c=>c===i?f.Children.count(o)>1?f.Children.only(null):f.isValidElement(o)?o.props.children:null:c);return n.jsx(Yi,{...s,ref:t,children:f.isValidElement(o)?f.cloneElement(o,void 0,u):null})}return n.jsx(Yi,{...s,ref:t,children:r})});pr.displayName="Slot";var Yi=f.forwardRef((e,t)=>{const{children:r,...s}=e;if(f.isValidElement(r)){const a=tx(r);return f.cloneElement(r,{...ex(s,r.props),ref:t?_a(t,a):a})}return f.Children.count(r)>1?f.Children.only(null):null});Yi.displayName="SlotClone";var Ql=({children:e})=>n.jsx(n.Fragment,{children:e});function Xp(e){return f.isValidElement(e)&&e.type===Ql}function ex(e,t){const r={...t};for(const s in t){const a=e[s],i=t[s];/^on[A-Z]/.test(s)?a&&i?r[s]=(...u)=>{i(...u),a(...u)}:a&&(r[s]=a):s==="style"?r[s]={...a,...i}:s==="className"&&(r[s]=[a,i].filter(Boolean).join(" "))}return{...e,...r}}function tx(e){var s,a;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function ka(e){const t=e+"CollectionProvider",[r,s]=Jp(t),[a,i]=r(t,{collectionRef:{current:null},itemMap:new Map}),o=p=>{const{scope:x,children:g}=p,b=B.useRef(null),v=B.useRef(new Map).current;return n.jsx(a,{scope:x,itemMap:v,collectionRef:b,children:g})};o.displayName=t;const u=e+"CollectionSlot",c=B.forwardRef((p,x)=>{const{scope:g,children:b}=p,v=i(u,g),y=he(x,v.collectionRef);return n.jsx(pr,{ref:y,children:b})});c.displayName=u;const l=e+"CollectionItemSlot",d="data-radix-collection-item",h=B.forwardRef((p,x)=>{const{scope:g,children:b,...v}=p,y=B.useRef(null),w=he(x,y),_=i(l,g);return B.useEffect(()=>(_.itemMap.set(y,{ref:y,...v}),()=>void _.itemMap.delete(y))),n.jsx(pr,{[d]:"",ref:w,children:b})});h.displayName=l;function m(p){const x=i(e+"CollectionConsumer",p);return B.useCallback(()=>{const b=x.collectionRef.current;if(!b)return[];const v=Array.from(b.querySelectorAll(`[${d}]`));return Array.from(x.itemMap.values()).sort((_,k)=>v.indexOf(_.ref.current)-v.indexOf(k.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:o,Slot:c,ItemSlot:h},m,s]}function rx(e,t){const r=f.createContext(t),s=i=>{const{children:o,...u}=i,c=f.useMemo(()=>u,Object.values(u));return n.jsx(r.Provider,{value:c,children:o})};s.displayName=e+"Provider";function a(i){const o=f.useContext(r);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[s,a]}function kr(e,t=[]){let r=[];function s(i,o){const u=f.createContext(o),c=r.length;r=[...r,o];const l=h=>{var v;const{scope:m,children:p,...x}=h,g=((v=m==null?void 0:m[e])==null?void 0:v[c])||u,b=f.useMemo(()=>x,Object.values(x));return n.jsx(g.Provider,{value:b,children:p})};l.displayName=i+"Provider";function d(h,m){var g;const p=((g=m==null?void 0:m[e])==null?void 0:g[c])||u,x=f.useContext(p);if(x)return x;if(o!==void 0)return o;throw new Error(`\`${h}\` must be used within \`${i}\``)}return[l,d]}const a=()=>{const i=r.map(o=>f.createContext(o));return function(u){const c=(u==null?void 0:u[e])||i;return f.useMemo(()=>({[`__scope${e}`]:{...u,[e]:c}}),[u,c])}};return a.scopeName=e,[s,sx(a,...t)]}function sx(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const s=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const o=s.reduce((u,{useScope:c,scopeName:l})=>{const h=c(i)[`__scope${l}`];return{...u,...h}},{});return f.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}var nx=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],re=nx.reduce((e,t)=>
vendor: 4,232 bytes, line 10
10{const r=f.forwardRef((s,a)=>{const{asChild:i,...o}=s,u=i?pr:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),n.jsx(u,{...o,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Ro(e,t){e&&Cs.flushSync(()=>e.dispatchEvent(t))}function Fe(e){const t=f.useRef(e);return f.useEffect(()=>{t.current=e}),f.useMemo(()=>(...r)=>{var s;return(s=t.current)==null?void 0:s.call(t,...r)},[])}function ax(e,t=globalThis==null?void 0:globalThis.document){const r=Fe(e);f.useEffect(()=>{const s=a=>{a.key==="Escape"&&r(a)};return t.addEventListener("keydown",s,{capture:!0}),()=>t.removeEventListener("keydown",s,{capture:!0})},[r,t])}var ix="DismissableLayer",Ki="dismissableLayer.update",ox="dismissableLayer.pointerDownOutside",ux="dismissableLayer.focusOutside",oc,Jl=f.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ss=f.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:o,onDismiss:u,...c}=e,l=f.useContext(Jl),[d,h]=f.useState(null),m=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=f.useState({}),x=he(t,j=>h(j)),g=Array.from(l.layers),[b]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),v=g.indexOf(b),y=d?g.indexOf(d):-1,w=l.layersWithOutsidePointerEventsDisabled.size>0,_=y>=v,k=lx(j=>{const C=j.target,I=[...l.branches].some(A=>A.contains(C));!_||I||(a==null||a(j),o==null||o(j),j.defaultPrevented||u==null||u())},m),N=dx(j=>{const C=j.target;[...l.branches].some(A=>A.contains(C))||(i==null||i(j),o==null||o(j),j.defaultPrevented||u==null||u())},m);return ax(j=>{y===l.layers.size-1&&(s==null||s(j),!j.defaultPrevented&&u&&(j.preventDefault(),u()))},m),f.useEffect(()=>{if(d)return r&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(oc=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(d)),l.layers.add(d),uc(),()=>{r&&l.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=oc)}},[d,m,r,l]),f.useEffect(()=>()=>{d&&(l.layers.delete(d),l.layersWithOutsidePointerEventsDisabled.delete(d),uc())},[d,l]),f.useEffect(()=>{const j=()=>p({});return document.addEventListener(Ki,j),()=>document.removeEventListener(Ki,j)},[]),n.jsx(re.div,{...c,ref:x,style:{pointerEvents:w?_?"auto":"none":void 0,...e.style},onFocusCapture:H(e.onFocusCapture,N.onFocusCapture),onBlurCapture:H(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:H(e.onPointerDownCapture,k.onPointerDownCapture)})});Ss.displayName=ix;var cx="DismissableLayerBranch",Zl=f.forwardRef((e,t)=>{const r=f.useContext(Jl),s=f.useRef(null),a=he(t,s);return f.useEffect(()=>{const i=s.current;if(i)return r.branches.add(i),()=>{r.branches.delete(i)}},[r.branches]),n.jsx(re.div,{...e,ref:a})});Zl.displayName=cx;function lx(e,t=globalThis==null?void 0:globalThis.document){const r=Fe(e),s=f.useRef(!1),a=f.useRef(()=>{});return f.useEffect(()=>{const i=u=>{if(u.target&&!s.current){let c=function(){Xl(ox,r,l,{discrete:!0})};const l={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=c,t.addEventListener("click",a.current,{once:!0})):c()}else t.removeEventListener("click",a.current);s.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",i),t.removeEventListener("click",a.current)}},[t,r]),{onPointerDownCapture:()=>s.current=!0}}function dx(e,t=globalThis==null?void 0:globalThis.document){const r=Fe(e),s=f.useRef(!1);return f.useEffect(()=>{const a=i=>{i.target&&!s.current&&Xl(ux,r,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,r]),{onFocusCapture:()=>s.current=!0,onBlurCapture:()=>s.current=!1}}function uc(){const e=new CustomEvent(Ki);document.dispatchEvent(e)}function Xl(e,t,r,{discrete:s}){const a=r.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&a.addEventListener(e,t,{once:!0}),s?Ro(a,i):a.dispatchEvent(i)}var fx=Ss,hx=Zl,Me=globalThis!=null&&globalThis.document?f.useLayoutEffect:()=>{},mx="Portal",pn=f.forwardRef((e,t)=>
10{var u;const{container:r,...s}=e,[a,i]=f.useState(!1);Me(()=>i(!0),[]);const o=r||a&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return o?Wl.createPortal(n.jsx(re.div,{...s,ref:t}),o):null});pn.displayName=mx;function px(e,t){return f.useReducer((r,s)=>t[r][s]??r,e)}var bt=e=>{const{present:t,children:r}=e,s=xx(t),a=typeof r=="function"?r({present:s.isPresent}):f.Children.only(r),i=he(s.ref,gx(a));return typeof r=="function"||s.isPresent?f.cloneElement(a,{ref:i}):null};bt.displayName="Presence";function xx(e){const[t,r]=f.useState(),s=f.useRef({}),a=f.useRef(e),i=f.useRef("none"),o=e?"mounted":"unmounted",[u,c]=px(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{const l=Rn(s.current);i.current=u==="mounted"?l:"none"},[u]),Me(()=>{const l=s.current,d=a.current;if(d!==e){const m=i.current,p=Rn(l);e?c("MOUNT"):p==="none"||(l==null?void 0:l.display)==="none"?c("UNMOUNT"):c(d&&m!==p?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,c]),Me(()=>{if(t){let l;const d=t.ownerDocument.defaultView??window,h=p=>{const g=Rn(s.current).includes(p.animationName);if(p.target===t&&g&&(c("ANIMATION_END"),!a.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",l=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},m=p=>{p.target===t&&(i.current=Rn(s.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{d.clearTimeout(l),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:f.useCallback(l=>{l&&(s.current=getComputedStyle(l)),r(l)},[])}}function Rn(e){return(e==null?void 0:e.animationName)||"none"}function gx(e){var s,a;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function Vt({prop:e,defaultProp:t,onChange:r=()=>{}}){const[s,a]=bx({defaultProp:t,onChange:r}),i=e!==void 0,o=i?e:s,u=Fe(r),c=f.useCallback(l=>{if(i){const h=typeof l=="function"?l(e):l;h!==e&&u(h)}else a(l)},[i,e,a,u]);return[o,c]}function bx({defaultProp:e,onChange:t}){const r=f.useState(e),[s]=r,a=f.useRef(s),i=Fe(t);return f.useEffect(()=>{a.current!==s&&(i(s),a.current=s)},[s,a,i]),r}var yx="VisuallyHidden",xn=f.forwardRef((e,t)=>n.jsx(re.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));xn.displayName=yx;var vx=xn,Io="ToastProvider",[Fo,wx,_x]=ka("Toast"),[ed,MN]=kr("Toast",[_x]),[kx,ja]=ed(Io),td=e=>{const{__scopeToast:t,label:r="Notification",duration:s=5e3,swipeDirection:a="right",swipeThreshold:i=50,children:o}=e,[u,c]=f.useState(null),[l,d]=f.useState(0),h=f.useRef(!1),m=f.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${Io}\`. Expected non-empty \`string\`.`),n.jsx(Fo.Provider,{scope:t,children:n.jsx(kx,{scope:t,label:r,duration:s,swipeDirection:a,swipeThreshold:i,toastCount:l,viewport:u,onViewportChange:c,onToastAdd:f.useCallback(()=>d(p=>p+1),[]),onToastRemove:f.useCallback(()=>d(p=>p-1),[]),isFocusedToastEscapeKeyDownRef:h,isClosePausedRef:m,children:o})})};td.displayName=Io;var rd="ToastViewport",jx=["F8"],Qi="toast.viewportPause",Ji="toast.viewportResume",sd=f.forwardRef((e,t)=>{const{__scopeToast:r,hotkey:s=jx,label:a="Notifications ({hotkey})",...i}=e,o=ja(rd,r),u=wx(r),c=f.useRef(null),l=f.useRef(null),d=f.useRef(null),h=f.useRef(null),m=he(t,h,o.onViewportChange),p=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),x=o.toastCount>0;f.useEffect(()=>{const b=v=>{var w;s.length!==0&&s.every(_=>v[_]||v.code===_)&&((w=h.current)==null||w.focus())};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[s]),f.useEffect(()=>{const b=c.current,v=h.current;if(x&&b&&v){const y=()=>
10{if(!o.isClosePausedRef.current){const N=new CustomEvent(Qi);v.dispatchEvent(N),o.isClosePausedRef.current=!0}},w=()=>{if(o.isClosePausedRef.current){const N=new CustomEvent(Ji);v.dispatchEvent(N),o.isClosePausedRef.current=!1}},_=N=>{!b.contains(N.relatedTarget)&&w()},k=()=>{b.contains(document.activeElement)||w()};return b.addEventListener("focusin",y),b.addEventListener("focusout",_),b.addEventListener("pointermove",y),b.addEventListener("pointerleave",k),window.addEventListener("blur",y),window.addEventListener("focus",w),()=>{b.removeEventListener("focusin",y),b.removeEventListener("focusout",_),b.removeEventListener("pointermove",y),b.removeEventListener("pointerleave",k),window.removeEventListener("blur",y),window.removeEventListener("focus",w)}}},[x,o.isClosePausedRef]);const g=f.useCallback(({tabbingDirection:b})=>{const y=u().map(w=>{const _=w.ref.current,k=[_,...Ox(_)];return b==="forwards"?k:k.reverse()});return(b==="forwards"?y.reverse():y).flat()},[u]);return f.useEffect(()=>{const b=h.current;if(b){const v=y=>{var k,N,j;const w=y.altKey||y.ctrlKey||y.metaKey;if(y.key==="Tab"&&!w){const C=document.activeElement,I=y.shiftKey;if(y.target===b&&I){(k=l.current)==null||k.focus();return}const E=g({tabbingDirection:I?"backwards":"forwards"}),U=E.findIndex(P=>P===C);xi(E.slice(U+1))?y.preventDefault():I?(N=l.current)==null||N.focus():(j=d.current)==null||j.focus()}};return b.addEventListener("keydown",v),()=>b.removeEventListener("keydown",v)}},[u,g]),n.jsxs(hx,{ref:c,role:"region","aria-label":a.replace("{hotkey}",p),tabIndex:-1,style:{pointerEvents:x?void 0:"none"},children:[x&&n.jsx(Zi,{ref:l,onFocusFromOutsideViewport:()=>{const b=g({tabbingDirection:"forwards"});xi(b)}}),n.jsx(Fo.Slot,{scope:r,children:n.jsx(re.ol,{tabIndex:-1,...i,ref:m})}),x&&n.jsx(Zi,{ref:d,onFocusFromOutsideViewport:()=>{const b=g({tabbingDirection:"backwards"});xi(b)}})]})});sd.displayName=rd;var nd="ToastFocusProxy",Zi=f.forwardRef((e,t)=>{const{__scopeToast:r,onFocusFromOutsideViewport:s,...a}=e,i=ja(nd,r);return n.jsx(xn,{"aria-hidden":!0,tabIndex:0,...a,ref:t,style:{position:"fixed"},onFocus:o=>{var l;const u=o.relatedTarget;!((l=i.viewport)!=null&&l.contains(u))&&s()}})});Zi.displayName=nd;var Na="Toast",Nx="toast.swipeStart",Cx="toast.swipeMove",Sx="toast.swipeCancel",Ex="toast.swipeEnd",ad=f.forwardRef((e,t)=>{const{forceMount:r,open:s,defaultOpen:a,onOpenChange:i,...o}=e,[u=!0,c]=Vt({prop:s,defaultProp:a,onChange:i});return n.jsx(bt,{present:r||u,children:n.jsx(Px,{open:u,...o,ref:t,onClose:()=>c(!1),onPause:Fe(e.onPause),onResume:Fe(e.onResume),onSwipeStart:H(e.onSwipeStart,l=>{l.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:H(e.onSwipeMove,l=>{const{x:d,y:h}=l.detail.delta;l.currentTarget.setAttribute("data-swipe","move"),l.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${d}px`),l.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${h}px`)}),onSwipeCancel:H(e.onSwipeCancel,l=>{l.currentTarget.setAttribute("data-swipe","cancel"),l.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),l.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),l.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),l.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:H(e.onSwipeEnd,l=>{const{x:d,y:h}=l.detail.delta;l.currentTarget.setAttribute("data-swipe","end"),l.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),l.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),l.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${d}px`),l.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${h}px`),c(!1)})})})});ad.displayName=Na;var[Tx,Ax]=ed(Na,{onClose(){}}),Px=f.forwardRef((e,t)=>{const{__scopeToast:r,type:s="foreground",duration:a,open:i,onClose:o,onEscapeKeyDown:u,onPause:c,onResume:l,onSwipeStart:d,onSwipeMove:h,onSwipeCancel:m,onSwipeEnd:p,...x}=e,g=ja(Na,r),[b,v]=f.useState(null),y=he(t,P=>v(P)),w=f.useRef(null),_=f.useRef(null),k=a||g.duration,N=f.useRef(0),j=f.useRef(k),C=f.useRef(0),{onToastAdd:I,onToastRemove:A}=g,F=Fe(()=>{var Y;(b==null?void 0:b.contains(document.activeElement))&&((Y=g.viewport)==null||Y.focus()),o()}),E=f.useCallback(P=>
vendor: 4,518 bytes, line 10
10{!P||P===1/0||(window.clearTimeout(C.current),N.current=new Date().getTime(),C.current=window.setTimeout(F,P))},[F]);f.useEffect(()=>{const P=g.viewport;if(P){const Y=()=>{E(j.current),l==null||l()},M=()=>{const Q=new Date().getTime()-N.current;j.current=j.current-Q,window.clearTimeout(C.current),c==null||c()};return P.addEventListener(Qi,M),P.addEventListener(Ji,Y),()=>{P.removeEventListener(Qi,M),P.removeEventListener(Ji,Y)}}},[g.viewport,k,c,l,E]),f.useEffect(()=>{i&&!g.isClosePausedRef.current&&E(k)},[i,k,g.isClosePausedRef,E]),f.useEffect(()=>(I(),()=>A()),[I,A]);const U=f.useMemo(()=>b?fd(b):null,[b]);return g.viewport?n.jsxs(n.Fragment,{children:[U&&n.jsx(Dx,{__scopeToast:r,role:"status","aria-live":s==="foreground"?"assertive":"polite","aria-atomic":!0,children:U}),n.jsx(Tx,{scope:r,onClose:F,children:Cs.createPortal(n.jsx(Fo.ItemSlot,{scope:r,children:n.jsx(fx,{asChild:!0,onEscapeKeyDown:H(u,()=>{g.isFocusedToastEscapeKeyDownRef.current||F(),g.isFocusedToastEscapeKeyDownRef.current=!1}),children:n.jsx(re.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":g.swipeDirection,...x,ref:y,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:H(e.onKeyDown,P=>{P.key==="Escape"&&(u==null||u(P.nativeEvent),P.nativeEvent.defaultPrevented||(g.isFocusedToastEscapeKeyDownRef.current=!0,F()))}),onPointerDown:H(e.onPointerDown,P=>{P.button===0&&(w.current={x:P.clientX,y:P.clientY})}),onPointerMove:H(e.onPointerMove,P=>{if(!w.current)return;const Y=P.clientX-w.current.x,M=P.clientY-w.current.y,Q=!!_.current,S=["left","right"].includes(g.swipeDirection),T=["left","up"].includes(g.swipeDirection)?Math.min:Math.max,O=S?T(0,Y):0,$=S?0:T(0,M),G=P.pointerType==="touch"?10:2,Z={x:O,y:$},te={originalEvent:P,delta:Z};Q?(_.current=Z,In(Cx,h,te,{discrete:!1})):cc(Z,g.swipeDirection,G)?(_.current=Z,In(Nx,d,te,{discrete:!1}),P.target.setPointerCapture(P.pointerId)):(Math.abs(Y)>G||Math.abs(M)>G)&&(w.current=null)}),onPointerUp:H(e.onPointerUp,P=>{const Y=_.current,M=P.target;if(M.hasPointerCapture(P.pointerId)&&M.releasePointerCapture(P.pointerId),_.current=null,w.current=null,Y){const Q=P.currentTarget,S={originalEvent:P,delta:Y};cc(Y,g.swipeDirection,g.swipeThreshold)?In(Ex,p,S,{discrete:!0}):In(Sx,m,S,{discrete:!0}),Q.addEventListener("click",T=>T.preventDefault(),{once:!0})}})})})}),g.viewport)})]}):null}),Dx=e=>{const{__scopeToast:t,children:r,...s}=e,a=ja(Na,t),[i,o]=f.useState(!1),[u,c]=f.useState(!1);return Fx(()=>o(!0)),f.useEffect(()=>{const l=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(l)},[]),u?null:n.jsx(pn,{asChild:!0,children:n.jsx(xn,{...s,children:i&&n.jsxs(n.Fragment,{children:[a.label," ",r]})})})},Rx="ToastTitle",id=f.forwardRef((e,t)=>{const{__scopeToast:r,...s}=e;return n.jsx(re.div,{...s,ref:t})});id.displayName=Rx;var Ix="ToastDescription",od=f.forwardRef((e,t)=>{const{__scopeToast:r,...s}=e;return n.jsx(re.div,{...s,ref:t})});od.displayName=Ix;var ud="ToastAction",cd=f.forwardRef((e,t)=>{const{altText:r,...s}=e;return r.trim()?n.jsx(dd,{altText:r,asChild:!0,children:n.jsx(Mo,{...s,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${ud}\`. Expected non-empty \`string\`.`),null)});cd.displayName=ud;var ld="ToastClose",Mo=f.forwardRef((e,t)=>{const{__scopeToast:r,...s}=e,a=Ax(ld,r);return n.jsx(dd,{asChild:!0,children:n.jsx(re.button,{type:"button",...s,ref:t,onClick:H(e.onClick,a.onClose)})})});Mo.displayName=ld;var dd=f.forwardRef((e,t)=>{const{__scopeToast:r,altText:s,...a}=e;return n.jsx(re.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":s||void 0,...a,ref:t})});function fd(e){const t=[];return Array.from(e.childNodes).forEach(s=>{if(s.nodeType===s.TEXT_NODE&&s.textContent&&t.push(s.textContent),Mx(s)){const a=s.ariaHidden||s.hidden||s.style.display==="none",i=s.dataset.radixToastAnnounceExclude==="";if(!a)if(i){const o=s.dataset.radixToastAnnounceAlt;o&&t.push(o)}else t.push(...fd(s))}}),t}function In(e,t,r,{discrete:s}){const a=r.originalEvent.currentTarget,i=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&a.addEventListener(e,t,{once:!0}),s?Ro(a,i):a.dispatchEvent(i)}var cc=(e,t,r=0)=>{const s=Math.abs(e.x),a=Math.abs(e.y),i=s>a;return t==="left"||t==="right"?i&&s>r:!i&&a>r};function Fx(e=()=>{}){const t=Fe(e);Me(()=>{let r=0,s=0;return r=window.requestAnimationFrame(()=>s=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(s)}},[t])}
vendor: 6,719 bytes, lines 10-70
10function Mx(e){return e.nodeType===e.ELEMENT_NODE}function Ox(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>{const a=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||a?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function xi(e){const t=document.activeElement;return e.some(r=>r===t?!0:(r.focus(),document.activeElement!==t))}var Lx=td,hd=sd,md=ad,pd=id,xd=od,gd=cd,bd=Mo;function yd(e){var t,r,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(r=yd(e[t]))&&(s&&(s+=" "),s+=r)}else for(r in e)e[r]&&(s&&(s+=" "),s+=r);return s}function vd(){for(var e,t,r=0,s="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=yd(e))&&(s&&(s+=" "),s+=t);return s}const lc=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,dc=vd,Es=(e,t)=>r=>{var s;if((t==null?void 0:t.variants)==null)return dc(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:a,defaultVariants:i}=t,o=Object.keys(a).map(l=>{const d=r==null?void 0:r[l],h=i==null?void 0:i[l];if(d===null)return null;const m=lc(d)||lc(h);return a[l][m]}),u=r&&Object.entries(r).reduce((l,d)=>{let[h,m]=d;return m===void 0||(l[h]=m),l},{}),c=t==null||(s=t.compoundVariants)===null||s===void 0?void 0:s.reduce((l,d)=>{let{class:h,className:m,...p}=d;return Object.entries(p).every(x=>{let[g,b]=x;return Array.isArray(b)?b.includes({...i,...u}[g]):{...i,...u}[g]===b})?[...l,h,m]:l},[]);return dc(e,o,c,r==null?void 0:r.class,r==null?void 0:r.className)};/**
11 * @license lucide-react v0.462.0 - ISC
12 *
13 * This source code is licensed under the ISC license.
14 * See the LICENSE file in the root directory of this source tree.
15 */const $x=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),wd=(...e)=>e.filter((t,r,s)=>!!t&&t.trim()!==""&&s.indexOf(t)===r).join(" ").trim();/**
16 * @license lucide-react v0.462.0 - ISC
17 *
18 * This source code is licensed under the ISC license.
19 * See the LICENSE file in the root directory of this source tree.
20 */var Ux={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
21 * @license lucide-react v0.462.0 - ISC
22 *
23 * This source code is licensed under the ISC license.
24 * See the LICENSE file in the root directory of this source tree.
25 */const zx=f.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:s,className:a="",children:i,iconNode:o,...u},c)=>f.createElement("svg",{ref:c,...Ux,width:t,height:t,stroke:e,strokeWidth:s?Number(r)*24/Number(t):r,className:wd("lucide",a),...u},[...o.map(([l,d])=>f.createElement(l,d)),...Array.isArray(i)?i:[i]]));/**
26 * @license lucide-react v0.462.0 - ISC
27 *
28 * This source code is licensed under the ISC license.
29 * See the LICENSE file in the root directory of this source tree.
30 */const W=(e,t)=>{const r=f.forwardRef(({className:s,...a},i)=>f.createElement(zx,{ref:i,iconNode:t,className:wd(`lucide-${$x(e)}`,s),...a}));return r.displayName=`${e}`,r};/**
31 * @license lucide-react v0.462.0 - ISC
32 *
33 * This source code is licensed under the ISC license.
34 * See the LICENSE file in the root directory of this source tree.
35 */const Oo=W("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
36 * @license lucide-react v0.462.0 - ISC
37 *
38 * This source code is licensed under the ISC license.
39 * See the LICENSE file in the root directory of this source tree.
40 */const mr=W("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
41 * @license lucide-react v0.462.0 - ISC
42 *
43 * This source code is licensed under the ISC license.
44 * See the LICENSE file in the root directory of this source tree.
45 */const Lo=W("Award",[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]]);/**
46 * @license lucide-react v0.462.0 - ISC
47 *
48 * This source code is licensed under the ISC license.
49 * See the LICENSE file in the root directory of this source tree.
50 */const _d=W("BookOpenText",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M16 12h2",key:"7q9ll5"}],["path",{d:"M16 8h2",key:"msurwy"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}],["path",{d:"M6 12h2",key:"32wvfc"}],["path",{d:"M6 8h2",key:"30oboj"}]]);/**
51 * @license lucide-react v0.462.0 - ISC
52 *
53 * This source code is licensed under the ISC license.
54 * See the LICENSE file in the root directory of this source tree.
55 */const Be=W("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/**
56 * @license lucide-react v0.462.0 - ISC
57 *
58 * This source code is licensed under the ISC license.
59 * See the LICENSE file in the root directory of this source tree.
60 */const fc=W("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
61 * @license lucide-react v0.462.0 - ISC
62 *
63 * This source code is licensed under the ISC license.
64 * See the LICENSE file in the root directory of this source tree.
65 */const xr=W("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/**
66 * @license lucide-react v0.462.0 - ISC
67 *
68 * This source code is licensed under the ISC license.
69 * See the LICENSE file in the root directory of this source tree.
70 */const Bx=W("CalendarClock",[["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M3 10h5",key:"r794hk"}
70],["path",{d:"M17.5 17.5 16 16.3V14",key:"akvzfd"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]]);/**
71 * @license lucide-react v0.462.0 - ISC
72 *
73 * This source code is licensed under the ISC license.
74 * See the LICENSE file in the root directory of this source tree.
75 */const qx=W("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
76 * @license lucide-react v0.462.0 - ISC
77 *
78 * This source code is licensed under the ISC license.
79 * See the LICENSE file in the root directory of this source tree.
80 */const Hx=W("ChartColumnIncreasing",[["path",{d:"M13 17V9",key:"1fwyjl"}],["path",{d:"M18 17V5",key:"sfb6ij"}],["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/**
81 * @license lucide-react v0.462.0 - ISC
82 *
83 * This source code is licensed under the ISC license.
84 * See the LICENSE file in the root directory of this source tree.
85 */const Vx=W("ChartNoAxesColumnIncreasing",[["line",{x1:"12",x2:"12",y1:"20",y2:"10",key:"1vz5eb"}],["line",{x1:"18",x2:"18",y1:"20",y2:"4",key:"cun8e5"}
85],["line",{x1:"6",x2:"6",y1:"20",y2:"16",key:"hq0ia6"}]]);/**
86 * @license lucide-react v0.462.0 - ISC
87 *
88 * This source code is licensed under the ISC license.
89 * See the LICENSE file in the root directory of this source tree.
90 */const $o=W("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
91 * @license lucide-react v0.462.0 - ISC
92 *
93 * This source code is licensed under the ISC license.
94 * See the LICENSE file in the root directory of this source tree.
95 */const Uo=W("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
96 * @license lucide-react v0.462.0 - ISC
97 *
98 * This source code is licensed under the ISC license.
99 * See the LICENSE file in the root directory of this source tree.
100 */const zo=W("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
101 * @license lucide-react v0.462.0 - ISC
102 *
103 * This source code is licensed under the ISC license.
104 * See the LICENSE file in the root directory of this source tree.
105 */const Xs=W("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
106 * @license lucide-react v0.462.0 - ISC
107 *
108 * This source code is licensed under the ISC license.
109 * See the LICENSE file in the root directory of this source tree.
110 */const Gx=W("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
111 * @license lucide-react v0.462.0 - ISC
112 *
113 * This source code is licensed under the ISC license.
114 * See the LICENSE file in the root directory of this source tree.
115 */const Gt=W("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"}]]);/**
116 * @license lucide-react v0.462.0 - ISC
117 *
118 * This source code is licensed under the ISC license.
119 * See the LICENSE file in the root directory of this source tree.
120 */const Ht=W("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
121 * @license lucide-react v0.462.0 - ISC
122 *
123 * This source code is licensed under the ISC license.
124 * See the LICENSE file in the root directory of this source tree.
125 */const Wx=W("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
126 * @license lucide-react v0.462.0 - ISC
127 *
128 * This source code is licensed under the ISC license.
129 * See the LICENSE file in the root directory of this source tree.
130 */const Vs=W("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
131 * @license lucide-react v0.462.0 - ISC
132 *
133 * This source code is licensed under the ISC license.
134 * See the LICENSE file in the root directory of this source tree.
135 */const Yx=W("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
136 * @license lucide-react v0.462.0 - ISC
137 *
138 * This source code is licensed under the ISC license.
139 * See the LICENSE file in the root directory of this source tree.
140 */const ta=W("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
141 * @license lucide-react v0.462.0 - ISC
142 *
143 * This source code is licensed under the ISC license.
144 * See the LICENSE file in the root directory of this source tree.
145 */const Kx=W("Compass",[["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
146 * @license lucide-react v0.462.0 - ISC
147 *
148 * This source code is licensed under the ISC license.
149 * See the LICENSE file in the root directory of this source tree.
150 */const gr=W("CreditCard",[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]]);/**
151 * @license lucide-react v0.462.0 - ISC
152 *
153 * This source code is licensed under the ISC license.
154 * See the LICENSE file in the root directory of this source tree.
155 */const kd=W("DollarSign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]);/**
156 * @license lucide-react v0.462.0 - ISC
157 *
158 * This source code is licensed under the ISC license.
159 * See the LICENSE file in the root directory of this source tree.
160 */const jd=W("FileQuestion",[["path",{d:"M12 17h.01",key:"p32p05"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",ke
160y:"1mlx9k"}],["path",{d:"M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3",key:"mhlwft"}]]);/**
161 * @license lucide-react v0.462.0 - ISC
162 *
163 * This source code is licensed under the ISC license.
164 * See the LICENSE file in the root directory of this source tree.
165 */const Pe=W("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
166 * @license lucide-react v0.462.0 - ISC
167 *
168 * This source code is licensed under the ISC license.
169 * See the LICENSE file in the root directory of this source tree.
170 */const Nd=W("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);/**
171 * @license lucide-react v0.462.0 - ISC
172 *
173 * This source code is licensed under the ISC license.
174 * See the LICENSE file in the root directory of this source tree.
175 */const Qx=W("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
176 * @license lucide-react v0.462.0 - ISC
177 *
178 * This source code is licensed under the ISC license.
179 * See the LICENSE file in the root directory of this source tree.
180 */const Jx=W("GraduationCap",[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]]);/**
181 * @license lucide-react v0.462.0 - ISC
182 *
183 * This source code is licensed under the ISC license.
184 * See the LICENSE file in the root directory of this source tree.
185 */const mt=W("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/**
186 * @license lucide-react v0.462.0 - ISC
187 *
188 * This source code is licensed under the ISC license.
189 * See the LICENSE file in the root directory of this source tree.
190 */const Ca=W("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
191 * @license lucide-react v0.462.0 - ISC
192 *
193 * This source code is licensed under the ISC license.
194 * See the LICENSE file in the root directory of this source tree.
195 */const Zx=W("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
196 * @license lucide-react v0.462.0 - ISC
197 *
198 * This source code is licensed under the ISC license.
199 * See the LICENSE file in the root directory of this source tree.
200 */const Xx=W("Key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]);/**
201 * @license lucide-react v0.462.0 - ISC
202 *
203 * This source code is licensed under the ISC license.
204 * See the LICENSE file in the root directory of this source tree.
205 */const Xi=W("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/**
206 * @license lucide-react v0.462.0 - ISC
207 *
208 * This source code is licensed under the ISC license.
209 * See the LICENSE file in the root directory of this source tree.
210 */const Jn=W("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/**
211 * @license lucide-react v0.462.0 - ISC
212 *
213 * This source code is licensed under the ISC license.
214 * See the LICENSE file in the root directory of this source tree.
215 */const Sa=W("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/**
216 * @license lucide-react v0.462.0 - ISC
217 *
218 * This source code is licensed under the ISC license.
219 * See the LICENSE file in the root directory of this source tree.
220 */const eo=W("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);/**
221 * @license lucide-react v0.462.0 - ISC
222 *
223 * This source code is licensed under the ISC license.
224 * See the LICENSE file in the root directory of this source tree.
225 */const Rt=W("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
226 * @license lucide-react v0.462.0 - ISC
227 *
228 * This source code is licensed under the ISC license.
229 * See the LICENSE file in the root directory of this source tree.
230 */const gs=W("Loader",[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}
230],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]]);/**
231 * @license lucide-react v0.462.0 - ISC
232 *
233 * This source code is licensed under the ISC license.
234 * See the LICENSE file in the root directory of this source tree.
235 */const eg=W("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
236 * @license lucide-react v0.462.0 - ISC
237 *
238 * This source code is licensed under the ISC license.
239 * See the LICENSE file in the root directory of this source tree.
240 */const hc=W("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]);/**
241 * @license lucide-react v0.462.0 - ISC
242 *
243 * This source code is licensed under the ISC license.
244 * See the LICENSE file in the root directory of this source tree.
245 */const mc=W("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/**
246 * @license lucide-react v0.462.0 - ISC
247 *
248 * This source code is licensed under the ISC license.
249 * See the LICENSE file in the root directory of this source tree.
250 */const tg=W("Maximize",[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]]);/**
251 * @license lucide-react v0.462.0 - ISC
252 *
253 * This source code is licensed under the ISC license.
254 * See the LICENSE file in the root directory of this source tree.
255 */const Cd=W("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"}]]);/**
256 * @license lucide-react v0.462.0 - ISC
257 *
258 * This source code is licensed under the ISC license.
259 * See the LICENSE file in the root directory of this source tree.
260 */const rg=W("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/**
261 * @license lucide-react v0.462.0 - ISC
262 *
263 * This source code is licensed under the ISC license.
264 * See the LICENSE file in the root directory of this source tree.
265 */const pc=W("Mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);/**
266 * @license lucide-react v0.462.0 - ISC
267 *
268 * This source code is licensed under the ISC license.
269 * See the LICENSE file in the root directory of this source tree.
270 */const sg=W("Minimize",[["path",{d:"M8 3v3a2 2 0 0 1-2 2H3",key:"hohbtr"}],["path",{d:"M21 8h-3a2 2 0 0 1-2-2V3",key:"5jw1f3"}],["path",{d:"M3 16h3a2 2 0 0 1 2 2v3",key:"198tvr"}],["path",{d:"M16 21v-3a2 2 0 0 1 2-2h3",key:"ph8mxp"}]]);/**
271 * @license lucide-react v0.462.0 - ISC
272 *
273 * This source code is licensed under the ISC license.
274 * See the LICENSE file in the root directory of this source tree.
275 */const ng=W("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
276 * @license lucide-react v0.462.0 - ISC
277 *
278 * This source code is licensed under the ISC license.
279 * See the LICENSE file in the root directory of this source tree.
280 */const to=W("Package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["path",{d:"m3.3 7 7.703 4.734a2 2 0 0 0 1.994 0L20.7 7",key:"yx3hmr"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]);/**
281 * @license lucide-react v0.462.0 - ISC
282 *
283 * This source code is licensed under the ISC license.
284 * See the LICENSE file in the root directory of this source tree.
285 */const ag=W("Paperclip",[["path",{d:"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48",key:"1u3ebp"}]]);/**
286 * @license lucide-react v0.462.0 - ISC
287 *
288 * This source code is licensed under the ISC license.
289 * See the LICENSE file in the root directory of this source tree.
290 */const ig=W("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);/**
291 * @license lucide-react v0.462.0 - ISC
292 *
293 * This source code is licensed under the ISC license.
294 * See the LICENSE file in the root directory of this source tree.
295 */const xc=W("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
296 * @license lucide-react v0.462.0 - ISC
297 *
298 * This source code is licensed under the ISC license.
299 * See the LICENSE file in the root directory of this source tree.
300 */const bs=W("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"}]]);/**
301 * @license lucide-react v0.462.0 - ISC
302 *
303 * This source code is licensed under the ISC license.
304 * See the LICENSE file in the root directory of this source tree.
305 */const og=W("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);/**
306 * @license lucide-react v0.462.0 - ISC
307 *
308 * This source code is licensed under the ISC license.
309 * See the LICENSE file in the root directory of this source tree.
310 */const qt=W("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
311 * @license lucide-react v0.462.0 - ISC
312 *
313 * This source code is licensed under the ISC license.
314 * See the LICENSE file in the root directory of this source tree.
315 */const gc=W("SendHorizontal",[["path",{d:"M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z",key:"117uat"}],["path",{d:"M6 12h16",key:"s4cdu5"}]]);/**
316 * @license lucide-react v0.462.0 - ISC
317 *
318 * This source code is licensed under the ISC license.
319 * See the LICENSE file in the root directory of this source tree.
320 */const bc=W("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
321 * @license lucide-react v0.462.0 - ISC
322 *
323 * This source code is licensed under the ISC license.
324 * See the LICENSE file in the root directory of this source tree.
325 */const Sd=W("Shield",[["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
325y:"oel41y"}]]);/**
326 * @license lucide-react v0.462.0 - ISC
327 *
328 * This source code is licensed under the ISC license.
329 * See the LICENSE file in the root directory of this source tree.
330 */const Xe=W("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
331 * @license lucide-react v0.462.0 - ISC
332 *
333 * This source code is licensed under the ISC license.
334 * See the LICENSE file in the root directory of this source tree.
335 */const yc=W("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);/**
336 * @license lucide-react v0.462.0 - ISC
337 *
338 * This source code is licensed under the ISC license.
339 * See the LICENSE file in the root directory of this source tree.
340 */const ug=W("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
341 * @license lucide-react v0.462.0 - ISC
342 *
343 * This source code is licensed under the ISC license.
344 * See the LICENSE file in the root directory of this source tree.
345 */const Ts=W("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
346 * @license lucide-react v0.462.0 - ISC
347 *
348 * This source code is licensed under the ISC license.
349 * See the LICENSE file in the root directory of this source tree.
350 */const Ed=W("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"}]]);/**
351 * @license lucide-react v0.462.0 - ISC
352 *
353 * This source code is licensed under the ISC license.
354 * See the LICENSE file in the root directory of this source tree.
355 */const ra=W("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
356 * @license lucide-react v0.462.0 - ISC
357 *
358 * This source code is licensed under the ISC license.
359 * See the LICENSE file in the root directory of this source tree.
360 */const ro=W("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
361 * @license lucide-react v0.462.0 - ISC
362 *
363 * This source code is licensed under the ISC license.
364 * See the LICENSE file in the root directory of this source tree.
365 */const Qs=W("Video",[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]);/**
366 * @license lucide-react v0.462.0 - ISC
367 *
368 * This source code is licensed under the ISC license.
369 * See the LICENSE file in the root directory of this source tree.
370 */const Bo=W("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"}]]);/**
371 * @license lucide-react v0.462.0 - ISC
372 *
373 * This source code is licensed under the ISC license.
374 * See the LICENSE file in the root directory of this source tree.
375 */const qo=W("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"}]]);/**
376 * @license lucide-react v0.462.0 - ISC
377 *
378 * This source code is licensed under the ISC license.
379 * See the LICENSE file in the root directory of this source tree.
380 */const Ur=W("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}
vendor: 8,307 bytes, lines 380-390
380],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
381 * @license lucide-react v0.462.0 - ISC
382 *
383 * This source code is licensed under the ISC license.
384 * See the LICENSE file in the root directory of this source tree.
385 */const Tt=W("Youtube",[["path",{d:"M2.5 17a24.12 24.12 0 0 1 0-10 2 2 0 0 1 1.4-1.4 49.56 49.56 0 0 1 16.2 0A2 2 0 0 1 21.5 7a24.12 24.12 0 0 1 0 10 2 2 0 0 1-1.4 1.4 49.55 49.55 0 0 1-16.2 0A2 2 0 0 1 2.5 17",key:"1q2vi4"}],["path",{d:"m10 15 5-3-5-3z",key:"1jp15x"}]]);/**
386 * @license lucide-react v0.462.0 - ISC
387 *
388 * This source code is licensed under the ISC license.
389 * See the LICENSE file in the root directory of this source tree.
390 */const cg=W("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),Ho="-",lg=e=>{const t=fg(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:o=>{const u=o.split(Ho);return u[0]===""&&u.length!==1&&u.shift(),Td(u,t)||dg(o)},getConflictingClassGroupIds:(o,u)=>{const c=r[o]||[];return u&&s[o]?[...c,...s[o]]:c}}},Td=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const r=e[0],s=t.nextPart.get(r),a=s?Td(e.slice(1),s):void 0;if(a)return a;if(t.validators.length===0)return;const i=e.join(Ho);return(o=t.validators.find(({validator:u})=>u(i)))==null?void 0:o.classGroupId},vc=/^\[(.+)\]$/,dg=e=>{if(vc.test(e)){const t=vc.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},fg=e=>{const{theme:t,prefix:r}=e,s={nextPart:new Map,validators:[]};return mg(Object.entries(e.classGroups),r).forEach(([i,o])=>{so(o,s,i,t)}),s},so=(e,t,r,s)=>{e.forEach(a=>{if(typeof a=="string"){const i=a===""?t:wc(t,a);i.classGroupId=r;return}if(typeof a=="function"){if(hg(a)){so(a(s),t,r,s);return}t.validators.push({validator:a,classGroupId:r});return}Object.entries(a).forEach(([i,o])=>{so(o,wc(t,i),r,s)})})},wc=(e,t)=>{let r=e;return t.split(Ho).forEach(s=>{r.nextPart.has(s)||r.nextPart.set(s,{nextPart:new Map,validators:[]}),r=r.nextPart.get(s)}),r},hg=e=>e.isThemeGetter,mg=(e,t)=>t?e.map(([r,s])=>{const a=s.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,u])=>[t+o,u])):i);return[r,a]}):e,pg=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,s=new Map;const a=(i,o)=>{r.set(i,o),t++,t>e&&(t=0,s=r,r=new Map)};return{get(i){let o=r.get(i);if(o!==void 0)return o;if((o=s.get(i))!==void 0)return a(i,o),o},set(i,o){r.has(i)?r.set(i,o):a(i,o)}}},Ad="!",xg=e=>{const{separator:t,experimentalParseClassName:r}=e,s=t.length===1,a=t[0],i=t.length,o=u=>{const c=[];let l=0,d=0,h;for(let b=0;b<u.length;b++){let v=u[b];if(l===0){if(v===a&&(s||u.slice(b,b+i)===t)){c.push(u.slice(d,b)),d=b+i;continue}if(v==="/"){h=b;continue}}v==="["?l++:v==="]"&&l--}const m=c.length===0?u:u.substring(d),p=m.startsWith(Ad),x=p?m.substring(1):m,g=h&&h>d?h-d:void 0;return{modifiers:c,hasImportantModifier:p,baseClassName:x,maybePostfixModifierPosition:g}};return r?u=>r({className:u,parseClassName:o}):o},gg=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(s=>{s[0]==="["?(t.push(...r.sort(),s),r=[]):r.push(s)}),t.push(...r.sort()),t},bg=e=>({cache:pg(e.cacheSize),parseClassName:xg(e),...lg(e)}),yg=/\s+/,vg=(e,t)=>{const{parseClassName:r,getClassGroupId:s,getConflictingClassGroupIds:a}=t,i=[],o=e.trim().split(yg);let u="";for(let c=o.length-1;c>=0;c-=1){const l=o[c],{modifiers:d,hasImportantModifier:h,baseClassName:m,maybePostfixModifierPosition:p}=r(l);let x=!!p,g=s(x?m.substring(0,p):m);if(!g){if(!x){u=l+(u.length>0?" "+u:u);continue}if(g=s(m),!g){u=l+(u.length>0?" "+u:u);continue}x=!1}const b=gg(d).join(":"),v=h?b+Ad:b,y=v+g;if(i.includes(y))continue;i.push(y);const w=a(g,x);for(let _=0;_<w.length;++_){const k=w[_];i.push(v+k)}u=l+(u.length>0?" "+u:u)}return u};function wg(){let e=0,t,r,s="";for(;e<arguments.length;)(t=arguments[e++])&&(r=Pd(t))&&(s&&(s+=" "),s+=r);return s}const Pd=e=>{if(typeof e=="string")return e;let t,r="";for(let s=0;s<e.length;s++)e[s]&&(t=Pd(e[s]))&&(r&&(r+=" "),r+=t);return r};function _g(e,...t){let r,s,a,i=o;function o(c){const l=t.reduce((d,h)=>h(d),e());return r=bg(l),s=r.cache.get,a=r.cache.set,i=u,u(c)}function u(c){const l=s(c);if(l)return l;const d=vg(c,r);return a(c,d),d}return function(){return i(wg.apply(null,arguments))}}const ye=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},Dd=/^\[(?:([a-z-]+):)?(.+)\]$/i,kg=/^\d+\/\d+$/,jg=new Set(["px","full","screen"]),Ng=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Cg=/\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$/,Sg=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Eg=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Tg=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ut=e=>rs(e)||jg.has(e)||kg.test(e),Jt=e=>As(e,"length",Og),rs=e=>!!e&&!Number.isNaN(Number(e)),gi=e=>As(e,"number",rs),zs=e=>!!e&&Number.isInteger(Number(e)),Ag=e=>e.endsWith("%")&&rs(e.slice(0,-1)),ie=e=>Dd.test(e),Zt=e=>Ng.test(e),Pg=new Set(["length","size","percentage"]),Dg=e=>As(e,Pg,Rd),Rg=e=>As(e,"position",Rd),Ig=new Set(["image","url"]),Fg=e=>As(e,Ig,$g),Mg=e=>As(e,"",Lg),Bs=()=>!0,As=(e,t,r)=>{const s=Dd.exec(e);return s?s[1]?typeof t=="string"?s[1]===t:t.has(s[1]):r(s[2]):!1},Og=e=>Cg.test(e)&&!Sg.test(e),Rd=()=>!1,Lg=e=>Eg.test(e),$g=e=>Tg.test(e),Ug=()=>{const e=ye("colors"),t=ye("spacing"),r=ye("blur"),s=ye("brightness"),a=ye("borderColor"),i=ye("borderRadius"),o=ye("borderSpacing"),u=ye("borderWidth"),c=ye("contrast"),l=ye("grayscale"),d=ye("hueRotate"),h=ye("invert"),m=ye("gap"),p=ye("gradientColorStops"),x=ye("gradientColorStopPositions"),g=ye("inset"),b=ye("margin"),v=ye("opacity"),y=ye("padding"),w=ye("saturate"),_=ye("scale"),k=ye("sepia"),N=ye("skew"),j=ye("space"),C=ye("translate"),I=()=>["auto","contain","none"],A=()=>["auto","hidden","clip","visible","scroll"],F=()=>["auto",ie,t],E=()=>[ie,t],U=()=>["",Ut,Jt],P=()=>["auto",rs,ie],Y=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],M=()=>["solid","dashed","dotted","double","none"],Q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],S=()=>["start","end","center","between","around","evenly","stretch"],T=()=>["","0",ie],O=()=>["auto","avoid","all","avoid-page","page","left","right","column"],$=()=>[rs,ie];return{cacheSize:500,separator:":",theme:{colors:[Bs],spacing:[Ut,Jt],blur:["none","",Zt,ie],brightness:$(),borderColor:[e],borderRadius:["none","","full",Zt,ie],borderSpacing:E(),borderWidth:U(),contrast:$(),grayscale:T(),hueRotate:$(),invert:T(),gap:E(),gradientColorStops:[e],gradientColorStopPositions:[Ag,Jt],inset:F(),margin:F(),opacity:$(),padding:E(),saturate:$(),scale:$(),sepia:T(),skew:$(),space:E(),translate:E()},classGroups:{aspect:[{aspect:["auto","square","video",ie]}],container:["container"],columns:[{columns:[Zt]}],"break-after":[{"break-after":O()}],"break-before":[{"break-before":O()}],"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:[...Y(),ie]}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}
vendor: 9,946 bytes, line 390
390],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",zs,ie]}],basis:[{basis:F()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ie]}],grow:[{grow:T()}],shrink:[{shrink:T()}],order:[{order:["first","last","none",zs,ie]}],"grid-cols":[{"grid-cols":[Bs]}],"col-start-end":[{col:["auto",{span:["full",zs,ie]},ie]}],"col-start":[{"col-start":P()}],"col-end":[{"col-end":P()}],"grid-rows":[{"grid-rows":[Bs]}],"row-start-end":[{row:["auto",{span:[zs,ie]},ie]}],"row-start":[{"row-start":P()}],"row-end":[{"row-end":P()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ie]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ie]}],gap:[{gap:[m]}],"gap-x":[{"gap-x":[m]}],"gap-y":[{"gap-y":[m]}],"justify-content":[{justify:["normal",...S()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...S(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...S(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[b]}],mx:[{mx:[b]}],my:[{my:[b]}],ms:[{ms:[b]}],me:[{me:[b]}],mt:[{mt:[b]}],mr:[{mr:[b]}],mb:[{mb:[b]}],ml:[{ml:[b]}],"space-x":[{"space-x":[j]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[j]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ie,t]}],"min-w":[{"min-w":[ie,t,"min","max","fit"]}],"max-w":[{"max-w":[ie,t,"none","full","min","max","fit","prose",{screen:[Zt]},Zt]}],h:[{h:[ie,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ie,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ie,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ie,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Zt,Jt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",gi]}],"font-family":[{font:[Bs]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",ie]}],"line-clamp":[{"line-clamp":["none",rs,gi]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ut,ie]}],"list-image":[{"list-image":["none",ie]}],"list-style-type":[{list:["none","disc","decimal",ie]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...M(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ut,Jt]}],"underline-offset":[{"underline-offset":["auto",Ut,ie]}],"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:E()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ie]}],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",ie]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Y(),Rg]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Dg]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Fg]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[x]}],"gradient-via-pos":[{via:[x]}],"gradient-to-pos":[{to:[x]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[u]}],"border-w-x":[{"border-x":[u]}],"border-w-y":[{"border-y":[u]}],"border-w-s":[{"border-s":[u]}],"border-w-e":[{"border-e":[u]}],"border-w-t":[{"border-t":[u]}],"border-w-r":[{"border-r":[u]}],"border-w-b":[{"border-b":[u]}],"border-w-l":[{"border-l":[u]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:[...M(),"hidden"]}],"divide-x":[{"divide-x":[u]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[u]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:M()}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-y":[{"border-y":[a]}],"border-color-s":[{"border-s":[a]}],"border-color-e":[{"border-e":[a]}],"border-color-t":[{"border-t":[a]}],"border-color-r":[{"border-r":[a]}],"border-color-b":[{"border-b":[a]}],"border-color-l":[{"border-l":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:["",...M()]}],"outline-offset":[{"outline-offset":[Ut,ie]}],"outline-w":[{outline:[Ut,Jt]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:U()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[Ut,Jt]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Zt,Mg]}],"shadow-color":[{shadow:[Bs]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...Q(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Q()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[s]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Zt,ie]}],grayscale:[{grayscale:[l]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[h]}],saturate:[{saturate:[w]}],sepia:[{sepia:[k]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[s]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[l]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[h]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[k]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ie]}],duration:[{duration:$()}],ease:[{ease:["linear","in","out","in-out",ie]}],delay:[{delay:$()}],animate:[{animate:["none","spin","ping","pulse","bounce",ie]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[_]}],"scale-x":[{"scale-x":[_]}],"scale-y":[{"scale-y":[_]}],rotate:[{rotate:[zs,ie]}],"translate-x":[{"translate-x":[C]}],"translate-y":[{"translate-y":[C]}],"skew-x":[{"skew-x":[N]}],"skew-y":[{"skew-y":[N]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ie]}],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",ie]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":E()}],"scroll-mx":[{"scroll-mx":E()}],"scroll-my":[{"scroll-my":E()}],"scroll-ms":[{"scroll-ms":E()}],"scroll-me":[{"scroll-me":E()}],"scroll-mt":[{"scroll-mt":E()}],"scroll-mr":[{"scroll-mr":E()}],"scroll-mb":[{"scroll-mb":E()}],"scroll-ml":[{"scroll-ml":E()}],"scroll-p":[{"scroll-p":E()}],"scroll-px":[{"scroll-px":E()}],"scroll-py":[{"scroll-py":E()}],"scroll-ps":[{"scroll-ps":E()}],"scroll-pe":[{"scroll-pe":E()}],"scroll-pt":[{"scroll-pt":E()}],"scroll-pr":[{"scroll-pr":E()}],"scroll-pb":[{"scroll-pb":E()}],"scroll-pl":[{"scroll-pl":E()}],"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"]}
vendor: 4,642 bytes, line 390
390],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",ie]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Ut,Jt,gi]}],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"]}}},zg=_g(Ug);function V(...e){return zg(vd(e))}const Bg=Lx,Id=f.forwardRef(({className:e,...t},r)=>n.jsx(hd,{ref:r,className:V("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));Id.displayName=hd.displayName;const qg=Es("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),Fd=f.forwardRef(({className:e,variant:t,...r},s)=>n.jsx(md,{ref:s,className:V(qg({variant:t}),e),...r}));Fd.displayName=md.displayName;const Hg=f.forwardRef(({className:e,...t},r)=>n.jsx(gd,{ref:r,className:V("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));Hg.displayName=gd.displayName;const Md=f.forwardRef(({className:e,...t},r)=>n.jsx(bd,{ref:r,className:V("absolute right-2 top-2 rounded-md p-1 text-foreground
390/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:n.jsx(Ur,{className:"h-4 w-4"})}));Md.displayName=bd.displayName;const Od=f.forwardRef(({className:e,...t},r)=>n.jsx(pd,{ref:r,className:V("text-sm font-semibold",e),...t}));Od.displayName=pd.displayName;const Ld=f.forwardRef(({className:e,...t},r)=>n.jsx(xd,{ref:r,className:V("text-sm opacity-90",e),...t}));Ld.displayName=xd.displayName;function Vg(){const{toasts:e}=wa();return n.jsxs(Bg,{children:[e.map(function({id:t,title:r,description:s,action:a,...i}){return n.jsxs(Fd,{...i,children:[n.jsxs("div",{className:"grid gap-1",children:[r&&n.jsx(Od,{children:r}),s&&n.jsx(Ld,{children:s})]}),a,n.jsx(Md,{})]},t)}),n.jsx(Id,{})]})}var sa=["light","dark"],Vo="(prefers-color-scheme: dark)",Gg=typeof window>"u",Go=f.createContext(void 0),Wg={setTheme:e=>{},themes:[]},$d=()=>{var e;return(e=f.useContext(Go))!=null?e:Wg},Yg=e=>f.useContext(Go)?e.children:f.createElement(Qg,{...e}),Kg=["light","dark"],Qg=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:r=!0,enableColorScheme:s=!0,storageKey:a="theme",themes:i=Kg,defaultTheme:o=r?"system":"light",attribute:u="data-theme",value:c,children:l,nonce:d})=>{let[h,m]=f.useState(()=>_c(a,o)),[p,x]=f.useState(()=>_c(a)),g=c?Object.values(c):i,b=f.useCallback(_=>{let k=_;if(!k)return;_==="system"&&r&&(k=kc());let N=c?c[k]:k,j=t?Zg():null,C=document.documentElement;if(u==="class"?(C.classList.remove(...g),N&&C.classList.add(N)):N?C.setAttribute(u,N):C.removeAttribute(u),s){let I=sa.includes(o)?o:null,A=sa.includes(k)?k:I;C.style.colorScheme=A}j==null||j()},[]),v=f.useCallback(_=>{let k=typeof _=="function"?_(_):_;m(k);try{localStorage.setItem(a,k)}catch{}},[e]),y=f.useCallback(_=>{let k=kc(_);x(k),h==="system"&&r&&!e&&b("system")},[h,e]);f.useEffect(()=>{let _=window.matchMedia(Vo);return _.addListener(y),y(_),()=>_.removeListener(y)},[y]),f.useEffect(()=>{let _=k=>{if(k.key!==a)return;let N=k.newValue||o;v(N)};return window.addEventListener("storage",_),()=>window.removeEventListener("storage",_)},[v]),f.useEffect(()=>{b(e??h)},[e,h]);let w=f.useMemo(()=>({theme:h,setTheme:v,forcedTheme:e,resolvedTheme:h==="system"?p:h,themes:r?[...i,"system"]:i,systemTheme:r?p:void 0}),[h,v,e,p,r,i]);return f.createElement(Go.Provider,{value:w},f.createElement(Jg,{forcedTheme:e,disableTransitionOnChange:t,enableSystem:r,enableColorScheme:s,storageKey:a,themes:i,defaultTheme:o,attribute:u,value:c,children:l,attrs:g,nonce:d}),l)},Jg=f.memo(({forcedTheme:e,storageKey:t,attribute:r,enableSystem:s,enableColorScheme:a,defaultTheme:i,value:o,attrs:u,nonce:c})=>{let l=i==="system",d=r==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${u.map(x=>`'${x}'`).join(",")})`};`:`var d=document.documentElement,n='${r}',s='setAttribute';`,h=a?sa.includes(i)&&i?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${i}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",m=(x,g=!1,b=!0)=>{let v=o?o[x]:x,y=g?x+"|| ''":`'${v}'`,w="";return a&&b&&!g&&sa.includes(x)&&(w+=`d.style.colorScheme = '${x}';`),r==="class"?g||v?w+=`c.add(${y})`:w+="null":v&&(w+=`d[s](n,${y})`),w},p=e?`!function(){${d}${m(e)}}()`:s?`!function(){try{${d}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${l})){var t='${Vo}',m=window.matchMedia(t);if(m.media!==t||m.matches){${m("dark")}}else{${m("light")}}}else if(e){${o?`var x=${JSON.stringify(o)};`:""}${m(o?"x[e]":"e",!0)}}${l?"":"else{"+m(i,!1,!1)+"}"}${h}}catch(e){}}()`:`!function(){try{${d}var e=localStorage.getItem('${t}');if(e){${o?`var x=${JSON.stringify(o)};`:""}${m(o?"x[e]":"e",!0)}}else{${m(i,!1,!1)};}${h}}catch(t){}}();`;return f.createElement("script",{nonce:c,dangerouslySetInnerHTML:{__html:p}})}),_c=(e,t)=>{if(Gg)return;let r;try{r=localStorage.getItem(e)||void 0}catch{}return r||t},Zg=()=>{let e=document.createElement("style");return e.appendChild(document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(e),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(e)},1)}},kc=e=>
390(e||(e=window.matchMedia(Vo)),e.matches?"dark":"light"),Xg=e=>{switch(e){case"success":return rb;case"info":return nb;case"warning":return sb;case"error":return ab;default:return null}},eb=Array(12).fill(0),tb=({visible:e})=>B.createElement("div",{className:"sonner-loading-wrapper","data-visible":e},B.createElement("div",{className:"sonner-spinner"},eb.map((t,r)=>B.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),rb=B.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},B.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"})),sb=B.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},B.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"})),nb=B.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},B.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"})),ab=B.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},B.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"})),ib=()=>{let[e,t]=B.useState(document.hidden);return B.useEffect(()=>{let r=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e},no=1,ob=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:r,...s}=e,a=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:no++,i=this.toasts.find(u=>u.id===a),o=e.dismissible===void 0?!0:e.dismissible;return i?this.toasts=this.toasts.map(u=>u.id===a?(this.publish({...u,...e,id:a,title:r}),{...u,...e,id:a,dismissible:o,title:r}):u):this.addToast({title:r,...s,dismissible:o,id:a}),a},this.dismiss=e=>(e||this.toasts.forEach(t=>{this.subscribers.forEach(r=>r({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)=>
390this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let r;t.loading!==void 0&&(r=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let s=e instanceof Promise?e:e(),a=r!==void 0;return s.then(async i=>{if(cb(i)&&!i.ok){a=!1;let o=typeof t.error=="function"?await t.error(`HTTP error! status: ${i.status}`):t.error,u=typeof t.description=="function"?await t.description(`HTTP error! status: ${i.status}`):t.description;this.create({id:r,type:"error",message:o,description:u})}else if(t.success!==void 0){a=!1;let o=typeof t.success=="function"?await t.success(i):t.success,u=typeof t.description=="function"?await t.description(i):t.description;this.create({id:r,type:"success",message:o,description:u})}}).catch(async i=>{if(t.error!==void 0){a=!1;let o=typeof t.error=="function"?await t.error(i):t.error,u=typeof t.description=="function"?await t.description(i):t.description;this.create({id:r,type:"error",message:o,description:u})}}).finally(()=>{var i;a&&(this.dismiss(r),r=void 0),(i=t.finally)==null||i.call(t)}),r},this.custom=(e,t)=>{let r=(t==null?void 0:t.id)||no++;return this.create({jsx:e(r),id:r,...t}),r},this.subscribers=[],this.toasts=[]}},Qe=new ob,ub=(e,t)=>{let r=(t==null?void 0:t.id)||no++;return Qe.addToast({title:e,...t,id:r}),r},cb=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",lb=ub,db=()=>Qe.toasts,L=Object.assign(lb,{success:Qe.success,info:Qe.info,warning:Qe.warning,error:Qe.error,custom:Qe.custom,message:Qe.message,promise:Qe.promise,dismiss:Qe.dismiss,loading:Qe.loading},{getHistory:db});function fb(e,{insertAt:t}={}){if(typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css",t==="top"&&r.firstChild?r.insertBefore(s,r.firstChild):r.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}fb(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999}:where([data-sonner-toaster][data-x-position="right"]){right:max(var(--offset),env(safe-area-inset-right))}:where([data-sonner-toaster][data-x-position="left"]){left:max(var(--offset),env(safe-area-inset-left))}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:max(var(--offset),env(safe-area-inset-top))}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:max(var(--offset),env(safe-area-inset-bottom))}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;
390left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;background:var(--gray1);color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:0;right:0;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}
390:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount, 0px));transition:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation:swipe-out .2s ease-out forwards}@keyframes swipe-out{0%{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount)));opacity:1}to{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount) + var(--lift) * -100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;--mobile-offset: 16px;right:var(--mobile-offset);left:var(--mobile-offset);width:100%}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset)}[data-sonner-toaster][data-y-position=bottom]{bottom:20px}[data-sonner-toaster][data-y-position=top]{top:20px}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset);right:var(--mobile-offset);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
391`);function Fn(e){return e.label!==void 0}
391var hb=3,mb="32px",pb=4e3,xb=356,gb=14,bb=20,yb=200;function vb(...e){return e.filter(Boolean).join(" ")}var wb=e=>{var t,r,s,a,i,o,u,c,l,d;let{invert:h,toast:m,unstyled:p,interacting:x,setHeights:g,visibleToasts:b,heights:v,index:y,toasts:w,expanded:_,removeToast:k,defaultRichColors:N,closeButton:j,style:C,cancelButtonStyle:I,actionButtonStyle:A,className:F="",descriptionClassName:E="",duration:U,position:P,gap:Y,loadingIcon:M,expandByDefault:Q,classNames:S,icons:T,closeButtonAriaLabel:O="Close toast",pauseWhenPageIsHidden:$,cn:G}=e,[Z,te]=B.useState(!1),[z,K]=B.useState(!1),[q,ee]=B.useState(!1),[se,X]=B.useState(!1),[ce,fe]=B.useState(0),[Oe,We]=B.useState(0),Kt=B.useRef(null),tt=B.useRef(null),Cr=y===0,li=y+1<=b,Te=m.type,Vr=m.dismissible!==!1,Ep=m.className||"",Tp=m.descriptionClassName||"",An=B.useMemo(()=>v.findIndex(ae=>ae.toastId===m.id)||0,[v,m.id]),Ap=B.useMemo(()=>{var ae;return(ae=m.closeButton)!=null?ae:j},[m.closeButton,j]),Zu=B.useMemo(()=>m.duration||U||pb,[m.duration,U]),di=B.useRef(0),Gr=B.useRef(0),Xu=B.useRef(0),Wr=B.useRef(null),[ec,Pp]=P.split("-"),tc=B.useMemo(()=>v.reduce((ae,be,pe)=>pe>=An?ae:ae+be.height,0),[v,An]),rc=ib(),Dp=m.invert||h,fi=Te==="loading";Gr.current=B.useMemo(()=>An*Y+tc,[An,tc]),B.useEffect(()=>{te(!0)},[]),B.useLayoutEffect(()=>{if(!Z)return;let ae=tt.current,be=ae.style.height;ae.style.height="auto";let pe=ae.getBoundingClientRect().height;ae.style.height=be,We(pe),g(wt=>wt.find(_t=>_t.toastId===m.id)?wt.map(_t=>_t.toastId===m.id?{..._t,height:pe}:_t):[{toastId:m.id,height:pe,position:m.position},...wt])},[Z,m.title,m.description,g,m.id]);let Qt=B.useCallback(()=>{K(!0),fe(Gr.current),g(ae=>ae.filter(be=>be.toastId!==m.id)),setTimeout(()=>{k(m)},yb)},[m,k,g,Gr]);B.useEffect(()=>{if(m.promise&&Te==="loading"||m.duration===1/0||m.type==="loading")return;let ae,be=Zu;return _||x||$&&rc?(()=>{if(Xu.current<di.current){let pe=new Date().getTime()-di.current;be=be-pe}Xu.current=new Date().getTime()})():be!==1/0&&(di.current=new Date().getTime(),ae=setTimeout(()=>{var pe;(pe=m.onAutoClose)==null||pe.call(m,m),Qt()},be)),()=>clearTimeout(ae)},[_,x,Q,m,Zu,Qt,m.promise,Te,$,rc]),B.useEffect(()=>{let ae=tt.current;if(ae){let be=ae.getBoundingClientRect().height;return We(be),g(pe=>[{toastId:m.id,height:be,position:m.position},...pe]),()=>g(pe=>pe.filter(wt=>wt.toastId!==m.id))}},[g,m.id]),B.useEffect(()=>{m.delete&&Qt()},[Qt,m.delete]);function Rp(){return T!=null&&T.loading?B.createElement("div",{className:"sonner-loader","data-visible":Te==="loading"},T.loading):M?B.createElement("div",{className:"sonner-loader","data-visible":Te==="loading"},M):B.createElement(tb,{visible:Te==="loading"})}return B.createElement("li",{"aria-live":m.important?"assertive":"polite","aria-atomic":"true",role:"status",tabIndex:0,ref:tt,className:G(F,Ep,S==null?void 0:S.toast,(t=m==null?void 0:m.classNames)==null?void 0:t.toast,S==null?void 0:S.default,S==null?void 0:S[Te],(r=m==null?void 0:m.classNames)==null?void 0:r[Te]),"data-sonner-toast":"","data-rich-colors":(s=m.richColors)!=null?s:N,"data-styled":!(m.jsx||m.unstyled||p),"data-mounted":Z,"data-promise":!!m.promise,"data-removed":z,"data-visible":li,"data-y-position":ec,"data-x-position":Pp,"data-index":y,"data-front":Cr,"data-swiping":q,"data-dismissible":Vr,"data-type":Te,"data-invert":Dp,"data-swipe-out":se,"data-expanded":!!(_||Q&&Z),style:{"--index":y,"--toasts-before":y,"--z-index":w.length-y,"--offset":`${z?ce:Gr.current}px`,"--initial-height":Q?"auto":`${Oe}px`,...C,...m.style},onPointerDown:ae=>{fi||!Vr||(Kt.current=new Date,fe(Gr.current),ae.target.setPointerCapture(ae.pointerId),ae.target.tagName!=="BUTTON"&&(ee(!0),Wr.current={x:ae.clientX,y:ae.clientY}))},onPointerUp:()=>{var ae,be,pe,wt;if(se||!Vr)return;Wr.current=null;let _t=Number(((ae=tt.current)==null?void 0:ae.style.getPropertyValue("--swipe-amount").replace("px",""))||0),Pn=new Date().getTime()-((be=Kt.current)==null?void 0:be.getTime()),Ip=Math.abs(_t)/Pn;if(Math.abs(_t)>=bb||Ip>.11){fe(Gr.current),(pe=m.onDismiss)==null||pe.call(m,m),Qt(),X(!0);return}(wt=tt.current)==null||wt.style.setProperty("--swipe-amount","0px"),ee(!1)},onPointerMove:ae=>{var be;if(!Wr.current||!Vr)return;let pe=ae.clientY-Wr.current.y,wt=ae.clientX-Wr.current.x,_t=(ec==="top"?Math.min:Math.max)(0,pe),Pn=ae.pointerType==="touch"?10:2;Math.abs(_t)>Pn?(be=tt.current)==null||be.style.setProperty("--swipe-amount",`${pe}px`):Math.abs(wt)>Pn&&(Wr.current=null)}},Ap&&!m.jsx?B.createElement("button",{"aria-label":O,"data-disabled":fi,"data-close-button":!0,onClick:fi||!Vr?()=>{}:()=>{var ae;Qt(),(ae=m.onDismiss)==null||ae.call(m,m)},className:G(S==null?void 0:S.closeButton,(a=m==null?void 0:m.classNames)==null?void 0:a.closeButton)},B.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"},B.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),B.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))):null,m.jsx||B.isValidElement(m.title)?m.jsx||m.title:B.createElement(B.Fragment,null,Te||m.icon||m.promise?B.createElement("div",{"data-icon":"",className:G(S==null?void 0:S.icon,(i=m==null?void 0:m.classNames)==null?void 0:i.icon)},m.promise||m.type==="loading"&&!m.icon?m.icon||Rp():null,m.type!=="loading"?m.
391icon||(T==null?void 0:T[Te])||Xg(Te):null):null,B.createElement("div",{"data-content":"",className:G(S==null?void 0:S.content,(o=m==null?void 0:m.classNames)==null?void 0:o.content)},B.createElement("div",{"data-title":"",className:G(S==null?void 0:S.title,(u=m==null?void 0:m.classNames)==null?void 0:u.title)},m.title),m.description?B.createElement("div",{"data-description":"",className:G(E,Tp,S==null?void 0:S.description,(c=m==null?void 0:m.classNames)==null?void 0:c.description)},m.description):null),B.isValidElement(m.cancel)?m.cancel:m.cancel&&Fn(m.cancel)?B.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||I,onClick:ae=>{var be,pe;Fn(m.cancel)&&Vr&&((pe=(be=m.cancel).onClick)==null||pe.call(be,ae),Qt())},className:G(S==null?void 0:S.cancelButton,(l=m==null?void 0:m.classNames)==null?void 0:l.cancelButton)},m.cancel.label):null,B.isValidElement(m.action)?m.action:m.action&&Fn(m.action)?B.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||A,onClick:ae=>{var be,pe;Fn(m.action)&&(ae.defaultPrevented||((pe=(be=m.action).onClick)==null||pe.call(be,ae),Qt()))},className:G(S==null?void 0:S.actionButton,(d=m==null?void 0:m.classNames)==null?void 0:d.actionButton)},m.action.label):null))};function jc(){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}var _b=e=>{let{invert:t,position:r="bottom-right",hotkey:s=["altKey","KeyT"],expand:a,closeButton:i,className:o,offset:u,theme:c="light",richColors:l,duration:d,style:h,visibleToasts:m=hb,toastOptions:p,dir:x=jc(),gap:g=gb,loadingIcon:b,icons:v,containerAriaLabel:y="Notifications",pauseWhenPageIsHidden:w,cn:_=vb}=e,[k,N]=B.useState([]),j=B.useMemo(()=>Array.from(new Set([r].concat(k.filter($=>$.position).map($=>$.position)))),[k,r]),[C,I]=B.useState([]),[A,F]=B.useState(!1),[E,U]=B.useState(!1),[P,Y]=B.useState(c!=="system"?c:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),M=B.useRef(null),Q=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),S=B.useRef(null),T=B.useRef(!1),O=B.useCallback($=>{var G;(G=k.find(Z=>Z.id===$.id))!=null&&G.delete||Qe.dismiss($.id),N(Z=>Z.filter(({id:te})=>te!==$.id))},[k]);return B.useEffect(()=>Qe.subscribe($=>{if($.dismiss){N(G=>G.map(Z=>Z.id===$.id?{...Z,delete:!0}:Z));return}setTimeout(()=>{Wl.flushSync(()=>{N(G=>{let Z=G.findIndex(te=>te.id===$.id);return Z!==-1?[...G.slice(0,Z),{...G[Z],...$},...G.slice(Z+1)]:[$,...G]})})})}),[]),B.useEffect(()=>{if(c!=="system"){Y(c);return}c==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Y("dark"):Y("light")),typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",({matches:$})=>{Y($?"dark":"light")})},[c]),B.useEffect(()=>{k.length<=1&&F(!1)},[k]),B.useEffect(()=>{let $=G=>{var Z,te;s.every(z=>G[z]||G.code===z)&&(F(!0),(Z=M.current)==null||Z.focus()),G.code==="Escape"&&(document.activeElement===M.current||(te=M.current)!=null&&te.contains(document.activeElement))&&F(!1)};return document.addEventListener("keydown",$),()=>document.removeEventListener("keydown",$)},[s]),B.useEffect(()=>{if(M.current)return()=>{S.current&&(S.current.focus({preventScroll:!0}),S.current=null,T.current=!1)}},[M.current]),k.length?B.createElement("section",{"aria-label":`${y} ${Q}`,tabIndex:-1},j.map(($,G)=>{var Z;let[te,z]=$.split("-");return B.createElement("ol",{key:$,dir:x==="auto"?jc():x,tabIndex:-1,ref:M,className:o,"data-sonner-toaster":!0,"data-theme":P,"data-y-position":te,"data-x-position":z,style:{"--front-toast-height":`${((Z=C[0])==null?void 0:Z.height)||0}px`,"--offset":typeof u=="number"?`${u}px`:u||mb,"--width":`${xb}px`,"--gap":`${g}px`,...h},onBlur:K=>{T.current&&!K.currentTarget.contains(K.relatedTarget)&&(T.current=!1,S.current&&(S.current.focus({preventScroll:!0}),S.current=null))},onFocus:K=>{K.target instanceof HTMLElement&&K.target.dataset.dismissible==="false"||T.current||(T.current=!0,S.current=K.relatedTarget)},onMouseEnter:()=>F(!0),onMouseMove:()=>F(!0),onMouseLeave:()=>{E||F(!1)},onPointerDown:K=>{K.target instanceof HTMLElement&&K.target.dataset.dismissible==="false"||U(!0)},onPointerUp:()=>U(!1)},k.filter(K=>!K.position&&G===0||K.position===$).map((K,q)=>{var ee,se;return B.createElement(wb,{key:K.id,icons:v,index:q,toast:K,defaultRichColors:l,duration:(ee=p==null?void 0:p.duration)!=null?ee:d,className:p==null?void 0:p.className,descriptionClassName:p==null?void 0:p.descriptionClassName,invert:t,visibleToasts:m,closeButton:(se=p==null?void 0:p.closeButton)!=null?se:i,interacting:E,position:$,style:p==null?void 0:p.style,unstyled:p==null?void 0:p.unstyled,classNames:p==null?void 0:p.classNames,cancelButtonStyle:p==null?void 0:p.cancelButtonStyle,actionButtonStyle:p==null?void 0:p.actionButtonStyle,removeToast:O,toasts:k.filter(X=>X.position==K.position),heights:C.filter(X=>X.position==K.position),setHeights:I,expandByDefault:a,gap:g,loadingIcon:b,expanded:A,pauseWhenPageIsHidden:w,cn:_})}))})):null};const kb=({...e})=>{const{theme:t="system"}=$d();return n.jsx(_b,{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})};var jb=Fp.useId||(()=>{}),Nb=0;function ht(e){const[t,r]=f.useState(jb());return Me(()=>{e||r(s=>s??String(Nb++))},[e]),e||(t?`radix-${t}`:"")}const Cb=["top","right","bottom","left"],br=Math.min,Je=Math.max,na=Math.round,Mn=Math.floor,yr=e=>({x:e,y:e}
vendor: 11,524 bytes, line 391
391),Sb={left:"right",right:"left",bottom:"top",top:"bottom"},Eb={start:"end",end:"start"};function ao(e,t,r){return Je(e,br(t,r))}function Wt(e,t){return typeof e=="function"?e(t):e}function Yt(e){return e.split("-")[0]}function Ps(e){return e.split("-")[1]}function Wo(e){return e==="x"?"y":"x"}function Yo(e){return e==="y"?"height":"width"}function vr(e){return["top","bottom"].includes(Yt(e))?"y":"x"}function Ko(e){return Wo(vr(e))}function Tb(e,t,r){r===void 0&&(r=!1);const s=Ps(e),a=Ko(e),i=Yo(a);let o=a==="x"?s===(r?"end":"start")?"right":"left":s==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(o=aa(o)),[o,aa(o)]}function Ab(e){const t=aa(e);return[io(e),t,io(t)]}function io(e){return e.replace(/start|end/g,t=>Eb[t])}function Pb(e,t,r){const s=["left","right"],a=["right","left"],i=["top","bottom"],o=["bottom","top"];switch(e){case"top":case"bottom":return r?t?a:s:t?s:a;case"left":case"right":return t?i:o;default:return[]}}function Db(e,t,r,s){const a=Ps(e);let i=Pb(Yt(e),r==="start",s);return a&&(i=i.map(o=>o+"-"+a),t&&(i=i.concat(i.map(io)))),i}function aa(e){return e.replace(/left|right|bottom|top/g,t=>Sb[t])}function Rb(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ud(e){return typeof e!="number"?Rb(e):{top:e,right:e,bottom:e,left:e}}function ia(e){const{x:t,y:r,width:s,height:a}=e;return{width:s,height:a,top:r,left:t,right:t+s,bottom:r+a,x:t,y:r}}function Nc(e,t,r){let{reference:s,floating:a}=e;const i=vr(t),o=Ko(t),u=Yo(o),c=Yt(t),l=i==="y",d=s.x+s.width/2-a.width/2,h=s.y+s.height/2-a.height/2,m=s[u]/2-a[u]/2;let p;switch(c){case"top":p={x:d,y:s.y-a.height};break;case"bottom":p={x:d,y:s.y+s.height};break;case"right":p={x:s.x+s.width,y:h};break;case"left":p={x:s.x-a.width,y:h};break;default:p={x:s.x,y:s.y}}switch(Ps(t)){case"start":p[o]-=m*(r&&l?-1:1);break;case"end":p[o]+=m*(r&&l?-1:1);break}return p}const Ib=async(e,t,r)=>{const{placement:s="bottom",strategy:a="absolute",middleware:i=[],platform:o}=r,u=i.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t));let l=await o.getElementRects({reference:e,floating:t,strategy:a}),{x:d,y:h}=Nc(l,s,c),m=s,p={},x=0;for(let g=0;g<u.length;g++){const{name:b,fn:v}=u[g],{x:y,y:w,data:_,reset:k}=await v({x:d,y:h,initialPlacement:s,placement:m,strategy:a,middlewareData:p,rects:l,platform:o,elements:{reference:e,floating:t}});d=y??d,h=w??h,p={...p,[b]:{...p[b],..._}},k&&x<=50&&(x++,typeof k=="object"&&(k.placement&&(m=k.placement),k.rects&&(l=k.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:a}):k.rects),{x:d,y:h}=Nc(l,m,c)),g=-1)}return{x:d,y:h,placement:m,strategy:a,middlewareData:p}};async function en(e,t){var r;t===void 0&&(t={});const{x:s,y:a,platform:i,rects:o,elements:u,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:m=!1,padding:p=0}=Wt(t,e),x=Ud(p),b=u[m?h==="floating"?"reference":"floating":h],v=ia(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(b)))==null||r?b:b.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(u.floating)),boundary:l,rootBoundary:d,strategy:c})),y=h==="floating"?{x:s,y:a,width:o.floating.width,height:o.floating.height}:o.reference,w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u.floating)),_=await(i.isElement==null?void 0:i.isElement(w))?await(i.getScale==null?void 0:i.getScale(w))||{x:1,y:1}:{x:1,y:1},k=ia(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:y,offsetParent:w,strategy:c}):y);return{top:(v.top-k.top+x.top)/_.y,bottom:(k.bottom-v.bottom+x.bottom)/_.y,left:(v.left-k.left+x.left)/_.x,right:(k.right-v.right+x.right)/_.x}}const Fb=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:s,placement:a,rects:i,platform:o,elements:u,middlewareData:c}=t,{element:l,padding:d=0}=Wt(e,t)||{};if(l==null)return{};const h=Ud(d),m={x:r,y:s},p=Ko(a),x=Yo(p),g=await o.getDimensions(l),b=p==="y",v=b?"top":"left",y=b?"bottom":"right",w=b?"clientHeight":"clientWidth",_=i.reference[x]+i.reference[p]-m[p]-i.floating[x],k=m[p]-i.reference[p],N=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l));let j=N?N[w]:0;(!j||!await(o.isElement==null?void 0:o.isElement(N)))&&(j=u.floating[w]||i.floating[x]);const C=_/2-k/2,I=j/2-g[x]/2-1,A=br(h[v],I),F=br(h[y],I),E=A,U=j-g[x]-F,P=j/2-g[x]/2+C,Y=ao(E,P,U),M=!c.arrow&&Ps(a)!=null&&P!==Y&&i.reference[x]/2-(P<E?A:F)-g[x]/2<0,Q=M?P<E?P-E:P-U:0;return{[p]:m[p]+Q,data:{[p]:Y,centerOffset:P-Y-Q,...M&&{alignmentOffset:Q}},reset:M}}}),Mb=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,s;const{placement:a,middlewareData:i,rects:o,initialPlacement:u,platform:c,elements:l}=t,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:m,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:g=!0,...b}=Wt(e,t);if((r=i.arrow)!=null&&r.alignmentOffset)return{};const v=Yt(a),y=vr(u),w=Yt(u)===u,_=await(c.isRTL==null?void 0:c.isRTL(l.floating)),k=m||(w||!g?[aa(u)]:Ab(u)),N=x!=="none";!m&&N&&k.push(...Db(u,g,x,_));const j=[u,...k],C=await en(t,b),I=[];let A=((s=i.flip)==null?void 0:s.overflows)||[];if(d&&I.push(C[v]),h){const P=Tb(a,o,_);I.push(C[P[0]],C[P[1]])}if(A=[...A,{placement:a,overflows:I}],!I.every(P=>P<=0)){var F,E;const P=(((F=i.flip)==null?void 0:F.index)||0)+1,Y=j[P];if(Y)return{data:{index:P,overflows:A},reset:{placement:Y}};let M=(E=A.filter(Q=>Q.overflows[0]<=0).sort((Q,S)=>Q.overflows[1]-S.overflows[1])[0])==null?void 0:E.placement;if(!M)switch(p){case"bestFit":{var U;const Q=(U=A.filter(S=>{if(N){const T=vr(S.placement);return T===y||T==="y"}return!0}).map(S=>[S.placement,S.overflows.filter(T=>T>0).reduce((T,O)=>T+O,0)]).sort((S,T)=>S[1]-T[1])[0])==null?void 0:U[0];Q&&(M=Q);break}case"initialPlacement":M=u;break}if(a!==M)return{reset:{placement:M}}}return{}}}};function Cc(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Sc(e){return Cb.some(t=>e[t]>=0)}const Ob=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:s="referenceHidden",...a}=Wt(e,t);switch(s){case"referenceHidden":{const i=await en(t,{...a,elementContext:"reference"}),o=Cc(i,r.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:Sc(o)}}}case"escaped":{const i=await en(t,{...a,altBoundary:!0}),o=Cc(i,r.floating);return{data:{escapedOffsets:o,escaped:Sc(o)}}}default:return{}}}}};async function Lb(e,t){const{placement:r,platform:s,elements:a}=e,i=await(s.isRTL==null?void 0:s.isRTL(a.floating)),o=Yt(r),u=Ps(r),c=vr(r)==="y",l=["left","top"].includes(o)?-1:1,d=i&&c?-1:1,h=Wt(t,e);let{mainAxis:m,crossAxis:p,alignmentAxis:x}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return u&&typeof x=="number"&&(p=u==="end"?x*-1:x),c?{x:p*d,y:m*l}:{x:m*l,y:p*d}}const $b=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,s;const{x:a,y:i,placement:o,middlewareData:u}=t,c=await Lb(t,e);return o===((r=u.offset)==null?void 0:r.placement)&&(s=u.arrow)!=null&&s.alignmentOffset?{}:{x:a+c.x,y:i+c.y,data:{...c,placement:o}}}}},Ub=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:s,placement:a}=t,{mainAxis:i=!0,crossAxis:o=!1,limiter:u={fn:b=>{let{x:v,y}=b;return{x:v,y}}},...c}=Wt(e,t),l={x:r,y:s},d=await en(t,c),h=vr(Yt(a)),m=Wo(h);let p=l[m],x=l[h];if(i){const b=m==="y"?"top":"left",v=m==="y"?"bottom":"right",y=p+d[b],w=p-d[v];p=ao(y,p,w)}if(o){const b=h==="y"?"top":"left",v=h==="y"?"bottom":"right",y=x+d[b],w=x-d[v];x=ao(y,x,w)}const g=u.fn({...t,[m]:p,[h]:x});return{...g,data:{x:g.x-r,y:g.y-s,enabled:{[m]:i,[h]:o}}}}}},zb=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:s,placement:a,rects:i,middlewareData:o}=t,{offset:u=0,mainAxis:c=!0,crossAxis:l=!0}=Wt(e,t),d={x:r,y:s},h=vr(a),m=Wo(h);let p=d[m],x=d[h];const g=Wt(u,t),b=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(c){const w=m==="y"?"height":"width",_=i.reference[m]-i.floating[w]+b.mainAxis,k=i.reference[m]+i.reference[w]-b.mainAxis;p<_?p=_:p>k&&(p=k)}if(l){var v,y;const w=m==="y"?"width":"height",_=["top","left"].includes(Yt(a)),k=i.reference[h]-i.floating[w]+(_&&((v=o.offset)==null?void 0:v[h])||0)+(_?0:b.crossAxis),N=i.reference[h]+i.reference[w]+(_?0:((y=o.offset)==null?void 0:y[h])||0)-(_?b.crossAxis:0);x<k?x=k:x>N&&(x=N)}return{[m]:p,[h]:x}}}},Bb=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,s;const{placement:a,rects:i,platform:o,elements:u}=t,{apply:c=()=>{},...l}=Wt(e,t),d=await en(t,l),h=Yt(a),m=Ps(a),p=vr(a)==="y",{width:x,height:g}=i.floating;let b,v;h==="top"||h==="bottom"?(b=h,v=m===(await(o.isRTL==null?void 0:o.isRTL(u.floating))?"start":"end")?"left":"right"):(v=h,b=m==="end"?"top":"bottom");const y=g-d.top-d.bottom,w=x-d.left-d.right,_=br(g-d[b],y),k=br(x-d[v],w),N=!t.middlewareData.shift;let j=_,C=k;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(C=w),(s=t.middlewareData.shift)!=null&&s.enabled.y&&(j=y),N&&!m){const A=Je(d.left,0),F=Je(d.right,0),E=Je(d.top,0),U=Je(d.bottom,0);p?C=x-2*(A!==0||F!==0?A+F:Je(d.left,d.right)):j=g-2*(E!==0||U!==0?E+U:Je(d.top,d.bottom))}await c({...t,availableWidth:C,availableHeight:j});const I=await o.getDimensions(u.floating);return x!==I.width||g!==I.height?{reset:{rects:!0}}:{}}}};function Ea(){return typeof window<"u"}function Ds(e){return zd(e)?(e.nodeName||"").toLowerCase():"#document"}function Ze(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ot(e){var t;return(t=(zd(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function zd(e){return Ea()?e instanceof Node||e instanceof Ze(e).Node:!1}function pt(e){return Ea()?e instanceof Element||e instanceof Ze(e).Element:!1}function It(e){return Ea()?e instanceof HTMLElement||e instanceof Ze(e).HTMLElement:!1}function Ec(e){return!Ea()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ze(e).ShadowRoot}function gn(e){const{overflow:t,overflowX:r,overflowY:s,display:a}=xt(e);return/auto|scroll|overlay|hidden|clip/.test(t+s+r)&&!["inline","contents"].includes(a)}function qb(e){return["table","td","th"].includes(Ds(e))}function Ta(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Qo(e){const t=Jo(),r=pt(e)?xt(e):e;return r.transform!=="none"||r.perspective!=="none"||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||["transform","perspective","filter"].some(s=>(r.willChange||"").includes(s))||["paint","layout","strict","content"].some(s=>(r.contain||"").includes(s))}function Hb(e){let t=wr(e);for(;It(t)&&!ys(t);){if(Qo(t))return t;if(Ta(t))return null;t=wr(t)}return null}function Jo(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ys(e){return["html","body","#document"].includes(Ds(e))}function xt(e){return Ze(e).getComputedStyle(e)}function Aa(e){return pt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function wr(e){if(Ds(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ec(e)&&e.host||Ot(e);return Ec(t)?t.host:t}function Bd(e){const t=wr(e);return ys(t)?e.ownerDocument?e.ownerDocument.body:e.body:It(t)&&gn(t)?t:Bd(t)}function tn(e,t,r){var s;
vendor: 5,385 bytes, line 391
391t===void 0&&(t=[]),r===void 0&&(r=!0);const a=Bd(e),i=a===((s=e.ownerDocument)==null?void 0:s.body),o=Ze(a);if(i){const u=oo(o);return t.concat(o,o.visualViewport||[],gn(a)?a:[],u&&r?tn(u):[])}return t.concat(a,tn(a,[],r))}function oo(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function qd(e){const t=xt(e);let r=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const a=It(e),i=a?e.offsetWidth:r,o=a?e.offsetHeight:s,u=na(r)!==i||na(s)!==o;return u&&(r=i,s=o),{width:r,height:s,$:u}}function Zo(e){return pt(e)?e:e.contextElement}function ss(e){const t=Zo(e);if(!It(t))return yr(1);const r=t.getBoundingClientRect(),{width:s,height:a,$:i}=qd(t);let o=(i?na(r.width):r.width)/s,u=(i?na(r.height):r.height)/a;return(!o||!Number.isFinite(o))&&(o=1),(!u||!Number.isFinite(u))&&(u=1),{x:o,y:u}}const Vb=yr(0);function Hd(e){const t=Ze(e);return!Jo()||!t.visualViewport?Vb:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Gb(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==Ze(e)?!1:t}function Fr(e,t,r,s){t===void 0&&(t=!1),r===void 0&&(r=!1);const a=e.getBoundingClientRect(),i=Zo(e);let o=yr(1);t&&(s?pt(s)&&(o=ss(s)):o=ss(e));const u=Gb(i,r,s)?Hd(i):yr(0);let c=(a.left+u.x)/o.x,l=(a.top+u.y)/o.y,d=a.width/o.x,h=a.height/o.y;if(i){const m=Ze(i),p=s&&pt(s)?Ze(s):s;let x=m,g=oo(x);for(;g&&s&&p!==x;){const b=ss(g),v=g.getBoundingClientRect(),y=xt(g),w=v.left+(g.clientLeft+parseFloat(y.paddingLeft))*b.x,_=v.top+(g.clientTop+parseFloat(y.paddingTop))*b.y;c*=b.x,l*=b.y,d*=b.x,h*=b.y,c+=w,l+=_,x=Ze(g),g=oo(x)}}return ia({width:d,height:h,x:c,y:l})}function Wb(e){let{elements:t,rect:r,offsetParent:s,strategy:a}=e;const i=a==="fixed",o=Ot(s),u=t?Ta(t.floating):!1;if(s===o||u&&i)return r;let c={scrollLeft:0,scrollTop:0},l=yr(1);const d=yr(0),h=It(s);if((h||!h&&!i)&&((Ds(s)!=="body"||gn(o))&&(c=Aa(s)),It(s))){const m=Fr(s);l=ss(s),d.x=m.x+s.clientLeft,d.y=m.y+s.clientTop}return{width:r.width*l.x,height:r.height*l.y,x:r.x*l.x-c.scrollLeft*l.x+d.x,y:r.y*l.y-c.scrollTop*l.y+d.y}}function Yb(e){return Array.from(e.getClientRects())}function uo(e,t){const r=Aa(e).scrollLeft;return t?t.left+r:Fr(Ot(e)).left+r}function Kb(e){const t=Ot(e),r=Aa(e),s=e.ownerDocument.body,a=Je(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),i=Je(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let o=-r.scrollLeft+uo(e);const u=-r.scrollTop;return xt(s).direction==="rtl"&&(o+=Je(t.clientWidth,s.clientWidth)-a),{width:a,height:i,x:o,y:u}}function Qb(e,t){const r=Ze(e),s=Ot(e),a=r.visualViewport;let i=s.clientWidth,o=s.clientHeight,u=0,c=0;if(a){i=a.width,o=a.height;const l=Jo();(!l||l&&t==="fixed")&&(u=a.offsetLeft,c=a.offsetTop)}return{width:i,height:o,x:u,y:c}}function Jb(e,t){const r=Fr(e,!0,t==="fixed"),s=r.top+e.clientTop,a=r.left+e.clientLeft,i=It(e)?ss(e):yr(1),o=e.clientWidth*i.x,u=e.clientHeight*i.y,c=a*i.x,l=s*i.y;return{width:o,height:u,x:c,y:l}}function Tc(e,t,r){let s;if(t==="viewport")s=Qb(e,r);else if(t==="document")s=Kb(Ot(e));else if(pt(t))s=Jb(t,r);else{const a=Hd(e);s={...t,x:t.x-a.x,y:t.y-a.y}}return ia(s)}function Vd(e,t){const r=wr(e);return r===t||!pt(r)||ys(r)?!1:xt(r).position==="fixed"||Vd(r,t)}function Zb(e,t){const r=t.get(e);if(r)return r;let s=tn(e,[],!1).filter(u=>pt(u)&&Ds(u)!=="body"),a=null;const i=xt(e).position==="fixed";let o=i?wr(e):e;for(;pt(o)&&!ys(o);){const u=xt(o),c=Qo(o);!c&&u.position==="fixed"&&(a=null),(i?!c&&!a:!c&&u.position==="static"&&!!a&&["absolute","fixed"].includes(a.position)||gn(o)&&!c&&Vd(e,o))?s=s.filter(d=>d!==o):a=u,o=wr(o)}return t.set(e,s),s}function Xb(e){let{element:t,boundary:r,rootBoundary:s,strategy:a}=e;const o=[...r==="clippingAncestors"?Ta(t)?[]:Zb(t,this._c):[].concat(r),s],u=o[0],c=o.reduce((l,d)=>{const h=Tc(t,d,a);return l.top=Je(h.top,l.top),l.right=br(h.right,l.right),l.bottom=br(h.bottom,l.bottom),l.left=Je(h.left,l.left),l},Tc(t,u,a));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function e1(e){const{width:t,height:r}=qd(e);return{width:t,height:r}}function t1(e,t,r){const s=It(t),a=Ot(t),i=r==="fixed",o=Fr(e,!0,i,t);let u={scrollLeft:0,scrollTop:0};const c=yr(0);if(s||!s&&!i)if((Ds(t)!=="body"||gn(a))&&(u=Aa(t)),s){const p=Fr(t,!0,i,t);c.x=p.x+t.clientLeft,c.y=p.y+t.clientTop}else a&&(c.x=uo(a));let l=0,d=0;if(a&&!s&&!i){const p=a.getBoundingClientRect();d=p.top+u.scrollTop,l=p.left+u.scrollLeft-uo(a,p)}const h=o.left+u.scrollLeft-c.x-l,m=o.top+u.scrollTop-c.y-d;return{x:h,y:m,width:o.width,height:o.height}}function bi(e){return xt(e).position==="static"}function Ac(e,t){if(!It(e)||xt(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Ot(e)===r&&(r=r.ownerDocument.body),r}function Gd(e,t){const r=Ze(e);if(Ta(e))return r;if(!It(e)){let a=wr(e);for(;a&&!ys(a);){if(pt(a)&&!bi(a))return a;a=wr(a)}return r}let s=Ac(e,t);for(;s&&qb(s)&&bi(s);)s=Ac(s,t);return s&&ys(s)&&bi(s)&&!Qo(s)?r:s||Hb(e)||r}const r1=async function(e){const t=this.getOffsetParent||Gd,r=this.getDimensions,s=await r(e.floating);return{reference:t1(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function s1(e){return xt(e).direction==="rtl"}const n1={convertOffsetParentRelativeRectToViewportRelativeRect:Wb,getDocumentElement:Ot,getClippingRect:Xb,getOffsetParent:Gd,getElementRects:r1,getClientRects:Yb,getDimensions:e1,getScale:ss,isElement:pt,
vendor: 9,301 bytes, line 391
391isRTL:s1};function a1(e,t){let r=null,s;const a=Ot(e);function i(){var u;clearTimeout(s),(u=r)==null||u.disconnect(),r=null}function o(u,c){u===void 0&&(u=!1),c===void 0&&(c=1),i();const{left:l,top:d,width:h,height:m}=e.getBoundingClientRect();if(u||t(),!h||!m)return;const p=Mn(d),x=Mn(a.clientWidth-(l+h)),g=Mn(a.clientHeight-(d+m)),b=Mn(l),y={rootMargin:-p+"px "+-x+"px "+-g+"px "+-b+"px",threshold:Je(0,br(1,c))||1};let w=!0;function _(k){const N=k[0].intersectionRatio;if(N!==c){if(!w)return o();N?o(!1,N):s=setTimeout(()=>{o(!1,1e-7)},1e3)}w=!1}try{r=new IntersectionObserver(_,{...y,root:a.ownerDocument})}catch{r=new IntersectionObserver(_,y)}r.observe(e)}return o(!0),i}function i1(e,t,r,s){s===void 0&&(s={});const{ancestorScroll:a=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:c=!1}=s,l=Zo(e),d=a||i?[...l?tn(l):[],...tn(t)]:[];d.forEach(v=>{a&&v.addEventListener("scroll",r,{passive:!0}),i&&v.addEventListener("resize",r)});const h=l&&u?a1(l,r):null;let m=-1,p=null;o&&(p=new ResizeObserver(v=>{let[y]=v;y&&y.target===l&&p&&(p.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var w;(w=p)==null||w.observe(t)})),r()}),l&&!c&&p.observe(l),p.observe(t));let x,g=c?Fr(e):null;c&&b();function b(){const v=Fr(e);g&&(v.x!==g.x||v.y!==g.y||v.width!==g.width||v.height!==g.height)&&r(),g=v,x=requestAnimationFrame(b)}return r(),()=>{var v;d.forEach(y=>{a&&y.removeEventListener("scroll",r),i&&y.removeEventListener("resize",r)}),h==null||h(),(v=p)==null||v.disconnect(),p=null,c&&cancelAnimationFrame(x)}}const o1=$b,u1=Ub,c1=Mb,l1=Bb,d1=Ob,Pc=Fb,f1=zb,h1=(e,t,r)=>{const s=new Map,a={platform:n1,...r},i={...a.platform,_c:s};return Ib(e,t,{...a,platform:i})};var Zn=typeof document<"u"?f.useLayoutEffect:f.useEffect;function oa(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 r,s,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(s=r;s--!==0;)if(!oa(e[s],t[s]))return!1;return!0}if(a=Object.keys(e),r=a.length,r!==Object.keys(t).length)return!1;for(s=r;s--!==0;)if(!{}.hasOwnProperty.call(t,a[s]))return!1;for(s=r;s--!==0;){const i=a[s];if(!(i==="_owner"&&e.$$typeof)&&!oa(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Wd(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Dc(e,t){const r=Wd(e);return Math.round(t*r)/r}function yi(e){const t=f.useRef(e);return Zn(()=>{t.current=e}),t}function m1(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:s=[],platform:a,elements:{reference:i,floating:o}={},transform:u=!0,whileElementsMounted:c,open:l}=e,[d,h]=f.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[m,p]=f.useState(s);oa(m,s)||p(s);const[x,g]=f.useState(null),[b,v]=f.useState(null),y=f.useCallback(S=>{S!==N.current&&(N.current=S,g(S))},[]),w=f.useCallback(S=>{S!==j.current&&(j.current=S,v(S))},[]),_=i||x,k=o||b,N=f.useRef(null),j=f.useRef(null),C=f.useRef(d),I=c!=null,A=yi(c),F=yi(a),E=yi(l),U=f.useCallback(()=>{if(!N.current||!j.current)return;const S={placement:t,strategy:r,middleware:m};F.current&&(S.platform=F.current),h1(N.current,j.current,S).then(T=>{const O={...T,isPositioned:E.current!==!1};P.current&&!oa(C.current,O)&&(C.current=O,Cs.flushSync(()=>{h(O)}))})},[m,t,r,F,E]);Zn(()=>{l===!1&&C.current.isPositioned&&(C.current.isPositioned=!1,h(S=>({...S,isPositioned:!1})))},[l]);const P=f.useRef(!1);Zn(()=>(P.current=!0,()=>{P.current=!1}),[]),Zn(()=>{if(_&&(N.current=_),k&&(j.current=k),_&&k){if(A.current)return A.current(_,k,U);U()}},[_,k,U,A,I]);const Y=f.useMemo(()=>({reference:N,floating:j,setReference:y,setFloating:w}),[y,w]),M=f.useMemo(()=>({reference:_,floating:k}),[_,k]),Q=f.useMemo(()=>{const S={position:r,left:0,top:0};if(!M.floating)return S;const T=Dc(M.floating,d.x),O=Dc(M.floating,d.y);return u?{...S,transform:"translate("+T+"px, "+O+"px)",...Wd(M.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:T,top:O}},[r,u,M.floating,d.x,d.y]);return f.useMemo(()=>({...d,update:U,refs:Y,elements:M,floatingStyles:Q}),[d,U,Y,M,Q])}const p1=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:s,padding:a}=typeof e=="function"?e(r):e;return s&&t(s)?s.current!=null?Pc({element:s.current,padding:a}).fn(r):{}:s?Pc({element:s,padding:a}).fn(r):{}}}},x1=(e,t)=>({...o1(e),options:[e,t]}),g1=(e,t)=>({...u1(e),options:[e,t]}),b1=(e,t)=>({...f1(e),options:[e,t]}),y1=(e,t)=>({...c1(e),options:[e,t]}),v1=(e,t)=>({...l1(e),options:[e,t]}),w1=(e,t)=>({...d1(e),options:[e,t]}),_1=(e,t)=>({...p1(e),options:[e,t]});var k1="Arrow",Yd=f.forwardRef((e,t)=>{const{children:r,width:s=10,height:a=5,...i}=e;return n.jsx(re.svg,{...i,ref:t,width:s,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:n.jsx("polygon",{points:"0,0 30,0 15,10"})})});Yd.displayName=k1;var j1=Yd;function N1(e,t=[]){let r=[];function s(i,o){const u=f.createContext(o),c=r.length;r=[...r,o];function l(h){const{scope:m,children:p,...x}=h,g=(m==null?void 0:m[e][c])||u,b=f.useMemo(()=>x,Object.values(x));return n.jsx(g.Provider,{value:b,children:p})}function d(h,m){const p=(m==null?void 0:m[e][c])||u,x=f.useContext(p);if(x)return x;if(o!==void 0)return o;throw new Error(`\`${h}\` must be used within \`${i}\``)}return l.displayName=i+"Provider",[l,d]}const a=()=>{const i=r.map(o=>f.createContext(o));return function(u){const c=(u==null?void 0:u[e])||i;return f.useMemo(()=>({[`__scope${e}`]:{...u,[e]:c}}),[u,c])}};return a.scopeName=e,[s,C1(a,...t)]}function C1(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const s=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const o=s.reduce((u,{useScope:c,scopeName:l})=>{const h=c(i)[`__scope${l}`];return{...u,...h}},{});return f.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}function Kd(e){const[t,r]=f.useState(void 0);return Me(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const s=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const i=a[0];let o,u;if("borderBoxSize"in i){const c=i.borderBoxSize,l=Array.isArray(c)?c[0]:c;o=l.inlineSize,u=l.blockSize}else o=e.offsetWidth,u=e.offsetHeight;r({width:o,height:u})});return s.observe(e,{box:"border-box"}),()=>s.unobserve(e)}else r(void 0)},[e]),t}var Xo="Popper",[Qd,Rs]=N1(Xo),[S1,Jd]=Qd(Xo),Zd=e=>{const{__scopePopper:t,children:r}=e,[s,a]=f.useState(null);return n.jsx(S1,{scope:t,anchor:s,onAnchorChange:a,children:r})};Zd.displayName=Xo;var Xd="PopperAnchor",ef=f.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:s,...a}=e,i=Jd(Xd,r),o=f.useRef(null),u=he(t,o);return f.useEffect(()=>{i.onAnchorChange((s==null?void 0:s.current)||o.current)}),s?null:n.jsx(re.div,{...a,ref:u})});ef.displayName=Xd;var eu="PopperContent",[E1,T1]=Qd(eu),tf=f.forwardRef((e,t)=>{var q,ee,se,X,ce,fe;const{__scopePopper:r,side:s="bottom",sideOffset:a=0,align:i="center",alignOffset:o=0,arrowPadding:u=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:d=0,sticky:h="partial",hideWhenDetached:m=!1,updatePositionStrategy:p="optimized",onPlaced:x,...g}=e,b=Jd(eu,r),[v,y]=f.useState(null),w=he(t,Oe=>y(Oe)),[_,k]=f.useState(null),N=Kd(_),j=(N==null?void 0:N.width)??0,C=(N==null?void 0:N.height)??0,I=s+(i!=="center"?"-"+i:""),A=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},F=Array.isArray(l)?l:[l],E=F.length>0,U={padding:A,boundary:F.filter(P1),altBoundary:E},{refs:P,floatingStyles:Y,placement:M,isPositioned:Q,middlewareData:S}=m1({strategy:"fixed",placement:I,whileElementsMounted:(...Oe)=>i1(...Oe,{animationFrame:p==="always"}),elements:{reference:b.anchor},middleware:[x1({mainAxis:a+C,alignmentAxis:o}),c&&g1({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?b1():void 0,...U}),c&&y1({...U}),v1({...U,apply:({elements:Oe,rects:We,availableWidth:Kt,availableHeight:tt})=>{const{width:Cr,height:li}=We.reference,Te=Oe.floating.style;Te.setProperty("--radix-popper-available-width",`${Kt}px`),Te.setProperty("--radix-popper-available-height",`${tt}px`),Te.setProperty("--radix-popper-anchor-width",`${Cr}px`),Te.setProperty("--radix-popper-anchor-height",`${li}px`)}}),_&&_1({element:_,padding:u}),D1({arrowWidth:j,arrowHeight:C}),m&&w1({strategy:"referenceHidden",...U})]}),[T,O]=nf(M),$=Fe(x);Me(()=>{Q&&($==null||$())},[Q,$]);const G=(q=S.arrow)==null?void 0:q.x,Z=(ee=S.arrow)==null?void 0:ee.y,te=((se=S.arrow)==null?void 0:se.centerOffset)!==0,[z,K]=f.useState();return Me(()=>{v&&K(window.getComputedStyle(v).zIndex)},[v]),n.jsx("div",{ref:P.setFloating,"data-radix-popper-content-wrapper":"",style:{...Y,transform:Q?Y.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:z,"--radix-popper-transform-origin":[(X=S.transformOrigin)==null?void 0:X.x,(ce=S.transformOrigin)==null?void 0:ce.y].join(" "),...((fe=S.hide)==null?void 0:fe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:n.jsx(E1,{scope:r,placedSide:T,onArrowChange:k,arrowX:G,arrowY:Z,shouldHideArrow:te,children:n.jsx(re.div,{"data-side":T,"data-align":O,...g,ref:w,style:{...g.style,animation:Q?void 0:"none"}})})})});tf.displayName=eu;
vendor: 4,301 bytes, line 391
391var rf="PopperArrow",A1={top:"bottom",right:"left",bottom:"top",left:"right"},sf=f.forwardRef(function(t,r){const{__scopePopper:s,...a}=t,i=T1(rf,s),o=A1[i.placedSide];return n.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:n.jsx(j1,{...a,ref:r,style:{...a.style,display:"block"}})})});sf.displayName=rf;function P1(e){return e!==null}var D1=e=>({name:"transformOrigin",options:e,fn(t){var b,v,y;const{placement:r,rects:s,middlewareData:a}=t,o=((b=a.arrow)==null?void 0:b.centerOffset)!==0,u=o?0:e.arrowWidth,c=o?0:e.arrowHeight,[l,d]=nf(r),h={start:"0%",center:"50%",end:"100%"}[d],m=(((v=a.arrow)==null?void 0:v.x)??0)+u/2,p=(((y=a.arrow)==null?void 0:y.y)??0)+c/2;let x="",g="";return l==="bottom"?(x=o?h:`${m}px`,g=`${-c}px`):l==="top"?(x=o?h:`${m}px`,g=`${s.floating.height+c}px`):l==="right"?(x=`${-c}px`,g=o?h:`${p}px`):l==="left"&&(x=`${s.floating.width+c}px`,g=o?h:`${p}px`),{data:{x,y:g}}}});function nf(e){const[t,r="center"]=e.split("-");return[t,r]}var tu=Zd,ru=ef,su=tf,nu=sf,[Pa,ON]=kr("Tooltip",[Rs]),Da=Rs(),af="TooltipProvider",R1=700,co="tooltip.open",[I1,au]=Pa(af),of=e=>{const{__scopeTooltip:t,delayDuration:r=R1,skipDelayDuration:s=300,disableHoverableContent:a=!1,children:i}=e,[o,u]=f.useState(!0),c=f.useRef(!1),l=f.useRef(0);return f.useEffect(()=>{const d=l.current;return()=>window.clearTimeout(d)},[]),n.jsx(I1,{scope:t,isOpenDelayed:o,delayDuration:r,onOpen:f.useCallback(()=>{window.clearTimeout(l.current),u(!1)},[]),onClose:f.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>u(!0),s)},[s]),isPointerInTransitRef:c,onPointerInTransitChange:f.useCallback(d=>{c.current=d},[]),disableHoverableContent:a,children:i})};of.displayName=af;var Ra="Tooltip",[F1,Ia]=Pa(Ra),uf=e=>{const{__scopeTooltip:t,children:r,open:s,defaultOpen:a=!1,onOpenChange:i,disableHoverableContent:o,delayDuration:u}=e,c=au(Ra,e.__scopeTooltip),l=Da(t),[d,h]=f.useState(null),m=ht(),p=f.useRef(0),x=o??c.disableHoverableContent,g=u??c.delayDuration,b=f.useRef(!1),[v=!1,y]=Vt({prop:s,defaultProp:a,onChange:j=>{j?(c.onOpen(),document.dispatchEvent(new CustomEvent(co))):c.onClose(),i==null||i(j)}}),w=f.useMemo(()=>v?b.current?"delayed-open":"instant-open":"closed",[v]),_=f.useCallback(()=>{window.clearTimeout(p.current),p.current=0,b.current=!1,y(!0)},[y]),k=f.useCallback(()=>{window.clearTimeout(p.current),p.current=0,y(!1)},[y]),N=f.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{b.current=!0,y(!0),p.current=0},g)},[g,y]);return f.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),n.jsx(tu,{...l,children:n.jsx(F1,{scope:t,contentId:m,open:v,stateAttribute:w,trigger:d,onTriggerChange:h,onTriggerEnter:f.useCallback(()=>{c.isOpenDelayed?N():_()},[c.isOpenDelayed,N,_]),onTriggerLeave:f.useCallback(()=>{x?k():(window.clearTimeout(p.current),p.current=0)},[k,x]),onOpen:_,onClose:k,disableHoverableContent:x,children:r})})};uf.displayName=Ra;var lo="TooltipTrigger",cf=f.forwardRef((e,t)=>{const{__scopeTooltip:r,...s}=e,a=Ia(lo,r),i=au(lo,r),o=Da(r),u=f.useRef(null),c=he(t,u,a.onTriggerChange),l=f.useRef(!1),d=f.useRef(!1),h=f.useCallback(()=>l.current=!1,[]);return f.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),n.jsx(ru,{asChild:!0,...o,children:n.jsx(re.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...s,ref:c,onPointerMove:H(e.onPointerMove,m=>{m.pointerType!=="touch"&&!d.current&&!i.isPointerInTransitRef.current&&(a.onTriggerEnter(),d.current=!0)}),onPointerLeave:H(e.onPointerLeave,()=>{a.onTriggerLeave(),d.current=!1}),onPointerDown:H(e.onPointerDown,()=>{l.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:H(e.onFocus,()=>{l.current||a.onOpen()}),onBlur:H(e.onBlur,a.onClose),onClick:H(e.onClick,a.onClose)})})});cf.displayName=lo;var M1="TooltipPortal",[LN,O1]=Pa(M1,{forceMount:void 0}),vs="TooltipContent",lf=f.forwardRef((e,t)=>
vendor: 2,989 bytes, line 391
391{const r=O1(vs,e.__scopeTooltip),{forceMount:s=r.forceMount,side:a="top",...i}=e,o=Ia(vs,e.__scopeTooltip);return n.jsx(bt,{present:s||o.open,children:o.disableHoverableContent?n.jsx(df,{side:a,...i,ref:t}):n.jsx(L1,{side:a,...i,ref:t})})}),L1=f.forwardRef((e,t)=>{const r=Ia(vs,e.__scopeTooltip),s=au(vs,e.__scopeTooltip),a=f.useRef(null),i=he(t,a),[o,u]=f.useState(null),{trigger:c,onClose:l}=r,d=a.current,{onPointerInTransitChange:h}=s,m=f.useCallback(()=>{u(null),h(!1)},[h]),p=f.useCallback((x,g)=>{const b=x.currentTarget,v={x:x.clientX,y:x.clientY},y=B1(v,b.getBoundingClientRect()),w=q1(v,y),_=H1(g.getBoundingClientRect()),k=G1([...w,..._]);u(k),h(!0)},[h]);return f.useEffect(()=>()=>m(),[m]),f.useEffect(()=>{if(c&&d){const x=b=>p(b,d),g=b=>p(b,c);return c.addEventListener("pointerleave",x),d.addEventListener("pointerleave",g),()=>{c.removeEventListener("pointerleave",x),d.removeEventListener("pointerleave",g)}}},[c,d,p,m]),f.useEffect(()=>{if(o){const x=g=>{const b=g.target,v={x:g.clientX,y:g.clientY},y=(c==null?void 0:c.contains(b))||(d==null?void 0:d.contains(b)),w=!V1(v,o);y?m():w&&(m(),l())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[c,d,o,l,m]),n.jsx(df,{...e,ref:i})}),[$1,U1]=Pa(Ra,{isInside:!1}),df=f.forwardRef((e,t)=>{const{__scopeTooltip:r,children:s,"aria-label":a,onEscapeKeyDown:i,onPointerDownOutside:o,...u}=e,c=Ia(vs,r),l=Da(r),{onClose:d}=c;return f.useEffect(()=>(document.addEventListener(co,d),()=>document.removeEventListener(co,d)),[d]),f.useEffect(()=>{if(c.trigger){const h=m=>{const p=m.target;p!=null&&p.contains(c.trigger)&&d()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[c.trigger,d]),n.jsx(Ss,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:h=>h.preventDefault(),onDismiss:d,children:n.jsxs(su,{"data-state":c.stateAttribute,...l,...u,ref:t,style:{...u.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:[n.jsx(Ql,{children:s}),n.jsx($1,{scope:r,isInside:!0,children:n.jsx(vx,{id:c.contentId,role:"tooltip",children:a||s})})]})})});lf.displayName=vs;var ff="TooltipArrow",z1=f.forwardRef((e,t)=>{const{__scopeTooltip:r,...s}=e,a=Da(r);return U1(ff,r).isInside?null:n.jsx(nu,{...a,...s,ref:t})});z1.displayName=ff;function B1(e,t){const r=Math.abs(t.top-e.y),s=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(r,s,a,i)){case i:return"left";case a:return"right";case r:return"top";case s:return"bottom";default:throw new Error("unreachable")}}function q1(e,t,r=5){const s=[];
391switch(t){case"top":s.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":s.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":s.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":s.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return s}function H1(e){const{top:t,right:r,bottom:s,left:a}=e;return[{x:a,y:t},{x:r,y:t},{x:r,y:s},{x:a,y:s}]}function V1(e,t){const{x:r,y:s}=e;let a=!1;for(let i=0,o=t.length-1;i<t.length;o=i++){const u=t[i].x,c=t[i].y,l=t[o].x,d=t[o].y;c>s!=d>s&&r<(l-u)*(s-c)/(d-c)+u&&(a=!a)}return a}function G1(e){const t=e.slice();return t.sort((r,s)=>r.x<s.x?-1:r.x>s.x?1:r.y<s.y?-1:r.y>s.y?1:0),W1(t)}function W1(e){if(e.length<=1)return e.slice();const t=[];for(let s=0;s<e.length;s++){const a=e[s];for(;t.length>=2;){const i=t[t.length-1],o=t[t.length-2];if((i.x-o.x)*(a.y-o.y)>=(i.y-o.y)*(a.x-o.x))t.pop();else break}t.push(a)}t.pop();const r=[];for(let s=e.length-1;s>=0;s--){const a=e[s];for(;r.length>=2;){const i=r[r.length-1],o=r[r.length-2];if((i.x-o.x)*(a.y-o.y)>=(i.y-o.y)*(a.x-o.x))r.pop();else break}r.push(a)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var Y1=of,K1=uf,Q1=cf,hf=lf;const mf=Y1,J1=K1,Z1=Q1,pf=f.forwardRef(({className:e,sideOffset:t=4,...r},s)=>n.jsx(hf,{ref:s,sideOffset:t,className:V("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),...r}));pf.displayName=hf.displayName;var Fa=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(){}},Ma=typeof window>"u"||"Deno"in globalThis;function lt(){}function X1(e,t){return typeof e=="function"?e(t):e}function ey(e){return typeof e=="number"&&e>=0&&e!==1/0}function ty(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Rc(e,t){return typeof e=="function"?e(t):e}function ry(e,t){return typeof e=="function"?e(t):e}function Ic(e,t){const{type:r="all",exact:s,fetchStatus:a,predicate:i,queryKey:o,stale:u}=e;if(o){if(s){if(t.queryHash!==iu(o,t.options))return!1}else if(!sn(t.queryKey,o))return!1}if(r!=="all"){const c=t.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof u=="boolean"&&t.isStale()!==u||a&&a!==t.state.fetchStatus||i&&!i(t))}function Fc(e,t){const{exact:r,status:s,predicate:a,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(r){if(rn(t.options.mutationKey)!==rn(i))return!1}else if(!sn(t.options.mutationKey,i))return!1}return!(s&&t.state.status!==s||a&&!a(t))}function iu(e,t){return((t==null?void 0:t.queryKeyHashFn)||rn)(e)}function rn(e){return JSON.stringify(e,(t,r)=>fo(r)?Object.keys(r).sort().reduce((s,a)=>(s[a]=r[a],s),{}):r)}function sn(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(r=>!sn(e[r],t[r])):!1}function xf(e,t){if(e===t)return e;const r=Mc(e)&&Mc(t);if(r||fo(e)&&fo(t)){const s=r?e:Object.keys(e),a=s.length,i=r?t:Object.keys(t),o=i.length,u=r?[]:{};let c=0;for(let l=0;l<o;l++){const d=r?l:i[l];(!r&&s.includes(d)||r)&&e[d]===void 0&&t[d]===void 0?(u[d]=void 0,c++):(u[d]=xf(e[d],t[d]),u[d]===e[d]&&e[d]!==void 0&&c++)}return a===o&&c===a?e:u}return t}function Mc(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function fo(e){if(!Oc(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!Oc(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Oc(e){return Object.prototype.toString.call(e)==="[object Object]"}function sy(e){return new Promise(t=>{setTimeout(t,e)})}function ny(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?xf(e,t):t}function ay(e,t,r=0){const s=[...e,t];return r&&s.length>r?s.slice(1):s}function iy(e,t,r=0){const s=[t,...e];return r&&s.length>r?s.slice(0,-1):s}var ou=Symbol();function gf(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===ou?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var Pr,ur,us,$l,oy=($l=class extends Fa{constructor(){super();me(this,Pr);me(this,ur);me(this,us);oe(this,us,t=>{if(!Ma&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}
vendor: 22,392 bytes, line 391
391onSubscribe(){D(this,ur)||this.setEventListener(D(this,us))}onUnsubscribe(){var t;this.hasListeners()||((t=D(this,ur))==null||t.call(this),oe(this,ur,void 0))}setEventListener(t){var r;oe(this,us,t),(r=D(this,ur))==null||r.call(this),oe(this,ur,t(s=>{typeof s=="boolean"?this.setFocused(s):this.onFocus()}))}setFocused(t){D(this,Pr)!==t&&(oe(this,Pr,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof D(this,Pr)=="boolean"?D(this,Pr):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Pr=new WeakMap,ur=new WeakMap,us=new WeakMap,$l),bf=new oy,cs,cr,ls,Ul,uy=(Ul=class extends Fa{constructor(){super();me(this,cs,!0);me(this,cr);me(this,ls);oe(this,ls,t=>{if(!Ma&&window.addEventListener){const r=()=>t(!0),s=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",s)}}})}onSubscribe(){D(this,cr)||this.setEventListener(D(this,ls))}onUnsubscribe(){var t;this.hasListeners()||((t=D(this,cr))==null||t.call(this),oe(this,cr,void 0))}setEventListener(t){var r;oe(this,ls,t),(r=D(this,cr))==null||r.call(this),oe(this,cr,t(this.setOnline.bind(this)))}setOnline(t){D(this,cs)!==t&&(oe(this,cs,t),this.listeners.forEach(s=>{s(t)}))}isOnline(){return D(this,cs)}},cs=new WeakMap,cr=new WeakMap,ls=new WeakMap,Ul),ua=new uy;function cy(){let e,t;const r=new Promise((a,i)=>{e=a,t=i});r.status="pending",r.catch(()=>{});function s(a){Object.assign(r,a),delete r.resolve,delete r.reject}return r.resolve=a=>{s({status:"fulfilled",value:a}),e(a)},r.reject=a=>{s({status:"rejected",reason:a}),t(a)},r}function ly(e){return Math.min(1e3*2**e,3e4)}function yf(e){return(e??"online")==="online"?ua.isOnline():!0}var vf=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function vi(e){return e instanceof vf}function wf(e){let t=!1,r=0,s=!1,a;const i=cy(),o=g=>{var b;s||(m(new vf(g)),(b=e.abort)==null||b.call(e))},u=()=>{t=!0},c=()=>{t=!1},l=()=>bf.isFocused()&&(e.networkMode==="always"||ua.isOnline())&&e.canRun(),d=()=>yf(e.networkMode)&&e.canRun(),h=g=>{var b;s||(s=!0,(b=e.onSuccess)==null||b.call(e,g),a==null||a(),i.resolve(g))},m=g=>{var b;s||(s=!0,(b=e.onError)==null||b.call(e,g),a==null||a(),i.reject(g))},p=()=>new Promise(g=>{var b;a=v=>{(s||l())&&g(v)},(b=e.onPause)==null||b.call(e)}).then(()=>{var g;a=void 0,s||(g=e.onContinue)==null||g.call(e)}),x=()=>{if(s)return;let g;const b=r===0?e.initialPromise:void 0;try{g=b??e.fn()}catch(v){g=Promise.reject(v)}Promise.resolve(g).then(h).catch(v=>{var N;if(s)return;const y=e.retry??(Ma?0:3),w=e.retryDelay??ly,_=typeof w=="function"?w(r,v):w,k=y===!0||typeof y=="number"&&r<y||typeof y=="function"&&y(r,v);if(t||!k){m(v);return}r++,(N=e.onFail)==null||N.call(e,r,v),sy(_).then(()=>l()?void 0:p()).then(()=>{t?m(v):x()})})};return{promise:i,cancel:o,continue:()=>(a==null||a(),i),cancelRetry:u,continueRetry:c,canStart:d,start:()=>(d()?x():p().then(x),i)}}function dy(){let e=[],t=0,r=u=>{u()},s=u=>{u()},a=u=>setTimeout(u,0);const i=u=>{t?e.push(u):a(()=>{r(u)})},o=()=>{const u=e;e=[],u.length&&a(()=>{s(()=>{u.forEach(c=>{r(c)})})})};return{batch:u=>{let c;t++;try{c=u()}finally{t--,t||o()}return c},batchCalls:u=>(...c)=>{i(()=>{u(...c)})},schedule:i,setNotifyFunction:u=>{r=u},setBatchNotifyFunction:u=>{s=u},setScheduler:u=>{a=u}}}var Ue=dy(),Dr,zl,_f=(zl=class{constructor(){me(this,Dr)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ey(this.gcTime)&&oe(this,Dr,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ma?1/0:5*60*1e3))}clearGcTimeout(){D(this,Dr)&&(clearTimeout(D(this,Dr)),oe(this,Dr,void 0))}},Dr=new WeakMap,zl),ds,fs,st,Re,hn,Rr,dt,zt,Bl,fy=(Bl=class extends _f{constructor(t){super();me(this,dt);me(this,ds);me(this,fs);me(this,st);me(this,Re);me(this,hn);me(this,Rr);oe(this,Rr,!1),oe(this,hn,t.defaultOptions),this.setOptions(t.options),this.observers=[],oe(this,st,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,oe(this,ds,my(this.options)),this.state=t.state??D(this,ds),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=D(this,Re))==null?void 0:t.promise}setOptions(t){this.options={...D(this,hn),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&D(this,st).remove(this)}setData(t,r){const s=ny(this.state.data,t,this.options);return De(this,dt,zt).call(this,{data:s,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),s}setState(t,r){De(this,dt,zt).call(this,{type:"setState",state:t,setStateOptions:r})}cancel(t){var s,a;const r=(s=D(this,Re))==null?void 0:s.promise;return(a=D(this,Re))==null||a.cancel(t),r?r.then(lt).catch(lt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(D(this,ds))}isActive(){return this.observers.some(t=>ry(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ou||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!ty(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(s=>s.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=D(this,Re))==null||r.continue()}onOnline(){var r;const t=this.observers.find(s=>s.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=D(this,Re))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),D(this,st).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(D(this,Re)&&(D(this,Rr)?D(this,Re).cancel({revert:!0}):D(this,Re).cancelRetry()),this.scheduleGc()),D(this,st).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||De(this,dt,zt).call(this,{type:"invalidate"})}fetch(t,r){var c,l,d;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(D(this,Re))return D(this,Re).continueRetry(),D(this,Re).promise}if(t&&this.setOptions(t),!this.options.queryFn){const h=this.observers.find(m=>m.options.queryFn);h&&this.setOptions(h.options)}const s=new AbortController,a=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(oe(this,Rr,!0),s.signal)})},i=()=>{const h=gf(this.options,r),m={queryKey:this.queryKey,meta:this.meta};return a(m),oe(this,Rr,!1),this.options.persister?this.options.persister(h,m,this):h(m)},o={fetchOptions:r,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:i};a(o),(c=this.options.behavior)==null||c.onFetch(o,this),oe(this,fs,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((l=o.fetchOptions)==null?void 0:l.meta))&&De(this,dt,zt).call(this,{type:"fetch",meta:(d=o.fetchOptions)==null?void 0:d.meta});const u=h=>{var m,p,x,g;vi(h)&&h.silent||De(this,dt,zt).call(this,{type:"error",error:h}),vi(h)||((p=(m=D(this,st).config).onError)==null||p.call(m,h,this),(g=(x=D(this,st).config).onSettled)==null||g.call(x,this.state.data,h,this)),this.scheduleGc()};return oe(this,Re,wf({initialPromise:r==null?void 0:r.initialPromise,fn:o.fetchFn,abort:s.abort.bind(s),onSuccess:h=>{var m,p,x,g;if(h===void 0){u(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(h)}catch(b){u(b);return}(p=(m=D(this,st).config).onSuccess)==null||p.call(m,h,this),(g=(x=D(this,st).config).onSettled)==null||g.call(x,h,this.state.error,this),this.scheduleGc()},onError:u,onFail:(h,m)=>{De(this,dt,zt).call(this,{type:"failed",failureCount:h,error:m})},onPause:()=>{De(this,dt,zt).call(this,{type:"pause"})},onContinue:()=>{De(this,dt,zt).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),D(this,Re).start()}},ds=new WeakMap,fs=new WeakMap,st=new WeakMap,Re=new WeakMap,hn=new WeakMap,Rr=new WeakMap,dt=new WeakSet,zt=function(t){const r=s=>{switch(t.type){case"failed":return{...s,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...hy(s.data,this.options),fetchMeta:t.meta??null};case"success":return{...s,data:t.data,dataUpdateCount:s.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const a=t.error;return vi(a)&&a.revert&&D(this,fs)?{...D(this,fs),fetchStatus:"idle"}:{...s,error:a,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error"};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...t.state}}};this.state=r(this.state),Ue.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),D(this,st).notify({query:this,type:"updated",action:t})})},Bl);function hy(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:yf(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function my(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,s=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var Nt,ql,py=(ql=class extends Fa{constructor(t={}){super();me(this,Nt);this.config=t,oe(this,Nt,new Map)}build(t,r,s){const a=r.queryKey,i=r.queryHash??iu(a,r);let o=this.get(i);return o||(o=new fy({cache:this,queryKey:a,queryHash:i,options:t.defaultQueryOptions(r),state:s,defaultOptions:t.getQueryDefaults(a)}),this.add(o)),o}add(t){D(this,Nt).has(t.queryHash)||(D(this,Nt).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=D(this,Nt).get(t.queryHash);r&&(t.destroy(),r===t&&D(this,Nt).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Ue.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return D(this,Nt).get(t)}getAll(){return[...D(this,Nt).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(s=>Ic(r,s))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(s=>Ic(t,s)):r}notify(t){Ue.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){Ue.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Ue.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Nt=new WeakMap,ql),Ct,$e,Ir,St,Xt,Hl,xy=(Hl=class extends _f{constructor(t){super();me(this,St);me(this,Ct);me(this,$e);me(this,Ir);this.mutationId=t.mutationId,oe(this,$e,t.mutationCache),oe(this,Ct,[]),this.state=t.state||gy(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){D(this,Ct).includes(t)||(D(this,Ct).push(t),this.clearGcTimeout(),D(this,$e).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){oe(this,Ct,D(this,Ct).filter(r=>r!==t)),this.scheduleGc(),D(this,$e).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){D(this,Ct).length||(this.state.status==="pending"?this.scheduleGc():D(this,$e).remove(this))}continue(){var t;return((t=D(this,Ir))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var a,i,o,u,c,l,d,h,m,p,x,g,b,v,y,w,_,k,N,j;oe(this,Ir,wf({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(C,I)=>{De(this,St,Xt).call(this,{type:"failed",failureCount:C,error:I})},onPause:()=>{De(this,St,Xt).call(this,{type:"pause"})},onContinue:()=>{De(this,St,Xt).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>D(this,$e).canRun(this)}));const r=this.state.status==="pending",s=!D(this,Ir).canStart();try{if(!r){De(this,St,Xt).call(this,{type:"pending",variables:t,isPaused:s}),await((i=(a=D(this,$e).config).onMutate)==null?void 0:i.call(a,t,this));const I=await((u=(o=this.options).onMutate)==null?void 0:u.call(o,t));I!==this.state.context&&De(this,St,Xt).call(this,{type:"pending",context:I,variables:t,isPaused:s})}const C=await D(this,Ir).start();return await((l=(c=D(this,$e).config).onSuccess)==null?void 0:l.call(c,C,t,this.state.context,this)),await((h=(d=this.options).onSuccess)==null?void 0:h.call(d,C,t,this.state.context)),await((p=(m=D(this,$e).config).onSettled)==null?void 0:p.call(m,C,null,this.state.variables,this.state.context,this)),await((g=(x=this.options).onSettled)==null?void 0:g.call(x,C,null,t,this.state.context)),De(this,St,Xt).call(this,{type:"success",data:C}),C}catch(C){try{throw await((v=(b=D(this,$e).config).onError)==null?void 0:v.call(b,C,t,this.state.context,this)),await((w=(y=this.options).onError)==null?void 0:w.call(y,C,t,this.state.context)),await((k=(_=D(this,$e).config).onSettled)==null?void 0:k.call(_,void 0,C,this.state.variables,this.state.context,this)),await((j=(N=this.options).onSettled)==null?void 0:j.call(N,void 0,C,t,this.state.context)),C}finally{De(this,St,Xt).call(this,{type:"error",error:C})}}finally{D(this,$e).runNext(this)}}},Ct=new WeakMap,$e=new WeakMap,Ir=new WeakMap,St=new WeakSet,Xt=function(t){const r=s=>{switch(t.type){case"failed":return{...s,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};case"pending":return{...s,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...s,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:t.error,failureCount:s.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),Ue.batch(()=>{D(this,Ct).forEach(s=>{s.onMutationUpdate(t)}),D(this,$e).notify({mutation:this,type:"updated",action:t})})},Hl);function gy(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ke,mn,Vl,by=(Vl=class extends Fa{constructor(t={}){super();me(this,Ke);me(this,mn);this.config=t,oe(this,Ke,new Map),oe(this,mn,Date.now())}build(t,r,s){const a=new xy({mutationCache:this,mutationId:++Dn(this,mn)._,options:t.defaultMutationOptions(r),state:s});return this.add(a),a}add(t){const r=On(t),s=D(this,Ke).get(r)??[];s.push(t),D(this,Ke).set(r,s),this.notify({type:"added",mutation:t})}remove(t){var s;const r=On(t);if(D(this,Ke).has(r)){const a=(s=D(this,Ke).get(r))==null?void 0:s.filter(i=>i!==t);a&&(a.length===0?D(this,Ke).delete(r):D(this,Ke).set(r,a))}this.notify({type:"removed",mutation:t})}canRun(t){var s;const r=(s=D(this,Ke).get(On(t)))==null?void 0:s.find(a=>a.state.status==="pending");return!r||r===t}runNext(t){var s;const r=(s=D(this,Ke).get(On(t)))==null?void 0:s.find(a=>a!==t&&a.state.isPaused);return(r==null?void 0:r.continue())??Promise.resolve()}clear(){Ue.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}getAll(){return[...D(this,Ke).values()].flat()}find(t){const r={exact:!0,...t};return this.getAll().find(s=>Fc(r,s))}findAll(t={}){return this.getAll().filter(r=>Fc(t,r))}notify(t){Ue.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return Ue.batch(()=>Promise.all(t.map(r=>r.continue().catch(lt))))}},Ke=new WeakMap,mn=new WeakMap,Vl);function On(e){var t;return((t=e.options.scope)==null?void 0:t.id)??String(e.mutationId)}function Lc(e){return{onFetch:(t,r)=>{var d,h,m,p,x;const s=t.options,a=(m=(h=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:h.fetchMore)==null?void 0:m.direction,i=((p=t.state.data)==null?void 0:p.pages)||[],o=((x=t.state.data)==null?void 0:x.pageParams)||[];let u={pages:[],pageParams:[]},c=0;const l=async()=>{let g=!1;const b=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(t.signal.aborted?g=!0:t.signal.addEventListener("abort",()=>{g=!0}),t.signal)})},v=gf(t.options,t.fetchOptions),y=async(w,_,k)=>{if(g)return Promise.reject();if(_==null&&w.pages.length)return Promise.resolve(w);const N={queryKey:t.queryKey,pageParam:_,direction:k?"backward":"forward",meta:t.options.meta};b(N);const j=await v(N),{maxPages:C}=t.options,I=k?iy:ay;return{pages:I(w.pages,j,C),pageParams:I(w.pageParams,_,C)}};if(a&&i.length){const w=a==="backward",_=w?yy:$c,k={pages:i,pageParams:o},N=_(s,k);u=await y(k,N,w)}else{const w=e??i.length;do{const _=c===0?o[0]??s.initialPageParam:$c(s,u);if(c>0&&_==null)break;u=await y(u,_),c++}while(c<w)}return u};t.options.persister?t.fetchFn=()=>{var g,b;return(b=(g=t.options).persister)==null?void 0:b.call(g,l,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=l}}}function $c(e,{pages:t,pageParams:r}){const s=t.length-1;return t.length>0?e.getNextPageParam(t[s],t,r[s],r):void 0}function yy(e,{pages:t,pageParams:r}){var s;return t.length>0?(s=e.getPreviousPageParam)==null?void 0:s.call(e,t[0],t,r[0],r):void 0}var we,lr,dr,hs,ms,fr,ps,xs,Gl,vy=(Gl=class{constructor(e={}){me(this,we);me(this,lr);me(this,dr);me(this,hs);me(this,ms);me(this,fr);me(this,ps);me(this,xs);oe(this,we,e.queryCache||new py),oe(this,lr,e.mutationCache||new by),oe(this,dr,e.defaultOptions||{}),oe(this,hs,new Map),oe(this,ms,new Map),oe(this,fr,0)}mount(){Dn(this,fr)._++,D(this,fr)===1&&(oe(this,ps,bf.subscribe(async e=>{e&&(await this.resumePausedMutations(),D(this,we).onFocus())})),oe(this,xs,ua.subscribe(async e=>{e&&(await this.resumePausedMutations(),D(this,we).onOnline())})))}unmount(){var e,t;Dn(this,fr)._--,D(this,fr)===0&&((e=D(this,ps))==null||e.call(this),oe(this,ps,void 0),(t=D(this,xs))==null||t.call(this),oe(this,xs,void 0))}isFetching(e){return D(this,we).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return D(this,lr).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=D(this,we).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);if(t===void 0)return this.fetchQuery(e);{const r=this.defaultQueryOptions(e),s=D(this,we).build(this,r);return e.revalidateIfStale&&s.isStaleByTime(Rc(r.staleTime,s))&&this.prefetchQuery(r),Promise.resolve(t)}}getQueriesData(e){return D(this,we).findAll(e).map(({queryKey:t,state:r})=>{const s=r.data;return[t,s]})}setQueryData(e,t,r){const s=this.defaultQueryOptions({queryKey:e}),a=D(this,we).get(s.queryHash),i=a==null?void 0:a.state.data,o=X1(t,i);if(o!==void 0)return D(this,we).build(this,s).setData(o,{...r,manual:!0})}setQueriesData(e,t,r){return Ue.batch(()=>D(this,we).findAll(e).map(({queryKey:s})=>[s,this.setQueryData(s,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=D(this,we).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=D(this,we);Ue.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=D(this,we),s={type:"active",...e};return Ue.batch(()=>(r.findAll(e).forEach(a=>{a.reset()}),this.refetchQueries(s,t)))}cancelQueries(e={},t={}){const r={revert:!0,...t},s=Ue.batch(()=>D(this,we).findAll(e).map(a=>a.cancel(r)));return Promise.all(s).then(lt).catch(lt)}invalidateQueries(e={},t={}){return Ue.batch(()=>{if(D(this,we).findAll(e).forEach(s=>{s.invalidate()}),e.refetchType==="none")return Promise.resolve();const r={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(r,t)})}refetchQueries(e={},t){const r={...t,cancelRefetch:(t==null?void 0:t.cancelRefetch)??!0},s=Ue.batch(()=>D(this,we).findAll(e).filter(a=>!a.isDisabled()).map(a=>{let i=a.fetch(void 0,r);return r.throwOnError||(i=i.catch(lt)),a.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(s).then(lt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=D(this,we).build(this,t);return r.isStaleByTime(Rc(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(lt).catch(lt)}fetchInfiniteQuery(e){return e.behavior=Lc(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(lt).catch(lt)}ensureInfiniteQueryData(e){return e.behavior=Lc(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return ua.isOnline()?D(this,lr).resumePausedMutations():Promise.resolve()}getQueryCache(){return D(this,we)}getMutationCache(){return D(this,lr)}getDefaultOptions(){return D(this,dr)}setDefaultOptions(e){oe(this,dr,e)}setQueryDefaults(e,t){D(this,hs).set(rn(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...D(this,hs).values()];let r={};return t.forEach(s=>{sn(e,s.queryKey)&&(r={...r,...s.defaultOptions})}),r}setMutationDefaults(e,t){D(this,ms).set(rn(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...D(this,ms).values()];let r={};return t.forEach(s=>{sn(e,s.mutationKey)&&(r={...r,...s.defaultOptions})}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...D(this,dr).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=iu(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.enabled!==!0&&t.queryFn===ou&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...D(this,dr).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}
391clear(){D(this,we).clear(),D(this,lr).clear()}},we=new WeakMap,lr=new WeakMap,dr=new WeakMap,hs=new WeakMap,ms=new WeakMap,fr=new WeakMap,ps=new WeakMap,xs=new WeakMap,Gl),wy=f.createContext(void 0),_y=({client:e,children:t})=>(f.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),n.jsx(wy.Provider,{value:e,children:t}));const ky=Es("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"}}),R=f.forwardRef(({className:e,variant:t,size:r,asChild:s=!1,...a},i)=>{const o=s?pr:"button";return n.jsx(o,{className:V(ky({variant:t,size:r,className:e})),ref:i,...a})});R.displayName="Button";function jy({onWatchDemo:e}){return n.jsxs("section",{className:"py-16 md:py-24 lg:py-32 container relative overflow-hidden",children:[n.jsxs("div",{className:"absolute top-0 left-0 w-full h-full overflow-hidden -z-10 opacity-50",children:[n.jsx("div",{className:"absolute top-10 left-10 w-72 h-72 bg-explainify-300/30 dark:bg-explainify-700/20 rounded-full filter blur-3xl"}),n.jsx("div",{className:"absolute bottom-10 right-10 w-96 h-96 bg-explainify-400/20 dark:bg-explainify-500/10 rounded-full filter blur-3xl"})]}),n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-10 md:gap-16 items-center",children:[n.jsxs("div",{className:"space-y-6 md:space-y-8",children:[n.jsxs("div",{className:"inline-flex items-center rounded-full border border-explainify-200 dark:border-explainify-800 bg-white/50 dark:bg-gray-900/50 backdrop-blur-sm px-4 py-1.5",children:[n.jsx(Xe,{className:"mr-2 h-4 w-4 text-explainify-500"}),n.jsx("span",{className:"text-sm font-medium",children:"AI-Powered Learning Revolution"})]}),n.jsxs("h1",{className:"text-4xl md:text-5xl lg:text-6xl xl:text-7xl font-bold leading-tight tracking-tighter",children:["Learn ",n.jsx("span",{className:"gradient-text",children:"Faster"})," and ",n.jsx("span",{className:"gradient-text",children:"Smarter"})," with Explainify"]}),n.jsx("p",{className:"text-lg md:text-xl text-muted-foreground max-w-[42rem] leading-relaxed",children:"Personalized AI tutoring, step-by-step explanations, and adaptive learning paths designed for your success."}),n.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",children:[n.jsx(R,{size:"lg",className:"btn-primary w-full sm:w-auto h-12 px-6 text-base",asChild:!0,children:n.jsxs(ne,{to:"/auth?mode=signup",children:["Try Free For 30 Days ",n.jsx(mr,{className:"ml-2 h-4 w-4"})]})}),n.jsxs(R,{size:"lg",variant:"outline",className:"gap-2 w-full sm:w-auto h-12 px-6 text-base hover:bg-explainify-50 dark:hover:bg-explainify-900/30",onClick:e,children:[n.jsx(Qs,{className:"h-4 w-4"})," Watch Demo"]})]}),n.jsxs("div",{className:"flex items-center gap-4 pt-4",children:[n.jsx("div",{className:"flex -space-x-3",children:[1,2,3,4].map(t=>n.jsx("div",{className:"inline-block h-8 w-8 md:h-10 md:w-10 rounded-full border-2 border-background shadow-sm bg-explainify-100 dark:bg-explainify-300 overflow-hidden",children:n.jsx("div",{className:"h-full w-full bg-explainify-300 dark:bg-explainify-500"})},t))}),n.jsxs("div",{className:"text-sm md:text-base text-muted-foreground",children:[n.jsx("span",{className:"font-semibold text-foreground",children:"4,000+"})," students learning today"]})]})]}),n.jsxs("div",{className:"relative",children:[n.jsx("div",{className:"absolute -top-6 -left-6 w-24 h-24 md:w-32 md:h-32 bg-explainify-100 dark:bg-explainify-700/30 rounded-2xl rotate-6 animate-float opacity-70"}),n.jsx("div",{className:"absolute -bottom-8 -right-8 w-24 h-24 md:w-32 md:h-32 bg-explainify-200 dark:bg-explainify-600/30 rounded-2xl -rotate-6 animate-float opacity-70"}),n.jsx("div",{className:"relative z-10 glass-morphism p-3 md:p-4 roun
391ded-2xl shadow-xl",children:n.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-xl overflow-hidden shadow-sm",children:n.jsxs("div",{className:"p-5 md:p-7 space-y-5 md:space-y-7",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"h-12 w-12 md:h-14 md:w-14 rounded-full bg-explainify-100 dark:bg-explainify-800 flex items-center justify-center shadow-sm",children:n.jsx(xr,{className:"h-6 w-6 md:h-7 md:w-7 text-explainify-600 dark:text-explainify-300"})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-lg md:text-xl font-medium",children:"Your AI Tutor"}),n.jsx("p",{className:"text-sm md:text-base text-muted-foreground",children:"Personalized learning assistant"})]})]}),n.jsx("div",{className:"bg-explainify-50 dark:bg-gray-900 p-4 md:p-5 rounded-xl shadow-sm",children:n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex gap-3 md:gap-4",children:[n.jsx("div",{className:"h-8 w-8 md:h-10 md:w-10 rounded-full bg-explainify-200 dark:bg-explainify-700 flex-shrink-0 shadow-sm"}),n.jsx("div",{className:"bg-explainify-100 dark:bg-gray-800 rounded-lg p-3 md:p-4 text-sm md:text-base shadow-sm",children:"Can you help me understand how photosynthesis works?"})]}),n.jsxs("div",{className:"flex gap-3 md:gap-4 justify-end",children:[n.jsx("div",{className:"bg-explainify-600 text-white rounded-lg p-3 md:p-4 text-sm md:text-base max-w-[80%] shadow-sm",children:"Of course! Photosynthesis is the process plants use to convert light energy into chemical energy. Let me break it down step-by-step..."}),n.jsx("div",{className:"h-8 w-8 md:h-10 md:w-10 rounded-full bg-explainify-700 flex-shrink-0 flex items-center justify-center shadow-sm",children:n.jsx(Xe,{className:"h-4 w-4 md:h-5 md:w-5 text-white"})})]})]})})]})})})]})]})]})}const Ny="modulepreload",Cy=function(e){return"/"+e},Uc={},Ft=function(t,r,s){let a=Promise.resolve();if(r&&r.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),u=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));a=Promise.allSettled(r.map(c=>{if(c=Cy(c),c in Uc)return;Uc[c]=!0;const l=c.endsWith(".css"),d=l?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const h=document.createElement("link");if(h.rel=l?"stylesheet":Ny,l||(h.as="script"),h.crossOrigin="",h.href=c,u&&h.setAttribute("nonce",u),document.head.appendChild(h),l)return new Promise((m,p)=>{h.addEventListener("load",m),h.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${c}`)))})}))}function i(o){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=o,window.dispatchEvent(u),!u.defaultPrevented)throw o}return a.then(o=>{for(const u of o||[])u.status==="rejected"&&i(u.reason);return t().catch(i)})},Sy=e=>{let t;return e?t=e:typeof fetch>"u"?t=(...r)=>Ft(async()=>{const{default:s}=await Promise.resolve().then(()=>Is);return{default:s}},void 0).then(({default:s})=>s(...r)):t=fetch,(...r)=>t(...r)};class uu extends Error{constructor(t,r="FunctionsError",s){super(t),this.name=r,this.context=s}}class Ey extends uu{constructor(t){super("Failed to send a request to the Edge Function","FunctionsFetchError",t)}}class Ty extends uu{constructor(t){super("Relay Error invoking the Edge Function","FunctionsRelayError",t)}}class Ay extends uu{constructor(t){super("Edge Function returned a non-2xx status code","FunctionsHttpError",t)}}var ho;(function(e){e.Any="any",e.ApNortheast1="ap-northeast-1",e.ApNortheast2="ap-northeast-2",e.ApSouth1="ap-south-1",e.ApSoutheast1="ap-southeast-1",e.ApSoutheast2="ap-southeast-2",e.CaCentral1="ca-central-1",e.EuCentral1="eu-central-1",e.EuWest1="eu-west-1",e.EuWest2="eu-west-2",e.EuWest3="eu-west-3",e.SaEast1="sa-east-1",e.UsEast1="us-east-1",e.UsWest1="us-west-1",e.UsWest2="us-west-2"})(ho||(ho={}));var Py=function(e,t,r,s){function a(i){return i instanceof r?i:new r(function(o){o(i)})}return new(r||(r=Promise))(function(i,o){function u(d){try{l(s.next(d))}catch(h){o(h)}}function c(d){try{l(s.throw(d))}catch(h){o(h)}}function l(d){d.done?i(d.value):a(d.value).then(u,c)}l((s=s.apply(e,t||[])).next())})};class Dy{constructor(t,{headers:r={}
391,customFetch:s,region:a=ho.Any}={}){this.url=t,this.headers=r,this.region=a,this.fetch=Sy(s)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t,r={}){var s;return Py(this,void 0,void 0,function*(){try{const{headers:a,method:i,body:o}=r;let u={},{region:c}=r;c||(c=this.region),c&&c!=="any"&&(u["x-region"]=c);let l;o&&(a&&!Object.prototype.hasOwnProperty.call(a,"Content-Type")||!a)&&(typeof Blob<"u"&&o instanceof Blob||o instanceof ArrayBuffer?(u["Content-Type"]="application/octet-stream",l=o):typeof o=="string"?(u["Content-Type"]="text/plain",l=o):typeof FormData<"u"&&o instanceof FormData?l=o:(u["Content-Type"]="application/json",l=JSON.stringify(o)));const d=yield this.fetch(`${this.url}/${t}`,{method:i||"POST",headers:Object.assign(Object.assign(Object.assign({},u),this.headers),a),body:l}).catch(x=>{throw new Ey(x)}),h=d.headers.get("x-relay-error");if(h&&h==="true")throw new Ty(d);if(!d.ok)throw new Ay(d);let m=((s=d.headers.get("Content-Type"))!==null&&s!==void 0?s:"text/plain").split(";")[0].trim(),p;return m==="application/json"?p=yield d.json():m==="application/octet-stream"?p=yield d.blob():m==="text/event-stream"?p=d:m==="multipart/form-data"?p=yield d.formData():p=yield d.text(),{data:p,error:null}}catch(a){return{data:null,error:a}}})}}var Ve={},cu={},Oa={},bn={},La={},$a={},Ry=function(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")},ws=Ry();const Iy=ws.fetch,kf=ws.fetch.bind(ws),jf=ws.Headers,Fy=ws.Request,My=ws.Response,Is=Object.freeze(Object.defineProperty({__proto__:null,Headers:jf,Request:Fy,Response:My,default:kf,fetch:Iy},Symbol.toStringTag,{value:"Module"})),Oy=Mp(Is);var Ua={};Object.defineProperty(Ua,"__esModule",{value:!0});let Ly=class extends Error{constructor(t){super(t.message),this.name="PostgrestError",this.details=t.details,this.hint=t.hint,this.co
391de=t.code}};Ua.default=Ly;var Nf=ot&&ot.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty($a,"__esModule",{value:!0});const $y=Nf(Oy),Uy=Nf(Ua);let zy=class{constructor(t){this.shouldThrowOnError=!1,this.method=t.method,this.url=t.url,this.headers=t.headers,this.schema=t.schema,this.body=t.body,this.shouldThrowOnError=t.shouldThrowOnError,this.signal=t.signal,this.isMaybeSingle=t.isMaybeSingle,t.fetch?this.fetch=t.fetch:typeof fetch>"u"?this.fetch=$y.default:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(t,r){return this.headers=Object.assign({},this.headers),this.headers[t]=r,this}then(t,r){this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers["Accept-Profile"]=this.schema:this.headers["Content-Profile"]=this.schema),this.method!=="GET"&&this.method!=="HEAD"&&(this.headers["Content-Type"]="application/json");const s=this.fetch;let a=s(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async i=>{var o,u,c;let l=null,d=null,h=null,m=i.status,p=i.statusText;if(i.ok){if(this.method!=="HEAD"){const v=await i.text();v===""||(this.headers.Accept==="text/csv"||this.headers.Accept&&this.headers.Accept.includes("application/vnd.pgrst.plan+text")?d=v:d=JSON.parse(v))}const g=(o=this.headers.Prefer)===null||o===void 0?void 0:o.match(/count=(exact|planned|estimated)/),b=(u=i.headers.get("content-range"))===null||u===void 0?void 0:u.split("/");g&&b&&b.length>1&&(h=parseInt(b[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(d)&&(d.length>1?(l={code:"PGRST116",details:`Results contain ${d.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},d=null,h=null,m=406,p="Not Acceptable"):d.length===1?d=d[0]:d=null)}else{const g=await i.text();try{l=JSON.parse(g),Array.isArray(l)&&i.status===404&&(d=[],l=null,m=200,p="OK")}catch{i.status===404&&g===""?(m=204,p="No Content"):l={message:g}}if(l&&this.isMaybeSingle&&(!((c=l==null?void 0:l.details)===null||c===void 0)&&c.includes("0 rows"))&&(l=null,m=200,p="OK"),l&&this.shouldThrowOnError)throw new Uy.default(l)}return{error:l,data:d,count:h,status:m,statusText:p}});return this.shouldThrowOnError||(a=a.catch(i=>{var o,u,c;return{error:{message:`${(o=i==null?void 0:i.name)!==null&&o!==void 0?o:"FetchError"}: ${i==null?void 0:i.message}`,details:`${(u=i==null?void 0:i.stack)!==null&&u!==void 0?u:""}`,hint:"",code:`${(c=i==null?void 0:i.code)!==null&&c!==void 0?c:""}`},data:null,count:null,status:0,statusText:""}})),a.then(t,r)}returns(){return this}overrideTypes(){return this}};$a.default=zy;var By=ot&&ot.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(La,"__esModule",{value:!0});const qy=By($a);let Hy=class extends qy.default{select(t){let r=!1;const s=(t??"*").split("").map(a=>/\s/.test(a)&&!r?"":(a==='"'&&(r=!r),a)).join("");return this.url.searchParams.set("select",s),this.headers.Prefer&&(this.headers.Prefer+=","),this.headers.Prefer+="return=representation",this}order(t,{ascending:r=!0,nullsFirst:s,foreignTable:a,referencedTable:i=a}={}){const o=i?`${i}.order`:"order",u=this.url.searchParams.get(o);return this.url.searchParams.set(o,`${u?`${u},`:""}${t}.${r?"asc":"desc"}${s===void 0?"":s?".nullsfirst":".nullslast"}`),this}limit(t,{foreignTable:r,referencedTable:s=r}={}){const a=typeof s>"u"?"limit":`${s}.limit`;return this.url.searchParams.set(a,`${t}`),this}range(t,r,{foreignTable:s,referencedTable:a=s}={}){const i=typeof a>"u"?"offset":`${a}.offset`,o=typeof a>"u"?"limit":`${a}.limit`;return this.url.searchParams.set(i,`${t}`),this.url.searchParams.set(o,`${r-t+1}`),this}abortSignal(t){return this.signal=t,this}single(){return this.headers.Accept="application/vnd.pgrst.object+json",this}maybeSingle(){return this.method==="GET"?this.headers.Accept="application/json":this.headers.Accept="application/vnd.pgrst.object+json",this.isMaybeSingle=!0,this}csv(){return this.headers.Accept="text/csv",this}geojson(){return this.headers.Accept="application/geo+json",this}
391explain({analyze:t=!1,verbose:r=!1,settings:s=!1,buffers:a=!1,wal:i=!1,format:o="text"}={}){var u;const c=[t?"analyze":null,r?"verbose":null,s?"settings":null,a?"buffers":null,i?"wal":null].filter(Boolean).join("|"),l=(u=this.headers.Accept)!==null&&u!==void 0?u:"application/json";return this.headers.Accept=`application/vnd.pgrst.plan+${o}; for="${l}"; options=${c};`,o==="json"?this:this}rollback(){var t;return((t=this.headers.Prefer)!==null&&t!==void 0?t:"").trim().length>0?this.headers.Prefer+=",tx=rollback":this.headers.Prefer="tx=rollback",this}returns(){return this}};La.default=Hy;var Vy=ot&&ot.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(bn,"__esModule",{value:!0});const Gy=Vy(La);let Wy=class extends Gy.default{eq(t,r){return this.url.searchParams.append(t,`eq.${r}`),this}neq(t,r){return this.url.searchParams.append(t,`neq.${r}`),this}gt(t,r){return this.url.searchParams.append(t,`gt.${r}`),this}gte(t,r){return this.url.searchParams.append(t,`gte.${r}`),this}lt(t,r){return this.url.searchParams.append(t,`lt.${r}`),this}lte(t,r){return this.url.searchParams.append(t,`lte.${r}`),this}like(t,r){return this.url.searchParams.append(t,`like.${r}`),this}likeAllOf(t,r){return this.url.searchParams.append(t,`like(all).{${r.join(",")}}`),this}likeAnyOf(t,r){return this.url.searchParams.append(t,`like(any).{${r.join(",")}}`),this}ilike(t,r){return this.url.searchParams.append(t,`ilike.${r}`),this}ilikeAllOf(t,r){return this.url.searchParams.append(t,`ilike(all).{${r.join(",")}}`),this}ilikeAnyOf(t,r){return this.url.searchParams.append(t,`ilike(any).{${r.join(",")}}`),this}is(t,r){return this.url.searchParams.append(t,`is.${r}`),this}in(t,r){const s=Array.from(new Set(r)).map(a=>typeof a=="string"&&new RegExp("[,()]").test(a)?`"${a}"`:`${a}`).join(",");return this.url.searchParams.append(t,`in.(${s})`),this}contains(t,r){return typeof r=="string"?this.url.searchParams.append(t,`cs.${r}`):Array.isArray(r)?this.url.searchParams.append(t,`cs.{${r.join(",")}}`):this.url.searchParams.append(t,`cs.${JSON.stringify(r)}`),this}containedBy(t,r){return typeof r=="string"?this.url.searchParams.append(t,`cd.${r}`):Array.isArray(r)?this.url.searchParams.append(t,`cd.{${r.join(",")}}`):this.url.searchParams.append(t,`cd.${JSON.stringify(r)}`),this}rangeGt(t,r){return this.url.searchParams.append(t,`sr.${r}`),this}rangeGte(t,r){return this.url.searchParams.append(t,`nxl.${r}`),this}rangeLt(t,r){return this.url.searchParams.append(t,`sl.${r}`),this}rangeLte(t,r){return this.url.searchParams.append(t,`nxr.${r}`),this}rangeAdjacent(t,r){return this.url.searchParams.append(t,`adj.${r}`),this}overlaps(t,r){return typeof r=="string"?this.url.searchParams.append(t,`ov.${r}`):this.url.searchParams.append(t,`ov.{${r.join(",")}}`),this}textSearch(t,r,{config:s,type:a}={}){let i="";a==="plain"?i="pl":a==="phrase"?i="ph":a==="websearch"&&(i="w");const o=s===void 0?"":`(${s})`;return this.url.searchParams.append(t,`${i}fts${o}.${r}`),this}match(t){return Object.entries(t).forEach(([r,s])=>{this.url.searchParams.append(r,`eq.${s}`)}),this}not(t,r,s){return this.url.searchParams.append(t,`not.${r}.${s}`),this}or(t,{foreignTable:r,referencedTable:s=r}={}){const a=s?`${s}.or`:"or";return this.url.searchParams.append(a,`(${t})`),this}filter(t,r,s){return this.url.searchParams.append(t,`${r}.${s}`),this}};bn.default=Wy;var Yy=ot&&ot.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Oa,"__esModule",{value:!0});const qs=Yy(bn);let Ky=class{constructor(t,{headers:r={},schema:s,fetch:a}){this.url=t,this.headers=r,this.schema=s,this.fetch=a}select(t,{head:r=!1,count:s}={}){const a=r?"HEAD":"GET";let i=!1;const o=(t??"*").split("").map(u=>/\s/.test(u)&&!i?"":(u==='"'&&(i=!i),u)).join("");return this.url.searchParams.set("select",o),s&&(this.headers.Prefer=`count=${s}`),new qs.default({method:a,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}insert(t,{count:r,defaultToNull:s=!0}={}){const a="POST",i=[];if(this.headers.Prefer&&i.push(this.headers.Prefer),r&&i.push(`count=${r}`),s||i.push("missing=default"),this.headers.Prefer=i.join(","),Array.isArray(t)){const o=t.reduce((u,c)=>u.concat(Object.keys(c)),[]);if(o.length>0){const u=[...new Set(o)].map(c=>`"${c}"`);this.url.searchParams.set("columns",u.join(","))}}return new qs.default({method:a,url:this.url,headers:this.headers,schema:this.schema,body:t,fetch:this.fetch,allowEmpty:!1})}upsert(t,{onConflict:r,ignoreDuplicates:s=!1,count:a,defaultToNull:i=!0}={}){const o="POST",u=[`resolution=${s?"ignore":"merge"}-duplicates`];if(r!==void 0&&this.url.searchParams.set("on_conflict",r),this.headers.Prefer&&u.push(this.headers.Prefer),a&&u.push(`count=${a}`),i||u.push("missing=default"),this.headers.Prefer=u.join(","),Array.isArray(t)){const c=t.reduce((l,d)=>l.concat(Object.keys(d)),[]);if(c.length>0){const l=[...new Set(c)].map(d=>`"${d}"`);this.url.searchParams.set("columns",l.join(","))}}return new qs.default({method:o,url:this.url,headers:this.headers,schema:this.schema,body:t,fetch:this.fetch,allowEmpty:!1})}update(t,{count:r}={}){const s="PATCH",a=[];return this.headers.Prefer&&a.push(this.headers.Prefer),r&&a.push(`count=${r}`),this.headers.Prefer=a.join(","),new qs.default({method:s,url:this.url,headers:this.headers,schema:this.schema,body:t,fetch:this.fetch,allowEmpty:!1})}delete({count:t}={}){const r="DELETE",s=[];return t&&s.push(`count=${t}`),this.headers.Prefer&&s.unshift(this.headers.Prefer),this.headers.Prefer=s.join(","),new qs.default({method:r,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}};Oa.default=Ky;var za={},Ba={};Object.defineProperty(Ba,"__esModule",{value:!0});Ba.version=void 0;Ba.version="0.0.0-automated";Object.defineProperty(za,"__esModule",{value:!0});za.DEFAULT_HEADERS=void 0;const Qy=Ba;za.DEFAULT_HEADERS={"X-Client-Info":`postgrest-js/${Qy.version}`};
391var Cf=ot&&ot.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(cu,"__esModule",{value:!0});const Jy=Cf(Oa),Zy=Cf(bn),Xy=za;let ev=class Sf{constructor(t,{headers:r={},schema:s,fetch:a}={}){this.url=t,this.headers=Object.assign(Object.assign({},Xy.DEFAULT_HEADERS),r),this.schemaName=s,this.fetch=a}from(t){const r=new URL(`${this.url}/${t}`);return new Jy.default(r,{headers:Object.assign({},this.headers),schema:this.schemaName,fetch:this.fetch})}schema(t){return new Sf(this.url,{headers:this.headers,schema:t,fetch:this.fetch})}rpc(t,r={},{head:s=!1,get:a=!1,count:i}={}){let o;const u=new URL(`${this.url}/rpc/${t}`);let c;s||a?(o=s?"HEAD":"GET",Object.entries(r).filter(([d,h])=>h!==void 0).map(([d,h])=>[d,Array.isArray(h)?`{${h.join(",")}}`:`${h}`]).forEach(([d,h])=>{u.searchParams.append(d,h)})):(o="POST",c=r);const l=Object.assign({},this.headers);return i&&(l.Prefer=`count=${i}`),new Zy.default({method:o,url:u,headers:l,schema:this.schemaName,body:c,fetch:this.fetch,allowEmpty:!1})}};cu.default=ev;var Fs=ot&&ot.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ve,"__esModule",{value:!0});Ve.PostgrestError=Ve.PostgrestBuilder=Ve.PostgrestTransformBuilder=Ve.PostgrestFilterBuilder=Ve.PostgrestQueryBuilder=Ve.PostgrestClient=void 0;const Ef=Fs(cu);Ve.PostgrestClient=Ef.default;const Tf=Fs(Oa);Ve.PostgrestQueryBuilder=Tf.default;const Af=Fs(bn);Ve.PostgrestFilterBuilder=Af.default;const Pf=Fs(La);Ve.PostgrestTransformBuilder=Pf.default;const Df=Fs($a);Ve.PostgrestBuilder=Df.default;const Rf=Fs(Ua);Ve.PostgrestError=Rf.default;var tv=Ve.default={PostgrestClient:Ef.default,PostgrestQueryBuilder:Tf.default,PostgrestFilterBuilder:Af.default,PostgrestTransformBuilder:Pf.default,PostgrestBuilder:Df.default,PostgrestError:Rf.default};const{PostgrestClient:rv,PostgrestQueryBuilder:HN,PostgrestFilterBuilder:VN,PostgrestTransformBuilder:GN,PostgrestBuilder:WN,PostgrestError:YN}=tv,sv="2.11.2",nv={"X-Client-Info":`realtime-js/${sv}`},av="1.0.0",If=1e4,iv=1e3;var ns;(function(e){e[e.connecting=0]="connecting",e[e.open=1]="open",e[e.closing=2]="closing",e[e.closed=3]="closed"})(ns||(ns={}));var Ye;(function(e){e.closed="closed",e.errored="errored",e.joined="joined",e.joining="joining",e.leaving="leaving"})(Ye||(Ye={}));var ft;(function(e){e.close="phx_close",e.error="phx_error",e.join="phx_join",e.reply="phx_reply",e.leave="phx_leave",e.access_token="access_token"})(ft||(ft={}));var mo;(function(e){e.websocket="websocket"})(mo||(mo={}));var Tr;(function(e){e.Connecting="connecting",e.Open="open",e.Closing="closing",e.Closed="closed"})(Tr||(Tr={}));class ov{constructor(){this.HEADER_LENGTH=1}decode(t,r){return t.constructor===ArrayBuffer?r(this._binaryDecode(t)):r(typeof t=="string"?JSON.parse(t):{})}_binaryDecode(t){const r=new DataView(t),s=new TextDecoder;return this._decodeBroadcast(t,r,s)}_decodeBroadcast(t,r,s){const a=r.getUint8(1),i=r.getUint8(2);let o=this.HEADER_LENGTH+2;const u=s.decode(t.slice(o,o+a));o=o+a;const c=s.decode(t.slice(o,o+i));o=o+i;const l=JSON.parse(s.decode(t.slice(o,t.byteLength)));return{ref:null,topic:u,event:c,payload:l}}}class Ff{constructor(t,r){this.callback=t,this.timerCalc=r,this.timer=void 0,this.tries=0,this.callback=t,this.timerCalc=r}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}}var xe;(function(e){e.abstime="abstime",e.bool="bool",e.date="date",e.daterange="daterange",e.float4="float4",e.float8="float8",e.int2="int2",e.int4="int4",e.int4range="int4range",e.int8="int8",e.int8range="int8range",e.json="json",e.jsonb="jsonb",e.money="money",e.numeric="numeric",e.oid="oid",e.reltime="reltime",e.text="text",e.time="time",e.timestamp="timestamp",e.timestamptz="timestamptz",e.timetz="timetz",e.tsrange="tsrange",e.tstzrange="tstzrange"})(xe||(xe={}));const zc=(e,t,r={})=>{var s;const a=(s=r.skipTypes)!==null&&s!==void 0?s:[];return Object.keys(t).reduce((i,o)=>(i[o]=uv(o,e,t,a),i),{})},uv=(e,t,r,s)=>{const a=t.find(u=>u.name===e),i=a==null?void 0:a.type,o=r[e];return i&&!s.includes(i)?Mf(i,o):po(o)},Mf=(e,t)=>
vendor: 14,175 bytes, lines 391-396
391{if(e.charAt(0)==="_"){const r=e.slice(1,e.length);return fv(t,r)}switch(e){case xe.bool:return cv(t);case xe.float4:case xe.float8:case xe.int2:case xe.int4:case xe.int8:case xe.numeric:case xe.oid:return lv(t);case xe.json:case xe.jsonb:return dv(t);case xe.timestamp:return hv(t);case xe.abstime:case xe.date:case xe.daterange:case xe.int4range:case xe.int8range:case xe.money:case xe.reltime:case xe.text:case xe.time:case xe.timestamptz:case xe.timetz:case xe.tsrange:case xe.tstzrange:return po(t);default:return po(t)}},po=e=>e,cv=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},lv=e=>{if(typeof e=="string"){const t=parseFloat(e);if(!Number.isNaN(t))return t}return e},dv=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch(t){return console.log(`JSON parse error: ${t}`),e}return e},fv=(e,t)=>{if(typeof e!="string")return e;const r=e.length-1,s=e[r];if(e[0]==="{"&&s==="}"){let i;const o=e.slice(1,r);try{i=JSON.parse("["+o+"]")}catch{i=o?o.split(","):[]}return i.map(u=>Mf(t,u))}return e},hv=e=>typeof e=="string"?e.replace(" ","T"):e,Of=e=>{let t=e;return t=t.replace(/^ws/i,"http"),t=t.replace(/(\/socket\/websocket|\/socket|\/websocket)\/?$/i,""),t.replace(/\/+$/,"")};class wi{constructor(t,r,s={},a=If){this.channel=t,this.event=r,this.payload=s,this.timeout=a,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null}resend(t){this.timeout=t,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,this.send()}send(){this._hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload,ref:this.ref,join_ref:this.channel._joinRef()}))}updatePayload(t){this.payload=Object.assign(Object.assign({},this.payload),t)}receive(t,r){var s;return this._hasReceived(t)&&r((s=this.receivedResp)===null||s===void 0?void 0:s.response),this.recHooks.push({status:t,callback:r}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);const t=r=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=r,this._matchReceive(r)};this.channel._on(this.refEvent,{},t),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(t,r){this.refEvent&&this.channel._trigger(this.refEvent,{status:t,response:r})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:t,response:r}){this.recHooks.filter(s=>s.status===t).forEach(s=>s.callback(r))}_hasReceived(t){return this.receivedResp&&this.receivedResp.status===t}}var Bc;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(Bc||(Bc={}));class Js{constructor(t,r){this.channel=t,this.state={},this.pendingDiffs=[],this.joinRef=null,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};const s=(r==null?void 0:r.events)||{state:"presence_state",diff:"presence_diff"};this.channel._on(s.state,{},a=>{const{onJoin:i,onLeave:o,onSync:u}=this.caller;this.joinRef=this.channel._joinRef(),this.state=Js.syncState(this.state,a,i,o),this.pendingDiffs.forEach(c=>{this.state=Js.syncDiff(this.state,c,i,o)}),this.pendingDiffs=[],u()}),this.channel._on(s.diff,{},a=>{const{onJoin:i,onLeave:o,onSync:u}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(a):(this.state=Js.syncDiff(this.state,a,i,o),u())}),this.onJoin((a,i,o)=>{this.channel._trigger("presence",{event:"join",key:a,currentPresences:i,newPresences:o})}),this.onLeave((a,i,o)=>{this.channel._trigger("presence",{event:"leave",key:a,currentPresences:i,leftPresences:o})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(t,r,s,a){const i=this.cloneDeep(t),o=this.transformState(r),u={},c={};return this.map(i,(l,d)=>{o[l]||(c[l]=d)}),this.map(o,(l,d)=>{const h=i[l];if(h){const m=d.map(b=>b.presence_ref),p=h.map(b=>b.presence_ref),x=d.filter(b=>p.indexOf(b.presence_ref)<0),g=h.filter(b=>m.indexOf(b.presence_ref)<0);x.length>0&&(u[l]=x),g.length>0&&(c[l]=g)}else u[l]=d}),this.syncDiff(i,{joins:u,leaves:c},s,a)}static syncDiff(t,r,s,a){const{joins:i,leaves:o}={joins:this.transformState(r.joins),leaves:this.transformState(r.leaves)};return s||(s=()=>{}),a||(a=()=>{}),this.map(i,(u,c)=>{var l;const d=(l=t[u])!==null&&l!==void 0?l:[];if(t[u]=this.cloneDeep(c),d.length>0){const h=t[u].map(p=>p.presence_ref),m=d.filter(p=>h.indexOf(p.presence_ref)<0);t[u].unshift(...m)}s(u,d,c)}),this.map(o,(u,c)=>{let l=t[u];if(!l)return;const d=c.map(h=>h.presence_ref);l=l.filter(h=>d.indexOf(h.presence_ref)<0),t[u]=l,a(u,l,c),l.length===0&&delete t[u]}),t}static map(t,r){return Object.getOwnPropertyNames(t).map(s=>r(s,t[s]))}static transformState(t){return t=this.cloneDeep(t),Object.getOwnPropertyNames(t).reduce((r,s)=>{const a=t[s];return"metas"in a?r[s]=a.metas.map(i=>(i.presence_ref=i.phx_ref,delete i.phx_ref,delete i.phx_ref_prev,i)):r[s]=a,r},{})}static cloneDeep(t){return JSON.parse(JSON.stringify(t))}onJoin(t){this.caller.onJoin=t}onLeave(t){this.caller.onLeave=t}onSync(t){this.caller.onSync=t}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}}var qc;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})(qc||(qc={}));var Hc;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(Hc||(Hc={}));var Bt;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(Bt||(Bt={}));class lu{constructor(t,r={config:{}},s){this.topic=t,this.params=r,this.socket=s,this.bindings={},this.state=Ye.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=t.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:""},private:!1},r.config),this.timeout=this.socket.timeout,this.joinPush=new wi(this,ft.join,this.params,this.timeout),this.rejoinTimer=new Ff(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=Ye.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(a=>a.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=Ye.closed,this.socket._remove(this)}),this._onError(a=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,a),this.state=Ye.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=Ye.errored,this.rejoinTimer.scheduleTimeout())}),this._on(ft.reply,{},(a,i)=>{this._trigger(this._replyEventName(i),a)}),this.presence=new Js(this),this.broadcastEndpointURL=Of(this.socket.endPoint)+"/api/broadcast",this.private=this.params.config.private||!1}subscribe(t,r=this.timeout){var s,a;if(this.socket.isConnected()||this.socket.connect(),this.joinedOnce)throw"tried to subscribe multiple times. 'subscribe' can only be called a single time per channel instance";{const{config:{broadcast:i,presence:o,private:u}}=this.params;this._onError(d=>t==null?void 0:t(Bt.CHANNEL_ERROR,d)),this._onClose(()=>t==null?void 0:t(Bt.CLOSED));const c={},l={broadcast:i,presence:o,postgres_changes:(a=(s=this.bindings.postgres_changes)===null||s===void 0?void 0:s.map(d=>d.filter))!==null&&a!==void 0?a:[],private:u};this.socket.accessTokenValue&&(c.access_token=this.socket.accessTokenValue),this.updateJoinPayload(Object.assign({config:l},c)),this.joinedOnce=!0,this._rejoin(r),this.joinPush.receive("ok",async({postgres_changes:d})=>{var h;if(this.socket.setAuth(),d===void 0){t==null||t(Bt.SUBSCRIBED);return}else{const m=this.bindings.postgres_changes,p=(h=m==null?void 0:m.length)!==null&&h!==void 0?h:0,x=[];for(let g=0;g<p;g++){const b=m[g],{filter:{event:v,schema:y,table:w,filter:_}}=b,k=d&&d[g];if(k&&k.event===v&&k.schema===y&&k.table===w&&k.filter===_)x.push(Object.assign(Object.assign({},b),{id:k.id}));else{this.unsubscribe(),t==null||t(Bt.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=x,t&&t(Bt.SUBSCRIBED);return}}).receive("error",d=>{t==null||t(Bt.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(d).join(", ")||"error")))}).receive("timeout",()=>{t==null||t(Bt.TIMED_OUT)})}return this}presenceState(){return this.presence.state}async track(t,r={}){return await this.send({type:"presence",event:"track",payload:t},r.timeout||this.timeout)}async untrack(t={}){return await this.send({type:"presence",event:"untrack"},t)}on(t,r,s){return this._on(t,r,s)}async send(t,r={}){var s,a;if(!this._canPush()&&t.type==="broadcast"){const{event:i,payload:o}=t,c={method:"POST",headers:{Authorization:this.socket.accessTokenValue?`Bearer ${this.socket.accessTokenValue}`:"",apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"},body:JSON.stringify({messages:[{topic:this.subTopic,event:i,payload:o,private:this.private}]})};try{const l=await this._fetchWithTimeout(this.broadcastEndpointURL,c,(s=r.timeout)!==null&&s!==void 0?s:this.timeout);return await((a=l.body)===null||a===void 0?void 0:a.cancel()),l.ok?"ok":"error"}catch(l){return l.name==="AbortError"?"timed out":"error"}}else return new Promise(i=>{var o,u,c;const l=this._push(t.type,t,r.timeout||this.timeout);t.type==="broadcast"&&!(!((c=(u=(o=this.params)===null||o===void 0?void 0:o.config)===null||u===void 0?void 0:u.broadcast)===null||c===void 0)&&c.ack)&&i("ok"),l.receive("ok",()=>i("ok")),l.receive("error",()=>i("error")),l.receive("timeout",()=>i("timed out"))})}updateJoinPayload(t){this.joinPush.updatePayload(t)}unsubscribe(t=this.timeout){this.state=Ye.leaving;const r=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(ft.close,"leave",this._joinRef())};return this.rejoinTimer.reset(),this.joinPush.destroy(),new Promise(s=>{const a=new wi(this,ft.leave,{},t);a.receive("ok",()=>{r(),s("ok")}).receive("timeout",()=>{r(),s("timed out")}).receive("error",()=>{s("error")}),a.send(),this._canPush()||a.trigger("ok",{})})}async _fetchWithTimeout(t,r,s){const a=new AbortController,i=setTimeout(()=>a.abort(),s),o=await this.socket.fetch(t,Object.assign(Object.assign({},r),{signal:a.signal}));return clearTimeout(i),o}_push(t,r,s=this.timeout){if(!this.joinedOnce)throw`tried to push '${t}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let a=new wi(this,t,r,s);return this._canPush()?a.send():(a.startTimeout(),this.pushBuffer.push(a)),a}_onMessage(t,r,s){return r}_isMember(t){return this.topic===t}_joinRef(){return this.joinPush.ref}_trigger(t,r,s){var a,i;const o=t.toLocaleLowerCase(),{close:u,error:c,leave:l,join:d}=ft;if(s&&[u,c,l,d].indexOf(o)>=0&&s!==this._joinRef())return;let m=this._onMessage(o,r,s);if(r&&!m)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(o)?(a=this.bindings.postgres_changes)===null||a===void 0||a.filter(p=>{var x,g,b;return((x=p.filter)===null||x===void 0?void 0:x.event)==="*"||((b=(g=p.filter)===null||g===void 0?void 0:g.event)===null||b===void 0?void 0:b.toLocaleLowerCase())===o}).map(p=>p.callback(m,s)):(i=this.bindings[o])===null||i===void 0||i.filter(p=>{var x,g,b,v,y,w;if(["broadcast","presence","postgres_changes"].includes(o))if("id"in p){const _=p.id,k=(x=p.filter)===null||x===void 0?void 0:x.event;return _&&((g=r.ids)===null||g===void 0?void 0:g.includes(_))&&(k==="*"||(k==null?void 0:k.toLocaleLowerCase())===((b=r.data)===null||b===void 0?void 0:b.type.toLocaleLowerCase()))}else{const _=(y=(v=p==null?void 0:p.filter)===null||v===void 0?void 0:v.event)===null||y===void 0?void 0:y.toLocaleLowerCase();return _==="*"||_===((w=r==null?void 0:r.event)===null||w===void 0?void 0:w.toLocaleLowerCase())}else return p.type.toLocaleLowerCase()===o}).map(p=>{if(typeof m=="object"&&"ids"in m){const x=m.data,{schema:g,table:b,commit_timestamp:v,type:y,errors:w}=x;m=Object.assign(Object.assign({},{schema:g,table:b,commit_timestamp:v,eventType:y,new:{},old:{},errors:w}),this._getPayloadRecords(x))}p.callback(m,s)})}_isClosed(){return this.state===Ye.closed}_isJoined(){return this.state===Ye.joined}_isJoining(){return this.state===Ye.joining}_isLeaving(){return this.state===Ye.leaving}_replyEventName(t){return`chan_reply_${t}`}_on(t,r,s){const a=t.toLocaleLowerCase(),i={type:a,filter:r,callback:s};return this.bindings[a]?this.bindings[a].push(i):this.bindings[a]=[i],this}_off(t,r){const s=t.toLocaleLowerCase();return this.bindings[s]=this.bindings[s].filter(a=>{var i;return!(((i=a.type)===null||i===void 0?void 0:i.toLocaleLowerCase())===s&&lu.isEqual(a.filter,r))}),this}static isEqual(t,r){if(Object.keys(t).length!==Object.keys(r).length)return!1;for(const s in t)if(t[s]!==r[s])return!1;return!0}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(t){this._on(ft.close,{},t)}_onError(t){this._on(ft.error,{},r=>t(r))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(t=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=Ye.joining,this.joinPush.resend(t))}_getPayloadRecords(t){const r={new:{},old:{}};return(t.type==="INSERT"||t.type==="UPDATE")&&(r.new=zc(t.columns,t.record)),(t.type==="UPDATE"||t.type==="DELETE")&&(r.old=zc(t.columns,t.old_record)),r}}const mv=()=>{},pv=typeof WebSocket<"u",xv=`
392  addEventListener("message", (e) => {
393    if (e.data.event === "start") {
394      setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
395    }
396  });`;class gv{constructor(t,r){var s;this.accessTokenValue=null,this.apiKey=null,this.channels=[],this.endPoint="",this.httpEndpoint="",this.headers=nv,this.params={},this.timeout=If,this.heartbeatIntervalMs=3e4,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.ref=0,this.logger=mv,this.conn=null,this.sendBuffer=[],this.serializer
396=new ov,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._resolveFetch=i=>{let o;return i?o=i:typeof fetch>"u"?o=(...u)=>Ft(async()=>{const{default:c}=await Promise.resolve().then(()=>Is);return{default:c}},void 0).then(({default:c})=>c(...u)):o=fetch,(...u)=>o(...u)},this.endPoint=`${t}/${mo.websocket}`,this.httpEndpoint=Of(t),r!=null&&r.transport?this.transport=r.transport:this.transport=null,r!=null&&r.params&&(this.params=r.params),r!=null&&r.headers&&(this.headers=Object.assign(Object.assign({},this.headers),r.headers)),r!=null&&r.timeout&&(this.timeout=r.timeout),r!=null&&r.logger&&(this.logger=r.logger),r!=null&&r.heartbeatIntervalMs&&(this.heartbeatIntervalMs=r.heartbeatIntervalMs);const a=(s=r==null?void 0:r.params)===null||s===void 0?void 0:s.apikey;if(a&&(this.accessTokenValue=a,this.apiKey=a),this.reconnectAfterMs=r!=null&&r.reconnectAfterMs?r.reconnectAfterMs:i=>[1e3,2e3,5e3,1e4][i-1]||1e4,this.encode=r!=null&&r.encode?r.encode:(i,o)=>o(JSON.stringify(i)),this.decode=r!=null&&r.decode?r.decode:this.serializer.decode.bind(this.serializer),this.reconnectTimer=new Ff(async()=>{this.disconnect(),this.connect()},this.reconnectAfterMs),this.fetch=this._resolveFetch(r==null?void 0:r.fetch),r!=null&&r.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.worker=(r==null?void 0:r.worker)||!1,this.workerUrl=r==null?void 0:r.workerUrl}this.accessToken=(r==null?void 0:r.accessToken)||null}connect(){if(!this.conn){if(this.transport){this.conn=new this.transport(this.endpointURL(),void 0,{headers:this.headers});return}if(pv){this.conn=new WebSocket(this.endpointURL()),this.setupConnection();return}this.conn=new bv(this.endpointURL(),void 0,{close:()=>{this.conn=null}}),Ft(async()=>{const{default:t}=await import("./browser-CDKG8DYR.js").then(r=>r.b);return{default:t}},__vite__mapDeps([0,1])).then(({default:t})=>{this.conn=new t(this.endpointURL(),void 0,{headers:this.headers}),this.setupConnection()})}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:av}))}disconnect(t,r){this.conn&&(this.conn.onclose=function(){},t?this.conn.close(t,r??""):this.conn.close(),this.conn=null,this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.reconnectTimer.reset())}getChannels(){return this.channels}async removeChannel(t){const r=await t.unsubscribe();return this.channels.length===0&&this.disconnect(),r}async removeAllChannels(){const t=await Promise.all(this.channels.map(r=>r.unsubscribe()));return this.disconnect(),t}log(t,r,s){this.logger(t,r,s)}connectionState(){switch(this.conn&&this.conn.readyState){case ns.connecting:return Tr.Connecting;case ns.open:return Tr.Open;case ns.closing:return Tr.Closing;default:return Tr.Closed}}isConnected(){return this.connectionState()===Tr.Open}channel(t,r={config:{}}){const s=new lu(`realtime:${t}`,r,this);return this.channels.push(s),s}push(t){const{topic:r,event:s,payload:a,ref:i}=t,o=()=>{this.encode(t,u=>{var c;(c=this.conn)===null||c===void 0||c.send(u)})};this.log("push",`${r} ${s} (${i})`,a),this.isConnected()?o():this.sendBuffer.push(o)}async setAuth(t=null){let r=t||this.accessToken&&await this.accessToken()||this.accessTokenValue;if(r){let s=null;try{s=JSON.parse(atob(r.split(".")[1]))}catch{}if(s&&s.exp&&!(Math.floor(Date.now()/1e3)-s.exp<0))return this.log("auth",`InvalidJWTToken: Invalid value for JWT claim "exp" with value ${s.exp}`),Promise.reject(`InvalidJWTToken: Invalid value for JWT claim "exp" with value ${s.exp}`);this.accessTokenValue=r,this.channels.forEach(a=>{r&&a.updateJoinPayload({access_token:r}),a.joinedOnce&&a._isJoined()&&a._push(ft.access_token,{access_token:r})})}}async sendHeartbeat(){var t;if(this.isConnected()){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection"),(t=this.conn)===null||t===void 0||t.close(iv,"hearbeat timeout");return}this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef}),this.setAuth()}}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(t=>t()),this.sendBuffer=[])}_makeRef(){let t=this.ref+1;return t===this.ref?this.ref=0:this.ref=t,this.ref.toString()}_leaveOpenTopic(t){let r=this.channels.find(s=>s.topic===t&&(s._isJoined()||s._isJoining()));r&&(this.log("transport",`leaving duplicate topic "${t}"`),r.unsubscribe())}_remove(t){this.channels=this.channels.filter(r=>r._joinRef()!==t._joinRef())}setupConnection(){this.conn&&(this.conn.binaryType="arraybuffer",this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=t=>this._onConnError(t),this.conn.onmessage=t=>
396this._onConnMessage(t),this.conn.onclose=t=>this._onConnClose(t))}_onConnMessage(t){this.decode(t.data,r=>{let{topic:s,event:a,payload:i,ref:o}=r;o&&o===this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null),this.log("receive",`${i.status||""} ${s} ${a} ${o&&"("+o+")"||""}`,i),this.channels.filter(u=>u._isMember(s)).forEach(u=>u._trigger(a,i,o)),this.stateChangeCallbacks.message.forEach(u=>u(r))})}async _onConnOpen(){if(this.log("transport",`connected to ${this.endpointURL()}`),this.flushSendBuffer(),this.reconnectTimer.reset(),!this.worker)this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this.sendHeartbeat(),this.heartbeatIntervalMs);else{this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const t=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(t),this.workerRef.onerror=r=>{this.log("worker","worker error",r.message),this.workerRef.terminate()},this.workerRef.onmessage=r=>{r.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}this.stateChangeCallbacks.open.forEach(t=>t())}_onConnClose(t){this.log("transport","close",t),this._triggerChanError(),this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.reconnectTimer.scheduleTimeout(),this.stateChangeCallbacks.close.forEach(r=>r(t))}_onConnError(t){this.log("transport",t.message),this._triggerChanError(),this.stateChangeCallbacks.error.forEach(r=>r(t))}_triggerChanError(){this.channels.forEach(t=>t._trigger(ft.error))}_appendParams(t,r){if(Object.keys(r).length===0)return t;const s=t.match(/\?/)?"&":"?",a=new URLSearchParams(r);return`${t}${s}${a}`}_workerObjectUrl(t){let r;if(t)r=t;else{const s=new Blob([xv],{type:"application/javascript"});r=URL.createObjectURL(s)}return r}}class bv{constructor(t,r,s){this.binaryType="arraybuffer",this.onclose=()=>{},this.onerror=()=>{},this.onmessage=()=>{},this.onopen=()=>{},this.readyState=ns.connecting,this.send=()=>{},this.url=null,this.url=t,this.close=s.close}}class du extends Error{constructor(t){super(t),this.__isStorageError=!0,this.name="StorageError"}}function Ne(e){return typeof e=="object"&&e!==null&&"__isStorageError"in e}class yv extends du{constructor(t,r){super(t),this.name="StorageApiError",this.status=r}toJSON(){return{name:this.name,message:this.message,status:this.status}}}class xo extends du{constructor(t,r){super(t),this.name="StorageUnknownError",this.originalError=r}}var vv=function(e,t,r,s){function a(i){return i instanceof r?i:new r(function(o){o(i)})}return new(r||(r=Promise))(function(i,o){function u(d){try{l(s.next(d))}catch(h){o(h)}}function c(d){try{l(s.throw(d))}catch(h){o(h)}}function l(d){d.done?i(d.value):a(d.value).then(u,c)}l((s=s.apply(e,t||[])).next())})};const Lf=e=>{let t;return e?t=e:typeof fetch>"u"?t=(...r)=>Ft(async()=>{const{default:s}=await Promise.resolve().then(()=>Is);return{default:s}},void 0).then(({default:s})=>s(...r)):t=fetch,(...r)=>t(...r)},wv=()=>vv(void 0,void 0,void 0,function*(){return typeof Response>"u"?(yield Ft(()=>Promise.resolve().then(()=>Is),void 0)).Response:Response}),go=e=>{if(Array.isArray(e))return e.map(r=>go(r));if(typeof e=="function"||e!==Object(e))return e;const t={};return Object.entries(e).forEach(([r,s])=>{const a=r.replace(/([-_][a-z])/gi,i=>i.toUpperCase().replace(/[-_]/g,""));t[a]=go(s)}),t};var zr=function(e,t,r,s){function a(i){return i instanceof r?i:new r(function(o){o(i)})}return new(r||(r=Promise))(function(i,o){function u(d){try{l(s.next(d))}catch(h){o(h)}}function c(d){try{l(s.throw(d))}catch(h){o(h)}}function l(d){d.done?i(d.value):a(d.value).then(u,c)}l((s=s.apply(e,t||[])).next())})};const _i=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),_v=(e,t,r)=>zr(void 0,void 0,void 0,function*(){const s=yield wv();e instanceof s&&!(r!=null&&r.noResolveJson)?e.json().then(a=>{t(new yv(_i(a),e.status||500))}).catch(a=>{t(new xo(_i(a),a))}):t(new xo(_i(e),e))}),kv=(e,t,r,s)=>{const a={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"?a:(a.headers=Object.assign({"Content-Type":"application/json"},t==null?void 0:t.headers),s&&(a.body=JSON.stringify(s)),Object.assign(Object.assign({},a),r))};function yn(e,t,r,s,a,i){return zr(this,void 0,void 0,function*(){return new Promise((o,u)=>{e(r,kv(t,s,a,i)).then(c=>{if(!c.ok)throw c;return s!=null&&s.noResolveJson?c:c.json()}).then(c=>o(c)).catch(c=>_v(c,u,s))})})}function ca(e,t,r,s){return zr(this,void 0,void 0,function*(){return yn(e,"GET",t,r,s)})}function nr(e,t,r,s,a){return zr(this,void 0,void 0,function*(){return yn(e,"POST",t,s,a,r)})}function jv(e,t,r,s,a){return zr(this,void 0,void 0,function*(){return yn(e,"PUT",t,s,a,r)})}function Nv(e,t,r,s){return zr(this,void 0,void 0,function*(){return yn(e,"HEAD",t,Object.assign(Object.assign({},r),{noResolveJson:!0}),s)})}function $f(e,t,r,s,a){return zr(this,void 0,void 0,function*(){return yn(e,"DELETE",t,s,a,r)})}
396var He=function(e,t,r,s){function a(i){return i instanceof r?i:new r(function(o){o(i)})}return new(r||(r=Promise))(function(i,o){function u(d){try{l(s.next(d))}catch(h){o(h)}}function c(d){try{l(s.throw(d))}catch(h){o(h)}}function l(d){d.done?i(d.value):a(d.value).then(u,c)}l((s=s.apply(e,t||[])).next())})};const Cv={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},Vc={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};class Sv{constructor(t,r={},s,a){this.url=t,this.headers=r,this.bucketId=s,this.fetch=Lf(a)}uploadOrUpdate(t,r,s,a){return He(this,void 0,void 0,function*(){try{let i;const o=Object.assign(Object.assign({},Vc),a);let u=Object.assign(Object.assign({},this.headers),t==="POST"&&{"x-upsert":String(o.upsert)});const c=o.metadata;typeof Blob<"u"&&s instanceof Blob?(i=new FormData,i.append("cacheControl",o.cacheControl),c&&i.append("metadata",this.encodeMetadata(c)),i.append("",s)):typeof FormData<"u"&&s instanceof FormData?(i=s,i.append("cacheControl",o.cacheControl),c&&i.append("metadata",this.encodeMetadata(c))):(i=s,u["cache-control"]=`max-age=${o.cacheControl}`,u["content-type"]=o.contentType,c&&(u["x-metadata"]=this.toBase64(this.encodeMetadata(c)))),a!=null&&a.headers&&(u=Object.assign(Object.assign({},u),a.headers));const l=this._removeEmptyFolders(r),d=this._getFinalPath(l),h=yield this.fetch(`${this.url}/object/${d}`,Object.assign({method:t,body:i,headers:u},o!=null&&o.duplex?{duplex:o.duplex}:{})),m=yield h.json();return h.ok?{data:{path:l,id:m.Id,fullPath:m.Key},error:null}:{data:null,error:m}}catch(i){if(Ne(i))return{data:null,error:i};throw i}})}upload(t,r,s){return He(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",t,r,s)})}uploadToSignedUrl(t,r,s,a){return He(this,void 0,void 0,function*(){const i=this._removeEmptyFolders(t),o=this._getFinalPath(i),u=new URL(this.url+`/object/upload/sign/${o}`);u.searchParams.set("token",r);try{let c;const l=Object.assign({upsert:Vc.upsert},a),d=Object.assign(Object.assign({},this.headers),{"x-upsert":String(l.upsert)});typeof Blob<"u"&&s instanceof Blob?(c=new FormData,c.append("cacheControl",l.cacheControl),c.append("",s)):typeof FormData<"u"&&s instanceof FormData?(c=s,c.append("cacheControl",l.cacheControl)):(c=s,d["cache-control"]=`max-age=${l.cacheControl}`,d["content-type"]=l.contentType);const h=yield this.fetch(u.toString(),{method:"PUT",body:c,headers:d}),m=yield h.json();return h.ok?{data:{path:i,fullPath:m.Key},error:null}:{data:null,error:m}}catch(c){if(Ne(c))return{data:null,error:c};throw c}})}createSignedUploadUrl(t,r){return He(this,void 0,void 0,function*(){try{let s=this._getFinalPath(t);const a=Object.assign({},this.headers);r!=null&&r.upsert&&(a["x-upsert"]="true");const i=yield nr(this.fetch,`${this.url}/object/upload/sign/${s}`,{},{headers:a}),o=new URL(this.url+i.url),u=o.searchParams.get("token");if(!u)throw new du("No token returned by API");return{data:{signedUrl:o.toString(),path:t,token:u},error:null}}catch(s){if(Ne(s))return{data:null,error:s};throw s}})}update(t,r,s){return He(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",t,r,s)})}move(t,r,s){return He(this,void 0,void 0,function*(){try{return{data:yield nr(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:t,destinationKey:r,destinationBucket:s==null?void 0:s.destinationBucket},{headers:this.headers}),error:null}}catch(a){if(Ne(a))return{data:null,error:a};throw a}})}copy(t,r,s){return He(this,void 0,void 0,function*(){try{return{data:{path:(yield nr(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:t,destinationKey:r,destinationBucket:s==null?void 0:s.destinationBucket},{headers:this.headers})).Key},error:null}}catch(a){if(Ne(a))return{data:null,error:a};throw a}})}createSignedUrl(t,r,s){return He(this,void 0,void 0,function*(){try{let a=this._getFinalPath(t),i=yield nr(this.fetch,`${this.url}/object/sign/${a}`,Object.assign({expiresIn:r},s!=null&&s.transform?{transform:s.transform}:{}),{headers:this.headers});const o=s!=null&&s.download?`&download=${s.download===!0?"":s.download}`:"";return i={signedUrl:encodeURI(`${this.url}${i.signedURL}${o}`)},{data:i,error:null}}catch(a){if(Ne(a))return{data:null,error:a};throw a}})}createSignedUrls(t,r,s){return He(this,void 0,void 0,function*(){try{const a=yield nr(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:r,paths:t},{headers:this.headers}),i=s!=null&&s.download?`&download=${s.download===!0?"":s.download}`:"";return{data:a.map(o=>Object.assign(Object.assign({},o),{signedUrl:o.signedURL?encodeURI(`${this.url}${o.signedURL}${i}`):null})),error:null}}catch(a){if(Ne(a))return{data:null,error:a};throw a}})}download(t,r){return He(this,void 0,void 0,function*(){const a=typeof(r==null?void 0:r.transform)<"u"?"render/image/authenticated":"object",i=this.transformOptsToQueryString((r==null?void 0:r.transform)||{}),o=i?`?${i}`:"";try{const u=this._getFinalPath(t);return{data:yield(yield ca(this.fetch,`${this.url}/${a}/${u}${o}`,{headers:this.headers,noResolveJson:!0})).blob(),error:null}}catch(u){if(Ne(u))return{data:null,error:u};throw u}})}info(t){return He(this,void 0,void 0,function*(){const r=this._getFinalPath(t);try{const s=yield ca(this.fetch,`${this.url}/object/info/${r}`,{headers:this.headers});return{data:go(s),error:null}}catch(s){if(Ne(s))return{data:null,error:s};throw s}})}exists(t){return He(this,void 0,void 0,function*(){const r=this._getFinalPath(t);try{return yield Nv(this.fetch,`${this.url}/object/${r}`,{headers:this.headers}),{data:!0,error:null}}catch(s){if(Ne(s)&&s instanceof xo){const a=s.originalError;if([400,404].includes(a==null?void 0:a.status))return{data:!1,error:s}}throw s}})}getPublicUrl(t,r){const s=this._getFinalPath(t),a=[],i=r!=null&&r.download?`download=${r.download===!0?"":r.download}`:"";i!==""&&a.push(i);const u=typeof(r==null?void 0:r.transform)<"u"?"render/image":"object",c=this.transformOptsToQueryString((r==null?void 0:r.transform)||{});c!==""&&a.push(c);let l=a.join("&");return l!==""&&(l=`?${l}`),{data:{publicUrl:encodeURI(`${this.url}/${u}/public/${s}${l}`)}}}remove(t){return He(this,void 0,void 0,function*(){try{return{data:yield $f(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:t},{headers:this.headers}),error:null}}catch(r){if(Ne(r))return{data:null,error:r};throw r}})}list(t,r,s){return He(this,void 0,void 0,function*(){try{const a=Object.assign(Object.assign(Object.assign({},Cv),r),{prefix:t||""});return{data:yield nr(this.fetch,`${this.url}/object/list/${this.bucketId}`,a,{headers:this.headers},s),error:null}}catch(a){if(Ne(a))return{data:null,error:a};throw a}})}encodeMetadata(t){return JSON.stringify(t)}toBase64(t){return typeof Buffer<"u"?Buffer.from(t).toString("base64"):btoa(t)}_getFinalPath(t){return`${this.bucketId}/${t}`}_removeEmptyFolders(t){return t.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(t){const r=[];return t.width&&r.push(`width=${t.width}`),t.height&&r.push(`height=${t.height}`),t.resize&&r.push(`resize=${t.resize}`),t.format&&r.push(`format=${t.format}`),t.quality&&r.push(`quality=${t.quality}`),r.join("&")}}const Ev="2.7.1",Tv={"X-Client-Info":`storage-js/${Ev}`};var Yr=function(e,t,r,s){function a(i){return i instanceof r?i:new r(function(o){o(i)})}return new(r||(r=Promise))(function(i,o){function u(d){try{l(s.next(d))}catch(h){o(h)}}function c(d){try{l(s.throw(d))}catch(h){o(h)}}function l(d){d.done?i(d.value):a(d.value).then(u,c)}l((s=s.apply(e,t||[])).next())})};class Av{constructor(t,r={},s){this.url=t,this.headers=Object.assign(Object.assign({},Tv),r),this.fetch=Lf(s)}listBuckets(){return Yr(this,void 0,void 0,function*(){try{return{data:yield ca(this.fetch,`${this.url}/bucket`,{headers:this.headers}),error:null}}catch(t){if(Ne(t))return{data:null,error:t};throw t}})}getBucket(t){return Yr(this,void 0,void 0,function*(){try{return{data:yield ca(this.fetch,`${this.url}/bucket/${t}`,{headers:this.headers}),error:null}}catch(r){if(Ne(r))return{data:null,error:r};throw r}})}createBucket(t,r={public:!1}){return Yr(this,void 0,void 0,function*(){try{return{data:yield nr(this.fetch,`${this.url}/bucket`,{id:t,name:t,public:r.public,file_size_limit:r.fileSizeLimit,allowed_mime_types:r.allowedMimeTypes},{headers:this.headers}),error:null}}catch(s){if(Ne(s))return{data:null,error:s};throw s}})}updateBucket(t,r){return Yr(this,void 0,void 0,function*(){try{return{data:yield jv(this.fetch,`${this.url}/bucket/${t}`,{id:t,name:t,public:r.public,file_size_limit:r.fileSizeLimit,allowed_mime_types:r.allowedMimeTypes},{headers:this.headers}),error:null}}catch(s){if(Ne(s))return{data:null,error:s};throw s}})}emptyBucket(t){return Yr(this,void 0,void 0,function*(){try{return{data:yield nr(this.fetch,`${this.url}/bucket/${t}/empty`,{},{headers:this.headers}),error:null}}catch(r){if(Ne(r))return{data:null,error:r};throw r}})}deleteBucket(t){return Yr(this,void 0,void 0,function*(){try{return{data:yield $f(this.fetch,`${this.url}/bucket/${t}`,{},{headers:this.headers}),error:null}}catch(r){if(Ne(r))return{data:null,error:r};throw r}})}}class Pv extends Av{constructor(t,r={},s){super(t,r,s)}from(t){return new Sv(this.url,this.headers,t,this.fetch)}}const Dv="2.49.1";let Gs="";typeof Deno<"u"?Gs="deno":typeof document<"u"?Gs="web":typeof navigator<"u"&&navigator.product==="ReactNative"?Gs="react-native":Gs="node";const Rv={"X-Client-Info":`supabase-js-${Gs}/${Dv}`},Iv={headers:Rv},Fv={schema:"public"},Mv={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},Ov={};var Lv=function(e,t,r,s){function a(i){return i instanceof r?i:new r(function(o){o(i)})}return new(r||(r=Promise))(function(i,o){function u(d){try{l(s.next(d))}catch(h){o(h)}}function c(d){try{l(s.throw(d))}catch(h){o(h)}}function l(d){d.done?i(d.value):a(d.value).then(u,c)}l((s=s.apply(e,t||[])).next())})};const $v=e=>{let t;return e?t=e:typeof fetch>"u"?t=kf:t=fetch,(...r)=>t(...r)},Uv=()=>typeof Headers>"u"?jf:Headers,zv=(e,t,r)=>{const s=$v(r),a=Uv();return(i,o)=>Lv(void 0,void 0,void 0,function*(){var u;const c=(u=yield t())!==null&&u!==void 0?u:e;let l=new a(o==null?void 0:o.headers);return l.has("apikey")||l.set("apikey",e),l.has("Authorization")||l.set("Authorization",`Bearer ${c}`),s(i,Object.assign(Object.assign({},o),{headers:l}))})};var Bv=function(e,t,r,s){function a(i){return i instanceof r?i:new r(function(o){o(i)})}return new(r||(r=Promise))(function(i,o){function u(d){try{l(s.next(d))}catch(h){o(h)}}function c(d){try{l(s.throw(d))}catch(h){o(h)}}function l(d){d.done?i(d.value):a(d.value).then(u,c)}l((s=s.apply(e,t||[])).next())})};function qv(e){return e.replace(/\/$/,"")}function Hv(e,t){const{db:r,auth:s,realtime:a,global:i}=e,{db:o,auth:u,realtime:c,global:l}=t,d={db:Object.assign(Object.assign({},o),r),auth:Object.assign(Object.assign({},u),s),realtime:Object.assign(Object.assign({},c),a),global:Object.assign(Object.assign({},l),i),accessToken:()=>Bv(this,void 0,void 0,function*(){return""})};return e.accessToken?d.accessToken=e.accessToken:delete d.accessToken,d}const Uf="2.68.0",ts=30*1e3,bo=3,ki=bo*ts,Vv="http://localhost:9999",Gv="supabase.auth.token",Wv={"X-Client-Info":`gotrue-js/${Uf}`},yo="X-Supabase-Api-Version",zf={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}};function Yv(e){return Math.round(Date.now()/1e3)+e}function Kv(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const t=Math.random()*16|0;return(e=="x"?t:t&3|8).toString(16)})}const kt=()=>typeof window<"u"&&typeof document<"u",Sr={tested:!1,writable:!1},Zs=()=>
396{if(!kt())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(Sr.tested)return Sr.writable;const e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),Sr.tested=!0,Sr.writable=!0}catch{Sr.tested=!0,Sr.writable=!1}return Sr.writable};function Qv(e){const t={},r=new URL(e);if(r.hash&&r.hash[0]==="#")try{new URLSearchParams(r.hash.substring(1)).forEach((a,i)=>{t[i]=a})}catch{}return r.searchParams.forEach((s,a)=>{t[a]=s}),t}const Bf=e=>{let t;return e?t=e:typeof fetch>"u"?t=(...r)=>Ft(async()=>{const{default:s}=await Promise.resolve().then(()=>Is);return{default:s}},void 0).then(({default:s})=>s(...r)):t=fetch,(...r)=>t(...r)},Jv=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",qf=async(e,t,r)=>{await e.setItem(t,JSON.stringify(r))},Ln=async(e,t)=>{const r=await e.getItem(t);if(!r)return null;try{return JSON.parse(r)}catch{return r}},$n=async(e,t)=>{await e.removeItem(t)};function Zv(e){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let r="",s,a,i,o,u,c,l,d=0;for(e=e.replace("-","+").replace("_","/");d<e.length;)o=t.indexOf(e.charAt(d++)),u=t.indexOf(e.charAt(d++)),c=t.indexOf(e.charAt(d++)),l=t.indexOf(e.charAt(d++)),s=o<<2|u>>4,a=(u&15)<<4|c>>2,i=(c&3)<<6|l,r=r+String.fromCharCode(s),c!=64&&a!=0&&(r=r+String.fromCharCode(a)),l!=64&&i!=0&&(r=r+String.fromCharCode(i));return r}class qa{constructor(){this.promise=new qa.promiseConstructor((t,r)=>{this.resolve=t,this.reject=r})}}qa.promiseConstructor=Promise;function Gc(e){const t=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}=?$|[a-z0-9_-]{2}(==)?$)$/i,r=e.split(".");if(r.length!==3)throw new Error("JWT is not valid: not a JWT structure");if(!t.test(r[1]))throw new Error("JWT is not valid: payload is not in base64url format");const s=r[1];return JSON.parse(Zv(s))}async function Xv(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function e2(e,t){return new Promise((s,a)=>{(async()=>{for(let i=0;i<1/0;i++)try{const o=await e(i);if(!t(i,null,o)){s(o);return}}catch(o){if(!t(i,o)){a(o);return}}})()})}function t2(e){return("0"+e.toString(16)).substr(-2)}function r2(){const t=new Uint32Array(56);if(typeof crypto>"u"){const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",s=r.length;let a="";for(let i=0;i<56;i++)a+=r.charAt(Math.floor(Math.random()*s));return a}return crypto.getRandomValues(t),Array.from(t,t2).join("")}async function s2(e){const r=new TextEncoder().encode(e),s=await crypto.subtle.digest("SHA-256",r),a=new Uint8Array(s);return Array.from(a).map(i=>String.fromCharCode(i)).join("")}function n2(e){return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function a2(e){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),e;const r=await s2(e);return n2(r)}async function Kr(e,t,r=!1){const s=r2();let a=s;r&&(a+="/PASSWORD_RECOVERY"),await qf(e,`${t}-code-verifier`,a);const i=await a2(s);return[i,s===i?"plain":"s256"]}const i2=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function o2(e){const t=e.headers.get(yo);if(!t||!t.match(i2))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}class fu extends Error{constructor(t,r,s){super(t),this.__isAuthError=!0,this.name="AuthError",this.status=r,this.code=s}}function ue(e){return typeof e=="object"&&e!==null&&"__isAuthError"in e}class u2 extends fu{constructor(t,r,s){super(t,r,s),this.name="AuthApiError",this.status=r,this.code=s}}function c2(e){return ue(e)&&e.name==="AuthApiError"}class Hf extends fu{constructor(t,r){super(t),this.name="AuthUnknownError",this.originalError=r}}class Br extends fu{constructor(t,r,s,a){super(t,s,a),this.name=r,this.status=s}}class er extends Br{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function l2(e){return ue(e)&&e.name==="AuthSessionMissingError"}class ji extends Br{constructor(){super("Auth session or user missing","AuthInvalidToken
396ResponseError",500,void 0)}}class Un extends Br{constructor(t){super(t,"AuthInvalidCredentialsError",400,void 0)}}class zn extends Br{constructor(t,r=null){super(t,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}function d2(e){return ue(e)&&e.name==="AuthImplicitGrantRedirectError"}class Wc extends Br{constructor(t,r=null){super(t,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class vo extends Br{constructor(t,r){super(t,"AuthRetryableFetchError",r,void 0)}}function Ni(e){return ue(e)&&e.name==="AuthRetryableFetchError"}class Yc extends Br{constructor(t,r,s){super(t,"AuthWeakPasswordError",r,"weak_password"),this.reasons=s}}var f2=function(e,t){var r={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(r[s]=e[s]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,s=Object.getOwnPropertySymbols(e);a<s.length;a++)t.indexOf(s[a])<0&&Object.prototype.propertyIsEnumerable.call(e,s[a])&&(r[s[a]]=e[s[a]]);return r};const Er=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),h2=[502,503,504];async function Kc(e){var t;if(!Jv(e))throw new vo(Er(e),0);if(h2.includes(e.status))throw new vo(Er(e),e.status);let r;try{r=await e.json()}catch(i){throw new Hf(Er(i),i)}let s;const a=o2(e);
396if(a&&a.getTime()>=zf["2024-01-01"].timestamp&&typeof r=="object"&&r&&typeof r.code=="string"?s=r.code:typeof r=="object"&&r&&typeof r.error_code=="string"&&(s=r.error_code),s){if(s==="weak_password")throw new Yc(Er(r),e.status,((t=r.weak_password)===null||t===void 0?void 0:t.reasons)||[]);if(s==="session_not_found")throw new er}else if(typeof r=="object"&&r&&typeof r.weak_password=="object"&&r.weak_password&&Array.isArray(r.weak_password.reasons)&&r.weak_password.reasons.length&&r.weak_password.reasons.reduce((i,o)=>i&&typeof o=="string",!0))throw new Yc(Er(r),e.status,r.weak_password.reasons);throw new u2(Er(r),e.status||500,s)}const m2=(e,t,r,s)=>{const a={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"?a:(a.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},t==null?void 0:t.headers),a.body=JSON.stringify(s),Object.assign(Object.assign({},a),r))};async function le(e,t,r,s){var a;const i=Object.assign({},s==null?void 0:s.headers);i[yo]||(i[yo]=zf["2024-01-01"].name),s!=null&&s.jwt&&(i.Authorization=`Bearer ${s.jwt}`);const o=(a=s==null?void 0:s.query)!==null&&a!==void 0?a:{};s!=null&&s.redirectTo&&(o.redirect_to=s.redirectTo);const u=Object.keys(o).length?"?"+new URLSearchParams(o).toString():"",c=await p2(e,t,r+u,{headers:i,noResolveJson:s==null?void 0:s.noResolveJson},{},s==null?void 0:s.body);return s!=null&&s.xform?s==null?void 0:s.xform(c):{data:Object.assign({},c),error:null}}async function p2(e,t,r,s,a,i){const o=m2(t,s,a,i);let u;try{u=await e(r,Object.assign({},o))}catch(c){throw console.error(c),new vo(Er(c),0)}if(u.ok||await Kc(u),s!=null&&s.noResolveJson)return u;try{return await u.json()}catch(c){await Kc(c)}}function tr(e){var t;let r=null;y2(e)&&(r=Object.assign({},e),e.expires_at||(r.expires_at=Yv(e.expires_in)));const s=(t=e.user)!==null&&t!==void 0?t:e;return{data:{session:r,user:s},error:null}}function Qc(e){const t=tr(e);return!t.error&&e.weak_password&&typeof e.weak_password=="object"&&Array.isArray(e.weak_password.reasons)&&e.weak_password.reasons.length&&e.weak_password.message&&typeof e.weak_password.message=="string"&&e.weak_password.reasons.reduce((r,s)=>r&&typeof s=="string",!0)&&(t.data.weak_password=e.weak_password),t}function ir(e){var t;return{data:{user:(t=e.user)!==null&&t!==void 0?t:e},error:null}}function x2(e){return{data:e,error:null}}function g2(e){const{action_link:t,email_otp:r,hashed_token:s,redirect_to:a,verification_type:i}=e,o=f2(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),u={action_link:t,email_otp:r,hashed_token:s,redirect_to:a,verification_type:i},c=Object.assign({},o);return{data:{properties:u,user:c},error:null}}function b2(e){return e}function y2(e){return e.access_token&&e.refresh_token&&e.expires_in}var v2=function(e,t){var r={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(r[s]=e[s]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,s=Object.getOwnPropertySymbols(e);a<s.length;a++)t.indexOf(s[a])<0&&Object.prototype.propertyIsEnumerable.call(e,s[a])&&(r[s[a]]=e[s[a]]);return r};class w2{constructor({url:t="",headers:r={},fetch:s}){this.url=t,this.headers=r,this.fetch=Bf(s),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)}}async signOut(t,r="global"){try{return await le(this.fetch,"POST",`${this.url}/logout?scope=${r}`,{headers:this.headers,jwt:t,noResolveJson:!0}),{data:null,error:null}}catch(s){if(ue(s))return{data:null,error:s};throw s}}async inviteUserByEmail(t,r={}){try{return await le(this.fetch,"POST",`${this.url}/invite`,{body:{email:t,data:r.data},headers:this.headers,redirectTo:r.redirectTo,xform:ir})}catch(s){if(ue(s))return{data:{user:null},error:s};throw s}}async generateLink(t){try{const{options:r}=t,s=v2(t,["options"]),a=Object.assign(Object.assign({},s),r);return"newEmail"in s&&(a.new_email=s==null?void 0:s.newEmail,delete a.newEmail),await le(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:a,headers:this.headers,xform:g2,redirectTo:r==null?void 0:r.redirectTo})}catch(r){if(ue(r))return{data:{properties:null,user:null},error:r};throw r}}async createUser(t){try{return await le(this.fetch,"POST",`${this.url}/admin/users`,{body:t,headers:this.headers,xform:ir})}catch(r){if(ue(r))return{data:{user:null},error:r};throw r}}async listUsers(t){var r,s,a,i,o,u,c;try{const l={nextPage:null,lastPage:0,total:0},d=await le(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(s=(r=t==null?void 0:t.page)===null||r===void 0?void 0:r.toString())!==null&&s!==void 0?s:"",per_page:(i=(a=t==null?void 0:t.perPage)===null||a===void 0?void 0:a.toString())!==null&&i!==void 0?i:""},xform:b2});if(d.error)throw d.error;const h=await d.json(),m=(o=d.headers.get("x-total-count"))!==null&&o!==void 0?o:0,p=(c=(u=d.headers.get("link"))===null||u===void 0?void 0:u.split(","))!==null&&c!==void 0?c:[];return p.length>
vendor: 16,384 bytes, line 396
3960&&(p.forEach(x=>{const g=parseInt(x.split(";")[0].split("=")[1].substring(0,1)),b=JSON.parse(x.split(";")[1].split("=")[1]);l[`${b}Page`]=g}),l.total=parseInt(m)),{data:Object.assign(Object.assign({},h),l),error:null}}catch(l){if(ue(l))return{data:{users:[]},error:l};throw l}}async getUserById(t){try{return await le(this.fetch,"GET",`${this.url}/admin/users/${t}`,{headers:this.headers,xform:ir})}catch(r){if(ue(r))return{data:{user:null},error:r};throw r}}async updateUserById(t,r){try{return await le(this.fetch,"PUT",`${this.url}/admin/users/${t}`,{body:r,headers:this.headers,xform:ir})}catch(s){if(ue(s))return{data:{user:null},error:s};throw s}}async deleteUser(t,r=!1){try{return await le(this.fetch,"DELETE",`${this.url}/admin/users/${t}`,{headers:this.headers,body:{should_soft_delete:r},xform:ir})}catch(s){if(ue(s))return{data:{user:null},error:s};throw s}}async _listFactors(t){try{const{data:r,error:s}=await le(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/factors`,{headers:this.headers,xform:a=>({data:{factors:a},error:null})});return{data:r,error:s}}catch(r){if(ue(r))return{data:null,error:r};throw r}}async _deleteFactor(t){try{return{data:await le(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/factors/${t.id}`,{headers:this.headers}),error:null}}catch(r){if(ue(r))return{data:null,error:r};throw r}}}const _2={getItem:e=>Zs()?globalThis.localStorage.getItem(e):null,setItem:(e,t)=>{Zs()&&globalThis.localStorage.setItem(e,t)},removeItem:e=>{Zs()&&globalThis.localStorage.removeItem(e)}};function Jc(e={}){return{getItem:t=>e[t]||null,setItem:(t,r)=>{e[t]=r},removeItem:t=>{delete e[t]}}}function k2(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}const Qr={debug:!!(globalThis&&Zs()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class Vf extends Error{constructor(t){super(t),this.isAcquireTimeout=!0}}class j2 extends Vf{}async function N2(e,t,r){Qr.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,t);const s=new globalThis.AbortController;return t>0&&setTimeout(()=>{s.abort(),Qr.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",e)},t),await Promise.resolve().then(()=>globalThis.navigator.locks.request(e,t===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:s.signal},async a=>{if(a){Qr.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,a.name);try{return await r()}finally{Qr.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,a.name)}}else{if(t===0)throw Qr.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new j2(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(Qr.debug)try{const i=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(i,null,"  "))}catch(i){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",i)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),await r()}}))}k2();const C2={url:Vv,storageKey:Gv,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:Wv,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1};async function Zc(e,t,r){return await r()}class nn{constructor(t){var r,s;this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log,this.instanceID=nn.nextInstanceID,nn.nextInstanceID+=1,this.instanceID>0&&kt()&&console.warn("Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.");const a=Object.assign(Object.assign({},C2),t);if(this.logDebugMessages=!!a.debug,typeof a.debug=="function"&&(this.logger=a.debug),this.persistSession=a.persistSession,this.storageKey=a.storageKey,this.autoRefreshToken=a.autoRefreshToken,this.admin=new w2({url:a.url,headers:a.headers,fetch:a.fetch}),this.url=a.url,this.headers=a.headers,this.fetch=Bf(a.fetch),this.lock=a.lock||Zc,this.detectSessionInUrl=a.detectSessionInUrl,this.flowType=a.flowType,this.hasCustomAuthorizationHeader=a.hasCustomAuthorizationHeader,a.lock?this.lock=a.lock:kt()&&(!((r=globalThis==null?void 0:globalThis.navigator)===null||r===void 0)&&r.locks)?this.lock=N2:this.lock=Zc,this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this)},this.persistSession?a.storage?this.storage=a.storage:Zs()?this.storage=_2:(this.memoryStorage={},this.storage=Jc(this.memoryStorage)):(this.memoryStorage={},this.storage=Jc(this.memoryStorage)),kt()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(i){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",i)}(s=this.broadcastChannel)===null||s===void 0||s.addEventListener("message",async i=>{this._debug("received broadcast notification from other tab or client",i),await this._notifyAllSubscribers(i.data.event,i.data.session,!1)})}this.initialize()}_debug(...t){return this.logDebugMessages&&this.logger(`GoTrueClient@${this.instanceID} (${Uf}) ${new Date().toISOString()}`,...t),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(-1,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var t;try{const r=Qv(window.location.href);let s="none";if(this._isImplicitGrantCallback(r)?s="implicit":await this._isPKCECallback(r)&&(s="pkce"),kt()&&this.detectSessionInUrl&&s!=="none"){const{data:a,error:i}=await this._getSessionFromURL(r,s);if(i){if(this._debug("#_initialize()","error detecting session from URL",i),d2(i)){const c=(t=i.details)===null||t===void 0?void 0:t.code;if(c==="identity_already_exists"||c==="identity_not_found"||c==="single_identity_not_deletable")return{error:i}}return await this._removeSession(),{error:i}}const{session:o,redirectType:u}=a;return this._debug("#_initialize()","detected session in URL",o,"redirect type",u),await this._saveSession(o),setTimeout(async()=>{u==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",o):await this._notifyAllSubscribers("SIGNED_IN",o)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(r){return ue(r)?{error:r}:{error:new Hf("Unexpected error during initialization",r)}}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(t){var r,s,a;try{const i=await le(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(s=(r=t==null?void 0:t.options)===null||r===void 0?void 0:r.data)!==null&&s!==void 0?s:{},gotrue_meta_security:{captcha_token:(a=t==null?void 0:t.options)===null||a===void 0?void 0:a.captchaToken}},xform:tr}),{data:o,error:u}=i;if(u||!o)return{data:{user:null,session:null},error:u};const c=o.session,l=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",c)),{data:{user:l,session:c},error:null}}catch(i){if(ue(i))return{data:{user:null,session:null},error:i};throw i}}async signUp(t){var r,s,a;try{let i;if("email"in t){const{email:d,password:h,options:m}=t;let p=null,x=null;this.flowType==="pkce"&&([p,x]=await Kr(this.storage,this.storageKey)),i=await le(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:m==null?void 0:m.emailRedirectTo,body:{email:d,password:h,data:(r=m==null?void 0:m.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:m==null?void 0:m.captchaToken},code_challenge:p,code_challenge_method:x},xform:tr})}else if("phone"in t){const{phone:d,password:h,options:m}=t;i=await le(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:d,password:h,data:(s=m==null?void 0:m.data)!==null&&s!==void 0?s:{},channel:(a=m==null?void 0:m.channel)!==null&&a!==void 0?a:"sms",gotrue_meta_security:{captcha_token:m==null?void 0:m.captchaToken}},xform:tr})}else throw new Un("You must provide either an email or phone number and a password");const{data:o,error:u}=i;if(u||!o)return{data:{user:null,session:null},error:u};const c=o.session,l=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",c)),{data:{user:l,session:c},error:null}}catch(i){if(ue(i))return{data:{user:null,session:null},error:i};throw i}}async signInWithPassword(t){try{let r;if("email"in t){const{email:i,password:o,options:u}=t;r=await le(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:i,password:o,gotrue_meta_security:{captcha_token:u==null?void 0:u.captchaToken}},xform:Qc})}else if("phone"in t){const{phone:i,password:o,options:u}=t;r=await le(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:i,password:o,gotrue_meta_security:{captcha_token:u==null?void 0:u.captchaToken}},xform:Qc})}else throw new Un("You must provide either an email or phone number and a password");const{data:s,error:a}=r;return a?{data:{user:null,session:null},error:a}:!s||!s.session||!s.user?{data:{user:null,session:null},error:new ji}:(s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",s.session)),{data:Object.assign({user:s.user,session:s.session},s.weak_password?{weakPassword:s.weak_password}:null),error:a})}catch(r){if(ue(r))return{data:{user:null,session:null},error:r};throw r}}async signInWithOAuth(t){var r,s,a,i;return await this._handleProviderSignIn(t.provider,{redirectTo:(r=t.options)===null||r===void 0?void 0:r.redirectTo,scopes:(s=t.options)===null||s===void 0?void 0:s.scopes,queryParams:(a=t.options)===null||a===void 0?void 0:a.queryParams,skipBrowserRedirect:(i=t.options)===null||i===void 0?void 0:i.skipBrowserRedirect})}async exchangeCodeForSession(t){return await this.initializePromise,this._acquireLock(-1,async()=>this._exchangeCodeForSession(t))}async _exchangeCodeForSession(t){const r=await Ln(this.storage,`${this.storageKey}-code-verifier`),[s,a]=(r??"").split("/");try{const{data:i,error:o}=await le(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:s},xform:tr});if(await $n(this.storage,`${this.storageKey}-code-verifier`),o)throw o;return!i||!i.session||!i.user?{data:{user:null,session:null,redirectType:null},error:new ji}:(i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers("SIGNED_IN",i.session)),{data:Object.assign(Object.assign({},i),{redirectType:a??null}),error:o})}catch(i){if(ue(i))return{data:{user:null,session:null,redirectType:null},error:i};throw i}}async signInWithIdToken(t){try{const{options:r,provider:s,token:a,access_token:i,nonce:o}=t,u=await le(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:s,id_token:a,access_token:i,nonce:o,gotrue_meta_security:{captcha_token:r==null?void 0:r.captchaToken}},xform:tr}),{data:c,error:l}=u;return l?{data:{user:null,session:null},error:l}:!c||!c.session||!c.user?{data:{user:null,session:null},error:new ji}:(c.session&&(await this._saveSession(c.session),await this._notifyAllSubscribers("SIGNED_IN",c.session)),{data:c,error:l})}catch(r){if(ue(r))return{data:{user:null,session:null},error:r};throw r}}async signInWithOtp(t){var r,s,a,i,o;try{if("email"in t){const{email:u,options:c}=t;let l=null,d=null;this.flowType==="pkce"&&([l,d]=await Kr(this.storage,this.storageKey));const{error:h}=await le(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:u,data:(r=c==null?void 0:c.data)!==null&&r!==void 0?r:{},create_user:(s=c==null?void 0:c.shouldCreateUser)!==null&&s!==void 0?s:!0,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken},code_challenge:l,code_challenge_method:d},redirectTo:c==null?void 0:c.emailRedirectTo});return{data:{user:null,session:null},error:h}}if("phone"in t){const{phone:u,options:c}=t,{data:l,error:d}=await le(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:u,data:(a=c==null?void 0:c.data)!==null&&a!==void 0?a:{},create_user:(i=c==null?void 0:c.shouldCreateUser)!==null&&i!==void 0?i:!0,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken},channel:(o=c==null?void 0:c.channel)!==null&&o!==void 0?o:"sms"}});return{data:{user:null,session:null,messageId:l==null?void 0:l.message_id},error:d}}throw new Un("You must provide either an email or phone number.")}catch(u){if(ue(u))return{data:{user:null,session:null},error:u};throw u}}async verifyOtp(t){var r,s;try{let a,i;"options"in t&&(a=(r=t.options)===null||r===void 0?void 0:r.redirectTo,i=(s=t.options)===null||s===void 0?void 0:s.captchaToken);const{data:o,error:u}=await le(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},t),{gotrue_meta_security:{captcha_token:i}}),redirectTo:a,xform:tr});if(u)throw u;if(!o)throw new Error("An error occurred on token verification.");const c=o.session,l=o.user;return c!=null&&c.access_token&&(await this._saveSession(c),await this._notifyAllSubscribers(t.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",c)),{data:{user:l,session:c},error:null}}catch(a){if(ue(a))return{data:{user:null,session:null},error:a};throw a}}async signInWithSSO(t){var r,s,a;try{let i=null,o=null;return this.flowType==="pkce"&&([i,o]=await Kr(this.storage,this.storageKey)),await le(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in t?{provider_id:t.providerId}:null),"domain"in t?{domain:t.domain}:null),{redirect_to:(s=(r=t.options)===null||r===void 0?void 0:r.redirectTo)!==null&&s!==void 0?s:void 0}),!((a=t==null?void 0:t.options)===null||a===void 0)&&a.captchaToken?{gotrue_meta_security:{captcha_token:t.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:i,code_challenge_method:o}),headers:this.headers,xform:x2})}catch(i){if(ue(i))return{data:null,error:i};throw i}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async t=>{const{data:{session:r},error:s}=t;if(s)throw s;if(!r)throw new er;const{error:a}=await le(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:r.access_token});return{data:{user:null,session:null},error:a}})}catch(t){if(ue(t))return{data:{user:null,session:null},error:t};throw t}}async resend(t){try{const r=`${this.url}/resend`;if("email"in t){const{email:s,type:a,options:i}=t,{error:o}=await le(this.fetch,"POST",r,{headers:this.headers,body:{email:s,type:a,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}},redirectTo:i==null?void 0:i.emailRedirectTo});return{data:{user:null,session:null},error:o}}else if("phone"in t){const{phone:s,type:a,options:i}=t,{data:o,error:u}=await le(this.fetch,"POST",r,{headers:this.headers,body:{phone:s,type:a,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}}});return{data:{user:null,session:null,messageId:o==null?void 0:o.message_id},error:u}}throw new Un("You must provide either an email or phone number and a type")}catch(r){if(ue(r))return{data:{user:null,session:null},error:r};throw r}}async getSession(){return await this.initializePromise,await this._acquireLock(-1,async()=>this._useSession(a
396sync r=>r))}async _acquireLock(t,r){this._debug("#_acquireLock","begin",t);try{if(this.lockAcquired){const s=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),a=(async()=>(await s,await r()))();return this.pendingInLock.push((async()=>{try{await a}catch{}})()),a}return await this.lock(`lock:${this.storageKey}`,t,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const s=r();for(this.pendingInLock.push((async()=>{try{await s}catch{}})()),await s;this.pendingInLock.length;){const a=[...this.pendingInLock];await Promise.all(a),this.pendingInLock.splice(0,a.length)}return await s}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(t){this._debug("#_useSession","begin");try{const r=await this.__loadSession();return await t(r)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let t=null;const r=await Ln(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",r),r!==null&&(this._isValidSession(r)?t=r:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!t)return{data:{session:null},error:null};const s=t.expires_at?t.expires_at*1e3-Date.now()<ki:!1;if(this._debug("#__loadSession()",`session has${s?"":" not"} expired`,"expires_at",t.expires_at),!s){if(this.storage.isServer){let o=this.suppressGetSessionWarning;t=new Proxy(t,{get:(c,l,d)=>(!o&&l==="user"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),o=!0,this.suppressGetSessionWarning=!0),Reflect.get(c,l,d))})}return{data:{session:t},error:null}}const{session:a,error:i}=await this._callRefreshToken(t.refresh_token);return i?{data:{session:null},error:i}:{data:{session:a},error:null}}finally{this._debug("#__loadSession()","end")}}async getUser(t){return t?await this._getUser(t):(await this.initializePromise,await this._acquireLock(-1,async()=>await this._getUser()))}async _getUser(t){try{return t?await le(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:t,xform:ir}):await this._useSession(async r=>{var s,a,i;const{data:o,error:u}=r;if(u)throw u;return!(!((s=o.session)===null||s===void 0)&&s.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new er}:await le(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(i=(a=o.session)===null||a===void 0?void 0:a.access_token)!==null&&i!==void 0?i:void 0,xform:ir})})}catch(r){if(ue(r))return l2(r)&&(await this._removeSession(),await $n(this.storage,`${this.storageKey}-code-verifier`)),{data:{user:null},error:r};throw r}}async updateUser(t,r={}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._updateUser(t,r))}async _updateUser(t,r={}){try{return await this._useSession(async s=>{const{data:a,error:i}=s;if(i)throw i;if(!a.session)throw new er;const o=a.session;let u=null,c=null;this.flowType==="pkce"&&t.email!=null&&([u,c]=await Kr(this.storage,this.storageKey));const{data:l,error:d}=await le(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:r==null?void 0:r.emailRedirectTo,body:Object.assign(Object.assign({},t),{code_challenge:u,code_challenge_method:c}),jwt:o.access_token,xform:ir});if(d)throw d;return o.user=l.user,await this._saveSession(o),await this._notifyAllSubscribers("USER_UPDATED",o),{data:{user:o.user},error:null}})}catch(s){if(ue(s))return{data:{user:null},error:s};throw s}}_decodeJWT(t){return Gc(t)}async setSession(t){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._setSession(t))}async _setSession(t){try{if(!t.access_token||!t.refresh_token)throw new er;const r=Date.now()/1e3;let s=r,a=!0,i=null;const o=Gc(t.access_token);if(o.exp&&(s=o.exp,a=s<=r),a){const{session:u,error:c}=await this._callRefreshToken(t.refresh_token);if(c)return{data:{user:null,session:null},error:c};if(!u)return{data:{user:null,session:null},error:null};i=u}else{const{data:u,error:c}=await this._getUser(t.access_token);if(c)throw c;i={access_token:t.access_token,refresh_token:t.refresh_token,user:u.user,token_type:"bearer",expires_in:s-r,expires_at:s},await this._saveSession(i),await this._notifyAllSubscribers("SIGNED_IN",i)}return{data:{user:i.user,session:i},error:null}}catch(r){if(ue(r))return{data:{session:null,user:null},error:r};throw r}}async refreshSession(t){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._refreshSession(t))}async _refreshSession(t){try{return await this._useSession(async r=>{var s;if(!t){const{data:o,error:u}=r;if(u)throw u;t=(s=o.session)!==null&&s!==void 0?s:void 0}if(!(t!=null&&t.refresh_token))throw new er;const{session:a,error:i}=await this._callRefreshToken(t.refresh_token);return i?{data:{user:null,session:null},error:i}:a?{data:{user:a.user,session:a},error:null}:{data:{user:null,session:null},error:null}})}catch(r){if(ue(r))return{data:{user:null,session:null},error:r};throw r}}async _getSessionFromURL(t,r){try{if(!kt())throw new zn("No browser detected.");
396if(t.error||t.error_description||t.error_code)throw new zn(t.error_description||"Error in URL with unspecified error_description",{error:t.error||"unspecified_error",code:t.error_code||"unspecified_code"});switch(r){case"implicit":if(this.flowType==="pkce")throw new Wc("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new zn("Not a valid implicit grant flow url.");break;default:}if(r==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!t.code)throw new Wc("No code detected.");const{data:y,error:w}=await this._exchangeCodeForSession(t.code);if(w)throw w;const _=new URL(window.location.href);return _.searchParams.delete("code"),window.history.replaceState(window.history.state,"",_.toString()),{data:{session:y.session,redirectType:null},error:null}}const{provider_token:s,provider_refresh_token:a,access_token:i,refresh_token:o,expires_in:u,expires_at:c,token_type:l}=t;if(!i||!u||!o||!l)throw new zn("No session defined in URL");const d=Math.round(Date.now()/1e3),h=parseInt(u);let m=d+h;c&&(m=parseInt(c));const p=m-d;p*1e3<=ts&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${p}s, should have been closer to ${h}s`);const x=m-h;d-x>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",x,m,d):d-x<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",x,m,d);const{data:g,error:b}=await this._getUser(i);if(b)throw b;const v={provider_token:s,provider_refresh_token:a,access_token:i,expires_in:h,expires_at:m,refresh_token:o,token_type:l,user:g.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),{data:{session:v,redirectType:t.type},error:null}}catch(s){if(ue(s))return{data:{session:null,redirectType:null},error:s};throw s}}_isImplicitGrantCallback(t){return!!(t.access_token||t.error_description)}async _isPKCECallback(t){const r=await Ln(this.storage,`${this.storageKey}-code-verifier`);return!!(t.code&&r)}async signOut(t={scope:"global"}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._signOut(t))}async _signOut({scope:t}={scope:"global"}){return await this._useSession(async r=>{var s;const{data:a,error:i}=r;if(i)return{error:i};const o=(s=a.session)===null||s===void 0?void 0:s.access_token;if(o){const{error:u}=await this.admin.signOut(o,t);if(u&&!(c2(u)&&(u.status===404||u.status===401||u.status===403)))return{error:u}}return t!=="others"&&(await this._removeSession(),await $n(this.storage,`${this.storageKey}-code-verifier`)),{error:null}})}onAuthStateChange(t){const r=Kv(),s={id:r,callback:t,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",r),this.stateChangeEmitters.delete(r)}};return this._debug("#onAuthStateChange()","registered callback with id",r),this.stateChangeEmitters.set(r,s),(async()=>(await this.initializePromise,await this._acquireLock(-1,async()=>{this._emitInitialSession(r)})))(),{data:{subscription:s}}}async _emitInitialSession(t){return await this._useSession(async r=>{var s,a;try{const{data:{session:i},error:o}=r;if(o)throw o;await((s=this.stateChangeEmitters.get(t))===null||s===void 0?void 0:s.callback("INITIAL_SESSION",i)),this._debug("INITIAL_SESSION","callback id",t,"session",i)}catch(i){await((a=this.stateChangeEmitters.get(t))===null||a===void 0?void 0:a.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",t,"error",i),console.error(i)}})}async resetPasswordForEmail(t,r={}){let s=null,a=null;this.flowType==="pkce"&&([s,a]=await Kr(this.storage,this.storageKey,!0));try{return await le(this.fetch,"POST",`${this.url}/recover`,{body:{email:t,code_challenge:s,code_challenge_method:a,gotrue_meta_security:{captcha_token:r.captchaToken}},headers:this.headers,redirectTo:r.redirectTo})}catch(i){if(ue(i))return{data:null,error:i};throw i}}async getUserIdentities(){var t;try{const{data:r,error:s}=await this.getUser();if(s)throw s;return{data:{identities:(t=r.user.identities)!==null&&t!==void 0?t:[]},error:null}}catch(r){if(ue(r))return{data:null,error:r};throw r}}async linkIdentity(t){var r;try{const{data:s,error:a}=await this._useSession(async i=>{var o,u,c,l,d;const{data:h,error:m}=i;if(m)throw m;const p=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,t.provider,{redirectTo:(o=t.options)===null||o===void 0?void 0:o.redirectTo,scopes:(u=t.options)===null||u===void 0?void 0:u.scopes,queryParams:(c=t.options)===null||c===void 0?void 0:c.queryParams,skipBrowserRedirect:!0});return await le(this.fetch,"GET",p,{headers:this.headers,jwt:(d=(l=h.session)===null||l===void 0?void 0:l.access_token)!==null&&d!==void 0?d:void 0})});if(a)throw a;return kt()&&!(!((r=t.options)===null||r===void 0)&&r.skipBrowserRedirect)&&window.location.assign(s==null?void 0:s.url),{data:{provider:t.provider,url:s==null?void 0:s.url},error:null}}catch(s){if(ue(s))return{data:{provider:t.provider,url:null},error:s};throw s}}async unlinkIdentity(t){try{return await this._useSession(async r=>{var s,a;const{data:i,error:o}=r;if(o)throw o;
396return await le(this.fetch,"DELETE",`${this.url}/user/identities/${t.identity_id}`,{headers:this.headers,jwt:(a=(s=i.session)===null||s===void 0?void 0:s.access_token)!==null&&a!==void 0?a:void 0})})}catch(r){if(ue(r))return{data:null,error:r};throw r}}async _refreshAccessToken(t){const r=`#_refreshAccessToken(${t.substring(0,5)}...)`;this._debug(r,"begin");try{const s=Date.now();return await e2(async a=>(a>0&&await Xv(200*Math.pow(2,a-1)),this._debug(r,"refreshing attempt",a),await le(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:t},headers:this.headers,xform:tr})),(a,i)=>{const o=200*Math.pow(2,a);return i&&Ni(i)&&Date.now()+o-s<ts})}catch(s){if(this._debug(r,"error",s),ue(s))return{data:{session:null,user:null},error:s};throw s}finally{this._debug(r,"end")}}_isValidSession(t){return typeof t=="object"&&t!==null&&"access_token"in t&&"refresh_token"in t&&"expires_at"in t}async _handleProviderSignIn(t,r){const s=await this._getUrlForProvider(`${this.url}/authorize`,t,{redirectTo:r.redirectTo,scopes:r.scopes,queryParams:r.queryParams});return this._debug("#_handleProviderSignIn()","provider",t,"options",r,"url",s),kt()&&!r.skipBrowserRedirect&&window.location.assign(s),{data:{provider:t,url:s},error:null}}async _recoverAndRefresh(){var t;const r="#_recoverAndRefresh()";this._debug(r,"begin");try{const s=await Ln(this.storage,this.storageKey);if(this._debug(r,"session from storage",s),!this._isValidSession(s)){this._debug(r,"session is not valid"),s!==null&&await this._removeSession();return}const a=((t=s.expires_at)!==null&&t!==void 0?t:1/0)*1e3-Date.now()<ki;if(this._debug(r,`session has${a?"":" not"} expired with margin of ${ki}s`),a){if(this.autoRefreshToken&&s.refresh_token){const{error:i}=await this._callRefreshToken(s.refresh_token);i&&(console.error(i),Ni(i)||(this._debug(r,"refresh failed with a non-retryable error, removing the session",i),await this._removeSession()))}}else await this._notifyAllSubscribers("SIGNED_IN",s)}catch(s){this._debug(r,"error",s),console.error(s);return}finally{this._debug(r,"end")}}async _callRefreshToken(t){var r,s;if(!t)throw new er;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const a=`#_callRefreshToken(${t.substring(0,5)}...)`;this._debug(a,"begin");try{this.refreshingDeferred=new qa;const{data:i,error:o}=await this._refreshAccessToken(t);if(o)throw o;if(!i.session)throw new er;await this._saveSession(i.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",i.session);const u={session:i.session,error:null};return this.refreshingDeferred.resolve(u),u}catch(i){if(this._debug(a,"error",i),ue(i)){const o={session:null,error:i};return Ni(i)||await this._removeSession(),(r=this.refreshingDeferred)===null||r===void 0||r.resolve(o),o}throw(s=this.refreshingDeferred)===null||s===void 0||s.reject(i),i}finally{this.refreshingDeferred=null,this._debug(a,"end")}}async _notifyAllSubscribers(t,r,s=!0){const a=`#_notifyAllSubscribers(${t})`;this._debug(a,"begin",r,`broadcast = ${s}`);try{this.broadcastChannel&&s&&this.broadcastChannel.postMessage({event:t,session:r});const i=[],o=Array.from(this.stateChangeEmitters.values()).map(async u=>{try{await u.callback(t,r)}catch(c){i.push(c)}});if(await Promise.all(o),i.length>0){for(let u=0;u<i.length;u+=1)console.error(i[u]);throw i[0]}}finally{this._debug(a,"end")}}async _saveSession(t){this._debug("#_saveSession()",t),this.suppressGetSessionWarning=!0,await qf(this.storage,this.storageKey,t)}async _removeSession(){this._debug("#_removeSession()"),await $n(this.storage,this.storageKey),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const t=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{t&&kt()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",t)}catch(r){console.error("removing visibilitychange callback failed",r)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const t=setInterval(()=>this._autoRefreshTokenTick(),ts);this.autoRefreshTicker=t,t&&typeof t=="object"&&typeof t.unref=="function"?t.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(t),setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const t=this.autoRefreshTicker;this.autoRefreshTicker=null,t&&clearInterval(t)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{const t=Date.now();try{return await this._useSession(async r=>{const{data:{session:s}}=r;if(!s||!s.refresh_token||!s.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const a=Math.floor((s.expires_at*1e3-t)/ts);this._debug("#_autoRefreshTokenTick()",`access token expires in ${a} ticks, a tick lasts ${ts}ms, refresh threshold is ${bo} ticks`),a<=bo&&await this._callRefreshToken(s.refresh_token)})}catch(r){console.error("Auto refresh tick failed with error. This is likely a transient error.",r)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(t){if(t.isAcquireTimeout||t instanceof Vf)this._debug("auto refresh token tick lock not available");else throw t}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!kt()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(t){console.error("_handleVisibilityChange",t)}}async _onVisibilityChanged(t){const r=`#_onVisibilityChanged(${t})`;this._debug(r,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),t||(await this.initializePromise,await this._acquireLock(-1,async()=>
396{if(document.visibilityState!=="visible"){this._debug(r,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(t,r,s){const a=[`provider=${encodeURIComponent(r)}`];if(s!=null&&s.redirectTo&&a.push(`redirect_to=${encodeURIComponent(s.redirectTo)}`),s!=null&&s.scopes&&a.push(`scopes=${encodeURIComponent(s.scopes)}`),this.flowType==="pkce"){const[i,o]=await Kr(this.storage,this.storageKey),u=new URLSearchParams({code_challenge:`${encodeURIComponent(i)}`,code_challenge_method:`${encodeURIComponent(o)}`});a.push(u.toString())}if(s!=null&&s.queryParams){const i=new URLSearchParams(s.queryParams);a.push(i.toString())}return s!=null&&s.skipBrowserRedirect&&a.push(`skip_http_redirect=${s.skipBrowserRedirect}`),`${t}?${a.join("&")}`}async _unenroll(t){try{return await this._useSession(async r=>{var s;const{data:a,error:i}=r;return i?{data:null,error:i}:await le(this.fetch,"DELETE",`${this.url}/factors/${t.factorId}`,{headers:this.headers,jwt:(s=a==null?void 0:a.session)===null||s===void 0?void 0:s.access_token})})}catch(r){if(ue(r))return{data:null,error:r};throw r}}async _enroll(t){try{return await this._useSession(async r=>{var s,a;const{data:i,error:o}=r;if(o)return{data:null,error:o};const u=Object.assign({friendly_name:t.friendlyName,factor_type:t.factorType},t.factorType==="phone"?{phone:t.phone}:{issuer:t.issuer}),{data:c,error:l}=await le(this.fetch,"POST",`${this.url}/factors`,{body:u,headers:this.headers,jwt:(s=i==null?void 0:i.session)===null||s===void 0?void 0:s.access_token});return l?{data:null,error:l}:(t.factorType==="totp"&&(!((a=c==null?void 0:c.totp)===null||a===void 0)&&a.qr_code)&&(c.totp.qr_code=`data:image/svg+xml;utf-8,${c.totp.qr_code}`),{data:c,error:null})})}catch(r){if(ue(r))return{data:null,error:r};throw r}}async _verify(t){return this._acquireLock(-1,async()=>{try{return await this._useSession(async r=>{var s;const{data:a,error:i}=r;if(i)return{data:null,error:i};const{data:o,error:u}=await le(this.fetch,"POST",`${this.url}/factors/${t.factorId}/verify`,{body:{code:t.code,challenge_id:t.challengeId},headers:this.headers,jwt:(s=a==null?void 0:a.session)===null||s===void 0?void 0:s.access_token});return u?{data:null,error:u}:(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+o.expires_in},o)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",o),{data:o,error:u})})}catch(r){if(ue(r))return{data:null,error:r};throw r}})}async _challenge(t){return this._acquireLock(-1,async()=>{try{return await this._useSession(async r=>{var s;const{data:a,error:i}=r;return i?{data:null,error:i}:await le(this.fetch,"POST",`${this.url}/factors/${t.factorId}/challenge`,{body:{channel:t.channel},headers:this.headers,jwt:(s=a==null?void 0:a.session)===null||s===void 0?void 0:s.access_token})})}catch(r){if(ue(r))return{data:null,error:r};throw r}})}async _challengeAndVerify(t){const{data:r,error:s}=await this._challenge({factorId:t.factorId});return s?{data:null,error:s}:await this._verify({factorId:t.factorId,challengeId:r.id,code:t.code})}async _listFactors(){const{data:{user:t},error:r}=await this.getUser();if(r)return{data:null,error:r};const s=(t==null?void 0:t.factors)||[],a=s.filter(o=>o.factor_type==="totp"&&o.status==="verified"),i=s.filter(o=>o.factor_type==="phone"&&o.status==="verified");return{data:{all:s,totp:a,phone:i},error:null}}async _getAuthenticatorAssuranceLevel(){return this._acquireLock(-1,async()=>await this._useSession(async t=>{var r,s;const{data:{session:a},error:i}=t;if(i)return{data:null,error:i};if(!a)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const o=this._decodeJWT(a.access_token);let u=null;o.aal&&(u=o.aal);let c=u;((s=(r=a.user.factors)===null||r===void 0?void 0:r.filter(h=>h.status==="verified"))!==null&&s!==void 0?s:[]).length>0&&(c="aal2");const d=o.amr||[];return{data:{currentLevel:u,nextLevel:c,currentAuthenticationMethods:d},error:null}}))}}nn.nextInstanceID=0;const S2=nn;class E2 extends S2{constructor(t){super(t)}}var T2=function(e,t,r,s){function a(i){return i instanceof r?i:new r(function(o){o(i)})}return new(r||(r=Promise))(function(i,o){function u(d){try{l(s.next(d))}catch(h){o(h)}}function c(d){try{l(s.throw(d))}catch(h){o(h)}}function l(d){d.done?i(d.value):a(d.value).then(u,c)}l((s=s.apply(e,t||[])).next())})};class A2{constructor(t,r,s){var a,i,o;if(this.supabaseUrl=t,this.supabaseKey=r,!t)throw new Error("supabaseUrl is required.");
396if(!r)throw new Error("supabaseKey is required.");const u=qv(t);this.realtimeUrl=`${u}/realtime/v1`.replace(/^http/i,"ws"),this.authUrl=`${u}/auth/v1`,this.storageUrl=`${u}/storage/v1`,this.functionsUrl=`${u}/functions/v1`;const c=`sb-${new URL(this.authUrl).hostname.split(".")[0]}-auth-token`,l={db:Fv,realtime:Ov,auth:Object.assign(Object.assign({},Mv),{storageKey:c}),global:Iv},d=Hv(s??{},l);this.storageKey=(a=d.auth.storageKey)!==null&&a!==void 0?a:"",this.headers=(i=d.global.headers)!==null&&i!==void 0?i:{},d.accessToken?(this.accessToken=d.accessToken,this.auth=new Proxy({},{get:(h,m)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(m)} is not possible`)}})):this.auth=this._initSupabaseAuthClient((o=d.auth)!==null&&o!==void 0?o:{},this.headers,d.global.fetch),this.fetch=zv(r,this._getAccessToken.bind(this),d.global.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers,accessToken:this._getAccessToken.bind(this)},d.realtime)),this.rest=new rv(`${u}/rest/v1`,{headers:this.headers,schema:d.db.schema,fetch:this.fetch}),d.accessToken||this._listenForAuthEvents()}get functions(){return new Dy(this.functionsUrl,{headers:this.headers,customFetch:this.fetch})}get storage(){return new Pv(this.storageUrl,this.headers,this.fetch)}from(t){return this.rest.from(t)}schema(t){return this.rest.schema(t)}rpc(t,r={},s={}){return this.rest.rpc(t,r,s)}channel(t,r={config:{}}){return this.realtime.channel(t,r)}getChannels(){return this.realtime.getChannels()}removeChannel(t){return this.realtime.removeChannel(t)}removeAllChannels(){return this.realtime.removeAllChannels()}_getAccessToken(){var t,r;return T2(this,void 0,void 0,function*(){if(this.accessToken)return yield this.accessToken();const{data:s}=yield this.auth.getSession();return(r=(t=s.session)===null||t===void 0?void 0:t.access_token)!==null&&r!==void 0?r:null})}_initSupabaseAuthClient({autoRefreshToken:t,persistSession:r,detectSessionInUrl:s,storage:a,storageKey:i,flowType:o,lock:u,debug:c},l,d){const h={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new E2({url:this.authUrl,headers:Object.assign(Object.assign({},h),l),storageKey:i,autoRefreshToken:t,persistSession:r,detectSessionInUrl:s,storage:a,flowType:o,lock:u,debug:c,fetch:d,hasCustomAuthorizationHeader:"Authorization"in this.headers})}_initRealtimeClient(t){return new gv(this.realtimeUrl,Object.assign(Object.assign({},t),{params:Object.assign({apikey:this.supabaseKey},t==null?void 0:t.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((r,s)=>{this._handleTokenChanged(r,"CLIENT",s==null?void 0:s.access_token)})}_handleTokenChanged(t,r,s){(t==="TOKEN_REFRESHED"||t==="SIGNED_IN")&&this.changedAccessToken!==s?this.changedAccessToken=s:t==="SIGNED_OUT"&&(this.realtime.setAuth(),r=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}}const P2=(e,t,r)=>new A2(e,t,r),Gf="https://kgmscuvosujhhtbfagmj.supabase.co",D2="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImtnbXNjdXZvc3VqaGh0YmZhZ21qIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NDE2ODE2NDIsImV4cCI6MjA1NzI1NzY0Mn0.g3QN899U_brrPWJuk97nRG4-akZYVNO5UosxMz7npII";console.log("Initializing Supabase client with URL:",Gf);const J=P2(Gf,D2,{auth:{flowType:"pkce",autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0}}),Bn={tier:null,status:null,isActive:!1,trialActive:!1,messageLimit:0,messagesUsed:0},Wf=f.createContext(void 0);function R2({children:e}){const[t,r]=f.useState(null),[s,a]=f.useState(null),[i,o]=f.useState(!0),[u,c]=f.useState(Bn),l=gt(),d=async()=>{if(!t)return Bn;try{const g=localStorage.getItem("explainify_subscription_active")==="true",b=localStorage.getItem("explainify_subscription_plan"),v=localStorage.getItem("explainify_subscription_time");if(g&&b&&v){const U=new Date(v).getTime(),P=new Date().getTime(),Y=5*60*1e3;if(P-U<Y){console.log("Using cached subscription data");const M={tier:b.charAt(0).toUpperCase()+b.slice(1),status:"active",isActive:!0,trialActive:!1,messageLimit:b==="starter"?100:b==="pro"?1e3:5e3,messagesUsed:0};return c(M),M}}const{data:y,error:w}=await J.from("profiles").select("subscription_tier, subscription_status, is_trial_active").eq("id",t.id).single();if(w)throw w;const{data:_,error:k}=await J.from("user_usage").select("messages_limit, messages_used").eq("id",t.id).single(),N=y==null?void 0:y.subscription_tier,j=(y==null?void 0:y.subscription_status)||"inactive",C=(y==null?void 0:y.is_trial_active)||!1,I=j==="active"||C,A=(_==null?void 0:_.messages_limit)||0,F=(_==null?void 0:_.messages_used)||0,E={tier:N,status:j,isActive:I,trialActive:C,messageLimit:A,messagesUsed:F};return c(E),localStorage.setItem("explainify_subscription_active",String(I)),N&&localStorage.setItem("explainify_subscription_plan",N.toLowerCase()),localStorage.setItem("explainify_subscription_time",new Date().toISOString()),E}catch(g){return console.error("Error checking subscription:",g),Bn}};f.useEffect(()=>{J.auth.getSession().then(({data:{session:b}})=>{a(b),r((b==null?void 0:b.user)??null),b!=null&&b.user&&d(),o(!1)});const{data:{subscription:g}}=J.auth.onAuthStateChange(async(b,v)=>{a(v),r((v==null?void 0:v.user)??null),v!=null&&v.user?await d():(c(Bn),localStorage.removeItem("explainify_subscription_active"),localStorage.removeItem("explainify_subscription_plan"),localStorage.removeItem("explainify_subscription_time")),o(!1)});return()=>g.unsubscribe()},[]);const h=async(g,b,v,y)=>{try{o(!0);const{error:w}=await J.auth.signUp({email:g,password:b,options:{data:{first_name:v,last_name:y}}});if(w)throw w;L.success("Account created successfully. Please check your email for verification."),l("/auth?mode=login")}catch(w){L.error(`Error creating account: ${w.message}`)}finally{o(!1)}},m=async(g,b)=>{try{o(!0);const{error:v}=await J.auth.signInWithPassword({email:g,password:b});if(v)throw v;L.success("Logged in successfully"),l("/dashboard")}catch(v){L.error(`Error signing in: ${v.message}`)}finally{o(!1)}},p=async()=>{let g=0;const b=1,v=()=>{localStorage.removeItem("explainify.auth.inProgress"),localStorage.removeItem("explainify.auth.timestamp"),localStorage.removeItem("explainify.auth.state"),localStorage.removeItem("explainify.auth.startTime")};v();const y=async()=>{try{o(!0);const w="https://explainify-ailearniverse-96.vercel.app/auth/callback";console.log("Using redirect URL:",w),localStorage.setItem("explainify.auth.timestamp",Date.now().toString()),localStorage.setItem("explainify.auth.inProgress","true");const _=`auth-${Date.now()}`;localStorage.setItem("explainify.auth.state",_),console.log(`Starting Google authentication flow (attempt ${g+1}/${b+1}) with redirect to:`,w);const k={redirectTo:w,queryParams:{access_type:"offline",prompt:"select_account consent",state:_},scopes:"email profile"},{data:N,error:j}=await J.auth.signInWithOAuth({provider:"google",options:k});if(j)throw j;if(N!=null&&N.url){console.log("Redirecting to Google authentication:",N.url),localStorage.setItem("explainify.auth.startTime",Date.now().toString()),window.location.href=N.url;return}else throw new Error("No redirect URL returned from authentication provider")}catch(w){if(console.error(`Google authentication error (attempt ${g+1}/${b+1}):`,w),v(),g<b)return g++,console.log(`Retrying authentication (attempt ${g+1}/${b+1})...`),await new Promise(k=>setTimeout(k,1e3)),y();let _="Failed to sign in with Google";w.message&&(w.message.includes("popup")?_="Popup was blocked. Please allow popups for this site.":w.message.includes("network")||w.message.includes("timeout")?_="Network error or timeout. Please try again.":w.message.includes("configuration")?_="Authentication configuration error. Please contact support.":_=`Error: ${w.message}`),L.error(n.jsxs("div",{className:"flex flex-col",children:[n.jsx("span",{children:_}),n.jsx("button",{onClick:()=>l("/auth/troubleshoot"),className:"text-left text-sm underline mt-1",children:"Go to troubleshooting"})]})),o(!1)}};await y()},x=async()=>{try{o(!0),r(null),a(null);try{await J.auth.signOut()}catch(g){console.error("Error during Supabase signOut:",g)}for(let g=0;g<localStorage.length;g++){const b=localStorage.key(g);b&&b.startsWith("sb-")&&localStorage.removeItem(b)}L.success("Signed out successfully"),window.location.href="/"}catch(g){L.error(`Error signing out: ${g.message}`),o(!1)}};return n.jsx(Wf.Provider,{value:{user:t,session:s,isLoading:i,subscription:u,checkSubscription:d,signUp:h,signIn:m,signInWithGoogle:p,signOut:x},children:e})}function ke(){const e=f.useContext(Wf);
vendor: 5,082 bytes, line 396
396if(e===void 0)throw new Error("useAuth must be used within an AuthProvider");return e}var I2=f.createContext(void 0);function Ha(e){const t=f.useContext(I2);return e||t||"ltr"}var Ci=0;function hu(){f.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Xc()),document.body.insertAdjacentElement("beforeend",e[1]??Xc()),Ci++,()=>{Ci===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Ci--}},[])}function Xc(){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 Si="focusScope.autoFocusOnMount",Ei="focusScope.autoFocusOnUnmount",el={bubbles:!1,cancelable:!0},F2="FocusScope",Va=f.forwardRef((e,t)=>{const{loop:r=!1,trapped:s=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...o}=e,[u,c]=f.useState(null),l=Fe(a),d=Fe(i),h=f.useRef(null),m=he(t,g=>c(g)),p=f.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;f.useEffect(()=>{if(s){let g=function(w){if(p.paused||!u)return;const _=w.target;u.contains(_)?h.current=_:rr(h.current,{select:!0})},b=function(w){if(p.paused||!u)return;const _=w.relatedTarget;_!==null&&(u.contains(_)||rr(h.current,{select:!0}))},v=function(w){if(document.activeElement===document.body)for(const k of w)k.removedNodes.length>0&&rr(u)};document.addEventListener("focusin",g),document.addEventListener("focusout",b);const y=new MutationObserver(v);return u&&y.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",b),y.disconnect()}}},[s,u,p.paused]),f.useEffect(()=>{if(u){rl.add(p);const g=document.activeElement;if(!u.contains(g)){const v=new CustomEvent(Si,el);u.addEventListener(Si,l),u.dispatchEvent(v),v.defaultPrevented||(M2(z2(Yf(u)),{select:!0}),document.activeElement===g&&rr(u))}return()=>{u.removeEventListener(Si,l),setTimeout(()=>{const v=new CustomEvent(Ei,el);u.addEventListener(Ei,d),u.dispatchEvent(v),v.defaultPrevented||rr(g??document.body,{select:!0}),u.removeEventListener(Ei,d),rl.remove(p)},0)}}},[u,l,d,p]);const x=f.useCallback(g=>{if(!r&&!s||p.paused)return;const b=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,v=document.activeElement;if(b&&v){const y=g.currentTarget,[w,_]=O2(y);w&&_?!g.shiftKey&&v===_?(g.preventDefault(),r&&rr(w,{select:!0})):g.shiftKey&&v===w&&(g.preventDefault(),r&&rr(_,{select:!0})):v===y&&g.preventDefault()}},[r,s,p.paused]);return n.jsx(re.div,{tabIndex:-1,...o,ref:m,onKeyDown:x})});Va.displayName=F2;function M2(e,{select:t=!1}={}){const r=document.activeElement;for(const s of e)if(rr(s,{select:t}),document.activeElement!==r)return}function O2(e){const t=Yf(e),r=tl(t,e),s=tl(t.reverse(),e);return[r,s]}function Yf(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>{const a=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||a?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function tl(e,t){for(const r of e)if(!L2(r,{upTo:t}))return r}function L2(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 $2(e){return e instanceof HTMLInputElement&&"select"in e}function rr(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&$2(e)&&t&&e.select()}}var rl=U2();function U2(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=sl(e,t),e.unshift(t)},remove(t){var r;e=sl(e,t),(r=e[0])==null||r.resume()}}}function sl(e,t){const r=[...e],s=r.indexOf(t);return s!==-1&&r.splice(s,1),r}function z2(e){return e.filter(t=>t.tagName!=="A")}function B2(e,t=[]){let r=[];function s(i,o){const u=f.createContext(o),c=r.length;r=[...r,o];function l(h){const{scope:m,children:p,...x}=h,g=(m==null?void 0:m[e][c])||u,b=f.useMemo(()=>x,Object.values(x));return n.jsx(g.Provider,{value:b,children:p})}function d(h,m){const p=(m==null?void 0:m[e][c])||u,x=f.useContext(p);if(x)return x;if(o!==void 0)return o;throw new Error(`\`${h}\` must be used within \`${i}\``)}return l.displayName=i+"Provider",[l,d]}const a=()=>{const i=r.map(o=>f.createContext(o));return function(u){const c=(u==null?void 0:u[e])||i;return f.useMemo(()=>({[`__scope${e}`]:{...u,[e]:c}}),[u,c])}};return a.scopeName=e,[s,q2(a,...t)]}function q2(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const s=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const o=s.reduce((u,{useScope:c,scopeName:l})=>{const h=c(i)[`__scope${l}`];return{...u,...h}},{});return f.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}var Ti="rovingFocusGroup.onEntryFocus",H2={bubbles:!1,cancelable:!0},Ga="RovingFocusGroup",[wo,Kf,V2]=ka(Ga),[G2,Wa]=B2(Ga,[V2]),[W2,Y2]=G2(Ga),Qf=f.forwardRef((e,t)=>
vendor: 10,098 bytes, lines 396-411
396n.jsx(wo.Provider,{scope:e.__scopeRovingFocusGroup,children:n.jsx(wo.Slot,{scope:e.__scopeRovingFocusGroup,children:n.jsx(K2,{...e,ref:t})})}));Qf.displayName=Ga;var K2=f.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:s,loop:a=!1,dir:i,currentTabStopId:o,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:d=!1,...h}=e,m=f.useRef(null),p=he(t,m),x=Ha(i),[g=null,b]=Vt({prop:o,defaultProp:u,onChange:c}),[v,y]=f.useState(!1),w=Fe(l),_=Kf(r),k=f.useRef(!1),[N,j]=f.useState(0);return f.useEffect(()=>{const C=m.current;if(C)return C.addEventListener(Ti,w),()=>C.removeEventListener(Ti,w)},[w]),n.jsx(W2,{scope:r,orientation:s,dir:x,loop:a,currentTabStopId:g,onItemFocus:f.useCallback(C=>b(C),[b]),onItemShiftTab:f.useCallback(()=>y(!0),[]),onFocusableItemAdd:f.useCallback(()=>j(C=>C+1),[]),onFocusableItemRemove:f.useCallback(()=>j(C=>C-1),[]),children:n.jsx(re.div,{tabIndex:v||N===0?-1:0,"data-orientation":s,...h,ref:p,style:{outline:"none",...e.style},onMouseDown:H(e.onMouseDown,()=>{k.current=!0}),onFocus:H(e.onFocus,C=>{const I=!k.current;if(C.target===C.currentTarget&&I&&!v){const A=new CustomEvent(Ti,H2);if(C.currentTarget.dispatchEvent(A),!A.defaultPrevented){const F=_().filter(M=>M.focusable),E=F.find(M=>M.active),U=F.find(M=>M.id===g),Y=[E,U,...F].filter(Boolean).map(M=>M.ref.current);Xf(Y,d)}}k.current=!1}),onBlur:H(e.onBlur,()=>y(!1))})})}),Jf="RovingFocusGroupItem",Zf=f.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:s=!0,active:a=!1,tabStopId:i,...o}=e,u=ht(),c=i||u,l=Y2(Jf,r),d=l.currentTabStopId===c,h=Kf(r),{onFocusableItemAdd:m,onFocusableItemRemove:p}=l;return f.useEffect(()=>{if(s)return m(),()=>p()},[s,m,p]),n.jsx(wo.ItemSlot,{scope:r,id:c,focusable:s,active:a,children:n.jsx(re.span,{tabIndex:d?0:-1,"data-orientation":l.orientation,...o,ref:t,onMouseDown:H(e.onMouseDown,x=>{s?l.onItemFocus(c):x.preventDefault()}),onFocus:H(e.onFocus,()=>l.onItemFocus(c)),onKeyDown:H(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){l.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const g=Z2(x,l.orientation,l.dir);if(g!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let v=h().filter(y=>y.focusable).map(y=>y.ref.current);if(g==="last")v.reverse();else if(g==="prev"||g==="next"){g==="prev"&&v.reverse();const y=v.indexOf(x.currentTarget);v=l.loop?X2(v,y+1):v.slice(y+1)}setTimeout(()=>Xf(v))}})})})});Zf.displayName=Jf;var Q2={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function J2(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Z2(e,t,r){const s=J2(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(s))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(s)))return Q2[s]}function Xf(e,t=!1){const r=document.activeElement;for(const s of e)if(s===r||(s.focus({preventScroll:t}),document.activeElement!==r))return}function X2(e,t){return e.map((r,s)=>e[(t+s)%e.length])}var eh=Qf,th=Zf,ew=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Jr=new WeakMap,qn=new WeakMap,Hn={},Ai=0,rh=function(e){return e&&(e.host||rh(e.parentNode))},tw=function(e,t){return t.map(function(r){if(e.contains(r))return r;var s=rh(r);return s&&e.contains(s)?s:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},rw=function(e,t,r,s){var a=tw(t,Array.isArray(e)?e:[e]);Hn[r]||(Hn[r]=new WeakMap);var i=Hn[r],o=[],u=new Set,c=new Set(a),l=function(h){!h||u.has(h)||(u.add(h),l(h.parentNode))};a.forEach(l);var d=function(h){!h||c.has(h)||Array.prototype.forEach.call(h.children,function(m){if(u.has(m))d(m);else try{var p=m.getAttribute(s),x=p!==null&&p!=="false",g=(Jr.get(m)||0)+1,b=(i.get(m)||0)+1;Jr.set(m,g),i.set(m,b),o.push(m),g===1&&x&&qn.set(m,!0),b===1&&m.setAttribute(r,"true"),x||m.setAttribute(s,"true")}catch(v){console.error("aria-hidden: cannot operate on ",m,v)}})};return d(t),u.clear(),Ai++,function(){o.forEach(function(h){var m=Jr.get(h)-1,p=i.get(h)-1;Jr.set(h,m),i.set(h,p),m||(qn.has(h)||h.removeAttribute(s),qn.delete(h)),p||h.removeAttribute(r)}),Ai--,Ai||(Jr=new WeakMap,Jr=new WeakMap,qn=new WeakMap,Hn={})}},mu=function(e,t,r){r===void 0&&(r="data-aria-hidden");var s=Array.from(Array.isArray(e)?e:[e]),a=ew(e);return a?(s.push.apply(s,Array.from(a.querySelectorAll("[aria-live]"))),rw(s,a,r,"aria-hidden")):function(){return null}},Et=function(){return Et=Object.assign||function(t){for(var r,s=1,a=arguments.length;s<a;s++){r=arguments[s];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},Et.apply(this,arguments)};function sh(e,t){var r={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(r[s]=e[s]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,s=Object.getOwnPropertySymbols(e);a<s.length;a++)t.indexOf(s[a])<0&&Object.prototype.propertyIsEnumerable.call(e,s[a])&&(r[s[a]]=e[s[a]]);return r}function sw(e,t,r){if(r||arguments.length===2)for(var s=0,a=t.length,i;s<a;s++)(i||!(s in t))&&(i||(i=Array.prototype.slice.call(t,0,s)),i[s]=t[s]);return e.concat(i||Array.prototype.slice.call(t))}var Xn="right-scroll-bar-position",ea="width-before-scroll-bar",nw="with-scroll-bars-hidden",aw="--removed-body-scroll-bar-size";function Pi(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function iw(e,t){var r=f.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(s){var a=r.value;a!==s&&(r.value=s,r.callback(s,a))}}}})[0];return r.callback=t,r.facade}var ow=typeof window<"u"?f.useLayoutEffect:f.useEffect,nl=new WeakMap;function uw(e,t){var r=iw(null,function(s){return e.forEach(function(a){return Pi(a,s)})});return ow(function(){var s=nl.get(r);if(s){var a=new Set(s),i=new Set(e),o=r.current;a.forEach(function(u){i.has(u)||Pi(u,null)}),i.forEach(function(u){a.has(u)||Pi(u,o)})}nl.set(r,e)},[e]),r}function cw(e){return e}function lw(e,t){t===void 0&&(t=cw);var r=[],s=!1,a={read:function(){if(s)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(i){var o=t(i,s);return r.push(o),function(){r=r.filter(function(u){return u!==o})}},assignSyncMedium:function(i){for(s=!0;r.length;){var o=r;r=[],o.forEach(i)}r={push:function(u){return i(u)},filter:function(){return r}}},assignMedium:function(i){s=!0;var o=[];if(r.length){var u=r;r=[],u.forEach(i),o=r}var c=function(){var d=o;o=[],d.forEach(i)},l=function(){return Promise.resolve().then(c)};l(),r={push:function(d){o.push(d),l()},filter:function(d){return o=o.filter(d),r}}}};return a}function dw(e){e===void 0&&(e={});var t=lw(null);return t.options=Et({async:!0,ssr:!1},e),t}var nh=function(e){var t=e.sideCar,r=sh(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var s=t.read();if(!s)throw new Error("Sidecar medium not found");return f.createElement(s,Et({},r))};nh.isSideCarExport=!0;function fw(e,t){return e.useMedium(t),nh}var ah=dw(),Di=function(){},Ya=f.forwardRef(function(e,t){var r=f.useRef(null),s=f.useState({onScrollCapture:Di,onWheelCapture:Di,onTouchMoveCapture:Di}),a=s[0],i=s[1],o=e.forwardProps,u=e.children,c=e.className,l=e.removeScrollBar,d=e.enabled,h=e.shards,m=e.sideCar,p=e.noIsolation,x=e.inert,g=e.allowPinchZoom,b=e.as,v=b===void 0?"div":b,y=e.gapMode,w=sh(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),_=m,k=uw([r,t]),N=Et(Et({},w),a);return f.createElement(f.Fragment,null,d&&f.createElement(_,{sideCar:ah,removeScrollBar:l,shards:h,noIsolation:p,inert:x,setCallbacks:i,allowPinchZoom:!!g,lockRef:r,gapMode:y}),o?f.cloneElement(f.Children.only(u),Et(Et({},N),{ref:k})):f.createElement(v,Et({},N,{className:c,ref:k}),u))});Ya.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ya.classNames={fullWidth:ea,zeroRight:Xn};var hw=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function mw(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=hw();return t&&e.setAttribute("nonce",t),e}function pw(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function xw(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var gw=function(){var e=0,t=null;return{add:function(r){e==0&&(t=mw())&&(pw(t,r),xw(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},bw=function(){var e=gw();return function(t,r){f.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},ih=function(){var e=bw(),t=function(r){var s=r.styles,a=r.dynamic;return e(s,a),null};return t},yw={left:0,top:0,right:0,gap:0},Ri=function(e){return parseInt(e||"",10)||0},vw=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],s=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[Ri(r),Ri(s),Ri(a)]},ww=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return yw;var t=vw(e),r=document.documentElement.clientWidth,s=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,s-r+t[2]-t[0])}},_w=ih(),as="data-scroll-locked",kw=function(e,t,r,s){var a=e.left,i=e.top,o=e.right,u=e.gap;return r===void 0&&(r="margin"),`
397  .`.concat(nw,` {
398   overflow: hidden `).concat(s,`;
399   padding-right: `).concat(u,"px ").concat(s,`;
400  }
401  body[`).concat(as,`] {
402    overflow: hidden `).concat(s,`;
403    overscroll-behavior: contain;
404    `).concat([t&&"position: relative ".concat(s,";"),r==="margin"&&`
405    padding-left: `.concat(a,`px;
406    padding-top: `).concat(i,`px;
407    padding-right: `).concat(o,`px;
408    margin-left:0;
409    margin-top:0;
410    margin-right: `).concat(u,"px ").concat(s,`;
411    `),r==="padding"&&"padding-right: ".concat(u,"px ").concat(s,";
411")].filter(Boolean).join(""),`
412  }
413  
414  .`).concat(Xn,` {
415    right: `).concat(u,"px ").concat(s,`;
416  }
417  
418  .`).concat(ea,` {
419    margin-right: `).concat(u,"px ").concat(s,`;
420  }
421  
422  .`).concat(Xn," .").concat(Xn,` {
423    right: 0 `).concat(s,`;
424  }
425  
426  .`).concat(ea," .").concat(ea,` {
427    margin-right: 0 `).concat(s,`;
428  }
429  
430  body[`).concat(as,`] {
431    `).concat(aw,": ").concat(u,`px;
432  }
433`)},al=function(){var e=parseInt(document.body.getAttribute(as)||"0",10);return isFinite(e)?e:0},jw=function(){f.useEffect(function(){return document.body.setAttribute(as,(al()+1).toString()),function(){var e=al()-1;e<=0?document.body.removeAttribute(as):document.body.setAttribute(as,e.toString())}},[])},Nw=function(e){var t=e.noRelative,r=e.noImportant,s=e.gapMode,a=s===void 0?"margin":s;jw();var i=f.useMemo(function(){return ww(a)},[a]);return f.createElement(_w,{styles:kw(i,!t,a,r?"":"!important")})},_o=!1;if(typeof window<"u")try{var Vn=Object.defineProperty({},"passive",{get:function(){return _o=!0,!0}});window.addEventListener("test",Vn,Vn),window.removeEventListener("test",Vn,Vn)}catch{_o=!1}var Zr=_o?{passive:!1}:!1,Cw=function(e){return e.tagName==="TEXTAREA"},oh=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!Cw(e)&&r[t]==="visible")},Sw=function(e){return oh(e,"overflowY")},Ew=function(e){return oh(e,"overflowX")},il=function(e,t){var r=t.ownerDocument,s=t;do{typeof ShadowRoot<"u"&&s instanceof ShadowRoot&&(s=s.host);var a=uh(e,s);if(a){var i=ch(e,s),o=i[1],u=i[2];if(o>u)return!0}s=s.parentNode}while(s&&s!==r.body);return!1},Tw=function(e){var t=e.scrollTop,r=e.scrollHeight,s=e.clientHeight;return[t,r,s]},Aw=function(e){var t=e.scrollLeft,r=e.scrollWidth,s=e.clientWidth;return[t,r,s]},uh=function(e,t){return e==="v"?Sw(t):Ew(t)},ch=function(e,t){return e==="v"?Tw(t):Aw(t)},Pw=function(e,t){return e==="h"&&t==="rtl"?-1:1},Dw=function(e,t,r,s,a){var i=Pw(e,window.getComputedStyle(t).direction),o=i*s,u=r.target,c=t.contains(u),l=!1,d=o>0,h=0,m=0;do{var p=ch(e,u),x=p[0],g=p[1],b=p[2],v=g-b-i*x;(x||v)&&uh(e,u)&&(h+=v,m+=x),u instanceof ShadowRoot?u=u.host:u=u.parentNode}while(!c&&u!==document.body||c&&(t.contains(u)||t===u));return(d&&(Math.abs(h)<1||!a)||!d&&(Math.abs(m)<1||!a))&&(l=!0),l},Gn=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ol=function(e){return[e.deltaX,e.deltaY]},ul=function(e){return e&&"current"in e?e.current:e},Rw=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Iw=function(e){return`
434  .block-interactivity-`.concat(e,` {pointer-events: none;}
435  .allow-interactivity-`).concat(e,` {pointer-events: all;}
436`)},Fw=0,Xr=[];function Mw(e){var t=f.useRef([]),r=f.useRef([0,0]),s=f.useRef(),a=f.useState(Fw++)[0],i=f.useState(ih)[0],o=f.useRef(e);f.useEffect(function(){o.current=e},[e]),f.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var g=sw([e.lockRef.current],(e.shards||[]).map(ul),!0).filter(Boolean);return g.forEach(function(b){return b.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),g.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var u=f.useCallback(function(g,b){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!o.current.allowPinchZoom;var v=Gn(g),y=r.current,w="deltaX"in g?g.deltaX:y[0]-v[0],_="deltaY"in g?g.deltaY:y[1]-v[1],k,N=g.target,j=Math.abs(w)>Math.abs(_)?"h":"v";if("touches"in g&&j==="h"&&N.type==="range")return!1;var C=il(j,N);if(!C)return!0;if(C?k=j:(k=j==="v"?"h":"v",C=il(j,N)),!C)return!1;if(!s.current&&"changedTouches"in g&&(w||_)&&(s.current=k),!k)return!0;var I=s.current||k;return Dw(I,b,g,I==="h"?w:_,!0)},[]),c=f.useCallback(function(g){var b=g;if(!(!Xr.length||Xr[Xr.length-1]!==i)){var v="deltaY"in b?ol(b):Gn(b),y=t.current.filter(function(k){return k.name===b.type&&(k.target===b.target||b.target===k.shadowParent)&&Rw(k.delta,v)}
vendor: 19,392 bytes, line 436
436)[0];if(y&&y.should){b.cancelable&&b.preventDefault();return}if(!y){var w=(o.current.shards||[]).map(ul).filter(Boolean).filter(function(k){return k.contains(b.target)}),_=w.length>0?u(b,w[0]):!o.current.noIsolation;_&&b.cancelable&&b.preventDefault()}}},[]),l=f.useCallback(function(g,b,v,y){var w={name:g,delta:b,target:v,should:y,shadowParent:Ow(v)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(_){return _!==w})},1)},[]),d=f.useCallback(function(g){r.current=Gn(g),s.current=void 0},[]),h=f.useCallback(function(g){l(g.type,ol(g),g.target,u(g,e.lockRef.current))},[]),m=f.useCallback(function(g){l(g.type,Gn(g),g.target,u(g,e.lockRef.current))},[]);f.useEffect(function(){return Xr.push(i),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:m}),document.addEventListener("wheel",c,Zr),document.addEventListener("touchmove",c,Zr),document.addEventListener("touchstart",d,Zr),function(){Xr=Xr.filter(function(g){return g!==i}),document.removeEventListener("wheel",c,Zr),document.removeEventListener("touchmove",c,Zr),document.removeEventListener("touchstart",d,Zr)}},[]);var p=e.removeScrollBar,x=e.inert;return f.createElement(f.Fragment,null,x?f.createElement(i,{styles:Iw(a)}):null,p?f.createElement(Nw,{gapMode:e.gapMode}):null)}function Ow(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Lw=fw(ah,Mw);var Ka=f.forwardRef(function(e,t){return f.createElement(Ya,Et({},e,{ref:t,sideCar:Lw}))});Ka.classNames=Ya.classNames;var ko=["Enter"," "],$w=["ArrowDown","PageUp","Home"],lh=["ArrowUp","PageDown","End"],Uw=[...$w,...lh],zw={ltr:[...ko,"ArrowRight"],rtl:[...ko,"ArrowLeft"]},Bw={ltr:["ArrowLeft"],rtl:["ArrowRight"]},vn="Menu",[an,qw,Hw]=ka(vn),[qr,dh]=kr(vn,[Hw,Rs,Wa]),Qa=Rs(),fh=Wa(),[Vw,Hr]=qr(vn),[Gw,wn]=qr(vn),hh=e=>{const{__scopeMenu:t,open:r=!1,children:s,dir:a,onOpenChange:i,modal:o=!0}=e,u=Qa(t),[c,l]=f.useState(null),d=f.useRef(!1),h=Fe(i),m=Ha(a);return f.useEffect(()=>{const p=()=>{d.current=!0,document.addEventListener("pointerdown",x,{capture:!0,once:!0}),document.addEventListener("pointermove",x,{capture:!0,once:!0})},x=()=>d.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",x,{capture:!0}),document.removeEventListener("pointermove",x,{capture:!0})}},[]),n.jsx(tu,{...u,children:n.jsx(Vw,{scope:t,open:r,onOpenChange:h,content:c,onContentChange:l,children:n.jsx(Gw,{scope:t,onClose:f.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:d,dir:m,modal:o,children:s})})})};hh.displayName=vn;var Ww="MenuAnchor",pu=f.forwardRef((e,t)=>{const{__scopeMenu:r,...s}=e,a=Qa(r);return n.jsx(ru,{...a,...s,ref:t})});pu.displayName=Ww;var xu="MenuPortal",[Yw,mh]=qr(xu,{forceMount:void 0}),ph=e=>{const{__scopeMenu:t,forceMount:r,children:s,container:a}=e,i=Hr(xu,t);return n.jsx(Yw,{scope:t,forceMount:r,children:n.jsx(bt,{present:r||i.open,children:n.jsx(pn,{asChild:!0,container:a,children:s})})})};ph.displayName=xu;var it="MenuContent",[Kw,gu]=qr(it),xh=f.forwardRef((e,t)=>{const r=mh(it,e.__scopeMenu),{forceMount:s=r.forceMount,...a}=e,i=Hr(it,e.__scopeMenu),o=wn(it,e.__scopeMenu);return n.jsx(an.Provider,{scope:e.__scopeMenu,children:n.jsx(bt,{present:s||i.open,children:n.jsx(an.Slot,{scope:e.__scopeMenu,children:o.modal?n.jsx(Qw,{...a,ref:t}):n.jsx(Jw,{...a,ref:t})})})})}),Qw=f.forwardRef((e,t)=>{const r=Hr(it,e.__scopeMenu),s=f.useRef(null),a=he(t,s);return f.useEffect(()=>{const i=s.current;if(i)return mu(i)},[]),n.jsx(bu,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:H(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),Jw=f.forwardRef((e,t)=>{const r=Hr(it,e.__scopeMenu);return n.jsx(bu,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),bu=f.forwardRef((e,t)=>{const{__scopeMenu:r,loop:s=!1,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:u,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:d,onFocusOutside:h,onInteractOutside:m,onDismiss:p,disableOutsideScroll:x,...g}=e,b=Hr(it,r),v=wn(it,r),y=Qa(r),w=fh(r),_=qw(r),[k,N]=f.useState(null),j=f.useRef(null),C=he(t,j,b.onContentChange),I=f.useRef(0),A=f.useRef(""),F=f.useRef(0),E=f.useRef(null),U=f.useRef("right"),P=f.useRef(0),Y=x?Ka:f.Fragment,M=x?{as:pr,allowPinchZoom:!0}:void 0,Q=T=>{var q,ee;const O=A.current+T,$=_().filter(se=>!se.disabled),G=document.activeElement,Z=(q=$.find(se=>se.ref.current===G))==null?void 0:q.textValue,te=$.map(se=>se.textValue),z=c3(te,O,Z),K=(ee=$.find(se=>se.textValue===z))==null?void 0:ee.ref.current;(function se(X){A.current=X,window.clearTimeout(I.current),X!==""&&(I.current=window.setTimeout(()=>se(""),1e3))})(O),K&&setTimeout(()=>K.focus())};f.useEffect(()=>()=>window.clearTimeout(I.current),[]),hu();const S=f.useCallback(T=>{var $,G;return U.current===(($=E.current)==null?void 0:$.side)&&d3(T,(G=E.current)==null?void 0:G.area)},[]);return n.jsx(Kw,{scope:r,searchRef:A,onItemEnter:f.useCallback(T=>{S(T)&&T.preventDefault()},[S]),onItemLeave:f.useCallback(T=>{var O;S(T)||((O=j.current)==null||O.focus(),N(null))},[S]),onTriggerLeave:f.useCallback(T=>{S(T)&&T.preventDefault()},[S]),pointerGraceTimerRef:F,onPointerGraceIntentChange:f.useCallback(T=>{E.current=T},[]),children:n.jsx(Y,{...M,children:n.jsx(Va,{asChild:!0,trapped:a,onMountAutoFocus:H(i,T=>{var O;T.preventDefault(),(O=j.current)==null||O.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:n.jsx(Ss,{asChild:!0,disableOutsidePointerEvents:u,onEscapeKeyDown:l,onPointerDownOutside:d,onFocusOutside:h,onInteractOutside:m,onDismiss:p,children:n.jsx(eh,{asChild:!0,...w,dir:v.dir,orientation:"vertical",loop:s,currentTabStopId:k,onCurrentTabStopIdChange:N,onEntryFocus:H(c,T=>{v.isUsingKeyboardRef.current||T.preventDefault()}),preventScrollOnEntryFocus:!0,children:n.jsx(su,{role:"menu","aria-orientation":"vertical","data-state":Dh(b.open),"data-radix-menu-content":"",dir:v.dir,...y,...g,ref:C,style:{outline:"none",...g.style},onKeyDown:H(g.onKeyDown,T=>{const $=T.target.closest("[data-radix-menu-content]")===T.currentTarget,G=T.ctrlKey||T.altKey||T.metaKey,Z=T.key.length===1;$&&(T.key==="Tab"&&T.preventDefault(),!G&&Z&&Q(T.key));const te=j.current;if(T.target!==te||!Uw.includes(T.key))return;T.preventDefault();const K=_().filter(q=>!q.disabled).map(q=>q.ref.current);lh.includes(T.key)&&K.reverse(),o3(K)}),onBlur:H(e.onBlur,T=>{T.currentTarget.contains(T.target)||(window.clearTimeout(I.current),A.current="")}),onPointerMove:H(e.onPointerMove,on(T=>{const O=T.target,$=P.current!==T.clientX;if(T.currentTarget.contains(O)&&$){const G=T.clientX>P.current?"right":"left";U.current=G,P.current=T.clientX}}))})})})})})})});xh.displayName=it;var Zw="MenuGroup",yu=f.forwardRef((e,t)=>{const{__scopeMenu:r,...s}=e;return n.jsx(re.div,{role:"group",...s,ref:t})});yu.displayName=Zw;var Xw="MenuLabel",gh=f.forwardRef((e,t)=>{const{__scopeMenu:r,...s}=e;return n.jsx(re.div,{...s,ref:t})});gh.displayName=Xw;var la="MenuItem",cl="menu.itemSelect",Ja=f.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:s,...a}=e,i=f.useRef(null),o=wn(la,e.__scopeMenu),u=gu(la,e.__scopeMenu),c=he(t,i),l=f.useRef(!1),d=()=>{const h=i.current;if(!r&&h){const m=new CustomEvent(cl,{bubbles:!0,cancelable:!0});h.addEventListener(cl,p=>s==null?void 0:s(p),{once:!0}),Ro(h,m),m.defaultPrevented?l.current=!1:o.onClose()}};return n.jsx(bh,{...a,ref:c,disabled:r,onClick:H(e.onClick,d),onPointerDown:h=>{var m;(m=e.onPointerDown)==null||m.call(e,h),l.current=!0},onPointerUp:H(e.onPointerUp,h=>{var m;l.current||(m=h.currentTarget)==null||m.click()}),onKeyDown:H(e.onKeyDown,h=>{const m=u.searchRef.current!=="";r||m&&h.key===" "||ko.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})});Ja.displayName=la;var bh=f.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:s=!1,textValue:a,...i}=e,o=gu(la,r),u=fh(r),c=f.useRef(null),l=he(t,c),[d,h]=f.useState(!1),[m,p]=f.useState("");return f.useEffect(()=>{const x=c.current;x&&p((x.textContent??"").trim())},[i.children]),n.jsx(an.ItemSlot,{scope:r,disabled:s,textValue:a??m,children:n.jsx(th,{asChild:!0,...u,focusable:!s,children:n.jsx(re.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":s||void 0,"data-disabled":s?"":void 0,...i,ref:l,onPointerMove:H(e.onPointerMove,on(x=>{s?o.onItemLeave(x):(o.onItemEnter(x),x.defaultPrevented||x.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:H(e.onPointerLeave,on(x=>o.onItemLeave(x))),onFocus:H(e.onFocus,()=>h(!0)),onBlur:H(e.onBlur,()=>h(!1))})})})}),e3="MenuCheckboxItem",yh=f.forwardRef((e,t)=>{const{checked:r=!1,onCheckedChange:s,...a}=e;return n.jsx(jh,{scope:e.__scopeMenu,checked:r,children:n.jsx(Ja,{role:"menuitemcheckbox","aria-checked":da(r)?"mixed":r,...a,ref:t,"data-state":wu(r),onSelect:H(a.onSelect,()=>s==null?void 0:s(da(r)?!0:!r),{checkForDefaultPrevented:!1})})})});yh.displayName=e3;var vh="MenuRadioGroup",[t3,r3]=qr(vh,{value:void 0,onValueChange:()=>{}}),wh=f.forwardRef((e,t)=>{const{value:r,onValueChange:s,...a}=e,i=Fe(s);return n.jsx(t3,{scope:e.__scopeMenu,value:r,onValueChange:i,children:n.jsx(yu,{...a,ref:t})})});wh.displayName=vh;var _h="MenuRadioItem",kh=f.forwardRef((e,t)=>{const{value:r,...s}=e,a=r3(_h,e.__scopeMenu),i=r===a.value;return n.jsx(jh,{scope:e.__scopeMenu,checked:i,children:n.jsx(Ja,{role:"menuitemradio","aria-checked":i,...s,ref:t,"data-state":wu(i),onSelect:H(s.onSelect,()=>{var o;return(o=a.onValueChange)==null?void 0:o.call(a,r)},{checkForDefaultPrevented:!1})})})});kh.displayName=_h;var vu="MenuItemIndicator",[jh,s3]=qr(vu,{checked:!1}),Nh=f.forwardRef((e,t)=>{const{__scopeMenu:r,forceMount:s,...a}=e,i=s3(vu,r);return n.jsx(bt,{present:s||da(i.checked)||i.checked===!0,children:n.jsx(re.span,{...a,ref:t,"data-state":wu(i.checked)})})});Nh.displayName=vu;var n3="MenuSeparator",Ch=f.forwardRef((e,t)=>{const{__scopeMenu:r,...s}=e;return n.jsx(re.div,{role:"separator","aria-orientation":"horizontal",...s,ref:t})});Ch.displayName=n3;var a3="MenuArrow",Sh=f.forwardRef((e,t)=>{const{__scopeMenu:r,...s}=e,a=Qa(r);return n.jsx(nu,{...a,...s,ref:t})});Sh.displayName=a3;var i3="MenuSub",[KN,Eh]=qr(i3),Ws="MenuSubTrigger",Th=f.forwardRef((e,t)=>{const r=Hr(Ws,e.__scopeMenu),s=wn(Ws,e.__scopeMenu),a=Eh(Ws,e.__scopeMenu),i=gu(Ws,e.__scopeMenu),o=f.useRef(null),{pointerGraceTimerRef:u,onPointerGraceIntentChange:c}=i,l={__scopeMenu:e.__scopeMenu},d=f.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return f.useEffect(()=>d,[d]),f.useEffect(()=>{const h=u.current;return()=>{window.clearTimeout(h),c(null)}},[u,c]),n.jsx(pu,{asChild:!0,...l,children:n.jsx(bh,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":a.contentId,"data-state":Dh(r.open),...e,ref:_a(t,a.onTriggerChange),onClick:h=>{var m;(m=e.onClick)==null||m.call(e,h),!(e.disabled||h.defaultPrevented)&&(h.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:H(e.onPointerMove,on(h=>{i.onItemEnter(h),!h.defaultPrevented&&!e.disabled&&!r.open&&!o.current&&(i.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{r.onOpenChange(!0),d()},100))})),onPointerLeave:H(e.onPointerLeave,on(h=>{var p,x;d();const m=(p=r.content)==null?void 0:p.getBoundingClientRect();if(m){const g=(x=r.content)==null?void 0:x.dataset.side,b=g==="right",v=b?-5:5,y=m[b?"left":"right"],w=m[b?"right":"left"];i.onPointerGraceIntentChange({area:[{x:h.clientX+v,y:h.clientY},{x:y,y:m.top},{x:w,y:m.top},{x:w,y:m.bottom},{x:y,y:m.bottom}],side:g}),window.clearTimeout(u.current),u.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(h),h.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:H(e.onKeyDown,h=>{var p;const m=i.searchRef.current!=="";e.disabled||m&&h.key===" "||zw[s.dir].includes(h.key)&&(r.onOpenChange(!0),(p=r.content)==null||p.focus(),h.preventDefault())})})})});Th.displayName=Ws;var Ah="MenuSubContent",Ph=f.forwardRef((e,t)=>{const r=mh(it,e.__scopeMenu),{forceMount:s=r.forceMount,...a}=e,i=Hr(it,e.__scopeMenu),o=wn(it,e.__scopeMenu),u=Eh(Ah,e.__scopeMenu),c=f.useRef(null),l=he(t,c);return n.jsx(an.Provider,{scope:e.__scopeMenu,children:n.jsx(bt,{present:s||i.open,children:n.jsx(an.Slot,{scope:e.__scopeMenu,children:n.jsx(bu,{id:u.contentId,"aria-labelledby":u.triggerId,...a,ref:l,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var h;o.isUsingKeyboardRef.current&&((h=c.current)==null||h.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:H(e.onFocusOutside,d=>{d.target!==u.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:H(e.onEscapeKeyDown,d=>{o.onClose(),d.preventDefault()}),onKeyDown:H(e.onKeyDown,d=>{var p;const h=d.currentTarget.contains(d.target),m=Bw[o.dir].includes(d.key);h&&m&&(i.onOpenChange(!1),(p=u.trigger)==null||p.focus(),d.preventDefault())})})})})})});Ph.displayName=Ah;function Dh(e){return e?"open":"closed"}function da(e){return e==="indeterminate"}function wu(e){return da(e)?"indeterminate":e?"checked":"unchecked"}function o3(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function u3(e,t){return e.map((r,s)=>e[(t+s)%e.length])}function c3(e,t,r){const a=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,i=r?e.indexOf(r):-1;let o=u3(e,Math.max(i,0));a.length===1&&(o=o.filter(l=>l!==r));const c=o.find(l=>l.toLowerCase().startsWith(a.toLowerCase()));return c!==r?c:void 0}function l3(e,t){const{x:r,y:s}=e;let a=!1;for(let i=0,o=t.length-1;i<t.length;o=i++){const u=t[i].x,c=t[i].y,l=t[o].x,d=t[o].y;c>s!=d>s&&r<(l-u)*(s-c)/(d-c)+u&&(a=!a)}return a}function d3(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return l3(r,t)}function on(e){return t=>t.pointerType==="mouse"?e(t):void 0}var f3=hh,h3=pu,m3=ph,p3=xh,x3=yu,g3=gh,b3=Ja,y3=yh,v3=wh,w3=kh,_3=Nh,k3=Ch,j3=Sh,N3=Th,C3=Ph,_u="DropdownMenu",[S3,QN]=kr(_u,[dh]),qe=dh(),[E3,Rh]=S3(_u),Ih=e=>{const{__scopeDropdownMenu:t,children:r,dir:s,open:a,defaultOpen:i,onOpenChange:o,modal:u=!0}=e,c=qe(t),l=f.useRef(null),[d=!1,h]=Vt({prop:a,defaultProp:i,onChange:o});return n.jsx(E3,{scope:t,triggerId:ht(),triggerRef:l,contentId:ht(),open:d,onOpenChange:h,onOpenToggle:f.useCallback(()=>h(m=>!m),[h]),modal:u,children:n.jsx(f3,{...c,open:d,onOpenChange:h,dir:s,modal:u,children:r})})};Ih.displayName=_u;var Fh="DropdownMenuTrigger",Mh=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:s=!1,...a}=e,i=Rh(Fh,r),o=qe(r);return n.jsx(h3,{asChild:!0,...o,children:n.jsx(re.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":s?"":void 0,disabled:s,...a,ref:_a(t,i.triggerRef),onPointerDown:H(e.onPointerDown,u=>{!s&&u.button===0&&u.ctrlKey===!1&&(i.onOpenToggle(),i.open||u.preventDefault())}),onKeyDown:H(e.onKeyDown,u=>{s||(["Enter"," "].includes(u.key)&&i.onOpenToggle(),u.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(u.key)&&u.preventDefault())})})})});Mh.displayName=Fh;var T3="DropdownMenuPortal",Oh=e=>{const{__scopeDropdownMenu:t,...r}=e,s=qe(t);return n.jsx(m3,{...s,...r})};Oh.displayName=T3;var Lh="DropdownMenuContent",$h=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...s}=e,a=Rh(Lh,r),i=qe(r),o=f.useRef(!1);return n.jsx(p3,{id:a.contentId,"aria-labelledby":a.triggerId,...i,...s,ref:t,onCloseAutoFocus:H(e.onCloseAutoFocus,u=>{var c;o.current||(c=a.triggerRef.current)==null||c.focus(),o.current=!1,u.preventDefault()}),onInteractOutside:H(e.onInteractOutside,u=>{const c=u.detail.originalEvent,l=c.button===0&&c.ctrlKey===!0,d=c.button===2||l;(!a.modal||d)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});$h.displayName=Lh;var A3="DropdownMenuGroup",P3=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...s}=e,a=qe(r);return n.jsx(x3,{...a,...s,ref:t})});P3.displayName=A3;var D3="DropdownMenuLabel",Uh=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...s}=e,a=qe(r);return n.jsx(g3,{...a,...s,ref:t})});Uh.displayName=D3;var R3="DropdownMenuItem",zh=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...s}=e,a=qe(r);return n.jsx(b3,{...a,...s,ref:t})});zh.displayName=R3;var I3="DropdownMenuCheckboxItem",Bh=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...s}=e,a=qe(r);return n.jsx(y3,{...a,...s,ref:t})});Bh.displayName=I3;var F3="DropdownMenuRadioGroup",M3=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...s}=e,a=qe(r);return n.jsx(v3,{...a,...s,ref:t})});M3.displayName=F3;var O3="DropdownMenuRadioItem",qh=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...s}=e,a=qe(r);return n.jsx(w3,{...a,...s,ref:t})});qh.displayName=O3;var L3="DropdownMenuItemIndicator",Hh=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...s}=e,a=qe(r);return n.jsx(_3,{...a,...s,ref:t})});Hh.displayName=L3;var $3="DropdownMenuSeparator",Vh=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...s}=e,a=qe(r);return n.jsx(k3,{...a,...s,ref:t})});Vh.displayName=$3;var U3="DropdownMenuArrow",z3=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...s}=e,a=qe(r);return n.jsx(j3,{...a,...s,ref:t})});z3.displayName=U3;var B3="DropdownMenuSubTrigger",Gh=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...s}=e,a=qe(r);return n.jsx(N3,{...a,...s,ref:t})});Gh.displayName=B3;var q3="DropdownMenuSubContent",Wh=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...s}=e,a=qe(r);return n.jsx(C3,{...a,...s,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Wh.displayName=q3;var H3=Ih,V3=Mh,G3=Oh,Yh=$h,Kh=Uh,Qh=zh,Jh=Bh,Zh=qh,Xh=Hh,e0=Vh,t0=Gh,r0=Wh;const s0=H3,n0=V3,W3=f.forwardRef(({className:e,inset:t,children:r,...s},a)=>n.jsxs(t0,{ref:a,className:V("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...s,children:[r,n.jsx(Xs,{className:"ml-auto h-4 w-4"})]}));W3.displayName=t0.displayName;const Y3=f.forwardRef(({className:e,...t},r)=>n.jsx(r0,{ref:r,className:V("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:sli
436de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));Y3.displayName=r0.displayName;const ku=f.forwardRef(({className:e,sideOffset:t=4,...r},s)=>n.jsx(G3,{children:n.jsx(Yh,{ref:s,sideOffset:t,className:V("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));ku.displayName=Yh.displayName;const Ar=f.forwardRef(({className:e,inset:t,...r},s)=>n.jsx(Qh,{ref:s,className:V("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...r}));Ar.displayName=Qh.displayName;const K3=f.forwardRef(({className:e,children:t,checked:r,...s},a)=>n.jsxs(Jh,{ref:a,className:V("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...s,children:[n.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:n.jsx(Xh,{children:n.jsx($o,{className:"h-4 w-4"})})}),t]}));K3.displayName=Jh.displayName;const Q3=f.forwardRef(({className:e,children:t,...r},s)=>n.jsxs(Zh,{ref:s,className:V("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[n.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:n.jsx(Xh,{children:n.jsx(Yx,{className:"h-2 w-2 fill-current"})})}),t]}));Q3.displayName=Zh.displayName;const a0=f.forwardRef(({className:e,inset:t,...r},s)=>n.jsx(Kh,{ref:s,className:V("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...r}));a0.displayName=Kh.displayName;const fa=f.forwardRef(({className:e,...t},r)=>n.jsx(e0,{ref:r,className:V("-mx-1 my-1 h-px bg-muted",e),...t}));fa.displayName=e0.displayName;const J3=Es("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function is({className:e,variant:t,...r}){return n.jsx("div",{className:V(J3({variant:t}),e),...r})}function ll(){const{user:e}=ke(),[t,r]=f.useState(null),[s,a]=f.useState(!1),[i,o]=f.useState(!0);return f.useEffect(()=>{const u=async()=>{if(e)try{const{data:l,error:d}=await J.from("profiles").select("trial_end_date, is_trial_active, subscription_tier").eq("id",e.id).single();if(d)throw d;if(l.subscription_tier==="Pro"||l.subscription_tier==="Teams"){o(!1);return}if(a(l.is_trial_active),l.is_trial_active&&l.trial_end_date){const h=new Date,m=new Date(l.trial_end_date),p=Math.max(0,Math.ceil((m.getTime()-h.getTime())/(1e3*60*60*24)));r(p)}}catch(l){console.error("Error fetching trial status:",l)}finally{o(!1)}};u();const c=setInterval(u,24*60*60*1e3);return()=>clearInterval(c)},[e]),i||!s||t===null?null:n.jsxs(is,{variant:"outline",className:"bg-amber-100 text-amber-800 flex items-center gap-1",children:[n.jsx(Bx,{className:"h-3 w-3"}),n.jsxs("span",{children:["Trial: ",t," days left"]})]})}function ha(){const{theme:e,setTheme:t}=$d(),[r,s]=f.useState(!1);return f.useEffect(()=>{s(!0)},[]),r?n.jsxs(R,{variant:"ghost",size:"icon",onClick:()=>t(e==="dark"?"light":"dark"),className:"h-9 w-9","aria-label":"Toggle theme",children:[n.jsx(ug,{className:"h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),n.jsx(ng,{className:"absolute h-4 w-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),n.jsx("span",{className:"sr-only",children:"Toggle theme"})]}):n.jsx(R,{variant:"ghost",size:"icon",className:"h-9 w-9",children:n.jsx("span",{className:"sr-only",children:"Toggle theme"})})}function _s(){var l,d;const[e,t]=f.useState(!1),[r,s]=f.useState("Starter"),{user:a,signOut:i}=ke(),o=gt();f.useEffect(()=>{a&&u()},[a]);const u=async()=>{try{const{data:h,error:m}=await J.from("profiles").select("subscription_tier").eq("id",a==null?void 0:a.id).single();if(m)throw m;h&&s(h.subscription_tier||"Starter")}catch(h){console.error("Error fetching subscription:",h)}},c=r==="Starter";return n.jsxs("header",{className:"bg-background border-b border-border sticky top-0 z-40",children:[n.jsxs("div",{className:"container flex h-16 items-center justify-between px-4 md:px-6",children:[n.jsxs(ne,{to:"/",className:"flex items-center gap-2 font-semibold",children:[n.jsx(Be,{className:"h-5 w-5 md:h-6 md:w-6 text-explainify-600"}),n.jsx("span",{className:"text-lg md:text-xl",children:"Explainify"})]}),n.jsxs("nav",{className:"hidden md:flex items-center gap-4 lg:gap-6",children:[n.jsx(ne,{to:"/",className:"text-sm font-medium hover:text-explainify-600 transition-colors",children:"Home"}),n.jsx(ne,{to:"/#features",className:"text-sm font-medium hover:text-explainify-600 transition-colors",children:"Features"}),n.jsx(ne,{to:"/tools",className:"text-sm font-medium hover:text-explainify-600 transition-colors",children:"Content Tools"}),a&&n.jsx(ne,{to:"/dashboard",className:"text-sm font-medium hover:text-explainify-600 transition-colors",children:"Dashboard"}),(!a||c)&&n.jsx(ne,{to:"/pricing",className:"text-sm font-medium hover:text-explainify-600 transition-colors",children:"Pricing"})]}),n.jsxs("div",{className:"hidden md:flex items-center gap-4",children:[n.jsx(ha,{}),a?n.jsxs(n.Fragment,{children:[n.jsx(ll,{}),n.jsxs(s0,{children:[n.jsx(n0,{asChild:!0,children:n.jsx(R,{variant:"ghost",className:"relative h-8 w-8 rounded-full",children:n.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-full bg-explainify-100",children:n.jsx("span",{className:"text-sm font-medium text-explainify-600",children:((d=(l=a.email)==null?void 0:l[0])==null?void 0:d.toUpperCase())||"U"})})})}),n.jsxs(ku,{className:"w-56",align:"end",forceMount:!0,children:[n.jsx(a0,{className:"font-normal",children:n.jsx("div",{className:"flex flex-col space-y-1",children:n.jsx("p",{className:"text-sm font-medium leading-none",children:a.email})})}),n.jsx(fa,{}),n.jsxs(Ar,{onClick:()=>
436o("/dashboard"),children:[n.jsx(Jn,{className:"mr-2 h-4 w-4"}),n.jsx("span",{children:"Dashboard"})]}),n.jsxs(Ar,{onClick:()=>o("/profile"),children:[n.jsx(bc,{className:"mr-2 h-4 w-4"}),n.jsx("span",{children:"Profile Settings"})]}),n.jsxs(Ar,{onClick:()=>o("/profile#subscription"),children:[n.jsx(gr,{className:"mr-2 h-4 w-4"}),n.jsx("span",{children:"Subscription"})]}),n.jsxs(Ar,{onClick:()=>o("/profile#history"),children:[n.jsx(mt,{className:"mr-2 h-4 w-4"}),n.jsx("span",{children:"Account History"})]}),n.jsx(fa,{}),n.jsxs(Ar,{onClick:i,children:[n.jsx(mc,{className:"mr-2 h-4 w-4"}),n.jsx("span",{children:"Log out"})]})]})]})]}):n.jsxs(n.Fragment,{children:[n.jsx(R,{variant:"outline",size:"sm",asChild:!0,children:n.jsxs(ne,{to:"/auth?mode=login",children:[n.jsx(hc,{className:"h-4 w-4 mr-2"}),"Log In"]})}),n.jsx(R,{size:"sm",asChild:!0,children:n.jsxs(ne,{to:"/auth?mode=signup",children:[n.jsx(ro,{className:"h-4 w-4 mr-2"}),"Try Free"]})})]})]}),n.jsxs("div",{className:"flex items-center gap-2 md:hidden",children:[n.jsx(ha,{}),n.jsxs(R,{variant:"ghost",size:"icon",onClick:()=>t(!e),children:[n.jsx(Cd,{className:"h-5 w-5"}),n.jsx("span",{className:"sr-only",children:"Toggle menu"})]})]})]}),e&&n.jsxs("div",{className:"fixed inset-0 z-50 bg-background md:hidden",children:[n.jsxs("div",{className:"container flex h-16 items-center justify-between px-4",children:[n.jsxs(ne,{to:"/",className:"flex items-center gap-2 font-semibold",children:[n.jsx(Be,{className:"h-5 w-5 text-explainify-600"}),n.jsx("span",{className:"text-lg",children:"Explainify"})]}),n.jsxs(R,{variant:"ghost",size:"icon",onClick:()=>t(!1),children:[n.jsx(Ur,{className:"h-5 w-5"}),n.jsx("span",{className:"sr-only",children:"Close menu"})]})]}),n.jsxs("nav",{className:"container grid gap-4 py-6 px-4",children:[n.jsx(ne,{to:"/",className:"flex items-center gap-2 text-base font-medium hover:text-explainify-600 transition-colors",onClick:()=>t(!1),children:"Home"}),n.jsx(ne,{to:"/#features",className:"flex items-center gap-2 text-base font-medium hover:text-explainify-600 transition-colors",onClick:()=>t(!1),children:"Features"}),n.jsxs(ne,{to:"/tools",className:"flex items-center gap-2 text-base font-medium hover:text-explainify-600 transition-colors",onClick:()=>t(!1),children:[n.jsx(Pe,{className:"h-4 w-4"}),"Content Tools"]}),a&&n.jsxs(ne,{to:"/dashboard",className:"flex items-center gap-2 text-base font-medium hover:text-explainify-600 transition-colors",onClick:()=>t(!1),children:[n.jsx(Jn,{className:"h-4 w-4"}),"Dashboard"]}),(!a||c)&&n.jsxs(ne,{to:"/pricing",className:"flex items-center gap-2 text-base font-medium hover:text-explainify-600 transition-colors",onClick:()=>t(!1),children:[n.jsx(kd,{className:"h-4 w-4"}),"Pricing"]}),n.jsx("div",{className:"flex flex-col gap-2 mt-4",children:a?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"mb-2",children:n.jsx(ll,{})}),n.jsxs(R,{variant:"outline",className:"w-full justify-center",onClick:()=>{o("/dashboard"),t(!1)},children:[n.jsx(Jn,{className:"h-4 w-4 mr-2"}),"Dashboard"]}),n.jsxs(R,{variant:"outline",className:"w-full justify-center",onClick:()=>{o("/profile"),t(!1)},children:[n.jsx(bc,{className:"h-4 w-4 mr-2"}),"Profile Settings"]}),n.jsxs(R,{variant:"outline",className:"w-full justify-center",onClick:()=>{o("/profile#subscription"),t(!1)},children:[n.jsx(gr,{className:"h-4 w-4 mr-2"}),"Subscription"]}),n.jsxs(R,{variant:"outline",className:"w-full justify-center",onClick:()=>{o("/profile#history"),t(!1)},children:[n.jsx(mt,{className:"h-4 w-4 mr-2"}),"Account History"]}),n.jsxs(R,{variant:"outline",className:"w-full justify-center",onClick:()=>{i(),t(!1)},children:[n.jsx(mc,{className:"h-4 w-4 mr-2"}),"Log Out"]})]}):n.jsxs(n.Fragment,{children:[n.jsx(R,{variant:"outline",className:"w-full justify-center",asChild:!0,children:n.jsxs(ne,{to:"/auth?mode=login",onClick:()=>t(!1),children:[n.jsx(hc,{className:"h-4 w-4 mr-2"}),"Log In"]})}),n.jsx(R,{className:"w-full justify-center",asChild:!0,children:n.jsxs(ne,{to:"/auth?mode=signup",onClick:()=>t(!1),children:[n.jsx(ro,{className:"h-4 w-4 mr-2"}),"Try Free"]})})]})})]})]})]})}function Z3({icon:e,title:t,description:r}){return n.jsxs("div",{className:"feature-card card-hover highlight-container",children:[n.jsx("div",{className:"feature-icon w-fit mb-5",children:n.jsx(e,{className:"h-6 w-6"})}),n.jsx("h3",{className:"text-xl font-semibold mb-3",children:t}),n.jsx("p",{className:"text-muted-foreground leading-relaxed",children:r})]})}var ju="Dialog",[i0,JN]=kr(ju),[X3,yt]=i0(ju),o0=e=>{const{__scopeDialog:t,children:r,open:s,defaultOpen:a,onOpenChange:i,modal:o=!0}=e,u=f.useRef(null),c=f.useRef(null),[l=!1,d]=Vt({prop:s,defaultProp:a,onChange:i});return n.jsx(X3,{scope:t,triggerRef:u,contentRef:c,contentId:ht(),titleId:ht(),descriptionId:ht(),open:l,onOpenChange:d,onOpenToggle:f.useCallback(()=>d(h=>!h),[d]),modal:o,children:r})};o0.displayName=ju;var u0="DialogTrigger",c0=f.forwardRef((e,t)=>
vendor: 5,566 bytes, lines 436-440
436{const{__scopeDialog:r,...s}=e,a=yt(u0,r),i=he(t,a.triggerRef);return n.jsx(re.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":Su(a.open),...s,ref:i,onClick:H(e.onClick,a.onOpenToggle)})});c0.displayName=u0;var Nu="DialogPortal",[e_,l0]=i0(Nu,{forceMount:void 0}),d0=e=>{const{__scopeDialog:t,forceMount:r,children:s,container:a}=e,i=yt(Nu,t);return n.jsx(e_,{scope:t,forceMount:r,children:f.Children.map(s,o=>n.jsx(bt,{present:r||i.open,children:n.jsx(pn,{asChild:!0,container:a,children:o})}))})};d0.displayName=Nu;var ma="DialogOverlay",f0=f.forwardRef((e,t)=>{const r=l0(ma,e.__scopeDialog),{forceMount:s=r.forceMount,...a}=e,i=yt(ma,e.__scopeDialog);return i.modal?n.jsx(bt,{present:s||i.open,children:n.jsx(t_,{...a,ref:t})}):null});f0.displayName=ma;var t_=f.forwardRef((e,t)=>{const{__scopeDialog:r,...s}=e,a=yt(ma,r);return n.jsx(Ka,{as:pr,allowPinchZoom:!0,shards:[a.contentRef],children:n.jsx(re.div,{"data-state":Su(a.open),...s,ref:t,style:{pointerEvents:"auto",...s.style}})})}),Mr="DialogContent",h0=f.forwardRef((e,t)=>{const r=l0(Mr,e.__scopeDialog),{forceMount:s=r.forceMount,...a}=e,i=yt(Mr,e.__scopeDialog);return n.jsx(bt,{present:s||i.open,children:i.modal?n.jsx(r_,{...a,ref:t}):n.jsx(s_,{...a,ref:t})})});h0.displayName=Mr;var r_=f.forwardRef((e,t)=>{const r=yt(Mr,e.__scopeDialog),s=f.useRef(null),a=he(t,r.contentRef,s);return f.useEffect(()=>{const i=s.current;if(i)return mu(i)},[]),n.jsx(m0,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:H(e.onCloseAutoFocus,i=>{var o;i.preventDefault(),(o=r.triggerRef.current)==null||o.focus()}),onPointerDownOutside:H(e.onPointerDownOutside,i=>{const o=i.detail.originalEvent,u=o.button===0&&o.ctrlKey===!0;(o.button===2||u)&&i.preventDefault()}),onFocusOutside:H(e.onFocusOutside,i=>i.preventDefault())})}),s_=f.forwardRef((e,t)=>{const r=yt(Mr,e.__scopeDialog),s=f.useRef(!1),a=f.useRef(!1);return n.jsx(m0,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,u;(o=e.onCloseAutoFocus)==null||o.call(e,i),i.defaultPrevented||(s.current||(u=r.triggerRef.current)==null||u.focus(),i.preventDefault()),s.current=!1,a.current=!1},onInteractOutside:i=>{var c,l;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(s.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const o=i.target;((l=r.triggerRef.current)==null?void 0:l.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),m0=f.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:s,onOpenAutoFocus:a,onCloseAutoFocus:i,...o}=e,u=yt(Mr,r),c=f.useRef(null),l=he(t,c);return hu(),n.jsxs(n.Fragment,{children:[n.jsx(Va,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:a,onUnmountAutoFocus:i,children:n.jsx(Ss,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":Su(u.open),...o,ref:l,onDismiss:()=>u.onOpenChange(!1)})}),n.jsxs(n.Fragment,{children:[n.jsx(n_,{titleId:u.titleId}),n.jsx(i_,{contentRef:c,descriptionId:u.descriptionId})]})]})}),Cu="DialogTitle",p0=f.forwardRef((e,t)=>{const{__scopeDialog:r,...s}=e,a=yt(Cu,r);return n.jsx(re.h2,{id:a.titleId,...s,ref:t})});p0.displayName=Cu;var x0="DialogDescription",g0=f.forwardRef((e,t)=>{const{__scopeDialog:r,...s}=e,a=yt(x0,r);return n.jsx(re.p,{id:a.descriptionId,...s,ref:t})});g0.displayName=x0;var b0="DialogClose",y0=f.forwardRef((e,t)=>{const{__scopeDialog:r,...s}=e,a=yt(b0,r);return n.jsx(re.button,{type:"button",...s,ref:t,onClick:H(e.onClick,()=>a.onOpenChange(!1))})});y0.displayName=b0;function Su(e){return e?"open":"closed"}var v0="DialogTitleWarning",[ZN,w0]=rx(v0,{contentName:Mr,titleName:Cu,docsSlug:"dialog"}),n_=({titleId:e})=>{const t=w0(v0),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
437
438If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
439
440For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return f.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},a_="DialogDescriptionWarning",i_=({contentRef:e,descriptionId:t})=>{const s=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${w0(a_).contentName}}.`;return f.useEffect(()=>{var i;const a=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(s))},[s,e,t]),null},_0=o0,k0=c0,Eu=d0,Za=f0,Xa=h0,ei=p0,ti=g0,Tu=y0;const Au=_0,j0=k0,o_=Eu,u_=Tu,N0=f.forwardRef(({className:e,...t},r)=>n.jsx(Za,{ref:r,className:V("fixed inset-0 z-50 bg-black/80  data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));N0.displayName=Za.displayName;const ri=f.forwardRef(({className:e,children:t,...r},s)=>n.jsxs(o_,{children:[n.jsx(N0,{}),n.jsxs(Xa,{ref:s,className:V("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...r,children:[t,n.jsxs(Tu,{className:"absolute right-4 top-4 roun
440ded-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:[n.jsx(Ur,{className:"h-4 w-4"}),n.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));ri.displayName=Xa.displayName;const Pu=({className:e,...t})=>n.jsx("div",{className:V("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Pu.displayName="DialogHeader";const Du=f.forwardRef(({className:e,...t},r)=>n.jsx(ei,{ref:r,className:V("text-lg font-semibold leading-none tracking-tight",e),...t}));Du.displayName=ei.displayName;const Ru=f.forwardRef(({className:e,...t},r)=>n.jsx(ti,{ref:r,className:V("text-sm text-muted-foreground",e),...t}));Ru.displayName=ti.displayName;const c_=()=>{const[e,t]=f.useState(!1),[r,s]=f.useState(!1),[a,i]=f.useState(!1),o=f.useRef(null),u=Mt(),c=gt();f.useEffect(()=>{e?s(!0):(s(!1),o.current&&o.current.pause())},[e]);const l=()=>{o.current&&(r?o.current.pause():o.current.play(),s(!r))},d=()=>{o.current&&(o.current.muted=!o.current.muted,i(!a))},h=[{icon:xr,title:"AI Tutor",description:"Personal AI tutor that adapts to your learning style and helps you master any subject at your own pace."},{icon:Pe,title:"Question Solver",description:"Get step-by-step solutions to any question in seconds, with detailed explanations tailored to your learning needs."},{icon:Be,title:"Multi-Modal Learning",description:"Learn through multiple formats - text, audio, images, and more - optimized for your personal learning style."},{icon:Tt,title:"YouTube Transcriber",description:"Extract transcripts, summaries, and key points from any YouTube video for enhanced learning."},{icon:Pe,title:"PDF Summarizer",description:"Turn lengthy PDFs into concise summaries with key insights, making information easier to digest."},{icon:Xe,title:"Personalized Dashboard",description:"Access all your learning tools and track your progress in one intuitive, customizable interface."}];return f.useEffect(()=>{const m=new URLSearchParams(u.search),p=m.get("error"),x=m.get("error_description");p&&(console.error("Auth error detected:",p,x),L.error(n.jsxs("div",{className:"flex flex-col",children:[n.jsxs("span",{children:["Authentication failed: ",x||p]}),n.jsx("button",{onClick:()=>c("/auth/troubleshoot"),className:"text-left text-sm underline mt-1",children:"Go to troubleshooting"})]}),{duration:1e4}),window.history.replaceState({},document.title,window.location.pathname))},[u,c]),f.useEffect(()=>{(async()=>{if(localStorage.getItem("explainify.auth.inProgress")==="true"){console.log("Detected in-progress Google authentication on home page");try{const{data:x,error:g}=await J.auth.getSession();if(!g&&(x!=null&&x.session)){console.log("Found existing session after page reload!"),L.success("Successfully signed in with Google"),localStorage.removeItem("explainify.auth.inProgress"),c("/dashboard",{replace:!0});return}console.log("No session found but auth was in progress, redirecting to callback..."),c("/auth/callback",{replace:!0})}catch(x){console.error("Error checking auth status:",x),localStorage.removeItem("explainify.auth.inProgress")}}})()},[c]),n.jsxs("div",{className:"min-h-screen",children:[n.jsx(_s,{}),n.jsx(jy,{onWatchDemo:()=>t(!0)}),n.jsxs("section",{className:"py-16 bg-explainify-600 text-white relative overflow-hidden",children:[n.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-explainify-700 to-explainify-500 opacity-90"}),n.jsx("div",{className:"container relative z-10",children:n.jsxs("div",{className:"max-w-3xl mx-auto text-center",children:[n.jsxs("div",{className:"inline-flex items-center rounded-full bg-explainify-500/30 px-3 py-1 text-sm mb-6 border border-white/20",children:[n.jsx(Lo,{className:"mr-2 h-4 w-4"}),n.jsx("span",{children:"Limited Time Offer"})]}),n.jsx("h2",{className:"text-4xl md:text-5xl font-bold mb-4",children:"Sign Up Now to Transform Your Learning"}),n.jsx("p",{className:"text-xl text-white/80 mb-8 max-w-2xl mx-auto",children:"Join thousands of students who are already experiencing the power of AI-enhanced learning. Get started today!"}),n.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 justify-center",children:[n.jsx(ne,{to:"/auth/signup",children:n.jsxs(R,{size:"lg",variant:"default",className:"bg-white text-explainify-600 hover:bg-gray-100 w-full sm:w-auto",children:["Sign Up Free",n.jsx(mr,{className:"ml-2 h-4 w-4"})]})}),n.jsx(ne,{to:"/pricing",children:n.jsx(R,{size:"lg",variant:"outline",className:"border-white text-white hover:bg-white/10 w-full sm:w-auto bg-explainify-700/50 dark:text-white text-explainify-800",children:"View Plans"})})]})]})})]}),n.jsx("section",{id:"features",className:"py-20 bg-gradient-to-b from-white to-explainify-50 dark:from-gray-900 dark:to-gray-800",children:n.jsxs("div",{className:"container",children:[n.jsxs("div",{className:"text-center max-w-3xl mx-auto mb-16",children:[n.jsxs("h2",{className:"text-3xl md:text-4xl font-bold tracking-tight mb-4",children:["AI-Powered ",n.jsx("span",{className:"gradient-text",children:"Learning"})," Platform"]}),n.jsx("p",{className:"text-muted-foreground text-lg",children:"Our AI-powered platform combines cutting-edge technology with proven learning methods to help you master any subject."})]}),n.jsx("div",{className:"grid sm:grid-cols-2 lg:grid-cols-3 gap-6",children:h.map((m,p)=>
440n.jsx(Z3,{icon:m.icon,title:m.title,description:m.description},p))})]})}),n.jsx("section",{className:"py-20 bg-white dark:bg-gray-900",children:n.jsxs("div",{className:"container",children:[n.jsxs("div",{className:"text-center max-w-3xl mx-auto mb-16",children:[n.jsxs("h2",{className:"text-3xl md:text-4xl font-bold tracking-tight mb-4",children:["Content ",n.jsx("span",{className:"gradient-text dark:dark-gradient-text",children:"Tools"})]}),n.jsx("p",{className:"text-muted-foreground dark:text-gray-300 text-lg",children:"Extract insights and knowledge from any content with our powerful AI tools."})]}),n.jsxs("div",{className:"grid md:grid-cols-2 gap-8 max-w-4xl mx-auto",children:[n.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-lg border border-gray-100 dark:border-gray-700 p-8 flex flex-col items-center text-center hover:shadow-xl transition-shadow",children:[n.jsx("div",{className:"bg-explainify-50 dark:bg-gray-700/50 rounded-full p-4 mb-6",children:n.jsx(Pe,{className:"h-12 w-12 text-explainify-600 dark:text-explainify-400"})}),n.jsx("h3",{className:"text-xl font-bold mb-3 dark:text-gray-100",children:"PDF Summarizer"}),n.jsx("p",{className:"text-muted-foreground dark:text-gray-300 mb-6",children:"Upload any PDF document and get instant summaries, key points, and insights."}),n.jsx(ne,{to:"/tools?tab=pdf",className:"mt-auto",children:n.jsxs(R,{className:"gap-2 dark:bg-explainify-600 dark:hover:bg-explainify-700",children:["Try PDF Summarizer",n.jsx(eo,{className:"h-4 w-4"})]})})]}),n.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-lg border border-gray-100 dark:border-gray-700 p-8 flex flex-col items-center text-center hover:shadow-xl transition-shadow",children:[n.jsx("div",{className:"bg-explainify-50 dark:bg-gray-700/50 rounded-full p-4 mb-6",children:n.jsx(Tt,{className:"h-12 w-12 text-explainify-600 dark:text-explainify-400"})}),n.jsx("h3",{className:"text-xl font-bold mb-3 dark:text-gray-100",children:"YouTube Transcriber"}),n.jsx("p",{className:"text-muted-foreground dark:text-gray-300 mb-6",children:"Convert YouTube videos into text transcripts with summaries and key takeaways."}),n.jsx(ne,{to:"/tools?tab=youtube",className:"mt-auto",children:n.jsxs(R,{className:"gap-2 dark:bg-explainify-600 dark:hover:bg-explainify-700",children:["Try YouTube Transcriber",n.jsx(eo,{className:"h-4 w-4"})]})})]})]})]})}),n.jsx("section",{className:"py-20 bg-explainify-50 dark:bg-gray-800",children:n.jsxs("div",{className:"container text-center",children:[n.jsxs("div",{className:"inline-flex items-center rounded-full bg-explainify-100 dark:bg-gray-700 px-3 py-1 text-sm mb-6",children:[n.jsx(kd,{className:"mr-1 h-3.5 w-3.5 text-explainify-600 dark:text-explainify-400"}),n.jsx("span",{className:"text-sm font-medium dark:text-gray-200",children:"One-time payment"})]}),n.jsx("h2",{className:"text-3xl md:text-4xl font-bold tracking-tight mb-4 max-w-2xl mx-auto dark:text-gray-100",children:"Simple, Affordable Pricing"}),n.jsx("p",{className:"text-muted-foreground dark:text-gray-300 text-lg max-w-xl mx-auto mb-8",children:"No monthly subscriptions or hidden fees. Pay once and get lifetime access."}),n.jsx(ne,{to:"/pricing",children:n.jsxs(R,{size:"lg",className:"gap-2 dark:bg-explainify-600 dark:hover:bg-explainify-700",children:["View Pricing",n.jsx(mr,{className:"h-4 w-4"})]})})]})}),n.jsx("section",{className:"py-20 bg-explainify-600 text-white",children:n.jsxs("div",{className:"container text-center",children:[n.jsxs("div",{className:"inline-flex items-center rounded-full bg-explainify-500 px-3 py-1 text-sm mb-6",children:[n.jsx(Xe,{className:"mr-1 h-3.5 w-3.5"}),n.jsx("span",{className:"text-sm font-medium",children:"Start your learning journey"})]}),n.jsx("h2",{className:"text-3xl md:text-4xl font-bold tracking-tight mb-4 max-w-2xl mx-auto",children:"Ready to Transform Your Learning Experience?"}),n.jsx("p",{className:"text-explainify-100 text-lg max-w-xl mx-auto mb-8",children:"Join thousands of students who are already learning faster and more effectively with Explainify."}),n.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 justify-center",children:[n.jsx(R,{size:"lg",className:"bg-white text-explainify-800 hover:bg-explainify-50",asChild:!0,children:n.jsx(ne,{to:"/pricing",children:"Get Started For Free"})}),n.jsxs(R,{size:"lg",variant:"outline",className:"border-white text-white hover:bg-explainify-500 flex items-center gap-2 bg-explainify-700/50 dark:text-white text-explainify-800",onClick:()=>t(!0),children:[n.jsx(Qs,{className:"h-4 w-4"})," Watch Demo"]})]})]})}),n.jsx(Au,{open:e,onOpenChange:t,children:n.jsxs(ri,{className:"sm:max-w-4xl p-0 overflow-hidden bg-black border-none max-h-[90vh]",children:[n.jsxs("div",{className:"relative w-full rounded-lg overflow-hidden shadow-2xl",children:[n.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/50 to-transparent z-10 pointer-events-none"}),n.jsxs("div",{className:"relative w-full aspect-video",children:[n.jsx("video",{ref:o,className:"w-full h-full object-cover",autoPlay:e,src:"/assets/demo.mp4",onPlay:()=>s(!0),onPause:()=>s(!1),children:"Your browser does not support the video tag."}),!r&&n.jsx("div",{className:"absolute inset-0 flex items-center justify-center z-20 cursor-pointer",onClick:l,children:n.jsx("div",{className:"h-20 w-20 bg-explainify-600/80 rounded-full flex items-center justify-center shadow-2xl hover:bg-explainify-600 transition-colors",children:n.jsx(xc,{className:"h-10 w-10 text-white ml-1"})})})]}),n.jsxs("div",{className:"absolute bottom-0 left-0 right-0 py-4 px-6 z-20 flex items-center justify-between bg-gradient-to-t from-black/80 to-transparent",children:[n.jsx(R,{variant:"ghost",size:"icon",className:"text-white hover:bg-white/20 rounded-full",onClick:l,children:r?n.jsx(ig,{className:"h-6 w-6"}):n.jsx(xc,{className:"h-6 w-6"})}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(R,{variant:"ghost",size:"icon",className:"text-white hover:bg-white/20 rounded-full",onClick:d,children:a?n.jsx(qo,{className:"h-5 w-5"}):n.jsx(Bo,{className:"h-5 w-5"})}),n.jsx("div",{className:"text-white text-sm font-medium px-2",children:"Explainify Demo"})]})]})]}),n.jsxs(u_,{className:"absolute top-3 right-3 rounded-full p-2 bg-black/60 hover:bg-black/80 text-white transition-colors z-30",children:[n.jsx(Ur,{className:"h-5 w-5"}),n.jsx("span",{className:"sr-only",children:"Close"})]})]})}),n.jsx("footer",{className:"py-12 bg-explainify-900 text-explainify-100",children:n.jsxs("div",{className:"container",children:[n.jsxs("div",{className:"flex items-center justify-center gap-2 font-semibold mb-8 text-white",children:[n.jsx(Be,{className:"h-6 w-6 text-explainify-400"}),n.jsx("span",{className:"text-xl",children:"Explainify"})]}),n.jsxs("div",{className:"flex flex-wrap justify-center gap-6 text-sm mb-8",children:[n.jsx("a",{href:"#features",className:"hover:text-white transition-colors",children:"Features"}),n.jsx(ne,{to:"/tools",className:"hover:text-white transition-colors",children:"Content Tools"}),n.jsx(ne,{to:"/pricing",className:"hover:text-white transition-colors",children:"Pricing"}),n.jsx("a",{href:"#",className:"hover:text-white transition-colors",children:"About Us"}),n.jsx("a",{href:"#",className:"hover:text-white transition-colors",children:"Contact"})]}),n.jsxs("div",{className:"text-center text-xs text-explainify-300",children:[n.jsx("p",{className:"mb-2",children:n.jsx("a",{href:"https://myportfolio-pearl-five.vercel.app/",target:"_blank",rel:"noopener noreferrer",className:"hover:text-white transition-colors",children:"Talk to our developer"})}),n.jsxs("p",{children:["© ",new Date().getFullYear()," Explainify. All rights reserved."]})]})]})})]})};
440var Iu="Tabs",[l_,XN]=kr(Iu,[Wa]),C0=Wa(),[d_,Fu]=l_(Iu),S0=f.forwardRef((e,t)=>{const{__scopeTabs:r,value:s,onValueChange:a,defaultValue:i,orientation:o="horizontal",dir:u,activationMode:c="automatic",...l}=e,d=Ha(u),[h,m]=Vt({prop:s,onChange:a,defaultProp:i});return n.jsx(d_,{scope:r,baseId:ht(),value:h,onValueChange:m,orientation:o,dir:d,activationMode:c,children:n.jsx(re.div,{dir:d,"data-orientation":o,...l,ref:t})})});S0.displayName=Iu;var E0="TabsList",T0=f.forwardRef((e,t)=>{const{__scopeTabs:r,loop:s=!0,...a}=e,i=Fu(E0,r),o=C0(r);return n.jsx(eh,{asChild:!0,...o,orientation:i.orientation,dir:i.dir,loop:s,children:n.jsx(re.div,{role:"tablist","aria-orientation":i.orientation,...a,ref:t})})});T0.displayName=E0;var A0="TabsTrigger",P0=f.forwardRef((e,t)=>{const{__scopeTabs:r,value:s,disabled:a=!1,...i}=e,o=Fu(A0,r),u=C0(r),c=I0(o.baseId,s),l=F0(o.baseId,s),d=s===o.value;return n.jsx(th,{asChild:!0,...u,focusable:!a,active:d,children:n.jsx(re.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":l,"data-state":d?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:c,...i,ref:t,onMouseDown:H(e.onMouseDown,h=>{!a&&h.button===0&&h.ctrlKey===!1?o.onValueChange(s):h.preventDefault()}),onKeyDown:H(e.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&o.onValueChange(s)}),onFocus:H(e.onFocus,()=>{const h=o.activationMode!=="manual";!d&&!a&&h&&o.onValueChange(s)})})})});P0.displayName=A0;var D0="TabsContent",R0=f.forwardRef((e,t)=>{const{__scopeTabs:r,value:s,forceMount:a,children:i,...o}=e,u=Fu(D0,r),c=I0(u.baseId,s),l=F0(u.baseId,s),d=s===u.value,h=f.useRef(d);return f.useEffect(()=>{const m=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(m)},[]),n.jsx(bt,{present:a||d,children:({present:m})=>n.jsx(re.div,{"data-state":d?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":c,hidden:!m,id:l,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:h.current?"0s":void 0},children:m&&i})})});R0.displayName=D0;function I0(e,t){return`${e}-trigger-${t}`}function F0(e,t){return`${e}-content-${t}`}var f_=S0,M0=T0,O0=P0,L0=R0;const _n=f_,Ms=f.forwardRef(({className:e,...t},r)=>n.jsx(M0,{ref:r,className:V("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Ms.displayName=M0.displayName;const Ie=f.forwardRef(({className:e,...t},r)=>n.jsx(O0,{ref:r,className:V("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));Ie.displayName=O0.displayName;const nt=f.forwardRef(({className:e,...t},r)=>n.jsx(L0,{ref:r,className:V("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));nt.displayName=L0.displayName;const de=f.forwardRef(({className:e,...t},r)=>n.jsx("div",{ref:r,className:V("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));de.displayName="Card";const Ce=f.forwardRef(({className:e,...t},r)=>n.jsx("div",{ref:r,className:V("flex flex-col space-y-1.5 p-6",e),...t}));Ce.displayName="CardHeader";const Se=f.forwardRef(({className:e,...t},r)=>n.jsx("h3",{ref:r,className:V("text-2xl font-semibold leading-none tracking-tight",e),...t}));Se.displayName="CardTitle";const at=f.forwardRef(({className:e,...t},r)=>n.jsx("p",{ref:r,className:V("text-sm text-muted-foreground",e),...t}));at.displayName="CardDescription";const ve=f.forwardRef(({className:e,...t},r)=>n.jsx("div",{ref:r,className:V("p-6 pt-0",e),...t}));ve.displayName="CardContent";const At=f.forwardRef(({className:e,...t},r)=>n.jsx("div",{ref:r,className:V("flex items-center p-6 pt-0",e),...t}));At.displayName="CardFooter";const _e={QUESTION_HISTORY:"explainify.questionHistory",SEARCH_HISTORY:"explainify.searchHistory",YOUTUBE_HISTORY:"explainify.youtubeHistory",PDF_HISTORY:"explainify.pdfHistory",TUTOR_HISTORY:"explainify.tutorHistory",ACTIVE_TUTOR_CONVERSATION:"explainify.activeTutorConversation"},h_=20;function kn(e,t,r){try{const s=r?`${e}.${r}`:e,i=Os(e,r).filter(u=>JSON.stringify(u)!==JSON.stringify(t)),o=[t,...i].slice(0,h_);localStorage.setItem(s,JSON.stringify(o))}catch(s){console.error("Error saving to local storage:",s)}}function Os(e,t){try{const r=t?`${e}.${t}`:e,s=localStorage.getItem(r);return s?JSON.parse(s):[]}catch(r){return console.error("Error retrieving from local storage:",r),[]}}function jn(e,t,r){return{id:m_(),data:e,timestamp:Date.now(),title:t,description:r}}function m_(){return Date.now().toString(36)+Math.random().toString(36).substr(2,5)}async function p_(e){try{const t=await Ft(()=>import("./pdf-C1rwW0z_.js").then(h=>h.p),__vite__mapDeps([2,1,3])),r=await Ft(()=>import("./pdf.worker.entry-DHlNKx66.js").then(h=>h.p),[]);t.GlobalWorkerOptions.workerSrc=r;const s=await e.arrayBuffer(),a=await t.getDocument({data:s}).promise,i=a.numPages;let o="";const u=[];let c=!1,l=!1;for(let h=1;h<=i;h++){const m=await a.getPage(h),p={pageNumber:h,text:"",images:[]},g=(await m.getTextContent()).items.map(b=>b.str).join(" ");p.text=g,o+=g+`
441
442`,g.trim().length>0&&(c=!0);try{const b=await m.getOperatorList(),v=m.commonObjs;for(let y=0;y<b.fnArray.length;
442y++)if(b.fnArray[y]===t.OPS.paintImageXObject){const k=b.argsArray[y][0];v.has(k)&&(l=!0,p.images.push({imageId:k,pageNumber:h,base64Data:"placeholder-for-actual-image-data",dimensions:{width:100,height:100}}))}}catch(b){console.error(`Error extracting images from page ${h}:`,b)}u.push(p)}let d="text-only";return l&&!c?d="image-only":l&&c&&(d="mixed"),{text:o,pages:u,totalPages:i,contentType:d}}catch(t){throw console.error("Error extracting content from PDF:",t),new Error("Failed to extract content from PDF")}}async function x_(e,t,r){try{let s="";switch(e.contentType){case"text-only":s=`Please summarize the following text from a PDF document. Provide:
4431. A title
4442. A concise summary (max 3 paragraphs)
4453. 5-7 key points or takeaways
446
447Here's the text:
448${e.text.slice(0,15e3)}`;break;case"image-only":s=`This PDF appears to be primarily image-based with little or no extractable text. 
449Based on the limited text available, please provide:
4501. A possible title for this document
4512. What type of document this might be
4523. Any key information you can infer
453
454Available text (may be limited):
455${e.text.slice(0,5e3)}`;break;case"mixed":s=`This PDF contains both text and images. Please summarize the textual content and provide:
4561. A title
4572. A concise summary (max 3 paragraphs)
4583. 5-7 key points or takeaways
4594. Mention of what types of visuals might be included based on context
460
461Here's the text:
462${e.text.slice(0,12e3)}`;break}const i=await t([{role:"user",content:s}],r);return{...g_(i),pdfText:e.text.slice(0,5e3),totalPages:e.totalPages,contentType:e.contentType}}catch(s){throw console.error("Error generating enhanced PDF summary:",s),new Error("Failed to summarize PDF content")}}function g_(e){let t="",r="",s=[],a=[];const i=e.split(`
463`).filter(u=>u.trim()!=="");i.length>0&&(t=i[0].replace(/^#|\*\*|Title:|\s*$/gi,"").trim());const o=e.match(/key\s*points:?|takeaways:?/i);if(o){r=e.substring(0,o.index).trim().replace(/^#.*?\n|\*\*.*?\*\*|Title:.*?\n|Summary:?/gi,"").trim();const l=e.substring(o.index).match(/[-•*]\s*(.*?)(?=[-•*]|\n\n|$)/gs);l&&(s=l.map(d=>d.replace(/^[-•*]\s*/,"").trim()))}else i.length>1&&(r=i.slice(1).join(`
464`).trim());return{title:t,summary:r,keyPoints:s.length?s:["No specific key points identified"],tableOfContents:a}}const dl=3,b_=1e3;async function y_(e){try{const{data:t,error:r}=await J.from("profiles").select("is_trial_active, trial_end_date, subscription_tier").eq("id",e).single();if(r)throw r;if(t.subscription_tier==="Pro"||t.subscription_tier==="Teams"||t.is_trial_active)return!0;let{data:s,error:a}=await J.from("user_usage").select("*").eq("id",e).single();if(a)throw a;if(s&&new Date>new Date(s.reset_date)){await J.from("user_usage").update({messages_used:0,reset_date:new Date(new Date().setMonth(new Date().getMonth()+1))}).eq("id",e);const{data:i,error:o}=await J.from("user_usage").select("*").eq("id",e).single();if(o)throw o;s=i}return s.messages_limit===-1?!0:s.messages_used>=s.messages_limit?!1:(await J.from("user_usage").update({messages_used:s.messages_used+1,last_updated:new Date}).eq("id",e),!0)}catch(t){return console.error("Error checking message limit:",t),!1}}async function v_(e){try{const{data:t,error:r}=await J.from("user_usage").select("messages_used").eq("id",e).single();if(r)throw r;await J.from("user_usage").update({messages_used:t.messages_used+1,last_updated:new Date}).eq("id",e)}catch(t){console.error("Error incrementing message usage:",t)}}async function Mu(e,t){var a;if(t&&!await y_(t))throw new Error("Message limit reached. Please upgrade your plan for unlimited messages.");let r=0,s=null;for(;r<dl;)try{const i=e.map(c=>({role:c.role,content:c.content})),o=await fetch("https://openrouter.ai/api/v1/chat/completions",{method:"POST",headers:{Authorization:"Bearer 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","Content-Type":"application/json","HTTP-Referer":window.location.origin,"X-Title":"Explainify AI Tutor"},body:JSON.stringify({model:"google/gemma-3-4b-it:free",messages:i,max_tokens:4e3,temperature:.7})});if(!o.ok){const c=await o.json().catch(()=>({error:{message:`HTTP error: ${o.status}`}}));throw new Error(`API error: ${o.status} - ${((a=c.error)==null?void 0:a.message)||"Unknown error"}`)}const u=await o.json();return t&&await v_(t),u.choices[0].message.content}catch(i){if(s=i instanceof Error?i:new Error(String(i)),console.error(`Attempt ${r+1}/${dl} failed:`,s),s.message.includes("Failed to fetch")||s.message.includes("NetworkError")){const o=b_*Math.pow(2,r)+Math.random()*1e3;await new Promise(u=>setTimeout(u,o)),r++}else break}return console.error("Error sending message to AI after retries:",s),"I'm having trouble connecting to my knowledge database. Please check your internet connection and try again in a moment."}function w_(e,t=[]){let r=[];function s(i,o){const u=f.createContext(o),c=r.length;r=[...r,o];function l(h){const{scope:m,children:p,...x}=h,g=(m==null?void 0:m[e][c])||u,b=f.useMemo(()=>x,Object.values(x));return n.jsx(g.Provider,{value:b,children:p})}function d(h,m){const p=(m==null?void 0:m[e][c])||u,x=f.useContext(p);if(x)return x;if(o!==void 0)return o;throw new Error(`\`${h}\` must be used within \`${i}\``)}return l.displayName=i+"Provider",[l,d]}const a=()=>{const i=r.map(o=>f.createContext(o));return function(u){const c=(u==null?void 0:u[e])||i;return f.useMemo(()=>({[`__scope${e}`]:{...u,[e]:c}}),[u,c])}};return a.scopeName=e,[s,__(a,...t)]}function __(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const s=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const o=s.reduce((u,{useScope:c,scopeName:l})=>{const h=c(i)[`__scope${l}`];return{...u,...h}},{});return f.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}var Ou="Progress",Lu=100,[k_,e5]=w_(Ou),[j_,N_]=k_(Ou),$0=f.forwardRef((e,t)=>
464{const{__scopeProgress:r,value:s=null,max:a,getValueLabel:i=C_,...o}=e;(a||a===0)&&!fl(a)&&console.error(S_(`${a}`,"Progress"));const u=fl(a)?a:Lu;s!==null&&!hl(s,u)&&console.error(E_(`${s}`,"Progress"));const c=hl(s,u)?s:null,l=pa(c)?i(c,u):void 0;return n.jsx(j_,{scope:r,value:c,max:u,children:n.jsx(re.div,{"aria-valuemax":u,"aria-valuemin":0,"aria-valuenow":pa(c)?c:void 0,"aria-valuetext":l,role:"progressbar","data-state":B0(c,u),"data-value":c??void 0,"data-max":u,...o,ref:t})})});$0.displayName=Ou;var U0="ProgressIndicator",z0=f.forwardRef((e,t)=>{const{__scopeProgress:r,...s}=e,a=N_(U0,r);return n.jsx(re.div,{"data-state":B0(a.value,a.max),"data-value":a.value??void 0,"data-max":a.max,...s,ref:t})});z0.displayName=U0;function C_(e,t){return`${Math.round(e/t*100)}%`}function B0(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function pa(e){return typeof e=="number"}function fl(e){return pa(e)&&!isNaN(e)&&e>0}function hl(e,t){return pa(e)&&!isNaN(e)&&e<=t&&e>=0}function S_(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Lu}\`.`}function E_(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
465  - a positive number
466  - less than the value passed to \`max\` (or ${Lu} if no \`max\` prop is set)
467  - \`null\` or \`undefined\` if the progress is indeterminate.
468
469Defaulting to \`null\`.`}var q0=$0,T_=z0;const ks=f.forwardRef(({className:e,value:t,...r},s)=>n.jsx(q0,{ref:s,className:V("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...r,children:n.jsx(T_,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));ks.displayName=q0.displayName;const $u=()=>{const{user:e}=ke(),[t,r]=f.useState({isLoading:!0,usage:null,canUsePdfSummarizer:!1,canUseYoutubeTranscriber:!1,remainingPdfs:0,remainingYoutubeVideos:0,isAdvancedQuestionSolver:!1}),s=o=>{switch(o){case"Pro":case"Teams":return{pdfLimit:1/0,youtubeLimit:1/0,questionSolverLevel:"advanced"};case"Starter":default:return{pdfLimit:5,youtubeLimit:10,questionSolverLevel:"basic"}}},a=async()=>{if(!e){r(o=>({...o,isLoading:!1}));return}try{r(b=>({...b,isLoading:!0}));const{data:o,error:u}=await J.from("profiles").select("subscription_tier").eq("id",e.id).single();if(u)throw u;const{pdfLimit:c,youtubeLimit:l,questionSolverLevel:d}=s(o.subscription_tier),{data:h,error:m}=await J.from("feature_usage").select("*").eq("user_id",e.id).single();if(m&&m.code!=="PGRST116")throw m;let p;if(h){p=h;const b=new Date(p.last_reset_date),v=new Date().getMonth(),y=new Date().getFullYear();if(b.getMonth()!==v||b.getFullYear()!==y){const w=new Date(y,v,1).toISOString().slice(0,10),{data:_,error:k}=await J.from("feature_usage").update({pdf_summarizer_count:0,youtube_transcriber_count:0,question_solver_count:0,pdf_limit:c,youtube_limit:l,question_solver_level:d,last_reset_date:w}).eq("user_id",e.id).select("*").single();if(k)throw k;p=_}else if(p.pdf_limit!==c||p.youtube_limit!==l||p.question_solver_level!==d){const{data:w,error:_}=await J.from("feature_usage").update({pdf_limit:c,youtube_limit:l,question_solver_level:d}).eq("user_id",e.id).select("*").single();if(_)throw _;p=w}}else{const b=new Date().toISOString().slice(0,7),v={pdf_summarizer_count:0,youtube_transcriber_count:0,question_solver_count:0,pdf_limit:c,youtube_limit:l,question_solver_level:d,last_reset_date:`${b}-01`},{data:y,error:w}=await J.from("feature_usage").insert([{user_id:e.id,...v}]).select("*").single();if(w)throw w;p=y}const x=p.pdf_limit===1/0?1/0:Math.max(0,p.pdf_limit-p.pdf_summarizer_count),g=p.youtube_limit===1/0?1/0:Math.max(0,p.youtube_limit-p.youtube_transcriber_count);r({isLoading:!1,usage:p,canUsePdfSummarizer:x>0,canUseYoutubeTranscriber:g>0,remainingPdfs:x,remainingYoutubeVideos:g,isAdvancedQuestionSolver:p.question_solver_level==="advanced"})}catch(o){console.error("Error fetching usage:",o),r(u=>({...u,isLoading:!1}))}},i=async o=>{if(!e||!t.usage)return!1;try{let u=!0,c="";switch(o){case"pdf":u=t.canUsePdfSummarizer,c="pdf_summarizer_count";break;case"youtube":u=t.canUseYoutubeTranscriber,c="youtube_transcriber_count";break;case"question":c="question_solver_count";break}if(!u)return L.error("You've reached your monthly limit for this feature. Please upgrade your plan for unlimited usage."),!1;const{error:l}=await J.from("feature_usage").update({[c]:t.usage[c]+1}).eq("user_id",e.id);if(l)throw l;return await a(),!0}catch(u){return console.error(`Error tracking ${o} usage:`,u),!1}};return f.useEffect(()=>{a()},[e]),{...t,trackPdfUsage:()=>i("pdf"),trackYoutubeUsage:()=>i("youtube"),trackQuestionUsage:()=>i("question"),refresh:a}};function H0({feature:e="all",className:t=""}){const{isLoading:r,remainingPdfs:s,remainingYoutubeVideos:a,usage:i}=$u();if(r)return n.jsx(de,{className:`p-3 ${t}`,children:n.jsx(ve,{className:"p-0 flex items-center justify-center h-16",children:n.jsx(Rt,{className:"h-5 w-5 animate-spin text-muted-foreground"})})});if(!i)return null;const o=i.pdf_limit===1/0,u=i.youtube_limit===1/0,c=o?0:Math.min(100,i.pdf_summarizer_count/i.pdf_limit*100),l=u?0:Math.min(100,i.youtube_transcriber_count/i.youtube_limit*100);return n.jsx(de,{className:`${t}`,children:n.jsxs(ve,{className:"p-3 space-y-3",children:[n.jsxs("div",{className:"text-sm font-medium mb-2 flex items-center justify-between",children:[n.jsx("span",{children:"Monthly Usage"}),n.jsx(mf,{children:n.jsxs(J1,{children:[n.jsx(Z1,{children:n.jsx(Wx,{className:"h-4 w-4 text-muted-foreground"})}),n.jsx(pf,{children:n.jsx("p",{className:"text-xs max-w-[220px]",children:"Usage limits reset on the 1st of each month. Upgrade to Pro for unlimited usage."})})]})})]}),(e==="all"||e==="pdf")&&n.jsxs("div",{className:"space-y-1.5",children:[n.jsxs("div",{className:"flex items-center justify-between text-sm",children:[n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx(Pe,{className:"h-3.5 w-3.5 text-muted-foreground"}),n.jsx("span",{children:"PDF Summarizer"})]}),n.jsx("span",{className:"text-xs",children:o?n.jsx("span",{className:"text-green-600 dark:text-green-500",children:"Unlimited"}):`${i.pdf_summarizer_count} / ${i.pdf_limit}`})]}),!o&&n.jsx(ks,{value:c,className:"h-1.5",indicatorClassName:c>80?"bg-red-500":void 0})]}),(e==="all"||e==="youtube")&&n.jsxs("div",{className:"space-y-1.5",children:[n.jsxs("div",{className:"flex items-center justify-between text-sm",children:[n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx(Tt,{className:"h-3.5 w-3.5 text-muted-foreground"}),n.jsx("span",{children:"YouTube Transcriber"})]}),n.jsx("span",{className:"text-xs",children:u?n.jsx("span",{className:"text-green-600 dark:text-green-500",children:"Unlimited"}):`${i.youtube_transcriber_count} / ${i.youtube_limit}`})]}),!u&&n.jsx(ks,{value:l,className:"h-1.5",indicatorClassName:l>80?"bg-red-500":void 0})]}),!o&&s===0&&e==="pdf"&&n.jsxs("div",{className:"text-xs text-red-500 mt-2",children:["You've reached your monthly limit for PDF summarization.",n.jsx("a",{href:"/pricing",className:"underline ml-1",children:"Upgrade for unlimited access."})]}),!u&&a===0&&e==="youtube"&&n.jsxs("div",{className:"text-xs text-red-500 mt-2",children:["You've reached your monthly limit for YouTube transcription.",n.jsx("a",{href:"/pricing",className:"underline ml-1",children:"Upgrade for unlimited access."})]})]})})}
469function A_(){const[e,t]=f.useState(null),[r,s]=f.useState(!1),[a,i]=f.useState(""),[o,u]=f.useState(0),[c,l]=f.useState(null),[d,h]=f.useState(null),[m,p]=f.useState(!1),{toast:x}=wa(),g=f.useRef(null),{user:b}=ke(),[v,y]=f.useState([]),[w,_]=f.useState(!1),[k,N]=f.useState("summary"),{canUsePdfSummarizer:j,remainingPdfs:C,trackPdfUsage:I,isLoading:A}=$u(),F=50;f.useEffect(()=>{if(b){const S=Os(_e.PDF_HISTORY,b.id);y(S)}},[b]);const E=S=>{var O;const T=(O=S.target.files)==null?void 0:O[0];if(T)if(T.type==="application/pdf"){if(T.size>F*1024*1024){h(`File size exceeds ${F}MB limit.`),x({title:"File Too Large",description:`Please select a PDF under ${F}MB.`,variant:"destructive"});return}t(T),h(null),l(null),p(!1),N("summary")}else h("Please select a valid PDF file."),x({title:"Invalid File Type",description:"Please select a valid PDF file.",variant:"destructive"})},U=async()=>{if(e){if(!b){x({title:"Authentication Required",description:"Please log in to use this feature",variant:"destructive"});return}if(!j){x({title:"Usage Limit Reached",description:"You've reached your monthly limit for PDF summarization. Upgrade to continue using this feature.",variant:"destructive"});return}s(!0),i("Analyzing PDF structure..."),u(10),h(null),l(null);try{if(!await I())throw new Error("Unable to track usage. Please try again.");i("Extracting content from PDF..."),u(30);const T=await p_(e);i("Processing document visuals..."),u(60),i("Generating comprehensive summary..."),u(80);const O=await x_(T,Mu,b.id);l(O),u(100);const $=jn({summary:O.summary,extractedText:T.text,fileName:e.name,totalPages:T.totalPages,contentType:T.contentType},e.name,`PDF summary, ${T.text.length} characters, ${T.totalPages} pages`);kn(_e.PDF_HISTORY,$,b.id),y(G=>[$,...G].slice(0,20)),x({title:"PDF Processed",description:"Your PDF has been summarized successfully.",duration:3e3})}catch(S){console.error("Error processing PDF:",S);const T=S instanceof Error?S.message:String(S);T.includes("Message limit reached")?x({title:"Message Limit Reached",description:"You've reached your message limit. Please upgrade your plan for unlimited summaries.",variant:"destructive"}):(h(T),x({title:"Processing Failed",description:T,variant:"destructive",duration:5e3}))}finally{s(!1),i(""),u(0)}}},P=S=>{l({title:S.title||"PDF Summary",summary:S.data.summary,keyPoints:[],pdfText:S.data.extractedText,totalPages:S.data.totalPages,contentType:S.data.contentType}),_(!1),t(null),g.current&&(g.current.value=""),x({title:"Loaded from History",description:S.data.fileName})},Y=()=>{b&&(localStorage.removeItem(`${_e.PDF_HISTORY}.${b.id}`),y([]),x({title:"History Cleared",description:"PDF summary history has been cleared."}))},M=S=>{switch(S){case"text-only":return n.jsx(_d,{className:"h-4 w-4"});case"image-only":return n.jsx(Ca,{className:"h-4 w-4"});case"mixed":return n.jsx(Xi,{className:"h-4 w-4"});default:return n.jsx(Pe,{className:"h-4 w-4"})}},Q=S=>{switch(S){case"text-only":return"Text-based PDF";case"image-only":return"Image-based PDF";case"mixed":return"Mixed content PDF";default:return"PDF document"}};return n.jsxs("section",{id:"pdf-summarizer",className:"py-20 container",children:[n.jsxs("div",{className:"text-center max-w-3xl mx-auto mb-8",children:[n.jsxs("h2",{className:"text-3xl md:text-4xl font-bold tracking-tight mb-4",children:["PDF ",n.jsx("span",{className:"gradient-text",children:"Summarizer"})]}),n.jsx("p",{className:"text-muted-foreground text-lg",children:"Upload any PDF and get instant summaries, key points, and insights."})]}),n.jsx(H0,{feature:"pdf",className:"mb-6 max-w-2xl mx-auto"}),n.jsxs("div",{className:"grid lg:grid-cols-5 gap-8",children:[n.jsxs("div",{className:"lg:col-span-2 space-y-5",children:[n.jsxs(de,{children:[n.jsx(Ce,{children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs(Se,{className:"flex items-center gap-2",children:[n.jsx(Pe,{className:"h-5 w-5 text-explainify-600"}),"Upload PDF"]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(R,{variant:"ghost",size:"sm",title:"View history",onClick:()=>_(!w),className:"text-muted-foreground",children:n.jsx(mt,{className:"h-4 w-4"})}),v.length>0&&n.jsx(R,{variant:"ghost",size:"sm",title:"Clear history",onClick:Y,className:"text-muted-foreground hover:text-destructive",children:n.jsx(Ts,{className:"h-4 w-4"})})]})]})}),n.jsxs(ve,{className:"space-y-4",children:[w&&v.length>0&&n.jsx(de,{className:"mb-4 max-h-60 overflow-y-auto",children:n.jsx(ve,{className:"pt-4",children:n.jsx("div",{className:"space-y-2",children:v.map(S=>n.jsxs("div",{className:"flex items-center p-2 hover:bg-muted rounded-md cursor-pointer",onClick:()=>P(S),children:[n.jsx("div",{className:"mr-2",children:M(S.data.contentType)}),n.jsxs("div",{className:"overflow-hidden flex-1",children:[n.jsx("p",{className:"text-sm font-medium truncate",children:S.data.fileName}),n.jsxs("div",{className:"flex items-center",children:[n.jsx("p",{className:"text-xs text-muted-foreground mr-2",children:new Date(S.timestamp).toLocaleStr
469ing()}),n.jsxs(is,{variant:"outline",className:"text-xs",children:[S.data.totalPages," pages"]})]})]})]},S.id))})})}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs("label",{htmlFor:"pdf-upload",className:"block w-full cursor-pointer rounded-md border-2 border-dashed border-muted-foreground/30 p-6 text-center hover:border-muted-foreground/50 focus:outline-none focus:ring-2 focus:ring-explainify-500 focus:ring-offset-2",children:[n.jsx(Pe,{className:"h-6 w-6 mx-auto mb-2 text-muted-foreground"}),n.jsx("span",{className:"mt-2 block text-sm font-medium",children:e?e.name:"Click to upload a PDF file"}),n.jsx("input",{id:"pdf-upload",name:"pdf-upload",type:"file",accept:"application/pdf",className:"sr-only",onChange:E,ref:g})]}),n.jsxs("p",{className:"text-xs text-muted-foreground text-center",children:["Maximum file size: ",F,"MB"]})]}),n.jsxs("div",{className:"pt-2",children:[n.jsx(R,{onClick:U,className:"w-full",disabled:!e||r,children:r?n.jsxs(n.Fragment,{children:[n.jsx(gs,{className:"mr-2 h-4 w-4 animate-spin"}),a]}):n.jsxs(n.Fragment,{children:[n.jsx(ra,{className:"mr-2 h-4 w-4"}),"Process PDF"]})}),r&&n.jsxs("div",{className:"mt-4",children:[n.jsx(ks,{value:o,className:"h-2"}),n.jsx("p",{className:"text-xs text-muted-foreground mt-1 text-center",children:a})]})]}),d&&n.jsxs("div",{className:"bg-destructive/10 p-3 rounded-md flex items-start mt-3",children:[n.jsx(Gt,{className:"h-5 w-5 text-destructive flex-shrink-0 mr-2 mt-0.5"}),n.jsx("p",{className:"text-sm text-destructive",children:d})]})]})]}),c&&n.jsxs(de,{children:[n.jsx(Ce,{children:n.jsx(Se,{className:"text-lg",children:"Document Information"})}),n.jsx(ve,{className:"space-y-4",children:n.jsxs("div",{className:"space-y-2",children:[n.jsxs("div",{className:"flex justify-between items-center",children:[n.jsx("span",{className:"text-sm font-medium",children:"Document Type:"}),n.jsxs(is,{variant:"outline",className:"flex items-center gap-1",children:[M(c.contentType),n.jsx("span",{children:Q(c.contentType)})]})]}),n.jsxs("div",{className:"flex justify-between items-center",children:[n.jsx("span",{className:"text-sm font-medium",children:"Page Count:"}),n.jsxs("span",{className:"text-sm",children:[c.totalPages," pages"]})]}),n.jsxs("div",{className:"flex justify-between items-center",children:[n.jsx("span",{className:"text-sm font-medium",children:"Text Length:"}),n.jsxs("span",{className:"text-sm",children:[c.pdfText.length.toLocaleString()," characters"]})]})]})})]})]}),n.jsx("div",{className:"lg:col-span-3",children:c?n.jsxs(de,{className:"h-full",children:[n.jsxs(Ce,{children:[n.jsx(Se,{children:c.title}),c.contentType!=="text-only"&&n.jsxs(is,{variant:"secondary",className:"w-fit flex items-center gap-1",children:[M(c.contentType),n.jsx("span",{children:"Advanced processing applied"})]})]}),n.jsx(ve,{className:"space-y-6",children:n.jsxs(_n,{defaultValue:"summary",value:k,onValueChange:N,children:[n.jsxs(Ms,{className:"grid grid-cols-3 mb-4",children:[n.jsx(Ie,{value:"summary",children:"Summary"}),n.jsx(Ie,{value:"key-points",children:"Key Points"}),n.jsx(Ie,{value:"full-text",children:"Full Text"})]}),n.jsx(nt,{value:"summary",className:"mt-0",children:n.jsx("div",{className:"prose prose-sm max-w-none dark:prose-invert",children:n.jsx("p",{className:"whitespace-pre-line",children:c.summary})})}),n.jsx(nt,{value:"key-points",className:"mt-0",children:n.jsx("div",{className:"space-y-4",children:n.jsx("ul",{className:"space-y-2",children:c.keyPoints.map((S,T)=>n.jsxs("li",{className:"flex items-start",children:[n.jsx("span",{className:"bg-primary/10 text-primary rounded-full w-6 h-6 flex items-center justify-center text-xs mr-2 mt-0.5 flex-shrink-0",children:T+1}),n.jsx("span",{children:S})]},T))})})}),n.jsx(nt,{value:"full-text",className:"mt-0",children:n.jsxs("div",{className:"prose prose-sm max-w-none dark:prose-invert",children:[n.jsx("div",{className:"bg-muted p-4 rounded-md max-h-96 overflow-y-auto",children:n.jsx("pre",{className:"text-sm whitespace-pre-wrap",children:c.pdfText})}),n.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Note: This is a truncated version of the extracted text."})]})})]})})]}):n.jsx(de,{className:"h-full flex items-center justify-center",children:n.jsxs(ve,{className:"py-12 text-center",children:[n.jsx(Pe,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),n.jsx("h3",{className:"text-xl font-medium mb-2",children:"No PDF Processed Yet"}),n.jsx("p",{className:"text-muted-foreground max-w-md",children:'Upload a PDF document and click "Process PDF" to get a comprehensive summary of your document, including content from images and complex layouts.'})]})})})]})]})}function P_(e){const t=/^.*(youtu.be\/|v\/|e\/|u\/\w+\/|embed\/|v=)([^#\&\?]*).*/,r=e.match(t);return r&&r[2].length===11?r[2]:null}async function D_(e,t=5){try{const r="AIzaSyAQJg7giaR3qLh44YfNuSLvkrCsRntAbV8",s=`https://www.googleapis.com/youtube/v3/search?part=snippet&q=${encodeURIComponent(e)}&maxResults=${t}&type=video&key=${r}`,a=await fetch(s);if(!a.ok)throw new Error(`YouTube API request failed with status: ${a.status}`);const i=await a.json();return!i.items||i.items.length===0?ml(e):i.items.map(o=>{var u,c;
469return{id:o.id.videoId,title:o.snippet.title,description:o.snippet.description,thumbnailUrl:((u=o.snippet.thumbnails.high)==null?void 0:u.url)||((c=o.snippet.thumbnails.default)==null?void 0:c.url),channelTitle:o.snippet.channelTitle,publishedAt:o.snippet.publishedAt}})}catch(r){return console.error("Error searching YouTube videos:",r),ml(e)}}function ml(e){const t=e.toLowerCase();return t.includes("calculus")?[{id:"N-7nachoCGI",title:"Calculus 1 - Full College Course",description:"Learn Calculus 1 in this full college course. This course was created by Dr. Linda Green, a lecturer at the University of North Carolina at Chapel Hill.",thumbnailUrl:"https://img.youtube.com/vi/N-7nachoCGI/hqdefault.jpg",channelTitle:"freeCodeCamp.org",publishedAt:"2021-08-01T00:00:00Z"},{id:"WUvTyaaNkzM",title:"Essence of calculus, chapter 1",description:"An intuitive overview of the big ideas in calculus",thumbnailUrl:"https://img.youtube.com/vi/WUvTyaaNkzM/hqdefault.jpg",channelTitle:"3Blue1Brown",publishedAt:"2018-01-01T00:00:00Z"},{id:"HfACrKJ_Y2w",title:"Calculus - The basic concepts",description:"In this video I try to give an intuitive understanding of the very basic concepts in calculus: limits, derivatives and integrals.",thumbnailUrl:"https://img.youtube.com/vi/HfACrKJ_Y2w/hqdefault.jpg",channelTitle:"The Organic Chemistry Tutor",publishedAt:"2019-01-01T00:00:00Z"}]:t.includes("physics")||t.includes("quantum")?[{id:"ZihywtixUYo",title:"Quantum Physics Full Course | Quantum Mechanics Course",description:"This course on quantum mechanics teaches all the basic of quantum physics and chemistry.",thumbnailUrl:"https://img.youtube.com/vi/ZihywtixUYo/hqdefault.jpg",channelTitle:"Academic Lesson",publishedAt:"2020-05-01T00:00:00Z"},{id:"7ku5MrNOio0",title:"If You Don't Understand Quantum Physics, Try This!",description:"A simple and clear explanation of all the important features of quantum physics that you need to know.",thumbnailUrl:"https://img.youtube.com/vi/7ku5MrNOio0/hqdefault.jpg",channelTitle:"DoS - Domain of Science",publishedAt:"2018-08-15T00:00:00Z"}]:t.includes("chemistry")||t.includes("organic")?[{id:"bIPAGzWnHQw",title:"General Chemistry 1 Review Study Guide - IB, AP, & College Chem Final Exam",description:"This video tutorial study guide review is for students who are taking their first semester of college general chemistry.",thumbnailUrl:"https://img.youtube.com/vi/bIPAGzWnHQw/hqdefault.jpg",channelTitle:"The Organic Chemistry Tutor",publishedAt:"2019-05-01T00:00:00Z"},{id:"PKA4CZHbNVw",title:"Organic Chemistry Introduction Part 1",description:"Comprehensive introduction to organic chemistry basics.",thumbnailUrl:"https://img.youtube.com/vi/PKA4CZHbNVw/hqdefault.jpg",channelTitle:"The Organic Chemistry Tutor",publishedAt:"2020-03-01T00:00:00Z"}]:t.includes("history")||t.includes("world war")?[{id:"Mwbw9KF-ACY",title:"World History in 20 Minutes",description:"A brief summary of world history from the big bang to the present.",thumbnailUrl:"https://img.youtube.com/vi/Mwbw9KF-ACY/hqdefault.jpg",channelTitle:"Oversimplified",publishedAt:"2020-01-01T00:00:00Z"},{id:"dHSQAEam2yc",title:'World War I - summary of the "Great War"',description:"A brief overview of the First World War and its causes and effects.",thumbnailUrl:"https://img.youtube.com/vi/dHSQAEam2yc/hqdefault.jpg",channelTitle:"History Matters",publishedAt:"2018-11-11T00:00:00Z"}]:t.includes("programming")||t.includes("coding")||t.includes("javascript")?[{id:"PkZNo7MFNFg",title:"Learn JavaScript - Full Course for Beginners",description:"This complete 134-part JavaScript tutorial for beginners will teach you everything you need to know to get started with the JavaScript programming language.",thumbnailUrl:"https://img.youtube.com/vi/PkZNo7MFNFg/hqdefault.jpg",channelTitle:"freeCodeCamp.org",publishedAt:"2018-12-10T00:00:00Z"},{id:"W6NZfCO5SIk",title:"JavaScript Tutorial for Beginners: Learn JavaScript in 1 Hour",description:"Watch this JavaScript tutorial for beginners to learn JavaScript basics in one hour.",thumbnailUrl:"https://img.youtube.com/vi/W6NZfCO5SIk/hqdefault.jpg",channelTitle:"Programming with Mosh",publishedAt:"2018-04-24T00:00:00Z"}]:[{id:"fNk_zzaMoSs",title:`${e} - Educational Overview`,description:`Learn about ${e} in this comprehensive video`,thumbnailUrl:"https://img.youtube.com/vi/fNk_zzaMoSs/hqdefault.jpg",channelTitle:"Educational Channel",publishedAt:new Date().toISOString()},{id:"rfscVS0vtbw",title:`Introduction to ${e}
469`,description:`A beginner's guide to ${e}`,thumbnailUrl:"https://img.youtube.com/vi/rfscVS0vtbw/hqdefault.jpg",channelTitle:"Learning Platform",publishedAt:new Date().toISOString()}]}async function R_(e){try{const t="AIzaSyAQJg7giaR3qLh44YfNuSLvkrCsRntAbV8",r=`https://www.googleapis.com/youtube/v3/videos?part=snippet&id=${e}&key=${t}`,s=await fetch(r);if(!s.ok)throw new Error(`Failed to fetch video details: ${s.statusText}`);const a=await s.json();if(!a.items||a.items.length===0)throw new Error("Video not found");const i=a.items[0].snippet;return{title:i.title,channelTitle:i.channelTitle}}catch(t){return console.error("Error fetching video details:",t),{title:"YouTube Video",channelTitle:"YouTube Channel"}}}async function I_(e){try{const t="27b5835efemsh1e149cf079a8d6fp129777jsn813d4f6f2052",r=await fetch(`https://youtube-subtitles-and-transcriptions.p.rapidapi.com/transcribe?video_id=${e}`,{method:"GET",headers:{Accept:"application/json","Content-Type":"application/json","x-rapidapi-ua":"RapidAPI-Playground","x-rapidapi-key":t,"x-rapidapi-host":"youtube-subtitles-and-transcriptions.p.rapidapi.com"}});if(!r.ok)return console.error(`API request failed with status: ${r.status}`),r.status===401||r.status===403?"Invalid or expired API key. Please check your RapidAPI key.":r.status===429?"API rate limit exceeded. Please try again later.":`Transcript fetch failed with status: ${r.status}. Please try again later.`;const s=await r.json();return!s.transcript||s.transcript.trim().length===0?"No transcript available for this video. The video may not have captions.":s.transcript}catch(t){return console.error("Error fetching transcript:",t),"Failed to fetch transcript. Please check your internet connection and try again later."}}async function F_(e,t,r){try{let s="YouTube Video",a="YouTube Channel";try{const l=await R_(t);s=l.title,a=l.channelTitle}catch(l){console.error("Error fetching video title:",l)}const o=[{role:"user",content:`Please summarize the following YouTube video transcript. Provide:
4701. A concise summary (max 3 paragraphs)
4712. 5-7 key points or takeaways
472
473Transcript:
474${e.slice(0,15e3)}`}],u=await Mu(o,r),c=M_(u);return{videoId:t,title:s,transcript:e.slice(0,5e3),summary:c.summary,keyPoints:c.keyPoints}}catch(s){throw console.error("Error summarizing transcript:",s),new Error("Failed to summarize transcript. Please try again later.")}}function M_(e){let t="",r=[];const s=e.match(/key\s*points:?|takeaways:?/i);if(s){t=e.substring(0,s.index).trim();const i=e.substring(s.index).match(/[-•*]\s*(.*?)(?=[-•*]|\n\n|$)/gs);i&&(r=i.map(o=>o.replace(/^[-•*]\s*/,"").trim()))}else t=e.trim();return{summary:t,keyPoints:r.length?r:["No specific key points identified"]}}function O_(){const[e,t]=f.useState(""),[r,s]=f.useState(!1),[a,i]=f.useState(null),[o,u]=f.useState(null),[c,l]=f.useState(!1),[d,h]=f.useState(!1),[m,p]=f.useState(!1),{toast:x}=wa(),{user:g}=ke(),[b,v]=f.useState([]),[y,w]=f.useState(!1),{canUseYoutubeTranscriber:_,remainingYoutubeVideos:k,trackYoutubeUsage:N,isLoading:j}=$u();f.useEffect(()=>{if(g){const E=Os(_e.YOUTUBE_HISTORY,g.id);v(E)}},[g]);const C=E=>{t(E.target.value),u(null)},I=async()=>{if(e.trim()){if(!g){x({title:"Authentication Required",description:"Please log in to use this feature",variant:"destructive"});return}if(!_){x.error("You've reached your monthly limit for YouTube transcription. Upgrade to continue using this feature.");return}s(!0),u(null),i(null),h(!1),p(!1);try{if(!await N())throw new Error("Unable to track usage. Please try again.");const U=P_(e);if(!U)throw new Error("Invalid YouTube URL. Please enter a valid YouTube video URL.");const P=await I_(U);if(P.includes("API key required")||P.includes("Invalid or expired API key")||P.includes("API rate limit exceeded")){u(P),x({title:"API Key Issue",description:P,variant:"destructive",duration:5e3}),s(!1);return}if(!P||P.includes("No transcript available"))throw new Error("Could not retrieve transcript for this video. It may not have captions available.");if(P.includes("Failed to fetch transcript"))throw new Error(P);const Y=!P.includes(">>")&&!P.includes("[")&&!P.includes("]"),M=P.includes("NOT an actual transcript")||P.includes("cannot directly access")||P.includes("alternative ways");h(Y&&!M),p(M),Y&&!M?x({title:"AI Transcription Used",description:"This video didn't have captions, so AI was used to generate a transcript.",duration:5e3}):M&&x({title:"AI Content Generated",description:"No captions were available. AI has provided alternative information based on the video title.",duration:5e3,variant:"warning"});const Q=await F_(P,U,g.id);i(Q);const S=jn(Q,Q.title,U);kn(_e.YOUTUBE_HISTORY,S,g.id),v(T=>[S,...T].slice(0,20)),x({title:"Processing Complete",description:M?"AI has provided information based on the video title.":"Your YouTube video has been transcribed and summarized.",duration:3e3})}catch(E){console.error("Error processing video:",E);const U=E instanceof Error?E.message:String(E);U.includes("Message limit reached")?x({title:"Message Limit Reached",description:"You've reached your message limit. Please upgrade your plan for unlimited transcriptions.",variant:"destructive"}):(u(U),x({title:"Processing Failed",description:U,variant:"destructive",duration:5e3}))}finally{s(!1)}}},A=E=>{i(E.data),w(!1),E.data.videoId&&t(`https://www.youtube.com/watch?v=${E.data.videoId}`),x({title:"Loaded from History",description:E.data.title})},F=()=>{g&&(localStorage.removeItem(`${_e.YOUTUBE_HISTORY}.${g.id}`),v([]),x.success("Transcript history cleared"))};return n.jsxs("section",{id:"youtube-transcriber",className:"py-20 container",children:[n.jsxs("div",{className:"text-center max-w-3xl mx-auto mb-8",children:[n.jsxs("h2",{className:"text-3xl md:text-4xl font-bold tracking-tight mb-4",children:["YouTube ",n.jsx("span",{className:"gradient-text",children:"Transcriber"})]}),n.jsx("p",{className:"text-muted-foreground text-lg",children:"Convert YouTube videos into transcripts with summaries and ke
474y takeaways."})]}),n.jsx(H0,{feature:"youtube",className:"mb-6 max-w-2xl mx-auto"}),n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6",children:[n.jsxs(de,{className:"lg:col-span-1",children:[n.jsx(Ce,{children:n.jsxs(Se,{className:"flex items-center gap-2",children:[n.jsx(Tt,{className:"h-5 w-5 text-explainify-500"}),"YouTube Transcriber"]})}),n.jsxs(ve,{className:"space-y-4",children:[y&&b.length>0&&n.jsx(de,{className:"mb-4 max-h-60 overflow-y-auto",children:n.jsx(ve,{className:"pt-4",children:n.jsx("div",{className:"space-y-2",children:b.map(E=>n.jsxs("div",{className:"flex items-center p-2 hover:bg-muted rounded-md cursor-pointer",onClick:()=>A(E),children:[n.jsx(Tt,{className:"h-4 w-4 mr-2 text-muted-foreground"}),n.jsxs("div",{className:"overflow-hidden",children:[n.jsx("p",{className:"text-sm font-medium truncate",children:E.data.title}),n.jsx("p",{className:"text-xs text-muted-foreground",children:new Date(E.timestamp).toLocaleString()})]})]},E.id))})})}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs("div",{className:"relative",children:[n.jsx(eo,{className:"h-4 w-4 absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),n.jsx("input",{type:"url",placeholder:"https://www.youtube.com/watch?v=...",value:e,onChange:C,className:"w-full pl-10 pr-4 py-2 rounded-md border focus:outline-none focus:ring-2 focus:ring-explainify-500 focus:border-transparent"})]}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Enter any YouTube video URL to get its transcript and summary."})]}),n.jsxs("div",{className:"flex flex-col gap-2",children:[n.jsx(R,{onClick:I,disabled:r||!e.trim(),className:"w-full",children:r?n.jsxs(n.Fragment,{children:[n.jsx(gs,{className:"h-4 w-4 mr-2 animate-spin"}),"Processing..."]}):n.jsxs(n.Fragment,{children:[n.jsx(Tt,{className:"h-4 w-4 mr-2"}),"Transcribe Video"]})}),n.jsxs("div",{className:"flex gap-2",children:[n.jsxs(R,{variant:"outline",size:"sm",className:"flex-1",onClick:()=>w(!y),children:[n.jsx(mt,{className:"h-4 w-4 mr-2"}),y?"Hide History":"Show History"]}),b.length>0&&n.jsx(R,{variant:"outline",size:"sm",className:"flex-none",onClick:F,children:n.jsx(Ts,{className:"h-4 w-4"})})]})]}),o&&n.jsxs("div",{className:"bg-destructive/10 p-3 rounded-md flex items-start gap-2 text-sm",children:[n.jsx(Gt,{className:"h-5 w-5 text-destructive flex-shrink-0 mt-0.5"}),n.jsx("p",{children:o})]}),n.jsxs("div",{className:"text-xs text-muted-foreground mt-4",children:[n.jsx("p",{className:"font-medium",children:"About this tool:"}),n.jsxs("ul",{className:"list-disc list-inside space-y-1 mt-1",children:[n.jsx("li",{children:"Transcribes YouTube videos using available captions"}),n.jsx("li",{children:"When captions aren't available, AI provides information based on the video title"}
474),n.jsx("li",{children:"Summarizes content and extracts key points"}),n.jsx("li",{children:"Clearly labels AI-generated content"}),n.jsx("li",{children:"Saves history for easy reference"})]}),n.jsxs("p",{className:"mt-2 text-amber-600",children:[n.jsx("strong",{children:"Note:"})," AI cannot directly listen to YouTube videos. For videos without captions, it will provide topic-related information rather than an actual transcript."]})]})]})]}),n.jsxs(de,{className:"lg:col-span-3 overflow-hidden",children:[!a&&!r&&n.jsxs("div",{className:"h-full flex flex-col items-center justify-center p-10 text-center text-muted-foreground",children:[n.jsx(Tt,{className:"h-16 w-16 text-explainify-200 mb-4"}),n.jsx("h3",{className:"text-lg font-medium mb-2",children:"No Video Transcribed Yet"}),n.jsx("p",{children:'Enter a YouTube video URL and click "Transcribe Video" to get started'})]}),r&&n.jsxs("div",{className:"h-full flex flex-col items-center justify-center p-10",children:[n.jsx(gs,{className:"h-12 w-12 text-explainify-500 animate-spin mb-4"}),n.jsx("h3",{className:"text-lg font-medium mb-2",children:"Processing Video"}),n.jsx("p",{className:"text-muted-foreground text-sm text-center",children:"Fetching transcript and generating summary. This may take a moment..."})]}),a&&!r&&n.jsx("div",{className:"overflow-hidden flex flex-col h-full",children:n.jsxs("div",{className:"p-6 overflow-y-auto flex-1",children:[n.jsx("div",{className:"aspect-video bg-gray-100 mb-4 rounded overflow-hidden",children:n.jsx("iframe",{width:"100%",height:"100%",src:`https://www.youtube.com/embed/${a.videoId}`,title:a.title,frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0})}),n.jsxs("h2",{className:"text-2xl font-bold mb-4 flex items-center gap-2",children:[a.title,d&&n.jsxs("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-explainify-100 text-explainify-800",children:[n.jsx(Xe,{className:"h-3 w-3 mr-1"}),"AI Transcribed"]}),m&&n.jsxs("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-amber-100 text-amber-800",children:[n.jsx(Xe,{className:"h-3 w-3 mr-1"}),"AI Generated Content"]})]}),m&&n.jsx("div",{className:"mb-6 bg-amber-50 border border-amber-200 rounded-md p-4",children:n.jsxs("div",{className:"flex items-start gap-2",children:[n.jsx(Gt,{className:"h-5 w-5 text-amber-500 mt-0.5"}),n.jsxs("div",{children:[n.jsx("h3",{className:"font-medium text-amber-800",children:"This is not an actual transcript"}),n.jsx("p",{className:"text-sm text-amber-700",children:"This content was generated by AI based on the video title. AI cannot directly access or listen to YouTube videos. For an actual transcript, consider using dedicated transcription services."})]})]})}),n.jsxs("div",{className:"mb-6",children:[n.jsx("h3",{className:"text-lg font-medium mb-2",children:m?"Content Overview":"Summary"}),n.jsx("div",{className:"prose prose-sm max-w-none",children:a.summary.split(`
475`).map((E,U)=>n.jsx("p",{className:"mb-3",children:E},U))})]}),n.jsxs("div",{className:"mb-6",children:[n.jsx("h3",{className:"text-lg font-medium mb-2",children:m?"Key Information":"Key Points"}),n.jsx("ul",{className:"space-y-2",children:a.keyPoints.map((E,U)=>n.jsxs("li",{className:"flex gap-2",children:[n.jsx("div",{className:"rounded-full bg-explainify-100 text-explainify-700 h-5 w-5 flex-shrink-0 flex items-center justify-center font-medium mt-0.5",children:U+1}),n.jsx("span",{children:E})]},U))})]}),n.jsxs("div",{className:"mb-6",children:[n.jsxs("div",{className:"flex items-center justify-between mb-2",children:[n.jsx("h3",{className:"text-lg font-medium",children:m?"Generated Content":"Transcript"}),n.jsx(R,{variant:"outline",size:"sm",onClick:()=>l(!c),children:c?"Show Less":"Show More"})]}),n.jsxs("div",{className:`prose prose-sm max-w-none ${c?"":"max-h-40 overflow-hidden relative"}`,children:[!c&&!m&&n.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-20 bg-gradient-to-t from-background to-transparent"}),a.transcript.split(`
476`).map((E,U)=>n.jsx("p",{className:"mb-2",children:E},U))]})]})]})})]})]})]})}const rt=["ai-tutor","question-solver","content-tools"],Ii={"ai-tutor":"/ai-tutor","question-solver"
476:"/question-solver","content-tools":"/tools"},V0=f.createContext(void 0),Fi="explainify_explored_features",Mi="explainify_completed_exploration",Oi="explainify_current_feature_index",Li="explainify_first_visit",L_=({children:e})=>{const t=gt(),[r,s]=f.useState(()=>localStorage.getItem(Li)!=="false"),[a,i]=f.useState(()=>{const j=localStorage.getItem(Fi);return j?JSON.parse(j):{"ai-tutor":!1,"question-solver":!1,"content-tools":!1}}),[o,u]=f.useState(()=>localStorage.getItem(Mi)==="true"),[c,l]=f.useState(()=>{const j=localStorage.getItem(Oi);return j!==null?parseInt(j,10):0}),[d,h]=f.useState(!1),m=Object.values(a).every(j=>j);f.useEffect(()=>{r&&localStorage.setItem(Li,"false")},[r]),f.useEffect(()=>{localStorage.setItem(Fi,JSON.stringify(a))},[a]),f.useEffect(()=>{localStorage.setItem(Oi,c.toString())},[c]);const p=j=>{o||(i(C=>({...C,[j]:!0})),r&&L.success(`Great job exploring the ${j.replace("-"," ")}!`,{description:m?"You've explored all features! You can now check pricing.":"Continue to the next feature when you're ready.",duration:3e3}))},x=()=>rt[c],g=()=>c>=rt.length-1?null:rt[c+1],b=()=>({completed:Object.values(a).filter(Boolean).length,total:rt.length}),v=()=>{if(c<rt.length-1){const j=c+1;l(j);const C=rt[j];t(Ii[C])}else w(),t("/pricing")},y=()=>{if(c>0){const j=c-1;l(j);const C=rt[j];t(Ii[C])}},w=()=>{localStorage.setItem(Mi,"true"),u(!0),s(!1)},N={exploredFeatures:a,allFeaturesExplored:m,markFeatureExplored:p,resetExploredFeatures:()=>{i({"ai-tutor":!1,"question-solver":!1,"content-tools":!1}),l(0),s(!0),localStorage.removeItem(Fi),localStorage.removeItem(Mi),localStorage.removeItem(Oi),localStorage.removeItem(Li),u(!1)},shouldShowExplorationPrompt:d,setShouldShowExplorationPrompt:h,redirectToPricing:()=>{if(m)o||w(),t("/pricing");else if(!o&&r){const j=Object.entries(a).filter(([C,I])=>!I).map(([C])=>C.replace("-"," "));L.error(`Please explore the following features first: ${j.join(", ")}`,{description:"This helps you understand the full value of our platform.",duration:5e3}),h(!0);for(let C=0;C<rt.length;C++){const I=rt[C];if(!a[I]){l(C),t(Ii[I]);break}}}else t("/pricing")},hasCompletedExploration:o,completeExploration:w,currentFeatureIndex:c,goToNextFeature:v,goToPreviousFeature:y,getCurrentFeature:x,getNextFeature:g,getFeatureProgress:b,isFirstTimeUser:r};return n.jsx(V0.Provider,{value:N,children:e})},Ls=()=>{const e=f.useContext(V0);if(e===void 0)throw new Error("useFeatureExploration must be used within a FeatureExplorationProvider");return e},$_=()=>{const{markFeatureExplored:e,hasCompletedExploration:t}=Ls();return f.useEffect(()=>{if(t)return;const r=setTimeout(()=>{e("content-tools"),L.success("You've explored the Content Tools!",{description:"You've completed the feature tour! You can now view pricing.",duration:5e3})},3e3);return()=>clearTimeout(r)},[e,t]),n.jsxs("div",{className:"min-h-screen bg-gradient-to-b from-white to-explainify-50 dark:from-gray-900 dark:to-gray-800",children:[n.jsx(_s,{}),n.jsxs("div",{className:"container py-10",children:[n.jsxs("div",{className:"text-center max-w-3xl mx-auto mb-10",children:[n.jsxs("h1",{className:"text-4xl md:text-5xl font-bold tracking-tight mb-4",children:["Content ",n.jsx("span",{className:"gradient-text dark:dark-gradient-text",children:"Tools"})]}),n.jsx("p",{className:"text-muted-foreground text-lg",children:"Extract insights from any type of content with our AI-powered tools."})]}),n.jsxs(_n,{defaultValue:"pdf",className:"max-w-6xl mx-auto",children:[n.jsxs(Ms,{className:"grid w-full grid-cols-2 mb-8",children:[n.jsxs(Ie,{value:"pdf",className:"flex items-center gap-2",children:[n.jsx(Xi,{className:"h-4 w-4"}),"Advanced PDF Summarizer"]}),n.jsxs(Ie,{value:"youtube",className:"flex items-center gap-2",children:[n.jsx(Tt,{className:"h-4 w-4"}),"YouTube Transcriber"]})]}),n.jsxs(nt,{value:"pdf",children:[n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 mb-8",children:[n.jsxs("div",{className:"bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md flex flex-col items-center text-center",children:[n.jsx(Pe,{className:"h-12 w-12 text-explainify-600 mb-4"}),n.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Text-based PDFs"}),n.jsx("p",{className:"text-muted-foreground text-sm",children:"Extract and summarize text from standard PDF documents with searchable text."})]}),n.jsxs("div",{className:"bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md flex flex-col items-center text-center",children:[n.jsx(Ca,{className:"h-12 w-12 text-explainify-600 mb-4"}),n.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Scanned Documents"}),n.jsx("p",{className:"text-muted-foreground text-sm",children:"Process image-based PDFs and scanned documents to extract meaningful insights."})]}),n.jsxs("div",{className:"bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md flex flex-col items-center text-center",children:[n.jsx(Xi,{className:"h-12 w-12 text-explainify-600 mb-4"}),n.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Complex Layouts"}),n.jsx("p",{className:"text-muted-foreground text-sm",children:"Handle PDFs with mixed content, tables, charts, and images for comprehensive summaries."})]})]}),n.jsx(A_,{})]}),n.jsx(nt,{value:"youtube",children:n.jsx(O_,{})})]})]}),n.jsx("footer",{className:"py-12 bg-explainify-900 text-explainify-100",children:n.jsxs("div",{className:"container",children:[n.jsxs("div",{className:"flex items-center justify-center gap-2 font-semibold mb-8 text-white",children:[n.jsx(Be,{className:"h-6 w-6 text-explainify-400"}),n.jsx("span",{className:"text-xl",children:"Explainify"})]}),n.jsxs("div",{className:"flex flex-wrap justify-center gap-6 text-sm mb-8",children:[n.jsx("a",{href:"#features",className:"hover:text-white transition-colors",children:"Features"}),n.jsx("a",{href:"#ai-tutor",className:"hover:text-white transition-colors",children:"AI Tutor"}),n.jsx("a",{href:"#learning-paths",className:"hover:text-white transition-colors",children:"Learning Paths"}),n.jsx("a",{href:"#question-solver",className:"hover:text-white transition-colors",children:"Question Solver"}),n.jsx("a",{href:"#",className:"hover:text-white transition-colors",children:"Pricing"}),n.jsx("a",{href:"#",className:"hover:text-white transition-colors",children:"About Us"}),n.jsx("a",{href:"#",className:"hover:text-white transition-colors",children:"Contact"})]}),n.jsx("div",{className:"text-center text-xs text-explainify-300",children:n.jsxs("p",{children:["© ",new Date().getFullYear()," Explainify. All rights reserved."]})})]})})]})},U_=()=>{const e=Mt();return f.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]),n.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-100",children:n.jsxs("div",{className:"text-center",children:[n.jsx("h1",{className:"text-4xl font-bold mb-4",children:"404"}),n.jsx("p",{className:"text-xl text-gray-600 mb-4",children:"Oops! Page not found"}),n.jsx("a",{href:"/",className:"text-blue-500 hover:text-blue-700 underline",children:"Return to Home"})]})})},ze=f.forwardRef(({className:e,type:t,...r},s)=>n.jsx("input",{type:t,className:V("flex h-9 sm:h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm md:text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:s,...r}));ze.displayName="Input";var z_="Separator",pl="horizontal",B_=["horizontal","vertical"],G0=f.forwardRef((e,t)=>
476{const{decorative:r,orientation:s=pl,...a}=e,i=q_(s)?s:pl,u=r?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return n.jsx(re.div,{"data-orientation":i,...u,...a,ref:t})});G0.displayName=z_;function q_(e){return B_.includes(e)}var W0=G0;const Y0=f.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...s},a)=>n.jsx(W0,{ref:a,decorative:r,orientation:t,className:V("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...s}));Y0.displayName=W0.displayName;function H_(){const e=Mt(),t=new URLSearchParams(e.search),[r,s]=f.useState(t.get("mode")==="signup"?"signup":"login"),[a,i]=f.useState(""),[o,u]=f.useState(""),[c,l]=f.useState(""),[d,h]=f.useState(""),{signIn:m,signUp:p,signInWithGoogle:x,isLoading:g}=ke(),b=async v=>{v.preventDefault(),r==="login"?await m(a,o):await p(a,o,c,d)};return n.jsxs("div",{className:"min-h-screen flex flex-col items-center justify-center p-4 bg-gray-50 dark:bg-gray-900",children:[n.jsxs(ne,{to:"/",className:"flex items-center gap-2 mb-8",children:[n.jsx(Be,{className:"h-8 w-8 text-explainify-600"}),n.jsx("span",{className:"text-2xl font-semibold",children:"Explainify"})]}),n.jsxs(de,{className:"w-full max-w-md",children:[n.jsxs(Ce,{children:[n.jsx(Se,{children:r==="login"?"Log In":"Sign Up"}),n.jsx(at,{children:r==="login"?"Enter your email and password to log in":"Create a new account to get started"})]}),n.jsxs("form",{onSubmit:b,children:[n.jsxs(ve,{className:"space-y-4",children:[r==="signup"&&n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{htmlFor:"firstName",className:"text-sm font-medium",children:"First Name"}),n.jsx(ze,{id:"firstName",placeholder:"John",value:c,onChange:v=>l(v.target.value),required:!0})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{htmlFor:"lastName",className:"text-sm font-medium",children:"Last Name"}),n.jsx(ze,{id:"lastName",placeholder:"Doe",value:d,onChange:v=>h(v.target.value),required:!0})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{htmlFor:"email",className:"text-sm font-medium",children:"Email"}),n.jsx(ze,{id:"email",type:"email",placeholder:"[email protected]",value:a,onChange:v=>i(v.target.value),required:!0})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("label",{htmlFor:"password",className:"text-sm font-medium",children:"Password"}),r==="login"&&n.jsx(ne,{to:"/auth/reset-password",className:"text-xs text-explainify-600 hover:underline",children:"Forgot password?"})]}),n.jsx(ze,{id:"password",type:"password",placeholder:"••••••••",value:o,onChange:v=>u(v.target.value),required:!0,minLength:6})]})]}),n.jsxs(At,{className:"flex flex-col space-y-4",children:[n.jsx(R,{type:"submit",className:"w-full",disabled:g,children:g?"Loading...":r==="login"?"Log In":"Create Account"}),n.jsxs("div",{className:"relative flex items-center justify-center w-full my-2",children:[n.jsx(Y0,{className:"w-full"}),n.jsx("span",{className:"absolute bg-card px-2 text-xs text-muted-foreground",children:"OR"})]}),n.jsxs(R,{type:"button",variant:"outline",className:"w-full flex items-center gap-2",onClick:x,disabled:g,children:[n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48",width:"20px",height:"20px",children:[n.jsx("path",{fill:"#FFC107",d:"M43.611,20.083H42V20H24v8h11.303c-1.649,4.657-6.08,8-11.303,8c-6.627,0-12-5.373-12-12c0-6.627,5.373-12,12-12c3.059,0,5.842,1.154,7.961,3.039l5.657-5.657C34.046,6.053,29.268,4,24,4C12.955,4,4,12.955,4,24c0,11.045,8.955,20,20,20c11.045,0,20-8.955,20-20C44,22.659,43.862,21.35,43.611,20.083z"}),n.jsx("path",{fill:"#FF3D00",d:"M6.306,14.691l6.571,4.819C14.655,15.108,18.961,12,24,12c3.059,0,5.842,1.154,7.961,3.039l5.657-5.657C34.046,6.053,29.268,4,24,4C16.318,4,9.656,8.337,6.306,14.691z"}),n.jsx("path",{fill:"#4CAF50",d:"M24,44c5.166,0,9.86-1.977,13.409-5.192l-6.19-5.238C29.211,35.091,26.715,36,24,36c-5.202,0-9.619-3.317-11.283-7.946l-6.522,5.025C9.505,39.556,16.227,44,24,44z"}),n.jsx("path",{fill:"#1976D2",d:"M43.611,20.083H42V20H24v8h11.303c-0.792,2.237-2.231,4.166-4.087,5.5
47671c0.001-0.001,0.002-0.001,0.003-0.002l6.19,5.238C36.971,39.205,44,34,44,24C44,22.659,43.862,21.35,43.611,20.083z"})]}),"Continue with Google"]}),n.jsxs("div",{className:"text-center text-sm",children:[r==="login"?n.jsxs("p",{children:["Don't have an account?"," ",n.jsx("button",{type:"button",className:"text-explainify-600 hover:underline font-medium",onClick:()=>s("signup"),children:"Sign up"})]}):n.jsxs("p",{children:["Already have an account?"," ",n.jsx("button",{type:"button",className:"text-explainify-600 hover:underline font-medium",onClick:()=>s("login"),children:"Log in"})]}),n.jsx("p",{className:"mt-2",children:n.jsx(ne,{to:"/auth/troubleshoot",className:"text-explainify-500 hover:underline text-xs",children:"Having trouble signing in?"})})]})]})]})]})]})}function V_(){const e=gt(),t=Mt(),[r,s]=f.useState(null),[a,i]=f.useState(!0),[o,u]=f.useState(1),[c,l]=f.useState(null),[d,h]=f.useState(!1),m=()=>{c&&window.clearTimeout(c),u(p=>p+1),i(!0),h(!1),s(null)};return f.useEffect(()=>{const p=window.setTimeout(()=>{a&&h(!0)},15e3);return l(p),()=>{p&&window.clearTimeout(p)}},[a,o]),f.useEffect(()=>{a&&!d&&(async()=>{try{const x=localStorage.getItem("explainify.auth.timestamp"),g=x?Date.now()-parseInt(x):null;console.log(`Processing OAuth callback (attempt ${o}), time since auth initiation: ${g?Math.round(g/1e3)+"s":"unknown"}`),localStorage.getItem("explainify.auth.inProgress")==="true"&&console.log("Detected return from Google auth - attempting to complete registration");const v=new URLSearchParams(t.search),y=v.get("error")||v.get("error_description");if(y)throw console.error("OAuth error from query parameters:",y),new Error(y);if(console.log("Attempting to exchange auth code or retrieve session..."),v.get("code")){console.log("Auth code found in URL, attempting to exchange...");const{data:N,error:j}=await J.auth.getSession();if(j)throw console.error("Session retrieval error:",j),j;if(N!=null&&N.session){console.log("Session created successfully after code exchange"),i(!1),localStorage.removeItem("explainify.auth.timestamp"),localStorage.removeItem("explainify.auth.inProgress"),localStorage.removeItem("explainify.auth.state"),localStorage.removeItem("explainify.auth.startTime"),L.success("Successfully signed in with Google"),e("/dashboard",{replace:!0});return}else{console.log("No session found after initial check, trying explicit approach..."),await new Promise(A=>setTimeout(A,2e3));const{data:C,error:I}=await J.auth.getSession();if(I)throw console.error("Session refresh error:",I),I;if(C!=null&&C.session){console.log("Session created after waiting"),i(!1),localStorage.removeItem("explainify.auth.timestamp"),localStorage.removeItem("explainify.auth.inProgress"),localStorage.removeItem("explainify.auth.state"),localStorage.removeItem("explainify.auth.startTime"),L.success("Successfully signed in with Google"),e("/dashboard",{replace:!0});return}}}console.log("Checking if user is already authenticated...");const{data:_,error:k}=await J.auth.getUser();if(k)throw console.error("User retrieval error:",k),k;if(_!=null&&_.user){console.log("User found, attempting to establish session...");const{data:N,error:j}=await J.auth.getSession();if(j)throw console.error("Session error:",j),j;if(N!=null&&N.session){console.log("Session established"),i(!1),localStorage.removeItem("explainify.auth.timestamp"),localStorage.removeItem("explainify.auth.inProgress"),localStorage.removeItem("explainify.auth.state"),localStorage.removeItem("explainify.auth.startTime"),L.success("Successfully signed in with Google"),e("/dashboard",{replace:!0});return}}throw new Error("Failed to authenticate. Please try again or contact support.")}catch(x){const g=(x==null?void 0:x.message)||"An unexpected error occurred";console.error(`Auth callback error (attempt ${o}):`,x),s(g),i(!1),d||L.error(`Authentication failed: ${g}`),localStorage.removeItem("explainify.auth.inProgress"),localStorage.removeItem("explainify.auth.timestamp"),localStorage.removeItem("explainify.auth.state"),localStorage.removeItem("explainify.auth.startTime")}})()},[e,t,a,o,d]),d?n.jsx("div",{className:"min-h-screen flex flex-col items-center justify-center p-4 bg-gray-50 dark:bg-gray-900",children:n.jsxs("div",{className:"text-center max-w-md",children:[n.jsx("h1",{className:"text-2xl font-bold mb-4",children:"Authentication Taking Too Long"}),n.jsx("p",{className:"text-gray-600 dark:text-gray-400 mb-6",children:"Your sign-in process seems to be taking longer than expected. This might be due to temporary server issues."}),n.jsxs("div",{className:"flex flex-col gap-4",children:[n.jsxs(R,{className:"flex items-center justify-center gap-2",onClick:m,children:[n.jsx(bs,{className:"h-4 w-4"}),"Try Again"]}),n.jsx(R,{variant:"outline",onClick:()=>
476e("/auth?mode=login"),children:"Return to Login Page"})]})]})}):a?n.jsx("div",{className:"min-h-screen flex flex-col items-center justify-center p-4 bg-gray-50 dark:bg-gray-900",children:n.jsxs("div",{className:"text-center max-w-md",children:[n.jsx(gs,{className:"animate-spin h-12 w-12 text-explainify-600 mb-4 mx-auto"}),n.jsx("h1",{className:"text-2xl font-bold mb-2",children:"Completing your sign-in"}),n.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:o>1?`Attempt ${o}: Please wait while we finish authenticating your account...`:"Please wait while we finish authenticating your account..."})]})}):r?n.jsx("div",{className:"min-h-screen flex flex-col items-center justify-center p-4 bg-gray-50 dark:bg-gray-900",children:n.jsxs("div",{className:"text-center max-w-md",children:[n.jsx("h1",{className:"text-2xl font-bold text-red-600 mb-2",children:"Authentication Error"}),n.jsx("p",{className:"text-gray-600 dark:text-gray-400 mb-6",children:r}),n.jsxs("div",{className:"flex flex-col gap-4",children:[n.jsxs(R,{onClick:m,className:"flex items-center justify-center gap-2",children:[n.jsx(bs,{className:"h-4 w-4"}),"Try Again"]}),n.jsx(R,{variant:"outline",onClick:()=>
476e("/auth?mode=login"),children:"Return to Login Page"})]})]})}):n.jsx("div",{className:"min-h-screen flex flex-col items-center justify-center",children:n.jsx("div",{className:"text-center",children:n.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:"Redirecting you now..."})})})}function G_(){const e=gt(),[t,r]=f.useState(!1),[s,a]=f.useState(null),i=async()=>{r(!0);const c={supabaseConnection:!1,localStorageAccess:!1,cookiesEnabled:!1,networkConnectivity:!1};try{try{localStorage.setItem("auth-test","test");const l=localStorage.getItem("auth-test");localStorage.removeItem("auth-test"),c.localStorageAccess=l==="test"}catch(l){console.error("Local storage test failed:",l)}try{document.cookie="cookietest=1",c.cookiesEnabled=document.cookie.indexOf("cookietest=")!==-1,document.cookie="cookietest=1; expires=Thu, 01-Jan-1970 00:00:01 GMT"}catch(l){console.error("Cookie test failed:",l)}try{const l=await fetch("https://www.google.com/generate_204",{method:"HEAD",mode:"no-cors",cache:"no-store"});c.networkConnectivity=!0}catch(l){console.error("Network test failed:",l)}try{const{error:l}=await J.auth.getSession();c.supabaseConnection=!l}catch(l){console.error("Supabase connection test failed:",l)}}catch(l){console.error("Diagnostics failed:",l)}finally{a(c),r(!1)}},o=()=>{try{Object.keys(localStorage).forEach(c=>{c.startsWith("sb-")&&localStorage.removeItem(c)}),localStorage.removeItem("explainify.auth.timestamp"),document.cookie.split(";").forEach(c=>{document.cookie=c.trim().split("=")[0]+"=;expires=Thu, 01 Jan 1970 00:00:00 UTC;path=/;"}),L.success("Authentication data cleared successfully")}catch(c){console.error("Error clearing auth data:",c),L.error("Failed to clear authentication data")}},u=()=>{o(),e("/auth?mode=login")};return n.jsxs("div",{className:"min-h-screen flex flex-col bg-gray-50 dark:bg-gray-900",children:[n.jsx("header",{className:"py-6 border-b",children:n.jsxs("div",{className:"container flex justify-between items-center",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Be,{className:"h-6 w-6 text-explainify-600"}),n.jsx("span",{className:"text-xl font-semibold",children:"Explainify"})]}),n.jsxs(R,{variant:"ghost",size:"sm",onClick:()=>e(-1),children:[n.jsx(Oo,{className:"h-4 w-4 mr-2"})," Back"]})]})}),n.jsx("main",{className:"container flex-grow py-12",children:n.jsxs("div",{className:"max-w-2xl mx-auto bg-white dark:bg-gray-800 rounded-lg shadow-md p-6 md:p-8",children:[n.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[n.jsx(Ed,{className:"h-8 w-8 text-amber-500"}),n.jsx("h1",{className:"text-2xl font-bold",children:"Authentication Troubleshooter"})]}),n.jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:"If you're having trouble signing in, this page can help diagnose and fix common issues."}),n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"p-4 border rounded-md",children:[n.jsxs("h2",{className:"font-semibold mb-2 flex items-center gap-2",children:[n.jsx(Zx,{className:"h-5 w-5 text-blue-500"}),"Diagnose Issues"]}),n.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400 mb-4",children:"Run a quick check to identify potential problems with your authentication."}),n.jsx(R,{onClick:i,disabled:t,className:"w-full",children:t?n.jsxs(n.Fragment,{children:[n.jsx(bs,{className:"h-4 w-4 mr-2 animate-spin"}),"Running Diagnostics..."]}):"Run Diagnostics"}),s&&n.jsxs("div",{className:"mt-4 border-t pt-4",children:[n.jsx("h3",{className:"font-medium mb-2",children:"Diagnostic Results:"}),n.jsxs("ul",{className:"space-y-2 text-sm",children:[n.jsxs("li",{className:"flex items-center",children:[n.jsx("span",{className:`w-5 h-5 flex-shrink-0 rounded-full ${s.supabaseConnection?"bg-green-500":"bg-red-500"}`}),n.jsxs("span",{className:"ml-2",children:["Connection to authentication service: ",s.supabaseConnection?"OK":"Failed"]})]}),n.jsxs("li",{className:"flex items-center",children:[n.jsx("span",{className:`w-5 h-5 flex-shrink-0 rounded-full ${s.localStorageAccess?"bg-green-500":"bg-red-500"}`}),n.jsxs("span",{className:"ml-2",children:["Browser storage access: ",s.localStorageAccess?"OK":"Failed"]})]}),n.jsxs("li",{className:"flex items-center",children:[n.jsx("span",{className:`w-5 h-5 flex-shrink-0 rounded-full ${s.cookiesEnabled?"bg-green-500":"bg-red-500"}`}),n.jsxs("span",{className:"ml-2",children:["Cookies enabled: ",s.cookiesEnabled?"Yes":"No"]})]}),n.jsxs("li",{className:"flex items-center",children:[n.jsx("span",{className:`w-5 h-5 flex-shrink-0 rounded-full ${s.networkConnectivity?"bg-green-500":"bg-red-500"}`}),n.jsxs("span",{className:"ml-2",children:["Network connectivity: ",s.networkConnectivity?"OK":"Issues detected"]})]})]})]})]}),n.jsxs("div",{className:"p-4 border rounded-md",children:[n.jsx("h2",{className:"font-semibold mb-2",children:"Reset Authentication Data"}),n.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400 mb-4",children:"Clear all locally stored authentication data. This can help resolve issues with corrupted tokens or cookies."}),n.jsx(R,{variant:"outline",onClick:o,className:"w-full",children:"Clear Authentication Data"})]}),n.jsxs("div",{className:"p-4 border rounded-md bg-explainify-50 dark:bg-explainify-900/30",children:[n.jsx("h2",{className:"font-semibold mb-2",children:"Try Again"}),n.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400 mb-4",children:"Start with a fresh authentication attempt. This will clear existing data and redirect you to the login page."}),n.jsx(R,{onClick:u,className:"w-full",children:"Try Signing In Again"})]})]}),n.jsx("div",{className:"mt-8 pt-6 border-t text-sm text-gray-500 dark:text-gray-400",children:n.jsx("p",{children:"If you continue to experience issues, please contact support or try again later. Authentication services may be experiencing temporary disruptions."})})]})})]})}
476function W_(){try{return Object.keys(localStorage).forEach(e=>{(e.startsWith("sb-")||e.includes("auth"))&&localStorage.removeItem(e)}),document.cookie.split(";").forEach(e=>{const t=e.trim().split("=")[0];(t.includes("sb-")||t.includes("auth")||t.includes("supabase"))&&(document.cookie=`${t}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;`)}),!0}catch(e){return console.error("Error clearing auth data:",e),!1}}function Y_(){(window.location.search||window.location.hash)&&window.history.replaceState({},document.title,window.location.pathname)}function K_(){const e=gt(),t=Mt(),[r,s]=f.useState({code:"",message:"",description:""}),[a,i]=f.useState(!0);f.useEffect(()=>{const u=localStorage.getItem("explainify.auth.inProgress")==="true",c=async()=>{if(u)try{console.log("Detected in-progress authentication, checking if we can recover...");const{data:p,error:x}=await J.auth.getSession();if(!x&&(p!=null&&p.session))return console.log("Found existing session, auth completed successfully!"),L.success("Authentication completed successfully"),localStorage.removeItem("explainify.auth.inProgress"),e("/dashboard",{replace:!0}),!0;const{data:g}=await J.auth.getUser();return g!=null&&g.user?(console.log("Found user but no session, redirecting to callback page to complete auth"),e("/auth/callback",{replace:!0}),!0):(console.log("No existing auth found, proceeding with error handler"),!1)}catch(p){return console.error("Error checking auth status:",p),!1}finally{i(!1)}else return i(!1),!1},l=new URLSearchParams(t.search),d=l.get("error_code")||l.get("code")||"",h=l.get("error")||"Authentication Error",m=l.get("error_description")||l.get("description")||"An error occurred during the authentication process.";s({code:d,message:h,description:decodeURIComponent(m.replace(/\+/g," "))}),Y_(),c()},[t,e]);const o=()=>{W_(),e("/auth?mode=login")};return a?n.jsx("div",{className:"min-h-screen flex flex-col items-center justify-center bg-gray-50 dark:bg-gray-900",children:n.jsxs("div",{className:"text-center",children:[n.jsx(bs,{className:"animate-spin h-8 w-8 text-explainify-600 mb-4 mx-auto"}),n.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:"Checking authentication status..."})]})}):n.jsxs("div",{className:"min-h-screen flex flex-col bg-gray-50 dark:bg-gray-900",children:[n.jsx("header",{className:"py-6 border-b",children:n.jsxs("div",{className:"container flex justify-between items-center",children:[n.jsxs(ne,{to:"/",className:"flex items-center gap-2",children:[n.jsx(Be,{className:"h-6 w-6 text-explainify-600"}),n.jsx("span",{className:"text-xl font-semibold",children:"Explainify"})]}),n.jsxs(R,{variant:"ghost",size:"sm",onClick:()=>e(-1),children:[n.jsx(Oo,{className:"h-4 w-4 mr-2"})," Back"]})]})}),n.jsx("main",{className:"container flex-grow py-12",children:n.jsxs("div",{className:"max-w-2xl mx-auto bg-white dark:bg-gray-800 rounded-lg shadow-md p-6 md:p-8",children:[n.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[n.jsx(Ed,{className:"h-8 w-8 text-amber-500"}),n.jsx("h1",{className:"text-2xl font-bold",children:"Authentication Error"})]}),n.jsxs("div",{className:"mb-6 p-4 bg-amber-50 dark:bg-amber-900/20 rounded border-l-4 border-amber-500",children:[n.jsx("h2",{className:"font-semibold text-amber-800 dark:text-amber-300 mb-2",children:r.message}),n.jsx("p",{className:"text-amber-700 dark:text-amber-200 text-sm",children:r.description}),r.code&&n.jsxs("p",{className:"text-amber-600 dark:text-amber-300 text-xs mt-2",children:["Error code: ",r.code]})]}),n.jsx("h3",{className:"text-lg font-medium mb-3",children:"What happened?"}),n.jsx("p",{className:"text-gray-600 dark:text-gray-300 mb-6",children:r.code==="bad_oauth_state"?n.jsxs(n.Fragment,{children:["This error typically occurs when there's a mismatch in the security state between your authentication request and the response from Google. This can happen due to:",n.jsxs("ul",{className:"list-disc pl-5 mt-2 space-y-1 text-sm",children:[n.jsx("li",{children:"Browser cookie or storage limitations"}),n.jsx("li",{children:"Network interruptions during the authentication process"}),n.jsx("li",{children:"Session timeouts on the authentication server"}),n.jsx("li",{children:"Multiple sign-in attempts in different tabs or browsers"})]})]}):"An unexpected error occurred during the authentication process. This might be due to network issues, browser settings, or temporary problems with the authentication service."}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",children:[n.jsxs(R,{onClick:o,className:"flex items-center gap-2",children:[n.jsx(bs,{className:"h-4 w-4"}),"Try Again with Google"]}),n.jsx(R,{variant:"outline",onClick:()=>e("/auth/troubleshoot"),children:"Go to Troubleshooting"})]}),n.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"If the problem persists, please try signing in with email and password instead, or use the troubleshooting page to diagnose and fix authentication issues."})]})]})})]})}const jt={NA:{code:"NA",name:"North America",currencyCode:"USD",currencySymbol:"$",priceFactor:1},EU:{code:"EU",name:"Europe",currencyCode:"EUR",currencySymbol:"€",priceFactor:.9},UK:{code:"UK",name:"United Kingdom",currencyCode:"GBP",currencySymbol:"£",priceFactor:.85},IN:{code:"IN",name:"India",currencyCode:"INR",currencySymbol:"₹",priceFactor:.7},NG:{code:"NG",name:"Nigeria",currencyCode:"NGN",currencySymbol:"₦",priceFactor:.7},BR:{code:"BR",name:"Brazil",currencyCode:"BRL",currencySymbol:"R$",priceFactor:.6},GLOBAL:{code:"GLOBAL",name:"Global",currencyCode:"USD",currencySymbol:"$",priceFactor:.7}},un=jt.GLOBAL;async function K0(){try{const r=(await(await fetch("https://ipapi.co/json/")).json()).country_code;return r==="US"||r==="CA"||r==="MX"?jt.NA:["GB","UK"].includes(r)?jt.UK:["DE","FR","IT","ES","NL","BE","AT","CH","SE","DK","FI","NO"].includes(r)?jt.EU:r==="IN"?jt.IN:r==="NG"?jt.NG:r==="BR"?jt.BR:jt.GLOBAL}catch(e){return console.error("Error detecting region:",e),un}}function Q0(e,t){const r={USD:{EUR:.92,GBP:.79,INR:83.2,NGN:1550,BRL:5.6}};return e===t?1:r[e]&&r[e][t]?r[e][t]:1}function Q_(e,t){const r=e*t.priceFactor;let s=r;if(t.currencyCode!=="USD"){const i=Q0("USD",t.currencyCode);s=r*i}let a;switch(t.currencyCode){case"INR":a=Math.round(s/10)*10+"";break;case"NGN":a=Math.round(s/100)*100+"";break;default:a=s.toFixed(2)}return["NGN","INR"].includes(t.currencyCode)&&(a=parseInt(a).toLocaleStr
476ing("en-US")),`${t.currencySymbol}${a}`}function J_(e,t){const r=e*t.priceFactor;if(t.currencyCode!=="USD"){const s=Q0("USD",t.currencyCode);return r*s}return r}const Ae=[];for(let e=0;e<256;++e)Ae.push((e+256).toString(16).slice(1));function Z_(e,t=0){return(Ae[e[t+0]]+Ae[e[t+1]]+Ae[e[t+2]]+Ae[e[t+3]]+"-"+Ae[e[t+4]]+Ae[e[t+5]]+"-"+Ae[e[t+6]]+Ae[e[t+7]]+"-"+Ae[e[t+8]]+Ae[e[t+9]]+"-"+Ae[e[t+10]]+Ae[e[t+11]]+Ae[e[t+12]]+Ae[e[t+13]]+Ae[e[t+14]]+Ae[e[t+15]]).toLowerCase()}let $i;const X_=new Uint8Array(16);function ek(){if(!$i){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");$i=crypto.getRandomValues.bind(crypto)}return $i(X_)}const tk=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),xl={randomUUID:tk};function rk(e,t,r){var a;if(xl.randomUUID&&!t&&!e)return xl.randomUUID();e=e||{};const s=e.random??((a=e.rng)==null?void 0:a.call(e))??ek();if(s.length<16)throw new Error("Random bytes length must be >= 16");return s[6]=s[6]&15|64,s[8]=s[8]&63|128,Z_(s)}const sk={starter:{id:"starter",name:"Starter Plan",price:500},pro:{id:"pro",name:"Pro Plan",price:1e3},teams:{id:"teams",name:"Teams Plan",price:2500}};function nk(e,t){const r=e/100,s=J_(r,t);if(t.currencyCode==="USD")return Math.round(s*100);{const a={EUR:100,GBP:100,INR:100,NGN:100,BRL:100}[t.currencyCode]||100;return Math.round(s*a)}}async function ak({userId:e,planType:t,transactionId:r,amount:s,currency:a,regionCode:i}){try{const o=new Date,u=new Date(o.getTime()+30*24*60*60*1e3),c=t.charAt(0).toUpperCase()+t.slice(1);let l=-1;c==="Starter"?l=100:c==="Pro"?l=1e3:c==="Teams"&&(l=5e3);const{error:d}=await J.from("profiles").update({subscription_tier:c,subscription_status:"active",is_trial_active:!1,trial_end_date:o.toISOString(),subscription_start_date:o.toISOString(),subscription_end_date:u.toISOString(),last_payment_date:o.toISOString()}).eq("id",e);if(d)return console.error("Error updating profile:",d),{success:!1,message:"Failed to update subscription information"};const{error:h}=await J.from("user_usage").update({messages_limit:l,messages_used:0,reset_date:u.toISOString()}).eq("id",e);if(h)try{await J.from("user_usage").insert({id:e,messages_limit:l,messages_used:0,reset_date:u.toISOString(),created_at:o.toISOString(),last_updated:o.toISOString()})}catch(p){return console.error("Error creating usage record:",p),{success:!1,message:"Failed to set usage limits"}}const{error:m}=await J.from("subscriptions").upsert({user_id:e,plan_type:c,status:"active",start_date:o.toISOString(),end_date:u.toISOString(),last_payment_id:r,last_payment_date:o.toISOString(),amount:s,currency:a,region_code:i||"GLOBAL",payment_method:"card",payment_status:"success"});return m?(console.error("Error recording subscription:",m),{success:!1,message:"Failed to record subscription details"}):{success:!0}}catch(o){return console.error("Error updating subscription:",o),{success:!1,message:"Failed to update subscription"}}}const ik=["NGN","USD","GHS","ZAR","KES"];async function ok(e,t,r,s=un){const{data:{session:a}}=await J.auth.getSession();if(!a)throw new Error("User is not authenticated");const i=sk[e];if(!i)throw new Error("Invalid plan ID");const o=nk(i.price,s),u=`EXP-${rk()}`;let c=s.currencyCode;return ik.includes(c)||(c="USD"),{tx_ref:u,amount:Math.round(o),currency:c,email:t,metadata:{user_id:a.user.id,plan_type:i.id,name:r,region_code:s.code,custom_fields:[{display_name:"Plan Type",variable_name:"plan_type",value:i.name}]},callback_url:`${window.location.origin}/payment/success`,onClose:()=>{console.log("Payment closed")}}}async function uk(e){try{return{status:!0,message:"Verification successful",data:{reference:e,status:"success"}}}catch(t){throw console.error("Payment verification error:",t),new Error("Failed to verify payment")}}function gl(e="test"){return{test:"https://paystack.com/pay/1u5ylj7v63",live:"https://paystack.com/pay/et019u2gsv"}[e]}function ck(e){const[t,r]=f.useState("loading");return f.useEffect(()=>{let s=document.querySelector(`script[src="${e}"]`);if(s){const i=s.getAttribute("data-status");i&&r(i)}else{s=document.createElement("script"),s.src=e,s.async=!0,s.setAttribute("data-status","loading"),document.body.appendChild(s);const i=o=>{s==null||s.setAttribute("data-status",o.type==="load"?"ready":"error")};s.addEventListener("load",i),s.addEventListener("error",i)}const a=i=>{r(i.type==="load"?"ready":"error")};return s.addEventListener("load",a),s.addEventListener("error",a),()=>{s&&(s.removeEventListener("load",a),s.removeEventListener("error",a))}},[e]),t}function lk({planId:e,variant:t="default",className:r="",region:s,useDirectLink:a=!1,environment:i="test"}){const[o,u]=f.useState(!1),[c,l]=f.useState(null),d=f.useRef(!1),h=ck("https://js.paystack.co/v1/inline.js"),m=()=>h==="ready"&&typeof window<"u"&&window.PaystackPop!==void 0;f.useEffect(()=>{if(h==="ready"&&!d.current){const g=setTimeout(()=>{d.current=!0,u(!1)},500);return()=>clearTimeout(g)}},[h]),f.useEffect(()=>{async function g(){try{if(s)l(s);else{const b=await K0();l(b)}}catch(b){console.error("Error detecting region:",b),l(un)}}g()},[s]);const p=async()=>{var g;try{u(!0);const{data:{user:b}}=await J.auth.getUser();if(!b){window.location.href="/auth?mode=login";return}if(a){window.location.href=gl(i);return}if(!m()){const y=document.createElement("script");y.src="https://js.paystack.co/v1/inline.js",y.async=!0,document.body.appendChild(y),L.error("Payment provider is not ready. Please refresh the page and try again."),u(!1);return}const v=await ok(e,b.email||"",(g=b.user_metadata)!=null&&g.first_name?`${b.user_metadata.first_name} ${b.user_metadata.last_name||""}`:b.email||"",c||un);try{new window.PaystackPop().newTransaction({key:"pk_test_f831a248896c91f39d93d16afdc4ac21ad26a373",email:v.email,amount:v.amount,currency:v.currency,ref:v.tx_ref,metadata:v.metadata,callback:function(w){
vendor: 4,144 bytes, line 476
476window.location.href=`${v.callback_url}?reference=${w.reference}&tx_ref=${v.tx_ref}`},onClose:function(){u(!1),L.info("Payment cancelled",{description:"You can try again whenever you're ready."})}})}catch(y){console.error("Paystack initialization error:",y),L.error("Could not initialize payment popup. Redirecting to payment page..."),setTimeout(()=>{window.location.href=gl(i)},2e3)}}catch(b){console.error("Payment initialization error:",b),L.error(b.message||"Could not initialize payment"),u(!1)}},x=o||!c||!d.current||h!=="ready";return n.jsx(R,{variant:t,className:r,onClick:p,disabled:x,children:o?n.jsxs(n.Fragment,{children:[n.jsx(Rt,{className:"mr-2 h-4 w-4 animate-spin"}),"Processing..."]}):x?n.jsxs(n.Fragment,{children:[n.jsx(Rt,{className:"mr-2 h-4 w-4 animate-spin"}),"Loading..."]}):n.jsx(n.Fragment,{children:"Subscribe"})})}function bl(e,[t,r]){return Math.min(r,Math.max(t,e))}function J0(e){const t=f.useRef({value:e,previous:e});return f.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var dk=[" ","Enter","ArrowUp","ArrowDown"],fk=[" ","Enter"],Nn="Select",[si,ni,hk]=ka(Nn),[$s,t5]=kr(Nn,[hk,Rs]),ai=Rs(),[mk,jr]=$s(Nn),[pk,xk]=$s(Nn),Z0=e=>{const{__scopeSelect:t,children:r,open:s,defaultOpen:a,onOpenChange:i,value:o,defaultValue:u,onValueChange:c,dir:l,name:d,autoComplete:h,disabled:m,required:p,form:x}=e,g=ai(t),[b,v]=f.useState(null),[y,w]=f.useState(null),[_,k]=f.useState(!1),N=Ha(l),[j=!1,C]=Vt({prop:s,defaultProp:a,onChange:i}),[I,A]=Vt({prop:o,defaultProp:u,onChange:c}),F=f.useRef(null),E=b?x||!!b.closest("form"):!0,[U,P]=f.useState(new Set),Y=Array.from(U).map(M=>M.props.value).join(";");return n.jsx(tu,{...g,children:n.jsxs(mk,{required:p,scope:t,trigger:b,onTriggerChange:v,valueNode:y,onValueNodeChange:w,valueNodeHasChildren:_,onValueNodeHasChildrenChange:k,contentId:ht(),value:I,onValueChange:A,open:j,onOpenChange:C,dir:N,triggerPointerDownPosRef:F,disabled:m,children:[n.jsx(si.Provider,{scope:t,children:n.jsx(pk,{scope:e.__scopeSelect,onNativeOptionAdd:f.useCallback(M=>{P(Q=>new Set(Q).add(M))},[]),onNativeOptionRemove:f.useCallback(M=>{P(Q=>{const S=new Set(Q);return S.delete(M),S})},[]),children:r})}),E?n.jsxs(km,{"aria-hidden":!0,required:p,tabIndex:-1,name:d,autoComplete:h,value:I,onChange:M=>A(M.target.value),disabled:m,form:x,children:[I===void 0?n.jsx("option",{value:""}):null,Array.from(U)]},Y):null]})})};Z0.displayName=Nn;var X0="SelectTrigger",em=f.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:s=!1,...a}=e,i=ai(r),o=jr(X0,r),u=o.disabled||s,c=he(t,o.onTriggerChange),l=ni(r),d=f.useRef("touch"),[h,m,p]=jm(g=>{const b=l().filter(w=>!w.disabled),v=b.find(w=>w.value===o.value),y=Nm(b,g,v);y!==void 0&&o.onValueChange(y.value)}),x=g=>{u||(o.onOpenChange(!0),p()),g&&(o.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)})};return n.jsx(ru,{asChild:!0,...i,children:n.jsx(re.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":_m(o.value)?"":void 0,...a,ref:c,onClick:H(a.onClick,g=>{g.currentTarget.focus(),d.current!=="mouse"&&x(g)}),onPointerDown:H(a.onPointerDown,g=>{d.current=g.pointerType;const b=g.target;b.hasPointerCapture(g.pointerId)&&b.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&g.pointerType==="mouse"&&(x(g),g.preventDefault())}),onKeyDown:H(a.onKeyDown,g=>{const b=h.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&m(g.key),!(b&&g.key===" ")&&dk.includes(g.key)&&(x(),g.preventDefault())})})})});em.displayName=X0;var tm="SelectValue",rm=f.forwardRef((e,t)=>{const{__scopeSelect:r,className:s,style:a,children:i,placeholder:o="",...u}=e,c=jr(tm,r),{onValueNodeHasChildrenChange:l}=c,d=i!==void 0,h=he(t,c.onValueNodeChange);return Me(()=>{l(d)},[l,d]),n.jsx(re.span,{...u,ref:h,style:{pointerEvents:"none"},children:_m(c.value)?n.jsx(n.Fragment,{children:o}):i})});rm.displayName=tm;var gk="SelectIcon",sm=f.forwardRef((e,t)=>
vendor: 15,054 bytes, line 476
476{const{__scopeSelect:r,children:s,...a}=e;return n.jsx(re.span,{"aria-hidden":!0,...a,ref:t,children:s||"▼"})});sm.displayName=gk;var bk="SelectPortal",nm=e=>n.jsx(pn,{asChild:!0,...e});nm.displayName=bk;var Or="SelectContent",am=f.forwardRef((e,t)=>{const r=jr(Or,e.__scopeSelect),[s,a]=f.useState();if(Me(()=>{a(new DocumentFragment)},[]),!r.open){const i=s;return i?Cs.createPortal(n.jsx(im,{scope:e.__scopeSelect,children:n.jsx(si.Slot,{scope:e.__scopeSelect,children:n.jsx("div",{children:e.children})})}),i):null}return n.jsx(om,{...e,ref:t})});am.displayName=Or;var ct=10,[im,Nr]=$s(Or),yk="SelectContentImpl",om=f.forwardRef((e,t)=>{const{__scopeSelect:r,position:s="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:i,onPointerDownOutside:o,side:u,sideOffset:c,align:l,alignOffset:d,arrowPadding:h,collisionBoundary:m,collisionPadding:p,sticky:x,hideWhenDetached:g,avoidCollisions:b,...v}=e,y=jr(Or,r),[w,_]=f.useState(null),[k,N]=f.useState(null),j=he(t,q=>_(q)),[C,I]=f.useState(null),[A,F]=f.useState(null),E=ni(r),[U,P]=f.useState(!1),Y=f.useRef(!1);f.useEffect(()=>{if(w)return mu(w)},[w]),hu();const M=f.useCallback(q=>{const[ee,...se]=E().map(fe=>fe.ref.current),[X]=se.slice(-1),ce=document.activeElement;for(const fe of q)if(fe===ce||(fe==null||fe.scrollIntoView({block:"nearest"}),fe===ee&&k&&(k.scrollTop=0),fe===X&&k&&(k.scrollTop=k.scrollHeight),fe==null||fe.focus(),document.activeElement!==ce))return},[E,k]),Q=f.useCallback(()=>M([C,w]),[M,C,w]);f.useEffect(()=>{U&&Q()},[U,Q]);const{onOpenChange:S,triggerPointerDownPosRef:T}=y;f.useEffect(()=>{if(w){let q={x:0,y:0};const ee=X=>{var ce,fe;q={x:Math.abs(Math.round(X.pageX)-(((ce=T.current)==null?void 0:ce.x)??0)),y:Math.abs(Math.round(X.pageY)-(((fe=T.current)==null?void 0:fe.y)??0))}},se=X=>{q.x<=10&&q.y<=10?X.preventDefault():w.contains(X.target)||S(!1),document.removeEventListener("pointermove",ee),T.current=null};return T.current!==null&&(document.addEventListener("pointermove",ee),document.addEventListener("pointerup",se,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ee),document.removeEventListener("pointerup",se,{capture:!0})}}},[w,S,T]),f.useEffect(()=>{const q=()=>S(!1);return window.addEventListener("blur",q),window.addEventListener("resize",q),()=>{window.removeEventListener("blur",q),window.removeEventListener("resize",q)}},[S]);const[O,$]=jm(q=>{const ee=E().filter(ce=>!ce.disabled),se=ee.find(ce=>ce.ref.current===document.activeElement),X=Nm(ee,q,se);X&&setTimeout(()=>X.ref.current.focus())}),G=f.useCallback((q,ee,se)=>{const X=!Y.current&&!se;(y.value!==void 0&&y.value===ee||X)&&(I(q),X&&(Y.current=!0))},[y.value]),Z=f.useCallback(()=>w==null?void 0:w.focus(),[w]),te=f.useCallback((q,ee,se)=>{const X=!Y.current&&!se;(y.value!==void 0&&y.value===ee||X)&&F(q)},[y.value]),z=s==="popper"?jo:um,K=z===jo?{side:u,sideOffset:c,align:l,alignOffset:d,arrowPadding:h,collisionBoundary:m,collisionPadding:p,sticky:x,hideWhenDetached:g,avoidCollisions:b}:{};return n.jsx(im,{scope:r,content:w,viewport:k,onViewportChange:N,itemRefCallback:G,selectedItem:C,onItemLeave:Z,itemTextRefCallback:te,focusSelectedItem:Q,selectedItemText:A,position:s,isPositioned:U,searchRef:O,children:n.jsx(Ka,{as:pr,allowPinchZoom:!0,children:n.jsx(Va,{asChild:!0,trapped:y.open,onMountAutoFocus:q=>{q.preventDefault()},onUnmountAutoFocus:H(a,q=>{var ee;(ee=y.trigger)==null||ee.focus({preventScroll:!0}),q.preventDefault()}),children:n.jsx(Ss,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:q=>q.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:n.jsx(z,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:q=>q.preventDefault(),...v,...K,onPlaced:()=>P(!0),ref:j,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:H(v.onKeyDown,q=>{const ee=q.ctrlKey||q.altKey||q.metaKey;if(q.key==="Tab"&&q.preventDefault(),!ee&&q.key.length===1&&$(q.key),["ArrowUp","ArrowDown","Home","End"].includes(q.key)){let X=E().filter(ce=>!ce.disabled).map(ce=>ce.ref.current);if(["ArrowUp","End"].includes(q.key)&&(X=X.slice().reverse()),["ArrowUp","ArrowDown"].includes(q.key)){const ce=q.target,fe=X.indexOf(ce);X=X.slice(fe+1)}setTimeout(()=>M(X)),q.preventDefault()}})})})})})})});om.displayName=yk;var vk="SelectItemAlignedPosition",um=f.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:s,...a}=e,i=jr(Or,r),o=Nr(Or,r),[u,c]=f.useState(null),[l,d]=f.useState(null),h=he(t,j=>d(j)),m=ni(r),p=f.useRef(!1),x=f.useRef(!0),{viewport:g,selectedItem:b,selectedItemText:v,focusSelectedItem:y}=o,w=f.useCallback(()=>{if(i.trigger&&i.valueNode&&u&&l&&g&&b&&v){const j=i.trigger.getBoundingClientRect(),C=l.getBoundingClientRect(),I=i.valueNode.getBoundingClientRect(),A=v.getBoundingClientRect();if(i.dir!=="rtl"){const ce=A.left-C.left,fe=I.left-ce,Oe=j.left-fe,We=j.width+Oe,Kt=Math.max(We,C.width),tt=window.innerWidth-ct,Cr=bl(fe,[ct,Math.max(ct,tt-Kt)]);u.style.minWidth=We+"px",u.style.left=Cr+"px"}else{const ce=C.right-A.right,fe=window.innerWidth-I.right-ce,Oe=window.innerWidth-j.right-fe,We=j.width+Oe,Kt=Math.max(We,C.width),tt=window.innerWidth-ct,Cr=bl(fe,[ct,Math.max(ct,tt-Kt)]);u.style.minWidth=We+"px",u.style.right=Cr+"px"}const F=m(),E=window.innerHeight-ct*2,U=g.scrollHeight,P=window.getComputedStyle(l),Y=parseInt(P.borderTopWidth,10),M=parseInt(P.paddingTop,10),Q=parseInt(P.borderBottomWidth,10),S=parseInt(P.paddingBottom,10),T=Y+M+U+S+Q,O=Math.min(b.offsetHeight*5,T),$=window.getComputedStyle(g),G=parseInt($.paddingTop,10),Z=parseInt($.paddingBottom,10),te=j.top+j.height/2-ct,z=E-te,K=b.offsetHeight/2,q=b.offsetTop+K,ee=Y+M+q,se=T-ee;if(ee<=te){const ce=F.length>0&&b===F[F.length-1].ref.current;u.style.bottom="0px";const fe=l.clientHeight-g.offsetTop-g.offsetHeight,Oe=Math.max(z,K+(ce?Z:0)+fe+Q),We=ee+Oe;u.style.height=We+"px"}else{const ce=F.length>0&&b===F[0].ref.current;u.style.top="0px";const Oe=Math.max(te,Y+g.offsetTop+(ce?G:0)+K)+se;u.style.height=Oe+"px",g.scrollTop=ee-te+g.offsetTop}u.style.margin=`${ct}px 0`,u.style.minHeight=O+"px",u.style.maxHeight=E+"px",s==null||s(),requestAnimationFrame(()=>p.current=!0)}},[m,i.trigger,i.valueNode,u,l,g,b,v,i.dir,s]);Me(()=>w(),[w]);const[_,k]=f.useState();Me(()=>{l&&k(window.getComputedStyle(l).zIndex)},[l]);const N=f.useCallback(j=>{j&&x.current===!0&&(w(),y==null||y(),x.current=!1)},[w,y]);return n.jsx(_k,{scope:r,contentWrapper:u,shouldExpandOnScrollRef:p,onScrollButtonChange:N,children:n.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:_},children:n.jsx(re.div,{...a,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});um.displayName=vk;var wk="SelectPopperPosition",jo=f.forwardRef((e,t)=>{const{__scopeSelect:r,align:s="start",collisionPadding:a=ct,...i}=e,o=ai(r);return n.jsx(su,{...o,...i,ref:t,align:s,collisionPadding:a,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});jo.displayName=wk;var[_k,Uu]=$s(Or,{}),No="SelectViewport",cm=f.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:s,...a}=e,i=Nr(No,r),o=Uu(No,r),u=he(t,i.onViewportChange),c=f.useRef(0);return n.jsxs(n.Fragment,{children:[n.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),n.jsx(si.Slot,{scope:r,children:n.jsx(re.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:H(a.onScroll,l=>{const d=l.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:m}=o;if(m!=null&&m.current&&h){const p=Math.abs(c.current-d.scrollTop);if(p>0){const x=window.innerHeight-ct*2,g=parseFloat(h.style.minHeight),b=parseFloat(h.style.height),v=Math.max(g,b);if(v<x){const y=v+p,w=Math.min(x,y),_=y-w;h.style.height=w+"px",h.style.bottom==="0px"&&(d.scrollTop=_>0?_:0,h.style.justifyContent="flex-end")}}}c.current=d.scrollTop})})})]})});cm.displayName=No;var lm="SelectGroup",[kk,jk]=$s(lm),Nk=f.forwardRef((e,t)=>{const{__scopeSelect:r,...s}=e,a=ht();return n.jsx(kk,{scope:r,id:a,children:n.jsx(re.div,{role:"group","aria-labelledby":a,...s,ref:t})})});Nk.displayName=lm;var dm="SelectLabel",fm=f.forwardRef((e,t)=>{const{__scopeSelect:r,...s}=e,a=jk(dm,r);return n.jsx(re.div,{id:a.id,...s,ref:t})});fm.displayName=dm;var xa="SelectItem",[Ck,hm]=$s(xa),mm=f.forwardRef((e,t)=>{const{__scopeSelect:r,value:s,disabled:a=!1,textValue:i,...o}=e,u=jr(xa,r),c=Nr(xa,r),l=u.value===s,[d,h]=f.useState(i??""),[m,p]=f.useState(!1),x=he(t,y=>{var w;return(w=c.itemRefCallback)==null?void 0:w.call(c,y,s,a)}),g=ht(),b=f.useRef("touch"),v=()=>{a||(u.onValueChange(s),u.onOpenChange(!1))};if(s==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return n.jsx(Ck,{scope:r,value:s,disabled:a,textId:g,isSelected:l,onItemTextChange:f.useCallback(y=>{h(w=>w||((y==null?void 0:y.textContent)??"").trim())},[]),children:n.jsx(si.ItemSlot,{scope:r,value:s,disabled:a,textValue:d,children:n.jsx(re.div,{role:"option","aria-labelledby":g,"data-highlighted":m?"":void 0,"aria-selected":l&&m,"data-state":l?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...o,ref:x,onFocus:H(o.onFocus,()=>p(!0)),onBlur:H(o.onBlur,()=>p(!1)),onClick:H(o.onClick,()=>{b.current!=="mouse"&&v()}),onPointerUp:H(o.onPointerUp,()=>{b.current==="mouse"&&v()}),onPointerDown:H(o.onPointerDown,y=>{b.current=y.pointerType}),onPointerMove:H(o.onPointerMove,y=>{var w;b.current=y.pointerType,a?(w=c.onItemLeave)==null||w.call(c):b.current==="mouse"&&y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:H(o.onPointerLeave,y=>{var w;y.currentTarget===document.activeElement&&((w=c.onItemLeave)==null||w.call(c))}),onKeyDown:H(o.onKeyDown,y=>{var _;((_=c.searchRef)==null?void 0:_.current)!==""&&y.key===" "||(fk.includes(y.key)&&v(),y.key===" "&&y.preventDefault())})})})})});mm.displayName=xa;var Ys="SelectItemText",pm=f.forwardRef((e,t)=>{const{__scopeSelect:r,className:s,style:a,...i}=e,o=jr(Ys,r),u=Nr(Ys,r),c=hm(Ys,r),l=xk(Ys,r),[d,h]=f.useState(null),m=he(t,v=>h(v),c.onItemTextChange,v=>{var y;return(y=u.itemTextRefCallback)==null?void 0:y.call(u,v,c.value,c.disabled)}),p=d==null?void 0:d.textContent,x=f.useMemo(()=>n.jsx("option",{value:c.value,disabled:c.disabled,children:p},c.value),[c.disabled,c.value,p]),{onNativeOptionAdd:g,onNativeOptionRemove:b}=l;return Me(()=>(g(x),()=>b(x)),[g,b,x]),n.jsxs(n.Fragment,{children:[n.jsx(re.span,{id:c.textId,...i,ref:m}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Cs.createPortal(i.children,o.valueNode):null]})});pm.displayName=Ys;var xm="SelectItemIndicator",gm=f.forwardRef((e,t)=>{const{__scopeSelect:r,...s}=e;return hm(xm,r).isSelected?n.jsx(re.span,{"aria-hidden":!0,...s,ref:t}):null});gm.displayName=xm;var Co="SelectScrollUpButton",bm=f.forwardRef((e,t)=>{const r=Nr(Co,e.__scopeSelect),s=Uu(Co,e.__scopeSelect),[a,i]=f.useState(!1),o=he(t,s.onScrollButtonChange);return Me(()=>{if(r.viewport&&r.isPositioned){let u=function(){const l=c.scrollTop>0;i(l)};const c=r.viewport;return u(),c.addEventListener("scroll",u),()=>c.removeEventListener("scroll",u)}},[r.viewport,r.isPositioned]),a?n.jsx(vm,{...e,ref:o,onAutoScroll:()=>{const{viewport:u,selectedItem:c}=r;u&&c&&(u.scrollTop=u.scrollTop-c.offsetHeight)}}):null});bm.displayName=Co;var So="SelectScrollDownButton",ym=f.forwardRef((e,t)=>{const r=Nr(So,e.__scopeSelect),s=Uu(So,e.__scopeSelect),[a,i]=f.useState(!1),o=he(t,s.onScrollButtonChange);return Me(()=>{if(r.viewport&&r.isPositioned){let u=function(){const l=c.scrollHeight-c.clientHeight,d=Math.ceil(c.scrollTop)<l;i(d)};const c=r.viewport;return u(),c.addEventListener("scroll",u),()=>c.removeEventListener("scroll",u)}},[r.viewport,r.isPositioned]),a?n.jsx(vm,{...e,ref:o,onAutoScroll:()=>{const{viewport:u,selectedItem:c}=r;u&&c&&(u.scrollTop=u.scrollTop+c.offsetHeight)}}):null});ym.displayName=So;var vm=f.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:s,...a}=e,i=Nr("SelectScrollButton",r),o=f.useRef(null),u=ni(r),c=f.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return f.useEffect(()=>()=>c(),[c]),Me(()=>{var d;const l=u().find(h=>h.ref.current===document.activeElement);(d=l==null?void 0:l.ref.current)==null||d.scrollIntoView({block:"nearest"})},[u]),n.jsx(re.div,{"aria-hidden":!0,...a,ref:t,style:{flexShrink:0,...a.style},onPointerDown:H(a.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(s,50))}),onPointerMove:H(a.onPointerMove,()=>{var l;(l=i.onItemLeave)==null||l.call(i),o.current===null&&(o.current=window.setInterval(s,50))}),onPointerLeave:H(a.onPointerLeave,()=>{c()})})}),Sk="SelectSeparator",wm=f.forwardRef((e,t)=>{const{__scopeSelect:r,...s}=e;return n.jsx(re.div,{"aria-hidden":!0,...s,ref:t})});wm.displayName=Sk;var Eo="SelectArrow",Ek=f.forwardRef((e,t)=>{const{__scopeSelect:r,...s}=e,a=ai(r),i=jr(Eo,r),o=Nr(Eo,r);return i.open&&o.position==="popper"?n.jsx(nu,{...a,...s,ref:t}):null});Ek.displayName=Eo;function _m(e){return e===""||e===void 0}var km=f.forwardRef((e,t)=>{const{value:r,...s}=e,a=f.useRef(null),i=he(t,a),o=J0(r);return f.useEffect(()=>{const u=a.current,c=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(c,"value").set;if(o!==r&&d){const h=new Event("change",{bubbles:!0});d.call(u,r),u.dispatchEvent(h)}},[o,r]),n.jsx(xn,{asChild:!0,children:n.jsx("select",{...s,ref:i,defaultValue:r})})});km.displayName="BubbleSelect";function jm(e){const t=Fe(e),r=f.useRef(""),s=f.useRef(0),a=f.useCallback(o=>{const u=r.current+o;t(u),function c(l){r.current=l,window.clearTimeout(s.current),l!==""&&(s.current=window.setTimeout(()=>c(""),1e3))}(u)},[t]),i=f.useCallback(()=>{r.current="",window.clearTimeout(s.current)},[]);return f.useEffect(()=>()=>window.clearTimeout(s.current),[]),[r,a,i]}function Nm(e,t,r){const a=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,i=r?e.indexOf(r):-1;let o=Tk(e,Math.max(i,0));a.length===1&&(o=o.filter(l=>l!==r));const c=o.find(l=>l.textValue.toLowerCase().startsWith(a.toLowerCase()));return c!==r?c:void 0}function Tk(e,t){return e.map((r,s)=>e[(t+s)%e.length])}var Ak=Z0,Cm=em,Pk=rm,Dk=sm,Rk=nm,Sm=am,Ik=cm,Em=fm,Tm=mm,Fk=pm,Mk=gm,Am=bm,Pm=ym,Dm=wm;const Ok=Ak,Lk=Pk,Rm=f.forwardRef(({className:e,children:t,...r},s)=>n.jsxs(Cm,{ref:s,className:V("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm r
476ing-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[t,n.jsx(Dk,{asChild:!0,children:n.jsx(Uo,{className:"h-4 w-4 opacity-50"})})]}));Rm.displayName=Cm.displayName;const Im=f.forwardRef(({className:e,...t},r)=>n.jsx(Am,{ref:r,className:V("flex cursor-default items-center justify-center py-1",e),...t,children:n.jsx(Gx,{className:"h-4 w-4"})}));Im.displayName=Am.displayName;const Fm=f.forwardRef(({className:e,...t},r)=>n.jsx(Pm,{ref:r,className:V("flex cursor-default items-center justify-center py-1",e),...t,children:n.jsx(Uo,{className:"h-4 w-4"})}));Fm.displayName=Pm.displayName;const Mm=f.forwardRef(({className:e,children:t,position:r="popper",...s},a)=>n.jsx(Rk,{children:n.jsxs(Sm,{ref:a,className:V("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...s,children:[n.jsx(Im,{}),n.jsx(Ik,{className:V("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),n.jsx(Fm,{})]})}));Mm.displayName=Sm.displayName;const $k=f.forwardRef(({className:e,...t},r)=>n.jsx(Em,{ref:r,className:V("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));$k.displayName=Em.displayName;const Om=f.forwardRef(({className:e,children:t,...r},s)=>n.jsxs(Tm,{ref:s,className:V("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[n.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:n.jsx(Mk,{children:n.jsx($o,{className:"h-4 w-4"})})}),n.jsx(Fk,{children:t})]}));Om.displayName=Tm.displayName;const Uk=f.forwardRef(({className:e,...t},r)=>n.jsx(Dm,{ref:r,className:V("-mx-1 my-1 h-px bg-muted",e),...t}));Uk.displayName=Dm.displayName;const zk=Es("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"}}),Lr=f.forwardRef(({className:e,variant:t,...r},s)=>n.jsx("div",{ref:s,role:"alert",className:V(zk({variant:t}),e),...r}));Lr.displayName="Alert";const zu=f.forwardRef(({className:e,...t},r)=>n.jsx("h5",{ref:r,className:V("mb-1 font-medium leading-none tracking-tight",e),...t}));zu.displayName="AlertTitle";const $r=f.forwardRef(({className:e,...t},r)=>n.jsx("div",{ref:r,className:V("text-sm [&_p]:leading-relaxed",e),...t}));$r.displayName="AlertDescription";const Bk=()=>{f.useState(!1);const[e,t]=f.useState(null),[r,s]=f.useState(!0),{exploredFeatures:a,allFeaturesExplored:i,hasCompletedExploration:o,completeExploration:u,resetExploredFeatures:c,isFirstTimeUser:l}=Ls();f.useEffect(()=>{async function p(){try{const x=await K0();t(x)}catch(x){console.error("Error detecting region:",x),t(un)}finally{s(!1)}}p()},[]),f.useEffect(()=>{i&&!o&&u()},[i,o,u]);const d=p=>e?Q_(p,e):`$${p}`;if(!i&&l&&!o)return n.jsxs("div",{className:"min-h-screen bg-gradient-to-b from-white to-explainify-50 dark:from-gray-900 dark:to-gray-950",children:[n.jsx(_s,{}),n.jsxs("div",{className:"container py-20 max-w-4xl mx-auto",children:[n.jsxs(Lr,{className:"mb-8 bg-yellow-50 dark:bg-yellow-900/20 border-yellow-200 dark:border-yellow-800",children:[n.jsx(Xe,{className:"h-5 w-5 text-yellow-600 dark:text-yellow-500"}),n.jsx(zu,{className:"text-xl font-bold text-yellow-800 dark:text-yellow-400",children:"Please explore our features first"}),n.jsx($r,{className:"text-yellow-700 dark:text-yellow-300",children:"To ensure you get the most value from our platform, we recommend trying out our core features before reviewing pricing options."})]}),n.jsxs("div",{className:"grid md:grid-cols-3 gap-6",children:[n.jsxs(de,{className:`border-${a["ai-tutor"]?"green-500":"gray-300"} ${a["ai-tutor"]?"bg-green-50 dark:bg-green-900/20":""}`,children:[n.jsxs(Ce,{children:[n.jsx(Se,{children:"AI Tutor"}),n.jsx(at,{children:"Interactive learning with our AI assistant"})]}),n.jsx(ve,{children:n.jsx("div",{className:"flex justify-center py-4",children:a["ai-tutor"]?n.jsx(Ht,{className:"h-10 w-10 text-green-500"}):n.jsx(Vs,{className:"h-10 w-10 text-gray-400"})})}),n.jsx(At,{children:n.jsx(R,{asChild:!0,variant:"outline",className:"w-full",children:n.jsx(ne,{to:"/ai-tutor",children:"Try AI Tutor"})})})]}),n.jsxs(de,{className:`border-${a["question-solver"]?"green-500":"gray-300"} ${a["question-solver"]?"bg-green-50 dark:bg-green-900/20":""}`,children:[n.jsxs(Ce,{children:[n.jsx(Se,{children:"Question Solver"}),n.jsx(at,{children:"Get step-by-step solutions to problems"})]}),n.jsx(ve,{children:n.jsx("div",{className:"flex justify-center py-4",children:a["question-solver"]?n.jsx(Ht,{className:"h-10 w-10 text-green-500"}):n.jsx(Vs,{className:"h-10 w-10 text-gray-400"})})}),n.jsx(At,{children:n.jsx(R,{asChild:!0,variant:"outline",className:"w-full",children:n.jsx(ne,{to:"/question-solver",children:"Try Question Solver"})})})]}),n.jsxs(de,{className:`border-${a["content-tools"]?"green-500":"gray-300"} ${a["content-tools"]?"bg-green-50 dark:bg-green-900/20":""}`,children:[n.jsxs(Ce,{children:[n.jsx(Se,{children:"Content Tools"}),n.jsx(at,{children:"Process PDFs, YouTube videos, and more"})]}),n.jsx(ve,{children:n.jsx("div",{className:"flex justify-center py-4",children:a["content-tools"]?n.jsx(Ht,{className:"h-10 w-10 text-green-500"}):n.jsx(Vs,{className:"h-10 w-10 text-gray-400"})})}),n.jsx(At,{children:n.jsx(R,{asChild:!0,variant:"outline",className:"w-full",children:n.jsx(ne,{to:"/tools",children:"Try Content Tools"})})})]})]}),n.jsxs("div",{className:"mt-8 text-center",children:[n.jsx("p",{className:"text-lg mb-4",children:"Explore the features above to unlock pricing details"}),n.jsx(R,{asChild:!0,children:n.jsx(ne,{to:"/",children:"Back to Home"})})]})]})]});const h=[{name:"Starter",price:5,description:"Perfect for students and casual learners",features:[{name:"AI Tutor (100 messages/month)",included:!0},{name:"Question Solver (Basic)",included:!0},{name:"PDF Summarizer (5 PDFs/month)",included:!0},{name:"YouTube Transcriber (10 videos/month)",included:!0},{name:"Dashboard Access",included:!0},{name:"Multi-Modal Learning",included:!0},{name:"Priority Support",included:!1}],icon:to,cta:"Start Free Trial",planId:"starter",popular:!1},{name:"Pro",price:10,description:"For serious learners who want full access",features:[{name:"AI Tutor (Unlimited)",included:!0},{name:"Question Solver (Advanced)",included:!0},{name:"PDF Summarizer (Unlimited)",included:!0},{name:"YouTube Transcriber (Unlimited)",included:!0},{name:"Dashboard Access",included:!0},{name:"Multi-Modal Learning",included:!0},{name:"Priority Support",included:!0}],icon:Lo,cta:"Start Free Trial",planId:"pro",popular:!0},{name:"Teams",price:25,description:"For study groups and educational teams",features:[{name:"AI Tutor (Unlimited for all members)",included:!0},{name:"Question Solver (Advanced)",included:!0},{name:"PDF Summarizer (Unlimited)",included:!0},{name:"YouTube Transcriber (Unlimited)",included:!0},{name:"Dashboard Access",included:!0},{name:"Multi-Modal Learning",included:!0},{name:"Priority Support",included:!0},{name:"Team Collaboration Features",included:!0}],icon:Xe,cta:"Start Free Trial",planId:"teams",popular:!1}],m=p=>{t(jt[p])};return n.jsxs("div",{className:"min-h-screen bg-gradient-to-b from-white to-explainify-50 dark:from-gray-900 dark:to-gray-950",children:[n.jsx(_s,{}),n.jsxs("div",{className:"container py-20",children:[n.jsxs("div",{className:"text-center max-w-3xl mx-auto mb-8",children:[n.jsx("span",{className:"inline-flex items-center rounded-full bg-explainify-100 dark:bg-explainify-900/20 px-3 py-1 text-sm font-medium text-explainify-800 dark:text-explainify-200 mb-4",children:"Try Free For 30 Days"}),n.jsxs("h1",{className:"text-4xl md:text-5xl font-bold tracking-tight mb-4",children:["Simple, Transparent ",n.jsx("span",{className:"gradient-text dark:dark-gradient-text",children:"Pricing"})]}),n.jsx("p",{className:"text-lg text-muted-foreground",children:"Try Explainify free for 30 days, then pay once for lifetime access. No subscriptions, no hidden fees."})]}),n.jsx("div",{className:"flex justify-center mb-12",children:n.jsxs("div",{className:"flex items-center gap-3 bg-muted p-2 rounded-lg",children:[n.jsx(Qx,{
476className:"h-5 w-5 text-muted-foreground"}),n.jsx("span",{className:"text-sm font-medium",children:"Region:"}),r?n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Rt,{className:"h-4 w-4 animate-spin"}),n.jsx("span",{className:"text-sm",children:"Detecting your region..."})]}):n.jsxs(Ok,{value:(e==null?void 0:e.code)||"GLOBAL",onValueChange:m,children:[n.jsx(Rm,{className:"w-[180px]",children:n.jsx(Lk,{placeholder:"Select Region"})}),n.jsx(Mm,{children:Object.values(jt).map(p=>n.jsxs(Om,{value:p.code,children:[p.name," (",p.currencySymbol,")"]},p.code))})]})]})}),n.jsx("div",{className:"grid md:grid-cols-3 gap-8 max-w-6xl mx-auto",children:h.map(p=>n.jsxs(de,{className:`relative flex flex-col ${p.popular?"border-explainify-600 shadow-lg":"border-border"}`,children:[p.popular&&n.jsx("div",{className:"absolute -top-4 left-0 right-0 flex justify-center",children:n.jsx("span",{className:"bg-explainify-600 text-white text-xs font-medium rounded-full px-3 py-1",children:"Most Popular"})}),n.jsxs(Ce,{children:[n.jsx("div",{className:"flex justify-center mb-4",children:n.jsx("div",{className:`p-3 rounded-full ${p.popular?"bg-explainify-100 dark:bg-explainify-900/30":"bg-muted"}`,children:n.jsx(p.icon,{className:`h-8 w-8 ${p.popular?"text-explainify-600":"text-muted-foreground"}`})})}),n.jsx(Se,{className:"text-2xl text-center",children:p.name}),n.jsx("div",{className:"flex justify-center items-baseline mt-4",children:r?n.jsx(Rt,{className:"h-6 w-6 animate-spin text-muted-foreground"}):n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-4xl font-bold",children:d(p.price)}),n.jsx("span",{className:"ml-1 text-muted-foreground",children:"one-time"})]})}),e&&e.code!=="NA"&&e.code!=="GLOBAL"&&n.jsxs("div",{className:"text-center mt-2 text-xs text-green-600 dark:text-green-400",children:["Regional pricing applied for ",e.name]}),n.jsx(at,{className:"text-center mt-2",children:p.description}),n.jsx("div",{className:"text-center mt-2 text-sm text-explainify-600 dark:text-explainify-400 font-medium",children:"30-day free trial, no credit card required"})]}),n.jsx(ve,{className:"flex-1",children:n.jsx("ul",{className:"space-y-3",children:p.features.map(x=>n.jsxs("li",{className:"flex items-start",children:[x.included?n.jsx(Ht,{className:"h-5 w-5 text-green-500 mr-2 flex-shrink-0"}):n.jsx(Vs,{className:"h-5 w-5 text-muted-foreground mr-2 flex-shrink-0"}),n.jsx("span",{className:x.included?"":"text-muted-foreground",children:x.name})]},x.name))})}),n.jsxs(At,{className:"flex flex-col gap-4",children:[n.jsx(R,{className:`w-full gap-2 ${p.popular?"":"variant-outline"}`,variant:p.popular?"default":"outline",asChild:!0,children:n.jsxs(ne,{to:"/auth?mode=signup",children:[p.cta,n.jsx(mr,{className:"h-4 w-4"})]})}),n.jsxs(Au,{children:[n.jsx(j0,{asChild:!0,children:n.jsxs(R,{variant:"outline",className:"w-full gap-2",children:[n.jsx(Sd,{className:"h-4 w-4"}),"View Terms & Legal"]})}),n.jsxs(ri,{children:[n.jsxs(Pu,{children:[n.jsx(Du,{children:"Terms & Legal Information"}),n.jsx(Ru,{children:"Please read our terms and legal information before proceeding with payment."})]}),n.jsxs("div",{className:"space-y-4 mt-4",children:[n.jsxs("div",{children:[n.jsx("h4",{className:"font-medium mb-2",children:"Payment Terms"}),n.jsxs("p",{className:"text-sm text-muted-foreground",children:["• Payment is processed securely through Paystack",n.jsx("br",{}),"• Prices are shown in your local currency where available",n.jsx("br",{}),"• Payment is required only after the 30-day free trial",n.jsx("br",{}),"• One-time payment for lifetime access"]})]}),n.jsxs("div",{children:[n.jsx("h4",{className:"font-medium mb-2",children:"Refund Policy"}),n.jsxs("p",{className:"text-sm text-muted-foreground",children:["• 30-day money-back guarantee after purchase",n.jsx("br",{}),"• No refunds for partial usage",n.jsx("br",{}),"• Refund requests must be submitted within 30 days of purchase"]})]}),n.jsxs("div",{children:[n.jsx("h4",{className:"font-medium mb-2",children:"Regional Pricing"}),n.jsxs("p",{className:"text-sm text-muted-foreground",children:["• We offer region-based pricing to make our services accessible globally",n.jsx("br",{}),"• Regional pricing is determined by your location",n.jsx("br",{}),"• You can manually select your region if needed"]})]})]})]})]}),n.jsx(lk,{planId:p.planId,className:"w-full bg-green-600 hover:bg-green-700 text-white",region:e||void 0,useDirectLink:!1,environment:"test"})]})]},p.name))}),n.jsxs("div",{className:"mt-20 max-w-3xl mx-auto text-center",children:[n.jsx("h2",{className:"text-2xl font-bold mb-4",children:"Frequently Asked Questions"}),n.jsxs("div",{className:"grid gap-6 mt-8",children:[n.jsxs("div",{className:"text-left",children:[n.jsx("h3",{className:"font-medium text-lg",children:"How does the free trial work?"}),n.jsx("p",{className:"text-muted-foreground mt-2",children:"Sign up today and get full access to all features for 30 days with 
476no credit card required. If you decide to continue, you'll make a one-time payment for lifetime access."})]}),n.jsxs("div",{className:"text-left",children:[n.jsx("h3",{className:"font-medium text-lg",children:"Is this really a one-time payment?"}),n.jsx("p",{className:"text-muted-foreground mt-2",children:"Yes! Unlike most learning platforms that charge monthly, we offer lifetime access with a single payment after your free trial."})]}),n.jsxs("div",{className:"text-left",children:[n.jsx("h3",{className:"font-medium text-lg",children:"Why do prices vary by region?"}),n.jsx("p",{className:"text-muted-foreground mt-2",children:"We believe education should be accessible to everyone. Our regional pricing ensures that our platform is affordable regardless of where you live, taking into account local economic conditions."})]}),n.jsxs("div",{className:"text-left",children:[n.jsx("h3",{className:"font-medium text-lg",children:"Do you offer refunds?"}),n.jsx("p",{className:"text-muted-foreground mt-2",children:"We offer a 30-day money-back guarantee after purchase. If you're not satisfied, just let us know and we'll process your refund."})]}),!1]})]})]})]})};var qk="Label",Lm=f.forwardRef((e,t)=>n.jsx(re.label,{...e,ref:t,onMouseDown:r=>{var a;r.target.closest("button, input, select, textarea")||((a=e.onMouseDown)==null||a.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));Lm.displayName=qk;var $m=Lm;const Hk=Es("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),sr=f.forwardRef(({className:e,...t},r)=>n.jsx($m,{ref:r,className:V(Hk(),e),...t}));sr.displayName=$m.displayName;var Bu="Switch",[Vk,r5]=kr(Bu),[Gk,Wk]=Vk(Bu),Um=f.forwardRef((e,t)=>{const{__scopeSwitch:r,name:s,checked:a,defaultChecked:i,required:o,disabled:u,value:c="on",onCheckedChange:l,form:d,...h}=e,[m,p]=f.useState(null),x=he(t,w=>p(w)),g=f.useRef(!1),b=m?d||!!m.closest("form"):!0,[v=!1,y]=Vt({prop:a,defaultProp:i,onChange:l});return n.jsxs(Gk,{scope:r,checked:v,disabled:u,children:[n.jsx(re.button,{type:"button",role:"switch","aria-checked":v,"aria-required":o,"data-state":qm(v),"data-disabled":u?"":void 0,disabled:u,value:c,...h,ref:x,onClick:H(e.onClick,w=>{y(_=>!_),b&&(g.current=w.isPropagationStopped(),g.current||w.stopPropagation())})}),b&&n.jsx(Yk,{control:m,bubbles:!g.current,name:s,value:c,checked:v,required:o,disabled:u,form:d,style:{transform:"translateX(-100%)"}})]})});Um.displayName=Bu;var zm="SwitchThumb",Bm=f.forwardRef((e,t)=>{const{__scopeSwitch:r,...s}=e,a=Wk(zm,r);return n.jsx(re.span,{"data-state":qm(a.checked),"data-disabled":a.disabled?"":void 0,...s,ref:t})});Bm.displayName=zm;var Yk=e=>{const{control:t,checked:r,bubbles:s=!0,...a}=e,i=f.useRef(null),o=J0(r),u=Kd(t);return f.useEffect(()=>{const c=i.current,l=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(l,"checked").set;if(o!==r&&h){const m=new Event("click",{bubbles:s});h.call(c,r),c.dispatchEvent(m)}},[o,r,s]),n.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...a,tabIndex:-1,ref:i,style:{...e.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function qm(e){return e?"checked":"unchecked"}var Hm=Um,Kk=Bm;const Vm=f.forwardRef(({className:e,...t},r)=>n.jsx(Hm,{className:V("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:r,children:n.jsx(Kk,{className:V("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")})}));Vm.displayName=Hm.displayName;function Qk(){const{user:e}=ke(),[t,r]=f.useState({used:0,limit:100,remaining:0,isUnlimited:!1}),[s,a]=f.useState(!0);if(f.useEffect(()=>{(async()=>{if(e){a(!0);try{const{data:c,error:l}=await J.from("user_usage").select("messages_used, messages_limit, reset_date").eq("id",e.id).single();if(l)throw l;const d=c.messages_limit===-1,h=d?-1:Math.max(0,c.messages_limit-c.messages_used);r({used:c.messages_used,limit:c.messages_limit,remaining:h,isUnlimited:d,resetDate:new Date(c.reset_date)})}catch(c){console.error("Error fetching message usage:",c)}finally{a(!1)}}})()},[e]),s)return n.jsx("div",{children:"Loading usage data..."});if(t.isUnlimited)return n.jsx("div",{className:"space-y-2",children:n.jsxs("div",{className:"flex justify-between items-center",children:[n.jsx("span",{className:"text-sm font-medium",children:"Message Usage"}),n.jsx("span",{className:"text-sm text-muted-foreground",children:"Unlimited"})]})});const i=Math.min(100,t.used/t.limit*100),o=u=>u.toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"});return n.jsxs("div",{className:"space-y-2",children:[n.jsxs("div",{className:"flex justify-between items-center",children:[n.jsx("span",{className:"text-sm font-medium",children:"Message Usage"}),n.jsxs("span",{className:"text-sm text-muted-foreground",children:[t.used," / ",t.limit]})]}),n.jsx(ks,{value:i,className:"h-2"}),t.resetDate&&n.jsxs("p",{className:"text-xs text-muted-foreground",children:["Resets on ",o(t.resetDate)]}),t.remaining<=10&&t.remaining>0&&n.jsx(Lr,{variant:"warning",className:"mt-2",children:n.jsxs($r,{children:["You have ",t.remaining," messages left this month. 
476Consider upgrading for unlimited messages."]})})]})}function Jk(){const{user:e}=ke(),[t,r]=f.useState({isActive:!1,startDate:null,endDate:null,daysLeft:0,percentageComplete:0}),[s,a]=f.useState(!0);if(f.useEffect(()=>{const o=async()=>{if(e){a(!0);try{const{data:c,error:l}=await J.from("profiles").select("trial_start_date, trial_end_date, is_trial_active, subscription_tier").eq("id",e.id).single();if(l)throw l;if(c.subscription_tier==="Pro"||c.subscription_tier==="Teams"){r({isActive:!1,startDate:null,endDate:null,daysLeft:0,percentageComplete:100}),a(!1);return}const d=new Date,h=c.trial_start_date?new Date(c.trial_start_date):null,m=c.trial_end_date?new Date(c.trial_end_date):null;let p=0,x=100,g=c.is_trial_active;if(h&&m){const b=m.getTime()-h.getTime(),v=d.getTime()-h.getTime();p=Math.max(0,Math.ceil((m.getTime()-d.getTime())/864e5)),x=Math.min(100,Math.max(0,v/b*100)),d>m&&g&&(g=!1,await J.from("profiles").update({is_trial_active:!1}).eq("id",e.id))}r({isActive:g,startDate:h,endDate:m,daysLeft:p,percentageComplete:x})}catch(c){console.error("Error fetching trial status:",c)}finally{a(!1)}}};o();const u=setInterval(o,60*60*1e3);return()=>clearInterval(u)},[e]),s)return n.jsx("div",{children:"Loading trial status..."});const i=o=>o?o.toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"}):"N/A";return t.isActive?n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("h3",{className:"font-medium",children:"Free Trial"}),n.jsxs("p",{className:"text-sm text-muted-foreground",children:["Expires on ",i(t.endDate)]})]}),n.jsx(is,{variant:"outline",className:"bg-green-100 text-green-800",children:"Active"})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs("div",{className:"flex justify-between text-sm",children:[n.jsx("span",{children:"Trial progress"}),n.jsxs("span",{children:[t.daysLeft," days left"]})]}),n.jsx(ks,{value:t.percentageComplete,className:"h-2"})]}),t.daysLeft<=5&&n.jsxs(Lr,{variant:"warning",children:[n.jsx(Gt,{className:"h-4 w-4"}),n.jsx($r,{children:"Your free trial is ending soon. Consider upgrading to avoid losing access."})]}),n.jsxs(R,{variant:"outline",className:"w-full",onClick:()=>window.location.href="https://flutterwave.com/pay/bneoya5kmyoq",children:[n.jsx(gr,{className:"h-4 w-4 mr-2"}),"Upgrade Plan"]})]}):n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("h3",{className:"font-medium",children:"Free Trial"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:t.endDate?"Trial expired on "+i(t.endDate):"No active trial"})]}),n.jsx(is,{variant:"outline",className:"bg-destructive/10 text-destructive",children:"Expired"})]}),n.jsxs(Lr,{variant:"warning",children:[n.jsx(Gt,{className:"h-4 w-4"}),n.jsx($r,{children:"Your free trial has expired. Upgrade to a paid plan to continue using all features."})]}),n.jsxs(R,{variant:"default",className:"w-full",onClick:()=>window.location.href="https://flutterwave.com/pay/bneoya5kmyoq",children:[n.jsx(gr,{className:"h-4 w-4 mr-2"}),"Upgrade Now"]})]})}const Zk=()=>{var b,v;const{user:e,signOut:t}=ke(),{toast:r}=wa(),[s,a]=f.useState(!1),[i,o]=f.useState({first_name:"",last_name:"",email:"",subscription_tier:"Starter",subscription_status:"Active",subscription_end_date:null,two_factor_enabled:!1,trial_start_date:null,trial_end_date:null,is_trial_active:!1}),[u,c]=f.useState({current:"",new:"",confirm:""}),[l,d]=f.useState(!1);f.useState(!1),f.useEffect(()=>{e&&h()},[e]);const h=async()=>{try{a(!0);const{data:y,error:w}=await J.from("profiles").select("*").eq("id",e==null?void 0:e.id).single();if(w)throw w;y&&o({first_name:y.first_name||"",last_name:y.last_name||"",email:e.email||"",subscription_tier:y.subscription_tier||"Starter",subscription_status:y.subscription_status||"Active",subscription_end_date:y.subscription_end_date,two_factor_enabled:y.two_factor_enabled||!1,trial_start_date:y.trial_start_date,trial_end_date:y.trial_end_date,is_trial_active:y.is_trial_active||!1})}catch(y){r({title:"Error fetching profile",description:y.message,variant:"destructive"})}finally{a(!1)}},m=async y=>{y.preventDefault();try{a(!0);const{error:w}=await J.from("profiles").update({first_name:i.first_name,last_name:i.last_name}).eq("id",e==null?void 0:e.id);if(w)throw w;r({title:"Profile updated successfully"})}catch(w){r({title:"Error updating profile",description:w.message,variant:"destructive"})}finally{a(!1)}},p=async y=>{if(y.preventDefault(),u.new!==u.confirm){r({title:"Error",description:"New passwords do not match",variant:"destructive"});return}try{a(!0);const{error:w}=await J.auth.updateUser({password:u.new});if(w)throw w;r({title:"Password updated successfully"}),d(!1),c({current:"",new:"",confirm:""})}catch(w){r({title:"Error updating password",description:w.message,variant:"destructive"})}finally{a(!1)}},x=async()=>{try{a(!0);const{error:y}=await J.from("profiles").update({two_factor_enabled:!i.two_factor_enabled}).eq("id",e==null?void 0:e.id);if(y)throw y;o(w=>({...w,two_factor_enabled:!w.two_factor_enabled}
476)),r({title:`Two-factor authentication ${i.two_factor_enabled?"disabled":"enabled"}`})}catch(y){r({title:"Error updating 2FA",description:y.message,variant:"destructive"})}finally{a(!1)}},g=y=>{switch(y){case"Pro":return n.jsx(Lo,{className:"h-6 w-6"});case"Teams":return n.jsx(Xe,{className:"h-6 w-6"});default:return n.jsx(to,{className:"h-6 w-6"})}};return e?n.jsxs("div",{className:"min-h-screen bg-gradient-to-b from-white to-explainify-50 dark:from-gray-900 dark:to-gray-950",children:[n.jsx(_s,{}),n.jsx("div",{className:"container py-10 sm:py-16 md:py-20 px-4 sm:px-6",children:n.jsxs("div",{className:"max-w-4xl mx-auto",children:[n.jsxs("div",{className:"flex flex-col sm:flex-row items-center gap-4 mb-8",children:[n.jsx("div",{className:"h-16 w-16 sm:h-20 sm:w-20 rounded-full bg-explainify-100 dark:bg-explainify-900/50 flex items-center justify-center",children:n.jsx("span",{className:"text-xl sm:text-2xl font-bold text-explainify-600 dark:text-explainify-400",children:((v=(b=i.first_name)==null?void 0:b[0])==null?void 0:v.toUpperCase())||"U"})}),n.jsxs("div",{className:"text-center sm:text-left",children:[n.jsxs("h1",{className:"text-2xl sm:text-3xl font-bold dark:text-white",children:[i.first_name," ",i.last_name]}),n.jsx("p",{className:"text-muted-foreground dark:text-gray-400",children:i.email})]})]}),n.jsxs(_n,{defaultValue:"profile",className:"space-y-6",children:[n.jsxs(Ms,{className:"grid w-full grid-cols-2 sm:grid-cols-4 bg-gray-100 dark:bg-gray-800 p-1 rounded-md",children:[n.jsx(Ie,{value:"profile",className:"data-[state=active]:bg-white dark:data-[state=active]:bg-gray-700 data-[state=active]:text-explainify-600 dark:data-[state=active]:text-explainify-400 rounded-md transition-all",children:"Profile"}),n.jsx(Ie,{value:"subscription",className:"data-[state=active]:bg-white dark:data-[state=active]:bg-gray-700 data-[state=active]:text-explainify-600 dark:data-[state=active]:text-explainify-400 rounded-md transition-all",children:"Subscription"}),n.jsx(Ie,{value:"security",className:"data-[state=active]:bg-white dark:data-[state=active]:bg-gray-700 data-[state=active]:text-explainify-600 dark:data-[state=active]:text-explainify-400 rounded-md transition-all",children:"Security"}),n.jsx(Ie,{value:"history",className:"data-[state=active]:bg-white dark:data-[state=active]:bg-gray-700 data-[state=active]:text-explainify-600 dark:data-[state=active]:text-explainify-400 rounded-md transition-all",children:"History"})]}),n.jsx(nt,{value:"profile",className:"space-y-6",children:n.jsxs(de,{className:"dark:bg-gray-800 dark:border-gray-700",children:[n.jsxs(Ce,{children:[n.jsx(Se,{className:"dark:text-white",children:"Profile Information"}),n.jsx(at,{className:"dark:text-gray-400",children:"Update your personal information and preferences."})]}),n.jsx(ve,{children:n.jsxs("form",{onSubmit:m,className:"space-y-4",children:[n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(sr,{htmlFor:"first_name",className:"dark:text-gray-300",children:"First Name"}),n.jsx(ze,{id:"first_name",value:i.first_name,onChange:y=>o({...i,first_name:y.target.value}),className:"dark:bg-gray-700 dark:border-gray-600 dark:text-white"})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(sr,{htmlFor:"last_name",className:"dark:text-gray-300",children:"Last Name"}),n.jsx(ze,{id:"last_name",value:i.last_name,onChange:y=>o({...i,last_name:y.target.value}),className:"dark:bg-gray-700 dark:border-gray-600 dark:text-white"})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(sr,{htmlFor:"email",className:"dark:text-gray-300",children:"Email"}),n.jsx(ze,{id:"email",type:"email",value:i.email,disabled:!0,className:"dark:bg-gray-700 dark:border-gray-600 dark:text-gray-400"})]}),n.jsx(R,{type:"submit",disabled:s,children:s?"Saving...":"Save Changes"})]})})]})}),n.jsx(nt,{value:"subscription",className:"space-y-6",children:n.jsxs(de,{className:"dark:bg-gray-800 dark:border-gray-700",children:[n.jsxs(Ce,{children:[n.jsx(Se,{className:"dark:text-white",children:"Subscription Details"}),n.jsx(at,{className:"dark:text-gray-400",children:"View and manage your subscription plan."})]}),n.jsxs(ve,{children:[n.jsxs("div",{className:"flex items-center gap-4 p-4 rounded-lg bg-explainify-50 dark:bg-explainify-900/20",children:[n.jsx("div",{className:"p-3 rounded-full bg-explainify-100 dark:bg-explainify-800/50",children:n.jsx("div",{className:"text-explainify-600 dark:text-explainify-400",children:g(i.subscription_tier)})}),n.jsxs("div",{children:[n.jsxs("h3",{className:"font-semibold dark:text-white",children:[i.subscription_tier," Plan"]}),n.jsxs("p",{className:"text-sm text-muted-foreground dark:text-gray-400",children:["Status: ",i.subscription_status]}),i.subscription_end_date&&n.jsxs("p",{className:"text-sm text-muted-foreground dark:text-gray-400",children:["Valid until: ",new Date(i.subscription_end_date).toLocaleDateString()]})]})]}),n.jsx("div",{className:"mt-6 p-4 border rounded-lg dark:border-gray-700",children:n.jsx(Jk,{})}),n.jsx("div",{className:"mt-6 p-4 border rounded-lg dark:border-gray-700",children:n.jsx(Qk,{})}),n.jsx("div",{className:"mt-6",children:n.jsxs(R,{variant:"outline",className:"w-full dark:bg-gray-700 dark:text-white dark:hover:bg-gray-600",onClick:()=>window.location.href="https://flutterwave.com/pay/bneoya5kmyoq",children:[n.jsx(gr,{className:"h-4 w-4 mr-2"}),"Manage Subscription"]})})]})]})}),n.jsx(nt,{value:"security",className:"space-y-6",children:n.jsxs(de,{className:"dark:bg-gray-800 dark:border-gray-700",children:[n.jsxs(Ce,{children:[n.jsx(Se,{className:"dark:text-white",children:"Security Settings"}),n.jsx(at,{className:"dark:text-gray-400",children:"Manage your account security and password."})]}),n.jsx(ve,{children:n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"space-y-0.5",children:[n.jsx(sr,{className:"dark:text-gray-300",children:"Two-Factor Authentication"}),n.jsx("p",{className:"text-sm text-muted-foreground dark:text-gray-400",children:"Add an extra layer of security to your account"})]}),n.jsx(Vm,{checked:i.two_factor_enabled,onCheckedChange:x,disabled:s})]}),n.jsxs(Au,{open:l,onOpenChange:d,children:[n.jsx(j0,{asChild:!0,children:n.jsxs(R,{variant:"outline",className:"w-full dark:bg-gray-700 dark:text-white dark:hover:bg-gray-600",children:[n.jsx(Xx,{className:"h-4 w-4 mr-2"}),"Change Password"]})}),n.jsxs(ri,{className:"dark:bg-gray-800 dark:border-gray-700",children:[n.jsxs(Pu,{children:[n.jsx(Du,{className:"dark:text-white",children:"Change Password"}),n.jsx(Ru,{className:"dark:text-gray-400",children:"Enter your current password and choose a new one."})]}),n.jsxs("form",{onSubmit:p,className:"space-y-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(sr,{htmlFor:"current_password",className:"dark:text-gray-300",children:"Current Password"}),n.jsx(ze,{id:"current_password",type:"password",value:u.current,onChange:y=>c({...u,current:y.target.value}),className:"dark:bg-gray-700 dark:border-gray-600 dark:text-white"})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(sr,{htmlFor:"new_password",className:"dark:text-gray-300",children:"New Password"}),n.jsx(ze,{id:"new_password",type:"password",value:u.new,onChange:y=>c({...u,new:y.target.value}),className:"dark:bg-gray-700 dark:border-gray-600 dark:text-white"})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(sr,{htmlFor:"confirm_password",className:"dark:text-gray-300",children:"Confirm New Password"}),n.jsx(ze,{id:"confirm_password",type:"password",value:u.confirm,onChange:y=>c({...u,confirm:y.target.value}),className:"dark:bg-gray-700 dark:border-gray-600 dark:text-white"})]}),n.jsx(R,{type:"submit",className:"w-full",disabled:s,children:s?"Updating...":"Update Password"})]})]})]}),n.jsxs(Lr,{className:"dark:bg-gray-700 dark:border-gray-600",children:[n.jsx(Gt,{className:"h-4 w-4 dark:text-gray-300"}),n.jsx(zu,{className:"dark:text-white",children:"Security Tips"}),n.jsxs($r,{className:"dark:text-gray-300",children:["• Use a strong, unique password",n.jsx("br",{}),"• Enable two-factor authentication",n.jsx("br",{}),"• Keep your email address up to date",n.jsx("br",{}),"• Never share your login credentials"]})]})]})})]})}),n.jsx(nt,{value:"history",className:"space-y-6",children:n.jsxs(de,{className:"dark:bg-gray-800 dark:border-gray-700 shadow-sm",children:[n.jsxs(Ce,{className:"border-b dark:border-gray-700 pb-4",children:[n.jsx(Se,{className:"dark:text-white text-2xl",children:"Account History"}),n.jsx(at,{className:"dark:text-gray-400",children:"View your account activity and history."})]}),n.jsx(ve,{className:"pt-6",children:n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center gap-4 p-4 rounded-lg bg-muted dark:bg-gray-700",children:[n.jsx(mt,{className:"h-5 w-5 text-muted-foreground dark:text-gray-400"}),n.jsxs("div",{children:[n.jsx("p",{className:"font-medium dark:text-white",children:"Account Created"}),n.jsx("p",{className:"text-sm text-muted-foreground dark:text-gray-400",children:new Date(e.created_at).toLocaleDateString()})]})]}),n.jsxs("div",{className:"flex items-center gap-4 p-4 rounded-lg bg-muted dark:bg-gray-700",children:[n.jsx(mt,{className:"h-5 w-5 text-muted-foreground dark:text-gray-400"}),n.jsxs("div",{children:[n.jsx("p",{className:"font-medium dark:text-white",children:"Last Login"}),n.jsx("p",{className:"text-sm text-muted-foreground dark:text-gray-400",children:new Date(e.last_sign_in_at||"").toLocaleDateString()})]})]}),n.jsxs("div",{className:"flex items-center gap-4 p-4 rounded-lg bg-muted dark:bg-gray-700",children:[n.jsx(Sd,{className:"h-5 w-5 text-muted-foreground dark:text-gray-400"}),n.jsxs("div",{children:[n.jsx("p",{className:"font-medium dark:text-white",children:"Security Status"}),n.jsx("p",{className:"text-sm text-muted-foreground dark:text-gray-400",children:i.two_factor_enabled?"Two-factor authentication enabled":"Two-factor authentication disabled"})]})]}),i.trial_start_date&&n.jsxs("div",{className:"flex items-center gap-4 p-4 rounded-lg bg-muted dark:bg-gray-700",children:[n.jsx(to,{className:"h-5 w-5 text-muted-foreground dark:text-gray-400"}),n.jsxs("div",{children:[n.jsx("p",{className:"font-medium dark:text-white",children:"Trial Start"}),n.jsx("p",{className:"text-sm text-muted-foreground dark:text-gray-400",children:new Date(i.trial_start_date).toLocaleDateString()})]})]})]})})]})})]}),n.jsx("div",{className:"mt-8",children:n.jsx(R,{variant:"destructive",onClick:t,className:"w-full",children:"Sign Out"})})]})})]}):n.jsxs("div",{className:"min-h-screen bg-gradient-to-b from-white to-explainify-50",children:[n.jsx(_s,{}),n.jsx("div",{className:"container py-20",children:n.jsx(de,{children:n.jsx(Ce,{children:n.jsx(Se,{children:"Please sign in to view your profile"})})})})]})};function yl({className:e,isCollapsed:t,toggleCollapse:r}){var u,c,l;const{user:s}=ke(),a=Mt(),i=[{title:"Dashboard",href:"/dashboard",icon:Jn},{title:"AI Tutor",href:"/ai-tutor",icon:xr},{title:"Question Solver",href:"/question-solver",icon:jd},{title:"Multi-Modal Learning",href:"/multi-modal",icon:_d},{title:"Content Tools",href:"/tools",icon:Pe}],o=d=>!!(d==="/dashboard"&&a.pathname==="/dashboard"||d!=="/dashboard"&&a.pathname.startsWith(d));return n.jsxs("div",{className:V("pb-12 min-h-screen relative",e),children:[n.jsx("div",{className:"space-y-4 py-4",children:n.jsxs("div",{className:"px-3 py-2",children:[n.jsxs("div",{className:"flex items-center justify-between mb-6 px-2",children:[!t&&n.jsxs(ne,{to:"/",className:"flex items-center gap-2",children:[n.jsx(Be,{className:"h-6 w-6 text-explainify-600"}),n.jsx("h2",{className:"text-lg font-semibold",children:"Explainify"})]}),t&&n.jsx(ne,{to:"/",className:"mx-auto",children:n.jsx(Be,{className:"h-6 w-6 text-explainify-600"})}),n.jsx(R,{variant:"ghost",size:"icon",onClick:r,className:"absolute right-[-12px] top-6 h-6 w-6 rounded-full border bg-background shadow-sm hidden md:flex",children:t?n.jsx(Xs,{className:"h-3 w-3"}):n.jsx(zo,{className:"h-3 w-3"})})]}),n.jsx("div",{className:"space-y-1",children:i.map(d=>n.jsxs(ne,{to:d.href,className:V("flex items-center gap-3 rounded-md px-3 py-2 text-sm font-medium hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors",t?"justify-center":"",o(d.href)?"bg-gray-100 dark:bg-gray-800 text-explainify-600":"text-gray-700 dark:text-gray-300"),title:t?d.title:void 0,children:[n.jsx(d.icon,{className:"h-4 w-4"}),!t&&d.title]},d.href))})]})}),!t&&n.jsx("div",{className:"px-3 absolute bottom-4 w-full",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:"h-8 w-8 rounded-full bg-explainify-100 dark:bg-explainify-800 flex items-center justify-center",children:n.jsx("span",{className:"text-sm font-medium text-explainify-600 dark:text-explainify-300",children:((c=(u=s==null?void 0:s.email)==null?void 0:u[0])==null?void 0:c.toUpperCase())||"U"})}),n.jsxs("div",{className:"text-xs",children:[n.jsx("p",{className:"font-medium",children:((l=s==null?void 0:s.user_metadata)==null?void 0:l.first_name)||"User"}),n.jsx("p",{className:"text-muted-foreground truncate max-w-[120px]",children:s==null?void 0:s.email})]})]}),n.jsx(ha,{})]})}),t&&n.jsx("div",{className:"absolute bottom-4 w-full flex justify-center",children:n.jsx(ha,{})})]})}const Xk=_0,e4=k0,Gm=({className:e,...t})=>n.jsx(Eu,{className:V(e),...t});Gm.displayName=Eu.displayName;const Wm=f.forwardRef(({className:e,...t},r)=>n.jsx(Za,{className:V("fixed inset-0 z-50 bg-background/80 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,ref:r}));Wm.displayName=Za.displayName;const t4=Es("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),Ym=f.forwardRef(({side:e="right",hideCloseButton:t=!1,className:r,children:s,...a},i)=>n.jsxs(Gm,{children:[n.jsx(Wm,{}),n.jsxs(Xa,{ref:i,className:V(t4({side:e}),r),...a,children:[s,!t&&n.jsxs(Tu,{className:"absolute right-4 top-4 roun
476ded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[n.jsx(Ur,{className:"h-4 w-4"}),n.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Ym.displayName=Xa.displayName;const r4=f.forwardRef(({className:e,...t},r)=>n.jsx(ei,{ref:r,className:V("text-lg font-semibold text-foreground",e),...t}));r4.displayName=ei.displayName;const s4=f.forwardRef(({className:e,...t},r)=>n.jsx(ti,{ref:r,className:V("text-sm text-muted-foreground",e),...t}));s4.displayName=ti.displayName;function Cn({children:e}){const{user:t}=ke(),r=gt(),[s,a]=f.useState(!1),i=()=>{a(o=>!o)};return t?n.jsxs("div",{className:"relative min-h-screen flex",children:[n.jsx("div",{className:V("hidden md:flex md:flex-col md:fixed md:inset-y-0 z-80 bg-white dark:bg-gray-950 border-r transition-all duration-300",s?"md:w-16":"md:w-64"),children:n.jsx(yl,{isCollapsed:s,toggleCollapse:i})}),n.jsxs(Xk,{children:[n.jsx(e4,{asChild:!0,children:n.jsxs(R,{variant:"ghost",size:"icon",className:"md:hidden fixed top-4 left-4 z-50",children:[n.jsx(Cd,{}),n.jsx("span",{className:"sr-only",children:"Toggle menu"})]})}),n.jsx(Ym,{side:"left",className:"p-0 w-64",children:n.jsx(yl,{isCollapsed:!1,toggleCollapse:()=>{}})})]}),n.jsx("main",{className:V("flex-1 pt-16 md:pt-0 transition-all duration-300",s?"md:pl-16":"md:pl-64"),children:e})]}):(r("/auth?mode=login"),null)}function n4(){const e=Mt(),t=gt(),[r,s]=f.useState("loading"),[a,i]=f.useState(null),[o,u]=f.useState(null),[c,l]=f.useState(null),[d,h]=f.useState(0),m=3;f.useEffect(()=>{J.auth.getUser().then(({data:g})=>{l(g.user)})},[]);const p=async(g,b)=>{try{console.log(`Verifying payment: ${g}, attempt: ${d+1}/${m}`);let v=!1,y;try{const w=await fetch("/api/payment/verify",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reference:g,tx_ref:b||g})}),_=await w.text();if(!_)throw new Error("Empty response from verification API");y=JSON.parse(_),w.ok&&y.status==="success"&&(v=!0)}catch(w){console.error("API verification failed, trying direct verification:",w)}if(!v)try{if(console.log("Attempting direct Paystack verification..."),(await uk(g)).status)y={status:"success",data:{transaction_id:g,amount:0,currency:"USD",plan_type:"starter",status:"success",region_code:"GLOBAL"}},v=!0;else throw new Error("Direct verification failed")}catch(w){throw console.error("Direct verification also failed:",w),new Error("All verification methods failed")}if(v&&y.status==="success"){const w=y.data;if(!w||!w.transaction_id)throw new Error("Invalid verification data received from server");const _={transactionId:w.transaction_id,amount:w.amount||0,planType:w.plan_type||"starter",currency:w.currency||"USD"};i(_),console.log("Payment verification successful, updating subscription...");try{const k=await ak({userId:c.id,planType:_.planType,transactionId:_.transactionId,amount:_.amount,currency:_.currency,regionCode:w.region_code});if(!k.success)throw console.error("Subscription update failed:",k.message),new Error(k.message||"Failed to update subscription. Please contact support.");await J.auth.refreshSession(),s("success"),L.success(`Your ${_.planType.charAt(0).toUpperCase()+_.planType.slice(1)} plan has been successfully activated.`),localStorage.setItem("explainify_subscription_active","true"),localStorage.setItem("explainify_subscription_plan",_.planType),localStorage.setItem("explainify_subscription_time",new Date().toISOString())}catch(k){return console.error("Subscription update error:",k),s("error"),u(`Payment was verified but there was an error updating your subscription: ${k.message}. Please contact support.`),L.error("Payment verified but subscription update failed",{description:"Your payment was successful but we encountered an issue activating your subscription. Please contact support."}),!1}return!0}else throw new Error("Payment verification failed: "+((y==null?void 0:y.message)||"Unknown error"))}catch(v){return console.error("Error verifying payment:",v),d<m-1?(h(y=>y+1),!1):(u(v.message||"An error occurred while verifying your payment"),s("error"),L.error(v.message||"We could not verify your payment. Please contact support."),!1)}};f.useEffect(()=>{if(!c)return;const g=new URLSearchParams(e.search),b=g.get("reference"),v=g.get("tx_ref");if(!b){s("error"),u("No payment reference found. Please contact support.");return}const y=async()=>{!await p(b,v)&&d<m&&setTimeout(()=>{y()},2e3)};y()},[e.search,c,d]);const x=async()=>{s("loading"),u(null),h(0);const g=new URLSearchParams(e.search),b=g.get("reference"),v=g.get("tx_ref");b?await p(b,v):(s("error"),u("No payment reference found. Please contact support."))};return n.jsx(Cn,{children:n.jsx("div",{className:"container mx-auto py-10",children:n.jsx("div",{className:"max-w-md mx-auto",children:n.jsxs(de,{children:[n.jsxs(Ce,{children:[n.jsxs(Se,{children:[r==="loading"&&"Processing Payment...",r==="success"&&"Payment Successful!",r==="error"&&"Payment Verification Failed"]}),n.jsxs(at,{children:[r==="loading"&&"We are verifying your payment...",r==="success"&&"Your subscription has been activated.",r==="error"&&"We encountered an issue while verifying your payment."]})]}),n.jsxs(ve,{children:[r==="loading"&&n.jsx("div",{className:"flex justify-center py-8",children:n.jsx(Rt,{className:"h-12 w-12 animate-spin text-explainify-600"})}),r==="success"&&a&&n.jsxs("div",{className:"space-y-4 py-4",children:[n.jsx("div",{className:"flex justify-center mb-6",children:n.jsx("div",{className:"rounded-full bg-green-100 p-4",children:n.jsx(Ht,{className:"h-12 w-12 text-green-600"})})}),n.jsxs("dl",{className:"space-y-2",children:[n.jsxs("div",{className:"flex justify-between",children:[n.jsx("dt",{className:"font-medium text-muted-foreground",children:"Plan:"}),n.jsx("dd",{className:"font-semibold",children:a.planType.charAt(0).toUpperCase()+a.planType.slice(1)})]}),n.jsxs("div",{className:"flex justify-between",children:[n.jsx("dt",{className:"font-medium text-muted-foreground",children:"Amount:"}),n.jsxs("dd",{className:"font-semibold",children:[a.amount," ",a.currency]})]}),n.jsxs("div",{className:"flex justify-between",children:[n.jsx("dt",{className:"font-medium text-muted-foreground",children:"Transaction ID:"}),n.jsx("dd",{className:"font-mono text-sm",children:a.transactionId})]}),n.jsxs("div",{className:"flex justify-between",children:[n.jsx("dt",{className:"font-medium text-muted-foreground",children:"Status:"}),n.jsx("dd",{className:"font-semibold text-green-600",children:"Active"})]})]})]}),r==="error"&&n.jsxs("div",{className:"py-4",children:[n.jsx("div",{className:"flex justify-center mb-6",children:n.jsx("div",{className:"rounded-full bg-red-100 p-4",children:n.jsx(Gt,{className:"h-12 w-12 text-red-600"})})}),n.jsx("p",{className:"text-center text-red-600 mb-4",children:o}),n.jsx("p",{className:"text-center text-sm",children:"If you believe this is an error, please contact our support team with your transaction reference."})]})]}),n.jsxs(At,{className:"flex justify-center",children:[r==="success"&&n.jsx(R,{onClick:()=>
476t("/dashboard"),children:"Go to Dashboard"}),r==="error"&&n.jsxs("div",{className:"flex gap-4 flex-wrap",children:[n.jsx(R,{variant:"outline",onClick:x,children:"Retry Verification"}),n.jsx(R,{variant:"outline",onClick:()=>t("/pricing"),children:"Try Again"}),n.jsx(R,{onClick:()=>t("/dashboard"),children:"Go to Dashboard"})]})]})]})})})})}const Km=({showButton:e=!1,className:t,variant:r="full"})=>{const{subscription:s,isLoading:a}=ke();if(a)return n.jsxs("div",{className:V("flex items-center",t),children:[n.jsx("div",{className:"animate-spin h-4 w-4 border-2 border-explainify-600 rounded-full border-t-transparent mr-2"}),n.jsx("span",{className:"text-sm",children:"Loading..."})]});let i=s.isActive?Ht:Vs,o=s.isActive?"text-green-600":"text-red-600",u="No subscription";return s.trialActive?(i=ta,o="text-blue-600",u="Trial Active"):s.isActive&&s.tier&&(u=`${s.tier} Plan`),r==="badge"?n.jsxs("div",{className:V("inline-flex items-center gap-1 rounded-full px-2 py-1 text-xs font-medium",s.isActive?"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-300":s.trialActive?"bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-300":"bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-300",t),children:[n.jsx(i,{className:"h-3 w-3"}),n.jsx("span",{children:u})]}):r==="compact"?n.jsxs("div",{className:V("flex items-center gap-1",t),children:[n.jsx(i,{className:V("h-4 w-4",o)}),n.jsx("span",{className:"text-sm font-medium",children:u}),e&&!s.isActive&&n.jsx(R,{asChild:!0,variant:"link",size:"sm",className:"h-auto p-0 ml-2",children:n.jsx(ne,{to:"/pricing",children:"Upgrade"})})]}):n.jsxs("div",{className:V("space-y-2",t),children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(gr,{className:"h-5 w-5 text-gray-500"}),n.jsx("span",{className:"font-medium",children:"Subscription Status"})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(i,{className:V("h-4 w-4",o)}),n.jsx("span",{children:s.trialActive?n.jsx("span",{children:"Trial Active"}):s.isActive?n.jsxs("span",{children:[s.tier," Plan - Active"]}):n.jsx("span",{children:"No active subscription"})})]}),s.messageLimit>0&&n.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-600 dark:text-gray-400",children:[n.jsx(ta,{className:"h-3.5 w-3.5"}),n.jsxs("span",{children:[s.messagesUsed," / ",s.messageLimit," messages used"]})]}),e&&n.jsx(R,{asChild:!0,size:"sm",className:"mt-2",variant:s.isActive?"outline":"default",children:n.jsx(ne,{to:"/pricing",children:s.isActive?"Manage Subscription":"Upgrade Now"})})]})},a4=()=>{const{subscription:e}=ke();return n.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-2xl p-6 shadow-sm border border-gray-100 dark:border-gray-700 card-hover highlight-container",children:[n.jsx("h3",{className:"text-xl font-semibold mb-5",children:"Your Subscription"}),n.jsx(Km,{showButton:!0,variant:"full",className:"mb-4"}),!e.isActive&&n.jsx("div",{className:"mt-6 p-3 bg-blue-50 dark:bg-blue-900/20 rounded-lg",children:n.jsx("p",{className:"text-sm text-blue-700 dark:text-blue-300",children:"Upgrade now to unlock all features and get unlimited access!"})})]})},i4=()=>{var i;const{user:e,subscription:t}=ke(),r=((i=e==null?void 0:e.user_metadata)==null?void 0:i.first_name)||"there",s=[{icon:xr,title:"AI Tutor",description:"Get personalized learning assistance",link:"/ai-tutor",color:"bg-blue-50 text-blue-600 dark:bg-blue-900/30 dark:text-blue-400"},{icon:jd,title:"Ask Question",description:"Get instant answers to your questions",link:"/question-solver",color:"bg-green-50 text-green-600 dark:bg-green-900/30 dark:text-green-400"},{icon:Be,title:"Multi-Modal Learning",description:"Learn through various interactive methods",link:"/multi-modal",color:"bg-purple-50 text-purple-600 dark:bg-purple-900/30 dark:text-purple-400"}],a=[{icon:Pe,title:"PDF Summarizer",description:"Summarize PDF documents instantly",link:"/tools?tab=pdf",color:"bg-orange-50 text-orange-600 dark:bg-orange-900/30 dark:text-orange-400"},{icon:Tt,title:"YouTube Transcriber",description:"Convert videos to text with summaries",link:"/tools?tab=youtube",color:"bg-red-50 text-red-600 dark:bg-red-900/30 dark:text-red-400"}];return n.jsx(Cn,{children:n.jsxs("div",{className:"bg-gray-50 dark:bg-gray-900 min-h-screen",children:[n.jsxs("div",{className:"container pt-10 pb-6 relative",children:[n.jsx("div",{className:"absolute -top-10 -right-10 w-64 h-64 bg-explainify-300/10 dark:bg-explainify-700/10 rounded-full filter blur-3xl -z-10"}),n.jsxs("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between gap-6",children:[n.jsxs("div",{children:[n.jsxs("h1",{className:"text-3xl md:text-4xl font-bold mb-2",children:["Welcome back, ",r,"!"]}),n.jsx("p",{className:"text-muted-foreground text-lg",children:"Continue your learning journey"}),n.jsx("div",{className:"mt-3",children:n.jsx(Km,{variant:"badge"})})]}),n.jsxs("div",{className:"grid grid-cols-3 gap-4 max-w-md",children:[n.jsxs("div",{className:"glass-morphism rounded-xl p-4 text-center",children:[n.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:"Sessions"}),n.jsx("p",{className:"text-2xl font-bold",children:"3"})]}),n.jsxs("div",{className:"glass-morphism rounded-xl p-4 text-center",children:[n.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:"Questions"}),n.jsx("p",{className:"text-2xl font-bold",children:"12"})]}),n.jsxs("div",{className:"glass-morphism rounded-xl p-4 text-center",children:[n.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:"Streak"}),n.jsx("p",{className:"text-2xl font-bold",children:"2"}),n.jsx("p",{className:"text-xs text-explainify-600 dark:text-explainify-400",children:"days"})]})]})]})]}),n.jsxs("div",{className:"container py-8",children:[n.jsxs("h2",{className:"text-2xl font-semibold mb-8 flex items-center",children:[n.jsx(Xe,{className:"w-5 h-5 mr-2 text-explainify-500"}
476),n.jsx("span",{children:"Quick Actions"})]}),n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:s.map((o,u)=>n.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-2xl p-6 shadow-sm hover:shadow-md card-hover highlight-container border border-gray-100 dark:border-gray-700",children:[n.jsx("div",{className:`${o.color} w-14 h-14 rounded-xl flex items-center justify-center mb-5 shadow-sm`,children:n.jsx(o.icon,{className:"w-7 h-7"})}),n.jsx("h3",{className:"text-xl font-semibold mb-3",children:o.title}),n.jsx("p",{className:"text-muted-foreground mb-5 leading-relaxed",children:o.description}),n.jsx(ne,{to:o.link,children:n.jsxs(R,{className:"w-full gap-2 bg-explainify-50 hover:bg-explainify-100 text-explainify-600 dark:bg-explainify-900/30 dark:text-explainify-400 dark:hover:bg-explainify-900/50",children:["Get Started",n.jsx(mr,{className:"h-4 w-4"})]})})]},u))})]}),n.jsx("div",{className:"container py-8",children:n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[n.jsxs("div",{className:"lg:col-span-2",children:[n.jsxs("h2",{className:"text-2xl font-semibold mb-8 flex items-center",children:[n.jsx(Pe,{className:"w-5 h-5 mr-2 text-explainify-500"}),n.jsx("span",{children:"Content Tools"})]}),n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:a.map((o,u)=>n.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-2xl p-6 shadow-sm hover:shadow-md card-hover highlight-container border border-gray-100 dark:border-gray-700",children:[n.jsx("div",{className:`${o.color} w-14 h-14 rounded-xl flex items-center justify-center mb-5 shadow-sm`,children:n.jsx(o.icon,{className:"w-7 h-7"})}),n.jsx("h3",{className:"text-xl font-semibold mb-3",children:o.title}),n.jsx("p",{className:"text-muted-foreground mb-5 leading-relaxed",children:o.description}),n.jsx(ne,{to:o.link,children:n.jsxs(R,{className:"w-full gap-2 bg-explainify-50 hover:bg-explainify-100 text-explainify-600 dark:bg-explainify-900/30 dark:text-explainify-400 dark:hover:bg-explainify-900/50",children:["Try Now",n.jsx(mr,{className:"h-4 w-4"})]})})]},u))})]}),n.jsxs("div",{children:[n.jsxs("h2",{className:"text-2xl font-semibold mb-8 flex items-center",children:[n.jsx(gr,{className:"w-5 h-5 mr-2 text-explainify-500"}),n.jsx("span",{children:"Your Account"})]}),n.jsx(a4,{})]})]})}),n.jsxs("div",{className:"container py-8 pb-16",children:[n.jsxs("h2",{className:"text-2xl font-semibold mb-8 flex items-center",children:[n.jsx(ta,{className:"w-5 h-5 mr-2 text-explainify-500"}),n.jsx("span",{children:"Recent Activity"})]}),n.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-2xl p-8 shadow-sm border border-gray-100 dark:border-gray-700",children:n.jsxs("div",{className:"flex flex-col items-center justify-center py-10 text-center",children:[n.jsx("div",{className:"w-16 h-16 bg-explainify-100 dark:bg-explainify-900/50 rounded-full flex items-center justify-center mb-4",children:n.jsx(Vx,{className:"w-8 h-8 text-explainify-600 dark:text-explainify-400"})}),n.jsx("h3",{className:"text-xl font-medium mb-2",children:"No Recent Activity"}),n.jsx("p",{className:"text-muted-foreground max-w-md mb-6",children:"Start learning with our AI tools to see your activity here."}),n.jsx(R,{variant:"outline",className:"gap-2",asChild:!0,children:n.jsxs(ne,{to:"/ai-tutor",children:["Start Learning",n.jsx(mr,{className:"h-4 w-4"})]})})]})})]})]})})};function o4({children:e,defaultTheme:t="system",...r}){const[s,a]=f.useState(!1);return f.useEffect(()=>{a(!0)},[]),s?n.jsx(Yg,{attribute:"class",defaultTheme:t,enableSystem:!0,...r,children:e}):n.jsx(n.Fragment,{children:e})}var vl={},u4="@vercel/analytics",c4="1.5.0",l4=()=>{window.va||(window.va=function(...t){(window.vaq=window.vaq||[]).push(t)})};function Qm(){return typeof window<"u"}function Jm(){try{const e="production"}catch{}return"production"}function d4(e="auto"){if(e==="auto"){window.vam=Jm();return}window.vam=e}function f4(){return(Qm()?window.vam:Jm())||"production"}function To(){return f4()==="development"}function h4(e){return e.scriptSrc?e.scriptSrc:To()?"https://va.vercel-scripts.com/v1/script.debug.js":e.basePath?`${e.basePath}
476/insights/script.js`:"/_vercel/insights/script.js"}function m4(e={debug:!0}){var t;if(!Qm())return;d4(e.mode),l4(),e.beforeSend&&((t=window.va)==null||t.call(window,"beforeSend",e.beforeSend));const r=h4(e);if(document.head.querySelector(`script[src*="${r}"]`))return;const s=document.createElement("script");s.src=r,s.defer=!0,s.dataset.sdkn=u4+(e.framework?`/${e.framework}`:""),s.dataset.sdkv=c4,e.disableAutoTrack&&(s.dataset.disableAutoTrack="1"),e.endpoint?s.dataset.endpoint=e.endpoint:e.basePath&&(s.dataset.endpoint=`${e.basePath}/insights`),e.dsn&&(s.dataset.dsn=e.dsn),s.onerror=()=>{const a=To()?"Please check if any ad blockers are enabled and try again.":"Be sure to enable Web Analytics for your project and deploy again. See https://vercel.com/docs/analytics/quickstart for more information.";console.log(`[Vercel Web Analytics] Failed to load script from ${r}. ${a}`)},To()&&e.debug===!1&&(s.dataset.debug="false"),document.head.appendChild(s)}function p4({route:e,path:t}){var r;(r=window.va)==null||r.call(window,"pageview",{route:e,path:t})}function x4(){if(!(typeof process>"u"||typeof vl>"u"))return vl.REACT_APP_VERCEL_OBSERVABILITY_BASEPATH}function g4(e){return f.useEffect(()=>{var t;e.beforeSend&&((t=window.va)==null||t.call(window,"beforeSend",e.beforeSend))},[e.beforeSend]),f.useEffect(()=>{m4({framework:e.framework||"react",basePath:e.basePath??x4(),...e.route!==void 0&&{disableAutoTrack:!0},...e})},[]),f.useEffect(()=>{e.route&&e.path&&p4({route:e.route,path:e.path})},[e.route,e.path]),null}function Hs({children:e,requiresSubscription:t=!1,minTier:r="starter"}){const{user:s,isLoading:a,subscription:i,checkSubscription:o}=ke(),u=Mt(),[c,l]=f.useState(!1),[d,h]=f.useState(!1);if(f.useEffect(()=>{a||(async()=>{if(!t){h(!!s);return}if(s){l(!0);try{const p=await o();if(!p.isActive){L.error("Your subscription is not active",{description:"Please upgrade your plan to access this feature",duration:5e3}),h(!1);return}const x={starter:1,pro:2,teams:3},g=p.tier&&x[p.tier.toLowerCase()]||0,b=x[r];if(g<b){const v=r.charAt(0).toUpperCase()+r.slice(1);L.error(`This feature requires the ${v} plan or higher`,{description:"Please upgrade your subscription to access this feature",duration:5e3}),h(!1);return}h(!0)}catch(p){console.error("Error checking subscription status:",p),h(!1)}finally{l(!1)}}else h(!1)})()},[s,a,t,r,o]),a||c)return n.jsx("div",{className:"flex items-center justify-center min-h-screen",children:n.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-explainify-600"})});if(!d){if(!s)return n.jsx(nc,{to:`/auth?redirect=${encodeURIComponent(u.pathname)}`,replace:!0});if(t)return n.jsx(nc,{to:"/pricing",replace:!0})}return n.jsx(n.Fragment,{children:e})}const wl={};function b4(e){let t=wl[e];
476if(t)return t;t=wl[e]=[];for(let r=0;r<128;r++){const s=String.fromCharCode(r);t.push(s)}for(let r=0;r<e.length;r++){const s=e.charCodeAt(r);t[s]="%"+("0"+s.toString(16).toUpperCase()).slice(-2)}return t}function js(e,t){typeof t!="string"&&(t=js.defaultChars);const r=b4(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(s){let a="";for(let i=0,o=s.length;i<o;i+=3){const u=parseInt(s.slice(i+1,i+3),16);if(u<128){a+=r[u];continue}if((u&224)===192&&i+3<o){const c=parseInt(s.slice(i+4,i+6),16);if((c&192)===128){const l=u<<6&1984|c&63;l<128?a+="��":a+=String.fromCharCode(l),i+=3;continue}}if((u&240)===224&&i+6<o){const c=parseInt(s.slice(i+4,i+6),16),l=parseInt(s.slice(i+7,i+9),16);if((c&192)===128&&(l&192)===128){const d=u<<12&61440|c<<6&4032|l&63;d<2048||d>=55296&&d<=57343?a+="���":a+=String.fromCharCode(d),i+=6;continue}}if((u&248)===240&&i+9<o){const c=parseInt(s.slice(i+4,i+6),16),l=parseInt(s.slice(i+7,i+9),16),d=parseInt(s.slice(i+10,i+12),16);if((c&192)===128&&(l&192)===128&&(d&192)===128){let h=u<<18&1835008|c<<12&258048|l<<6&4032|d&63;h<65536||h>1114111?a+="����":(h-=65536,a+=String.fromCharCode(55296+(h>>10),56320+(h&1023))),i+=9;continue}}a+="�"}return a})}js.defaultChars=";/?:@&=+$,#";js.componentChars="";const _l={};function y4(e){let t=_l[e];if(t)return t;t=_l[e]=[];for(let r=0;r<128;r++){const s=String.fromCharCode(r);/^[0-9a-z]$/i.test(s)?t.push(s):t.push("%"+("0"+r.toString(16).toUpperCase()).slice(-2))}for(let r=0;r<e.length;r++)t[e.charCodeAt(r)]=e[r];return t}function Sn(e,t,r){typeof t!="string"&&(r=t,t=Sn.defaultChars),typeof r>"u"&&(r=!0);const s=y4(t);let a="";for(let i=0,o=e.length;i<o;i++){const u=e.charCodeAt(i);if(r&&u===37&&i+2<o&&/^[0-9a-f]{2}$/i.test(e.slice(i+1,i+3))){a+=e.slice(i,i+3),i+=2;continue}if(u<128){a+=s[u];continue}if(u>=55296&&u<=57343){if(u>=55296&&u<=56319&&i+1<o){const c=e.charCodeAt(i+1);if(c>=56320&&c<=57343){a+=encodeURIComponent(e[i]+e[i+1]),i++;continue}}a+="%EF%BF%BD";continue}a+=encodeURIComponent(e[i])}return a}Sn.defaultChars=";/?:@&=+$,-_.!~*'()#";Sn.componentChars="-_.!~*'()";function qu(e){let t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&e.hostname.indexOf(":")!==-1?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||"",t}function ga(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const v4=/^([a-z0-9.+-]+:)/i,w4=/:[0-9]*$/,_4=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,k4=["<",">",'"',"`"," ","\r",`
477`,"	"],j4=["{","}","|","\\","^","`"].concat(k4),N4=["'"].concat(j4),kl=["%","/","?",";","#"].concat(N4),jl=["/","?","#"],C4=255,Nl=/^[+a-z0-9A-Z_-]{0,63}$/,S4=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Cl={javascript:!0,"javascript:":!0},Sl={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Hu(e,t){if(e&&e instanceof ga)return e;const r=new ga;return r.parse(e,t),r}ga.prototype.parse=function(e,t){let r,s,a,i=e;if(i=i.trim(),!t&&e.split("#").length===1){const l=_4.exec(i);if(l)return this.pathname=l[1],l[2]&&(this.search=l[2]),this}let o=v4.exec(i);if(o&&(o=o[0],r=o.toLowerCase(),this.protocol=o,i=i.substr(o.length)),(t||o||i.match(/^\/\/[^@\/]+@[^@\/]+/))&&(a=i.substr(0,2)==="//",a&&!(o&&Cl[o])&&(i=i.substr(2),this.slashes=!0)),!Cl[o]&&(a||o&&!Sl[o])){let l=-1;for(let x=0;x<jl.length;x++)s=i.indexOf(jl[x]),s!==-1&&(l===-1||s<l)&&(l=s);let d,h;l===-1?h=i.lastIndexOf("@"):h=i.lastIndexOf("@",l),h!==-1&&(d=i.slice(0,h),i=i.slice(h+1),this.auth=d),l=-1;for(let x=0;x<kl.length;x++)s=i.indexOf(kl[x]),s!==-1&&(l===-1||s<l)&&(l=s);l===-1&&(l=i.length),i[l-1]===":"&&l--;const m=i.slice(0,l);i=i.slice(l),this.parseHost(m),this.hostname=this.hostname||"";const p=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!p){const x=this.hostname.split(/\./);for(let g=0,b=x.length;g<b;g++){const v=x[g];if(v&&!v.match(Nl)){let y="";for(let w=0,_=v.length;w<_;w++)v.charCodeAt(w)>127?y+="x":y+=v[w];if(!y.match(Nl)){const w=x.slice(0,g),_=x.slice(g+1),k=v.match(S4);k&&(w.push(k[1]),_.unshift(k[2])),_.length&&(i=_.join(".")+i),this.hostname=w.join(".");break}}}}this.hostname.length>C4&&(this.hostname=""),p&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const u=i.indexOf("#");u!==-1&&(this.hash=i.substr(u),i=i.slice(0,u));const c=i.indexOf("?");return c!==-1&&(this.search=i.substr(c),i=i.slice(0,c)),i&&(this.pathname=i),Sl[r]&&this.hostname&&!this.pathname&&(this.pathname=""),this};ga.prototype.parseHost=function(e){let t=w4.exec(e);t&&(t=t[0],t!==":"&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};const E4=Object.freeze(Object.defineProperty({__proto__:null,decode:js,encode:Sn,format:qu,parse:Hu},Symbol.toStringTag,{value:"Module"})),Zm=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Xm=/[\0-\x1F\x7F-\x9F]/,T4=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,Vu=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,ep=/[\$\+<->
477\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,tp=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,A4=Object.freeze(Object.defineProperty({__proto__:null,Any:Zm,Cc:Xm,Cf:T4,P:Vu,S:ep,Z:tp},Symbol.toStringTag,{value:"Module"})),P4
vendor: 8,319 bytes, line 477
477=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms�„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;æ«§ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapÓºÓ¾cr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpÔ¦Ôªon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋ĀipÕªÕ¯sts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0Ö£mallSquare;旼erySmallSquare;斪Ͱֺ\0Ö¿\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0Ú²f;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgÜ´Ü·r;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyÞ±Þµrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āeyß¶ß»dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;æ««y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;
vendor: 7,828 bytes, line 477
477쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;
vendor: 4,294 bytes, line 477
477䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;
vendor: 6,210 bytes, line 477
477astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌
477'.split("").map(e=>e.charCodeAt(0))),D4=new Uint16Array("Ȁaglq	��\x1BÉ­�\0\0�p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0)));var Ui;const R4=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),I4=(Ui=String.fromCodePoint)!==null&&Ui!==void 0?Ui:function(e){let t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|e&1023),t+=String.fromCharCode(e),t};function F4(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=R4.get(e))!==null&&t!==void 0?t:e}var Ee;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(Ee||(Ee={}));const M4=32;var hr;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(hr||(hr={}));function Ao(e){return e>=Ee.ZERO&&e<=Ee.NINE}function O4(e){return e>=Ee.UPPER_A&&e<=Ee.UPPER_F||e>=Ee.LOWER_A&&e<=Ee.LOWER_F}function L4(e){return e>=Ee.UPPER_A&&e<=Ee.UPPER_Z||e>=Ee.LOWER_A&&e<=Ee.LOWER_Z||Ao(e)}function $4(e){return e===Ee.EQUALS||L4(e)}var je;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(je||(je={}));var or;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(or||(or={}));class U4{constructor(t,r,s){this.decodeTree=t,this.emitCodePoint=r,this.errors=s,this.state=je.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=or.Strict}startEntity(t){this.decodeMode=t,this.state=je.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,r){switch(this.state){case je.EntityStart:return t.charCodeAt(r)===Ee.NUM?(this.state=je.NumericStart,this.consumed+=1,this.stateNumericStart(t,r+1)):(this.state=je.NamedEntity,this.stateNamedEntity(t,r));case je.NumericStart:return this.stateNumericStart(t,r);case je.NumericDecimal:return this.stateNumericDecimal(t,r);case je.NumericHex:return this.stateNumericHex(t,r);case je.NamedEntity:return this.stateNamedEntity(t,r)}}stateNumericStart(t,r){return r>=t.length?-1:(t.charCodeAt(r)|M4)===Ee.LOWER_X?(this.state=je.NumericHex,this.consumed+=1,this.stateNumericHex(t,r+1)):(this.state=je.NumericDecimal,this.stateNumericDecimal(t,r))}addToNumericResult(t,r,s,a){if(r!==s){const i=s-r;this.result=this.result*Math.pow(a,i)+parseInt(t.substr(r,i),a),this.consumed+=i}}stateNumericHex(t,r){const s=r;for(;r<t.length;){const a=t.charCodeAt(r);if(Ao(a)||O4(a))r+=1;else return this.addToNumericResult(t,s,r,16),this.emitNumericEntity(a,3)}return this.addToNumericResult(t,s,r,16),-1}stateNumericDecimal(t,r){const s=r;for(;r<t.length;){const a=t.charCodeAt(r);if(Ao(a))r+=1;else return this.addToNumericResult(t,s,r,10),this.emitNumericEntity(a,2)}return this.addToNumericResult(t,s,r,10),-1}emitNumericEntity(t,r){var s;if(this.consumed<=r)return(s=this.errors)===null||s===void 0||s.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===Ee.SEMI)this.consumed+=1;else if(this.decodeMode===or.Strict)return 0;return this.emitCodePoint(F4(this.result),this.consumed),this.errors&&(t!==Ee.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,r){const{decodeTree:s}=this;let a=s[this.treeIndex],i=(a&hr.VALUE_LENGTH)>>14;for(;r<t.length;r++,this.excess++){const o=t.charCodeAt(r);if(this.treeIndex=z4(s,a,this.treeIndex+Math.max(1,i),o),this.treeIndex<0)return this.result===0||this.decodeMode===or.Attribute&&(i===0||$4(o))?0:this.emitNotTerminatedNamedEntity();if(a=s[this.treeIndex],i=(a&hr.VALUE_LENGTH)>>
47714,i!==0){if(o===Ee.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==or.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:r,decodeTree:s}=this,a=(s[r]&hr.VALUE_LENGTH)>>14;return this.emitNamedEntityData(r,a,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,r,s){const{decodeTree:a}=this;return this.emitCodePoint(r===1?a[t]&~hr.VALUE_LENGTH:a[t+1],s),r===3&&this.emitCodePoint(a[t+2],s),s}end(){var t;switch(this.state){case je.NamedEntity:return this.result!==0&&(this.decodeMode!==or.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case je.NumericDecimal:return this.emitNumericEntity(0,2);case je.NumericHex:return this.emitNumericEntity(0,3);case je.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case je.EntityStart:return 0}}}function rp(e){let t="";const r=new U4(e,s=>t+=I4(s));return function(a,i){let o=0,u=0;for(;(u=a.indexOf("&",u))>=0;){t+=a.slice(o,u),r.startEntity(i);const l=r.write(a,u+1);if(l<0){o=u+r.end();break}o=u+l,u=l===0?o+1:o}const c=t+a.slice(o);return t="",c}}function z4(e,t,r,s){const a=(t&hr.BRANCH_LENGTH)>>7,i=t&hr.JUMP_TABLE;if(a===0)return i!==0&&s===i?r:-1;if(i){const c=s-i;return c<0||c>=a?-1:e[r+c]-1}let o=r,u=o+a-1;for(;o<=u;){const c=o+u>>>1,l=e[c];if(l<s)o=c+1;else if(l>s)u=c-1;else return e[c+a]}return-1}const B4=rp(P4);rp(D4);function sp(e,t=or.Legacy){return B4(e,t)}function q4(e){return Object.prototype.toString.call(e)}function Gu(e){return q4(e)==="[object String]"}const H4=Object.prototype.hasOwnProperty;function V4(e,t){return H4.call(e,t)}function ii(e){return Array.prototype.slice.call(arguments,1).forEach(function(r){if(r){if(typeof r!="object")throw new TypeError(r+"must be object");Object.keys(r).forEach(function(s){e[s]=r[s]})}}),e}function np(e,t,r){return[].concat(e.slice(0,t),r,e.slice(t+1))}function Wu(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function ba(e){if(e>65535){e-=65536;const t=55296+(e>>10),r=56320+(e&1023);return String.fromCharCode(t,r)}return String.fromCharCode(e)}const ap=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,G4=/&([a-z#][a-z0-9]{1,31});/gi,W4=new RegExp(ap.source+"|"+G4.source,"gi"),Y4=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function K4(e,t){if(t.charCodeAt(0)===35&&Y4.test(t)){const s=t[1].toLowerCase()==="x"?parseInt(t.slice(2),16):parseInt(t.slice(1),10);return Wu(s)?ba(s):e}const r=sp(e);return r!==e?r:e}function Q4(e){return e.indexOf("\\")<0?e:e.replace(ap,"$1")}function Ns(e){return e.indexOf("\\")<0&&e.indexOf("&")<0?e:e.replace(W4,function(t,r,s){return r||K4(t,s)})}const J4=/[&<>"]/,Z4=/[&<>"]/g,X4={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function ej(e){return X4[e]}function _r(e){return J4.test(e)?e.replace(Z4,ej):e}const tj=/[.?*+^$[\]\\(){}|-]/g;function rj(e){return e.replace(tj,"\\$&")}function ge(e){switch(e){case 9:case 32:return!0}return!1}function cn(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function ln(e){return Vu.test(e)||ep.test(e)}function dn(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function oi(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}const sj={mdurl:E4,ucmicro:A4},nj=Object.freeze(Object.defineProperty({__proto__:null,arrayReplaceAt:np,assign:ii,escapeHtml:_r,escapeRE:rj,fromCodePoint:ba,has:V4,isMdAsciiPunct:dn,isPunctChar:ln,isSpace:ge,isString:Gu,isValidEntityCode:Wu,isWhiteSpace:cn,lib:sj,normalizeReference:oi,unescapeAll:Ns,unescapeMd:Q4},Symbol.toStringTag,{value:"Module"}));function aj(e,t,r){let s,a,i,o;const u=e.posMax,c=e.pos;for(e.pos=t+1,s=1;e.pos<u;
477){if(i=e.src.charCodeAt(e.pos),i===93&&(s--,s===0)){a=!0;break}if(o=e.pos,e.md.inline.skipToken(e),i===91){if(o===e.pos-1)s++;else if(r)return e.pos=c,-1}}let l=-1;return a&&(l=e.pos),e.pos=c,l}function ij(e,t,r){let s,a=t;const i={ok:!1,pos:0,str:""};if(e.charCodeAt(a)===60){for(a++;a<r;){if(s=e.charCodeAt(a),s===10||s===60)return i;if(s===62)return i.pos=a+1,i.str=Ns(e.slice(t+1,a)),i.ok=!0,i;if(s===92&&a+1<r){a+=2;continue}a++}return i}let o=0;for(;a<r&&(s=e.charCodeAt(a),!(s===32||s<32||s===127));){if(s===92&&a+1<r){if(e.charCodeAt(a+1)===32)break;a+=2;continue}if(s===40&&(o++,o>32))return i;if(s===41){if(o===0)break;o--}a++}return t===a||o!==0||(i.str=Ns(e.slice(t,a)),i.pos=a,i.ok=!0),i}function oj(e,t,r,s){let a,i=t;const o={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(s)o.str=s.str,o.marker=s.marker;else{if(i>=r)return o;let u=e.charCodeAt(i);if(u!==34&&u!==39&&u!==40)return o;t++,i++,u===40&&(u=41),o.marker=u}for(;i<r;){if(a=e.charCodeAt(i),a===o.marker)return o.pos=i+1,o.str+=Ns(e.slice(t,i)),o.ok=!0,o;if(a===40&&o.marker===41)return o;a===92&&i+1<r&&i++,i++}return o.can_continue=!0,o.str+=Ns(e.slice(t,i)),o}const uj=Object.freeze(Object.defineProperty({__proto__:null,parseLinkDestination:ij,parseLinkLabel:aj,parseLinkTitle:oj},Symbol.toStringTag,{value:"Module"})),Lt={};Lt.code_inline=function(e,t,r,s,a){const i=e[t];return"<code"+a.renderAttrs(i)+">"+_r(i.content)+"</code>"};Lt.code_block=function(e,t,r,s,a){const i=e[t];return"<pre"+a.renderAttrs(i)+"><code>"+_r(e[t].content)+`</code></pre>
478`};Lt.fence=function(e,t,r,s,a){const i=e[t],o=i.info?Ns(i.info).trim():"";let u="",c="";if(o){const d=o.split(/(\s+)/g);u=d[0],c=d.slice(2).join("")}let l;if(r.highlight?l=r.highlight(i.content,u,c)||_r(i.content):l=_r(i.content),l.indexOf("<pre")===0)return l+`
479`;if(o){const d=i.attrIndex("class"),h=i.attrs?i.attrs.slice():[];d<0?h.push(["class",r.langPrefix+u]):(h[d]=h[d].slice(),h[d][1]+=" "+r.langPrefix+u);const m={attrs:h};return`<pre><code${a.renderAttrs(m)}>${l}</code></pre>
480`}return`<pre><code${a.renderAttrs(i)}>${l}</code></pre>
481`};Lt.image=function(e,t,r,s,a){const i=e[t];return i.attrs[i.attrIndex("alt")][1]=a.renderInlineAsText(i.children,r,s),a.renderToken(e,t,r)};Lt.hardbreak=function(e,t,r){return r.xhtmlOut?`<br />
482`:`<br>
483`};Lt.softbreak=function(e,t,r){return r.breaks?r.xhtmlOut?`<br />
484`:`<br>
485`:`
486`};Lt.text=function(e,t){return _r(e[t].content)};Lt.html_block=function(e,t){return e[t].content};Lt.html_inline=function(e,t){return e[t].content};function Us(){this.rules=ii({},Lt)}Us.prototype.renderAttrs=function(t){let r,s,a;if(!t.attrs)return"";for(a="",r=0,s=t.attrs.length;r<s;r++)a+=" "+_r(t.attrs[r][0])+'="'+_r(t.attrs[r][1])+'"';return a};Us.prototype.renderToken=function(t,r,s){const a=t[r];let i="";if(a.hidden)return"";a.block&&a.nesting!==-1&&r&&t[r-1].hidden&&(i+=`
487`),i+=(a.nesting===-1?"</":"<")+a.tag,i+=this.renderAttrs(a),a.nesting===0&&s.xhtmlOut&&(i+=" /");let o=!1;if(a.block&&(o=!0,a.nesting===1&&r+1<t.length)){const u=t[r+1];(u.type==="inline"||u.hidden||u.nesting===-1&&u.tag===a.tag)&&(o=!1)}return i+=o?`>
488`:">",i};Us.prototype.renderInline=function(e,t,r){let s="";const a=this.rules;for(let i=0,o=e.length;i<o;i++){const u=e[i].type;typeof a[u]<"u"?s+=a[u](e,i,t,r,this):s+=this.renderToken(e,i,t)}return s};Us.prototype.renderInlineAsText=function(e,t,r){let s="";for(let a=0,i=e.length;a<i;a++)switch(e[a].type){case"text":s+=e[a].content;break;case"image":s+=this.renderInlineAsText(e[a].children,t,r);break;case"html_inline":case"html_block":s+=e[a].content;break;case"softbreak":case"hardbreak":s+=`
489`;break}return s};Us.prototype.render=function(e,t,r){let s="";const a=this.rules;for(let i=0,o=e.length;i<o;i++){const u=e[i].type;u==="inline"?s+=this.renderInline(e[i].children,t,r):typeof a[u]<"u"?s+=a[u](e,i,t,r,this):s+=this.renderToken(e,i,t,r)}return s};function Ge(){this.__rules__=[],this.__cache__=null}Ge.prototype.__find__=function(e){for(let t=0;t<this.__rules__.length;t++)if(this.__rules__[t].name===e)return t;return-1};Ge.prototype.__compile__=function(){const e=this,t=[""];e.__rules__.forEach(function(r){r.enabled&&r.alt.forEach(function(s){t.indexOf(s)<0&&t.push(s)})}),e.__cache__={},t.forEach(function(r){e.__cache__[r]=[],e.__rules__.forEach(function(s){s.enabled&&(r&&s.alt.indexOf(r)<0||e.__cache__[r].push(s.fn))})})};Ge.prototype.at=function(e,t,r){const s=this.__find__(e),a=r||{};if(s===-1)throw new Error("Parser rule not found: "+e);this.__rules__[s].fn=t,this.__rules__[s].alt=a.alt||[],this.__cache__=null};Ge.prototype.before=function(e,t,r,s){const a=this.__find__(e),i=s||{};if(a===-1)throw new Error("Parser rule not found: "+e);this.__rules__.splice(a,0,{name:t,enabled:!0,fn:r,alt:i.alt||[]}),this.__cache__=null};Ge.prototype.after=function(e,t,r,s){const a=this.__find__(e),i=s||{};if(a===-1)throw new Error("Parser rule not found: "+e);this.__rules__.splice(a+1,0,{name:t,enabled:!0,fn:r,alt:i.alt||[]}),this.__cache__=null};Ge.prototype.push=function(e,t,r){const s=r||{};this.__rules__.push({name:e,enabled:!0,fn:t,alt:s.alt||[]}),this.__cache__=null};Ge.prototype.enable=function(e,t){Array.isArray(e)||(e=[e]);const r=[];return e.forEach(function(s){const a=this.__find__(s);if(a<0){if(t)return;throw new Error("Rules manager: invalid rule name "+s)}this.__rules__[a].enabled=!0,r.push(s)},this),this.__cache__=null,r};
489Ge.prototype.enableOnly=function(e,t){Array.isArray(e)||(e=[e]),this.__rules__.forEach(function(r){r.enabled=!1}),this.enable(e,t)};Ge.prototype.disable=function(e,t){Array.isArray(e)||(e=[e]);const r=[];return e.forEach(function(s){const a=this.__find__(s);if(a<0){if(t)return;throw new Error("Rules manager: invalid rule name "+s)}this.__rules__[a].enabled=!1,r.push(s)},this),this.__cache__=null,r};Ge.prototype.getRules=function(e){return this.__cache__===null&&this.__compile__(),this.__cache__[e]||[]};function vt(e,t,r){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=r,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}vt.prototype.attrIndex=function(t){if(!this.attrs)return-1;const r=this.attrs;for(let s=0,a=r.length;s<a;s++)if(r[s][0]===t)return s;return-1};vt.prototype.attrPush=function(t){this.attrs?this.attrs.push(t):this.attrs=[t]};vt.prototype.attrSet=function(t,r){const s=this.attrIndex(t),a=[t,r];s<0?this.attrPush(a):this.attrs[s]=a};vt.prototype.attrGet=function(t){const r=this.attrIndex(t);let s=null;return r>=0&&(s=this.attrs[r][1]),s};vt.prototype.attrJoin=function(t,r){const s=this.attrIndex(t);s<0?this.attrPush([t,r]):this.attrs[s][1]=this.attrs[s][1]+" "+r};function ip(e,t,r){this.src=e,this.env=r,this.tokens=[],this.inlineMode=!1,this.md=t}ip.prototype.Token=vt;const cj=/\r\n?|\n/g,lj=/\0/g;function dj(e){let t;t=e.src.replace(cj,`
490`),t=t.replace(lj,"�"),e.src=t}function fj(e){let t;e.inlineMode?(t=new e.Token("inline","",0),t.content=e.src,t.map=[0,1],t.children=[],e.tokens.push(t)):e.md.block.parse(e.src,e.md,e.env,e.tokens)}function hj(e){const t=e.tokens;for(let r=0,s=t.length;r<s;r++){const a=t[r];a.type==="inline"&&e.md.inline.parse(a.content,e.md,e.env,a.children)}}function mj(e){return/^<a[>\s]/i.test(e)}function pj(e){return/^<\/a\s*>/i.test(e)}function xj(e){const t=e.tokens;if(e.md.options.linkify)for(let r=0,s=t.length;r<s;r++){if(t[r].type!=="inline"||!e.md.linkify.pretest(t[r].content))continue;let a=t[r].children,i=0;for(let o=a.length-1;o>=0;o--){const u=a[o];if(u.type==="link_close"){for(o--;a[o].level!==u.level&&a[o].type!=="link_open";)o--;continue}if(u.type==="html_inline"&&(mj(u.content)&&i>0&&i--,pj(u.content)&&i++),!(i>0)&&u.type==="text"&&e.md.linkify.test(u.content)){const c=u.content;let l=e.md.linkify.match(c);const d=[];let h=u.level,m=0;l.length>0&&l[0].index===0&&o>0&&a[o-1].type==="text_special"&&(l=l.slice(1));for(let p=0;p<l.length;p++){const x=l[p].url,g=e.md.normalizeLink(x);if(!e.md.validateLink(g))continue;let b=l[p].text;l[p].schema?l[p].schema==="mailto:"&&!/^mailto:/i.test(b)?b=e.md.normalizeLinkText("mailto:"+b).replace(/^mailto:/,""):b=e.md.normalizeLinkText(b):b=e.md.normalizeLinkText("http://"+b).replace(/^http:\/\//,"");const v=l[p].index;if(v>m){const k=new e.Token("text","",0);k.content=c.slice(m,v),k.level=h,d.push(k)}const y=new e.Token("link_open","a",1);y.attrs=[["href",g]],y.level=h++,y.markup="linkify",y.info="auto",d.push(y);const w=new e.Token("text","",0);w.content=b,w.level=h,d.push(w);const _=new e.Token("link_close","a",-1);_.level=--h,_.markup="linkify",_.info="auto",d.push(_),m=l[p].lastIndex}if(m<c.length){const p=new e.Token("text","",0);p.content=c.slice(m),p.level=h,d.push(p)}t[r].children=a=np(a,o,d)}}}}const op=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,gj=/\((c|tm|r)\)/i,bj=/\((c|tm|r)\)/ig,yj={c:"©",r:"®",tm:"™"};function vj(e,t){return yj[t.toLowerCase()]}function wj(e){let t=0;for(let r=e.length-1;r>=0;r--){const s=e[r];s.type==="text"&&!t&&(s.content=s.content.replace(bj,vj)),s.type==="link_open"&&s.info==="auto"&&t--,s.type==="link_close"&&s.info==="auto"&&t++}}function _j(e){let t=0;for(let r=e.length-1;r>=0;r--){const s=e[r];s.type==="text"&&!t&&op.test(s.content)&&(s.content=s.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1—").replace(/(^|\s)--(?=\s|$)/mg,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1–")),s.type==="link_open"&&s.info==="auto"&&t--,s.type==="link_close"&&s.info==="auto"&&t++}}function kj(e){let t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)e.tokens[t].type==="inline"&&(gj.test(e.tokens[t].content)&&wj(e.tokens[t].children),op.test(e.tokens[t].content)&&_j(e.tokens[t].children))}const jj=/['"]/,El=/['"]/g,Tl="’";function Wn(e,t,r){return e.slice(0,t)+r+e.slice(t+1)}function Nj(e,t){let r;const s=[];for(let a=0;a<e.length;a++){const i=e[a],o=e[a].level;for(r=s.length-1;r>=0&&!(s[r].level<=o);r--);if(s.length=r+1,i.type!=="text")continue;let u=i.content,c=0,l=u.length;e:for(;c<l;){El.lastIndex=c;const d=El.exec(u);if(!d)break;let h=!0,m=!0;c=d.index+1;const p=d[0]==="'";let x=32;if(d.index-1>=0)x=u.charCodeAt(d.index-1);else for(r=a-1;r>=0&&!(e[r].type==="softbreak"||e[r].type==="hardbreak");r--)if(e[r].content){x=e[r].content.charCodeAt(e[r].content.length-1);break}let g=32;if(c<l)g=u.charCodeAt(c);else for(r=a+1;r<e.length&&!(e[r].type==="softbreak"||e[r].type==="hardbreak");r++)if(e[r].content){g=e[r].content.charCodeAt(0);break}const b=dn(x)||ln(String.fromCharCode(x)),v=dn(g)||ln(String.fromCharCode(g)),y=cn(x),w=cn(g);if(w?h=!1:v&&(y||b||(h=!1)),y?m=!1:b&&(w||v||(m=!1)),g===34&&d[0]==='"'&&x>=48&&x<=57&&(m=h=!1),h&&m&&(h=b,m=v),!h&&!m){p&&(i.content=Wn(i.content,d.index,Tl));continue}if(m)for(r=s.length-1;r>=0;r--){let _=s[r];if(s[r].level<o)break;if(_.single===p&&s[r].level===o){_=s[r];let k,N;p?(k=t.md.options.quotes[2],N=t.md.options.quotes[3]):(k=t.md.options.quotes[0],N=t.md.options.quotes[1]),i.content=Wn(i.content,d.index,N),e[_.token].content=Wn(e[_.token].content,_.pos,k),c+=N.length-1,_.token===a&&(c+=k.length-1),u=i.content,l=u.length,s.length=r;continue e}}h?s.push({token:a,pos:d.index,single:p,level:o}):m&&p&&(i.content=Wn(i.content,d.index,Tl))}}}function Cj(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--)e.tokens[t].type!=="inline"||!jj.test(e.tokens[t].content)||Nj(e.tokens[t].children,e)}function Sj(e){let t,r;const s=e.tokens,a=s.length;for(let i=0;i<a;i++){if(s[i].type!=="inline")continue;const o=s[i].children,u=o.length;for(t=0;t<u;
490t++)o[t].type==="text_special"&&(o[t].type="text");for(t=r=0;t<u;t++)o[t].type==="text"&&t+1<u&&o[t+1].type==="text"?o[t+1].content=o[t].content+o[t+1].content:(t!==r&&(o[r]=o[t]),r++);t!==r&&(o.length=r)}}const zi=[["normalize",dj],["block",fj],["inline",hj],["linkify",xj],["replacements",kj],["smartquotes",Cj],["text_join",Sj]];function Yu(){this.ruler=new Ge;for(let e=0;e<zi.length;e++)this.ruler.push(zi[e][0],zi[e][1])}Yu.prototype.process=function(e){const t=this.ruler.getRules("");for(let r=0,s=t.length;r<s;r++)t[r](e)};Yu.prototype.State=ip;function $t(e,t,r,s){this.src=e,this.md=t,this.env=r,this.tokens=s,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType="root",this.level=0;const a=this.src;for(let i=0,o=0,u=0,c=0,l=a.length,d=!1;o<l;o++){const h=a.charCodeAt(o);if(!d)if(ge(h)){u++,h===9?c+=4-c%4:c++;continue}else d=!0;(h===10||o===l-1)&&(h!==10&&o++,this.bMarks.push(i),this.eMarks.push(o),this.tShift.push(u),this.sCount.push(c),this.bsCount.push(0),d=!1,u=0,c=0,i=o+1)}this.bMarks.push(a.length),this.eMarks.push(a.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}$t.prototype.push=function(e,t,r){const s=new vt(e,t,r);return s.block=!0,r<0&&this.level--,s.level=this.level,r>0&&this.level++,this.tokens.push(s),s};$t.prototype.isEmpty=function(t){return this.bMarks[t]+this.tShift[t]>=this.eMarks[t]};$t.prototype.skipEmptyLines=function(t){for(let r=this.lineMax;t<r&&!(this.bMarks[t]+this.tShift[t]<this.eMarks[t]);t++);return t};$t.prototype.skipSpaces=function(t){for(let r=this.src.length;t<r;t++){const s=this.src.charCodeAt(t);if(!ge(s))break}return t};$t.prototype.skipSpacesBack=function(t,r){if(t<=r)return t;for(;t>r;)if(!ge(this.src.charCodeAt(--t)))return t+1;return t};$t.prototype.skipChars=function(t,r){for(let s=this.src.length;t<s&&this.src.charCodeAt(t)===r;t++);return t};$t.prototype.skipCharsBack=function(t,r,s){if(t<=s)return t;for(;t>s;)if(r!==this.src.charCodeAt(--t))return t+1;return t};$t.prototype.getLines=function(t,r,s,a){if(t>=r)return"";const i=new Array(r-t);for(let o=0,u=t;u<r;u++,o++){let c=0;const l=this.bMarks[u];let d=l,h;for(u+1<r||a?h=this.eMarks[u]+1:h=this.eMarks[u];d<h&&c<s;){const m=this.src.charCodeAt(d);if(ge(m))m===9?c+=4-(c+this.bsCount[u])%4:c++;else if(d-l<this.tShift[u])c++;else break;d++}c>s?i[o]=new Array(c-s+1).join(" ")+this.src.slice(d,h):i[o]=this.src.slice(d,h)}return i.join("")};$t.prototype.Token=vt;const Ej=65536;function Bi(e,t){const r=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];return e.src.slice(r,s)}function Al(e){const t=[],r=e.length;let s=0,a=e.charCodeAt(s),i=!1,o=0,u="";for(;s<r;)a===124&&(i?(u+=e.substring(o,s-1),o=s):(t.push(u+e.substring(o,s)),u="",o=s+1)),i=a===92,s++,a=e.charCodeAt(s);return t.push(u+e.substring(o)),t}function Tj(e,t,r,s){if(t+2>r)return!1;let a=t+1;if(e.sCount[a]<e.blkIndent||e.sCount[a]-e.blkIndent>=4)return!1;let i=e.bMarks[a]+e.tShift[a];if(i>=e.eMarks[a])return!1;const o=e.src.charCodeAt(i++);if(o!==124&&o!==45&&o!==58||i>=e.eMarks[a])return!1;const u=e.src.charCodeAt(i++);if(u!==124&&u!==45&&u!==58&&!ge(u)||o===45&&ge(u))return!1;for(;i<e.eMarks[a];){const _=e.src.charCodeAt(i);if(_!==124&&_!==45&&_!==58&&!ge(_))return!1;i++}let c=Bi(e,t+1),l=c.split("|");const d=[];for(let _=0;_<l.length;_++){const k=l[_].trim();if(!k){if(_===0||_===l.length-1)continue;return!1}if(!/^:?-+:?$/.test(k))return!1;k.charCodeAt(k.length-1)===58?d.push(k.charCodeAt(0)===58?"center":"right"):k.charCodeAt(0)===58?d.push("left"):d.push("")}if(c=Bi(e,t).trim(),c.indexOf("|")===-1||e.sCount[t]-e.blkIndent>=4)return!1;l=Al(c),l.length&&l[0]===""&&l.shift(),l.length&&l[l.length-1]===""&&l.pop();const h=l.length;if(h===0||h!==d.length)return!1;if(s)return!0;const m=e.parentType;e.parentType="table";const p=e.md.block.ruler.getRules("blockquote"),x=e.push("table_open","table",1),g=[t,0];x.map=g;const b=e.push("thead_open","thead",1);b.map=[t,t+1];const v=e.push("tr_open","tr",1);v.map=[t,t+1];for(let _=0;_<l.length;_++){const k=e.push("th_open","th",1);d[_]&&(k.attrs=[["style","text-align:"+d[_]]]);const N=e.push("inline","",0);N.content=l[_].trim(),N.children=[],e.push("th_close","th",-1)}e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let y,w=0;for(a=t+2;a<r&&!(e.sCount[a]<e.blkIndent);a++){let _=!1;for(let N=0,j=p.length;N<j;N++)if(p[N](e,a,r,!0)){_=!0;break}if(_||(c=Bi(e,a).trim(),!c)||e.sCount[a]-e.blkIndent>=4||(l=Al(c),l.length&&l[0]===""&&l.shift(),l.length&&l[l.length-1]===""&&l.pop(),w+=h-l.length,w>Ej))break;if(a===t+2){const N=e.push("tbody_open","tbody",1);N.map=y=[t+2,0]}const k=e.push("tr_open","tr",1);k.map=[a,a+1];for(let N=0;N<h;N++){const j=e.push("td_open","td",1);d[N]&&(j.attrs=[["style","text-align:"+d[N]]]);const C=e.push("inline","",0);C.content=l[N]?l[N].trim():"",C.children=[],e.push("td_close","td",-1)}e.push("tr_close","tr",-1)}return y&&(e.push("tbody_close","tbody",-1),y[1]=a),e.push("table_close","table",-1),g[1]=a,e.parentType=m,e.line=a,!0}function Aj(e,t,r){if(e.sCount[t]-e.blkIndent<4)return!1;let s=t+1,a=s;for(;s<r;){if(e.isEmpty(s)){s++;continue}if(e.sCount[s]-e.blkIndent>=4){s++,a=s;continue}break}e.line=a;const i=e.push("code_block","code",0);return i.content=e.getLines(t,a,4+e.blkIndent,!1)+`
491`,i.map=[t,e.line],!0}function Pj(e,t,r,s){let a=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||a+3>i)return!1;
vendor: 4,105 bytes, line 491
491const o=e.src.charCodeAt(a);if(o!==126&&o!==96)return!1;let u=a;a=e.skipChars(a,o);let c=a-u;if(c<3)return!1;const l=e.src.slice(u,a),d=e.src.slice(a,i);if(o===96&&d.indexOf(String.fromCharCode(o))>=0)return!1;if(s)return!0;let h=t,m=!1;for(;h++,!(h>=r||(a=u=e.bMarks[h]+e.tShift[h],i=e.eMarks[h],a<i&&e.sCount[h]<e.blkIndent));)if(e.src.charCodeAt(a)===o&&!(e.sCount[h]-e.blkIndent>=4)&&(a=e.skipChars(a,o),!(a-u<c)&&(a=e.skipSpaces(a),!(a<i)))){m=!0;break}c=e.sCount[t],e.line=h+(m?1:0);const p=e.push("fence","code",0);return p.info=d,p.content=e.getLines(t+1,h,c,!0),p.markup=l,p.map=[t,e.line],!0}function Dj(e,t,r,s){let a=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];const o=e.lineMax;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(a)!==62)return!1;if(s)return!0;const u=[],c=[],l=[],d=[],h=e.md.block.ruler.getRules("blockquote"),m=e.parentType;e.parentType="blockquote";let p=!1,x;for(x=t;x<r;x++){const w=e.sCount[x]<e.blkIndent;if(a=e.bMarks[x]+e.tShift[x],i=e.eMarks[x],a>=i)break;if(e.src.charCodeAt(a++)===62&&!w){let k=e.sCount[x]+1,N,j;e.src.charCodeAt(a)===32?(a++,k++,j=!1,N=!0):e.src.charCodeAt(a)===9?(N=!0,(e.bsCount[x]+k)%4===3?(a++,k++,j=!1):j=!0):N=!1;let C=k;for(u.push(e.bMarks[x]),e.bMarks[x]=a;a<i;){const I=e.src.charCodeAt(a);if(ge(I))I===9?C+=4-(C+e.bsCount[x]+(j?1:0))%4:C++;else break;a++}p=a>=i,c.push(e.bsCount[x]),e.bsCount[x]=e.sCount[x]+1+(N?1:0),l.push(e.sCount[x]),e.sCount[x]=C-k,d.push(e.tShift[x]),e.tShift[x]=a-e.bMarks[x];continue}if(p)break;let _=!1;for(let k=0,N=h.length;k<N;k++)if(h[k](e,x,r,!0)){_=!0;break}if(_){e.lineMax=x,e.blkIndent!==0&&(u.push(e.bMarks[x]),c.push(e.bsCount[x]),d.push(e.tShift[x]),l.push(e.sCount[x]),e.sCount[x]-=e.blkIndent);break}u.push(e.bMarks[x]),c.push(e.bsCount[x]),d.push(e.tShift[x]),l.push(e.sCount[x]),e.sCount[x]=-1}const g=e.blkIndent;e.blkIndent=0;const b=e.push("blockquote_open","blockquote",1);b.markup=">";const v=[t,0];b.map=v,e.md.block.tokenize(e,t,x);const y=e.push("blockquote_close","blockquote",-1);y.markup=">",e.lineMax=o,e.parentType=m,v[1]=e.line;for(let w=0;w<d.length;w++)e.bMarks[w+t]=u[w],e.tShift[w+t]=d[w],e.sCount[w+t]=l[w],e.bsCount[w+t]=c[w];return e.blkIndent=g,!0}function Rj(e,t,r,s){const a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let i=e.bMarks[t]+e.tShift[t];const o=e.src.charCodeAt(i++);if(o!==42&&o!==45&&o!==95)return!1;let u=1;for(;i<a;){const l=e.src.charCodeAt(i++);if(l!==o&&!ge(l))return!1;l===o&&u++}if(u<3)return!1;if(s)return!0;e.line=t+1;const c=e.push("hr","hr",0);return c.map=[t,e.line],c.markup=Array(u+1).join(String.fromCharCode(o)),!0}function Pl(e,t){const r=e.eMarks[t];let s=e.bMarks[t]+e.tShift[t];const a=e.src.charCodeAt(s++);if(a!==42&&a!==45&&a!==43)return-1;if(s<r){const i=e.src.charCodeAt(s);if(!ge(i))return-1}return s}function Dl(e,t){const r=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];let a=r;if(a+1>=s)return-1;let i=e.src.charCodeAt(a++);if(i<48||i>57)return-1;for(;;){if(a>=s)return-1;if(i=e.src.charCodeAt(a++),i>=48&&i<=57){if(a-r>=10)return-1;continue}if(i===41||i===46)break;return-1}return a<s&&(i=e.src.charCodeAt(a),!ge(i))?-1:a}function Ij(e,t){const r=e.level+2;for(let s=t+2,a=e.tokens.length-2;s<a;s++)e.tokens[s].level===r&&e.tokens[s].type==="paragraph_open"&&(e.tokens[s+2].hidden=!0,e.tokens[s].hidden=!0,s+=2)}function Fj(e,t,r,s){let a,i,o,u,c=t,l=!0;if(e.sCount[c]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[c]-e.listIndent>=4&&e.sCount[c]<e.blkIndent)return!1;let d=!1;s&&e.parentType==="paragraph"&&e.sCount[c]>=e.blkIndent&&(d=!0);let h,m,p;if((p=Dl(e,c))>=0){if(h=!0,o=e.bMarks[c]+e.tShift[c],m=Number(e.src.slice(o,p-1)),d&&m!==1)return!1}else if((p=Pl(e,c))>=0)h=!1;else return!1;if(d&&e.skipSpaces(p)>=e.eMarks[c])return!1;if(s)return!0;const x=e.src.charCodeAt(p-1),g=e.tokens.length;h?(u=e.push("ordered_list_open","ol",1),m!==1&&(u.attrs=[["start",m]])):u=e.push("bullet_list_open","ul",1);const b=[c,0];u.map=b,u.markup=String.fromCharCode(x);let v=!1;const y=e.md.block.ruler.getRules("list"),w=e.parentType;for(e.parentType="list";c<r;){i=p,a=e.eMarks[c];const _=e.sCount[c]+p-(e.bMarks[c]+e.tShift[c]);let k=_;for(;i<a;
491){const Y=e.src.charCodeAt(i);if(Y===9)k+=4-(k+e.bsCount[c])%4;else if(Y===32)k++;else break;i++}const N=i;let j;N>=a?j=1:j=k-_,j>4&&(j=1);const C=_+j;u=e.push("list_item_open","li",1),u.markup=String.fromCharCode(x);const I=[c,0];u.map=I,h&&(u.info=e.src.slice(o,p-1));const A=e.tight,F=e.tShift[c],E=e.sCount[c],U=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=C,e.tight=!0,e.tShift[c]=N-e.bMarks[c],e.sCount[c]=k,N>=a&&e.isEmpty(c+1)?e.line=Math.min(e.line+2,r):e.md.block.tokenize(e,c,r,!0),(!e.tight||v)&&(l=!1),v=e.line-c>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=U,e.tShift[c]=F,e.sCount[c]=E,e.tight=A,u=e.push("list_item_close","li",-1),u.markup=String.fromCharCode(x),c=e.line,I[1]=c,c>=r||e.sCount[c]<e.blkIndent||e.sCount[c]-e.blkIndent>=4)break;let P=!1;for(let Y=0,M=y.length;Y<M;Y++)if(y[Y](e,c,r,!0)){P=!0;break}if(P)break;if(h){if(p=Dl(e,c),p<0)break;o=e.bMarks[c]+e.tShift[c]}else if(p=Pl(e,c),p<0)break;if(x!==e.src.charCodeAt(p-1))break}return h?u=e.push("ordered_list_close","ol",-1):u=e.push("bullet_list_close","ul",-1),u.markup=String.fromCharCode(x),b[1]=c,e.line=c,e.parentType=w,l&&Ij(e,g),!0}function Mj(e,t,r,s){let a=e.bMarks[t]+e.tShift[t],i=e.eMarks[t],o=t+1;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(a)!==91)return!1;function u(y){const w=e.lineMax;if(y>=w||e.isEmpty(y))return null;let _=!1;if(e.sCount[y]-e.blkIndent>3&&(_=!0),e.sCount[y]<0&&(_=!0),!_){const j=e.md.block.ruler.getRules("reference"),C=e.parentType;e.parentType="reference";let I=!1;for(let A=0,F=j.length;A<F;A++)if(j[A](e,y,w,!0)){I=!0;break}if(e.parentType=C,I)return null}const k=e.bMarks[y]+e.tShift[y],N=e.eMarks[y];return e.src.slice(k,N+1)}let c=e.src.slice(a,i+1);i=c.length;let l=-1;for(a=1;a<i;a++){const y=c.charCodeAt(a);if(y===91)return!1;if(y===93){l=a;break}else if(y===10){const w=u(o);w!==null&&(c+=w,i=c.length,o++)}else if(y===92&&(a++,a<i&&c.charCodeAt(a)===10)){const w=u(o);w!==null&&(c+=w,i=c.length,o++)}}if(l<0||c.charCodeAt(l+1)!==58)return!1;for(a=l+2;a<i;a++){const y=c.charCodeAt(a);if(y===10){const w=u(o);w!==null&&(c+=w,i=c.length,o++)}else if(!ge(y))break}const d=e.md.helpers.parseLinkDestination(c,a,i);if(!d.ok)return!1;const h=e.md.normalizeLink(d.str);if(!e.md.validateLink(h))return!1;a=d.pos;const m=a,p=o,x=a;for(;a<i;a++){const y=c.charCodeAt(a);if(y===10){const w=u(o);w!==null&&(c+=w,i=c.length,o++)}else if(!ge(y))break}let g=e.md.helpers.parseLinkTitle(c,a,i);for(;g.can_continue;){const y=u(o);if(y===null)break;c+=y,a=i,i=c.length,o++,g=e.md.helpers.parseLinkTitle(c,a,i,g)}let b;for(a<i&&x!==a&&g.ok?(b=g.str,a=g.pos):(b="",a=m,o=p);a<i;){const y=c.charCodeAt(a);if(!ge(y))break;a++}if(a<i&&c.charCodeAt(a)!==10&&b)for(b="",a=m,o=p;a<i;){const y=c.charCodeAt(a);if(!ge(y))break;a++}if(a<i&&c.charCodeAt(a)!==10)return!1;const v=oi(c.slice(1,l));return v?(s||(typeof e.env.references>"u"&&(e.env.references={}),typeof e.env.references[v]>"u"&&(e.env.references[v]={title:b,href:h}),e.line=o),!0):!1}const Oj=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Lj="[a-zA-Z_:][a-zA-Z0-9:._-]*",$j="[^\"'=<>`\\x00-\\x20]+",Uj="'[^']*'",zj='"[^"]*"',Bj="(?:"+$j+"|"+Uj+"|"+zj+")",qj="(?:\\s+"+Lj+"(?:\\s*=\\s*"+Bj+")?)",up="<[A-Za-z][A-Za-z0-9\\-]*"+qj+"*\\s*\\/?>",cp="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",Hj="<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->",Vj="<[?][\\s\\S]*?[?]>",Gj="<![A-Za-z][^>]*>",Wj="<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",Yj=new RegExp("^(?:"+up+"|"+cp+"|"+Hj+"|"+Vj+"|"+Gj+"|"+Wj+")"),Kj=new RegExp("^(?:"+up+"|"+cp+")"),es=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+Oj.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(Kj.source+"\\s*$"),/^$/,!1]];function Qj(e,t,r,s){let a=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>
491=4||!e.md.options.html||e.src.charCodeAt(a)!==60)return!1;let o=e.src.slice(a,i),u=0;for(;u<es.length&&!es[u][0].test(o);u++);if(u===es.length)return!1;if(s)return es[u][2];let c=t+1;if(!es[u][1].test(o)){for(;c<r&&!(e.sCount[c]<e.blkIndent);c++)if(a=e.bMarks[c]+e.tShift[c],i=e.eMarks[c],o=e.src.slice(a,i),es[u][1].test(o)){o.length!==0&&c++;break}}e.line=c;const l=e.push("html_block","",0);return l.map=[t,c],l.content=e.getLines(t,c,e.blkIndent,!0),!0}function Jj(e,t,r,s){let a=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let o=e.src.charCodeAt(a);if(o!==35||a>=i)return!1;let u=1;for(o=e.src.charCodeAt(++a);o===35&&a<i&&u<=6;)u++,o=e.src.charCodeAt(++a);if(u>6||a<i&&!ge(o))return!1;if(s)return!0;i=e.skipSpacesBack(i,a);const c=e.skipCharsBack(i,35,a);c>a&&ge(e.src.charCodeAt(c-1))&&(i=c),e.line=t+1;const l=e.push("heading_open","h"+String(u),1);l.markup="########".slice(0,u),l.map=[t,e.line];const d=e.push("inline","",0);d.content=e.src.slice(a,i).trim(),d.map=[t,e.line],d.children=[];const h=e.push("heading_close","h"+String(u),-1);return h.markup="########".slice(0,u),!0}function Zj(e,t,r){const s=e.md.block.ruler.getRules("paragraph");if(e.sCount[t]-e.blkIndent>=4)return!1;const a=e.parentType;e.parentType="paragraph";let i=0,o,u=t+1;for(;u<r&&!e.isEmpty(u);u++){if(e.sCount[u]-e.blkIndent>3)continue;if(e.sCount[u]>=e.blkIndent){let p=e.bMarks[u]+e.tShift[u];const x=e.eMarks[u];if(p<x&&(o=e.src.charCodeAt(p),(o===45||o===61)&&(p=e.skipChars(p,o),p=e.skipSpaces(p),p>=x))){i=o===61?1:2;break}}if(e.sCount[u]<0)continue;let m=!1;for(let p=0,x=s.length;p<x;p++)if(s[p](e,u,r,!0)){m=!0;break}if(m)break}if(!i)return!1;const c=e.getLines(t,u,e.blkIndent,!1).trim();e.line=u+1;const l=e.push("heading_open","h"+String(i),1);l.markup=String.fromCharCode(o),l.map=[t,e.line];const d=e.push("inline","",0);d.content=c,d.map=[t,e.line-1],d.children=[];const h=e.push("heading_close","h"+String(i),-1);return h.markup=String.fromCharCode(o),e.parentType=a,!0}function Xj(e,t,r){const s=e.md.block.ruler.getRules("paragraph"),a=e.parentType;let i=t+1;for(e.parentType="paragraph";i<r&&!e.isEmpty(i);i++){if(e.sCount[i]-e.blkIndent>3||e.sCount[i]<0)continue;let l=!1;for(let d=0,h=s.length;d<h;d++)if(s[d](e,i,r,!0)){l=!0;break}if(l)break}const o=e.getLines(t,i,e.blkIndent,!1).trim();e.line=i;const u=e.push("paragraph_open","p",1);u.map=[t,e.line];const c=e.push("inline","",0);return c.content=o,c.map=[t,e.line],c.children=[],e.push("paragraph_close","p",-1),e.parentType=a,!0}const Yn=[["table",Tj,["paragraph","reference"]],["code",Aj],["fence",Pj,["paragraph","reference","blockquote","list"]],["blockquote",Dj,["paragraph","reference","blockquote","list"]],["hr",Rj,["paragraph","reference","blockquote","list"]],["list",Fj,["paragraph","reference","blockquote"]],["reference",Mj],["html_block",Qj,["paragraph","reference","blockquote"]],["heading",Jj,["paragraph","reference","blockquote"]],["lheading",Zj],["paragraph",Xj]];function ui(){this.ruler=new Ge;for(let e=0;e<Yn.length;e++)this.ruler.push(Yn[e][0],Yn[e][1],{alt:(Yn[e][2]||[]).slice()})}ui.prototype.tokenize=function(e,t,r){const s=this.ruler.getRules(""),a=s.length,i=e.md.options.maxNesting;let o=t,u=!1;for(;
491o<r&&(e.line=o=e.skipEmptyLines(o),!(o>=r||e.sCount[o]<e.blkIndent));){if(e.level>=i){e.line=r;break}const c=e.line;let l=!1;for(let d=0;d<a;d++)if(l=s[d](e,o,r,!1),l){if(c>=e.line)throw new Error("block rule didn't increment state.line");break}if(!l)throw new Error("none of the block rules matched");e.tight=!u,e.isEmpty(e.line-1)&&(u=!0),o=e.line,o<r&&e.isEmpty(o)&&(u=!0,o++,e.line=o)}};ui.prototype.parse=function(e,t,r,s){if(!e)return;const a=new this.State(e,t,r,s);this.tokenize(a,a.line,a.lineMax)};ui.prototype.State=$t;function En(e,t,r,s){this.src=e,this.env=r,this.md=t,this.tokens=s,this.tokens_meta=Array(s.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0}En.prototype.pushPending=function(){const e=new vt("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e};En.prototype.push=function(e,t,r){this.pending&&this.pushPending();const s=new vt(e,t,r);let a=null;return r<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),s.level=this.level,r>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],a={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(s),this.tokens_meta.push(a),s};En.prototype.scanDelims=function(e,t){const r=this.posMax,s=this.src.charCodeAt(e),a=e>0?this.src.charCodeAt(e-1):32;let i=e;for(;i<r&&this.src.charCodeAt(i)===s;)i++;const o=i-e,u=i<r?this.src.charCodeAt(i):32,c=dn(a)||ln(String.fromCharCode(a)),l=dn(u)||ln(String.fromCharCode(u)),d=cn(a),h=cn(u),m=!h&&(!l||d||c),p=!d&&(!c||h||l);return{can_open:m&&(t||!p||c),can_close:p&&(t||!m||l),length:o}};En.prototype.Token=vt;function e6(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function t6(e,t){let r=e.pos;for(;r<e.posMax&&!e6(e.src.charCodeAt(r));)r++;return r===e.pos?!1:(t||(e.pending+=e.src.slice(e.pos,r)),e.pos=r,!0)}const r6=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function s6(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;const r=e.pos,s=e.posMax;if(r+3>s||e.src.charCodeAt(r)!==58||e.src.charCodeAt(r+1)!==47||e.src.charCodeAt(r+2)!==47)return!1;const a=e.pending.match(r6);if(!a)return!1;const i=a[1],o=e.md.linkify.matchAtStart(e.src.slice(r-i.length));if(!o)return!1;let u=o.url;if(u.length<=i.length)return!1;u=u.replace(/\*+$/,"");const c=e.md.normalizeLink(u);if(!e.md.validateLink(c))return!1;if(!t){e.pending=e.pending.slice(0,-i.length);const l=e.push("link_open","a",1);l.attrs=[["href",c]],l.markup="linkify",l.info="auto";const d=e.push("text","",0);d.content=e.md.normalizeLinkText(u);const h=e.push("link_close","a",-1);h.markup="linkify",h.info="auto"}return e.pos+=u.length-i.length,!0}function n6(e,t){let r=e.pos;if(e.src.charCodeAt(r)!==10)return!1;const s=e.pending.length-1,a=e.posMax;if(!t)if(s>=0&&e.pending.charCodeAt(s)===32)if(s>=1&&e.pending.charCodeAt(s-1)===32){let i=s-1;for(;i>=1&&e.pending.charCodeAt(i-1)===32;)i--;e.pending=e.pending.slice(0,i),e.push("hardbreak","br",0)}else e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0);else e.push("softbreak","br",0);for(r++;r<a&&ge(e.src.charCodeAt(r));)r++;return e.pos=r,!0}const Ku=[];for(let e=0;e<256;e++)Ku.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(e){Ku[e.charCodeAt(0)]=1});function a6(e,t){let r=e.pos;const s=e.posMax;if(e.src.charCodeAt(r)!==92||(r++,r>=s))return!1;let a=e.src.charCodeAt(r);if(a===10){for(t||e.push("hardbreak","br",0),r++;r<s&&(a=e.src.charCodeAt(r),!!ge(a));)r++;return e.pos=r,!0}let i=e.src[r];if(a>=55296&&a<=56319&&r+1<s){const u=e.src.charCodeAt(r+1);u>=56320&&u<=57343&&(i+=e.src[r+1],r++)}const o="\\"+i;if(!t){const u=e.push("text_special","",0);a<256&&Ku[a]!==0?u.content=i:u.content=o,u.markup=o,u.info="escape"}return e.pos=r+1,!0}function i6(e,t){let r=e.pos;
491if(e.src.charCodeAt(r)!==96)return!1;const a=r;r++;const i=e.posMax;for(;r<i&&e.src.charCodeAt(r)===96;)r++;const o=e.src.slice(a,r),u=o.length;if(e.backticksScanned&&(e.backticks[u]||0)<=a)return t||(e.pending+=o),e.pos+=u,!0;let c=r,l;for(;(l=e.src.indexOf("`",c))!==-1;){for(c=l+1;c<i&&e.src.charCodeAt(c)===96;)c++;const d=c-l;if(d===u){if(!t){const h=e.push("code_inline","code",0);h.markup=o,h.content=e.src.slice(r,l).replace(/\n/g," ").replace(/^ (.+) $/,"$1")}return e.pos=c,!0}e.backticks[d]=l}return e.backticksScanned=!0,t||(e.pending+=o),e.pos+=u,!0}function o6(e,t){const r=e.pos,s=e.src.charCodeAt(r);if(t||s!==126)return!1;const a=e.scanDelims(e.pos,!0);let i=a.length;const o=String.fromCharCode(s);if(i<2)return!1;let u;i%2&&(u=e.push("text","",0),u.content=o,i--);for(let c=0;c<i;c+=2)u=e.push("text","",0),u.content=o+o,e.delimiters.push({marker:s,length:0,token:e.tokens.length-1,end:-1,open:a.can_open,close:a.can_close});return e.pos+=a.length,!0}function Rl(e,t){let r;const s=[],a=t.length;for(let i=0;i<a;i++){const o=t[i];if(o.marker!==126||o.end===-1)continue;const u=t[o.end];r=e.tokens[o.token],r.type="s_open",r.tag="s",r.nesting=1,r.markup="~~",r.content="",r=e.tokens[u.token],r.type="s_close",r.tag="s",r.nesting=-1,r.markup="~~",r.content="",e.tokens[u.token-1].type==="text"&&e.tokens[u.token-1].content==="~"&&s.push(u.token-1)}for(;s.length;){const i=s.pop();let o=i+1;for(;o<e.tokens.length&&e.tokens[o].type==="s_close";)o++;o--,i!==o&&(r=e.tokens[o],e.tokens[o]=e.tokens[i],e.tokens[i]=r)}}function u6(e){const t=e.tokens_meta,r=e.tokens_meta.length;Rl(e,e.delimiters);for(let s=0;s<r;s++)t[s]&&t[s].delimiters&&Rl(e,t[s].delimiters)}const lp={tokenize:o6,postProcess:u6};function c6(e,t){const r=e.pos,s=e.src.charCodeAt(r);if(t||s!==95&&s!==42)return!1;const a=e.scanDelims(e.pos,s===42);for(let i=0;i<a.length;i++){const o=e.push("text","",0);o.content=String.fromCharCode(s),e.delimiters.push({marker:s,length:a.length,token:e.tokens.length-1,end:-1,open:a.can_open,close:a.can_close})}return e.pos+=a.length,!0}function Il(e,t){const r=t.length;for(let s=r-1;s>=0;s--){const a=t[s];if(a.marker!==95&&a.marker!==42||a.end===-1)continue;const i=t[a.end],o=s>0&&t[s-1].end===a.end+1&&t[s-1].marker===a.marker&&t[s-1].token===a.token-1&&t[a.end+1].token===i.token+1,u=String.fromCharCode(a.marker),c=e.tokens[a.token];c.type=o?"strong_open":"em_open",c.tag=o?"strong":"em",c.nesting=1,c.markup=o?u+u:u,c.content="";const l=e.tokens[i.token];l.type=o?"strong_close":"em_close",l.tag=o?"strong":"em",l.nesting=-1,l.markup=o?u+u:u,l.content="",o&&(e.tokens[t[s-1].token].content="",e.tokens[t[a.end+1].token].content="",s--)}}function l6(e){const t=e.tokens_meta,r=e.tokens_meta.length;Il(e,e.delimiters);for(let s=0;s<r;s++)t[s]&&t[s].delimiters&&Il(e,t[s].delimiters)}const dp={tokenize:c6,postProcess:l6};function d6(e,t){let r,s,a,i,o="",u="",c=e.pos,l=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;const d=e.pos,h=e.posMax,m=e.pos+1,p=e.md.helpers.parseLinkLabel(e,e.pos,!0);if(p<0)return!1;let x=p+1;if(x<h&&e.src.charCodeAt(x)===40){for(l=!1,x++;x<h&&(r=e.src.charCodeAt(x),!(!ge(r)&&r!==10));x++);if(x>=h)return!1;if(c=x,a=e.md.helpers.parseLinkDestination(e.src,x,e.posMax),a.ok){for(o=e.md.normalizeLink(a.str),e.md.validateLink(o)?x=a.pos:o="",c=x;x<h&&(r=e.src.charCodeAt(x),!(!ge(r)&&r!==10));x++);if(a=e.md.helpers.parseLinkTitle(e.src,x,e.posMax),x<h&&c!==x&&a.ok)for(u=a.str,x=a.pos;x<h&&(r=e.src.charCodeAt(x),!(!ge(r)&&r!==10));x++);}(x>=h||e.src.charCodeAt(x)!==41)&&(l=!0),x++}if(l){if(typeof e.env.references>"u")return!1;if(x<h&&e.src.charCodeAt(x)===91?(c=x+1,x=e.md.helpers.parseLinkLabel(e,x),x>=0?s=e.src.slice(c,x++):x=p+1):x=p+1,s||(s=e.src.slice(m,p)),i=e.env.references[oi(s)],!i)return e.pos=d,!1;o=i.href,u=i.title}if(!t){e.pos=m,e.posMax=p;const g=e.push("link_open","a",1),b=[["href",o]];g.attrs=b,u&&b.push(["title",u]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=x,e.posMax=h,!0}function f6(e,t){let r,s,a,i,o,u,c,l,d="";const h=e.pos,m=e.posMax;
491if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const p=e.pos+2,x=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(x<0)return!1;if(i=x+1,i<m&&e.src.charCodeAt(i)===40){for(i++;i<m&&(r=e.src.charCodeAt(i),!(!ge(r)&&r!==10));i++);if(i>=m)return!1;for(l=i,u=e.md.helpers.parseLinkDestination(e.src,i,e.posMax),u.ok&&(d=e.md.normalizeLink(u.str),e.md.validateLink(d)?i=u.pos:d=""),l=i;i<m&&(r=e.src.charCodeAt(i),!(!ge(r)&&r!==10));i++);if(u=e.md.helpers.parseLinkTitle(e.src,i,e.posMax),i<m&&l!==i&&u.ok)for(c=u.str,i=u.pos;i<m&&(r=e.src.charCodeAt(i),!(!ge(r)&&r!==10));i++);else c="";if(i>=m||e.src.charCodeAt(i)!==41)return e.pos=h,!1;i++}else{if(typeof e.env.references>"u")return!1;if(i<m&&e.src.charCodeAt(i)===91?(l=i+1,i=e.md.helpers.parseLinkLabel(e,i),i>=0?a=e.src.slice(l,i++):i=x+1):i=x+1,a||(a=e.src.slice(p,x)),o=e.env.references[oi(a)],!o)return e.pos=h,!1;d=o.href,c=o.title}if(!t){s=e.src.slice(p,x);const g=[];e.md.inline.parse(s,e.md,e.env,g);const b=e.push("image","img",0),v=[["src",d],["alt",""]];b.attrs=v,b.children=g,b.content=s,c&&v.push(["title",c])}return e.pos=i,e.posMax=m,!0}const h6=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,m6=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function p6(e,t){let r=e.pos;if(e.src.charCodeAt(r)!==60)return!1;const s=e.pos,a=e.posMax;for(;;){if(++r>=a)return!1;const o=e.src.charCodeAt(r);if(o===60)return!1;if(o===62)break}const i=e.src.slice(s+1,r);if(m6.test(i)){const o=e.md.normalizeLink(i);if(!e.md.validateLink(o))return!1;if(!t){const u=e.push("link_open","a",1);u.attrs=[["href",o]],u.markup="autolink",u.info="auto";const c=e.push("text","",0);
491c.content=e.md.normalizeLinkText(i);const l=e.push("link_close","a",-1);l.markup="autolink",l.info="auto"}return e.pos+=i.length+2,!0}if(h6.test(i)){const o=e.md.normalizeLink("mailto:"+i);if(!e.md.validateLink(o))return!1;if(!t){const u=e.push("link_open","a",1);u.attrs=[["href",o]],u.markup="autolink",u.info="auto";const c=e.push("text","",0);c.content=e.md.normalizeLinkText(i);const l=e.push("link_close","a",-1);l.markup="autolink",l.info="auto"}return e.pos+=i.length+2,!0}return!1}function x6(e){return/^<a[>\s]/i.test(e)}function g6(e){return/^<\/a\s*>/i.test(e)}function b6(e){const t=e|32;return t>=97&&t<=122}function y6(e,t){if(!e.md.options.html)return!1;const r=e.posMax,s=e.pos;if(e.src.charCodeAt(s)!==60||s+2>=r)return!1;const a=e.src.charCodeAt(s+1);if(a!==33&&a!==63&&a!==47&&!b6(a))return!1;const i=e.src.slice(s).match(Yj);if(!i)return!1;if(!t){const o=e.push("html_inline","",0);o.content=i[0],x6(o.content)&&e.linkLevel++,g6(o.content)&&e.linkLevel--}return e.pos+=i[0].length,!0}const v6=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,w6=/^&([a-z][a-z0-9]{1,31});/i;function _6(e,t){const r=e.pos,s=e.posMax;if(e.src.charCodeAt(r)!==38||r+1>=s)return!1;if(e.src.charCodeAt(r+1)===35){const i=e.src.slice(r).match(v6);if(i){if(!t){const o=i[1][0].toLowerCase()==="x"?parseInt(i[1].slice(1),16):parseInt(i[1],10),u=e.push("text_special","",0);u.content=Wu(o)?ba(o):ba(65533),u.markup=i[0],u.info="entity"}return e.pos+=i[0].length,!0}}else{const i=e.src.slice(r).match(w6);if(i){const o=sp(i[0]);if(o!==i[0]){if(!t){const u=e.push("text_special","",0);u.content=o,u.markup=i[0],u.info="entity"}return e.pos+=i[0].length,!0}}}return!1}function Fl(e){const t={},r=e.length;if(!r)return;let s=0,a=-2;const i=[];for(let o=0;o<r;o++){const u=e[o];if(i.push(0),(e[s].marker!==u.marker||a!==u.token-1)&&(s=o),a=u.token,u.length=u.length||0,!u.close)continue;t.hasOwnProperty(u.marker)||(t[u.marker]=[-1,-1,-1,-1,-1,-1]);const c=t[u.marker][(u.open?3:0)+u.length%3];let l=s-i[s]-1,d=l;for(;l>c;l-=i[l]+1){const h=e[l];if(h.marker===u.marker&&h.open&&h.end<0){let m=!1;if((h.close||u.open)&&(h.length+u.length)%3===0&&(h.length%3!==0||u.length%3!==0)&&(m=!0),!m){const p=l>0&&!e[l-1].open?i[l-1]+1:0;i[o]=o-l+p,i[l]=p,u.open=!1,h.end=o,h.close=!1,d=-1,a=-2;break}}}d!==-1&&(t[u.marker][(u.open?3:0)+(u.length||0)%3]=d)}}function k6(e){const t=e.tokens_meta,r=e.tokens_meta.length;Fl(e.delimiters);for(let s=0;s<r;s++)t[s]&&t[s].delimiters&&Fl(t[s].delimiters)}function j6(e){let t,r,s=0;const a=e.tokens,i=e.tokens.length;for(t=r=0;t<i;t++)a[t].nesting<0&&s--,a[t].level=s,a[t].nesting>0&&s++,a[t].type==="text"&&t+1<i&&a[t+1].type==="text"?a[t+1].content=a[t].content+a[t+1].content:(t!==r&&(a[r]=a[t]),r++);t!==r&&(a.length=r)}const qi=[["text",t6],["linkify",s6],["newline",n6],["escape",a6],["backticks",i6],["strikethrough",lp.tokenize],["emphasis",dp.tokenize],["link",d6],["image",f6],["autolink",p6],["html_inline",y6],["entity",_6]],Hi=[["balance_pairs",k6],["strikethrough",lp.postProcess],["emphasis",dp.postProcess],["fragments_join",j6]];function Tn(){this.ruler=new Ge;for(let e=0;e<qi.length;e++)this.ruler.push(qi[e][0],qi[e][1]);this.ruler2=new Ge;for(let e=0;e<Hi.length;e++)this.ruler2.push(Hi[e][0],Hi[e][1])}Tn.prototype.skipToken=function(e){const t=e.pos,r=this.ruler.getRules(""),s=r.length,a=e.md.options.maxNesting,i=e.cache;if(typeof i[t]<"u"){e.pos=i[t];return}let o=!1;if(e.level<a){for(let u=0;u<s;u++)if(e.level++,o=r[u](e,!0),e.level--,o){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;o||e.pos++,i[t]=e.pos};Tn.prototype.tokenize=function(e){const t=this.ruler.getRules(""),r=t.length,s=e.posMax,a=e.md.options.maxNesting;for(;e.pos<s;){const i=e.pos;let o=!1;if(e.level<a){for(let u=0;u<r;u++)if(o=t[u](e,!1),o){if(i>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(o){if(e.pos>=s)break;continue}e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()};Tn.prototype.parse=function(e,t,r,s){const a=new this.State(e,t,r,s);this.tokenize(a);const i=this.ruler2.getRules(""),o=i.length;for(let u=0;u<o;u++)i[u](a)};Tn.prototype.State=En;function N6(e){const t={};e=e||{},t.src_Any=Zm.source,t.src_Cc=Xm.source,t.src_Z=tp.source,t.src_P=Vu.source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join("|"),t.src_ZCc=[t.src_Z,t.src_Cc].join("|");const r="[><|]";return t.src_pseudo_letter="(?:(?!"+r+"|"+t.src_ZPCc+")"+t.src_Any+")",t.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",t.src_auth="(?:(?:(?!"+t.src_ZCc+"|[@/\\[\\]()]).)+@)?",t.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",t.src_host_terminator="(?=$|"+r+"|"+t.src_ZPCc+")(?!"+(e["---"]?"-(?!--)|":"-|")+"_|:\\d|\\.-|\\.(?!$|"+t.src_ZPCc+"))",t.src_path="(?:[/?#](?:(?!"+t.src_ZCc+"|"+r+`|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!`+t.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+t.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+t.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+t.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+t.src_ZCc+"|[']).)+\\'|\\'(?="+t.src_pseudo_letter+"|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+t.src_ZCc+"|[.]|$)|"+(e["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+t.src_ZCc+"|$)|;(?!"+t.src_ZCc+"|$)|\\!+(?!"+t.src_ZCc+"|[!]|$)|\\?(?!"+t.src_ZCc+"|[?]|$))+|\\/)?",t.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',t.src_xn="xn--[a-z0-9\\-]{1,59}",t.src_domain_root="(?:"+t.src_xn+"|"+t.src_pseudo_letter+"{1,63})",t.src_domain="(?:"+t.src_xn+"|(?:"+t.src_pseudo_letter+")|(?:"+t.src_pseudo_letter+"(?:-|"+t.src_pseudo_letter+"){0,61}
491"+t.src_pseudo_letter+"))",t.src_host="(?:(?:(?:(?:"+t.src_domain+")\\.)*"+t.src_domain+"))",t.tpl_host_fuzzy="(?:"+t.src_ip4+"|(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%)))",t.tpl_host_no_ip_fuzzy="(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%))",t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+t.src_ZPCc+"|>|$))",t.tpl_email_fuzzy="(^|"+r+'|"|\\(|'+t.src_ZCc+")("+t.src_email_name+"@"+t.tpl_host_fuzzy_strict+")",t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_fuzzy_strict+t.src_path+")",t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+")",t}function Po(e){return Array.prototype.slice.call(arguments,1).forEach(function(r){r&&Object.keys(r).forEach(function(s){e[s]=r[s]})}),e}function ci(e){return Object.prototype.toString.call(e)}function C6(e){return ci(e)==="[object String]"}function S6(e){return ci(e)==="[object Object]"}function E6(e){return ci(e)==="[object RegExp]"}function Ml(e){return ci(e)==="[object Function]"}function T6(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const fp={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function A6(e){return Object.keys(e||{}).reduce(function(t,r){return t||fp.hasOwnProperty(r)},!1)}const P6={"http:":{validate:function(e,t,r){const s=e.slice(t);return r.re.http||(r.re.http=new RegExp("^\\/\\/"+r.re.src_auth+r.re.src_host_port_strict+r.re.src_path,"i")),r.re.http.test(s)?s.match(r.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,r){const s=e.slice(t);return r.re.no_http||(r.re.no_http=new RegExp("^"+r.re.src_auth+"(?:localhost|(?:(?:"+r.re.src_domain+")\\.)+"+r.re.src_domain_root+")"+r.re.src_port+r.re.src_host_terminator+r.re.src_path,"i")),r.re.no_http.test(s)?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:s.match(r.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,r){const s=e.slice(t);return r.re.mailto||(r.re.mailto=new RegExp("^"+r.re.src_email_name+"@"+r.re.src_host_strict,"i")),r.re.mailto.test(s)?s.match(r.re.mailto)[0].length:0}}},D6="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",R6="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function I6(e){e.__index__=-1,e.__text_cache__=""}function F6(e){return function(t,r){const s=t.slice(r);return e.test(s)?s.match(e)[0].length:0}}function Ol(){return function(e,t){t.normalize(e)}}function ya(e){const t=e.re=N6(e.__opts__),r=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||r.push(D6),r.push(t.src_xn),t.src_tlds=r.join("|");function s(u){return u.replace("%TLDS%",t.src_tlds)}t.email_fuzzy=RegExp(s(t.tpl_email_fuzzy),"i"),t.link_fuzzy=RegExp(s(t.tpl_link_fuzzy),"i"),t.link_no_ip_fuzzy=RegExp(s(t.tpl_link_no_ip_fuzzy),"i"),t.host_fuzzy_test=RegExp(s(t.tpl_host_fuzzy_test),"i");const a=[];e.__compiled__={};function i(u,c){throw new Error('(LinkifyIt) Invalid schema "'+u+'": '+c)}Object.keys(e.__schemas__).forEach(function(u){const c=e.__schemas__[u];if(c===null)return;const l={validate:null,link:null};if(e.__compiled__[u]=l,S6(c)){E6(c.validate)?l.validate=F6(c.validate):Ml(c.validate)?l.validate=c.validate:i(u,c),Ml(c.normalize)?l.normalize=c.normalize:c.normalize?i(u,c):l.normalize=Ol();return}if(C6(c)){a.push(u);return}i(u,c)}),a.forEach(function(u){e.__compiled__[e.__schemas__[u]]&&(e.__compiled__[u].validate=e.__compiled__[e.__schemas__[u]].validate,e.__compiled__[u].normalize=e.__compiled__[e.__schemas__[u]].normalize)}),e.__compiled__[""]={validate:null,normalize:Ol()};const o=Object.keys(e.__compiled__).filter(function(u){return u.length>0&&e.__compiled__[u]}).map(T6).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+o+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[>
491<|]|"+t.src_ZPCc+"))("+o+")","ig"),e.re.schema_at_start=RegExp("^"+e.re.schema_search.source,"i"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i"),I6(e)}function M6(e,t){const r=e.__index__,s=e.__last_index__,a=e.__text_cache__.slice(r,s);this.schema=e.__schema__.toLowerCase(),this.index=r+t,this.lastIndex=s+t,this.raw=a,this.text=a,this.url=a}function Do(e,t){const r=new M6(e,t);return e.__compiled__[r.schema].normalize(r,e),r}function et(e,t){if(!(this instanceof et))return new et(e,t);t||A6(e)&&(t=e,e={}),this.__opts__=Po({},fp,t),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=Po({},P6,e),this.__compiled__={},this.__tlds__=R6,this.__tlds_replaced__=!1,this.re={},ya(this)}et.prototype.add=function(t,r){return this.__schemas__[t]=r,ya(this),this};et.prototype.set=function(t){return this.__opts__=Po(this.__opts__,t),this};et.prototype.test=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return!1;let r,s,a,i,o,u,c,l,d;if(this.re.schema_test.test(t)){for(c=this.re.schema_search,c.lastIndex=0;(r=c.exec(t))!==null;)if(i=this.testSchemaAt(t,r[2],c.lastIndex),i){this.__schema__=r[2],this.__index__=r.index+r[1].length,this.__last_index__=r.index+r[0].length+i;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(l=t.search(this.re.host_fuzzy_test),l>=0&&(this.__index__<0||l<this.__index__)&&(s=t.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))!==null&&(o=s.index+s[1].length,(this.__index__<0||o<this.__index__)&&(this.__schema__="",this.__index__=o,this.__last_index__=s.index+s[0].length))),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&(d=t.indexOf("@"),d>=0&&(a=t.match(this.re.email_fuzzy))!==null&&(o=a.index+a[1].length,u=a.index+a[0].length,(this.__index__<0||o<this.__index__||o===this.__index__&&u>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=o,this.__last_index__=u))),this.__index__>=0};et.prototype.pretest=function(t){return this.re.pretest.test(t)};et.prototype.testSchemaAt=function(t,r,s){return this.__compiled__[r.toLowerCase()]?this.__compiled__[r.toLowerCase()].validate(t,s,this):0};et.prototype.match=function(t){const r=[];let s=0;this.__index__>=0&&this.__text_cache__===t&&(r.push(Do(this,s)),s=this.__last_index__);let a=s?t.slice(s):t;for(;this.test(a);)r.push(Do(this,s)),a=a.slice(this.__last_index__),s+=this.__last_index__;return r.length?r:null};et.prototype.matchAtStart=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return null;const r=this.re.schema_at_start.exec(t);if(!r)return null;const s=this.testSchemaAt(t,r[2],r[0].length);return s?(this.__schema__=r[2],this.__index__=r.index+r[1].length,this.__last_index__=r.index+r[0].length+s,Do(this,0)):null};et.prototype.tlds=function(t,r){return t=Array.isArray(t)?t:[t],r?(this.__tlds__=this.__tlds__.concat(t).sort().filter(function(s,a,i){return s!==i[a-1]}).reverse(),ya(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,ya(this),this)};et.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url="mailto:"+t.url)};et.prototype.onCompile=function(){};const os=2147483647,Pt=36,Qu=1,fn=26,O6=38,L6=700,hp=72,mp=128,pp="-",$6=/^xn--/,U6=/[^\0-\x7F]/,z6=/[\x2E\u3002\uFF0E\uFF61]/g,B6={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Vi=Pt-Qu,Dt=Math.floor,Gi=String.fromCharCode;function ar(e){throw new RangeError(B6[e])}function q6(e,t){const r=[];let s=e.length;for(;s--;)r[s]=t(e[s]);return r}function xp(e,t){const r=e.split("@");let s="";r.length>1&&(s=r[0]+"@",e=r[1]),e=e.replace(z6,".");const a=e.split("."),i=q6(a,t).join(".");return s+i}function gp(e){const t=[];let r=0;const s=e.length;for(;r<s;){const a=e.charCodeAt(r++);if(a>=55296&&a<=56319&&r<s){const i=e.charCodeAt(r++);(i&64512)==56320?t.push(((a&1023)<<10)+(i&1023)+65536):(t.push(a),r--)}else t.push(a)}return t}const H6=e=>String.fromCodePoint(...e),V6=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:Pt},Ll=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},bp=function(e,t,r){let s=0;for(e=r?Dt(e/L6):e>>
4911,e+=Dt(e/t);e>Vi*fn>>1;s+=Pt)e=Dt(e/Vi);return Dt(s+(Vi+1)*e/(e+O6))},yp=function(e){const t=[],r=e.length;let s=0,a=mp,i=hp,o=e.lastIndexOf(pp);o<0&&(o=0);for(let u=0;u<o;++u)e.charCodeAt(u)>=128&&ar("not-basic"),t.push(e.charCodeAt(u));for(let u=o>0?o+1:0;u<r;){const c=s;for(let d=1,h=Pt;;h+=Pt){u>=r&&ar("invalid-input");const m=V6(e.charCodeAt(u++));m>=Pt&&ar("invalid-input"),m>Dt((os-s)/d)&&ar("overflow"),s+=m*d;const p=h<=i?Qu:h>=i+fn?fn:h-i;if(m<p)break;const x=Pt-p;d>Dt(os/x)&&ar("overflow"),d*=x}const l=t.length+1;i=bp(s-c,l,c==0),Dt(s/l)>os-a&&ar("overflow"),a+=Dt(s/l),s%=l,t.splice(s++,0,a)}return String.fromCodePoint(...t)},vp=function(e){const t=[];e=gp(e);const r=e.length;let s=mp,a=0,i=hp;for(const c of e)c<128&&t.push(Gi(c));const o=t.length;let u=o;for(o&&t.push(pp);u<r;){let c=os;for(const d of e)d>=s&&d<c&&(c=d);const l=u+1;c-s>Dt((os-a)/l)&&ar("overflow"),a+=(c-s)*l,s=c;for(const d of e)if(d<s&&++a>os&&ar("overflow"),d===s){let h=a;for(let m=Pt;;m+=Pt){const p=m<=i?Qu:m>=i+fn?fn:m-i;if(h<p)break;const x=h-p,g=Pt-p;t.push(Gi(Ll(p+x%g,0))),h=Dt(x/g)}t.push(Gi(Ll(h,0))),i=bp(a,l,u===o),a=0,++u}++a,++s}return t.join("")},G6=function(e){return xp(e,function(t){return $6.test(t)?yp(t.slice(4).toLowerCase()):t})},W6=function(e){return xp(e,function(t){return U6.test(t)?"xn--"+vp(t):t})},wp={version:"2.3.1",ucs2:{decode:gp,encode:H6},decode:yp,encode:vp,toASCII:W6,toUnicode:G6},Y6={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},K6={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}},Q6={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","fragments_join"]}}},J6={default:Y6,zero:K6,commonmark:Q6},Z6=/^(vbscript|javascript|file|data):/,X6=/^data:image\/(gif|png|jpeg|webp);/;function eN(e){const t=e.trim().toLowerCase();return Z6.test(t)?X6.test(t):!0}const _p=["http:","https:","mailto:"];function tN(e){const t=Hu(e,!0);if(t.hostname&&(!t.protocol||_p.indexOf(t.protocol)>=0))try{t.hostname=wp.toASCII(t.hostname)}catch{}return Sn(qu(t))}function rN(e){const t=Hu(e,!0);if(t.hostname&&(!t.protocol||_p.indexOf(t.protocol)>=0))try{t.hostname=wp.toUnicode(t.hostname)}catch{}return js(qu(t),js.defaultChars+"%")}function ut(e,t){if(!(this instanceof ut))return new ut(e,t);t||Gu(e)||(t=e||{},e="default"),this.inline=new Tn,this.block=new ui,this.core=new Yu,this.renderer=new Us,this.linkify=new et,this.validateLink=eN,this.normalizeLink=tN,this.normalizeLinkText=rN,this.utils=nj,this.helpers=ii({},uj),this.options={},this.configure(e),t&&this.set(t)}ut.prototype.set=function(e){return ii(this.options,e),this};ut.prototype.configure=function(e){const t=this;if(Gu(e)){const r=e;if(e=J6[r],!e)throw new Error('Wrong `markdown-it` preset "'+r+'", check name')}if(!e)throw new Error("Wrong `markdown-it` preset, can't be empty");return e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach(function(r){e.components[r].rules&&t[r].ruler.enableOnly(e.components[r].rules),e.components[r].rules2&&t[r].ruler2.enableO
491nly(e.components[r].rules2)}),this};ut.prototype.enable=function(e,t){let r=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(a){r=r.concat(this[a].ruler.enable(e,!0))},this),r=r.concat(this.inline.ruler2.enable(e,!0));const s=e.filter(function(a){return r.indexOf(a)<0});if(s.length&&!t)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+s);return this};ut.prototype.disable=function(e,t){let r=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(a){r=r.concat(this[a].ruler.disable(e,!0))},this),r=r.concat(this.inline.ruler2.disable(e,!0));const s=e.filter(function(a){return r.indexOf(a)<0});if(s.length&&!t)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+s);return this};ut.prototype.use=function(e){const t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this};ut.prototype.parse=function(e,t){if(typeof e!="string")throw new Error("Input data should be a String");const r=new this.core.State(e,this,t);return this.core.process(r),r.tokens};ut.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)};ut.prototype.parseInline=function(e,t){const r=new this.core.State(e,this,t);return r.inlineMode=!0,this.core.process(r),r.tokens};ut.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)};const sN=new ut({html:!1,linkify:!0,typographer:!0,breaks:!0}),nN=e=>{const t=sN.render(e);return n.jsx("div",{className:"markdown-content",dangerouslySetInnerHTML:{__html:t}})};function aN({messages:e,isLoading:t,errorState:r,onRetry:s}){const a=f.useRef(null),[i,o]=f.useState(!1),u=f.useRef(null);f.useEffect(()=>{a.current&&a.current.scrollIntoView({behavior:"smooth"})},[e,t]);const c=l=>{if(i){window.speechSynthesis.cancel(),o(!1);return}try{const d=new SpeechSynthesisUtterance(l);u.current=d,d.onend=()=>{o(!1),u.current=null},window.speechSynthesis.speak(d),o(!0)}catch(d){console.error("Speech synthesis error:",d)}};return n.jsxs("div",{className:"flex flex-col h-full overflow-y-auto py-4 md:py-6 px-4 md:px-6 space-y-6",children:[e.map((l,d)=>n.jsxs("div",{className:V("flex gap-3 md:gap-4 animate-in fade-in duration-300",l.role==="user"?"justify-end":"justify-start",d===e.length-1&&"slide-in-from-bottom-2"),children:[l.role==="assistant"&&n.jsx("div",{className:"h-8 w-8 md:h-10 md:w-10 rounded-full bg-explainify-100 dark:bg-explainify-800/50 flex-shrink-0 flex items-center justify-center shadow-sm",children:n.jsx(fc,{className:"h-4 w-4 md:h-5 md:w-5 text-explainify-600 dark:text-explainify-400"})}),n.jsxs("div",{className:V("rounded-2xl p-3 md:p-4 text-sm md:text-base max-w-[85%] md:max-w-[75%] shadow-sm",l.role==="assistant"?"bg-white dark:bg-gray-800 border border-gray-100 dark:border-gray-700":"bg-explainify-600 text-white"),children:[l.fileType&&l.fileType==="image"&&l.fileContent&&n.jsxs("div",{className:"mb-3",children:[n.jsx("div",{className:"rounded-lg border border-gray-200 dark:border-gray-700 p-1 inline-block bg-white dark:bg-gray-800 shadow-sm hover:shadow-md transition-shadow",children:n.jsx("img",{src:l.fileContent,alt:"Uploaded image",className:"max-w-full max-h-48 md:max-h-72 rounded-md object-contain"})}),n.jsxs("div",{className:"mt-2 text-xs text-muted-foreground flex items-center",children:[n.jsx(Ca,{className:"h-3 w-3 mr-1"}),l.fileName||"Uploaded image"]})]}),l.fileType&&l.fileType==="pdf"&&n.jsxs("div",{className:"mb-3 glass-morphism rounded-lg p-2 md:p-3 flex items-center text-xs md:text-sm",children:[n.jsx(Pe,{className:"h-4 w-4 md:h-5 md:w-5 mr-2 md:mr-3 text-explainify-600 dark:text-explainify-400"}),n.jsx("span",{className:"text-explainify-700 dark:text-explainify-300 truncate",children:l.fileName||"PDF document"})]}),l.fileType&&l.fileType==="text"&&n.jsxs("div",{className:"mb-3 glass-morphism rounded-lg p-2 md:p-3 flex items-center text-xs md:text-sm",children:[n.jsx(Nd,{className:"h-4 w-4 md:h-5 md:w-5 mr-2 md:mr-3 text-explainify-600 dark:text-explainify-400"}),n.jsx("span",{className:"text-explainify-700 dark:text-explainify-300 truncate",children:l.fileName||"Text document"})]}),l.role==="assistant"?n.jsx("div",{className:"leading-relaxed",children:nN(l.content)}):n.jsx("p",{className:"leading-relaxed",children:l.content}),l.role==="assistant"&&n.jsx("div",{className:"mt-3 border-t border-gray-100 dark:border-gray-700 pt-2 flex justify-end",children:n.jsxs(R,{size:"sm",variant:"ghost",onClick:()=>c(l.content),className:"h-7 md:h-8 px-2 md:px-3 text-xs rounded-full bg-explainify-50 hover:bg-explainify-100 text-explainify-600 dark:bg-explainify-900/30 dark:text-explainify-400 dark:hover:bg-explainify-900/50",children:[i?n.jsx(qo,{className:"h-3 w-3 md:h-4 md:w-4 mr-1 md:mr-2"}):n.jsx(Bo,{className:"h-3 w-3 md:h-4 md:w-4 mr-1 md:mr-2"}),i?"Stop":"Listen"]})})]}),l.role==="user"&&n.jsx("div",{className:"h-8 w-8 md:h-10 md:w-10 rounded-full bg-explainify-700 flex-shrink-0 flex items-center justify-center shadow-sm",children:n.jsx(ro,{className:"h-4 w-4 md:h-5 md:w-5 text-white"})})]},d)),t&&n.jsxs("div",{className:"flex items-center justify-start gap-3 md:gap-4 py-4 animate-in fade-in slide-in-from-bottom-2 duration-300",children:[n.jsx("div",{className:"h-8 w-8 md:h-10 md:w-10 rounded-full bg-explainify-100 dark:bg-explainify-800/50 flex-shrink-0 flex items-center justify-center shadow-sm",children:n.jsx(fc,{className:"h-4 w-4 md:h-5 md:w-5 text-explainify-600 dark:text-explainify-400"})}),n.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-2xl p-3 md:p-4 shadow-sm border border-gray-100 dark:border-gray-700",children:n.jsxs("div",{className:"flex space-x-2",children:[n.jsx("div",{className:"w-2 h-2 rounded-full bg-explainify-400 animate-pulse"}),n.jsx("div",{className:"w-2 h-2 rounded-full bg-explainify-500 animate-pulse delay-150"}),n.jsx("div",{className:"w-2 h-2 rounded-full bg-explainify-600 animate-pulse delay-300"})]})})]}),r&&n.jsxs("div",{className:"rounded-xl border border-red-200 bg-red-50 dark:bg-red-900/10 dark:border-red-800/30 p-4 md:p-5 text-sm md:text-base my-4 animate-in fade-in duration-300",children:[n.jsxs("div",{className:"flex items-center gap-2 md:gap-3 text-red-700 dark:text-red-400 mb-2 md:mb-3",children:[n.jsx(Gt,{className:"h-4 w-4 md:h-5 md:w-5"}),n.jsx("p",{className:"font-medium",children:"Error connecting to AI"})]}),n.jsx("p",{className:"text-red-600 dark:text-red-300 mb-4",children:r}),n.jsxs(R,{size:"sm",variant:"outline",className:"border-red-200 text-red-700 hover:bg-red-100 dark:border-red-800/30 dark:text-red-400 dark:hover:bg-red-900/20 rounded-full",onClick:s,children:[n.jsx(bs,{className:"h-3.5 w-3.5 mr-2"}),"Retry"]})]}),n.jsx("div",{ref:a})]})}const kp=f.forwardRef(({isLoading:e,onSendMessage:t,onFileUpload:r,inputValue:s,setInputValue:a},i)=>{const o=f.useRef(null),u=f.useRef(null),[c,l]=f.useState(!1),[d,h]=f.useState(null),[m,p]=f.useState(""),x=()=>{window.innerWidth<=768&&i&&"current"in i&&i.current&&setTimeout(()=>{var C;(C=i.current)==null||C.scrollIntoView({behavior:"smooth",block:"center"}),window.scrollBy(0,100)},300)},g=()=>{d?(r(d,m),h(null),p("")):s.trim()&&!e&&t(s)},b=()=>{o.current&&o.current.click()},v=j=>{var I;const C=(I=j.target.files)==null?void 0:I[0];if(C){if(C.size>50*1024*1024){L.error("File is too large. Maximum size is 50MB.");return}C.type.includes("image")||C.type.includes("pdf")||C.type.includes("text")?(h(C),setTimeout(()=>{var A;
491return(A=document.getElementById("file-comment"))==null?void 0:A.focus()},100)):L.error("Unsupported file type. Please upload an image, PDF, or text file."),o.current&&(o.current.value="")}},y=()=>{h(null),p("")},w=j=>{j.preventDefault(),j.stopPropagation(),l(!0)},_=j=>{j.preventDefault(),j.stopPropagation(),l(!1)},k=j=>{j.preventDefault(),j.stopPropagation()},N=j=>{j.preventDefault(),j.stopPropagation(),l(!1);const C=j.dataTransfer.files;if(C&&C.length>0){const I=C[0];if(I.size>50*1024*1024){L.error("File is too large. Maximum size is 50MB.");return}I.type.includes("image")||I.type.includes("pdf")||I.type.includes("text")?(h(I),setTimeout(()=>{var A;return(A=document.getElementById("file-comment"))==null?void 0:A.focus()},100)):L.error("Unsupported file type. Please upload an image, PDF, or text file.")}};return n.jsx("div",{className:"p-4 md:p-5 border-t border-gray-100 dark:border-gray-800 bg-white dark:bg-gray-900 rounded-b-xl",children:n.jsxs("div",{className:V("relative transition-all duration-200",c?"bg-explainify-50 dark:bg-explainify-900/30 border-2 border-dashed border-explainify-300 dark:border-explainify-700 rounded-xl p-6":""),onDragEnter:w,onDragLeave:_,onDragOver:k,onDrop:N,children:[c&&n.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:n.jsxs("div",{className:"text-center",children:[n.jsx("div",{className:"w-12 h-12 bg-explainify-100 dark:bg-explainify-800/50 rounded-full flex items-center justify-center mx-auto mb-3",children:n.jsx(ra,{className:"h-6 w-6 text-explainify-600 dark:text-explainify-400"})}),n.jsx("p",{className:"font-medium text-explainify-700 dark:text-explainify-300",children:"Drop your file here"}),n.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Images, PDFs, and text files supported"})]})}),d?n.jsxs("div",{className:"space-y-3 animate-in fade-in duration-300",children:[n.jsxs("div",{className:"flex items-center gap-3 p-3 bg-explainify-50 dark:bg-explainify-900/30 rounded-xl border border-explainify-100 dark:border-explainify-800/50",children:[n.jsx("div",{className:"flex-shrink-0",children:d.type.includes("image")?n.jsx("div",{className:"h-12 w-12 bg-explainify-100 dark:bg-explainify-800/50 rounded-xl flex items-center justify-center shadow-sm",children:n.jsx(Ca,{className:"h-6 w-6 text-explainify-600 dark:text-explainify-400"})}):n.jsx("div",{className:"h-12 w-12 bg-explainify-100 dark:bg-explainify-800/50 rounded-xl flex items-center justify-center shadow-sm",children:n.jsx(Nd,{className:"h-6 w-6 text-explainify-600 dark:text-explainify-400"})})}),n.jsxs("div",{className:"flex-grow min-w-0",children:[n.jsx("p",{className:"font-medium truncate dark:text-gray-200",children:d.name}),n.jsx("p",{className:"text-sm text-muted-foreground",children:iN(d.size)})]}),n.jsx(R,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-full text-muted-foreground hover:text-red-500 hover:bg-red-50 dark:hover:bg-red-900/20",onClick:y,children:n.jsx(Ur,{className:"h-4 w-4"})})]}),n.jsxs("div",{className:"relative",children:[n.jsx("input",{id:"file-comment",type:"text",placeholder:"Add a comment about this file...",className:"w-full px-4 py-3 pr-12 rounded-xl border dark:border-gray-700 focus:outline-none focus:ring-2 focus:ring-explainify-500/50 focus:border-explainify-500 transition-all duration-200 text-base bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 placeholder-gray-500 dark:placeholder-gray-400 shadow-sm",value:m,onChange:j=>p(j.target.value),onFocus:x,onKeyDown:j=>{j.key==="Enter"&&!e&&g()},disabled:e}),n.jsx(R,{className:"absolute right-2 top-1/2 -translate-y-1/2 h-9 w-9 rounded-full p-0 btn-primary shadow-md hover:shadow-lg transition-all duration-200",disabled:e,onClick:g,title:"Upload file with comment",children:e?n.jsx(gs,{className:"h-4 w-4 animate-spin"}):n.jsx(gc,{className:"h-4 w-4"})})]})]}):n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[n.jsx(R,{variant:"outline",size:"icon",type:"button",onClick:b,disabled:e,title:"Upload file (PDF, image, or text)",className:"h-9 w-9 rounded-full flex-shrink-0 dark:border-gray-700 hover:border-explainify-300 dark:hover:border-explainify-700 transition-colors duration-200",children:n.jsx(ag,{className:"h-4 w-4"})}),n.jsx("input",{type:"file",ref:o,className:"hidden",accept:"image/*,application/pdf,text/plain",onChange:v}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Upload images, PDFs, or text files (max 50MB)"})]}),n.jsxs("div",{className:"relative",children:[n.jsx("textarea",{type:"text",ref:u,placeholder:"Ask anything or drop a file here...",className:"w-full px-4 py-3 pr-12 rounded-xl border dark:border-gray-700 focus:outline-none focus:ring-2 focus:ring-explainify-500/50 focus:border-explainify-500 transition-all duration-200 text-base bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 placeholder-gray-500 dark:placeholder-gray-400 shadow-sm resize-none min-h-[50px] max-h-[200px] overflow-y-auto",value:s,onChange:j=>{a(j.target.value),j.target.style.height="auto",j.target.style.height=`${Math.min(j.target.scrollHeight,200)}px`},onFocus:j=>{x(),j.target.style.height="auto",j.target.style.height=`${Math.min(j.target.scrollHeight,200)}px`},onKeyDown:j=>{j.key==="Enter"&&!j.shiftKey&&!e&&s.trim()&&(j.preventDefault(),g())},disabled:e,rows:1}),n.jsx(R,{className:V("absolute right-2 top-1/2 -translate-y-1/2 h-9 w-9 rounded-full p-0 shadow-md transition-all duration-200",s.trim()?"btn-primary hover:shadow-lg":"bg-gray-100 text-gray-400 dark:bg-gray-700 cursor-not-allowed"),disabled:!s.trim()||e,onClick:g,children:e?n.jsx(gs,{className:"h-4 w-4 animate-spin"}):n.jsx(gc,{className:"h-4 w-4"})})]})]}),c&&n.jsx("div",{className:"absolute inset-0 bg-white/50 dark:bg-gray-900/50 flex items-center justify-center z-10 rounded-xl",children:n.jsxs("div",{className:"text-center",children:[n.jsx("div",{className:"w-16 h-16 bg-explainify-100 dark:bg-explainify-800/50 rounded-full flex items-center justify-center mx-auto mb-4 shadow-md",children:n.jsx(ra,{className:"h-8 w-8 text-explainify-600 dark:text-explainify-400"})}),n.jsx("p",{className:"text-lg font-medium text-explainify-700 dark:text-explainify-300",children:"Drop your file here"}),n.jsx("p",{className:"text-muted-foreground mt-1",children:"Images, PDFs, and text files supported"})]})})]})})});function iN(e){return e<1024?e+" bytes":e<1024*1024?(e/1024).toFixed(1)+" KB":(e/(1024*1024)).toFixed(1)+" MB"}kp.displayName="MessageInput";function oN({onSuggestionClick:e,category:t="all"}){const r={stem:["Can you explain quantum computing in simple terms?","How do black holes work?","What's the difference between machine learning and deep learning?","Explain the process of protein synthesis","How does nuclear fusion differ from nuclear fission?","What causes northern lights (aurora borealis)?","Explain how photosynthesis works in simple terms","How do vaccines create immunity?"],humanities:["What were the main causes of World War I?","How has social media influenced modern politics?","What are the major philosophical arguments for free will?","Explain the significance of symbolism in 'The Great Gatsby'","How did the Renaissance change European society?","Compare and contrast democracy and republicanism","What were the key themes in Romeo and Juliet?","How did the civil rights movement transform America?"],skills:["How can I improve my critical thinking skills?","What techniques help with public speaking anxiety?","How do I create an effective study schedule?","What are some strategies for solving complex math problems?","How can I learn a new language efficiently?","What are effective techniques for managing time?","How do I write a compelling research paper?","What are good habits for maintaining mental health?"]};let s=[];return t==="all"?s=[...r.stem.slice(0,2),...r.humanities.slice(0,2),...r.skills.slice(0,2)]:t in r&&(s=r[t].slice(0,6)),s=[...s].sort(()=>.5-Math.random()),n.jsxs(de,{className:"p-3 md:p-5 dark:bg-gray-800/50",children:[n.jsxs("h4",{className:"font-medium mb-2 md:mb-3 flex items-center gap-1.5 md:gap-2 text-sm md:text-base dark:text-gray-200",children:[n.jsx(rg,{className:"h-3.5 w-3.5 md:h-4 md:w-4 text-explainify-600 dark:text-explainify-400"}),t==="all"?"Ask about anything":t==="stem"?"Ask about STEM topics":t==="humanities"?"Explore humanities subjects":"Develop practical skills"]}),n.jsx("div",{className:"space-y-1.5 md:space-y-2 text-xs md:text-sm",children:s.map((a,i)=>n.jsx("div",{className:"p-1.5 md:p-2 rounded border dark:border-gray-700 hover:bg-explainify-50 dark:hover:bg-explainify-900/30 hover:border-explainify-200 dark:hover:border-explainify-600 cursor-pointer transition-colors active:bg-explainify-100 dark:active:bg-explainify-800/50 dark:text-gray-200",onClick:()=>e(a),children:a},i))})]})}function uN({}){const[e,t]=f.useState(null),[r,s]=f.useState([]),a=[{icon:xr,text:"Personalized explanations based on your learning style",details:"Our AI adapts to your specific learning preferences, whether you're a visual learner, prefer step-by-step explanations, or need concrete examples."},{icon:Ht,text:"Step-by-step walkthroughs of complex problems",details:"Break down challenging concepts into manageable parts with detailed explanations at each step of the problem-solving process."},{icon:Kx,text:"Interactive learning with real-time feedback",details:"Get immediate feedback on your understanding as you work through problems, with hints and corrections when needed."},{icon:Be,text:"Support across all major subjects and topics",details:"From mathematics and science to humanities and languages, our AI tutor can assist with virtually any subject at any level."},{icon:ta,text:"Available 24/7 for help whenever you need it",details:"Study on your schedule with round-the-clock access to tutoring assistance, no appointments necessary."},{icon:cg,text:"Rapid responses to keep your learning momentum",details:"No waiting for answers - get immediate assistance to maintain your study flow and productivity."}],i=c=>{t(e===c?null:c)},o=c=>{r.includes(c)?s(r.filter(l=>l!==c)):(s([...r,c]),L.success(`Highlighted: ${a[c].text}`))},u=()=>{s([]),L.info("All highlights cleared")};return n.jsxs("div",{className:"space-y-3 md:space-y-4",children:[n.jsxs("div",{className:"flex justify-between items-center",children:[n.jsx("h4",{className:"font-medium text-sm md:text-base",children:"Key Features"}),r.length>0&&n.jsx(R,{variant:"ghost",size:"sm",onClick:u,className:"text-xs h-6 md:h-7 px-1.5 md:px-2",children:"Clear Highlights"})]}),n.jsx("ul",{className:"space-y-2 md:space-y-3",children:a.map((c,l)=>{const d=c.icon,h=r.includes(l),m=e===l;return n.jsxs("li",{className:`
492                transition-all duration-200 
493                ${h?"bg-explainify-50 dark:bg-explainify-900/30":""} 
494                rounded-lg p-1.5 md:p-2 -mx-2
495              `,children:[n.jsxs("div",{className:"flex items-center gap-2 md:gap-3 text-xs md:text-sm cursor-pointer min-h-[2.5rem]",onClick:()=>i(l),children:[n.jsx("div",{className:`
496                    flex-shrink-0 p-1 md:p-1.5 rounded-full 
497                    ${h?"bg-explainify-200 dark:bg-explainify-700":"bg-explainify-100 dark:bg-explainify-900/50"}
498                  `,children:n.jsx(d,{className:`
499                      h-3 w-3 md:h-3.5 md:w-3.5 
500                      ${h?"text-explainify-700 dark:text-explainify-300":"text-explainify-600 dark:text-explainify-400"}
501                    `})}),n.jsx("span",{className:h?"font-medium":"",children:c.text})]}),m&&n.jsxs("div",{className:"pl-7 md:pl-9 pr-2 mt-1.5 md:mt-2 text-xs text-muted-foreground",children:[n.jsx("p",{children:c.details}),n.jsx("div",{className:"mt-1.5 md:mt-2",children:n.jsx(R,{variant:"ghost",size:"sm",onClick:p=>{p.stopPropagation(),o(l)},className:"text-xs h-6 px-2 text-explainify-600 dark:text-explainify-400",children:h?"Remove Highlight":"Highlight"})})]})]},l)})}),n.jsx("div",{className:"pt-1 md:pt-2",children:n.jsxs("p",{className:"text-[10px] md:text-xs text-muted-foreground",children:["Click on any feature to learn more. Highlighted features: ",r.length]})})]})}function cN({isFullscreen:e,toggleFullscreen:t,startNewConversation:r,isLoading:s,toggleHistory:a,clearHistoryFn:i}){const[o,u]=f.useState({name:"Einstein",description:"Your personal science & math tutor",avatar:xr,color:"bg-purple-600"}),c=[{name:"Einstein",description:"Your personal science & math tutor",avatar:xr,color:"bg-purple-600"},{name:"Austen",description:"Your literature & writing tutor",avatar:Be,color:"bg-blue-600"},{name:"Socrates",description:"Your philosophy & ethics tutor",avatar:Sa,color:"bg-green-600"}];return n.jsxs("div",{className:"flex items-center justify-between gap-3 w-full py-4 px-4 md:px-6 border-b border-white/10",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:V("h-10 w-10 rounded-full flex items-center justify-center shadow-md",o.color),children:n.jsx(o.avatar,{className:"h-5 w-5 text-white"})}),n.jsx("div",{children:n.jsxs(s0,{children:[n.jsx(n0,{asChild:!0,children:n.jsxs(R,{variant:"ghost",className:"h-auto p-0 hover:bg-white/10 text-left flex items-center gap-1 text-white",children:[n.jsxs("div",{children:[n.jsx("h3",{className:"font-medium text-lg",children:o.name}),n.jsx("p",{className:"text-xs text-explainify-200 dark:text-explainify-300",children:o.description})]}),n.jsx(Uo,{className:"h-4 w-4 opacity-70 ml-1"})]})}),n.jsxs(ku,{align:"start",className:"w-64 dark:bg-gray-800 dark:border-gray-700 p-2 rounded-xl shadow-lg",children:[n.jsx("div",{className:"px-3 py-2",children:n.jsx("h4",{className:"text-sm font-medium text-gray-500 dark:text-gray-400",children:"Choose AI Personality"})}),n.jsx(fa,{}),c.map(l=>n.jsxs(Ar,{onClick:()=>u(l),className:V("flex items-center gap-3 py-3 px-3 rounded-lg my-1 transition-colors",o.name===l.name?"bg-explainify-50 dark:bg-explainify-900/30 text-explainify-600 dark:text-explainify-400":"dark:hover:bg-gray-700/50"),children:[n.jsx("div",{className:V("h-8 w-8 rounded-full flex items-center justify-center shadow-sm",l.color),children:n.jsx(l.avatar,{className:"h-4 w-4 text-white"})}),n.jsxs("div",{className:"flex-1",children:[n.jsx("p",{className:"text-sm font-medium dark:text-gray-200",children:l.name}),n.jsx("p",{className:"text-xs text-muted-foreground dark:text-gray-400",children:l.description})]}),o.name===l.name&&n.jsx("div",{className:"h-2 w-2 rounded-full bg-explainify-500"})]},l.name))]})]})})]}),n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx(R,{variant:"ghost",size:"icon",className:"text-white hover:bg-white/10 rounded-full h-9 w-9",onClick:r,disabled:s,title:"Start new conversation",children:n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"M12 5v14M5 12h14"})})}),n.jsx(R,{variant:"ghost",size:"icon",className:"text-white hover:bg-white/10 rounded-full h-9 w-9",onClick:a,disabled:s,title:"View conversation history",children:n.jsx(mt,{className:"h-4 w-4"})}),n.jsx(R,{variant:"ghost",size:"icon",className:"text-white hover:bg-white/10 rounded-full h-9 w-9",onClick:i,disabled:s,title:"Clear current conversation",children:n.jsx(Ts,{className:"h-4 w-4"})}),n.jsx(R,{variant:"ghost",size:"icon",className:"text-white hover:bg-white/10 rounded-full h-9 w-9",onClick:t,title:e?"Exit fullscreen mode":"Enter fullscreen mode",children:e?n.jsx(sg,{className:"h-4 w-4"}):n.jsx(tg,{className:"h-4 w-4"})})]})]})}const lN=()=>{const e=async r=>{const s=await t(r);return s===-1?!0:s<=0?(L.error("Message limit reached",{description:"You've reached your monthly message limit. Please upgrade your plan for unlimited messages.",duration:7e3,action:{label:"Upgrade",onClick:()=>{window.location.href="/pricing"}}}
501),!1):(s<5&&L.warning(`Only ${s} messages remaining`,{description:"You're approaching your monthly message limit. Consider upgrading your plan.",duration:5e3,action:{label:"Upgrade",onClick:()=>{window.location.href="/pricing"}}}),!0)},t=async r=>{const s=localStorage.getItem("explainify_subscription_active")==="true",a=localStorage.getItem("explainify_subscription_plan"),i=localStorage.getItem("explainify_subscription_time");if(s&&a&&i){const o=new Date(i).getTime(),u=new Date().getTime(),c=5*60*1e3;if(u-o<c&&(a==="pro"||a==="teams"))return-1}try{const{data:o,error:u}=await J.from("profiles").select("subscription_tier, is_trial_active").eq("id",r).single();if(u)throw u;const{subscription_tier:c,is_trial_active:l}=o;if(localStorage.setItem("explainify_subscription_active",String(!!c||l)),c&&localStorage.setItem("explainify_subscription_plan",c.toLowerCase()),localStorage.setItem("explainify_subscription_time",new Date().toISOString()),c==="Pro"||c==="Teams")return-1;const{data:d,error:h}=await J.from("user_usage").select("messages_limit, messages_used").eq("id",r).single();if(h){const x=l||c==="Starter"?100:10;return await J.from("user_usage").insert({id:r,messages_limit:x,messages_used:0,reset_date:new Date(new Date().setMonth(new Date().getMonth()+1)).toISOString(),created_at:new Date().toISOString(),last_updated:new Date().toISOString()}),x}const{messages_limit:m,messages_used:p}=d;return m===-1?-1:Math.max(0,m-p)}catch(o){return console.error("Error checking message limit:",o),0}};return{checkAndNotify:e,getRemainingMessages:t}},Ju=()=>{const{user:e}=ke(),{checkAndNotify:t,getRemainingMessages:r}=lN(),s=async o=>{try{const{data:u,error:c}=await J.from("profiles").select("is_trial_active, subscription_tier").eq("id",o).single();if(c)throw c;return u.subscription_tier==="Pro"||u.subscription_tier==="Teams"||u.is_trial_active?{hasAccess:!0}:{hasAccess:!1,reason:"Your free trial has expired. Please upgrade to a paid plan to continue using this feature."}}catch(u){return console.error("Error checking user access:",u),{hasAccess:!1,reason:"Unable to verify subscription status."}}};return{sendMessage:async o=>{if(!e)throw new Error("You must be logged in to use this feature");const u=await s(e.id);if(!u.hasAccess)throw new Error(u.reason||"Trial expired. Please upgrade to continue.");if(!await t(e.id))throw new Error("Message limit reached. Please upgrade your plan.");try{let l;try{l=JSON.parse(o)}catch{l=[{role:"user",content:o}]}return{message:await Mu(l,e.id)}}catch(l){throw console.error("Error sending message to AI service:",l),l}},getMessageUsage:async()=>{if(!e)throw new Error("You must be logged in to check message usage");const o=await s(e.id);if(!o.hasAccess)return{remaining:0,unlimited:!1,hasAccess:!1,reason:o.reason};const u=await r(e.id);return{remaining:u,unlimited:u===-1,hasAccess:!0}}}},dN=()=>{const{user:e}=ke(),[t,r]=f.useState({hasAccess:!1,isLoading:!0,reason:null}),s=async()=>{if(!e){r({hasAccess:!1,isLoading:!1,reason:"not_authenticated"});return}try{r(o=>({...o,isLoading:!0}));const{data:a,error:i}=await J.from("profiles").select("is_trial_active, trial_end_date, subscription_tier").eq("id",e.id).single();if(i)throw i;if(a.subscription_tier==="Pro"||a.subscription_tier==="Teams"){r({hasAccess:!0,isLoading:!1,reason:"paid_plan"});return}if(a.is_trial_active){const o=new Date,u=a.trial_end_date?new Date(a.trial_end_date):null,c=u?Math.max(0,Math.ceil((u.getTime()-o.getTime())/(1e3*60*60*24))):0;r({hasAccess:!0,isLoading:!1,reason:"trial_active",trialDaysLeft:c,trialEndDate:u});return}r({hasAccess:!1,isLoading:!1,reason:"trial_expired",trialEndDate:a.trial_end_date?new Date(a.trial_end_date):null})}catch(a){console.error("Error checking subscription access:",a),r({hasAccess:!1,isLoading:!1,reason:"no_subscription"})}};return f.useEffect(()=>{s()},[e]),{...t,refresh:s}};function jp({children:e,featureName:t="This feature"}){const{hasAccess:r,isLoading:s,reason:a,trialDaysLeft:i,trialEndDate:o}=dN();if(s)return n.jsx("div",{className:"flex items-center justify-center h-40",children:n.jsx(Rt,{className:"h-8 w-8 animate-spin text-muted-foreground"})});if(r)return n.jsx(n.Fragment,{children:e});const u=c=>c?c.toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"}):"N/A";return n.jsxs(de,{className:"border-destructive/20 bg-destructive/5",children:[n.jsx(Ce,{children:n.jsxs(Se,{className:"flex items-center gap-2",children:[n.jsx(eg,{className:"h-5 w-5 text-destructive"}),a==="trial_expired"?"Trial Expired":"Premium Feature"]})}),n.jsxs(ve,{className:"space-y-4",children:[a==="trial_expired"&&o&&n.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[n.jsx(qx,{className:"h-4 w-4 text-muted-foreground"}),n.jsxs("span",{children:["Your trial expired on ",u(o)]})]}),n.jsxs(Lr,{variant:"warning",className:"bg-amber-50",children:[n.jsx(Gt,{className:"h-4 w-4"}),n.jsx($r,{children:a==="trial_expired"?`Your free trial has expired. ${t} is only available with a paid subscription.`:`${t} is only available with a paid subscription.`})]}),n.jsx("p",{className:"text-sm text-center",children:"Upgrade to a paid plan to access all features, including unlimited AI interactions."})]}),n.jsx(At,{children:n.jsxs(R,{className:"w-full",onClick:()=>window.location.href="https://flutterwave.com/pay/bneoya5kmyoq",children:[n.jsx(gr,{className:"h-4 w-4 mr-2"}),"Upgrade Now"]})})]})}async function Np(e){const{createWorker:t}=await Ft(async()=>{const{createWorker:r}=await import("./index-BZU9upL2.js").then(s=>s.i);return{createWorker:r}},__vite__mapDeps([4,3]));try{const r=await t();await r.loadLanguage("eng"),await r.initialize("eng");const s=URL.createObjectURL(e),{data:{text:a}}=await r.recognize(s);return URL.revokeObjectURL(s),await r.terminate(),a.trim()}catch(r){throw console.error("Error processing image:",r),new Error("Failed to process image file")}}async function fN(e){return new Promise((t,r)=>
501{if(!("webkitSpeechRecognition"in window)&&!("SpeechRecognition"in window)){r(new Error("Your browser doesn't support speech recognition. Please try Chrome, Edge, or Safari."));return}const s=new Audio,a=URL.createObjectURL(e);s.src=a;const i=window.SpeechRecognition||window.webkitSpeechRecognition,o=new i;o.lang="en-US",o.continuous=!0,o.interimResults=!1;let u="";o.onresult=c=>{for(let l=c.resultIndex;l<c.results.length;l++)c.results[l].isFinal&&(u+=c.results[l][0].transcript+" ")},o.onend=()=>{URL.revokeObjectURL(a),t(u.trim()||"Sorry, I couldn't understand what you said. Please try again.")},o.onerror=c=>{URL.revokeObjectURL(a),console.error("Speech recognition error:",c.error),r(new Error(`Speech recognition error: ${c.error}`))},s.onplay=()=>{o.start()},s.play().catch(c=>{URL.revokeObjectURL(a),console.error("Error playing audio:",c),r(new Error("Error processing audio. Please try again."))}),setTimeout(()=>{if(!u){const c=new FileReader;c.onload=()=>{t("I heard you! Please tap the mic again and speak clearly.")},c.onerror=()=>{r(new Error("Error processing audio. Please try again."))},c.readAsArrayBuffer(e)}},5e3)})}async function Cp(e){const t=await Ft(()=>import("./pdf-C1rwW0z_.js").then(r=>r.p),__vite__mapDeps([2,1,3]));t.GlobalWorkerOptions.workerSrc=`//cdnjs.cloudflare.com/ajax/libs/pdf.js/${t.version}/pdf.worker.min.js`;try{const r=await e.arrayBuffer(),s=await t.getDocument({data:r}).promise;let a="";for(let i=1;i<=s.numPages;i++){const c=(await(await s.getPage(i)).getTextContent()).items.map(l=>l.str).join(" ");a+=c+`
502`}return a.trim()}catch(r){throw console.error("Error processing PDF:",r),new Error("Failed to process PDF file")}}async function hN(e){try{return(await e.text()).trim()}catch(t){throw console.error("Error processing text file:",t),new Error("Failed to process text file")}}async function mN(e){const t=e.type.toLowerCase();try{if(t.includes("pdf"))return await Cp(e);if(t.includes("image"))return await Np(e);if(t.includes("text")||e.name.endsWith(".txt")||e.name.endsWith(".md"))return await hN(e);throw new Error("Unsupported file type")}catch(r){throw console.error("Error processing file:",r),r}}async function pN(e){if(e.type.includes("image"))try{const t=await Np(e),r=await xN(e);return{content:t,fileType:"image",fileContent:r}}catch(t){throw console.error("Error processing image:",t),new Error("Failed to process image")}else if(e.type.includes("pdf"))try{return{content:await Cp(e),fileType:"pdf"}}catch(t){throw console.error("Error processing PDF:",t),new Error("Failed to process PDF")}else if(e.type.includes("text"))try{return{content:await e.text(),fileType:"text"}}catch(t){throw console.error("Error processing text file:",t),new Error("Failed to process text file")}else throw new Error("Unsupported file type")}function xN(e){return new Promise((t,r)=>{const s=new FileReader;s.readAsDataURL(e),s.onload=()=>t(s.result),s.onerror=a=>r(a)})}const gN=`
503  .markdown-content h1, .markdown-content h2, .markdown-content h3, .markdown-content h4 {
504    font-weight: 600;
505    margin-top: 1.2em;
506    margin-bottom: 0.6em;
507  }
508  .markdown-content h1 { font-size: 1.5em; }
509  .markdown-content h2 { font-size: 1.3em; }
510  .markdown-content h3 { font-size: 1.1em; }
511  .markdown-content p { margin-bottom: 0.8em; }
512  .markdown-content ul, .markdown-content ol {
513    padding-left: 1.5em;
514    margin-bottom: 0.8em;
515  }
516  .markdown-content ul { list-style-type: disc; }
517  .markdown-content ol { list-style-type: decimal; }
518  .markdown-content a {
519    color: #7c3aed;
520    text-decoration: underline;
521  }
522  .dark .markdown-content a {
523    color: #a78bfa;
524  }
525  .markdown-content code {
526    font-family: monospace;
527    background-color: rgba(124, 58, 237, 0.1);
528    padding: 0.2em 0.4em;
529    border-radius: 3px;
530    font-size: 0.9em;
531  }
532  .dark .markdown-content code {
533    background-color: rgba(167, 139, 250, 0.1);
534  }
535  .markdown-content pre {
536    background-color: #f5f3ff;
537    padding: 0.8em;
538    border-radius: 5px;
539    overflow-x: auto;
540    margin-bottom: 1em;
541  }
542  .dark .markdown-content pre {
543    background-color: #1f1f1f;
544  }
545  .markdown-content pre code {
546    background-color: transparent;
547    padding: 0;
548  }
549  .markdown-content blockquote {
550    border-left: 4px solid #e9e9e9;
551    padding-left: 1em;
552    margin-left: 0;
553    margin-bottom: 1em;
554    color: #666;
555  }
556  .dark .markdown-content blockquote {
557    border-left-color: #404040;
558    color: #a3a3a3;
559  }
560  .markdown-content table {
561    border-collapse: collapse;
562    width: 100%;
563    margin-bottom: 1em;
564  }
565  .markdown-content table, .markdown-content th, .markdown-content td {
566    border: 1px solid #ddd;
567  }
568  .dark .markdown-content table, .dark .markdown-content th, .dark .markdown-content td {
569    border-color: #404040;
570  }
571  .markdown-content th, .markdown-content td {
572    padding: 0.5em;
573    text-align: left;
574  }
575  .markdown-content img {
576    max-width: 100%;
577    border-radius: 5px;
578  }
579`;function bN(){const[e,t]=f.useState(""),[r,s]=f.useState([{role:"assistant",content:"Hello! I'm Einstein, your AI tutor. I'm here to help you learn and understand any concept. What would you like to study today? You can also upload images, PDFs, or text documents to discu
579ss."}]),[a,i]=f.useState(!1),[o,u]=f.useState(null),[c,l]=f.useState(!1),d=f.useRef(null),h=f.useRef(null),{user:m}=ke(),{sendMessage:p}=Ju(),{markFeatureExplored:x,hasCompletedExploration:g}=Ls(),[b,v]=f.useState([]),[y,w]=f.useState(!1),[_,k]=f.useState(null),[N,j]=f.useState(!1),[C,I]=f.useState("all");f.useEffect(()=>{if(g)return;const O=setTimeout(()=>{x("ai-tutor"),L.success("You've explored the AI Tutor!",{description:"Use the navigation at the bottom to continue to the next feature.",duration:5e3})},5e3);return()=>clearTimeout(O)},[x,g]),f.useEffect(()=>{if(m){const O=Os(_e.TUTOR_HISTORY,m.id);v(O);const $=localStorage.getItem(`${_e.ACTIVE_TUTOR_CONVERSATION}.${m.id}`);if($){const G=O.find(Z=>Z.id===$);G&&(s(G.data),k($))}}},[m]);const A=async O=>{if(!O.trim())return;if(!m){L.error("You must be logged in to use the AI tutor.");return}u(null);const $={role:"user",content:O.trim()};s(G=>[...G,$]),t(""),i(!0);try{const G=[...r,$],te={role:"assistant",content:(await p(JSON.stringify(G))).message},z=[...G,te];s(z),U(z)}catch(G){console.error("Error sending message:",G),u(G instanceof Error?G.message:String(G)),L.error("Failed to get AI response. Please try again.")}finally{i(!1)}},F=async O=>{await A(O)},E=async(O,$)=>{if(!m){L.error("You must be logged in to use the AI tutor.");return}j(!0),L.info(`Processing ${O.name}...`);try{const G=await pN(O);let Z=`I've uploaded a ${G.fileType} file: ${O.name}.`;$&&$.trim()&&(Z=`I've uploaded a ${G.fileType} file: ${O.name}. 
580My comment: "${$}"`);const te={role:"user",content:Z,fileType:G.fileType,fileContent:G.fileContent,fileName:O.name};s(se=>[...se,te]),i(!0);const z=[...r,te],q={role:"assistant",content:(await p(JSON.stringify(z))).message},ee=[...z,q];s(ee),U(ee),L.success(`Successfully processed ${O.name}`)}catch(G){console.error("Error processing file:",G),L.error("Failed to process file. Please try again with a different file.")}finally{j(!1),i(!1)}},U=O=>{var Z;if(!m)return;const $=((Z=O.find(te=>te.role==="user"))==null?void 0:Z.content)||"New conversation",G=$.length>30?`${$.substring(0,30)}...`:$;if(_){const te=b.findIndex(z=>z.id===_);if(te!==-1){const z=[...b];z[te]={...z[te],data:O,timestamp:Date.now()},localStorage.setItem(`${_e.TUTOR_HISTORY}.${m.id}`,JSON.stringify(z)),v(z)}}else{const te=jn(O,G,`Conversation with ${O.length} messages`);kn(_e.TUTOR_HISTORY,te,m.id),v(z=>[te,...z].slice(0,20)),k(te.id),localStorage.setItem(`${_e.ACTIVE_TUTOR_CONVERSATION}.${m.id}`,te.id)}},P=O=>{a||F(O)},Y=()=>{o&&r.length>0&&r[r.length-1].role==="user"&&(u(null),i(!0),r[r.length-1],r.slice(0,-1),p(JSON.stringify(r)).then(O=>{const $={role:"assistant",content:O.message},G=[...r,$];if(s(G),_&&m){const Z=b.findIndex(te=>te.id===_);if(Z!==-1){const te=[...b];te[Z]={...te[Z],data:G,timestamp:Date.now()},localStorage.setItem(`${_e.TUTOR_HISTORY}.${m.id}`,JSON.stringify(te)),v(te)}}}).catch(O=>{console.error("Retry failed:",O),u(O instanceof Error?O.message:String(O)),L.error("Still having trouble connecting. Please try again later.")}).finally(()=>{i(!1)}))},M=()=>{var O;c?document.exitFullscreen().catch($=>console.error($)):(O=d.current)==null||O.requestFullscreen().catch($=>console.error($)),l(!c)};typeof document<"u"&&document.addEventListener("fullscreenchange",()=>{l(!!document.fullscreenElement)});const Q=O=>{s(O.data),w(!1),k(O.id),m&&localStorage.setItem(`${_e.ACTIVE_TUTOR_CONVERSATION}.${m.id}`,O.id),L.success(`Loaded conversation: ${O.title}`)},S=()=>{s([{role:"assistant",content:"Hello! I'm Einstein, your AI tutor. I'm here to help you learn and understand any concept. What would you like to study today? You can also upload images, PDFs, or text documents to discuss."}]),k(null),w(!1),m&&localStorage.removeItem(`${_e.ACTIVE_TUTOR_CONVERSATION}.${m.id}`),L.success("New conversation started")},T=()=>{m&&(localStorage.removeItem(`${_e.TUTOR_HISTORY}.${m.id}`),localStorage.removeItem(`${_e.ACTIVE_TUTOR_CONVERSATION}.${m.id}`),v([]),k(null),L.success("Conversation history cleared"),S())};return n.jsxs(Cn,{children:[n.jsxs("div",{className:"container py-6 md:py-8 min-h-screen flex flex-col",children:[n.jsxs("h1",{className:"text-3xl md:text-4xl font-bold mb-6 flex items-center gap-2",children:[n.jsx("div",{className:"bg-explainify-100 dark:bg-explainify-800/40 p-2 rounded-lg",children:n.jsx(xr,{className:"h-6 w-6 md:h-7 md:w-7 text-explainify-600 dark:text-explainify-400"})}),"AI Tutor"]}),n.jsx("p",{className:"text-muted-foreground text-lg mb-8",children:"Your personal AI assistant for interactive learning and problem-solving."}),n.jsxs("div",{className:"flex flex-col gap-6 md:gap-8 flex-1",children:[n.jsx("div",{className:V("h-[calc(100vh-240p
580x)] lg:h-[calc(100vh-200px)] relative","transition-all duration-300 ease-in-out",c&&"fixed inset-0 h-screen z-50"),children:n.jsxs("div",{ref:d,className:V("h-full rounded-xl overflow-hidden shadow-lg flex flex-col bg-gradient-to-br from-explainify-600 to-explainify-800 relative",c&&"border-none rounded-none"),children:[n.jsx(cN,{isFullscreen:c,toggleFullscreen:M,startNewConversation:S,isLoading:a,toggleHistory:()=>w(!y),clearHistoryFn:T}),n.jsx("div",{className:"flex-1 overflow-y-auto bg-white/5 backdrop-blur-sm",children:n.jsx(aN,{messages:r,isLoading:a||N,errorState:o,onRetry:Y})}),n.jsx("div",{ref:h,className:"flex-shrink-0",children:n.jsx(kp,{isLoading:a||N,onSendMessage:F,onFileUpload:E,inputValue:e,setInputValue:t})})]})}),!c&&n.jsxs("div",{className:"space-y-6 md:space-y-8",children:[n.jsxs(de,{className:"border-explainify-100 dark:border-explainify-800/40 shadow-sm hover:shadow-md transition-shadow rounded-xl overflow-hidden",children:[n.jsx("div",{className:"bg-explainify-50 dark:bg-explainify-900/30 p-4 border-b border-explainify-100 dark:border-explainify-800/40",children:n.jsxs("h3",{className:"font-semibold text-lg flex items-center gap-2",children:[n.jsx(Sa,{className:"h-4 w-4 text-explainify-600 dark:text-explainify-400"}),"Suggested Topics"]})}),n.jsx("div",{className:"p-4",children:n.jsxs("div",{className:"space-y-3 md:space-y-4",children:[n.jsx(_n,{defaultValue:"all",onValueChange:I,className:"w-full",children:n.jsxs(Ms,{className:"w-full mb-2",children:[n.jsx(Ie,{value:"all",className:"flex-1",children:"All"}),n.jsx(Ie,{value:"stem",className:"flex-1",children:"STEM"}),n.jsx(Ie,{value:"humanities",className:"flex-1",children:"Humanities"}),n.jsx(Ie,{value:"skills",className:"flex-1",children:"Skills"})]})}),n.jsx(oN,{onSuggestionClick:P,category:C})]})})]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[n.jsx(uN,{}),n.jsx(jp,{})]})]})]}),y&&n.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm z-50 flex items-center justify-center p-4",children:n.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-xl max-w-2xl w-full max-h-[80vh] flex flex-col shadow-2xl animate-in fade-in zoom-in-95 duration-200",children:[n.jsxs("div",{className:"p-4 border-b flex items-center justify-between",children:[n.jsxs("h3",{className:"font-semibold text-lg flex items-center gap-2",children:[n.jsx(mt,{className:"h-4 w-4 text-explainify-600 dark:text-explainify-400"}),"Conversation History"]}),n.jsx(R,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-full",onClick:()=>w(!1),children:n.jsx(Ur,{className:"h-4 w-4"})})]}),n.jsx("div",{className:"p-4 overflow-y-auto flex-1",children:b.length>0?n.jsx("div",{className:"space-y-3",children:b.map(O=>n.jsxs("div",{className:V("p-3 rounded-lg border cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-700/50 transition-colors",_===O.id&&"border-explainify-500 bg-explainify-50 dark:bg-explainify-900/30"),onClick:()=>Q(O),children:[n.jsx("h4",{className:"font-medium truncate",children:O.title||"Untitled Conversation"}),n.jsxs("div",{className:"flex justify-between items-center text-xs text-muted-foreground mt-1",children:[n.jsx("span",{children:new Date(O.timestamp).toLocaleString()}),n.jsxs("span",{children:[O.data.length," messages"]})]})]},O.id))}):n.jsxs("div",{className:"text-center py-10",children:[n.jsx("div",{className:"w-16 h-16 bg-explainify-100 dark:bg-explainify-900/50 rounded-full flex items-center justify-center mx-auto mb-4",children:n.jsx(mt,{className:"h-8 w-8 text-explainify-600 dark:text-explainify-400"})}),n.jsx("h4",{className:"font-medium text-lg mb-2",children:"No conversation history"}),n.jsx("p",{className:"text-muted-foreground",children:"Your conversation history will appear here."})]})}),n.jsxs("div",{className:"p-4 border-t flex gap-2 justify-between",children:[n.jsx(R,{variant:"outline",className:"w-full",onClick:()=>{S(),w(!1)},children:"Start New Conversation"}),b.length>0&&n.jsxs(R,{variant:"destructive",className:"flex-shrink-0",onClick:T,children:[n.jsx(Ts,{className:"h-4 w-4 mr-2"}),"Clear All"]})]})]})})]}),n.jsx("style",{jsx:!0,global:!0,children:gN})]})}const Sp=f.forwardRef(({className:e,...t},r)=>n.jsx("textarea",{className:V("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm r
580ing-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...t}));Sp.displayName="Textarea";function yN(){const[e,t]=f.useState(!1),[r,s]=f.useState(null),a=f.useCallback(o=>{r&&(r.pause(),r.remove());const u=new SpeechSynthesisUtterance(o),l=window.speechSynthesis.getVoices().find(d=>d.lang.includes("en")&&d.name.includes("Google")||d.name.includes("Female"));return l&&(u.voice=l),t(!0),u.onend=()=>{t(!1)},u.onerror=()=>{t(!1)},window.speechSynthesis.speak(u),()=>{window.speechSynthesis.cancel(),t(!1)}},[r]),i=f.useCallback(()=>{r&&(r.pause(),r.remove(),s(null)),window.speechSynthesis.cancel(),t(!1)},[r]);return{speak:a,stopSpeaking:i,isSpeaking:e}}function vN({question:e,explanation:t,onBack:r}){const s=t||`
581    <div>
582      <h4 class="font-semibold text-explainify-800 dark:text-explainify-200">Step 1: Understand the Problem</h4>
583      <p class="mt-1 text-muted-foreground dark:text-gray-300">
584        We need to find the derivative of f(x) = x³ - 4x² + 2x - 7
585      </p>
586      
587      <div class="bg-white dark:bg-gray-800 border dark:border-gray-700 rounded-lg p-3 mt-2">
588        <p class="dark:text-gray-200">The derivative measures the rate of change of a function with respect to a variable.</p>
589      </div>
590      
591      <h4 class="font-semibold text-explainify-800 dark:text-explainify-200 mt-4">Step 2: Recall the Power Rule</h4>
592      <p class="mt-1 text-muted-foreground dark:text-gray-300">
593        For any term x^n, the derivative is n·x^(n-1)
594      </p>
595      
596      <div class="bg-white dark:bg-gray-800 border dark:border-gray-700 rounded-lg p-3 mt-2">
597        <p class="dark:text-gray-200">
598          The general form of the power rule is:
599          <br>
600          If f(x) = x^n, then f'(x) = n·x^(n-1)
601        </p>
602      </div>
603      
604      <h4 class="font-semibold text-explainify-800 dark:text-explainify-200 mt-4">Step 3: Apply the Rule to Each Term</h4>
605      <p class="mt-1 text-muted-foreground dark:text-gray-300">
606        We'll take the derivative of each term separately
607      </p>
608      
609      <div class="bg-white dark:bg-gray-800 border dark:border-gray-700 rounded-lg p-3 mt-2">
610        <p class="dark:text-gray-200">
611          1. For x³: The derivative is 3x² <br>
612          2. For -4x²: The derivative is -8x <br>
613          3. For 2x: The derivative is 2 <br>
614          4. For -7: The derivative is 0 (constants disappear)
615        </p>
616      </div>
617      
618      <h4 class="font-semibold text-explainify-800 dark:text-explainify-200 mt-4">Step 4: Combine all terms</h4>
619      <p class="mt-1 text-muted-foreground dark:text-gray-300">
620        Add all the derivatives together
621      </p>
622      
623      <div class="bg-white dark:bg-gray-800 border dark:border-gray-700 rounded-lg p-3 mt-2">
624        <p class="dark:text-gray-200">
625          f'(x) = 3x² - 8x + 2
626        </p>
627      </div>
628      
629      <div class="bg-explainify-100 dark:bg-gray-700 p-4 rounded-lg mt-4">
630        <h4 class="font-semibold text-explainify-800 dark:text-explainify-200">Final Answer:</h4>
631        <p class="mt-1 dark:text-gray-200">
632          The derivative of f(x) = x³ - 4x² + 2x - 7 is f'(x) = 3x² - 8x + 2
633        </p>
634      </div>
635      
636      <h4 class="font-semibold text-explainify-800 dark:text-explainify-200 mt-4">Additional Learning Resources</h4>
637      <ul class="mt-1 list-disc pl-5 space-y-1 text-muted-foreground dark:text-gray-300">
638        <li>Khan Academy: Introduction to Derivatives</li>
639        <li>MIT OpenCourseWare: Single Variable Calculus</li>
640        <li>3Blue1Brown: The Essence of Calculus series</li>
641      </ul>
642    </div>
643  `;return n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"flex justify-between items-center",children:[n.jsx("h3",{className:"text-xl font-bold text-explainify-800 dark:text-explainify-200",children:"Detailed Explanation"}),n.jsx(R,{variant:"ghost",size:"sm",onClick:r,className:"text-explainify-600 dark:text-explainify-400",children:"Close"})]}),n.jsxs("div",{className:"flex items-center gap-2 mb-4 text-sm text-muted-foreground dark:text-gray-300",children:[n.jsx(Jx,{className:"h-4 w-4"}),n.jsx("span",{children:"Enhanced learning material with additional context"})]}),n.jsxs(de,{className:"p-6 border bg-white dark:bg-gray-800 dark:border-gray-700",children:[n.jsx("div",{className:"bg-explainify-50 dark:bg-gray-700/50 p-4 rounded-lg mb-6",children:n.jsx("p",{className:"font-medium dark:text-gray-200",children:e})}),n.jsx("div",{className:"space-y-4 prose dark:prose-invert max-w-none",dangerouslySetInnerHTML:{__html:s}}),n.jsx("div",{className:"mt-6 border-t dark:border-gray-700 pt-4",children:n.jsxs("div",{className:"flex items-start gap-2",children:[n.jsx(Sa,{className:"h-5 w-5 text-amber-500 flex-shrink-0 mt-1"}),n.jsxs("p",{className:"text-sm dark:text-gray-300",children:[n.jsx("span",{className:"font-semibold dark:text-gray-200",children:"Learning Tip:"})," When solving derivative problems, always break down complex functions into individual terms and apply the appropriate differentiation rules to each term separately before combining them."]})]})})]})]})}function wN(){const[e,t]=f.useState(""),[r,s]=f.useState(!1),[a,i]=f.useState(null),[o,u]=f.useState("Find the derivative of f(x) = x³ - 4x² + 2x - 7"),[c,l]=f.useState(["Solve the quadratic equation: 2x² + 5x - 3 = 0","What is the capital of Madagascar?","Explain how DNA replication works"]),{speak:d,stopSpeaking:h,isSpeaking:m}=yN(),p=f.useRef(null),x=f.useRef(null),[g,b]=f.useState(!1),v=f.useRef(null),y=f.useRef([]),w=f.useRef(null),[_,k]=f.useState(!1),[N,j]=f.useState("solution"),{user:C}=ke(),{sendMessage:I}=Ju(),{markFeatureExplored:A,hasCompletedExploration:F}=Ls(),[E,U]=f.useState([]);f.useEffect(()=>{if(C){const z=Os(_e.QUESTION_HISTORY,C.id);if(U(z),z.length>0){const K=z.slice(0,3).map(q=>q.data.question);l(K)}}},[C]),f.useEffect(()=>{if(!F)if(a)A("question-solver");else{const z=setTimeout(()=>{A("question-solver"),L.success("You've explored the Question Solver!",{description:"Use the navigation at the bottom to continue to the next feature.",duration:5e3})},5e3);return()=>clearTimeout(z)}},[a,A,F]);const P=async()=>
643{if(!e.trim()){L.error("Please enter a question first");return}if(!C){L.error("Please log in to use this feature");return}s(!0);try{const z=`
644      You are an educational AI assistant designed to provide step-by-step explanations for academic questions.
645      Please solve the following question with detailed steps:
646      "${e}"
647      
648      Format your response in clear steps. If it's a mathematical problem, explain the approach before solving.
649      `,K=await I(JSON.stringify([{role:"user",content:z}]));i(K.message),u(e);const q={question:e,solution:K.message},ee=jn(q,e.length>30?e.substring(0,30)+"...":e,new Date().toLocaleString());kn(_e.QUESTION_HISTORY,ee,C.id),U(X=>[ee,...X].slice(0,20));const se=[e,...c.filter(X=>X!==e)].slice(0,3);l(se),t("")}catch(z){console.error("Error solving question:",z),(z instanceof Error?z.message:String(z)).includes("Message limit reached")?L.error("You've reached your message limit. Please upgrade your plan for unlimited questions."):L.error("Failed to solve the question. Please try again later.")}finally{s(!1)}},Y=z=>{t(z)},M=z=>{u(z.data.question),i(z.data.solution)},Q=()=>{C&&(localStorage.removeItem(`${_e.QUESTION_HISTORY}.${C.id}`),U([]),L.success("Question history cleared"))},S=async()=>{if(g||_){b(!1),k(!1),v.current&&v.current.state==="recording"&&v.current.stop(),w.current&&(w.current.stop(),w.current=null);return}if("webkitSpeechRecognition"in window||"SpeechRecognition"in window)try{const z=window.SpeechRecognition||window.webkitSpeechRecognition,K=new z;K.lang="en-US",K.continuous=!1,K.interimResults=!0,w.current=K;let q="",ee="";K.onstart=()=>{k(!0),L.success("Listening... Speak your question clearly.")},K.onresult=se=>{ee="";for(let X=se.resultIndex;X<se.results.length;X++){const ce=se.results[X][0].transcript;se.results[X].isFinal?q+=ce+" ":ee+=ce}ee?t(q+ee):q&&t(q.trim())},K.onerror=se=>{console.error("Speech recognition error:",se.error),k(!1),L.error(`Speech recognition error: ${se.error}`)},K.onend=()=>{k(!1),e.trim()?L.success("Speech converted to text"):L.error("No speech detected. Please try again and speak clearly.")},K.start()}catch(z){console.error("Error with speech recognition:",z),k(!1),L.error("Could not initialize speech recognition. Trying alternative method..."),T()}else T()},T=async()=>
649{try{L.info("Accessing microphone...");const z=await navigator.mediaDevices.getUserMedia({audio:!0}),K=new MediaRecorder(z);v.current=K,y.current=[],K.ondataavailable=q=>{q.data.size>0&&y.current.push(q.data)},K.onstop=async()=>{const q=new Blob(y.current,{type:"audio/webm"});z.getTracks().forEach(ee=>ee.stop()),L.info("Processing audio...");try{const ee=await fN(q);t(ee),L.success("Speech converted to text")}catch(ee){console.error("Error processing audio:",ee),L.error("Failed to process speech. Please try again.")}},K.start(),b(!0),L.success("Recording... Speak your question clearly."),setTimeout(()=>{v.current&&v.current.state==="recording"&&(v.current.stop(),b(!1))},1e4)}catch(z){console.error("Error accessing microphone:",z),b(!1),L.error("Could not access microphone. Please check permissions and try again.")}},O=()=>{x.current&&x.current.click()},$=async z=>{var se;const K=(se=z.target.files)==null?void 0:se[0];if(!K)return;const q=10*1024*1024;if(K.size>q){L.error("File is too large. Maximum size is 10MB.");return}if(!["application/pdf","image/jpeg","image/png","image/webp","text/plain","text/markdown"].includes(K.type)&&!K.name.endsWith(".txt")&&!K.name.endsWith(".md")){L.error("Unsupported file type. Please upload a PDF, image, or text file.");return}L.info(`Processing ${K.name}...`,{icon:n.jsx(Rt,{className:"h-4 w-4 animate-spin"})});try{const X=await mN(K);if(!X.trim()){L.error("No text could be extracted from the file. Please try a different file or enter your question manually.");return}const ce=500;X.length>ce?(t(X.substring(0,ce)),L.warning(`Text was truncated as it exceeded ${ce} characters.`)):(t(X),L.success("Text extracted successfully!"))}catch(X){console.error("Error processing file:",X),L.error(X instanceof Error?X.message:"Failed to process file. Please try again.")}finally{x.current&&(x.current.value="")}},G=()=>{var K;if(m){h();return}let z="";if(a){const q=document.createElement("div");q.innerHTML=a,z=q.textContent||q.innerText||""}else z=((K=p.current)==null?void 0:K.textContent)||"";z&&(L.info("Reading solution aloud..."),d(z))},Z=()=>{j("detailed")},te=()=>{j("solution")};return f.useEffect(()=>()=>{h(),v.current&&v.current.state==="recording"&&v.current.stop(),w.current&&w.current.stop()},[h]),n.jsx(Cn,{children:n.jsx("div",{className:"bg-gray-50 dark:bg-gray-900 min-h-screen",children:n.jsx("div",{className:"container py-8",children:n.jsxs("div",{className:"w-full max-w-5xl mx-auto",children:[n.jsxs("div",{className:"text-center w-full mx-auto mb-8",children:[n.jsx("h2",{className:"text-3xl md:text-4xl font-bold tracking-tight mb-3 md:mb-4",children:n.jsx("span",{className:"text-explainify-600 dark:text-explainify-400",children:"Question Solver"})}),n.jsx("p",{className:"text-muted-foreground text-base md:text-lg max-w-2xl mx-auto",children:"Ask any question and receive detailed, step-by-step explanations tailored to your learning needs."})]}),n.jsxs("div",{className:"grid lg:grid-cols-5 gap-6 items-start",children:[n.jsx("div",{className:"lg:col-span-3 order-2 lg:order-1",children:n.jsx(jp,{featureName:"The Question Solver",children:n.jsxs(de,{className:"overflow-hidden shadow-md border-explainify-100 dark:border-gray-700 dark:bg-gray-800",children:[n.jsx("div",{className:"p-4 bg-explainify-50 dark:bg-explainify-900/20 border-b border-explainify-100 dark:border-gray-700",children:n.jsxs("h3",{className:"font-semibold text-lg flex items-center gap-2",children:[n.jsx(qt,{className:"h-5 w-5 text-explainify-600 dark:text-explainify-400"}),"Ask Your Question"]})}),n.jsxs("div",{className:"p-5 space-y-5",children:[n.jsxs("div",{className:"flex flex-col gap-4",children:[n.jsxs("div",{className:"relative",children:[n.jsx(Sp,{placeholder:o,value:e,onChange:z=>t(z.target.value),className:"resize-none min-h-[120px] text-base focus:ring-explainify-500/50",onKeyDown:z=>{z.key==="Enter"&&z.ctrlKey&&!r&&(z.preventDefault(),P())}}),e&&n.jsx("button",{onClick:()=>t(""),className:"absolute right-3 top-3 text-muted-foreground hover:text-foreground",children:"✕"}),n.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Press Ctrl+Enter to submit"})]}),n.jsxs("div",{className:"flex flex-wrap items-center gap-3 justify-between",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(R,{variant:"outline",size:"icon",onClick:S,className:V("transition-colors duration-200",(g||_)&&"bg-red-500 hover:bg-red-600 text-white border-red-400"),title:"Record your question",children:_?n.jsx(Ht,{className:"h-4 w-4 animate-pulse"}):g?n.jsx(pc,{className:"h-4 w-4 animate-pulse"}):n.jsx(pc,{className:"h-4 w-4"})}),n.jsxs(R,{variant:"outline",size:"icon",onClick:O,title:"Upload image or document",children:[n.jsx(ra,{className:"h-4 w-4"}),n.jsx("input",{type:"file",ref:x,className:"hidden",accept:".pdf,.txt,.md,image/jpeg,image/png,image/webp",onChange:$})]}),n.jsx("span",{className:"text-xs text-muted-foreground hidden sm:inline-block",children:"Max file size: 50MB"})]}),n.jsx(R,{onClick:P,disabled:r||!e,className:"bg-explainify-600 hover:bg-explainify-700 text-white px-5",children:r?n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Rt,{className:"h-4 w-4 animate-spin"}),n.jsx("span",{children:"Processing..."})]}):n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(qt,{className:"h-4 w-4"}),n.jsx("span",{children:"Solve Question"})]})})]})]}),a&&n.jsxs("div",{ref:p,className:"mt-8 border rounded-lg overflow-hidden bg-white dark:bg-gray-800/50 dark:border-gray-700 shadow-sm",children:[n.jsxs("div",{className:"flex border-b dark:border-gray-700 bg-gray-50 dark:bg-gray-800/80",children:[n.jsx("button",{className:`px-5 py-3 font-medium text-sm ${N==="solution"?"border-b-2 border-explainify-600 text-explainify-700 dark:border-explainify-400 dark:text-explainify-300 bg-white dark:bg-gray-800":"text-muted-foreground dark:text-gray-400"}`,onClick:()=>j("solution"),children:"Solution"}),n.jsx("button",{className:`px-5 py-3 font-medium text-sm ${N==="detailed"?"border-b-2 border-explainify-600 text-explainify-700 dark:border-explainify-400 dark:text-explainify-300 bg-white dark:bg-gray-800":"text-muted-foreground dark:text-gray-400"}`,onClick:Z,children:"Detailed View"}),n.jsx("div",{className:"ml-auto flex items-center px-3",children:n.jsx(R,{variant:"ghost",size:"sm",onClick:G,className:"text-muted-foreground h-8 w-8 p-0 rounded-full",title:m?"Stop speaking":"Listen to solution",children:m?n.jsx(qo,{className:"h-4 w-4"}):n.jsx(Bo,{className:"h-4 w-4"})})})]}),n.jsxs("div",{className:"p-5",children:[N==="solution"&&n.jsx("div",{className:"prose prose-explainify max-w-none dark:prose-invert",dangerouslySetInnerHTML:{__html:_N(a)}}),N==="detailed"&&n.jsx(vN,{question:o,explanation:a,onBack:te})]})]})]})]})})}),n.jsx("div",{className:"lg:col-span-2 order-1 lg:order-2",children:n.jsxs("div",{className:"space-y-6 sticky top-24",children:[n.jsxs(de,{className:"overflow-hidden shadow-md border-explainify-100 dark:border-gray-700",children:[n.jsx("div",{className:"p-4 bg-explainify-50 dark:bg-explainify-900/20 border-b border-explainify-100 dark:border-gray-700",children:n.jsxs("h3",{className:"font-semibold text-lg flex items-center gap-2",children:[n.jsx(Be,{className:"h-5 w-5 text-explainify-600 dark:text-explainify-400"}),"How It Works"]})}),n.jsx("div",{className:"p-5",children:n.jsxs("ol",{className:"space-y-4 text-sm text-muted-foreground dark:text-gray-300",children:[n.jsxs("li",{className:"flex items-start gap-3",children:[n.jsx("div",{className:"flex-shrink-0 w-6 h-6 rounded-full bg-explainify-100 dark:bg-explainify-900/30 flex items-center justify-center",children:n.jsx("span",{className:"text-explainify-600 dark:text-explainify-400 text-sm font-medium",children:"1"})}),n.jsxs("div",{children:[n.jsx("p",{className:"font-medium text-foreground dark:text-gray-200",children:"Enter your question"}),n.jsx("p",{className:"mt-1",children:"Type your question, upload an image, or speak it"})]})]}),n.jsxs("li",{className:"flex items-start gap-3",children:[n.jsx("div",{className:"flex-shrink-0 w-6 h-6 rounded-full bg-explainify-100 dark:bg-explainify-900/30 flex items-center justify-center",children:n.jsx("span",{className:"text-explainify-600 dark:text-explainify-400 text-sm font-medium",children:"2"})}),n.jsxs("div",{children:[n.jsx("p",{className:"font-medium text-foreground dark:text-gray-200",children:"AI generates solution"}),n.jsx("p",{className:"mt-1",children:"Our AI creates a comprehensive step-by-step answer"})]})]}),n.jsxs("li",{className:"flex items-start gap-3",children:[n.jsx("div",{className:"flex-shrink-0 w-6 h-6 rounded-full bg-explainify-100 dark:bg-explainify-900/30 flex items-center justify-center",children:n.jsx("span",{className:"text-explainify-600 dark:text-explainify-400 text-sm font-medium",children:"3"})}),n.jsxs("div",{children:[n.jsx("p",{className:"font-medium text-foreground dark:text-gray-200",children:"Review & understand"}),n.jsx("p",{className:"mt-1",children:"Read or listen to the solution at your own pace"})]})]})]})})]}),n.jsxs(de,{className:"overflow-hidden shadow-md border-explainify-100 dark:border-gray-700",children:[n.jsxs("div",{className:"p-4 bg-explainify-50 dark:bg-explainify-900/20 border-b border-explainify-100 dark:border-gray-700 flex items-center justify-between",children:[n.jsxs("h3",{className:"font-semibold text-lg flex items-center gap-2",children:[n.jsx(Sa,{className:"h-5 w-5 text-explainify-600 dark:text-explainify-400"}),"Recent Questions"]}),E.length>0&&n.jsxs(R,{variant:"ghost",size:"sm",onClick:Q,className:"h-8 px-2 text-xs text-muted-foreground hover:text-destructive",children:[n.jsx(Ts,{className:"h-3.5 w-3.5 mr-1"}),"Clear"]})]}),n.jsx("div",{className:"p-5",children:c.length===0&&E.length===0?n.jsxs("div",{className:"flex flex-col items-center justify-center py-6 text-center",children:[n.jsx("div",{className:"w-12 h-12 rounded-full bg-explainify-100 dark:bg-explainify-900/30 flex items-center justify-center mb-3",children:n.jsx(qt,{className:"h-5 w-5 text-explainify-600 dark:text-explainify-400"})}),n.jsx("p",{className:"text-muted-foreground dark:text-gray-400",children:"Your recent questions will appear here"})]}):n.jsxs("div",{className:"space-y-4",children:[E.length>0&&n.jsxs("div",{className:"space-y-2",children:[n.jsxs("div",{className:"flex items-center gap-1 text-xs font-medium text-muted-foreground mb-2",children:[n.jsx(og,{className:"h-3 w-3"})," History"]}),E.slice(0,3).map(z=>n.jsxs("div",{className:"p-3 rounded-lg border hover:bg-explainify-50 hover:border-explainify-200 cursor-pointer transition-colors dark:border-gray-700 dark:hover:bg-gray-700/50 dark:hover:border-gray-600",onClick:()=>M(z),children:[n.jsx("p",{className:"line-clamp-2 dark:text-gray-200",children:z.data.question}),n.jsx("p",{className:"text-xs text-muted-foreground mt-1 dark:text-gray-400",children:new Date(z.timestamp).toLocaleStr
649ing(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})})]},z.id))]}),c.length>0&&n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-1 text-xs font-medium text-muted-foreground mb-2",children:[n.jsx(Xe,{className:"h-3 w-3"})," Suggested Questions"]}),c.map((z,K)=>n.jsx("div",{className:"p-3 rounded-lg border hover:bg-explainify-50 hover:border-explainify-200 cursor-pointer transition-colors mb-2 dark:border-gray-700 dark:hover:bg-gray-700/50 dark:hover:border-gray-600 dark:text-gray-200",onClick:()=>Y(z),children:z},K))]})]})})]})]})})]})]})})})})}function _N(e){const t=e.split(`
650
651`);let r="",s=!1,a=1;for(const i of t){const o=i.trim();if(o)if(o.toLowerCase().startsWith("step ")||o.match(/^[0-9]+\./)||o.includes(":")&&!s){s&&(r+="</div>"),s=!0;let u=o;o.toLowerCase().startsWith("step ")||(u=`Step ${a}: ${o}`,a++),r+=`<div><h4 class="font-semibold text-explainify-800 dark:text-explainify-200">${u}</h4>`}else o.toLowerCase().includes("final")&&(o.toLowerCase().includes("answer")||o.toLowerCase().includes("solution"))?(s&&(r+="</div>",s=!1),r+=`<div class="bg-explainify-100 dark:bg-gray-700 p-4 rounded-lg">
652                          <h4 class="font-semibold text-explainify-800 dark:text-explainify-200">${o}</h4>`):(r+=`<p class="mt-1 ${s?"text-muted-foreground dark:text-gray-300":"dark:text-gray-200"}">${o}</p>`,(o.includes("=")||/[a-zA-Z]\([a-zA-Z]\)/.test(o)||/[0-9x\+\-\*\/\^]+/.test(o))&&(r+=`<div class="bg-white dark:bg-gray-800 border dark:border-gray-700 rounded-lg p-3 mt-2"><p class="dark:text-gray-200">${o}</p></div>`))}return s&&(r+="</div>"),r}function kN({searchResults:e,currentVideoId:t,onSelectVideo:r}){const[s,a]=f.useState(!1);return f.useEffect(()=>{const i=()=>{a(window.innerWidth<768)};return i(),window.addEventListener("resize",i),()=>{window.removeEventListener("resize",i)}},[]),!e||e.length<=1?null:n.jsxs("div",{className:"p-4 border-t",children:[n.jsxs("h4",{className:"font-medium mb-2 flex items-center",children:[n.jsx(Tt,{className:"h-4 w-4 mr-2 text-red-600"}),"Related Videos"]}),n.jsx("div",{className:`grid ${s?"grid-cols-1":"sm:grid-cols-2"} gap-2`,children:e.slice(1,5).map(i=>n.jsxs("div",{className:`flex gap-2 p-2 border rounded hover:bg-gray-50 cursor-pointer ${t===i.id?"bg-gray-100 border-explainify-500":""}`,onClick:()=>r(i),children:[n.jsx("div",{className:"w-20 h-12 flex-shrink-0 bg-gray-100 overflow-hidden",children:n.jsx("img",{src:i.thumbnailUrl,alt:i.title,className:"w-full h-full object-cover"})}),n.jsxs("div",{className:"overflow-hidden",children:[n.jsx("p",{className:"text-xs font-medium line-clamp-2",children:i.title}),n.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:i.channelTitle})]})]},i.id))})]})}function jN(){const[e,t]=f.useState("visual"),[r,s]=f.useState(""),[a,i]=f.useState(!1),[o,u]=f.useState(null),[c,l]=f.useState({topic:"",videoId:"",videoTitle:"",channelTitle:"",textContent:""});f.useRef(null);const[d,h]=f.useState(0),[m,p]=f.useState(0),{user:x}=ke(),{sendMessage:g}=Ju(),[b,v]=f.useState([]),[y,w]=f.useState(!1);f.useEffect(()=>{if(x){const A=Os(_e.SEARCH_HISTORY,x.id);v(A)}},[x]);const _=async A=>{if(A.preventDefault(),!r.trim()){L.error("Please enter a search term");return}if(!x){L.error("Please log in to use this feature");return}i(!0);try{const F=await D_(r,5);if(!F||F.length===0)throw new Error("No videos found for this topic");u(F);const E=F[0],U=await k(r),P={topic:r,videoId:E.id,videoTitle:E.title,channelTitle:E.channelTitle,textContent:U};l(P);const Y={topic:r,videoId:E.id,videoTitle:E.title,textContent:U},M=jn(Y,r,new Date().toLocaleString());kn(_e.SEARCH_HISTORY,M,x.id),v(Q=>[M,...Q].slice(0,20)),L.success("Content loaded successfully"),h(0),p(0)}catch(F){console.error("Error searching for content:",F),(F instanceof Error?F.message:String(F)).includes("Message limit reached")?L.error("You've reached your message limit. Please upgrade your plan for unlimited content."):L.error("Failed to load content. Please try again.")}finally{i(!1)}},k=async A=>{try{const F=`Please provide an educational overview of the topic: ${A}. 
653      Include the following sections:
654      1. Introduction to ${A}
655      2. Key principles or concepts
656      3. Important details and explanations
657      4. Real-world applications
658      5. Summary
659      
660      Format the content in clear paragraphs with appropriate headings.`;return(await g(JSON.stringify([{role:"user",content:F}]))).message}catch(F){throw console.error("Error generating text content:",F),F}},N=A=>{s(A.data.topic),l({topic:A.data.topic,videoId:A.data.videoId,videoTitle:A.data.videoTitle,channelTitle:"",textContent:A.data.textContent}),w(!1),L.success(`Loaded: ${A.data.topic}`)},j=()=>{x&&(localStorage.removeItem(`${_e.SEARCH_HISTORY}.${x.id}`),v([]),L.success("Search history cleared"))};f.useEffect(()=>{t("visual"),e==="visual"?h(A=>Math.min(100,A+10)):e==="text"&&p(A=>Math.min(100,A+10))},[e]);const C=A=>{const F=A.currentTarget,E=F.scrollTop,U=F.scrollHeight-F.clientHeight;E/U*100>80&&m<100&&(p(100),L.success("Reading completed!"))},I=A=>{l(F=>({...F,videoId:A.id,videoTitle:A.title,channelTitle:A.channelTitle})),L.success(`Selected: ${A.title}`)};return n.jsxs(Cn,{children:[n.jsx("div",{className:"bg-gradient-to-b from-gray-50 to-white dark:from-gray-900 dark:to-gray-950 min-h-screen",children:n.jsx("div",{className:"container py-8",children:n.jsxs("div",{className:"w-full max-w-6xl mx-auto",children:[n.jsxs("div",{className:"text-center w-full mx-auto mb-8",children:[n.jsx("h2",{className:"text-3xl md:text-4xl lg:text-5xl font-bold tracking-tight mb-4",children:n.jsx("span",{className:"bg-clip-text text-transparent bg-gradient-to-r from-explainify-600 to-explainify-400",children:"Multi-Modal Learning"})}),n.jsx("p",{className:"text-muted-foreground text-base md:text-lg max-w-2xl mx-auto",children:"Enhance your understanding through multiple formats - videos, text, and interactive content tailored to your learning style."})]}),n.jsxs("div",{className:"grid lg:grid-cols-12 gap-8",children:[n.jsxs("div",{className:"lg:col-span-4 space-y-6",children:[n.jsxs(de,{className:"overflow-hidden shadow-md border-explainify-100 dark:border-gray-700",children:[n.jsx("div",{className:"p-4 bg-explainify-50 dark:bg-explainify-900/20 border-b border-explainify-100 dark:border-gray-700",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("h3",{className:"font-semibold flex items-center gap-2",children:[n.jsx(qt,{className:"h-5 w-5 text-explainify-600 dark:text-explainify-400"}),"Search For Topics"]}),n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx(R,{variant:"ghost",size:"sm",title:"View search history",onClick:()=>w(!y),className:V("h-8 w-8 p-0 rounded-full",y&&"bg-explainify-100 text-explainify-700 dark:bg-explainify-900/30 dark:text-explainify-300"),children:n.jsx(mt,{className:"h-4 w-4"})}),b.length>0&&n.jsx(R,{variant:"ghost",size:"sm",title:"Clear history",onClick:j,className:"h-8 w-8 p-0 rounded-full text-muted-foreground hover:text-destructive",children:n.jsx(Ts,{className:"h-4 w-4"})})]})]})}),n.jsxs("div",{className:"p-5 space-y-4",children:[y&&b.length>0&&n.jsxs("div",{className:"border rounded-lg overflow-hidden max-h-[200px] overflow-y-auto",children:[n.jsxs("div",{className:"p-2 bg-muted/30 border-b flex items-center gap-1.5",children:[n.jsx(mt,{className:"h-3.5 w-3.5 text-muted-foreground"}),n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Recent Searches"})]}),n.jsx("div",{className:"p-1",children:b.map(A=>n.jsxs("div",{className:"flex items-center p-2 hover:bg-muted rounded-md cursor-pointer transition-colors gap-2",onClick:()=>N(A),children:[n.jsx("div",{className:"h-7 w-7 rounded-full bg-explainify-50 dark:bg-explainify-900/30 flex items-center justify-center flex-shrink-0",children:n.jsx(qt,{className:"h-3.5 w-3.5 text-explainify-600 dark:text-explainify-400"})}),n.jsxs("div",{className:"overflow-hidden",children:[n.jsx("p",{className:"text-sm font-medium truncate",children:A.data.topic}),n.jsx("p",{className:"text-xs text-muted-foreground truncate",children:new Date(A.timestamp).toLocaleStr
660ing(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})})]})]},A.id))})]}),n.jsxs("form",{onSubmit:_,className:"space-y-3",children:[n.jsxs("div",{className:"relative",children:[n.jsx(qt,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),n.jsx(ze,{type:"text",placeholder:"Quantum physics, Roman history, calculus...",className:"pl-9 py-6 text-base",value:r,onChange:A=>s(A.target.value)})]}),n.jsx(R,{type:"submit",disabled:a,className:"w-full bg-explainify-600 hover:bg-explainify-700 text-white py-6",size:"lg",children:a?n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Rt,{className:"h-4 w-4 animate-spin"}),n.jsx("span",{children:"Searching..."})]}):n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(qt,{className:"h-4 w-4"}),n.jsx("span",{children:"Find Learning Resources"})]})})]})]})]}),n.jsxs(de,{className:"overflow-hidden shadow-md border-explainify-100 dark:border-gray-700",children:[n.jsx("div",{className:"p-4 bg-explainify-50 dark:bg-explainify-900/20 border-b border-explainify-100 dark:border-gray-700",children:n.jsxs("h3",{className:"font-semibold flex items-center gap-2",children:[n.jsx(Hx,{className:"h-5 w-5 text-explainify-600 dark:text-explainify-400"}),"Your Learning Profile"]})}),n.jsxs("div",{className:"p-5 space-y-6",children:[n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsxs("div",{className:"flex justify-between items-center",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:"w-8 h-8 rounded-full bg-explainify-100 dark:bg-explainify-900/30 flex items-center justify-center",children:n.jsx(Qs,{className:"h-4 w-4 text-explainify-600 dark:text-explainify-400"})}),n.jsx("span",{children:"Visual Learning"})]}),n.jsxs("span",{className:"font-medium",children:[d,"%"]})]}),n.jsx("div",{className:"h-2 bg-explainify-100 dark:bg-gray-700 rounded-full overflow-hidden",children:n.jsx("div",{className:"h-full bg-gradient-to-r from-explainify-500 to-explainify-400 rounded-full transition-all duration-500",style:{width:`${d}%`}})})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs("div",{className:"flex justify-between items-center",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:"w-8 h-8 rounded-full bg-explainify-100 dark:bg-explainify-900/30 flex items-center justify-center",children:n.jsx(Pe,{className:"h-4 w-4 text-explainify-600 dark:text-explainify-400"})}),n.jsx("span",{children:"Text-Based Learning"})]}),n.jsxs("span",{className:"font-medium",children:[m,"%"]})]}),n.jsx("div",{className:"h-2 bg-explainify-100 dark:bg-gray-700 rounded-full overflow-hidden",children:n.jsx("div",{className:"h-full bg-gradient-to-r from-explainify-500 to-explainify-400 rounded-full transition-all duration-500",style:{width:`${m}%`}})})]})]}),n.jsxs("div",{className:"border rounded-lg overflow-hidden bg-muted/20",children:[n.jsx("div",{className:"p-3 border-b",children:n.jsx("h4",{className:"text-sm font-medium",children:"Personalized Recommendations"})}),n.jsxs("div",{className:"p-4 text-sm space-y-3",children:[n.jsxs("div",{className:"flex items-start gap-2",children:[n.jsx(Xe,{className:"h-4 w-4 text-explainify-500 mt-0.5"}),n.jsxs("p",{className:"text-muted-foreground",children:["Learning through ",d>m?"visual content":"text-based materials"," seems more effective for you."]})]}),n.jsxs("div",{className:"flex items-start gap-2",children:[n.jsx(Xe,{className:"h-4 w-4 text-explainify-500 mt-0.5"}),n.jsx("p",{className:"text-muted-foreground",children:"Try using both learning formats for maximum retention and understanding."})]})]})]}),n.jsx(R,{className:"w-full",onClick:()=>{L.success("Learning analysis updated based on your activity!")},children:"Update My Profile"})]})]})]}),n.jsx("div",{className:"lg:col-span-8",children:n.jsx(de,{className:"overflow-hidden shadow-lg border-explainify-100 dark:border-gray-700",children:n.jsxs(_n,{defaultValue:"visual",className:"w-full",onValueChange:t,children:[n.jsx("div",{className:"border-b",children:n.jsxs(Ms,{className:"h-14 w-full justify-start bg-explainify-50 dark:bg-explainify-900/20",children:[n.jsxs(Ie,{value:"visual",className:"gap-2 data-[state=active]:bg-white dark:data-[state=active]:bg-gray-800",children:[n.jsx(Qs,{className:"h-4 w-4"})," Visual Learning"]}),n.jsxs(Ie,{value:"text",className:"gap-2 data-[state=active]:bg-white dark:data-[state=active]:bg-gray-800",children:[n.jsx(Pe,{className:"h-4 w-4"}
660)," Text-Based Learning"]})]})}),n.jsx(nt,{value:"visual",className:"p-0 focus:outline-none",children:n.jsx("div",{className:"relative aspect-video bg-explainify-900",children:c.videoId?n.jsxs(n.Fragment,{children:[n.jsx("iframe",{className:"w-full h-full",src:`https://www.youtube.com/embed/${c.videoId}`,title:c.videoTitle,frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0}),n.jsxs("div",{className:"p-4 bg-white dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700",children:[n.jsx("h3",{className:"font-semibold text-lg line-clamp-1",children:c.videoTitle}),c.channelTitle&&n.jsx("p",{className:"text-sm text-muted-foreground",children:c.channelTitle})]}),o&&n.jsxs("div",{className:"p-4",children:[n.jsx("h4",{className:"font-medium mb-3 text-sm text-muted-foreground",children:"Related Videos"}),n.jsx(kN,{searchResults:o,currentVideoId:c.videoId,onSelectVideo:I})]})]}):n.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-gradient-to-b from-explainify-900/80 to-explainify-900",children:n.jsxs("div",{className:"text-white text-center px-6 py-8 max-w-md mx-auto",children:[n.jsx("div",{className:"mb-4 w-20 h-20 bg-explainify-800/50 rounded-full flex items-center justify-center mx-auto",children:n.jsx(Qs,{className:"h-8 w-8 text-explainify-300"})}),n.jsx("h3",{className:"text-xl font-semibold mb-2",children:"Start Your Learning Journey"}),n.jsx("p",{className:"text-explainify-200 mb-6",children:"Search for any topic to find videos and text content tailored to your learning style."}),n.jsxs(R,{onClick:()=>{var A;(A=document.querySelector("input"))==null||A.focus()},className:"bg-white text-explainify-900 hover:bg-explainify-50",children:[n.jsx(qt,{className:"h-4 w-4 mr-2"})," Search for a topic"]})]})})})}),n.jsx(nt,{value:"text",className:"focus:outline-none",children:c.textContent?n.jsx("div",{className:"p-6",children:n.jsx("div",{className:"prose prose-explainify dark:prose-invert max-w-none h-[600px] overflow-y-auto pr-4 custom-scrollbar",onScroll:C,dangerouslySetInnerHTML:{__html:c.textContent.replace(/\n/g,"<br />")}})}):n.jsx("div",{className:"h-[500px] flex items-center justify-center bg-muted/10",children:n.jsxs("div",{className:"text-center max-w-md p-8",children:[n.jsx("div",{className:"mb-4 w-16 h-16 bg-explainify-100 dark:bg-explainify-900/30 rounded-full flex items-center justify-center mx-auto",children:n.jsx(Pe,{className:"h-6 w-6 text-explainify-600 dark:text-explainify-400"})}),n.jsx("h3",{className:"text-xl font-semibold mb-2",children:"Text Content"}),n.jsx("p",{className:"text-muted-foreground mb-6",children:"Search for a topic to view detailed text explanations and resources."}),n.jsxs(R,{onClick:()=>{var A;(A=document.querySelector("input"))==null||A.focus()},variant:"outline",children:[n.jsx(qt,{className:"h-4 w-4 mr-2"})," Find something to learn"]})]})})})]})})})]})]})})}),n.jsx("style",{jsx:!0,global:!0,children:`
661        .custom-scrollbar::-webkit-scrollbar {
662          width: 8px;
663        }
664        .custom-scrollbar::-webkit-scrollbar-track {
665          background: #f1f1f1;
666          border-radius: 10px;
667        }
668        .custom-scrollbar::-webkit-scrollbar-thumb {
669          background: #d1d5db;
670          border-radius: 10px;
671        }
672        .custom-scrollbar::-webkit-scrollbar-thumb:hover {
673          background: #a1a1aa;
674        }
675        .dark .custom-scrollbar::-webkit-scrollbar-track {
676          background: #1f2937;
677        }
678        .dark .custom-scrollbar::-webkit-scrollbar-thumb {
679          background: #4b5563;
680        }
681        .dark .custom-scrollbar::-webkit-scrollbar-thumb:hover {
682          background: #6b7280;
683        }
684      `})]})}function NN(){const{exploredFeatures:e,allFeaturesExplored:t,shouldShowExplorationPrompt:r,setShouldShowExplorationPrompt:s,hasCompletedExploration:a,getCurrentFeature:i,getNextFeature:o,goToNextFeature:u,goToPreviousFeature:c,currentFeatureIndex:l,getFeatureProgress:d,isFirstTimeUser:h}=Ls(),m=gt();Mt();const{completed:p,total:x}=d();if(!r||a||!h)return null;const g=[{id:"ai-tutor",name:"AI Tutor",description:"Engage with our AI tutor to learn any topic interactively",path:"/ai-tutor",completed:e["ai-tutor"]},{id:"question-solver",name:"Question Solver",description:"Get step-by-step solutions to academic questions",path:"/question-solver",completed:e["question-solver"]},{id:"content-tools",name:"Content Tools",description:"Try our PDF summarizer and YouTube learning tools",path:"/tools",completed:e["content-tools"]}],b=i();o();const v=l===rt.length-1;return n.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",children:n.jsxs(de,{className:"w-full max-w-md p-6 bg-white dark:bg-gray-800 shadow-lg",children:[n.jsxs("div",{className:"flex items-center justify-between mb-4",children:[n.jsxs("h3",{className:"text-xl font-bold",children:["Feature Tour (",p,"/",x,")"]}),n.jsx(R,{variant:"ghost",size:"icon",onClick:()=>s(!1),children:"✕"})]}),n.jsx("div",{className:"w-full bg-gray-200 dark:bg-gray-700 h-2 rounded-full mb-6",children:n.jsx("div",{className:"bg-explainify-600 dark:bg-explainify-400 h-2 rounded-full transition-all duration-300",style:{width:`${p/x*100}%`}})}),n.jsx("p",{className:"text-muted-foreground mb-4",children:"Explore these features in sequence to understand the full value of our platform:"}),n.jsx("div",{className:"space-y-3 mb-6",children:g.map((y,w)=>{const _=y.id===b,k=_||y.completed,N=!y.completed&&!_&&g.slice(0,w).every(j=>j.completed);return n.jsxs("div",{className:`p-3 border rounded-md flex items-start gap-3 cursor-pointer transition-colors relative ${y.completed?"bg-green-50 border-green-200 dark:bg-green-900/20 dark:border-green-800":_?"bg-explainify-50 border-explainify-200 dark:bg-explainify-900/20 dark:border-explainify-800":N?"bg-amber-50 border-amber-200 dark:bg-amber-900/20 dark:border-amber-800":"opacity-60 hover:bg-gray-50 dark:hover:bg-gray-700"}`,onClick:()=>{(k||N)&&(s(!1),m(y.path))},children:[_&&n.jsx("div",{className:"absolute -left-2 top-1/2 transform -translate-y-1/2 w-1 h-8 bg-explainify-600 dark:bg-explainify-400 rounded-full"}),n.jsx("div",{className:"flex-shrink-0 mt-0.5",children:y.completed?n.jsx($o,{className:"h-5 w-5 text-green-500"}):_?n.jsx(yc,{className:"h-5 w-5 text-explainify-500"}):N?n.jsx(yc,{className:"h-5 w-5 text-amber-500"}):n.jsx("div",{className:"h-5 w-5 rounded-full border-2 border-gray-300 dark:border-gray-600"})}),n.jsxs("div",{children:[n.jsxs("div",{className:"font-medium flex items-center",children:[y.name,y.completed&&n.jsx("span",{className:"text-green-600 dark:text-green-400 ml-2 text-sm",children:"Completed"}),_&&!y.completed&&n.jsx("span",{className:"text-explainify-600 dark:text-explainify-400 ml-2 text-sm",children:"Current"}),N&&!_&&n.jsx("span",{className:"text-amber-600 dark:text-amber-400 ml-2 text-sm",children:"Next"})]}),n.jsx("p",{className:"text-sm text-muted-foreground",children:y.description})]}),n.jsx(Xs,{className:"ml-auto h-5 w-5 text-muted-foreground"})]},y.id)})}),n.jsxs("div",{className:"flex justify-between items-center",children:[n.jsxs(R,{variant:"outline",className:"gap-1",onClick:c,disabled:l===0,children:[n.jsx(zo,{className:"h-4 w-4"}),"Previous"]}),t?n.jsxs(R,{className:"gap-1",onClick:()=>{s(!1),m("/pricing")},children:["View Pricing",n.jsx(mr,{className:"h-4 w-4"})]}):n.jsxs(R,{className:"gap-1",onClick:()=>{v?m("/pricing"):u(),s(!1)}
684,children:[v?"Finish Tour":"Next Feature",n.jsx(Xs,{className:"h-4 w-4"})]})]})]})})}function CN(){const{exploredFeatures:e,goToNextFeature:t,goToPreviousFeature:r,currentFeatureIndex:s,hasCompletedExploration:a,getFeatureProgress:i,isFirstTimeUser:o}=Ls();if(a||!o)return null;const{completed:u,total:c}=i(),l=s===0,d=s===rt.length-1,h=rt[s],m=e[h];return n.jsx("div",{className:"fixed bottom-0 left-0 right-0 bg-white dark:bg-gray-900 border-t dark:border-gray-800 shadow-md py-4 px-6 z-40",children:n.jsx("div",{className:"container max-w-7xl mx-auto",children:n.jsxs("div",{className:"flex justify-between items-center",children:[n.jsxs("div",{className:"flex items-center space-x-2",children:[n.jsxs("div",{className:"text-sm font-medium",children:["Feature tour: ",n.jsxs("span",{className:"text-explainify-600 dark:text-explainify-400",children:[u,"/",c]})]}),n.jsx("div",{className:"w-48 bg-gray-200 dark:bg-gray-700 h-2 rounded-full",children:n.jsx("div",{className:"bg-explainify-600 dark:bg-explainify-400 h-2 rounded-full transition-all duration-300",style:{width:`${u/c*100}%`}})})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs(R,{variant:"outline",size:"sm",className:"gap-1",onClick:r,disabled:l,children:[n.jsx(zo,{className:"h-4 w-4"}),"Previous"]}),n.jsxs(R,{size:"sm",className:"gap-1",onClick:t,disabled:!m&&!a,children:[d?"Finish Tour":"Next Feature",m&&n.jsx(Ht,{className:"h-4 w-4 ml-1"}),!d&&n.jsx(Xs,{className:"h-4 w-4"})]})]})]})})})}function SN(){const[e,t]=f.useState(""),[r,s]=f.useState(""),[a,i]=f.useState(""),[o,u]=f.useState(!1),[c,l]=f.useState("request"),d=gt(),h=Mt();f.useEffect(()=>{const x=h.hash;x&&x.includes("type=recovery")&&l("update")},[h]);const m=async x=>{if(x.preventDefault(),!e){L.error("Please enter your email address");return}try{u(!0);const{error:g}=await J.auth.resetPasswordForEmail(e,{redirectTo:`${window.location.origin}/auth/reset-password#type=recovery`});if(g)throw g;L.success("Password reset link sent to your email")}catch(g){L.error(`Error: ${g.message}`)}finally{u(!1)}},p=async x=>{if(x.preventDefault(),r!==a){L.error("Passwords do not match");return}if(r.length<6){L.error("Password must be at least 6 characters");return}try{u(!0);const{error:g}=await J.auth.updateUser({password:r});if(g)throw g;L.success("Password updated successfully"),setTimeout(()=>{d("/auth?mode=login")},1500)}catch(g){L.error(`Error: ${g.message}`)}finally{u(!1)}};return n.jsxs("div",{className:"min-h-screen flex flex-col items-center justify-center p-4 bg-gray-50 dark:bg-gray-900",children:[n.jsxs(ne,{to:"/",className:"flex items-center gap-2 mb-8",children:[n.jsx(Be,{className:"h-8 w-8 text-explainify-600"}),n.jsx("span",{className:"text-2xl font-semibold",children:"Explainify"})]}),n.jsxs(de,{className:"w-full max-w-md",children:[n.jsxs(Ce,{children:[n.jsx(Se,{children:c==="request"?"Reset Password":"Create New Password"}),n.jsx(at,{children:c==="request"?"Enter your email and we'll send you a link to reset your password":"Enter your new password below"})]}),c==="request"?n.jsxs("form",{onSubmit:m,children:[n.jsx(ve,{className:"space-y-4",children:n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{htmlFor:"email",className:"text-sm font-medium",children:"Email"}),n.jsx(ze,{id:"email",type:"email",placeholder:"[email protected]",value:e,onChange:x=>t(x.target.value),required:!0})]})}),n.jsxs(At,{className:"flex flex-col space-y-4",children:[n.jsx(R,{type:"submit",className:"w-full",disabled:o,children:o?"Sending...":"Send Reset Link"}),n.jsx("div",{className:"text-center text-sm",children:n.jsxs(ne,{to:"/auth?mode=login",className:"text-explainify-600 hover:underline font-medium flex items-center justify-center gap-1",children:[n.jsx(Oo,{className:"h-4 w-4"}),"Back to Login"]})})]})]}):n.jsxs("form",{onSubmit:p,children:[n.jsxs(ve,{className:"space-y-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{htmlFor:"password",className:"text-sm font-medium",children:"New Password"}),n.jsx(ze,{id:"password",type:"password",placeholder:"••••••••",value:r,onChange:x=>s(x.target.value),required:!0,minLength:6})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{htmlFor:"confirmPassword",className:"text-sm font-medium",children:"Confirm New Password"}),n.jsx(ze,{id:"confirmPassword",type:"password",placeholder:"••••••••",value:a,onChange:x=>i(x.target.value),required:!0,minLength:6})]})]}),n.jsx(At,{className:"flex flex-col space-y-4",children:n.jsx(R,{type:"submit",className:"w-full",disabled:o,children:o?"Updating...":"Update Password"})})]})]})]})}const EN=new vy,TN=()=>n.jsx(_y,{client:EN,children:n.jsx(o4,{defaultTheme:"system",children:n.jsxs(mf,{children:[n.jsx(Vg,{}),n.jsx(kb,{}),n.jsx(Op,{children:n.jsx(R2,{children:n.jsxs(L_,{children:[n.jsx(NN,{}),n.jsx(CN,{}),n.jsxs(Lp,{children:[n.jsx(Le,{path:"/",element:n.jsx(c_,{})}),n.jsx(Le,{path:"/dashboard",element:n.jsx(Hs,{children:n.jsx(i4,{})})}),n.jsx(Le,{path:"/ai-tutor",element:n.jsx(Hs,{requiresSubscription:!0,children:n.jsx(bN,{})})}),n.jsx(Le,{path:"/question-solver",element:n.jsx(Hs,{requiresSubscription:!0,children:n.jsx(wN,{})})}),n.jsx(Le,{path:"/multi-modal",element:n.jsx(Hs,{requiresSubscription:!0,minTier:"pro",children:n.jsx(jN,{})})}),n.jsx(Le,{path:"/tools",element:n.jsx($_,{})}),n.jsx(Le,{path:"/auth",element:n.jsx(H_,{})}),n.jsx(Le,{path:"/auth/callback",element:n.jsx(V_,{})}),n.jsx(Le,{path:"/auth/troubleshoot",element:n.jsx(G_,{})}),n.jsx(Le,{path:"/auth/error",element:n.jsx(K_,{})}),n.jsx(Le,{path:"/auth/reset-password",element:n.jsx(SN,{})}),n.jsx(Le,{path:"/pricing",element:n.jsx(Bk,{})}),n.jsx(Le,{path:"/profile",element:n.jsx(Hs,{children:n.jsx(Zk,{})})}),n.jsx(Le,{path:"/payment/success",element:n.jsx(n4,{})}),n.jsx(Le,{path:"*",element:n.jsx(U_,{})})]})]})})}),n.jsx(g4,{})]})})}),AN=`-- Create feature_usage table to track usage of features for each user
685CREATE TABLE IF NOT EXISTS feature_usage (
686  id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
687  user_id UUID NOT NULL REFERENCES auth.users(id) ON DELETE CASCADE,
688  pdf_summarizer_count INTEGER NOT NULL DEFAULT 0,
689  youtube_transcriber_count INTEGER NOT NULL DEFAULT 0,
690  question_solver_count INTEGER NOT NULL DEFAULT 0,
691  pdf_limit INTEGER NOT NULL DEFAULT 5,
692  youtube_limit INTEGER NOT NULL DEFAULT 10,
693  question_solver_level TEXT NOT NULL DEFAULT 'basic',
694  last_reset_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),
695  created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),
696  updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),
697  UNIQUE(user_id)
698);
699
700-- Add RLS policies
701ALTER TABLE feature_usage ENABLE ROW LEVEL SECURITY;
702
703-- Allow users to read only their own usage
704CREATE POLICY "Users can view their own usage"
705  ON feature_usage
706  FOR SELECT
707  USING (auth.uid() = user_id);
708
709-- Allow users to update only their own usage
710CREATE POLICY "Users can update their own usage"
711  ON feature_usage
712  FOR UPDATE
713  USING (auth.uid() = user_id);
714
715-- Allow service role to read/write all records
716CREATE POLICY "Service role can do anything"
717  ON feature_usage
718  USING (auth.uid() = service_role OR auth.jwt() ? 'service_role');
719
720-- Add triggers for updated_at
721CREATE OR REPLACE FUNCTION update_feature_usage_updated_at()
722RETURNS TRIGGER AS $$
723BEGIN
724  NEW.updated_at = NOW();
725  RETURN NEW;
726END;
727$$ LANGUAGE plpgsql;
728
729CREATE TRIGGER update_feature_usage_updated_at
730BEFORE UPDATE ON feature_usage
731FOR EACH ROW
732EXECUTE FUNCTION update_feature_usage_updated_at(); `;async function PN(){try{console.log("Running database migrations...");const{error:e}=await J.from("feature_usage").select("id").limit(1);e&&e.code==="PGRST116"&&(console.log("Running feature_usage table migration..."),await J.rpc("exec_sql",{query:AN})),console.log("Database migrations completed successfully.")}catch(e){console.error("Error running migrations:",e)}}async function DN(){await PN()}const RN={initialize:DN};RN.initialize();Wi.createRoot(document.getElementById("root")).render(n.jsx(TN,{}));

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.