jitar 0.11.0 → 0.11.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.
Files changed (57) hide show
  1. package/dist/ConfigurationManager-B7adTVpS.js +1 -0
  2. package/dist/cli.js +1 -1
  3. package/dist/client.js +1 -1
  4. package/dist/lib.d.ts +3 -0
  5. package/dist/lib.js +1 -1
  6. package/dist/templates/backend/jitar.json +1 -1
  7. package/dist/templates/backend/{_package.json → package.json} +4 -3
  8. package/dist/templates/backend/src/tsconfig.json +8 -0
  9. package/dist/templates/{react/tsconfig.base.json → backend/tsconfig.json} +4 -11
  10. package/dist/templates/react/jitar.json +1 -1
  11. package/dist/templates/react/package.json +28 -0
  12. package/dist/templates/react/services/standalone.json +1 -0
  13. package/dist/templates/react/src/{webui → app/components}/App.tsx +3 -3
  14. package/dist/templates/react/{index.html → src/app/index.html} +1 -1
  15. package/dist/templates/react/src/app/public/vite.svg +1 -0
  16. package/dist/templates/react/src/app/tsconfig.json +9 -0
  17. package/dist/templates/react/src/app/vite.config.ts +25 -0
  18. package/dist/templates/react/src/tsconfig.json +8 -0
  19. package/dist/templates/react/tsconfig.json +15 -0
  20. package/dist/templates/vue/jitar.json +1 -1
  21. package/dist/templates/vue/package.json +27 -0
  22. package/dist/templates/vue/services/standalone.json +1 -0
  23. package/dist/templates/vue/src/{webui → app/components}/App.vue +3 -3
  24. package/dist/templates/vue/{index.html → src/app/index.html} +1 -1
  25. package/dist/templates/vue/src/app/public/vite.svg +1 -0
  26. package/dist/templates/vue/src/app/tsconfig.json +7 -0
  27. package/dist/templates/vue/src/app/vite.config.ts +25 -0
  28. package/dist/templates/vue/src/domain/sayHello.js +3 -0
  29. package/dist/templates/vue/src/tsconfig.json +8 -0
  30. package/dist/templates/vue/tsconfig.json +15 -0
  31. package/package.json +1 -1
  32. package/dist/ConfigurationManager-CYD-3rnJ.js +0 -1
  33. package/dist/templates/backend/_gitignore +0 -25
  34. package/dist/templates/backend/_tsconfig.json +0 -20
  35. package/dist/templates/react/_gitignore +0 -25
  36. package/dist/templates/react/_package.json +0 -28
  37. package/dist/templates/react/_tsconfig.json +0 -6
  38. package/dist/templates/react/_vite.config.ts +0 -14
  39. package/dist/templates/react/public/vite.svg +0 -1
  40. package/dist/templates/react/src/vite-env.d.ts +0 -1
  41. package/dist/templates/react/tsconfig.build.json +0 -11
  42. package/dist/templates/vue/_gitignore +0 -25
  43. package/dist/templates/vue/_package.json +0 -26
  44. package/dist/templates/vue/_tsconfig.json +0 -19
  45. package/dist/templates/vue/_vite.config.ts +0 -14
  46. package/dist/templates/vue/public/vite.svg +0 -1
  47. package/dist/templates/vue/src/vite-env.d.ts +0 -1
  48. package/dist/templates/vue/tsconfig.build.json +0 -10
  49. /package/dist/templates/react/src/{webui → app}/assets/jitar.svg +0 -0
  50. /package/dist/templates/react/src/{webui → app}/assets/react.svg +0 -0
  51. /package/dist/templates/react/src/{webui → app/components}/App.css +0 -0
  52. /package/dist/templates/react/src/{webui → app/components}/index.css +0 -0
  53. /package/dist/templates/react/src/{webui → app/components}/main.tsx +0 -0
  54. /package/dist/templates/vue/src/{webui → app}/assets/jitar.svg +0 -0
  55. /package/dist/templates/vue/src/{webui → app}/assets/vue.svg +0 -0
  56. /package/dist/templates/vue/src/{webui → app/components}/main.ts +0 -0
  57. /package/dist/templates/vue/src/{webui → app/components}/style.css +0 -0
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "jitar-vue-starter",
3
+ "private": true,
4
+ "version": "0.0.0",
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev": "vite --config src/app/vite.config.ts",
8
+ "build": "npm run build-domain && npm run build-app",
9
+ "build-domain": "rimraf build dist && tsc -p src/tsconfig.json && jitar build",
10
+ "build-app": "vite build --config=src/app/vite.config.ts && vue-tsc --noEmit",
11
+ "standalone": "jitar start --service=services/standalone.json"
12
+ },
13
+ "dependencies": {
14
+ "jitar": "^0.11.0",
15
+ "vue": "^3.5.35"
16
+ },
17
+ "devDependencies": {
18
+ "@types/node": "^24.12.4",
19
+ "@jitar/plugin-vite": "^0.11.0",
20
+ "@vitejs/plugin-vue": "^6.0.7",
21
+ "@vue/tsconfig": "^0.9.1",
22
+ "rimraf": "^6.1.3",
23
+ "typescript": "5.9.3",
24
+ "vite": "^7.3.3",
25
+ "vue-tsc": "^3.3.3"
26
+ }
27
+ }
@@ -3,6 +3,7 @@
3
3
  "standalone":
4
4
  {
5
5
  "segments": ["default"],
6
+ "assetRoot": "./app",
6
7
  "assets": ["index.html", "vite.svg", "assets/**/*"]
7
8
  }
8
9
  }
@@ -1,7 +1,7 @@
1
1
  <script setup lang="ts">
2
2
 
3
3
  import { ref } from 'vue';
4
- import { sayHello } from '../domain/sayHello';
4
+ import { sayHello } from '../../domain/sayHello';
5
5
 
6
6
  const message = ref('');
7
7
 
@@ -19,10 +19,10 @@ runComponent();
19
19
  <img src="/vite.svg" class="logo" alt="Vite logo" />
20
20
  </a>
21
21
  <a href="https://vuejs.org/" target="_blank" rel="noopener noreferrer">
22
- <img src="./assets/vue.svg" class="logo vue" alt="Vue logo" />
22
+ <img src="../assets/vue.svg" class="logo vue" alt="Vue logo" />
23
23
  </a>
24
24
  <a href="https://jitar.dev" target="_blank" rel="noopener noreferrer">
25
- <img src="./assets/jitar.svg" class="logo jitar" alt="Jitar logo" />
25
+ <img src="../assets/jitar.svg" class="logo jitar" alt="Jitar logo" />
26
26
  </a>
27
27
  </div>
28
28
  <h1>{{ message }}</h1>
@@ -8,6 +8,6 @@
8
8
  </head>
9
9
  <body>
10
10
  <div id="app"></div>
11
- <script type="module" src="/src/webui/main.ts"></script>
11
+ <script type="module" src="./components/main.ts"></script>
12
12
  </body>
