diff --git a/reader/dist/assets/index-jPnQ2s5e.js b/reader/dist/assets/index-CnZdeEjV.js similarity index 97% rename from reader/dist/assets/index-jPnQ2s5e.js rename to reader/dist/assets/index-CnZdeEjV.js index 1bd8b90..44b75b1 100644 --- a/reader/dist/assets/index-jPnQ2s5e.js +++ b/reader/dist/assets/index-CnZdeEjV.js @@ -57,11 +57,11 @@ Error generating stack: `+n.message+` * @license MIT */var op="popstate";function Ty(a={}){function u(r,o){let{pathname:f,search:p,hash:m}=r.location;return Oc("",{pathname:f,search:p,hash:m},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function s(r,o){return typeof o=="string"?o:iu(o)}return wy(u,s,null,a)}function Ne(a,u){if(a===!1||a===null||typeof a>"u")throw new Error(u)}function Ut(a,u){if(!a){typeof console<"u"&&console.warn(u);try{throw new Error(u)}catch{}}}function Ry(){return Math.random().toString(36).substring(2,10)}function fp(a,u){return{usr:a.state,key:a.key,idx:u}}function Oc(a,u,s=null,r){return{pathname:typeof a=="string"?a:a.pathname,search:"",hash:"",...typeof u=="string"?Jl(u):u,state:s,key:u&&u.key||r||Ry()}}function iu({pathname:a="/",search:u="",hash:s=""}){return u&&u!=="?"&&(a+=u.charAt(0)==="?"?u:"?"+u),s&&s!=="#"&&(a+=s.charAt(0)==="#"?s:"#"+s),a}function Jl(a){let u={};if(a){let s=a.indexOf("#");s>=0&&(u.hash=a.substring(s),a=a.substring(0,s));let r=a.indexOf("?");r>=0&&(u.search=a.substring(r),a=a.substring(0,r)),a&&(u.pathname=a)}return u}function wy(a,u,s,r={}){let{window:o=document.defaultView,v5Compat:f=!1}=r,p=o.history,m="POP",b=null,h=g();h==null&&(h=0,p.replaceState({...p.state,idx:h},""));function g(){return(p.state||{idx:null}).idx}function R(){m="POP";let D=g(),q=D==null?null:D-h;h=D,b&&b({action:m,location:k.location,delta:q})}function E(D,q){m="PUSH";let Z=Oc(k.location,D,q);h=g()+1;let G=fp(Z,h),te=k.createHref(Z);try{p.pushState(G,"",te)}catch($){if($ instanceof DOMException&&$.name==="DataCloneError")throw $;o.location.assign(te)}f&&b&&b({action:m,location:k.location,delta:1})}function U(D,q){m="REPLACE";let Z=Oc(k.location,D,q);h=g();let G=fp(Z,h),te=k.createHref(Z);p.replaceState(G,"",te),f&&b&&b({action:m,location:k.location,delta:0})}function T(D){let q=o.location.origin!=="null"?o.location.origin:o.location.href,Z=typeof D=="string"?D:iu(D);return Z=Z.replace(/ $/,"%20"),Ne(q,`No window.location.(origin|href) available to create URL for href: ${Z}`),new URL(Z,q)}let k={get action(){return m},get location(){return a(o,p)},listen(D){if(b)throw new Error("A history only accepts one active listener");return o.addEventListener(op,R),b=D,()=>{o.removeEventListener(op,R),b=null}},createHref(D){return u(o,D)},createURL:T,encodeLocation(D){let q=T(D);return{pathname:q.pathname,search:q.search,hash:q.hash}},push:E,replace:U,go(D){return p.go(D)}};return k}function Lp(a,u,s="/"){return Ay(a,u,s,!1)}function Ay(a,u,s,r){let o=typeof u=="string"?Jl(u):u,f=fn(o.pathname||"/",s);if(f==null)return null;let p=Hp(a);Oy(p);let m=null;for(let b=0;m==null&&b{let b={relativePath:m===void 0?f.path||"":m,caseSensitive:f.caseSensitive===!0,childrenIndex:p,route:f};b.relativePath.startsWith("/")&&(Ne(b.relativePath.startsWith(r),`Absolute route path "${b.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),b.relativePath=b.relativePath.slice(r.length));let h=on([r,b.relativePath]),g=s.concat(b);f.children&&f.children.length>0&&(Ne(f.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${h}".`),Hp(f.children,u,g,h)),!(f.path==null&&!f.index)&&u.push({path:h,score:jy(h,f.index),routesMeta:g})};return a.forEach((f,p)=>{var m;if(f.path===""||!((m=f.path)!=null&&m.includes("?")))o(f,p);else for(let b of qp(f.path))o(f,p,b)}),u}function qp(a){let u=a.split("/");if(u.length===0)return[];let[s,...r]=u,o=s.endsWith("?"),f=s.replace(/\?$/,"");if(r.length===0)return o?[f,""]:[f];let p=qp(r.join("/")),m=[];return m.push(...p.map(b=>b===""?f:[f,b].join("/"))),o&&m.push(...p),m.map(b=>a.startsWith("/")&&b===""?"/":b)}function Oy(a){a.sort((u,s)=>u.score!==s.score?s.score-u.score:Uy(u.routesMeta.map(r=>r.childrenIndex),s.routesMeta.map(r=>r.childrenIndex)))}var zy=/^:[\w-]+$/,_y=3,Ny=2,My=1,Cy=10,Dy=-2,dp=a=>a==="*";function jy(a,u){let s=a.split("/"),r=s.length;return s.some(dp)&&(r+=Dy),u&&(r+=Ny),s.filter(o=>!dp(o)).reduce((o,f)=>o+(zy.test(f)?_y:f===""?My:Cy),r)}function Uy(a,u){return a.length===u.length&&a.slice(0,-1).every((r,o)=>r===u[o])?a[a.length-1]-u[u.length-1]:0}function ky(a,u,s=!1){let{routesMeta:r}=a,o={},f="/",p=[];for(let m=0;m{if(g==="*"){let T=m[E]||"";p=f.slice(0,f.length-T.length).replace(/(.)\/+$/,"$1")}const U=m[E];return R&&!U?h[g]=void 0:h[g]=(U||"").replace(/%2F/g,"/"),h},{}),pathname:f,pathnameBase:p,pattern:a}}function By(a,u=!1,s=!0){Ut(a==="*"||!a.endsWith("*")||a.endsWith("/*"),`Route path "${a}" will be treated as if it were "${a.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${a.replace(/\*$/,"/*")}".`);let r=[],o="^"+a.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(p,m,b)=>(r.push({paramName:m,isOptional:b!=null}),b?"/?([^\\/]+)?":"/([^\\/]+)"));return a.endsWith("*")?(r.push({paramName:"*"}),o+=a==="*"||a==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):s?o+="\\/*$":a!==""&&a!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,u?void 0:"i"),r]}function Ly(a){try{return a.split("/").map(u=>decodeURIComponent(u).replace(/\//g,"%2F")).join("/")}catch(u){return Ut(!1,`The URL path "${a}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${u}).`),a}}function fn(a,u){if(u==="/")return a;if(!a.toLowerCase().startsWith(u.toLowerCase()))return null;let s=u.endsWith("/")?u.length-1:u.length,r=a.charAt(s);return r&&r!=="/"?null:a.slice(s)||"/"}function Hy(a,u="/"){let{pathname:s,search:r="",hash:o=""}=typeof a=="string"?Jl(a):a;return{pathname:s?s.startsWith("/")?s:qy(s,u):u,search:Zy(r),hash:Xy(o)}}function qy(a,u){let s=u.replace(/\/+$/,"").split("/");return a.split("/").forEach(o=>{o===".."?s.length>1&&s.pop():o!=="."&&s.push(o)}),s.length>1?s.join("/"):"/"}function xc(a,u,s,r){return`Cannot include a '${a}' character in a manually specified \`to.${u}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${s}\` field. Alternatively you may provide the full path as a string in and the router will parse it for you.`}function Yy(a){return a.filter((u,s)=>s===0||u.route.path&&u.route.path.length>0)}function Hc(a){let u=Yy(a);return u.map((s,r)=>r===u.length-1?s.pathname:s.pathnameBase)}function qc(a,u,s,r=!1){let o;typeof a=="string"?o=Jl(a):(o={...a},Ne(!o.pathname||!o.pathname.includes("?"),xc("?","pathname","search",o)),Ne(!o.pathname||!o.pathname.includes("#"),xc("#","pathname","hash",o)),Ne(!o.search||!o.search.includes("#"),xc("#","search","hash",o)));let f=a===""||o.pathname==="",p=f?"/":o.pathname,m;if(p==null)m=s;else{let R=u.length-1;if(!r&&p.startsWith("..")){let E=p.split("/");for(;E[0]==="..";)E.shift(),R-=1;o.pathname=E.join("/")}m=R>=0?u[R]:"/"}let b=Hy(o,m),h=p&&p!=="/"&&p.endsWith("/"),g=(f||p===".")&&s.endsWith("/");return!b.pathname.endsWith("/")&&(h||g)&&(b.pathname+="/"),b}var on=a=>a.join("/").replace(/\/\/+/g,"/"),Gy=a=>a.replace(/\/+$/,"").replace(/^\/*/,"/"),Zy=a=>!a||a==="?"?"":a.startsWith("?")?a:"?"+a,Xy=a=>!a||a==="#"?"":a.startsWith("#")?a:"#"+a;function Vy(a){return a!=null&&typeof a.status=="number"&&typeof a.statusText=="string"&&typeof a.internal=="boolean"&&"data"in a}var Yp=["POST","PUT","PATCH","DELETE"];new Set(Yp);var Qy=["GET",...Yp];new Set(Qy);var Fl=M.createContext(null);Fl.displayName="DataRouter";var Gi=M.createContext(null);Gi.displayName="DataRouterState";var Gp=M.createContext({isTransitioning:!1});Gp.displayName="ViewTransition";var $y=M.createContext(new Map);$y.displayName="Fetchers";var Ky=M.createContext(null);Ky.displayName="Await";var kt=M.createContext(null);kt.displayName="Navigation";var su=M.createContext(null);su.displayName="Location";var Mt=M.createContext({outlet:null,matches:[],isDataRoute:!1});Mt.displayName="Route";var Yc=M.createContext(null);Yc.displayName="RouteError";function Jy(a,{relative:u}={}){Ne(Wl(),"useHref() may be used only in the context of a component.");let{basename:s,navigator:r}=M.useContext(kt),{hash:o,pathname:f,search:p}=cu(a,{relative:u}),m=f;return s!=="/"&&(m=f==="/"?s:on([s,f])),r.createHref({pathname:m,search:p,hash:o})}function Wl(){return M.useContext(su)!=null}function Bn(){return Ne(Wl(),"useLocation() may be used only in the context of a component."),M.useContext(su).location}var Zp="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Xp(a){M.useContext(kt).static||M.useLayoutEffect(a)}function Vp(){let{isDataRoute:a}=M.useContext(Mt);return a?fb():Fy()}function Fy(){Ne(Wl(),"useNavigate() may be used only in the context of a component.");let a=M.useContext(Fl),{basename:u,navigator:s}=M.useContext(kt),{matches:r}=M.useContext(Mt),{pathname:o}=Bn(),f=JSON.stringify(Hc(r)),p=M.useRef(!1);return Xp(()=>{p.current=!0}),M.useCallback((b,h={})=>{if(Ut(p.current,Zp),!p.current)return;if(typeof b=="number"){s.go(b);return}let g=qc(b,JSON.parse(f),o,h.relative==="path");a==null&&u!=="/"&&(g.pathname=g.pathname==="/"?u:on([u,g.pathname])),(h.replace?s.replace:s.push)(g,h.state,h)},[u,s,f,o,a])}var Wy=M.createContext(null);function Py(a){let u=M.useContext(Mt).outlet;return u&&M.createElement(Wy.Provider,{value:a},u)}function Iy(){let{matches:a}=M.useContext(Mt),u=a[a.length-1];return u?u.params:{}}function cu(a,{relative:u}={}){let{matches:s}=M.useContext(Mt),{pathname:r}=Bn(),o=JSON.stringify(Hc(s));return M.useMemo(()=>qc(a,JSON.parse(o),r,u==="path"),[a,o,r,u])}function eb(a,u){return Qp(a,u)}function Qp(a,u,s,r){var Z;Ne(Wl(),"useRoutes() may be used only in the context of a component.");let{navigator:o,static:f}=M.useContext(kt),{matches:p}=M.useContext(Mt),m=p[p.length-1],b=m?m.params:{},h=m?m.pathname:"/",g=m?m.pathnameBase:"/",R=m&&m.route;{let G=R&&R.path||"";$p(h,!R||G.endsWith("*")||G.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${h}" (under ) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. -Please change the parent to .`)}let E=Bn(),U;if(u){let G=typeof u=="string"?Jl(u):u;Ne(g==="/"||((Z=G.pathname)==null?void 0:Z.startsWith(g)),`When overriding the location using \`\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${g}" but pathname "${G.pathname}" was given in the \`location\` prop.`),U=G}else U=E;let T=U.pathname||"/",k=T;if(g!=="/"){let G=g.replace(/^\//,"").split("/");k="/"+T.replace(/^\//,"").split("/").slice(G.length).join("/")}let D=!f&&s&&s.matches&&s.matches.length>0?s.matches:Lp(a,{pathname:k});Ut(R||D!=null,`No routes matched location "${U.pathname}${U.search}${U.hash}" `),Ut(D==null||D[D.length-1].route.element!==void 0||D[D.length-1].route.Component!==void 0||D[D.length-1].route.lazy!==void 0,`Matched leaf route at location "${U.pathname}${U.search}${U.hash}" does not have an element or Component. This means it will render an with a null value by default resulting in an "empty" page.`);let q=ub(D&&D.map(G=>Object.assign({},G,{params:Object.assign({},b,G.params),pathname:on([g,o.encodeLocation?o.encodeLocation(G.pathname).pathname:G.pathname]),pathnameBase:G.pathnameBase==="/"?g:on([g,o.encodeLocation?o.encodeLocation(G.pathnameBase).pathname:G.pathnameBase])})),p,s,r);return u&&q?M.createElement(su.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...U},navigationType:"POP"}},q):q}function tb(){let a=ob(),u=Vy(a)?`${a.status} ${a.statusText}`:a instanceof Error?a.message:JSON.stringify(a),s=a instanceof Error?a.stack:null,r="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:r},f={padding:"2px 4px",backgroundColor:r},p=null;return console.error("Error handled by React Router default ErrorBoundary:",a),p=M.createElement(M.Fragment,null,M.createElement("p",null,"💿 Hey developer 👋"),M.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",M.createElement("code",{style:f},"ErrorBoundary")," or"," ",M.createElement("code",{style:f},"errorElement")," prop on your route.")),M.createElement(M.Fragment,null,M.createElement("h2",null,"Unexpected Application Error!"),M.createElement("h3",{style:{fontStyle:"italic"}},u),s?M.createElement("pre",{style:o},s):null,p)}var nb=M.createElement(tb,null),lb=class extends M.Component{constructor(a){super(a),this.state={location:a.location,revalidation:a.revalidation,error:a.error}}static getDerivedStateFromError(a){return{error:a}}static getDerivedStateFromProps(a,u){return u.location!==a.location||u.revalidation!=="idle"&&a.revalidation==="idle"?{error:a.error,location:a.location,revalidation:a.revalidation}:{error:a.error!==void 0?a.error:u.error,location:u.location,revalidation:a.revalidation||u.revalidation}}componentDidCatch(a,u){console.error("React Router caught the following error during render",a,u)}render(){return this.state.error!==void 0?M.createElement(Mt.Provider,{value:this.props.routeContext},M.createElement(Yc.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function ab({routeContext:a,match:u,children:s}){let r=M.useContext(Fl);return r&&r.static&&r.staticContext&&(u.route.errorElement||u.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=u.route.id),M.createElement(Mt.Provider,{value:a},s)}function ub(a,u=[],s=null,r=null){if(a==null){if(!s)return null;if(s.errors)a=s.matches;else if(u.length===0&&!s.initialized&&s.matches.length>0)a=s.matches;else return null}let o=a,f=s==null?void 0:s.errors;if(f!=null){let b=o.findIndex(h=>h.route.id&&(f==null?void 0:f[h.route.id])!==void 0);Ne(b>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(f).join(",")}`),o=o.slice(0,Math.min(o.length,b+1))}let p=!1,m=-1;if(s)for(let b=0;b=0?o=o.slice(0,m+1):o=[o[0]];break}}}return o.reduceRight((b,h,g)=>{let R,E=!1,U=null,T=null;s&&(R=f&&h.route.id?f[h.route.id]:void 0,U=h.route.errorElement||nb,p&&(m<0&&g===0?($p("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),E=!0,T=null):m===g&&(E=!0,T=h.route.hydrateFallbackElement||null)));let k=u.concat(o.slice(0,g+1)),D=()=>{let q;return R?q=U:E?q=T:h.route.Component?q=M.createElement(h.route.Component,null):h.route.element?q=h.route.element:q=b,M.createElement(ab,{match:h,routeContext:{outlet:b,matches:k,isDataRoute:s!=null},children:q})};return s&&(h.route.ErrorBoundary||h.route.errorElement||g===0)?M.createElement(lb,{location:s.location,revalidation:s.revalidation,component:U,error:R,children:D(),routeContext:{outlet:null,matches:k,isDataRoute:!0}}):D()},null)}function Gc(a){return`${a} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ib(a){let u=M.useContext(Fl);return Ne(u,Gc(a)),u}function rb(a){let u=M.useContext(Gi);return Ne(u,Gc(a)),u}function sb(a){let u=M.useContext(Mt);return Ne(u,Gc(a)),u}function Zc(a){let u=sb(a),s=u.matches[u.matches.length-1];return Ne(s.route.id,`${a} can only be used on routes that contain a unique "id"`),s.route.id}function cb(){return Zc("useRouteId")}function ob(){var r;let a=M.useContext(Yc),u=rb("useRouteError"),s=Zc("useRouteError");return a!==void 0?a:(r=u.errors)==null?void 0:r[s]}function fb(){let{router:a}=ib("useNavigate"),u=Zc("useNavigate"),s=M.useRef(!1);return Xp(()=>{s.current=!0}),M.useCallback(async(o,f={})=>{Ut(s.current,Zp),s.current&&(typeof o=="number"?a.navigate(o):await a.navigate(o,{fromRouteId:u,...f}))},[a,u])}var hp={};function $p(a,u,s){!u&&!hp[a]&&(hp[a]=!0,Ut(!1,s))}M.memo(db);function db({routes:a,future:u,state:s}){return Qp(a,void 0,s,u)}function hb({to:a,replace:u,state:s,relative:r}){Ne(Wl()," may be used only in the context of a component.");let{static:o}=M.useContext(kt);Ut(!o," must not be used on the initial render in a . This is a no-op, but you should modify your code so the is only ever rendered in response to some user interaction or state change.");let{matches:f}=M.useContext(Mt),{pathname:p}=Bn(),m=Vp(),b=qc(a,Hc(f),p,r==="path"),h=JSON.stringify(b);return M.useEffect(()=>{m(JSON.parse(h),{replace:u,state:s,relative:r})},[m,h,r,u,s]),null}function pb(a){return Py(a.context)}function au(a){Ne(!1,"A is only ever to be used as the child of element, never rendered directly. Please wrap your in a .")}function mb({basename:a="/",children:u=null,location:s,navigationType:r="POP",navigator:o,static:f=!1}){Ne(!Wl(),"You cannot render a inside another . You should never have more than one in your app.");let p=a.replace(/^\/*/,"/"),m=M.useMemo(()=>({basename:p,navigator:o,static:f,future:{}}),[p,o,f]);typeof s=="string"&&(s=Jl(s));let{pathname:b="/",search:h="",hash:g="",state:R=null,key:E="default"}=s,U=M.useMemo(()=>{let T=fn(b,p);return T==null?null:{location:{pathname:T,search:h,hash:g,state:R,key:E},navigationType:r}},[p,b,h,g,R,E,r]);return Ut(U!=null,` is not able to match the URL "${b}${h}${g}" because it does not start with the basename, so the won't render anything.`),U==null?null:M.createElement(kt.Provider,{value:m},M.createElement(su.Provider,{children:u,value:U}))}function gb({children:a,location:u}){return eb(zc(a),u)}function zc(a,u=[]){let s=[];return M.Children.forEach(a,(r,o)=>{if(!M.isValidElement(r))return;let f=[...u,o];if(r.type===M.Fragment){s.push.apply(s,zc(r.props.children,f));return}Ne(r.type===au,`[${typeof r.type=="string"?r.type:r.type.name}] is not a component. All component children of must be a or `),Ne(!r.props.index||!r.props.children,"An index route cannot have child routes.");let p={id:r.props.id||f.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(p.children=zc(r.props.children,f)),s.push(p)}),s}var Ni="get",Mi="application/x-www-form-urlencoded";function Zi(a){return a!=null&&typeof a.tagName=="string"}function yb(a){return Zi(a)&&a.tagName.toLowerCase()==="button"}function bb(a){return Zi(a)&&a.tagName.toLowerCase()==="form"}function vb(a){return Zi(a)&&a.tagName.toLowerCase()==="input"}function xb(a){return!!(a.metaKey||a.altKey||a.ctrlKey||a.shiftKey)}function Sb(a,u){return a.button===0&&(!u||u==="_self")&&!xb(a)}var zi=null;function Eb(){if(zi===null)try{new FormData(document.createElement("form"),0),zi=!1}catch{zi=!0}return zi}var Tb=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Sc(a){return a!=null&&!Tb.has(a)?(Ut(!1,`"${a}" is not a valid \`encType\` for \`
\`/\`\` and will default to "${Mi}"`),null):a}function Rb(a,u){let s,r,o,f,p;if(bb(a)){let m=a.getAttribute("action");r=m?fn(m,u):null,s=a.getAttribute("method")||Ni,o=Sc(a.getAttribute("enctype"))||Mi,f=new FormData(a)}else if(yb(a)||vb(a)&&(a.type==="submit"||a.type==="image")){let m=a.form;if(m==null)throw new Error('Cannot submit a