corequery 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -4,15 +4,17 @@
4
4
 
5
5
  To prove it works:
6
6
 
7
- - Setup express server
8
- - Setup server to serve frontend
9
- - Setup demo app
7
+ - Hot reloading server code, and `COREQUERY_HOT_RELOAD` env var set by script
8
+ - Prove everything works when installed in an external repo
10
9
  - Script to create demo app from external git repo
10
+ - Some mechanism to inject stuff into the built Vite project (i.e. the app name and favicons into PWA manifest, etc.)
11
11
 
12
12
  For the real deal:
13
13
 
14
14
  - Setup linting with ESLint and TSC
15
+ - Setup Prisma, and check it can easily swap between PostgreSQL and SQLite.
15
16
  - Setup Prettier
16
17
  - Setup unit tests
17
18
  - Setup renovate
18
19
  - Setup CI
20
+ - Setup PWA properly
package/package.json CHANGED
@@ -1,26 +1,34 @@
1
1
  {
2
2
  "name": "corequery",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "type": "module",
5
5
  "files": [
6
- "server/dist"
6
+ "server/dist",
7
+ "web/dist"
7
8
  ],
8
- "exports": "./server/dist/index.js",
9
- "types": "./server/dist/index.d.ts",
9
+ "exports": "./server/dist/server/index.js",
10
+ "types": "./server/dist/server/index.d.ts",
10
11
  "scripts": {
11
- "dev": "vite web",
12
12
  "build": "tsc -p server/tsconfig.json && vite build web",
13
- "start": "tsx server/main.ts"
13
+ "setup": "tsx scripts/demo-app.ts setup",
14
+ "dev": "tsx scripts/demo-app.ts dev",
15
+ "start": "tsx scripts/demo-app.ts start"
16
+ },
17
+ "dependencies": {
18
+ "express": "5.2.1",
19
+ "zod": "4.1.13"
14
20
  },
15
- "dependencies": {},
16
21
  "devDependencies": {
17
22
  "@preact/preset-vite": "2.10.2",
23
+ "@types/express": "5.0.6",
18
24
  "@types/node": "24.10.1",
25
+ "chalk": "5.6.2",
19
26
  "preact": "10.27.2",
20
27
  "preact-iso": "2.11.0",
21
28
  "tsx": "4.20.6",
22
29
  "typescript": "5.9.3",
23
- "vite": "7.2.4"
30
+ "vite": "7.2.4",
31
+ "vite-plugin-pwa": "1.2.0"
24
32
  },
25
33
  "author": "dan-schel",
26
34
  "description": "A platform for building web apps serving transit information.",
@@ -0,0 +1,11 @@
1
+ type CorequeryConfig = {
2
+ port: number;
3
+ };
4
+ type CorequeryConfigBuilder = (corequery: Corequery) => CorequeryConfig;
5
+ export declare class Corequery {
6
+ private readonly _config;
7
+ private readonly _webServer;
8
+ constructor(configBuilder: CorequeryConfigBuilder);
9
+ start(): Promise<void>;
10
+ }
11
+ export {};
@@ -0,0 +1,18 @@
1
+ import { runSharedCode } from "../shared/example.js";
2
+ import { serverFolderPath } from "./dirname.js";
3
+ import { env } from "./env.js";
4
+ import { WebServer } from "./web-server.js";
5
+ export class Corequery {
6
+ _config;
7
+ _webServer;
8
+ constructor(configBuilder) {
9
+ this._config = configBuilder(this);
10
+ console.log("Corequery config:", this._config, env.COREQUERY_HOT_RELOAD ? "vite-middleware" : "dist-folder");
11
+ this._webServer = new WebServer(this, this._config.port, env.COREQUERY_HOT_RELOAD ? "vite-middleware" : "dist-folder", serverFolderPath);
12
+ }
13
+ async start() {
14
+ runSharedCode();
15
+ await this._webServer.start();
16
+ }
17
+ }
18
+ //# sourceMappingURL=corequery.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"corequery.js","sourceRoot":"","sources":["../../corequery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAQ5C,MAAM,OAAO,SAAS;IACH,OAAO,CAAkB;IACzB,UAAU,CAAY;IAEvC,YAAY,aAAqC;QAC/C,IAAI,CAAC,OAAO,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;QAEnC,OAAO,CAAC,GAAG,CACT,mBAAmB,EACnB,IAAI,CAAC,OAAO,EACZ,GAAG,CAAC,oBAAoB,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,aAAa,CAC7D,CAAC;QAEF,IAAI,CAAC,UAAU,GAAG,IAAI,SAAS,CAC7B,IAAI,EACJ,IAAI,CAAC,OAAO,CAAC,IAAI,EACjB,GAAG,CAAC,oBAAoB,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,aAAa,EAC5D,gBAAgB,CACjB,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,KAAK;QACT,aAAa,EAAE,CAAC;QAEhB,MAAM,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;IAChC,CAAC;CACF"}
@@ -0,0 +1 @@
1
+ export declare const serverFolderPath: string;
@@ -0,0 +1,4 @@
1
+ // This file MUST stay at the root level of the server/ folder, otherwise this
2
+ // constant will be incorrect.
3
+ export const serverFolderPath = import.meta.dirname;
4
+ //# sourceMappingURL=dirname.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dirname.js","sourceRoot":"","sources":["../../dirname.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,8BAA8B;AAC9B,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare const env: {
2
+ COREQUERY_HOT_RELOAD: boolean;
3
+ };
@@ -0,0 +1,19 @@
1
+ import z from "zod";
2
+ // Declares which environment variables CoreQuery uses.
3
+ //
4
+ // WARNING: There should be almost NO environment variables for CoreQuery, most
5
+ // (e.g. PORT, DATABASE_URL, etc.) should be implemented by the consumers of
6
+ // this package, and passed in via config (you wouldn't expect a random NPM
7
+ // package you install to read and act on env vars, right?).
8
+ //
9
+ // COREQUERY_HOT_RELOAD is an exception to this because it's designed to be set
10
+ // when developing CoreQuery itself (i.e. when working directly in this repo),
11
+ // and you want hot-reloading of the Vite frontend and server code. A consumer
12
+ // of CoreQuery cannot and would not be able to hot-reload CoreQuery's own code,
13
+ // as only the built javascript code gets bundled into the package. (The env var
14
+ // is prefixed with `COREQUERY_` to avoid possible conflicts.)
15
+ const envSchema = z.object({
16
+ COREQUERY_HOT_RELOAD: z.coerce.boolean().default(false),
17
+ });
18
+ export const env = envSchema.parse(process.env);
19
+ //# sourceMappingURL=env.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"env.js","sourceRoot":"","sources":["../../env.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB,uDAAuD;AACvD,EAAE;AACF,+EAA+E;AAC/E,4EAA4E;AAC5E,2EAA2E;AAC3E,4DAA4D;AAC5D,EAAE;AACF,+EAA+E;AAC/E,8EAA8E;AAC9E,8EAA8E;AAC9E,gFAAgF;AAChF,gFAAgF;AAChF,8DAA8D;AAE9D,MAAM,SAAS,GAAG,CAAC,CAAC,MAAM,CAAC;IACzB,oBAAoB,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;CACxD,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,GAAG,GAAG,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ export * from "./corequery.js";
@@ -0,0 +1,2 @@
1
+ export * from "./corequery.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
@@ -0,0 +1,14 @@
1
+ import type { Corequery } from "./corequery.js";
2
+ export declare const clientModes: readonly ["dist-folder", "vite-middleware"];
3
+ export type ClientMode = (typeof clientModes)[number];
4
+ export declare class WebServer {
5
+ private readonly _app;
6
+ private readonly _port;
7
+ private readonly _clientMode;
8
+ private readonly _serverFolderPath;
9
+ constructor(_app: Corequery, _port: number, _clientMode: ClientMode, _serverFolderPath: string);
10
+ start(): Promise<void>;
11
+ private _serveFrontendFromDistFolder;
12
+ private _serveFrontendUsingViteMiddleware;
13
+ private _getWebFolderPath;
14
+ }
@@ -0,0 +1,54 @@
1
+ import express from "express";
2
+ import fsp from "fs/promises";
3
+ import path from "path";
4
+ import { createServer } from "vite";
5
+ export const clientModes = ["dist-folder", "vite-middleware"];
6
+ export class WebServer {
7
+ _app;
8
+ _port;
9
+ _clientMode;
10
+ _serverFolderPath;
11
+ constructor(_app, _port, _clientMode, _serverFolderPath) {
12
+ this._app = _app;
13
+ this._port = _port;
14
+ this._clientMode = _clientMode;
15
+ this._serverFolderPath = _serverFolderPath;
16
+ }
17
+ async start() {
18
+ const server = express();
19
+ // TODO: Implement APIs
20
+ // server.use("/api", express.json(), createApiRouter(this._app));
21
+ if (this._clientMode === "dist-folder") {
22
+ await this._serveFrontendFromDistFolder(server);
23
+ }
24
+ if (this._clientMode === "vite-middleware") {
25
+ await this._serveFrontendUsingViteMiddleware(server);
26
+ }
27
+ server.listen(this._port, () => {
28
+ console.log(`Server ready (http://localhost:${this._port})!`);
29
+ });
30
+ }
31
+ async _serveFrontendFromDistFolder(server) {
32
+ const indexHtmlPath = this._getWebFolderPath("dist/index.html");
33
+ const indexHtml = await fsp.readFile(indexHtmlPath, "utf-8");
34
+ server.use(express.static(this._getWebFolderPath("dist")));
35
+ server.use("*all", async (_req, res) => {
36
+ res.status(200).set({ "Content-Type": "text/html" }).end(indexHtml);
37
+ });
38
+ }
39
+ async _serveFrontendUsingViteMiddleware(server) {
40
+ console.log("Running with Vite middleware for hot-reloading...");
41
+ const vite = await createServer({
42
+ server: { middlewareMode: true },
43
+ root: this._getWebFolderPath(),
44
+ });
45
+ server.use(vite.middlewares);
46
+ }
47
+ _getWebFolderPath(innerPath = "") {
48
+ // TODO: This assumes we're running in <folder>/server/dist/server, and so
49
+ // need three hops to find the web/ folder. Is it still true if we're
50
+ // hot-reloading the server code?
51
+ return path.resolve(path.resolve(this._serverFolderPath, "../../../web"), innerPath);
52
+ }
53
+ }
54
+ //# sourceMappingURL=web-server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"web-server.js","sourceRoot":"","sources":["../../web-server.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,GAAG,MAAM,aAAa,CAAC;AAC9B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AAGpC,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,aAAa,EAAE,iBAAiB,CAAU,CAAC;AAGvE,MAAM,OAAO,SAAS;IAED;IACA;IACA;IACA;IAJnB,YACmB,IAAe,EACf,KAAa,EACb,WAAuB,EACvB,iBAAyB;QAHzB,SAAI,GAAJ,IAAI,CAAW;QACf,UAAK,GAAL,KAAK,CAAQ;QACb,gBAAW,GAAX,WAAW,CAAY;QACvB,sBAAiB,GAAjB,iBAAiB,CAAQ;IACzC,CAAC;IAEJ,KAAK,CAAC,KAAK;QACT,MAAM,MAAM,GAAG,OAAO,EAAE,CAAC;QAEzB,uBAAuB;QACvB,kEAAkE;QAElE,IAAI,IAAI,CAAC,WAAW,KAAK,aAAa,EAAE,CAAC;YACvC,MAAM,IAAI,CAAC,4BAA4B,CAAC,MAAM,CAAC,CAAC;QAClD,CAAC;QACD,IAAI,IAAI,CAAC,WAAW,KAAK,iBAAiB,EAAE,CAAC;YAC3C,MAAM,IAAI,CAAC,iCAAiC,CAAC,MAAM,CAAC,CAAC;QACvD,CAAC;QAED,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE;YAC7B,OAAO,CAAC,GAAG,CAAC,kCAAkC,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC;QAChE,CAAC,CAAC,CAAC;IACL,CAAC;IAEO,KAAK,CAAC,4BAA4B,CAAC,MAAuB;QAChE,MAAM,aAAa,GAAG,IAAI,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;QAChE,MAAM,SAAS,GAAG,MAAM,GAAG,CAAC,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;QAE7D,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QAE3D,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE;YACrC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,cAAc,EAAE,WAAW,EAAE,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACtE,CAAC,CAAC,CAAC;IACL,CAAC;IAEO,KAAK,CAAC,iCAAiC,CAAC,MAAuB;QACrE,OAAO,CAAC,GAAG,CAAC,mDAAmD,CAAC,CAAC;QACjE,MAAM,IAAI,GAAG,MAAM,YAAY,CAAC;YAC9B,MAAM,EAAE,EAAE,cAAc,EAAE,IAAI,EAAE;YAChC,IAAI,EAAE,IAAI,CAAC,iBAAiB,EAAE;SAC/B,CAAC,CAAC;QACH,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAC/B,CAAC;IAEO,iBAAiB,CAAC,YAAoB,EAAE;QAC9C,0EAA0E;QAC1E,qEAAqE;QACrE,iCAAiC;QACjC,OAAO,IAAI,CAAC,OAAO,CACjB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,iBAAiB,EAAE,cAAc,CAAC,EACpD,SAAS,CACV,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1 @@
1
+ import{u as r}from"./index-CAIeHOhe.js";import{N as o}from"./Nav-C2NVTyoC.js";function u(){return r("div",{children:[r("h1",{children:"CoreQuery - About"}),r(o,{})]})}export{u as default};
@@ -0,0 +1 @@
1
+ import{y as r,u as o}from"./index-CAIeHOhe.js";import{N as e}from"./Nav-C2NVTyoC.js";function n(){console.log("This is shared code running!")}function u(){return r(()=>{n()},[]),o("div",{children:[o("h1",{children:"CoreQuery - Home"}),o(e,{})]})}export{u as default};
@@ -0,0 +1 @@
1
+ import{u as r}from"./index-CAIeHOhe.js";function n(){return r("nav",{children:r("ul",{children:[r("li",{children:r("a",{href:"/",children:"Home"})}),r("li",{children:r("a",{href:"/about",children:"About"})}),r("li",{children:r("a",{href:"/bacon",children:"Not Found"})})]})})}export{n as N};
@@ -0,0 +1 @@
1
+ import{u as o}from"./index-CAIeHOhe.js";import{N as r}from"./Nav-C2NVTyoC.js";function n(){return o("div",{children:[o("h1",{children:"CoreQuery - Not Found"}),o(r,{})]})}export{n as default};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Home-BduB8uYZ.js","assets/Nav-C2NVTyoC.js","assets/About-CHls07V1.js","assets/NotFound-vj1r1f4z.js"])))=>i.map(i=>d[i]);
2
+ (function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const n of o)if(n.type==="childList")for(const u of n.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&r(u)}).observe(document,{childList:!0,subtree:!0});function _(o){const n={};return o.integrity&&(n.integrity=o.integrity),o.referrerPolicy&&(n.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?n.credentials="include":o.crossOrigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function r(o){if(o.ep)return;o.ep=!0;const n=_(o);fetch(o.href,n)}})();const Ve="modulepreload",et=function(t){return"/"+t},ye={},le=function(e,_,r){let o=Promise.resolve();if(_&&_.length>0){let f=function(l){return Promise.all(l.map(p=>Promise.resolve(p).then(i=>({status:"fulfilled",value:i}),i=>({status:"rejected",reason:i}))))};document.getElementsByTagName("link");const u=document.querySelector("meta[property=csp-nonce]"),c=u?.nonce||u?.getAttribute("nonce");o=f(_.map(l=>{if(l=et(l),l in ye)return;ye[l]=!0;const p=l.endsWith(".css"),i=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${i}`))return;const s=document.createElement("link");if(s.rel=p?"stylesheet":Ve,p||(s.as="script"),s.crossOrigin="",s.href=l,c&&s.setAttribute("nonce",c),document.head.appendChild(s),p)return new Promise((a,v)=>{s.addEventListener("load",a),s.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${l}`)))})}))}function n(u){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=u,window.dispatchEvent(c),!c.defaultPrevented)throw u}return o.then(u=>{for(const c of u||[])c.status==="rejected"&&n(c.reason);return e().catch(n)})};var j,h,Ae,D,ge,Te,Me,Oe,se,re,oe,Ne,W={},Fe=[],tt=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,B=Array.isArray;function $(t,e){for(var _ in e)t[_]=e[_];return t}function fe(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function x(t,e,_){var r,o,n,u={};for(n in e)n=="key"?r=e[n]:n=="ref"?o=e[n]:u[n]=e[n];if(arguments.length>2&&(u.children=arguments.length>3?j.call(arguments,2):_),typeof t=="function"&&t.defaultProps!=null)for(n in t.defaultProps)u[n]===void 0&&(u[n]=t.defaultProps[n]);return I(t,u,r,o,null)}function I(t,e,_,r,o){var n={type:t,props:e,key:_,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o??++Ae,__i:-1,__u:0};return o==null&&h.vnode!=null&&h.vnode(n),n}function ee(t){return t.children}function Y(t,e){this.props=t,this.context=e}function N(t,e){if(e==null)return t.__?N(t.__,t.__i+1):null;for(var _;e<t.__k.length;e++)if((_=t.__k[e])!=null&&_.__e!=null)return _.__e;return typeof t.type=="function"?N(t):null}function Ie(t){var e,_;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((_=t.__k[e])!=null&&_.__e!=null){t.__e=t.__c.base=_.__e;break}return Ie(t)}}function ie(t){(!t.__d&&(t.__d=!0)&&D.push(t)&&!Z.__r++||ge!=h.debounceRendering)&&((ge=h.debounceRendering)||Te)(Z)}function Z(){for(var t,e,_,r,o,n,u,c=1;D.length;)D.length>c&&D.sort(Me),t=D.shift(),c=D.length,t.__d&&(_=void 0,r=void 0,o=(r=(e=t).__v).__e,n=[],u=[],e.__P&&((_=$({},r)).__v=r.__v+1,h.vnode&&h.vnode(_),ae(e.__P,_,r,e.__n,e.__P.namespaceURI,32&r.__u?[o]:null,n,o??N(r),!!(32&r.__u),u),_.__v=r.__v,_.__.__k[_.__i]=_,qe(n,_,u),r.__e=r.__=null,_.__e!=o&&Ie(_)));Z.__r=0}function We(t,e,_,r,o,n,u,c,f,l,p){var i,s,a,v,E,g,d,m=r&&r.__k||Fe,P=e.length;for(f=_t(_,e,m,f,P),i=0;i<P;i++)(a=_.__k[i])!=null&&(s=a.__i==-1?W:m[a.__i]||W,a.__i=i,g=ae(t,a,s,o,n,u,c,f,l,p),v=a.__e,a.ref&&s.ref!=a.ref&&(s.ref&&pe(s.ref,null,a),p.push(a.ref,a.__c||v,a)),E==null&&v!=null&&(E=v),(d=!!(4&a.__u))||s.__k===a.__k?f=je(a,f,t,d):typeof a.type=="function"&&g!==void 0?f=g:v&&(f=v.nextSibling),a.__u&=-7);return _.__e=E,f}function _t(t,e,_,r,o){var n,u,c,f,l,p=_.length,i=p,s=0;for(t.__k=new Array(o),n=0;n<o;n++)(u=e[n])!=null&&typeof u!="boolean"&&typeof u!="function"?(f=n+s,(u=t.__k[n]=typeof u=="string"||typeof u=="number"||typeof u=="bigint"||u.constructor==String?I(null,u,null,null,null):B(u)?I(ee,{children:u},null,null,null):u.constructor==null&&u.__b>0?I(u.type,u.props,u.key,u.ref?u.ref:null,u.__v):u).__=t,u.__b=t.__b+1,c=null,(l=u.__i=nt(u,_,f,i))!=-1&&(i--,(c=_[l])&&(c.__u|=2)),c==null||c.__v==null?(l==-1&&(o>p?s--:o<p&&s++),typeof u.type!="function"&&(u.__u|=4)):l!=f&&(l==f-1?s--:l==f+1?s++:(l>f?s--:s++,u.__u|=4))):t.__k[n]=null;if(i)for(n=0;n<p;n++)(c=_[n])!=null&&(2&c.__u)==0&&(c.__e==r&&(r=N(c)),Ke(c,c));return r}function je(t,e,_,r){var o,n;if(typeof t.type=="function"){for(o=t.__k,n=0;o&&n<o.length;n++)o[n]&&(o[n].__=t,e=je(o[n],e,_,r));return e}t.__e!=e&&(r&&(e&&t.type&&!e.parentNode&&(e=N(t)),_.insertBefore(t.__e,e||null)),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function Be(t,e){return e=e||[],t==null||typeof t=="boolean"||(B(t)?t.some(function(_){Be(_,e)}):e.push(t)),e}function nt(t,e,_,r){var o,n,u,c=t.key,f=t.type,l=e[_],p=l!=null&&(2&l.__u)==0;if(l===null&&t.key==null||p&&c==l.key&&f==l.type)return _;if(r>(p?1:0)){for(o=_-1,n=_+1;o>=0||n<e.length;)if((l=e[u=o>=0?o--:n++])!=null&&(2&l.__u)==0&&c==l.key&&f==l.type)return u}return-1}function be(t,e,_){e[0]=="-"?t.setProperty(e,_??""):t[e]=_==null?"":typeof _!="number"||tt.test(e)?_:_+"px"}function G(t,e,_,r,o){var n,u;e:if(e=="style")if(typeof _=="string")t.style.cssText=_;else{if(typeof r=="string"&&(t.style.cssText=r=""),r)for(e in r)_&&e in _||be(t.style,e,"");if(_)for(e in _)r&&_[e]==r[e]||be(t.style,e,_[e])}else if(e[0]=="o"&&e[1]=="n")n=e!=(e=e.replace(Oe,"$1")),u=e.toLowerCase(),e=u in t||e=="onFocusOut"||e=="onFocusIn"?u.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+n]=_,_?r?_.u=r.u:(_.u=se,t.addEventListener(e,n?oe:re,n)):t.removeEventListener(e,n?oe:re,n);else{if(o=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=_??"";break e}catch{}typeof _=="function"||(_==null||_===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&_==1?"":_))}}function ke(t){return function(e){if(this.l){var _=this.l[e.type+t];if(e.t==null)e.t=se++;else if(e.t<_.u)return;return _(h.event?h.event(e):e)}}}function ae(t,e,_,r,o,n,u,c,f,l){var p,i,s,a,v,E,g,d,m,P,w,A,H,K,T,b,C,S=e.type;if(e.constructor!=null)return null;128&_.__u&&(f=!!(32&_.__u),n=[c=e.__e=_.__e]),(p=h.__b)&&p(e);e:if(typeof S=="function")try{if(d=e.props,m="prototype"in S&&S.prototype.render,P=(p=S.contextType)&&r[p.__c],w=p?P?P.props.value:p.__:r,_.__c?g=(i=e.__c=_.__c).__=i.__E:(m?e.__c=i=new S(d,w):(e.__c=i=new Y(d,w),i.constructor=S,i.render=ot),P&&P.sub(i),i.props=d,i.state||(i.state={}),i.context=w,i.__n=r,s=i.__d=!0,i.__h=[],i._sb=[]),m&&i.__s==null&&(i.__s=i.state),m&&S.getDerivedStateFromProps!=null&&(i.__s==i.state&&(i.__s=$({},i.__s)),$(i.__s,S.getDerivedStateFromProps(d,i.__s))),a=i.props,v=i.state,i.__v=e,s)m&&S.getDerivedStateFromProps==null&&i.componentWillMount!=null&&i.componentWillMount(),m&&i.componentDidMount!=null&&i.__h.push(i.componentDidMount);else{if(m&&S.getDerivedStateFromProps==null&&d!==a&&i.componentWillReceiveProps!=null&&i.componentWillReceiveProps(d,w),!i.__e&&i.shouldComponentUpdate!=null&&i.shouldComponentUpdate(d,i.__s,w)===!1||e.__v==_.__v){for(e.__v!=_.__v&&(i.props=d,i.state=i.__s,i.__d=!1),e.__e=_.__e,e.__k=_.__k,e.__k.some(function(M){M&&(M.__=e)}),A=0;A<i._sb.length;A++)i.__h.push(i._sb[A]);i._sb=[],i.__h.length&&u.push(i);break e}i.componentWillUpdate!=null&&i.componentWillUpdate(d,i.__s,w),m&&i.componentDidUpdate!=null&&i.__h.push(function(){i.componentDidUpdate(a,v,E)})}if(i.context=w,i.props=d,i.__P=t,i.__e=!1,H=h.__r,K=0,m){for(i.state=i.__s,i.__d=!1,H&&H(e),p=i.render(i.props,i.state,i.context),T=0;T<i._sb.length;T++)i.__h.push(i._sb[T]);i._sb=[]}else do i.__d=!1,H&&H(e),p=i.render(i.props,i.state,i.context),i.state=i.__s;while(i.__d&&++K<25);i.state=i.__s,i.getChildContext!=null&&(r=$($({},r),i.getChildContext())),m&&!s&&i.getSnapshotBeforeUpdate!=null&&(E=i.getSnapshotBeforeUpdate(a,v)),b=p,p!=null&&p.type===ee&&p.key==null&&(b=ze(p.props.children)),c=We(t,B(b)?b:[b],e,_,r,o,n,u,c,f,l),i.base=e.__e,e.__u&=-161,i.__h.length&&u.push(i),g&&(i.__E=i.__=null)}catch(M){if(e.__v=null,f||n!=null)if(M.then){for(e.__u|=f?160:128;c&&c.nodeType==8&&c.nextSibling;)c=c.nextSibling;n[n.indexOf(c)]=null,e.__e=c}else{for(C=n.length;C--;)fe(n[C]);ue(e)}else e.__e=_.__e,e.__k=_.__k,M.then||ue(e);h.__e(M,e,_)}else n==null&&e.__v==_.__v?(e.__k=_.__k,e.__e=_.__e):c=e.__e=rt(_.__e,e,_,r,o,n,u,f,l);return(p=h.diffed)&&p(e),128&e.__u?void 0:c}function ue(t){t&&t.__c&&(t.__c.__e=!0),t&&t.__k&&t.__k.forEach(ue)}function qe(t,e,_){for(var r=0;r<_.length;r++)pe(_[r],_[++r],_[++r]);h.__c&&h.__c(e,t),t.some(function(o){try{t=o.__h,o.__h=[],t.some(function(n){n.call(o)})}catch(n){h.__e(n,o.__v)}})}function ze(t){return typeof t!="object"||t==null||t.__b&&t.__b>0?t:B(t)?t.map(ze):$({},t)}function rt(t,e,_,r,o,n,u,c,f){var l,p,i,s,a,v,E,g=_.props,d=e.props,m=e.type;if(m=="svg"?o="http://www.w3.org/2000/svg":m=="math"?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),n!=null){for(l=0;l<n.length;l++)if((a=n[l])&&"setAttribute"in a==!!m&&(m?a.localName==m:a.nodeType==3)){t=a,n[l]=null;break}}if(t==null){if(m==null)return document.createTextNode(d);t=document.createElementNS(o,m,d.is&&d),c&&(h.__m&&h.__m(e,n),c=!1),n=null}if(m==null)g===d||c&&t.data==d||(t.data=d);else{if(n=n&&j.call(t.childNodes),g=_.props||W,!c&&n!=null)for(g={},l=0;l<t.attributes.length;l++)g[(a=t.attributes[l]).name]=a.value;for(l in g)if(a=g[l],l!="children"){if(l=="dangerouslySetInnerHTML")i=a;else if(!(l in d)){if(l=="value"&&"defaultValue"in d||l=="checked"&&"defaultChecked"in d)continue;G(t,l,null,a,o)}}for(l in d)a=d[l],l=="children"?s=a:l=="dangerouslySetInnerHTML"?p=a:l=="value"?v=a:l=="checked"?E=a:c&&typeof a!="function"||g[l]===a||G(t,l,a,g[l],o);if(p)c||i&&(p.__html==i.__html||p.__html==t.innerHTML)||(t.innerHTML=p.__html),e.__k=[];else if(i&&(t.innerHTML=""),We(e.type=="template"?t.content:t,B(s)?s:[s],e,_,r,m=="foreignObject"?"http://www.w3.org/1999/xhtml":o,n,u,n?n[0]:_.__k&&N(_,0),c,f),n!=null)for(l=n.length;l--;)fe(n[l]);c||(l="value",m=="progress"&&v==null?t.removeAttribute("value"):v!=null&&(v!==t[l]||m=="progress"&&!v||m=="option"&&v!=g[l])&&G(t,l,v,g[l],o),l="checked",E!=null&&E!=t[l]&&G(t,l,E,g[l],o))}return t}function pe(t,e,_){try{if(typeof t=="function"){var r=typeof t.__u=="function";r&&t.__u(),r&&e==null||(t.__u=t(e))}else t.current=e}catch(o){h.__e(o,_)}}function Ke(t,e,_){var r,o;if(h.unmount&&h.unmount(t),(r=t.ref)&&(r.current&&r.current!=t.__e||pe(r,null,e)),(r=t.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(n){h.__e(n,e)}r.base=r.__P=null}if(r=t.__k)for(o=0;o<r.length;o++)r[o]&&Ke(r[o],e,_||typeof t.type!="function");_||fe(t.__e),t.__c=t.__=t.__e=void 0}function ot(t,e,_){return this.constructor(t,_)}function it(t,e,_){var r,o,n,u;e==document&&(e=document.documentElement),h.__&&h.__(t,e),o=(r=!1)?null:e.__k,n=[],u=[],ae(e,t=e.__k=x(ee,null,[t]),o||W,W,e.namespaceURI,o?null:e.firstChild?j.call(e.childNodes):null,n,o?o.__e:e.firstChild,r,u),qe(n,t,u)}function Ee(t,e,_){var r,o,n,u,c=$({},t.props);for(n in t.type&&t.type.defaultProps&&(u=t.type.defaultProps),e)n=="key"?r=e[n]:n=="ref"?o=e[n]:c[n]=e[n]===void 0&&u!=null?u[n]:e[n];return arguments.length>2&&(c.children=arguments.length>3?j.call(arguments,2):_),I(t.type,c,r||t.key,o||t.ref,null)}function Ge(t){function e(_){var r,o;return this.getChildContext||(r=new Set,(o={})[e.__c]=this,this.getChildContext=function(){return o},this.componentWillUnmount=function(){r=null},this.shouldComponentUpdate=function(n){this.props.value!=n.value&&r.forEach(function(u){u.__e=!0,ie(u)})},this.sub=function(n){r.add(n);var u=n.componentWillUnmount;n.componentWillUnmount=function(){r&&r.delete(n),u&&u.call(n)}}),_.children}return e.__c="__cC"+Ne++,e.__=t,e.Provider=e.__l=(e.Consumer=function(_,r){return _.children(r)}).contextType=e,e}j=Fe.slice,h={__e:function(t,e,_,r){for(var o,n,u;e=e.__;)if((o=e.__c)&&!o.__)try{if((n=o.constructor)&&n.getDerivedStateFromError!=null&&(o.setState(n.getDerivedStateFromError(t)),u=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(t,r||{}),u=o.__d),u)return o.__E=o}catch(c){t=c}throw t}},Ae=0,Y.prototype.setState=function(t,e){var _;_=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=$({},this.state),typeof t=="function"&&(t=t($({},_),this.props)),t&&$(_,t),t!=null&&this.__v&&(e&&this._sb.push(e),ie(this))},Y.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),ie(this))},Y.prototype.render=ee,D=[],Te=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Me=function(t,e){return t.__v.__b-e.__v.__b},Z.__r=0,Oe=/(PointerCapture)$|Capture$/i,se=0,re=ke(!1),oe=ke(!0),Ne=0;var ut=0;function U(t,e,_,r,o,n){e||(e={});var u,c,f=e;if("ref"in f)for(c in f={},e)c=="ref"?u=e[c]:f[c]=e[c];var l={type:t,props:f,key:_,ref:u,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--ut,__i:-1,__u:0,__source:o,__self:n};if(typeof t=="function"&&(u=t.defaultProps))for(c in u)f[c]===void 0&&(f[c]=u[c]);return h.vnode&&h.vnode(l),l}var R,y,te,Pe,V=0,Je=[],k=h,we=k.__b,Se=k.__r,$e=k.diffed,Ce=k.__c,Le=k.unmount,xe=k.__;function q(t,e){k.__h&&k.__h(y,t,V||e),V=0;var _=y.__H||(y.__H={__:[],__h:[]});return t>=_.__.length&&_.__.push({}),_.__[t]}function ct(t){return V=1,he(Xe,t)}function he(t,e,_){var r=q(R++,2);if(r.t=t,!r.__c&&(r.__=[Xe(void 0,e),function(c){var f=r.__N?r.__N[0]:r.__[0],l=r.t(f,c);f!==l&&(r.__N=[l,r.__[1]],r.__c.setState({}))}],r.__c=y,!y.__f)){var o=function(c,f,l){if(!r.__c.__H)return!0;var p=r.__c.__H.__.filter(function(s){return!!s.__c});if(p.every(function(s){return!s.__N}))return!n||n.call(this,c,f,l);var i=r.__c.props!==c;return p.forEach(function(s){if(s.__N){var a=s.__[0];s.__=s.__N,s.__N=void 0,a!==s.__[0]&&(i=!0)}}),n&&n.call(this,c,f,l)||i};y.__f=!0;var n=y.shouldComponentUpdate,u=y.componentWillUpdate;y.componentWillUpdate=function(c,f,l){if(this.__e){var p=n;n=void 0,o(c,f,l),n=p}u&&u.call(this,c,f,l)},y.shouldComponentUpdate=o}return r.__N||r.__}function Et(t,e){var _=q(R++,3);!k.__s&&me(_.__H,e)&&(_.__=t,_.u=e,y.__H.__h.push(_))}function Qe(t,e){var _=q(R++,4);!k.__s&&me(_.__H,e)&&(_.__=t,_.u=e,y.__h.push(_))}function L(t){return V=5,de(function(){return{current:t}},[])}function de(t,e){var _=q(R++,7);return me(_.__H,e)&&(_.__=t(),_.__H=e,_.__h=t),_.__}function Ye(t){var e=y.context[t.__c],_=q(R++,9);return _.c=t,e?(_.__==null&&(_.__=!0,e.sub(y)),e.props.value):t.__}function lt(){for(var t;t=Je.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(X),t.__H.__h.forEach(ce),t.__H.__h=[]}catch(e){t.__H.__h=[],k.__e(e,t.__v)}}k.__b=function(t){y=null,we&&we(t)},k.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),xe&&xe(t,e)},k.__r=function(t){Se&&Se(t),R=0;var e=(y=t.__c).__H;e&&(te===y?(e.__h=[],y.__h=[],e.__.forEach(function(_){_.__N&&(_.__=_.__N),_.u=_.__N=void 0})):(e.__h.forEach(X),e.__h.forEach(ce),e.__h=[],R=0)),te=y},k.diffed=function(t){$e&&$e(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(Je.push(e)!==1&&Pe===k.requestAnimationFrame||((Pe=k.requestAnimationFrame)||st)(lt)),e.__H.__.forEach(function(_){_.u&&(_.__H=_.u),_.u=void 0})),te=y=null},k.__c=function(t,e){e.some(function(_){try{_.__h.forEach(X),_.__h=_.__h.filter(function(r){return!r.__||ce(r)})}catch(r){e.some(function(o){o.__h&&(o.__h=[])}),e=[],k.__e(r,_.__v)}}),Ce&&Ce(t,e)},k.unmount=function(t){Le&&Le(t);var e,_=t.__c;_&&_.__H&&(_.__H.__.forEach(function(r){try{X(r)}catch(o){e=o}}),_.__H=void 0,e&&k.__e(e,_.__v))};var He=typeof requestAnimationFrame=="function";function st(t){var e,_=function(){clearTimeout(r),He&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(_,35);He&&(e=requestAnimationFrame(_))}function X(t){var e=y,_=t.__c;typeof _=="function"&&(t.__c=void 0,_()),y=e}function ce(t){var e=y;t.__c=t.__(),y=e}function me(t,e){return!t||t.length!==e.length||e.some(function(_,r){return _!==t[r]})}function Xe(t,e){return typeof e=="function"?e(t):e}let O,F;function ft(t){return!F||(typeof F=="string"?t.startsWith(F):F.test(t))}function at(t,e){let _="";if(O=void 0,e&&e.type==="click"){if(e.ctrlKey||e.metaKey||e.altKey||e.shiftKey||e.button!==0)return t;const r=e.composedPath().find(n=>n.nodeName=="A"&&n.href),o=r&&r.getAttribute("href");if(!r||r.origin!=location.origin||/^#/.test(o)||!/^(_?self)?$/i.test(r.target)||!ft(o))return t;O=!0,e.preventDefault(),_=r.href.replace(location.origin,"")}else e&&e.url?(O=!e.replace,_=e.url):_=location.pathname+location.search;return O===!0?history.pushState(null,"",_):O===!1&&history.replaceState(null,"",_),_}const pt=(t,e,_={})=>{t=t.split("/").filter(Boolean),e=(e||"").split("/").filter(Boolean),_.params||(_.params={});for(let r=0,o,n;r<Math.max(t.length,e.length);r++){let[,u,c,f]=(e[r]||"").match(/^(:?)(.*?)([+*?]?)$/);if(o=t[r],!(!u&&c==o)){if(!u&&o&&f=="*"){_.rest="/"+t.slice(r).map(decodeURIComponent).join("/");break}if(!u||!o&&f!="?"&&f!="*")return;if(n=f=="+"||f=="*",n?o=t.slice(r).map(decodeURIComponent).join("/")||void 0:o&&(o=decodeURIComponent(o)),_.params[c]=o,c in _||(_[c]=o),n)break}}return _};function z(t){const[e,_]=he(at,t.url||location.pathname+location.search);t.scope&&(F=t.scope);const r=O===!0,o=de(()=>{const n=new URL(e,location.origin),u=n.pathname.replace(/\/+$/g,"")||"/";return{url:e,path:u,query:Object.fromEntries(n.searchParams),route:(c,f)=>_({url:c,replace:f}),wasPush:r}},[e]);return Qe(()=>(addEventListener("click",_),addEventListener("popstate",_),()=>{removeEventListener("click",_),removeEventListener("popstate",_)}),[]),x(z.ctx.Provider,{value:o},t.children)}const ht=Promise.resolve();function Ze(t){const[e,_]=he(b=>b+1,0),{url:r,query:o,wasPush:n,path:u}=dt();if(!r)throw new Error("preact-iso's <Router> must be used within a <LocationProvider>, see: https://github.com/preactjs/preact-iso#locationprovider");const{rest:c=u,params:f={}}=Ye(Ue),l=L(!1),p=L(u),i=L(0),s=L(),a=L(),v=L(),E=L(!1),g=L();g.current=!1;let d,m,P;Be(t.children).some(b=>{if(pt(c,b.props.path,P={...b.props,path:c,query:o,params:Object.assign({},f),rest:""}))return d=Ee(b,P);b.props.default&&(m=Ee(b,P))});let w=d||m;const A=s.current&&s.current.__u&J&&s.current.__u&Q,H=s.current&&s.current.__h,K=de(()=>{a.current=s.current,s.current=x(Ue.Provider,{value:P},w);const b=a.current&&a.current.props.children;return!b||!w||w.type!==b.type||w.props.component!==b.props.component?(this.__v&&this.__v.__k&&this.__v.__k.reverse(),i.current++,!0):!1},[r,JSON.stringify(P)]);A?(s.current.__u|=J,s.current.__u|=Q):H&&(s.current.__h=!0);const T=a.current;return a.current=null,this.__c=(b,C)=>{g.current=!0,a.current=T,t.onLoadStart&&t.onLoadStart(r),l.current=!0;let S=i.current;b.then(()=>{S===i.current&&(a.current=null,s.current&&(C.__h&&(s.current.__h=C.__h),C.__u&Q&&(s.current.__u|=Q),C.__u&J&&(s.current.__u|=J)),ht.then(_))})},Qe(()=>{const b=this.__v&&this.__v.__e;if(g.current){!E.current&&!v.current&&(v.current=b);return}!E.current&&v.current&&(v.current!==b&&v.current.remove(),v.current=null),E.current=!0,p.current!==u&&(n&&scrollTo(0,0),t.onRouteChange&&t.onRouteChange(r),p.current=u),t.onLoadEnd&&l.current&&t.onLoadEnd(r),l.current=!1},[u,n,e]),K?[x(_e,{r:s}),x(_e,{r:a})]:x(_e,{r:s})}const J=32,Q=128,_e=({r:t})=>t.current;Ze.Provider=z;z.ctx=Ge({});const Ue=Ge({}),ne=t=>x(t.component,t),dt=()=>Ye(z.ctx),De=h.__b;h.__b=t=>{t.type&&t.type._forwarded&&t.ref&&(t.props.ref=t.ref,t.ref=null),De&&De(t)};function ve(t){let e,_;const r=()=>t().then(n=>_=n&&n.default||n),o=n=>{const[,u]=ct(0),c=L(_);if(e||(e=r()),_!==void 0)return x(_,n);throw c.current||(c.current=e.then(()=>u(1))),e};return o.preload=()=>(e||(e=r()),e),o._forwarded=!0,o}const Re=h.__e;h.__e=(t,e,_)=>{if(t&&t.then){let r=e;for(;r=r.__;)if(r.__c&&r.__c.__c)return e.__e==null&&(e.__c.__z=[_.__e],e.__e=_.__e,e.__k=_.__k),e.__k||(e.__k=[]),r.__c.__c(t,e)}Re&&Re(t,e,_)};function mt(t){return this.__c=vt,this.componentDidCatch=t.onError,t.children}function vt(t){t.then(()=>this.forceUpdate())}const yt=ve(()=>le(()=>import("./Home-BduB8uYZ.js"),__vite__mapDeps([0,1]))),gt=ve(()=>le(()=>import("./About-CHls07V1.js"),__vite__mapDeps([2,1]))),bt=ve(()=>le(()=>import("./NotFound-vj1r1f4z.js"),__vite__mapDeps([3,1])));function kt(){return U(z,{children:U(mt,{children:U(Ze,{children:[U(ne,{path:"/",component:yt}),U(ne,{path:"/about",component:gt}),U(ne,{default:!0,component:bt})]})})})}it(U(kt,{}),document.body);export{U as u,Et as y};
@@ -0,0 +1,12 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>CoreQuery</title>
8
+ <script type="module" crossorigin src="/assets/index-CAIeHOhe.js"></script>
9
+ <link rel="manifest" href="/manifest.webmanifest"><script id="vite-plugin-pwa:register-sw" src="/registerSW.js"></script></head>
10
+ <body>
11
+ </body>
12
+ </html>
@@ -0,0 +1 @@
1
+ {"name":"CoreQuery Demo App","short_name":"corequery","description":"A platform for building web apps serving transit information.","start_url":"/","display":"standalone","background_color":"#ffffff","theme_color":"#42b883","lang":"en","scope":"/"}
@@ -0,0 +1 @@
1
+ if('serviceWorker' in navigator) {window.addEventListener('load', () => {navigator.serviceWorker.register('/sw.js', { scope: '/' })})}
package/web/dist/sw.js ADDED
@@ -0,0 +1 @@
1
+ if(!self.define){let e,s={};const i=(i,n)=>(i=new URL(i+".js",n).href,s[i]||new Promise(s=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=s,document.head.appendChild(e)}else e=i,importScripts(i),s()}).then(()=>{let e=s[i];if(!e)throw new Error(`Module ${i} didn’t register its module`);return e}));self.define=(n,r)=>{const t=e||("document"in self?document.currentScript.src:"")||location.href;if(s[t])return;let o={};const l=e=>i(e,t),u={module:{uri:t},exports:o,require:l};s[t]=Promise.all(n.map(e=>u[e]||l(e))).then(e=>(r(...e),o))}}define(["./workbox-1ef09536"],function(e){"use strict";self.addEventListener("message",e=>{e.data&&"SKIP_WAITING"===e.data.type&&self.skipWaiting()}),e.precacheAndRoute([{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"index.html",revision:"8087ccf519638fd03cc644ece1211841"},{url:"assets/index-CAIeHOhe.js",revision:null},{url:"assets/NotFound-vj1r1f4z.js",revision:null},{url:"assets/Nav-C2NVTyoC.js",revision:null},{url:"assets/Home-BduB8uYZ.js",revision:null},{url:"assets/About-CHls07V1.js",revision:null},{url:"manifest.webmanifest",revision:"48fd3cb91ed36b2bc127d102d508a762"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))});
@@ -0,0 +1 @@
1
+ define(["exports"],function(t){"use strict";try{self["workbox:core:7.3.0"]&&_()}catch(t){}const e=(t,...e)=>{let s=t;return e.length>0&&(s+=` :: ${JSON.stringify(e)}`),s};class s extends Error{constructor(t,s){super(e(t,s)),this.name=t,this.details=s}}try{self["workbox:routing:7.3.0"]&&_()}catch(t){}const n=t=>t&&"object"==typeof t?t:{handle:t};class i{constructor(t,e,s="GET"){this.handler=n(e),this.match=t,this.method=s}setCatchHandler(t){this.catchHandler=n(t)}}class r extends i{constructor(t,e,s){super(({url:e})=>{const s=t.exec(e.href);if(s&&(e.origin===location.origin||0===s.index))return s.slice(1)},e,s)}}class o{constructor(){this.t=new Map,this.i=new Map}get routes(){return this.t}addFetchListener(){self.addEventListener("fetch",t=>{const{request:e}=t,s=this.handleRequest({request:e,event:t});s&&t.respondWith(s)})}addCacheListener(){self.addEventListener("message",t=>{if(t.data&&"CACHE_URLS"===t.data.type){const{payload:e}=t.data,s=Promise.all(e.urlsToCache.map(e=>{"string"==typeof e&&(e=[e]);const s=new Request(...e);return this.handleRequest({request:s,event:t})}));t.waitUntil(s),t.ports&&t.ports[0]&&s.then(()=>t.ports[0].postMessage(!0))}})}handleRequest({request:t,event:e}){const s=new URL(t.url,location.href);if(!s.protocol.startsWith("http"))return;const n=s.origin===location.origin,{params:i,route:r}=this.findMatchingRoute({event:e,request:t,sameOrigin:n,url:s});let o=r&&r.handler;const c=t.method;if(!o&&this.i.has(c)&&(o=this.i.get(c)),!o)return;let a;try{a=o.handle({url:s,request:t,event:e,params:i})}catch(t){a=Promise.reject(t)}const h=r&&r.catchHandler;return a instanceof Promise&&(this.o||h)&&(a=a.catch(async n=>{if(h)try{return await h.handle({url:s,request:t,event:e,params:i})}catch(t){t instanceof Error&&(n=t)}if(this.o)return this.o.handle({url:s,request:t,event:e});throw n})),a}findMatchingRoute({url:t,sameOrigin:e,request:s,event:n}){const i=this.t.get(s.method)||[];for(const r of i){let i;const o=r.match({url:t,sameOrigin:e,request:s,event:n});if(o)return i=o,(Array.isArray(i)&&0===i.length||o.constructor===Object&&0===Object.keys(o).length||"boolean"==typeof o)&&(i=void 0),{route:r,params:i}}return{}}setDefaultHandler(t,e="GET"){this.i.set(e,n(t))}setCatchHandler(t){this.o=n(t)}registerRoute(t){this.t.has(t.method)||this.t.set(t.method,[]),this.t.get(t.method).push(t)}unregisterRoute(t){if(!this.t.has(t.method))throw new s("unregister-route-but-not-found-with-method",{method:t.method});const e=this.t.get(t.method).indexOf(t);if(!(e>-1))throw new s("unregister-route-route-not-registered");this.t.get(t.method).splice(e,1)}}let c;const a=()=>(c||(c=new o,c.addFetchListener(),c.addCacheListener()),c);function h(t,e,n){let o;if("string"==typeof t){const s=new URL(t,location.href);o=new i(({url:t})=>t.href===s.href,e,n)}else if(t instanceof RegExp)o=new r(t,e,n);else if("function"==typeof t)o=new i(t,e,n);else{if(!(t instanceof i))throw new s("unsupported-route-type",{moduleName:"workbox-routing",funcName:"registerRoute",paramName:"capture"});o=t}return a().registerRoute(o),o}const u={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:"undefined"!=typeof registration?registration.scope:""},l=t=>[u.prefix,t,u.suffix].filter(t=>t&&t.length>0).join("-"),f=t=>t||l(u.precache),w=t=>t||l(u.runtime);function d(t,e){const s=e();return t.waitUntil(s),s}try{self["workbox:precaching:7.3.0"]&&_()}catch(t){}function p(t){if(!t)throw new s("add-to-cache-list-unexpected-type",{entry:t});if("string"==typeof t){const e=new URL(t,location.href);return{cacheKey:e.href,url:e.href}}const{revision:e,url:n}=t;if(!n)throw new s("add-to-cache-list-unexpected-type",{entry:t});if(!e){const t=new URL(n,location.href);return{cacheKey:t.href,url:t.href}}const i=new URL(n,location.href),r=new URL(n,location.href);return i.searchParams.set("__WB_REVISION__",e),{cacheKey:i.href,url:r.href}}class y{constructor(){this.updatedURLs=[],this.notUpdatedURLs=[],this.handlerWillStart=async({request:t,state:e})=>{e&&(e.originalRequest=t)},this.cachedResponseWillBeUsed=async({event:t,state:e,cachedResponse:s})=>{if("install"===t.type&&e&&e.originalRequest&&e.originalRequest instanceof Request){const t=e.originalRequest.url;s?this.notUpdatedURLs.push(t):this.updatedURLs.push(t)}return s}}}class g{constructor({precacheController:t}){this.cacheKeyWillBeUsed=async({request:t,params:e})=>{const s=(null==e?void 0:e.cacheKey)||this.h.getCacheKeyForURL(t.url);return s?new Request(s,{headers:t.headers}):t},this.h=t}}let R;async function m(t,e){let n=null;if(t.url){n=new URL(t.url).origin}if(n!==self.location.origin)throw new s("cross-origin-copy-response",{origin:n});const i=t.clone(),r={headers:new Headers(i.headers),status:i.status,statusText:i.statusText},o=e?e(r):r,c=function(){if(void 0===R){const t=new Response("");if("body"in t)try{new Response(t.body),R=!0}catch(t){R=!1}R=!1}return R}()?i.body:await i.blob();return new Response(c,o)}function v(t,e){const s=new URL(t);for(const t of e)s.searchParams.delete(t);return s.href}class q{constructor(){this.promise=new Promise((t,e)=>{this.resolve=t,this.reject=e})}}const U=new Set;try{self["workbox:strategies:7.3.0"]&&_()}catch(t){}function L(t){return"string"==typeof t?new Request(t):t}class b{constructor(t,e){this.u={},Object.assign(this,e),this.event=e.event,this.l=t,this.p=new q,this.R=[],this.m=[...t.plugins],this.v=new Map;for(const t of this.m)this.v.set(t,{});this.event.waitUntil(this.p.promise)}async fetch(t){const{event:e}=this;let n=L(t);if("navigate"===n.mode&&e instanceof FetchEvent&&e.preloadResponse){const t=await e.preloadResponse;if(t)return t}const i=this.hasCallback("fetchDidFail")?n.clone():null;try{for(const t of this.iterateCallbacks("requestWillFetch"))n=await t({request:n.clone(),event:e})}catch(t){if(t instanceof Error)throw new s("plugin-error-request-will-fetch",{thrownErrorMessage:t.message})}const r=n.clone();try{let t;t=await fetch(n,"navigate"===n.mode?void 0:this.l.fetchOptions);for(const s of this.iterateCallbacks("fetchDidSucceed"))t=await s({event:e,request:r,response:t});return t}catch(t){throw i&&await this.runCallbacks("fetchDidFail",{error:t,event:e,originalRequest:i.clone(),request:r.clone()}),t}}async fetchAndCachePut(t){const e=await this.fetch(t),s=e.clone();return this.waitUntil(this.cachePut(t,s)),e}async cacheMatch(t){const e=L(t);let s;const{cacheName:n,matchOptions:i}=this.l,r=await this.getCacheKey(e,"read"),o=Object.assign(Object.assign({},i),{cacheName:n});s=await caches.match(r,o);for(const t of this.iterateCallbacks("cachedResponseWillBeUsed"))s=await t({cacheName:n,matchOptions:i,cachedResponse:s,request:r,event:this.event})||void 0;return s}async cachePut(t,e){const n=L(t);var i;await(i=0,new Promise(t=>setTimeout(t,i)));const r=await this.getCacheKey(n,"write");if(!e)throw new s("cache-put-with-no-response",{url:(o=r.url,new URL(String(o),location.href).href.replace(new RegExp(`^${location.origin}`),""))});var o;const c=await this.q(e);if(!c)return!1;const{cacheName:a,matchOptions:h}=this.l,u=await self.caches.open(a),l=this.hasCallback("cacheDidUpdate"),f=l?await async function(t,e,s,n){const i=v(e.url,s);if(e.url===i)return t.match(e,n);const r=Object.assign(Object.assign({},n),{ignoreSearch:!0}),o=await t.keys(e,r);for(const e of o)if(i===v(e.url,s))return t.match(e,n)}(u,r.clone(),["__WB_REVISION__"],h):null;try{await u.put(r,l?c.clone():c)}catch(t){if(t instanceof Error)throw"QuotaExceededError"===t.name&&await async function(){for(const t of U)await t()}(),t}for(const t of this.iterateCallbacks("cacheDidUpdate"))await t({cacheName:a,oldResponse:f,newResponse:c.clone(),request:r,event:this.event});return!0}async getCacheKey(t,e){const s=`${t.url} | ${e}`;if(!this.u[s]){let n=t;for(const t of this.iterateCallbacks("cacheKeyWillBeUsed"))n=L(await t({mode:e,request:n,event:this.event,params:this.params}));this.u[s]=n}return this.u[s]}hasCallback(t){for(const e of this.l.plugins)if(t in e)return!0;return!1}async runCallbacks(t,e){for(const s of this.iterateCallbacks(t))await s(e)}*iterateCallbacks(t){for(const e of this.l.plugins)if("function"==typeof e[t]){const s=this.v.get(e),n=n=>{const i=Object.assign(Object.assign({},n),{state:s});return e[t](i)};yield n}}waitUntil(t){return this.R.push(t),t}async doneWaiting(){for(;this.R.length;){const t=this.R.splice(0),e=(await Promise.allSettled(t)).find(t=>"rejected"===t.status);if(e)throw e.reason}}destroy(){this.p.resolve(null)}async q(t){let e=t,s=!1;for(const t of this.iterateCallbacks("cacheWillUpdate"))if(e=await t({request:this.request,response:e,event:this.event})||void 0,s=!0,!e)break;return s||e&&200!==e.status&&(e=void 0),e}}class C{constructor(t={}){this.cacheName=w(t.cacheName),this.plugins=t.plugins||[],this.fetchOptions=t.fetchOptions,this.matchOptions=t.matchOptions}handle(t){const[e]=this.handleAll(t);return e}handleAll(t){t instanceof FetchEvent&&(t={event:t,request:t.request});const e=t.event,s="string"==typeof t.request?new Request(t.request):t.request,n="params"in t?t.params:void 0,i=new b(this,{event:e,request:s,params:n}),r=this.U(i,s,e);return[r,this.L(r,i,s,e)]}async U(t,e,n){let i;await t.runCallbacks("handlerWillStart",{event:n,request:e});try{if(i=await this._(e,t),!i||"error"===i.type)throw new s("no-response",{url:e.url})}catch(s){if(s instanceof Error)for(const r of t.iterateCallbacks("handlerDidError"))if(i=await r({error:s,event:n,request:e}),i)break;if(!i)throw s}for(const s of t.iterateCallbacks("handlerWillRespond"))i=await s({event:n,request:e,response:i});return i}async L(t,e,s,n){let i,r;try{i=await t}catch(r){}try{await e.runCallbacks("handlerDidRespond",{event:n,request:s,response:i}),await e.doneWaiting()}catch(t){t instanceof Error&&(r=t)}if(await e.runCallbacks("handlerDidComplete",{event:n,request:s,response:i,error:r}),e.destroy(),r)throw r}}class E extends C{constructor(t={}){t.cacheName=f(t.cacheName),super(t),this.C=!1!==t.fallbackToNetwork,this.plugins.push(E.copyRedirectedCacheableResponsesPlugin)}async _(t,e){const s=await e.cacheMatch(t);return s||(e.event&&"install"===e.event.type?await this.O(t,e):await this.N(t,e))}async N(t,e){let n;const i=e.params||{};if(!this.C)throw new s("missing-precache-entry",{cacheName:this.cacheName,url:t.url});{const s=i.integrity,r=t.integrity,o=!r||r===s;n=await e.fetch(new Request(t,{integrity:"no-cors"!==t.mode?r||s:void 0})),s&&o&&"no-cors"!==t.mode&&(this.P(),await e.cachePut(t,n.clone()))}return n}async O(t,e){this.P();const n=await e.fetch(t);if(!await e.cachePut(t,n.clone()))throw new s("bad-precaching-response",{url:t.url,status:n.status});return n}P(){let t=null,e=0;for(const[s,n]of this.plugins.entries())n!==E.copyRedirectedCacheableResponsesPlugin&&(n===E.defaultPrecacheCacheabilityPlugin&&(t=s),n.cacheWillUpdate&&e++);0===e?this.plugins.push(E.defaultPrecacheCacheabilityPlugin):e>1&&null!==t&&this.plugins.splice(t,1)}}E.defaultPrecacheCacheabilityPlugin={cacheWillUpdate:async({response:t})=>!t||t.status>=400?null:t},E.copyRedirectedCacheableResponsesPlugin={cacheWillUpdate:async({response:t})=>t.redirected?await m(t):t};class O{constructor({cacheName:t,plugins:e=[],fallbackToNetwork:s=!0}={}){this.j=new Map,this.k=new Map,this.K=new Map,this.l=new E({cacheName:f(t),plugins:[...e,new g({precacheController:this})],fallbackToNetwork:s}),this.install=this.install.bind(this),this.activate=this.activate.bind(this)}get strategy(){return this.l}precache(t){this.addToCacheList(t),this.T||(self.addEventListener("install",this.install),self.addEventListener("activate",this.activate),this.T=!0)}addToCacheList(t){const e=[];for(const n of t){"string"==typeof n?e.push(n):n&&void 0===n.revision&&e.push(n.url);const{cacheKey:t,url:i}=p(n),r="string"!=typeof n&&n.revision?"reload":"default";if(this.j.has(i)&&this.j.get(i)!==t)throw new s("add-to-cache-list-conflicting-entries",{firstEntry:this.j.get(i),secondEntry:t});if("string"!=typeof n&&n.integrity){if(this.K.has(t)&&this.K.get(t)!==n.integrity)throw new s("add-to-cache-list-conflicting-integrities",{url:i});this.K.set(t,n.integrity)}if(this.j.set(i,t),this.k.set(i,r),e.length>0){const t=`Workbox is precaching URLs without revision info: ${e.join(", ")}\nThis is generally NOT safe. Learn more at https://bit.ly/wb-precache`;console.warn(t)}}}install(t){return d(t,async()=>{const e=new y;this.strategy.plugins.push(e);for(const[e,s]of this.j){const n=this.K.get(s),i=this.k.get(e),r=new Request(e,{integrity:n,cache:i,credentials:"same-origin"});await Promise.all(this.strategy.handleAll({params:{cacheKey:s},request:r,event:t}))}const{updatedURLs:s,notUpdatedURLs:n}=e;return{updatedURLs:s,notUpdatedURLs:n}})}activate(t){return d(t,async()=>{const t=await self.caches.open(this.strategy.cacheName),e=await t.keys(),s=new Set(this.j.values()),n=[];for(const i of e)s.has(i.url)||(await t.delete(i),n.push(i.url));return{deletedURLs:n}})}getURLsToCacheKeys(){return this.j}getCachedURLs(){return[...this.j.keys()]}getCacheKeyForURL(t){const e=new URL(t,location.href);return this.j.get(e.href)}getIntegrityForCacheKey(t){return this.K.get(t)}async matchPrecache(t){const e=t instanceof Request?t.url:t,s=this.getCacheKeyForURL(e);if(s){return(await self.caches.open(this.strategy.cacheName)).match(s)}}createHandlerBoundToURL(t){const e=this.getCacheKeyForURL(t);if(!e)throw new s("non-precached-url",{url:t});return s=>(s.request=new Request(t),s.params=Object.assign({cacheKey:e},s.params),this.strategy.handle(s))}}let x;const N=()=>(x||(x=new O),x);class P extends i{constructor(t,e){super(({request:s})=>{const n=t.getURLsToCacheKeys();for(const i of function*(t,{ignoreURLParametersMatching:e=[/^utm_/,/^fbclid$/],directoryIndex:s="index.html",cleanURLs:n=!0,urlManipulation:i}={}){const r=new URL(t,location.href);r.hash="",yield r.href;const o=function(t,e=[]){for(const s of[...t.searchParams.keys()])e.some(t=>t.test(s))&&t.searchParams.delete(s);return t}(r,e);if(yield o.href,s&&o.pathname.endsWith("/")){const t=new URL(o.href);t.pathname+=s,yield t.href}if(n){const t=new URL(o.href);t.pathname+=".html",yield t.href}if(i){const t=i({url:r});for(const e of t)yield e.href}}(s.url,e)){const e=n.get(i);if(e){return{cacheKey:e,integrity:t.getIntegrityForCacheKey(e)}}}},t.strategy)}}t.NavigationRoute=class extends i{constructor(t,{allowlist:e=[/./],denylist:s=[]}={}){super(t=>this.W(t),t),this.M=e,this.S=s}W({url:t,request:e}){if(e&&"navigate"!==e.mode)return!1;const s=t.pathname+t.search;for(const t of this.S)if(t.test(s))return!1;return!!this.M.some(t=>t.test(s))}},t.cleanupOutdatedCaches=function(){self.addEventListener("activate",t=>{const e=f();t.waitUntil((async(t,e="-precache-")=>{const s=(await self.caches.keys()).filter(s=>s.includes(e)&&s.includes(self.registration.scope)&&s!==t);return await Promise.all(s.map(t=>self.caches.delete(t))),s})(e).then(t=>{}))})},t.createHandlerBoundToURL=function(t){return N().createHandlerBoundToURL(t)},t.precacheAndRoute=function(t,e){!function(t){N().precache(t)}(t),function(t){const e=N();h(new P(e,t))}(e)},t.registerRoute=h});
@@ -1 +0,0 @@
1
- export {};
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=main.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"main.js","sourceRoot":"","sources":["../main.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- export {};
@@ -1,7 +0,0 @@
1
- import { runSharedCode } from "../shared/example.js";
2
- async function main() {
3
- console.log("Hello!");
4
- runSharedCode();
5
- }
6
- main();
7
- //# sourceMappingURL=main.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"main.js","sourceRoot":"","sources":["../../main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,KAAK,UAAU,IAAI;IACjB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACtB,aAAa,EAAE,CAAC;AAClB,CAAC;AAED,IAAI,EAAE,CAAC"}