13
13
  </html>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="77" height="47" fill="none" aria-labelledby="vite-logo-title" viewBox="0 0 77 47"><title id="vite-logo-title">Vite</title><style>.parenthesis{fill:#000}@media (prefers-color-scheme:dark){.parenthesis{fill:#fff}}</style><path fill="#9135ff" d="M40.151 45.71c-.663.844-2.02.374-2.02-.699V34.708a2.26 2.26 0 0 0-2.262-2.262H24.493c-.92 0-1.457-1.04-.92-1.788l7.479-10.471c1.07-1.498 0-3.578-1.842-3.578H15.443c-.92 0-1.456-1.04-.92-1.788l9.696-13.576c.213-.297.556-.474.92-.474h28.894c.92 0 1.456 1.04.92 1.788l-7.48 10.472c-1.07 1.497 0 3.578 1.842 3.578h11.376c.944 0 1.474 1.087.89 1.83L40.153 45.712z"/><mask id="a" width="48" height="47" x="14" y="0" maskUnits="userSpaceOnUse" style="mask-type:alpha"><path fill="#000" d="M40.047 45.71c-.663.843-2.02.374-2.02-.699V34.708a2.26 2.26 0 0 0-2.262-2.262H24.389c-.92 0-1.457-1.04-.92-1.788l7.479-10.472c1.07-1.497 0-3.578-1.842-3.578H15.34c-.92 0-1.456-1.04-.92-1.788l9.696-13.575c.213-.297.556-.474.92-.474H53.93c.92 0 1.456 1.04.92 1.788L47.37 13.03c-1.07 1.498 0 3.578 1.842 3.578h11.376c.944 0 1.474 1.088.89 1.831L40.049 45.712z"/></mask><g mask="url(#a)"><g filter="url(#b)"><ellipse cx="5.508" cy="14.704" fill="#eee6ff" rx="5.508" ry="14.704" transform="rotate(269.814 20.96 11.29)scale(-1 1)"/></g><g filter="url(#c)"><ellipse cx="10.399" cy="29.851" fill="#eee6ff" rx="10.399" ry="29.851" transform="rotate(89.814 -16.902 -8.275)scale(1 -1)"/></g><g filter="url(#d)"><ellipse cx="5.508" cy="30.487" fill="#8900ff" rx="5.508" ry="30.487" transform="rotate(89.814 -19.197 -7.127)scale(1 -1)"/></g><g filter="url(#e)"><ellipse cx="5.508" cy="30.599" fill="#8900ff" rx="5.508" ry="30.599" transform="rotate(89.814 -25.928 4.177)scale(1 -1)"/></g><g filter="url(#f)"><ellipse cx="5.508" cy="30.599" fill="#8900ff" rx="5.508" ry="30.599" transform="rotate(89.814 -25.738 5.52)scale(1 -1)"/></g><g filter="url(#g)"><ellipse cx="14.072" cy="22.078" fill="#eee6ff" rx="14.072" ry="22.078" transform="rotate(93.35 31.245 55.578)scale(-1 1)"/></g><g filter="url(#h)"><ellipse cx="3.47" cy="21.501" fill="#8900ff" rx="3.47" ry="21.501" transform="rotate(89.009 35.419 55.202)scale(-1 1)"/></g><g filter="url(#i)"><ellipse cx="3.47" cy="21.501" fill="#8900ff" rx="3.47" ry="21.501" transform="rotate(89.009 35.419 55.202)scale(-1 1)"/></g><g filter="url(#j)"><ellipse cx="14.592" cy="9.743" fill="#8900ff" rx="4.407" ry="29.108" transform="rotate(39.51 14.592 9.743)"/></g><g filter="url(#k)"><ellipse cx="61.728" cy="-5.321" fill="#8900ff" rx="4.407" ry="29.108" transform="rotate(37.892 61.728 -5.32)"/></g><g filter="url(#l)"><ellipse cx="55.618" cy="7.104" fill="#00c2ff" rx="5.971" ry="9.665" transform="rotate(37.892 55.618 7.104)"/></g><g filter="url(#m)"><ellipse cx="12.326" cy="39.103" fill="#8900ff" rx="4.407" ry="29.108" transform="rotate(37.892 12.326 39.103)"/></g><g filter="url(#n)"><ellipse cx="12.326" cy="39.103" fill="#8900ff" rx="4.407" ry="29.108" transform="rotate(37.892 12.326 39.103)"/></g><g filter="url(#o)"><ellipse cx="49.857" cy="30.678" fill="#8900ff" rx="4.407" ry="29.108" transform="rotate(37.892 49.857 30.678)"/></g><g filter="url(#p)"><ellipse cx="52.623" cy="33.171" fill="#00c2ff" rx="5.971" ry="15.297" transform="rotate(37.892 52.623 33.17)"/></g></g><path d="M6.919 0c-9.198 13.166-9.252 33.575 0 46.789h6.215c-9.25-13.214-9.196-33.623 0-46.789zm62.424 0h-6.215c9.198 13.166 9.252 33.575 0 46.789h6.215c9.25-13.214 9.196-33.623 0-46.789" class="parenthesis"/><defs><filter id="b" width="60.045" height="41.654" x="-5.564" y="16.92" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="7.659"/></filter><filter id="c" width="90.34" height="51.437" x="-40.407" y="-6.762" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="7.659"/></filter><filter id="d" width="79.355" height="29.4" x="-35.435" y="2.801" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="e" width="79.579" height="29.4" x="-30.84" y="20.8" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="f" width="79.579" height="29.4" x="-29.307" y="21.949" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="g" width="74.749" height="58.852" x="29.961" y="-17.13" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="7.659"/></filter><filter id="h" width="61.377" height="25.362" x="37.754" y="3.055" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="i" width="61.377" height="25.362" x="37.754" y="3.055" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="j" width="56.045" height="63.649" x="-13.43" y="-22.082" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="k" width="54.814" height="64.646" x="34.321" y="-37.644" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="l" width="33.541" height="35.313" x="38.847" y="-10.552" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="m" width="54.814" height="64.646" x="-15.081" y="6.78" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="n" width="54.814" height="64.646" x="-15.081" y="6.78" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="o" width="54.814" height="64.646" x="22.45" y="-1.645" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="p" width="39.409" height="43.623" x="32.919" y="11.36" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter></defs></svg>
@@ -0,0 +1,7 @@
1
+ {
2
+ "extends": "@vue/tsconfig/tsconfig.dom.json",
3
+ "compilerOptions": {
4
+ "types": ["vite/client"]
5
+ },
6
+ "include": ["./"]
7
+ }
@@ -0,0 +1,25 @@
1
+
2
+ import { defineConfig } from 'vite';
3
+ import vue from '@vitejs/plugin-vue';
4
+ import jitar, { JitarConfig } from '@jitar/plugin-vite';
5
+
6
+ const jitarConfig: JitarConfig = {
7
+ projectRoot: '../../',
8
+ sourceRoot: '../',
9
+ jitarUrl: 'http://localhost:3000',
10
+ segments: [],
11
+ middleware: []
12
+ };
13
+
14
+ export default defineConfig({
15
+ root: './src/app',
16
+ publicDir: 'public',
17
+ build: {
18
+ outDir: '../../dist/app',
19
+ emptyOutDir: true
20
+ },
21
+ plugins: [
22
+ vue(),
23
+ jitar(jitarConfig)
24
+ ]
25
+ });
@@ -0,0 +1,3 @@
1
+ export async function sayHello(name) {
2
+ return `Hello, ${name}!`;
3
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "extends": "../tsconfig.json",
3
+ "compilerOptions": {
4
+ "outDir": "../build",
5
+ "rootDir": "./"
6
+ },
7
+ "include": ["./domain"]
8
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "compilerOptions": {
3
+ "types": ["node"],
4
+ "useDefineForClassFields": true,
5
+ "allowJs": false,
6
+ "skipLibCheck": true,
7
+ "allowSyntheticDefaultImports": true,
8
+ "strict": true,
9
+ "forceConsistentCasingInFileNames": true,
10
+ "isolatedModules": true,
11
+ "target": "esnext",
12
+ "module": "esnext",
13
+ "moduleResolution": "bundler"
14
+ }
15
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jitar",
3
- "version": "0.11.0",
3
+ "version": "0.11.2",
4
4
  "description": "Distributed runtime for JavaScript and TypeScript to chop monolithic applications into micros.",
5
5
  "author": "Masking Technology <info@masking.tech> (https://jitar.dev)",
6
6
  "license": "MIT",
@@ -1 +0,0 @@
1
- import e,{promises as t}from"node:fs";import s from"node:path";import{glob as r}from"glob";import i from"mime-types";import n from"dotenv";const o={MODULE_PATTERN:"**/*.js",RESOURCE_PATTERN:"**/*.json",SEGMENT_PATTERN:"**/*.json"};class a extends Error{#e;constructor(e){super(`Invalid location: ${e}`),this.#e=e}get location(){return this.#e}}class c extends Error{#t;constructor(e){super(`The file '${e}' could not be found`),this.#t=e}get filename(){return this.#t}}class u{#e;#s;#r;constructor(e,t,s){this.#e=e,this.#s=t,this.#r=s}get location(){return this.#e}get type(){return this.#s}get content(){return this.#r}get size(){return this.#r.length}}class l{#e;#i;#n;constructor(e,t){const s=t.resolve(e);this.#e=t.normalize(e),this.#i=t.normalize(s),this.#n=t}getAbsoluteLocation(e){const t=this.#n.isAbsolute(e)?e:this.#n.join(this.#e,e),s=this.#n.resolve(t),r=this.#n.normalize(s);return this.#o(r,e),r}getRelativeLocation(e){const t=this.#n.relative(this.#e,e);return this.#n.normalize(t)}normalizeLocation(e){return this.#n.normalize(e)}async getType(e){const t=this.getAbsoluteLocation(e);return await this.#n.mimeType(t)??"application/octet-stream"}async getContent(e){const t=this.getAbsoluteLocation(e);if(!1===await this.#n.exists(t))throw new c(e);return this.#n.read(t)}async exists(e){const t=this.getAbsoluteLocation(e);return this.#n.exists(t)}isDirectory(e){const t=this.getAbsoluteLocation(e);return this.#n.isDirectory(t)}async read(e){const t=this.getAbsoluteLocation(e),s=await this.getType(t),r=await this.getContent(t);return new u(e,s,r)}async write(e,t){const s=this.getAbsoluteLocation(e);return this.#n.write(s,t)}async copy(e,t){const s=this.getAbsoluteLocation(e),r=this.getAbsoluteLocation(t);return this.#n.copy(s,r)}async delete(e){const t=this.getAbsoluteLocation(e);return this.#n.delete(t)}async filter(e){const t=this.getAbsoluteLocation("./"),s=this.#n.normalize(e);return(await this.#n.filter(t,s)).map(e=>this.#n.normalize(e))}#o(e,t){if(!1===e.startsWith(this.#i))throw new a(t)}}class h{copy(e,s){return t.cp(e,s,{recursive:!0,force:!0})}delete(e){return t.rm(e,{recursive:!0,force:!0})}async exists(e){try{return await t.stat(e),!0}catch{return!1}}isAbsolute(e){return s.isAbsolute(e)}isDirectory(t){try{return e.statSync(t).isDirectory()}catch{return!1}}filter(e,t){return r(`${e}/${t}`)}join(...e){return s.join(...e)}read(e){return t.readFile(e)}resolve(e){return s.resolve(e)}relative(e,t){return s.relative(e,t)}normalize(e){return e.replaceAll(s.win32.sep,s.posix.sep)}async mimeType(e){const t=i.lookup(e);if(!1!==t)return t}async write(r,i){const n=s.dirname(r);return e.mkdirSync(n,{recursive:!0}),t.writeFile(r,i)}}class p extends l{constructor(e){super(e,new h)}}class d{#a;#c;#u;constructor(e,t,s){this.#a=e,this.#c=t,this.#u=s}get resources(){return this.#c}get repository(){return this.#a}get segmentation(){return this.#u}}class m{#c;constructor(e){this.#c=e}isResourceModule(e){return this.#c.includes(e)}}const f="private",g="0.0.0",E="index.js",w=".json",y="default";class S{#l=0;next(){return"$"+ ++this.#l}}const b="js",A=/\.js$/,I=[".","/","http:","https:"];class v{translatePath(e){const t=e.split("/"),s=[];for(const e of t){switch(e.trim()){case"":case".":continue;case"..":s.pop();continue}s.push(e)}return s.join("/")}makePathRelative(e,t){if(""===t)return`./${e}`;const s=e.split("/"),r=t.split("/");for(;s[0]===r[0];)s.shift(),r.shift();const i=r.map(()=>"..").join("/");return`${r.length>0?i:"."}/${s.join("/")}`}makePathAbsolute(e,t,s="/"){const r=""!==t?`${t}/${e}`:e;return`${s}${this.translatePath(r)}`}extractPath(e){return e.split("/").slice(0,-1).join("/")}extractFilename(e){return e.split("/").pop()}assureExtension(e){return e.endsWith(`.${b}`)?e:`${e}.${b}`}addSubExtension(e,t){return e.replace(A,`.${t}.${b}`)}isApplicationModule(e){return I.some(t=>e.startsWith(t))}}let T=class extends Error{constructor(e,t){super(`Failed to load resource file '${e}' because of: ${t}`)}};class O{#h;#p;#d=new v;constructor(e,t){this.#h=e,this.#p=t}async readAll(e){const t=await Promise.all(e.map(e=>this.#m(e)));return new m(t.flat())}async#m(e){try{const t=await this.#h.getContent(e);return JSON.parse(t.toString()).map(e=>this.#f(e))}catch(t){const s=t instanceof Error?t.message:String(t);throw new T(e,s)}}#f(e){const t=this.#p.normalizeLocation(e),s=this.#p.isDirectory(t)?`${t}/${E}`:this.#d.assureExtension(t);return s.startsWith("./")?s.substring(2):s.startsWith("/")?s.substring(1):s}}let R=class{#t;#g;constructor(e,t){this.#t=e,this.#g=t}get filename(){return this.#t}get model(){return this.#g}};class N{#E;constructor(e){this.#E=e}get modules(){return this.#E}get(e){return this.#E.find(t=>t.filename===e)}}class x{}class M extends x{elements;constructor(e){super(),this.elements=e}clone(){const e=this.elements.map(e=>e.clone());return new M(e)}toString(){return`[${this.elements.map(e=>e.toString()).join(",")}]`}}class C{}class $ extends C{identifier;constructor(e){super(),this.identifier=e}is(e){return this.identifier===e}}class L extends ${parameters;body;isAsync;constructor(e,t,s,r=!1){super(e),this.parameters=t,this.body=s,this.isAsync=r}clone(){const e=this.parameters.map(e=>e.clone()),t=this.body.clone();return new L(this.identifier,e,t,this.isAsync)}toString(){const e=this.isAsync?"async ":"",t=this.identifier?` ${this.identifier}`:"",s=this.parameters.map(e=>e.toString()),r=this.body.toString();return`${e}function${t}(${s.join(",")})${r}`}}class P extends L{constructor(e,t,s=!1){super(void 0,e,t,s)}clone(){const e=this.parameters.map(e=>e.clone()),t=this.body.clone();return new P(e,t,this.isAsync)}toString(){const e=this.isAsync?"async ":"",t=this.parameters.map(e=>e.toString()),s=this.body.toString();return`${e}(${t.join(", ")})=>${s}`}}class F{binding;initializer;constructor(e,t){this.binding=e,this.initializer=t}clone(){const e=this.binding.clone(),t=this.initializer?.clone();return new F(e,t)}toString(){return`${this.binding.toString()}${void 0!==this.initializer?`=${this.initializer.toString(!1)}`:""}`}}class V extends C{code;constructor(e){super(),this.code=e}clone(){return new V(this.code)}toString(){return this.code}}class D{identifier;visibility;location;constructor(e,t,s){this.identifier=e,this.visibility=t,this.location=s}is(e){return this.identifier===e}}class k extends D{parameters;body;constructor(e,t){super("constructor","public","instance"),this.parameters=e,this.body=t}clone(){const e=this.parameters.map(e=>e.clone()),t=this.body.clone();return new k(e,t)}toString(){const e=this.parameters.map(e=>e.toString()),t=this.body.toString();return`${this.identifier}(${e.join(",")}) ${t}`}}class j extends D{body;constructor(e,t,s,r){super(e,t,s),this.body=r}clone(){const e=this.body.clone();return new j(this.identifier,this.visibility,this.location,e)}toString(){const e="static"===this.location?"static ":"",t="private"===this.visibility?"#":"",s=this.body.toString();return`${e}get ${t}${this.identifier}()${s}`}}class B extends D{parameter;body;constructor(e,t,s,r,i){super(e,t,s),this.parameter=r,this.body=i}clone(){const e=this.parameter.clone(),t=this.body.clone();return new B(this.identifier,this.visibility,this.location,e,t)}toString(){const e="static"===this.location?"static ":"",t="private"===this.visibility?"#":"",s=this.parameter.toString(),r=this.body.toString();return`${e}set ${t}${this.identifier}(${s})${r}`}}class U extends D{parameters;body;isAsync;constructor(e,t,s,r,i,n=!1){super(e,t,s),this.parameters=r,this.body=i,this.isAsync=n}clone(){const e=this.parameters.map(e=>e.clone()),t=this.body.clone();return new U(this.identifier,this.visibility,this.location,e,t,this.isAsync)}toString(){const e="static"===this.location?"static ":"",t="private"===this.visibility?"#":"",s=this.isAsync?"async ":"",r=this.parameters.map(e=>e.toString()),i=this.body.toString();return`${e}${s}${t}${this.identifier}(${r.join(",")})${i}`}}class q extends D{initializer;constructor(e,t,s,r){super(e,t,s),this.initializer=r}clone(){const e=this.initializer?.clone();return new q(this.identifier,this.visibility,this.location,e)}toString(){const e="static"===this.location?"static ":"",t="private"===this.visibility?"#":"",s=void 0!==this.initializer?`=${this.initializer.toString(!0)}`:";";return`${e}${t}${this.identifier}${s}`}}class G extends ${parent;members;constructor(e,t,s){super(e),this.parent=t,this.members=s}get construct(){return this.members.find(e=>e instanceof k)}get fields(){return this.members.filter(e=>e instanceof q)}get getters(){return this.members.filter(e=>e instanceof j)}get setters(){return this.members.filter(e=>e instanceof B)}get methods(){return this.members.filter(e=>e instanceof U)}get publicFields(){return this.fields.filter(e=>"public"===e.visibility)}get publicGetters(){return this.getters.filter(e=>"public"===e.visibility)}get publicSetters(){return this.setters.filter(e=>"public"===e.visibility)}get publicMethods(){return this.methods.filter(e=>"public"===e.visibility)}get readable(){return[...this.publicFields,...this.publicGetters]}get writable(){return[...this.publicFields,...this.publicSetters]}getMember(e){return this.members.find(t=>t.is(e))}hasMember(e){return this.members.some(t=>t.is(e))}getField(e){return this.fields.find(t=>t.is(e))}hasField(e){return this.fields.some(t=>t.is(e))}getGetter(e){return this.getters.find(t=>t.is(e))}hasGetter(e){return this.getters.some(t=>t.is(e))}getSetter(e){return this.setters.find(t=>t.is(e))}hasSetter(e){return this.setters.some(t=>t.is(e))}getMethod(e){return this.methods.find(t=>t.is(e))}hasMethod(e){return this.methods.some(t=>t.is(e))}canRead(e){return this.readable.some(t=>t.is(e))}canWrite(e){return this.writable.some(t=>t.is(e))}clone(){const e=this.members.map(e=>e.clone());return new G(this.identifier,this.parent,e)}toString(){return`class ${this.identifier??""}${void 0!==this.parent?` extends ${this.parent}`:""}{${this.members.map(e=>e.toString()).join("")}}`}}class H extends C{members;from;constructor(e,t){super(),this.members=e,this.from=t}hasMember(e){return this.members.some(t=>t.is(e))}getMember(e){return this.members.find(t=>t.is(e))}clone(){const e=this.members.map(e=>e.clone());return new H(e,this.from)}toString(){const e=this.members.map(e=>e.toString()),t=this.from?` from '${this.from}'`:"";return`export {${e.join(",")}}${t};`}}class K extends C{code;constructor(e){super(),this.code=e}clone(){return new K(this.code)}toString(e=!0){const t=!1===e||this.code.endsWith("}")?"":";";return`${this.code}${t}`}}class _ extends L{clone(){const e=this.parameters.map(e=>e.clone()),t=this.body.clone();return new _(this.identifier,e,t,this.isAsync)}toString(){const e=this.isAsync?"async ":"",t=this.identifier??"",s=this.parameters.map(e=>e.toString()),r=this.body.toString();return`${e}function* ${t}(${s.join(",")})${r}`}}class W extends U{clone(){const e=this.parameters.map(e=>e.clone()),t=this.body.clone();return new W(this.identifier,this.visibility,this.location,e,t,this.isAsync)}toString(){const e=this.isAsync?"async ":"",t=this.identifier,s=this.parameters.map(e=>e.toString()),r=this.body.toString();return`${e}*${t}(${s.join(",")})${r}`}}class z extends x{identifier;isRest;constructor(e,t=!1){super(),this.identifier=e,this.isRest=t}clone(){return new z(this.identifier,this.isRest)}toString(){return`${this.isRest?"...":""}${this.identifier}`}}class Y extends C{members;from;constructor(e,t){super(),this.members=e,this.from=t}hasMember(e){return this.members.some(t=>t.is(e))}getMember(e){return this.members.find(t=>t.is(e))}clone(){const e=this.members.map(e=>e.clone());return new Y(e,this.from)}toString(){if(0===this.members.length)return`import '${this.from}';`;return`import {${this.members.map(e=>e.toString()).join(",")}} from '${this.from}';`}}class X extends ${type;binding;initializer;constructor(e,t,s){super(t.toString()),this.type=e,this.binding=t,this.initializer=s}clone(){const e=this.binding.clone(),t=this.initializer?.clone();return new X(this.type,e,t)}toString(){const e=void 0!==this.initializer?`=${this.initializer.toString(!0)}`:"",t=e.endsWith(";")?"":";";return`${this.type} ${this.identifier}${e}${t}`}}class Q{statements;constructor(e){this.statements=e}get exports(){return this.statements.filter(e=>e instanceof H)}get imports(){return this.statements.filter(e=>e instanceof Y)}get expressions(){return this.statements.filter(e=>e instanceof K)}get declarations(){return this.statements.filter(e=>e instanceof $)}get variables(){return this.statements.filter(e=>e instanceof X)}get functions(){return this.statements.filter(e=>e instanceof L)}get classes(){return this.statements.filter(e=>e instanceof G)}get exported(){const e=[];for(const t of this.exports)for(const s of t.members){const t=this.getDeclaration(s.identifier);void 0!==t&&e.push(t)}return e}get exportedVariables(){return this.exported.filter(e=>e instanceof X)}get exportedFunctions(){return this.exported.filter(e=>e instanceof L)}get exportedClasses(){return this.exported.filter(e=>e instanceof G)}getExport(e){return this.exports.find(t=>t.hasMember(e))}getImport(e){return this.imports.find(t=>t.hasMember(e))}hasDeclaration(e){return this.declarations.some(t=>t.is(e))}getDeclaration(e){return this.declarations.find(t=>t.is(e))}hasVariable(e){return this.variables.some(t=>t.is(e))}getVariable(e){return this.variables.find(t=>t.is(e))}hasFunction(e){return this.functions.some(t=>t.is(e))}getFunction(e){return this.functions.find(t=>t.is(e))}hasClass(e){return this.classes.some(t=>t.is(e))}getClass(e){return this.classes.find(t=>t.is(e))}clone(){const e=this.statements.map(e=>e.clone());return new Q(e)}toString(){return this.statements.map(e=>e.toString(!0)).join("\n")}}class J{identifier;alias;constructor(e,t){this.identifier=e,this.alias=t}is(e){return this.alias===e||void 0===this.alias&&this.identifier===e}clone(){return new J(this.identifier,this.alias)}toString(){return void 0===this.alias?this.identifier:`${this.identifier} as ${this.alias}`}}class Z extends x{elements;constructor(e){super(),this.elements=e}clone(){const e=this.elements.map(e=>e.clone());return new Z(e)}toString(){return`{${this.elements.map(e=>e.toString()).join(",")}}`}}const ee={SINGLE:"//",MULTI_START:"/*",MULTI_END:"*/"},te=Object.values(ee);const se=".",re="(",ie=")",ne="[",oe="]",ae="{",ce="}",ue="_",le={SCOPE:":",SEPARATOR:",",TERMINATOR:";"},he=Object.values(le);function pe(e){return he.includes(e)}const de={UNDEFINED:void 0,NULL:null,STRING:""},me=["null","undefined"],fe=Object.values(de);function ge(e){return fe.includes(e)}const Ee={OPEN:re,CLOSE:ie};function we(e){return e===Ee.OPEN||e===Ee.CLOSE}const ye={IMPORT:"import",EXPORT:"export",AS:"as",FROM:"from",DEFAULT:"default",ASYNC:"async",AWAIT:"await",USING:"using",CONST:"const",LET:"let",VAR:"var",FUNCTION:"function",RETURN:"return",YIELD:"yield",CLASS:"class",CONSTRUCTOR:"constructor",GET:"get",SET:"set",EXTENDS:"extends",STATIC:"static",NEW:"new",THIS:"this",DO:"do",WHILE:"while",FOR:"for",OF:"of",IN:"in",BREAK:"break",CONTINUE:"continue",IF:"if",ELSE:"else",SWITCH:"switch",CASE:"case",THROW:"throw",TRY:"try",CATCH:"catch",FINALLY:"finally"},Se=Object.values(ye),be=[ye.IMPORT,ye.EXPORT,ye.VAR,ye.LET,ye.CONST,ye.FUNCTION,ye.CLASS,ye.ASYNC],Ae=[ye.VAR,ye.LET,ye.CONST,ye.FUNCTION,ye.CLASS,ye.USING],Ie=[ye.AS,ye.ASYNC,ye.GET,ye.SET,ye.OF,ye.YIELD,ye.FROM,ye.STATIC];function ve(e){return be.includes(e)}function Te(e){return Ae.includes(e)}function Oe(e){return Ie.includes(e)}const Re={OPEN:ne,CLOSE:oe};function Ne(e){return e===Re.OPEN||e===Re.CLOSE}const xe=Object.values({SINGLE:"'",DOUBLE:'"',BACKTICK:"`"});function Me(e){return xe.includes(e)}const Ce={ADD:"+",ARROW:"=>",ASSIGN:"=",ASSIGN_ADD:"+=",ASSIGN_BITWISE_AND:"&=",ASSIGN_BITWISE_OR:"|=",ASSIGN_BITWISE_XOR:"^=",ASSIGN_DIVIDE:"/=",ASSIGN_EXPONENTIAL:"**=",ASSIGN_LEFT_SHIFT:"<<=",ASSIGN_LOGICAL_AND:"&&=",ASSIGN_LOGICAL_OR:"||=",ASSIGN_REMAINDER:"%=",ASSIGN_MULTIPLY:"*=",ASSIGN_NULLISH:"??=",ASSIGN_RIGHT_SHIFT:">>=",ASSIGN_SUBTRACT:"-=",BITWISE_AND:"&",BITWISE_OR:"|",BITWISE_NOT:"~",BITWISE_XOR:"^",DECREMENT:"--",DIVIDE:"/",EQUAL:"==",EQUAL_STRICT:"===",EXPONENTIAL:"**",GREATER:">",GREATER_EQUAL:">=",INCREMENT:"++",LEFT_SHIFT:"<<",LESS:"<",LESS_EQUAL:"<=",LOGICAL_AND:"&&",LOGICAL_OR:"||",REMAINDER:"%",MULTIPLY:"*",NULLISH:"??",CHAINING:".",OPTIONAL_CHAINING:"?.",SPREAD:"...",NOT:"!",NOT_EQUAL:"!=",NOT_EQUAL_STRICT:"!==",RIGHT_SHIFT:">>",SUBTRACT:"-",TERNARY:"?",$BRIDGE_CHAINING_SPREAD:".."},$e=Object.values(Ce);function Le(e){return $e.includes(e)}const Pe={OPEN:ae,CLOSE:ce};function Fe(e){return e===Pe.OPEN||e===Pe.CLOSE}const Ve={BOOLEAN:"boolean",COMMENT:"comment",DIVIDER:"divider",GROUP:"group",IDENTIFIER:"identifier",KEYWORD:"keyword",LIST:"list",LITERAL:"literal",NOTHING:"nothing",NUMBER:"number",OPERATOR:"operator",INDICATOR:"indicator",REGEX:"regex",SCOPE:"scope",WHITESPACE:"whitespace"},De={SPACE:" ",TAB:"\t",NEWLINE:"\n",CARRIAGE_RETURN:"\r"},ke=Object.values(De);function je(e){return ke.includes(e)}class Be{#w;#y;constructor(e){this.#w=e,this.#y=0}get items(){return this.#w}get position(){return this.#y}get size(){return this.#w.length}get eol(){return this.#y>=this.#w.length}get current(){return this.#w[this.#y]}get next(){return this.#w[this.#y+1]}get previous(){return this.#w[this.#y-1]}notAtEnd(){return!1===this.eol}get(e){return this.#w[e]}step(e=1){return this.#y+=e,this.current}stepBack(e=1){return this.#y-=e,this.current}hasNext(){return this.#y+1<this.#w.length}insert(...e){this.#w.splice(this.#y,0,...e)}}class Ue extends Be{constructor(e){super(e.split(""))}}class qe{#s;#S;#b;#A;constructor(e,t,s,r){this.#s=e,this.#S=t,this.#b=s,this.#A=r}get type(){return this.#s}get value(){return this.#S}get start(){return this.#b}get end(){return this.#A}isType(e){return this.#s===e}hasValue(e){return this.#S===e}toString(){return`${this.#S}`}}class Ge extends Be{}const He=["true","false"];const Ke=["0","1","2","3","4","5","6","7","8","9"],_e=[...Ke,"a","b","c","d","e","f","A","B","C","D","E","F"],We=["0","1"];function ze(e){return Ke.includes(e)}const Ye={GENERATOR:"*",PRIVATE:"#"},Xe=Object.values(Ye);class Qe{tokenize(e){const t=new Ue(e),s=[];let r;for(;t.notAtEnd();){const e=this.#I(t,r);if(void 0===e)break;e.isType(Ve.WHITESPACE)||e.isType(Ve.COMMENT)?t.step():(s.push(e),this.#v(e)&&(r=e),t.step())}return new Ge(s)}#v(e){return!1===[Ve.WHITESPACE,Ve.COMMENT].includes(e.type)}#I(e,t){const s=e.current,r=e.position;if(je(s)){const t=e.position;return new qe(Ve.WHITESPACE,s,r,t)}if(function(e){return te.includes(e)}(s+e.next)){const t=this.#T(e),s=e.position;return new qe(Ve.COMMENT,t,r,s)}if(this.#O(s,t)){const t=this.#R(e),s=e.position;return new qe(Ve.REGEX,t,r,s)}if(this.#N(e,t)){const t=this.#x(e),s=e.position;return new qe(Ve.NUMBER,t,r,s)}if(Me(s)){const t=this.#M(e),s=e.position;return new qe(Ve.LITERAL,t,r,s)}if(Le(s)){const t=this.#C(e),s=e.position;return new qe(Ve.OPERATOR,t,r,s)}if(function(e){return Xe.includes(e)}(s)){const t=this.#C(e),s=e.position;return new qe(Ve.INDICATOR,t,r,s)}if(pe(s)){const t=e.position;return new qe(Ve.DIVIDER,s,r,t)}if(we(s)){const t=e.position;return new qe(Ve.GROUP,s,r,t)}if(Fe(s)){const t=e.position;return new qe(Ve.SCOPE,s,r,t)}if(Ne(s)){const t=e.position;return new qe(Ve.LIST,s,r,t)}if(ge(s))return;const i=this.#$(e),n=e.position;return function(e){return Se.includes(e)}(i)?new qe(Ve.KEYWORD,i,r,n):function(e){return He.includes(e)}(i)?new qe(Ve.BOOLEAN,i,r,n):function(e){return me.includes(e)}(i)?new qe(Ve.NOTHING,i,r,n):new qe(Ve.IDENTIFIER,i,r,n)}#T(e){const t=e.current+e.next===ee.MULTI_START,s=t?ee.MULTI_END:De.NEWLINE;let r=t?ee.MULTI_START:ee.SINGLE;for(e.step(2);e.notAtEnd();){const i=e.current;if((t?i+e.next:i)===s){e.step(s.length-1);break}r+=i,e.step()}return t?r+ee.MULTI_END:r.trim()}#O(e,t){return e===Ce.DIVIDE&&(void 0===t||([Ve.OPERATOR,Ve.DIVIDER,Ve.KEYWORD].includes(t.type)||[Ee.OPEN,Re.OPEN].includes(t.value)))}#L(e){return je(e)||e==se||!1===this.#P(e)}#R(e){let t=e.current,s=!1;for(e.step();e.notAtEnd();){const r=e.current,i=e.previous;if(r===Ce.DIVIDE&&"\\"!==i)s=!0;else if(!0===s&&this.#L(r)){e.stepBack();break}t+=r,e.step()}return t}#N(e,t){const s=e.current,r=e.next;return!!ze(s)||s===Ce.SUBTRACT&&(!t?.isType(Ve.NUMBER)&&ze(r))}#F(e,t,s){return t?!1===(r=e,_e.includes(r))&&e!==ue:s?!1===function(e){return We.includes(e)}(e)&&e!==ue:!1===ze(e)&&e!==se&&e!==ue&&"e"!==e;var r}#x(e){let t=e.current;t===Ce.SUBTRACT&&(t+=e.step()),e.step();const s="x"===e.current,r="b"===e.current;for((s||r)&&(t+=e.current,e.step());e.notAtEnd();){const i=e.current;if(this.#F(i,s,r)){e.stepBack();break}t+=i,e.step()}return t}#M(e){const t=e.current;let s=t,r=!1;for(e.step();e.notAtEnd();){const i=e.current;if(!1===r){if(i===t){s+=i;break}"\\"===i&&(r=!0)}else r=!1;s+=i,e.step()}return s}#P(e){return!1===(ge(e)||je(e)||Le(e)||Me(e)||pe(e)||we(e)||Fe(e)||Ne(e))}#$(e){let t="";for(;e.notAtEnd();){const s=e.current;if(!1===this.#P(s)){e.stepBack();break}t+=s,e.step()}return t}#C(e){let t=e.current;for(e.step();e.notAtEnd();){const s=e.current;if(!1===Le(s)||!1===Le(t+s)){e.stepBack();break}t+=s,e.step()}return t}}class Je extends Error{constructor(e,t){super(`Expected keyword '${e}' at position ${t}`)}}class Ze extends Error{constructor(e,t){super(`Expected token '${e}' at position ${t}`)}}class et extends Error{constructor(e,t){super(`Unexpected keyword '${e}' at position ${t}`)}}class tt extends Error{constructor(e){super(`The given code does not contain ${e}`)}}class st extends Error{constructor(e,t){super(`Unexpected token '${e}' at position ${t}`)}}class rt{#V;constructor(e=[]){this.#V=e}get tokens(){return this.#V}append(...e){this.#V.push(...e)}merge(e){this.append(...e.tokens)}generate(){let e="",t=new qe(Ve.NOTHING,"",0,0);for(const s of this.#V){e+=`${this.#D(t,s)?" ":""}${s.value}`,t=s}return e}#D(e,t){return!(!e.isType(Ve.KEYWORD)||!this.#k(e))||!(!e.isType(Ve.OPERATOR)||!t.isType(Ve.OPERATOR))}#k(e){return Te(e.value)||e.hasValue(ye.RETURN)||e.hasValue(ye.ASYNC)||e.hasValue(ye.AWAIT)||e.hasValue(ye.YIELD)||e.hasValue(ye.NEW)||e.hasValue(ye.THROW)}}const it="default";class nt{#j;constructor(e=new Qe){this.#j=e}parse(e){const t=this.#j.tokenize(e),s=this.#B(t);return new Q(s)}parseStatement(e){const t=this.#j.tokenize(e),s=this.#U(t);if(void 0===s)throw new tt("a statement");return s}parseImport(e){const t=this.#j.tokenize(e),s=this.#q(t);if(s instanceof Y==!1)throw new tt("an import definition");return s}parseExport(e){const t=this.#j.tokenize(e),s=this.#q(t);if(s instanceof H==!1)throw new tt("an export definition");return s}parseVariable(e){const t=this.#j.tokenize(e),s=this.#q(t);if(s instanceof X==!1)throw new tt("a variable definition");return s}parseFunction(e){const t=this.#j.tokenize(e),s=this.#q(t);if(s instanceof L==!1)throw new tt("a function definition");return s}parseClass(e){const t=this.#j.tokenize(e),s=this.#q(t);if(s instanceof G==!1)throw new tt("a class definition");return s}#B(e){const t=[];for(;e.notAtEnd();){const s=this.#U(e);void 0!==s&&t.push(s)}return t}#U(e,t=!1){const s=e.current;if(this.#G(s))return this.#H(e);if(s.isType(Ve.IDENTIFIER)){const s=e.next;return s?.hasValue(Ce.ARROW)?this.#K(e,t):this.#H(e)}if(s.isType(Ve.KEYWORD)){if(Oe(s.value)){const t=e.next,r=void 0!==t&&(t.hasValue(ye.FUNCTION)||t.hasValue(Ee.OPEN));if(s.hasValue(ye.ASYNC)&&r)return e.step(),this.#U(e,!0);if(void 0===t||this.#_(t))return this.#H(e)}return s.hasValue(ye.RETURN)?this.#H(e):!1===ve(s.value)?this.#H(e):this.#q(e,t)}if(s.isType(Ve.REGEX))return this.#H(e);if(s.hasValue(Ee.OPEN)){const s=this.#W(e,Ee.OPEN,Ee.CLOSE);return s?.hasValue(Ce.ARROW)?this.#K(e,t):this.#H(e)}if(s.hasValue(Pe.OPEN))return this.#H(e);if(s.hasValue(Re.OPEN))return this.#H(e);if(s.hasValue(Ce.NOT)||s.hasValue(Ce.SUBTRACT))return this.#H(e);if(!pe(s.value))throw new st(s.value,s.start);e.step()}#G(e){return e.isType(Ve.LITERAL)||e.isType(Ve.NUMBER)||e.isType(Ve.BOOLEAN)||e.isType(Ve.NOTHING)||e.hasValue(ye.NEW)}#q(e,t=!1){const s=e.current;switch(e.step(),s.value){case ye.IMPORT:return this.#z(e);case ye.EXPORT:return this.#Y(e);case ye.CLASS:return this.#X(e);case ye.FUNCTION:return this.#Q(e,t);case ye.VAR:return this.#J(e,"var");case ye.LET:return this.#J(e,"let");case ye.CONST:return this.#J(e,"const");case ye.ASYNC:return this.#U(e,!0);default:throw new et(s.value,s.start)}}#z(e){const t=[];let s=e.current;if(s.isType(Ve.LITERAL)){const e=this.#Z(s.value);return new Y(t,e)}if(s.hasValue(Ee.OPEN)){s=e.step();const r=this.#Z(s.value);return e.step(2),new Y(t,r)}if(!1===s.hasValue(Pe.OPEN)){const r=s.hasValue(Ce.MULTIPLY)?Ce.MULTIPLY:it;let i=s.value;s=e.step(),s.hasValue(ye.AS)&&(s=e.step(),i=s.value,s=e.step()),t.push(new J(r,i))}if(s.hasValue(le.SEPARATOR)&&(s=e.step()),s.hasValue(Pe.OPEN)){const r=this.#ee(e);t.push(...r),s=e.current}if(!1===s.hasValue(ye.FROM))throw new Je(ye.FROM,s.start);s=e.step();const r=this.#Z(s.value);return e.step(),new Y(t,r)}#Y(e){switch(e.current.value){case ye.DEFAULT:return e.step(),this.#te(e,!0);case Pe.OPEN:return this.#se(e);default:return this.#te(e,!1)}}#te(e,t){let s=e.current,r=0;if(t&&this.#re(e)){const t=`$_EXPORT_${s.start}_${s.end}`;e.insert(new qe(Ve.KEYWORD,ye.CONST,0,0),new qe(Ve.IDENTIFIER,t,0,0),new qe(Ve.OPERATOR,Ce.ASSIGN,0,0)),s=e.current}s.hasValue(ye.ASYNC)&&(s=e.step(),r++),Te(s.value)&&(s=e.step(),r++);const i=this.#P(s)?s.value:"",n=t?it:void 0;let o;s=e.step(),s?.hasValue(ye.FROM)&&(s=e.step(),o=this.#Z(s.value)),r>0&&(r++,e.stepBack(r));const a=new J(i,n);return new H([a],o)}#re(e){const t=e.current;if(this.#G(t))return!0;const s=e.next;return this.#P(t)&&s?.hasValue(Ee.OPEN)}#se(e){const t=this.#ee(e);let s,r=e.current;return r?.hasValue(ye.FROM)&&(r=e.step(),s=this.#Z(r.value)),e.step(),new H(t,s)}#Z(e){return e.slice(1,-1)}#ee(e){const t=[];let s=e.step();for(;e.notAtEnd();){if(s.hasValue(Pe.CLOSE)){e.step();break}if(s.hasValue(le.SEPARATOR)){s=e.step();continue}const r=this.#ie(e);t.push(r),s=e.step()}return t}#ie(e){let t=e.current;const s=t.value;let r;return e.next.hasValue(ye.AS)&&(t=e.step(2),r=t.value),new J(s,r)}#J(e,t){const s=this.#ne(e),r=this.#oe(e);return new X(t,s,r)}#ne(e){const t=e.current;return t.hasValue(Re.OPEN)?this.#ae(e):t.hasValue(Pe.OPEN)?this.#ce(e):this.#ue(e)}#ae(e){const t=this.#le(e,Re.CLOSE);return new M(t)}#ce(e){const t=this.#le(e,Pe.CLOSE);return new Z(t)}#le(e,t){const s=[];for(e.step();e.notAtEnd();){const r=e.current;if(r.hasValue(t)){e.step();break}if(r.hasValue(le.SEPARATOR)){e.step();continue}const i=this.#ne(e),n=this.#oe(e),o=new F(i,n);s.push(o)}return s}#ue(e){let t=e.current,s=!1;t.hasValue(Ce.SPREAD)&&(s=!0,t=e.step());const r=t.value;return e.step(),new z(r,s)}#oe(e){const t=e.current;if(!1!==t.hasValue(Ce.ASSIGN))return e.step(),this.#U(e,!1);t.hasValue(le.TERMINATOR)&&e.step()}#Q(e,t){let s,r=e.current,i=!1;r.hasValue(Ye.GENERATOR)&&(i=!0,r=e.step()),this.#P(r)&&(s=r.value,e.step());const n=this.#le(e,Ee.CLOSE);if(r=e.current,!1===r.hasValue(Pe.OPEN))throw new Ze(Pe.OPEN,r.start);const o=this.#he(e);return i?new _(s,n,o,t):new L(s,n,o,t)}#K(e,t){let s,r,i=e.current;if(i.hasValue(Ee.OPEN))s=this.#le(e,Ee.CLOSE);else{const t=this.#ue(e);s=[new F(t,void 0)]}if(i=e.current,!1===i.hasValue(Ce.ARROW))throw new Ze(Ce.ARROW,i.start);if(i=e.step(),i.hasValue(Pe.OPEN))r=this.#he(e);else{const t=this.#H(e);r=new V(t.code)}return new P(s,r,t)}#X(e){let t,s,r=e.current;if(this.#P(r)&&(t=r.value,r=e.step()),r.hasValue(ye.EXTENDS)&&(r=e.step(),s=r.value,r=e.step()),!1===r.hasValue(Pe.OPEN))throw new Ze(Pe.OPEN,r.start);const i=this.#pe(e);return new G(t,s,i)}#pe(e){let t=e.step();const s=[];for(;e.notAtEnd();){if(t.hasValue(Pe.CLOSE)){e.step();break}const r=this.#de(e);s.push(r),t=e.current}return s}#de(e){let t=e.current,s="public",r="instance",i=!1;for(;e.notAtEnd();){if(t.hasValue(Ye.PRIVATE))s="private";else if(t.hasValue(ye.STATIC))r="static";else{if(!t.hasValue(ye.ASYNC)){if(t.hasValue(ye.CONSTRUCTOR))return this.#me(e);if(t.hasValue(ye.GET))return this.#fe(e,r);if(t.hasValue(ye.SET))return this.#ge(e,r);if(t.hasValue(Ye.GENERATOR))return e.step(),this.#Ee(e,s,r,i,!0);break}i=!0}t=e.step()}return e.next.hasValue(Ee.OPEN)?this.#Ee(e,s,r,i,!1):this.#we(e,s,r)}#me(e){e.step();const t=this.#le(e,Ee.CLOSE),s=e.current;if(!1===s.hasValue(Pe.OPEN))throw new Ze(Pe.OPEN,s.start);const r=this.#he(e);return new k(t,r)}#fe(e,t){let s="public",r=e.step();r.hasValue(Ye.PRIVATE)&&(s="private",r=e.step());const i=r.value;e.step();if(0!==this.#le(e,Ee.CLOSE).length)throw new tt("an empty parameter list");if(r=e.current,!1===r.hasValue(Pe.OPEN))throw new Ze(Pe.OPEN,r.start);const n=this.#he(e);return new j(i,s,t,n)}#ge(e,t){let s="public",r=e.step();r.hasValue(Ye.PRIVATE)&&(s="private",r=e.step());const i=r.value;e.step();const n=this.#le(e,Ee.CLOSE);if(r=e.current,1!==n.length)throw new tt("exactly one setter parameter");if(!1===r.hasValue(Pe.OPEN))throw new Ze(Pe.OPEN,r.start);const o=this.#he(e);return new B(i,s,t,n[0],o)}#Ee(e,t,s,r,i){let n=e.current;const o=n.value;e.step();const a=this.#le(e,Ee.CLOSE);if(n=e.current,!1===n.hasValue(Pe.OPEN))throw new Ze(Pe.OPEN,n.start);const c=this.#he(e);return i?new W(o,t,s,a,c,r):new U(o,t,s,a,c,r)}#we(e,t,s){const r=e.current.value;e.step();const i=this.#oe(e);return new q(r,t,s,i)}#he(e){const t=this.#ye(e,Pe.OPEN,Pe.CLOSE).generate();return new V(t)}#H(e){const t=new rt;let s=e.current;for(;e.notAtEnd();){if(s.hasValue(Re.OPEN)){const r=this.#ye(e,Re.OPEN,Re.CLOSE);t.merge(r),s=e.current}else if(s.hasValue(Ee.OPEN)){const r=this.#ye(e,Ee.OPEN,Ee.CLOSE);t.merge(r),s=e.current}else if(s.hasValue(Pe.OPEN)){const r=this.#ye(e,Pe.OPEN,Pe.CLOSE);t.merge(r),s=e.current}else t.append(s),s=e.step();if(void 0===s)break;if(this.#_(s)){s.hasValue(le.TERMINATOR)&&e.step();break}}const r=t.generate();return new K(r)}#ye(e,t,s){let r=e.current;const i=new rt([r]);for(r=e.step();e.notAtEnd();){if(r.hasValue(t)){const n=this.#ye(e,t,s);i.merge(n),r=e.current;continue}if(r.hasValue(s))return e.step(),i.append(r),i;i.append(r),r=e.step()}return i}#W(e,t,s){const r=e.position;this.#ye(e,t,s);const i=e.current,n=e.position;return e.stepBack(n-r),i}#_(e){return[le.TERMINATOR,le.SEPARATOR].includes(e.value)||[Re.CLOSE,Ee.CLOSE,Pe.CLOSE].includes(e.value)||ve(e.value)}#P(e){return e.isType(Ve.IDENTIFIER)||e.isType(Ve.KEYWORD)&&Oe(e.value)}}let ot=class extends Error{constructor(e,t){super(`Failed to load module file '${e}' because of: ${t}`)}};class at{#p;#d=new v;constructor(e){this.#p=e}rewrite(e,t){e.imports.forEach(e=>this.#Se(e,t)),e.exports.forEach(e=>this.#be(e,t))}#Se(e,t){const s=this.#p.normalizeLocation(e.from);!1!==this.#d.isApplicationModule(s)&&(e.from=this.#Ae(t,s))}#be(e,t){if(void 0===e.from)return;const s=this.#p.normalizeLocation(e.from);!1!==this.#d.isApplicationModule(s)&&(e.from=this.#Ae(t,s))}#Ae(e,t){const s=this.#d.extractPath(e),r=this.#d.makePathAbsolute(t,s,"");return this.#p.isDirectory(r)?`${t}/${E}`:this.#d.assureExtension(t)}}let ct=class{#p;#Ie;#ve;constructor(e,t=new nt){this.#p=e,this.#Ie=t,this.#ve=new at(e)}async readAll(e){const t=await Promise.all(e.map(e=>this.read(e)));return new N(t)}async read(e){try{const t=this.#p.getRelativeLocation(e),s=await this.#Te(e),r=this.#Ie.parse(s);return this.#ve.rewrite(r,t),new R(t,r)}catch(t){const s=t instanceof Error?t.message:String(t);throw new ot(e,s)}}async#Te(e){return(await this.#p.getContent(e)).toString()}},ut=class{#Oe;#E=new Map;#Re=new Map;#Ne=new Map;constructor(e){this.#Oe=e}get name(){return this.#Oe}get modules(){return[...this.#E.values()]}get classes(){return[...this.#Re.values()]}get procedures(){return[...this.#Ne.values()]}hasModule(e){return this.#E.has(e)}getModule(e){return this.#E.get(e)}getSegmentedModules(){return this.modules.filter(e=>e.segmented)}setModule(e){this.#E.set(e.filename,e)}hasProcedure(e){return this.#Ne.has(e)}getProcedure(e){return this.#Ne.get(e)}setProcedure(e){this.#Ne.set(e.fqn,e)}setClass(e){this.#Re.set(e.fqn,e)}};class lt{#l;#xe;#Me;constructor(e,t,s){this.#l=e,this.#xe=t,this.#Me=s}get id(){return this.#l}get importKey(){return this.#xe}get fqn(){return this.#Me}}class ht extends lt{#g;constructor(e,t,s,r){super(e,t,s),this.#g=r}get model(){return this.#g}}class pt extends lt{#Ce;#$e;#g;constructor(e,t,s,r,i,n){super(e,t,s),this.#Ce=r,this.#$e=i,this.#g=n}get access(){return this.#Ce}get version(){return this.#$e}get model(){return this.#g}}class dt{#t;#e;#Le;#Pe=[];#Fe;constructor(e,t,s,r){this.#t=e,this.#e=t,this.#Le=s,this.#Fe=r}get filename(){return this.#t}get location(){return this.#e}get imports(){return this.#Le}get members(){return this.#Pe}get segmented(){return this.#Fe}hasClasses(){return this.#Pe.some(e=>e instanceof ht)}getClasses(){return this.#Pe.filter(e=>e instanceof ht)}hasImplementations(){return this.#Pe.some(e=>e instanceof pt)}getImplementations(){return this.#Pe.filter(e=>e instanceof pt)}addMember(e){this.#Pe.push(e)}addImports(e){const t=Object.keys(e);for(const s of t){const t=s.trim();this.#Le[t]=e[s]}}}class mt{#Me;#Ve=[];constructor(e,t=[]){this.#Me=e,this.#Ve=t}get fqn(){return this.#Me}get implementations(){return this.#Ve}addImplementation(e){this.#Ve.push(e)}}class ft{#De;constructor(e){this.#De=e}get segments(){return this.#De}getSegment(e){return this.#De.find(t=>t.name===e)}isSegmentedModule(e){return this.#De.some(t=>t.hasModule(e))}getSegments(e){return this.#De.filter(t=>t.hasModule(e))}}class gt extends Error{constructor(e,t){super(`Function '${t}' from file '${e}' is not async`)}}class Et extends Error{constructor(e){super(`Segment filename '${e}' is invalid`)}}class wt extends Error{constructor(e,t){super(`Failed to load segment file '${e}' because of: ${t}`)}}class yt extends Error{constructor(e,t){super(`The export '${t}' from file '${e}' is not a function or a class.`)}}class St extends Error{constructor(e,t){super(`Module '${e}' does not export '${t}'`)}}class bt extends Error{constructor(e){super(`Segmented module not found '${e}'`)}}class At{#a;#d=new v;constructor(e){this.#a=e}locate(e,t){const s=[];return{trace:s,model:this.#ke(e,t,s)}}#ke(e,t,s){s.push({filename:e,importKey:t});const r=this.#je(e);return this.#Be(r,t)?this.#Ue(r,t,s):this.#qe(r,t)}#je(e){const t=this.#a.get(e);if(void 0===t)throw new bt(e);return t}#Be(e,t){const s=e.model.getImport(t),r=e.model.getExport(t);return void 0!==s||void 0!==r?.from}#Ue(e,t,s){const r=this.#Ge(e,t)??this.#He(e,t),i=r?.from,n=r?.name,o=this.#d.extractPath(e.filename),a=i,c=this.#d.makePathAbsolute(a,o,"");return this.#ke(c,n,s)}#qe(e,t){const s=this.#He(e,t);if(void 0===s)throw new St(e.filename,t);const r=e.model.getDeclaration(s.name);if(void 0===r)throw new St(e.filename,s.name);return r}#He(e,t){const s=e.model.getExport(t),r=s?.getMember(t);if(void 0!==r)return{from:s?.from,name:r.identifier}}#Ge(e,t){const s=e.model.getImport(t),r=s?.getMember(t);if(void 0!==s&&void 0!==r)return{from:s.from,name:r.identifier}}}class It{#Ke;#p;#_e;#d=new v;constructor(e,t,s){this.#Ke=e,this.#p=t,this.#_e=new At(s)}async readAll(e){const t=await Promise.all(e.map(e=>this.#We(e)));return new ft(t)}async#We(e){const t=await this.#ze(e),s=this.#Ye(e),r=new ut(s);return this.#Xe(r,t),this.#Qe(r),r}#Ye(e){const t=e.split("/").pop();if(void 0===t||""===t)throw new Et(e);return t.replace(w,"")}async#ze(e){try{const t=await this.#Ke.getContent(e);return JSON.parse(t.toString())}catch(t){const s=t instanceof Error?t.message:String(t);throw new wt(e,s)}}#Xe(e,t){for(const[s,r]of Object.entries(t))this.#Je(e,s,r,!0)}#Je(e,t,s,r){const i=this.#Ze(t),n=this.#d.extractPath(i),o=e.hasModule(i)?e.getModule(i):new dt(i,n,{},r);o.addImports(s),e.setModule(o)}#Ze(e){const t=e.trim(),s=this.#p.normalizeLocation(t),r=this.#p.isDirectory(s)?`${s}/${E}`:this.#d.assureExtension(s);return r.startsWith("./")?r.substring(2):r.startsWith("/")?r.substring(1):r}#Qe(e){const t=new S;for(const s of e.modules)for(const r in s.imports)this.#et(e,s,r,t)}#et(e,t,s,r){const{model:i,trace:n}=this.#_e.locate(t.filename,s),o=this.#tt(t,i,s,r);this.#st(e,t,i,o),n.shift();for(const t of n){const s={[t.importKey]:{access:o.access}};this.#Je(e,t.filename,s,!1)}}#tt(e,t,s,r){const i=e.imports[s],n=r.next(),o=i.as??t.identifier;return{id:n,importKey:s,name:o,access:i.access??f,version:i.version??g,fqn:this.#rt(e,o,s)}}#rt(e,t,s){return this.#it(e)?t:this.#nt(e)&&this.#ot(s)?e.location:`${e.location}/${t}`}#it(e){return""===e.location}#nt(e){return e.filename.endsWith(E)}#ot(e){return e===y}#st(e,t,s,r){if(s instanceof G)return this.#at(e,t,s,r);if(s instanceof L)return this.#ct(e,t,s,r);throw new yt(t.filename,r.importKey)}#at(e,t,s,r){const i=new ht(r.id,r.importKey,r.fqn,s);t.addMember(i),e.setClass(i)}#ct(e,t,s,r){if(!1===s.isAsync)throw new gt(t.filename,r.name);const i=new pt(r.id,r.importKey,r.fqn,r.access,r.version,s);this.#ut(e,t,i)}#ut(e,t,s){const r=e.hasProcedure(s.fqn)?e.getProcedure(s.fqn):new mt(s.fqn);r.addImplementation(s),t.addMember(s),e.setProcedure(r)}}class vt{#lt;constructor(e){this.#lt=e}async read(e,t,s){const r=this.#lt.source,i=this.#lt.resource,n=this.#lt.segment,o=new ct(r),a=await o.readAll(e),c=new O(i,r),u=await c.readAll(t),l=new It(n,r,a),h=await l.readAll(s);return new d(a,u,h)}}class Tt extends Error{constructor(e){super(`Could not find the rewrite item: ${e}`)}}class Ot{#ht;#c;#u;#pt;#d=new v;constructor(e,t,s,r){this.#ht=e,this.#c=t,this.#u=s,this.#pt=r}generate(){const e=this.#ht.model.clone();return this.#dt(e,e.imports),this.#dt(e,e.exports),e.toString()}#dt(e,t){for(const s of t){const t=this.#mt(s);if(0===t.length)continue;const r=e.statements.indexOf(s);if(-1===r)throw new Tt(s.toString());e.statements.splice(r,1,...t)}}#mt(e){if(this.#ft(e))return[];const t=this.#gt(e);return this.#c.isResourceModule(t)?this.#Et(e,t):this.#wt(e,t)}#ft(e){return void 0===e.from||this.#yt(e)}#yt(e){return!1===this.#d.isApplicationModule(e.from)}#gt(e){const t=e.from,s=this.#d.extractPath(this.#ht.filename);return this.#d.makePathAbsolute(t,s,"")}#Et(e,t){const s=e.clone();return s.from=this.#St(t),[s]}#wt(e,t){if(0===e.members.length)return[this.#bt(t,e,[])];const{segmentKeys:s,remoteKeys:r,commonKeys:i}=this.#At(t,e),n=[];return s.length>0&&n.push(this.#It(t,e,s)),r.length>0&&n.push(this.#vt(t,e,r)),i.length>0&&n.push(this.#bt(t,e,i)),n}#At(e,t){const s=this.#Tt(e,this.#pt),r=this.#Ot(e,s),i=this.#Rt(t,s),n=this.#Rt(t,r);return{segmentKeys:i,remoteKeys:n,commonKeys:this.#Nt(t,[...i,...n])}}#Tt(e,t){if(void 0===t)return[];const s=t.getModule(e);return void 0===s?[]:Object.keys(s.imports)}#Ot(e,t){const s=this.#u.getSegments(e).filter(e=>e!==this.#pt).flatMap(t=>this.#Tt(e,t));return[...new Set(s)].filter(e=>!1===t.includes(e))}#Rt(e,t){return e.members.filter(e=>t.includes(e.identifier)).map(e=>e.identifier)}#Nt(e,t){return e.members.filter(e=>!1===t.includes(e.identifier)).map(e=>e.identifier)}#It(e,t,s){const r=t.clone();return r.from=this.#St(e,this.#pt?.name),r.members=this.#xt(t.members,s),r}#vt(e,t,s){const r=t.clone();return r.from=this.#St(e,"remote"),r.members=this.#xt(t.members,s),r}#bt(e,t,s){const r=t.clone();return r.from=this.#St(e),r.members=this.#xt(t.members,s),r}#xt(e,t){const s=[];for(const r of t){const t=e.find(e=>e.identifier===r);void 0!==t&&s.push(t)}return s}#St(e,t){const s=this.#d.extractPath(this.#ht.filename),r=this.#d.makePathRelative(e,s);return void 0!==t?this.#d.addSubExtension(r,t):r}}const Rt={PRIVATE:"private",PROTECTED:"protected",PUBLIC:"public"};class Nt extends Error{constructor(e="Invalid request"){super(e)}}class xt extends Error{constructor(e="Forbidden"){super(e)}}class Mt extends Error{constructor(e="Not found"){super(e)}}class Ct extends Error{constructor(e="Not implemented"){super(e)}}class $t extends Error{constructor(e="Payment required"){super(e)}}class Lt extends Error{constructor(e="Server error"){super(e)}}class Pt extends Error{constructor(e="I'm a teapot"){super(e)}}class Ft extends Error{constructor(e="Unauthorized"){super(e)}}class Vt{#l;#Re=new Map;#Ne=new Map;constructor(e){this.#l=e}get id(){return this.#l}addClass(e){return this.#Re.set(e.fqn,e),this}hasClass(e){return void 0!==this.getClass(e)}getClass(e){return this.#Re.get(e)}getClassByImplementation(e){return this.getClasses().find(t=>t.implementation===e)}getClasses(){return[...this.#Re.values()]}addProcedure(e){return this.#Ne.set(e.fqn,e),this}hasProcedure(e){return this.#Ne.has(e)}getProcedure(e){return this.#Ne.get(e)}getExposedProcedures(){return[...this.#Ne.values()].filter(e=>e.public||e.protected)}}class Dt{static get DEFAULT(){return new Dt(0,0,0)}#Mt;#Ct;#$t;constructor(e=0,t=0,s=0){this.#Mt=e,this.#Ct=t,this.#$t=s}get major(){return this.#Mt}get minor(){return this.#Ct}get patch(){return this.#$t}equals(e){return this.#Mt===e.major&&this.#Ct===e.minor&&this.#$t===e.patch}greater(e){return this.#Mt!==e.major?this.#Mt>e.major:this.#Ct!==e.minor?this.#Ct>e.minor:this.#$t!==e.patch&&this.#$t>e.patch}less(e){return this.#Mt!==e.major?this.#Mt<e.major:this.#Ct!==e.minor?this.#Ct<e.minor:this.#$t!==e.patch&&this.#$t<e.patch}toString(){return`${this.#Mt}.${this.#Ct}.${this.#$t}`}}class kt{#Oe;#Lt;constructor(e,t=!1){this.#Oe=e,this.#Lt=t}get name(){return this.#Oe}get isOptional(){return this.#Lt}}class jt extends kt{}class Bt extends kt{#Pt;constructor(e,t,s){super(t??"(anonymous)",s),this.#Pt=e}get variables(){return this.#Pt}}class Ut extends Bt{}class qt extends Bt{}class Gt{#Me;#$e;#Ft;#Vt=new Map;#Dt;constructor(e,t,s,r,i){this.#Me=e,this.#$e=t,this.#Ft=s,this.#Vt=r,this.#Dt=i}get fqn(){return this.#Me}get version(){return this.#$e}get args(){return this.#Ft}get headers(){return this.#Vt}get mode(){return this.#Dt}clearArguments(){this.#Ft.clear()}setArgument(e,t){this.#Ft.set(e,t)}getArgument(e){return this.#Ft.get(e)}hasArgument(e){return this.#Ft.has(e)}removeArgument(e){this.#Ft.delete(e)}clearHeaders(){this.#Vt.clear()}setHeader(e,t){this.#Vt.set(e.toLowerCase(),t)}getHeader(e){return this.#Vt.get(e.toLowerCase())}hasHeader(e){return this.#Vt.has(e.toLowerCase())}removeHeader(e){this.#Vt.delete(e.toLowerCase())}}class Ht{#kt;#jt;#Vt;constructor(e,t=void 0,s=new Map){this.#kt=e,this.#jt=t,this.#Vt=s}get status(){return this.#kt}get result(){return this.#jt}set result(e){this.#jt=e}get headers(){return this.#Vt}clearHeaders(){this.#Vt.clear()}setHeader(e,t){this.#Vt.set(e.toLowerCase(),t)}getHeader(e){return this.#Vt.get(e.toLowerCase())}hasHeader(e){return this.#Vt.has(e.toLowerCase())}removeHeader(e){this.#Vt.delete(e.toLowerCase())}}class Kt{#ht;#De;constructor(e,t){this.#ht=e,this.#De=t}generate(){const e=[],t=this.#Bt();for(const s of t){const t=s.access===Rt.PRIVATE?this.#Ut(s):this.#qt(s);e.push(...t)}return new Q(e).toString()}#Bt(){const e=this.#De.map(e=>e.getModule(this.#ht.filename)).flatMap(e=>e.getImplementations()),t=new Map;for(const s of e){const e=`${s.fqn}:${s.version.toString()}`;t.set(e,s)}return[...t.values()]}#Ut(e){const t=`throw new ProcedureNotAccessible('${e.fqn}','${e.version}');`;return[this.#Gt(e),this.#Ht(e,t)]}#qt(e){const t=`return __run('${e.fqn}','${e.version}',{${this.#Kt(e.model.parameters)}},this);`;return[this.#Gt(e),this.#Ht(e,t)]}#Gt(e){const t=e.model.identifier,s=e.importKey===y?y:void 0,r=new J(t,s);return new H([r],void 0)}#Ht(e,t){const s=e.model.identifier,r=e.model.parameters,i=new V(`{${t}}`),n=e.model.isAsync;return new L(s,r,i,n)}#Kt(e){return this.#_t(e).join(",")}#_t(e){const t=[];for(const s of e)if(s.binding instanceof z){const e=this.#Wt(s.binding);t.push(e)}else if(s.binding instanceof M){const e=this.#_t(s.binding.elements);t.push(...e)}else if(s.binding instanceof Z){const e=this.#_t(s.binding.elements);t.push(...e)}return t}#Wt(e){return`'${e.identifier}':${e.toString()}`}}class _t{#zt;#Yt;#Xt;#pt;constructor(e,t,s,r){this.#zt=e,this.#Yt=t,this.#Xt=s,this.#pt=r}get source(){return this.#zt}get target(){return this.#Yt}get resource(){return this.#Xt}get segment(){return this.#pt}}class Wt{#Qt;constructor(e=!0){this.#Qt=e}validate(e,t){const s=[];this.#Jt("",e,t,s);return{valid:0===s.length,errors:s}}#Jt(e,t,s,r){this.#Qt&&this.#Zt(e,t,s,r),this.#es(e,t,s,r)}#Zt(e,t,s,r){const i=Object.keys(t),n=Object.keys(s);for(const t of i)if(!1===n.includes(t)){const s=this.#ts(e,t);r.push(`Unknown field '${s}'`)}}#es(e,t,s,r){const i=Object.keys(s);for(const n of i){const i=this.#ts(e,n),o=s[n],a=t[n];this.#ss(i,a,o,r)}}#ss(e,t,s,r){if(void 0!==t)switch(s.type){case"string":return this.#rs(e,t,s,r);case"integer":return this.#is(e,t,s,r);case"real":return this.#ns(e,t,s,r);case"boolean":return this.#os(e,t,s,r);case"url":return this.#as(e,t,s,r);case"group":return this.#cs(e,t,s,r);case"list":return this.#us(e,t,s,r)}else!0===s.required&&r.push(`Field '${e}' is required`)}#rs(e,t,s,r){"string"!=typeof t&&r.push(`Field '${e}' is not a string`)}#is(e,t,s,r){"number"==typeof t&&!1!==Number.isInteger(t)||r.push(`Field '${e}' is not an integer`)}#ns(e,t,s,r){"number"!=typeof t&&r.push(`Field '${e}' is not a real number`)}#os(e,t,s,r){"boolean"!=typeof t&&r.push(`Field '${e}' is not a boolean`)}#as(e,t,s,r){"string"==typeof t&&!1!==t.startsWith("http")||r.push(`Field '${e}' is not a valid URL`)}#cs(e,t,s,r){"object"==typeof t?this.#Jt(e,t,s.fields,r):r.push(`Field '${e}' is not an object`)}#us(e,t,s,r){if(!Array.isArray(t))return void r.push(`Field '${e}' is not a list`);const i=t;for(const t in i){const n=this.#ts(e,t),o=i[t];this.#ss(n,o,s.items,r)}}#ts(e,t){return""===e?t:`${e}.${t}`}}class zt{#ls;constructor(e){this.#ls=e}async configure(e){const t=this.#ls.getAbsoluteLocation(e);n.config({path:t})}}class Yt extends Error{constructor(e){super(`Runtime configuration is invalid:\n${e.errors.join("\n")}`)}}const Xt="./jitar.json",Qt="./src",Jt="./dist",Zt="./segments",es="./resources",ts={source:{type:"string",required:!1},target:{type:"string",required:!1},segments:{type:"string",required:!1},resources:{type:"string",required:!1}};let ss=class{#hs;#ps;constructor(e,t){this.#hs=e,this.#ps=t}async build(e=Xt){const t=await this.#hs.read(e),s=this.#ps.validate(t,ts);if(!1===s.valid)throw new Yt(s);return t.source??=Qt,t.target??=Jt,t.segments??=Zt,t.resources??=es,t.meta={root:this.#hs.getRootLocation(),configFile:e},t}};const rs="\n => ";class is extends Error{constructor(e){const t=e.errors.join(rs);super(`Invalid server configuration:${rs}${t}`)}}const ns={indexFilename:{type:"string",required:!1},serveIndexOnNotFound:{type:"boolean",required:!1},assetRoot:{type:"string",required:!1},assets:{type:"list",required:!1,items:{type:"string"}}},os={gateway:{type:"url",required:!1},segments:{type:"list",required:!0,items:{type:"string"}},trustKey:{type:"string",required:!1},reportInterval:{type:"integer",required:!1}},as={url:{type:"url",required:!0},setUp:{type:"list",required:!1,items:{type:"string"}},tearDown:{type:"list",required:!1,items:{type:"string"}},middleware:{type:"list",required:!1,items:{type:"string"}},healthChecks:{type:"list",required:!1,items:{type:"string"}},gateway:{type:"group",required:!1,fields:{monitorInterval:{type:"integer",required:!1},trustKey:{type:"string",required:!1}}},proxy:{type:"group",required:!1,fields:{gateway:{type:"url",required:!0},repository:{type:"url",required:!0}}},repository:{type:"group",required:!1,fields:ns},standalone:{type:"group",required:!1,fields:{...ns,segments:os.segments}},worker:{type:"group",required:!1,fields:os},remoteWorker:{type:"group",required:!1,fields:{unavailableThreshold:{type:"integer",required:!1},stoppedThreshold:{type:"integer",required:!1}}}};class cs{#hs;#ps;constructor(e,t){this.#hs=e,this.#ps=t}async build(e){const t=await this.#hs.read(e),s=this.#ps.validate(t,as);if(!1===s.valid)throw new is(s);return t.meta={root:this.#hs.getRootLocation(),configFile:e},t}}class us extends Error{constructor(e){super(`${e} is not a valid configuration file.`)}}const ls=/\${([^}]*)}/g;class hs{#ls;constructor(e){this.#ls=e}getRootLocation(){return this.#ls.getAbsoluteLocation(".")}async read(e){if(!1===await this.#ls.exists(e))return{};const t=await this.#ls.read(e);if(!1===t.type.includes("json"))throw new us(e);const s=t.content.toString(),r=this.#ds(s);return this.#ms(r)}#ds(e){return e.replace(ls,(e,t)=>process.env[t]??"null")}#ms(e){return JSON.parse(e)}}class ps{#fs;#gs;#Es;constructor(e="./"){const t=new p(e),s=new hs(t),r=new Wt;this.#fs=new zt(t),this.#gs=new ss(s,r),this.#Es=new cs(s,r)}configureEnvironment(e=".env"){return this.#fs.configure(e)}getRuntimeConfiguration(e){return this.#gs.build(e)}getServerConfiguration(e){return this.#Es.build(e)}}export{Ut as A,Nt as B,ps as C,c as D,G as E,xt as F,Gt as G,Rt as H,p as L,Mt as N,qt as O,nt as P,Ht as R,Lt as S,Pt as T,Ft as U,Dt as V,z as a,K as b,X as c,Q as d,q as e,k as f,j as g,B as h,U as i,jt as j,Ct as k,$t as l,Vt as m,v as n,Ot as o,Kt as p,Y as q,J as r,H as s,M as t,Z as u,_t as v,vt as w,o as x,Wt as y,u as z};
@@ -1,25 +0,0 @@
1
- # Logs
2
- logs
3
- *.log
4
- npm-debug.log*
5
- yarn-debug.log*
6
- yarn-error.log*
7
- pnpm-debug.log*
8
- lerna-debug.log*
9
-
10
- node_modules
11
- .jitar
12
- dist
13
- dist-ssr
14
- *.local
15
-
16
- # Editor directories and files
17
- .vscode/*
18
- !.vscode/extensions.json
19
- .idea
20
- .DS_Store
21
- *.suo
22
- *.ntvs*
23
- *.njsproj
24
- *.sln
25
- *.sw?
@@ -1,20 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ESNext",
4
- "module": "ESNext",
5
- "rootDir": "./src/",
6
- "moduleResolution": "node",
7
- "outDir": "./dist",
8
- "removeComments": true,
9
- "forceConsistentCasingInFileNames": true,
10
- "strict": true,
11
- "skipLibCheck": true
12
- },
13
- "exclude": [
14
- "cache",
15
- "dist",
16
- "node_modules",
17
- "segments",
18
- "services"
19
- ]
20
- }
@@ -1,25 +0,0 @@
1
- # Logs
2
- logs
3
- *.log
4
- npm-debug.log*
5
- yarn-debug.log*
6
- yarn-error.log*
7
- pnpm-debug.log*
8
- lerna-debug.log*
9
-
10
- node_modules
11
- .jitar
12
- dist
13
- dist-ssr
14
- *.local
15
-
16
- # Editor directories and files
17
- .vscode/*
18
- !.vscode/extensions.json
19
- .idea
20
- .DS_Store
21
- *.suo
22
- *.ntvs*
23
- *.njsproj
24
- *.sln
25
- *.sw?
@@ -1,28 +0,0 @@
1
- {
2
- "name": "jitar-react-starter",
3
- "private": true,
4
- "version": "0.0.0",
5
- "type": "module",
6
- "scripts": {
7
- "dev": "vite",
8
- "build": "npm run build-domain && npm run build-webui",
9
- "build-domain": "rimraf dist && tsc -p tsconfig.build.json && jitar build",
10
- "build-webui": "vite build",
11
- "standalone": "jitar start --service=services/standalone.json"
12
- },
13
- "dependencies": {
14
- "jitar": "^0.10.2",
15
- "react": "^19.2.0",
16
- "react-dom": "^19.2.0"
17
- },
18
- "devDependencies": {
19
- "@jitar/plugin-vite": "^0.10.1",
20
- "@types/node": "^24.9.2",
21
- "@types/react": "^19.2.2",
22
- "@types/react-dom": "^19.2.2",
23
- "@vitejs/plugin-react": "^5.1.0",
24
- "rimraf": "^6.1.0",
25
- "typescript": "^5.9.3",
26
- "vite": "^7.1.12"
27
- }
28
- }
@@ -1,6 +0,0 @@
1
- {
2
- "extends": "./tsconfig.base.json",
3
- "compilerOptions": {
4
- "jsx": "react-jsx"
5
- }
6
- }
@@ -1,14 +0,0 @@
1
-
2
- import { defineConfig } from 'vite';
3
- import react from '@vitejs/plugin-react';
4
- import jitar from '@jitar/plugin-vite';
5
-
6
- export default defineConfig({
7
- build: {
8
- emptyOutDir: false
9
- },
10
- plugins: [
11
- react(),
12
- jitar({ sourceDir: 'src', targetDir: 'dist', jitarDir: 'domain', jitarUrl: 'http://localhost:3000', segments: [] })
13
- ]
14
- });
@@ -1 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
@@ -1 +0,0 @@
1
- /// <reference types="vite/client" />
@@ -1,11 +0,0 @@
1
- {
2
- "extends": "./tsconfig.base.json",
3
- "compilerOptions": {
4
- "noEmit": false,
5
- "jsx": "react-jsx",
6
- "rootDir": "./src",
7
- "outDir": "./dist",
8
- },
9
- "include": ["src"],
10
- "exclude": ["src/webui"]
11
- }
@@ -1,25 +0,0 @@
1
- # Logs
2
- logs
3
- *.log
4
- npm-debug.log*
5
- yarn-debug.log*
6
- yarn-error.log*
7
- pnpm-debug.log*
8
- lerna-debug.log*
9
-
10
- node_modules
11
- dist
12
- .jitar
13
- dist-ssr
14
- *.local
15
-
16
- # Editor directories and files
17
- .vscode/*
18
- !.vscode/extensions.json
19
- .idea
20
- .DS_Store
21
- *.suo
22
- *.ntvs*
23
- *.njsproj
24
- *.sln
25
- *.sw?
@@ -1,26 +0,0 @@
1
- {
2
- "name": "jitar-vue-starter",
3
- "private": true,
4
- "version": "0.0.0",
5
- "type": "module",
6
- "scripts": {
7
- "dev": "vite",
8
- "build": "npm run build-domain && npm run build-webui",
9
- "build-domain": "rimraf dist && tsc -p tsconfig.build.json && jitar build",
10
- "build-webui": "vite build && vue-tsc --noEmit",
11
- "standalone": "jitar start --service=services/standalone.json"
12
- },
13
- "dependencies": {
14
- "jitar": "^0.10.2",
15
- "vue": "^3.5.22"
16
- },
17
- "devDependencies": {
18
- "@types/node": "^24.9.2",
19
- "@jitar/plugin-vite": "^0.10.1",
20
- "@vitejs/plugin-vue": "^6.0.1",
21
- "rimraf": "^6.1.0",
22
- "typescript": "5.9.3",
23
- "vite": "^7.1.12",
24
- "vue-tsc": "^3.1.2"
25
- }
26
- }
@@ -1,19 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ESNext",
4
- "useDefineForClassFields": true,
5
- "module": "ESNext",
6
- "moduleResolution": "Node",
7
- "strict": true,
8
- "jsx": "preserve",
9
- "resolveJsonModule": true,
10
- "isolatedModules": true,
11
- "esModuleInterop": true,
12
- "lib": ["ESNext", "DOM"],
13
- "skipLibCheck": true,
14
- "noEmit": false,
15
- "outDir": "dist"
16
- },
17
- "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"],
18
- "exclude": ["src/webui/main.ts"]
19
- }
@@ -1,14 +0,0 @@
1
-
2
- import { defineConfig } from 'vite';
3
- import vue from '@vitejs/plugin-vue';
4
- import jitar from '@jitar/plugin-vite';
5
-
6
- export default defineConfig({
7
- build: {
8
- emptyOutDir: false
9
- },
10
- plugins: [
11
- vue(),
12
- jitar({ sourceDir: 'src', targetDir: 'dist', jitarDir: 'domain', jitarUrl: 'http://localhost:3000', segments: [] })
13
- ]
14
- });
@@ -1 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
@@ -1 +0,0 @@
1
- /// <reference types="vite/client" />
@@ -1,10 +0,0 @@
1
- {
2
- "extends": "./tsconfig.json",
3
- "compilerOptions": {
4
- "noEmit": false,
5
- "rootDir": "./src",
6
- "outDir": "./dist",
7
- },
8
- "include": ["src"],
9
- "exclude": ["src/webui"]
10
- }