diff --git a/.github/workflows/npmpublish-beta.yml b/.github/workflows/npmpublish-beta.yml index 0da6bb8b..02b0882d 100644 --- a/.github/workflows/npmpublish-beta.yml +++ b/.github/workflows/npmpublish-beta.yml @@ -17,8 +17,8 @@ jobs: - uses: actions/checkout@v3.3.0 - uses: actions/setup-node@v3.6.0 with: - node-version: 16 - - run: npm ci + node-version: 22 + - run: npm i && npm ci --install-strategy=nested - run: npm test publish-npm: @@ -28,11 +28,11 @@ jobs: - uses: actions/checkout@v3.3.0 - uses: actions/setup-node@v3.6.0 with: - node-version: 16 + node-version: 22 registry-url: https://registry.npmjs.org/ - name: Set up NPM authentication run: echo "registry=https://registry.npmjs.org/:_authToken=${{secrets.NPM_TOKEN}}" >> ~/.npmrc - - run: npm ci + - run: npm i && npm ci --install-strategy=nested - run: npm publish --tag ${GITHUB_REF##*/} env: NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} diff --git a/.github/workflows/npmpublish-lts.yml b/.github/workflows/npmpublish-lts.yml index a5febcbc..74823c48 100644 --- a/.github/workflows/npmpublish-lts.yml +++ b/.github/workflows/npmpublish-lts.yml @@ -17,8 +17,8 @@ jobs: - uses: actions/checkout@v3.3.0 - uses: actions/setup-node@v3.6.0 with: - node-version: 16 - - run: npm ci + node-version: 22 + - run: npm i && npm ci --install-strategy=nested - run: npm test publish-npm: @@ -28,11 +28,11 @@ jobs: - uses: actions/checkout@v3.3.0 - uses: actions/setup-node@v3.6.0 with: - node-version: 16 + node-version: 22 registry-url: https://registry.npmjs.org/ - name: Set up NPM authentication run: echo "registry=https://registry.npmjs.org/:_authToken=${{secrets.NPM_TOKEN}}" >> ~/.npmrc - - run: npm ci + - run: npm i && npm ci --install-strategy=nested - run: npm publish --tag ${GITHUB_REF##*/} env: NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} diff --git a/.github/workflows/npmpublish-main.yml b/.github/workflows/npmpublish-main.yml index 48c640e3..22e2a1dc 100644 --- a/.github/workflows/npmpublish-main.yml +++ b/.github/workflows/npmpublish-main.yml @@ -17,8 +17,8 @@ jobs: - uses: actions/checkout@v3.3.0 - uses: actions/setup-node@v3.6.0 with: - node-version: 16 - - run: npm ci + node-version: 22 + - run: npm i && npm ci --install-strategy=nested - run: npm test publish-npm: @@ -28,11 +28,11 @@ jobs: - uses: actions/checkout@v3.3.0 - uses: actions/setup-node@v3.6.0 with: - node-version: 16 + node-version: 22 registry-url: https://registry.npmjs.org/ - name: Set up NPM authentication run: echo "registry=https://registry.npmjs.org/:_authToken=${{secrets.NPM_TOKEN}}" >> ~/.npmrc - - run: npm ci + - run: npm i && npm ci --install-strategy=nested - run: npm publish env: NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} diff --git a/.github/workflows/npmpublish-ts.yml b/.github/workflows/npmpublish-ts.yml new file mode 100644 index 00000000..9a0e3e18 --- /dev/null +++ b/.github/workflows/npmpublish-ts.yml @@ -0,0 +1,38 @@ +# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created +# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages + +name: Node.js Publish Beta TypeScript version + +on: + push: + branches: + - 'v*.*-ts' + tags: + - 'v*.*.*-ts' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3.3.0 + - uses: actions/setup-node@v3.6.0 + with: + node-version: 22 + - run: npm i && npm ci --install-strategy=nested + - run: npm test + + publish-npm: + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3.3.0 + - uses: actions/setup-node@v3.6.0 + with: + node-version: 22 + registry-url: https://registry.npmjs.org/ + - name: Set up NPM authentication + run: echo "registry=https://registry.npmjs.org/:_authToken=${{secrets.NPM_TOKEN}}" >> ~/.npmrc + - run: npm i && npm ci --install-strategy=nested + - run: npm publish --tag ${GITHUB_REF##*/} + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} diff --git a/README-es.pdf b/README-es.pdf index ed2beca3..1c62097d 100644 Binary files a/README-es.pdf and b/README-es.pdf differ diff --git a/README.pdf b/README.pdf index 7a04dd40..88e67487 100644 Binary files a/README.pdf and b/README.pdf differ diff --git a/package-lock.json b/package-lock.json index bffc9e9b..f6088c45 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,8 @@ "version": "2.4.104-ts", "license": "LGPL-3.0", "devDependencies": { + "@types/qcobjects": "github:QCObjects/-types-qcobjects", + "@types/qcobjects-sdk": "github:QCObjects/-types-qcobjects-sdk", "@typescript-eslint/eslint-plugin": "^5.58.0", "@typescript-eslint/parser": "^5.58.0", "eslint": "^8.40.0", @@ -20,6 +22,8 @@ "eslint-plugin-promise": "^6.1.1", "hint": "^2.0.0", "jasmine": "^3.7.0", + "qcobjects-sdk": "^2.4.66", + "qcobjects-tsconfig": "^2.4.10", "typescript": "^5.6.3" }, "engines": { @@ -33,10 +37,11 @@ } }, "node_modules/@adobe/css-tools": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/@adobe/css-tools/-/css-tools-4.4.0.tgz", - "integrity": "sha512-Ff9+ksdQQB3rMncgqDK78uLznstjyfIf2Arnh22pW8kBpLs6rpKDwgnZT46hin5Hl1WzazzK64DOrhSwYpS7bQ==", + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@adobe/css-tools/-/css-tools-4.3.3.tgz", + "integrity": "sha512-rE0Pygv0sEZ4vBWHlAgJLGDU7Pm8xoO6p3wsEceb7GYAjScrOHpEo8KK/eVkAcnSM+slAEtXjA2JpdjLp4fJQQ==", "dev": true, + "license": "MIT", "peer": true }, "node_modules/@eslint-community/eslint-utils": { @@ -44,6 +49,7 @@ "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", "dev": true, + "license": "MIT", "dependencies": { "eslint-visitor-keys": "^3.3.0" }, @@ -55,23 +61,25 @@ } }, "node_modules/@eslint-community/regexpp": { - "version": "4.5.1", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.5.1.tgz", - "integrity": "sha512-Z5ba73P98O1KUYCCJTUeVpja9RcGoMdncZ6T49FCUl2lN38JtCJ+3WgIDBv0AuY4WChU5PmtJmOCTlN6FZTFKQ==", + "version": "4.11.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.11.1.tgz", + "integrity": "sha512-m4DVN9ZqskZoLU5GlWZadwDnYo3vAEydiUayB9widCl9ffWx2IvPnp6n3on5rJmziJSw9Bv+Z3ChDVdMwXCY8Q==", "dev": true, + "license": "MIT", "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" } }, "node_modules/@eslint/eslintrc": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.0.3.tgz", - "integrity": "sha512-+5gy6OQfk+xx3q0d6jGZZC3f3KzAkXc/IanVxd1is/VIIziRqqt3ongQz0FiTUXqTk0c7aDB3OaFuKnuSoJicQ==", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", "dev": true, + "license": "MIT", "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", - "espree": "^9.5.2", + "espree": "^9.6.0", "globals": "^13.19.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", @@ -87,22 +95,25 @@ } }, "node_modules/@eslint/js": { - "version": "8.40.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.40.0.tgz", - "integrity": "sha512-ElyB54bJIhXQYVKjDSvCkPO1iU1tSAeVQJbllWJq1XQSmmA4dgFk8CbiBGpiOPxleE48vDogxCtmMYku4HSVLA==", + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.1.tgz", + "integrity": "sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==", "dev": true, + "license": "MIT", "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, "node_modules/@humanwhocodes/config-array": { - "version": "0.11.8", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.8.tgz", - "integrity": "sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g==", + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.13.0.tgz", + "integrity": "sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==", + "deprecated": "Use @eslint/config-array instead", "dev": true, + "license": "Apache-2.0", "dependencies": { - "@humanwhocodes/object-schema": "^1.2.1", - "debug": "^4.1.1", + "@humanwhocodes/object-schema": "^2.0.3", + "debug": "^4.3.1", "minimatch": "^3.0.5" }, "engines": { @@ -114,6 +125,7 @@ "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", "dev": true, + "license": "Apache-2.0", "engines": { "node": ">=12.22" }, @@ -123,16 +135,19 @@ } }, "node_modules/@humanwhocodes/object-schema": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", - "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", - "dev": true + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", + "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", + "deprecated": "Use @eslint/object-schema instead", + "dev": true, + "license": "BSD-3-Clause" }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", "dev": true, + "license": "MIT", "dependencies": { "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" @@ -146,6 +161,7 @@ "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", "dev": true, + "license": "MIT", "engines": { "node": ">= 8" } @@ -155,6 +171,7 @@ "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", "dev": true, + "license": "MIT", "dependencies": { "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" @@ -163,57 +180,72 @@ "node": ">= 8" } }, + "node_modules/@rtsao/scc": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@rtsao/scc/-/scc-1.1.0.tgz", + "integrity": "sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/json-schema": { - "version": "7.0.11", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", - "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", - "dev": true + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true, + "license": "MIT" }, "node_modules/@types/json5": { "version": "0.0.29", "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/node": { - "version": "18.16.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.16.5.tgz", - "integrity": "sha512-seOA34WMo9KB+UA78qaJoCO20RJzZGVXQ5Sh6FWu0g/hfT44nKXnej3/tCQl7FL97idFpBhisLYCTB50S0EirA==", - "peer": true + "version": "18.19.55", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.55.tgz", + "integrity": "sha512-zzw5Vw52205Zr/nmErSEkN5FLqXPuKX/k5d1D7RKHATGqU7y6YfX9QxZraUzUrFGqH6XzOzG196BC35ltJC4Cw==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~5.26.4" + } }, "node_modules/@types/qcobjects": { "version": "2.4.1", - "resolved": "git+ssh://git@github.com/QCObjects/-types-qcobjects.git#1e551c9b08ff9530c4a9739d7c94639b6a09995e", + "resolved": "git+ssh://git@github.com/QCObjects/-types-qcobjects.git#51470ffb98ec539a5563e5eb5426e9d5adddfad3", + "dev": true, "license": "LGPL-3.0", - "peer": true, "dependencies": { "@types/node": "^18.16.2" } }, "node_modules/@types/qcobjects-sdk": { "version": "2.4.1", - "resolved": "git+ssh://git@github.com/QCObjects/-types-qcobjects-sdk.git#03f545de0149da6dcc1a78c09e22835e30da806f", - "license": "LGPL-3.0", - "peer": true + "resolved": "git+ssh://git@github.com/QCObjects/-types-qcobjects-sdk.git#230425c25deff48fc15dee4008def6e6afddacbd", + "dev": true, + "license": "LGPL-3.0" }, "node_modules/@types/semver": { - "version": "7.3.13", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.3.13.tgz", - "integrity": "sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==", - "dev": true + "version": "7.5.8", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.8.tgz", + "integrity": "sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==", + "dev": true, + "license": "MIT" }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "5.59.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.59.2.tgz", - "integrity": "sha512-yVrXupeHjRxLDcPKL10sGQ/QlVrA8J5IYOEWVqk0lJaSZP7X5DfnP7Ns3cc74/blmbipQ1htFNVGsHX6wsYm0A==", + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.62.0.tgz", + "integrity": "sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==", "dev": true, + "license": "MIT", "dependencies": { "@eslint-community/regexpp": "^4.4.0", - "@typescript-eslint/scope-manager": "5.59.2", - "@typescript-eslint/type-utils": "5.59.2", - "@typescript-eslint/utils": "5.59.2", + "@typescript-eslint/scope-manager": "5.62.0", + "@typescript-eslint/type-utils": "5.62.0", + "@typescript-eslint/utils": "5.62.0", "debug": "^4.3.4", - "grapheme-splitter": "^1.0.4", + "graphemer": "^1.4.0", "ignore": "^5.2.0", "natural-compare-lite": "^1.4.0", "semver": "^7.3.7", @@ -237,14 +269,15 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "5.59.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.59.2.tgz", - "integrity": "sha512-uq0sKyw6ao1iFOZZGk9F8Nro/8+gfB5ezl1cA06SrqbgJAt0SRoFhb9pXaHvkrxUpZaoLxt8KlovHNk8Gp6/HQ==", + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.62.0.tgz", + "integrity": "sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { - "@typescript-eslint/scope-manager": "5.59.2", - "@typescript-eslint/types": "5.59.2", - "@typescript-eslint/typescript-estree": "5.59.2", + "@typescript-eslint/scope-manager": "5.62.0", + "@typescript-eslint/types": "5.62.0", + "@typescript-eslint/typescript-estree": "5.62.0", "debug": "^4.3.4" }, "engines": { @@ -264,13 +297,14 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "5.59.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.59.2.tgz", - "integrity": "sha512-dB1v7ROySwQWKqQ8rEWcdbTsFjh2G0vn8KUyvTXdPoyzSL6lLGkiXEV5CvpJsEe9xIdKV+8Zqb7wif2issoOFA==", + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz", + "integrity": "sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/types": "5.59.2", - "@typescript-eslint/visitor-keys": "5.59.2" + "@typescript-eslint/types": "5.62.0", + "@typescript-eslint/visitor-keys": "5.62.0" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -281,13 +315,14 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "5.59.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.59.2.tgz", - "integrity": "sha512-b1LS2phBOsEy/T381bxkkywfQXkV1dWda/z0PhnIy3bC5+rQWQDS7fk9CSpcXBccPY27Z6vBEuaPBCKCgYezyQ==", + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.62.0.tgz", + "integrity": "sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/typescript-estree": "5.59.2", - "@typescript-eslint/utils": "5.59.2", + "@typescript-eslint/typescript-estree": "5.62.0", + "@typescript-eslint/utils": "5.62.0", "debug": "^4.3.4", "tsutils": "^3.21.0" }, @@ -308,10 +343,11 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "5.59.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.59.2.tgz", - "integrity": "sha512-LbJ/HqoVs2XTGq5shkiKaNTuVv5tTejdHgfdjqRUGdYhjW1crm/M7og2jhVskMt8/4wS3T1+PfFvL1K3wqYj4w==", + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.62.0.tgz", + "integrity": "sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==", "dev": true, + "license": "MIT", "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, @@ -321,13 +357,14 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.59.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.2.tgz", - "integrity": "sha512-+j4SmbwVmZsQ9jEyBMgpuBD0rKwi9RxRpjX71Brr73RsYnEr3Lt5QZ624Bxphp8HUkSKfqGnPJp1kA5nl0Sh7Q==", + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz", + "integrity": "sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { - "@typescript-eslint/types": "5.59.2", - "@typescript-eslint/visitor-keys": "5.59.2", + "@typescript-eslint/types": "5.62.0", + "@typescript-eslint/visitor-keys": "5.62.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -348,17 +385,18 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "5.59.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.59.2.tgz", - "integrity": "sha512-kSuF6/77TZzyGPhGO4uVp+f0SBoYxCDf+lW3GKhtKru/L8k/Hd7NFQxyWUeY7Z/KGB2C6Fe3yf2vVi4V9TsCSQ==", + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.62.0.tgz", + "integrity": "sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==", "dev": true, + "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@types/json-schema": "^7.0.9", "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.59.2", - "@typescript-eslint/types": "5.59.2", - "@typescript-eslint/typescript-estree": "5.59.2", + "@typescript-eslint/scope-manager": "5.62.0", + "@typescript-eslint/types": "5.62.0", + "@typescript-eslint/typescript-estree": "5.62.0", "eslint-scope": "^5.1.1", "semver": "^7.3.7" }, @@ -374,12 +412,13 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "5.59.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.2.tgz", - "integrity": "sha512-EEpsO8m3RASrKAHI9jpavNv9NlEUebV4qmF1OWxSTtKSFBpC1NCmWazDQHFivRf0O1DV11BA645yrLEVQ0/Lig==", + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz", + "integrity": "sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/types": "5.59.2", + "@typescript-eslint/types": "5.62.0", "eslint-visitor-keys": "^3.3.0" }, "engines": { @@ -390,11 +429,19 @@ "url": "https://opencollective.com/typescript-eslint" } }, + "node_modules/@ungap/structured-clone": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", + "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", + "dev": true, + "license": "ISC" + }, "node_modules/acorn": { - "version": "8.8.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", - "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", + "version": "8.12.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", + "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==", "dev": true, + "license": "MIT", "bin": { "acorn": "bin/acorn" }, @@ -407,6 +454,7 @@ "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", "dev": true, + "license": "MIT", "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } @@ -416,6 +464,7 @@ "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "dev": true, + "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -432,6 +481,7 @@ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -441,6 +491,7 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, + "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -455,31 +506,38 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true + "dev": true, + "license": "Python-2.0" }, "node_modules/array-buffer-byte-length": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz", - "integrity": "sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz", + "integrity": "sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==", "dev": true, + "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "is-array-buffer": "^3.0.1" + "call-bind": "^1.0.5", + "is-array-buffer": "^3.0.4" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/array-includes": { - "version": "3.1.6", - "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.6.tgz", - "integrity": "sha512-sgTbLvL6cNnw24FnbaDyjmvddQ2ML8arZsgaJhoABMoplz/4QRhtrYS+alr1BUM1Bwp6dhx8vVCBSLG+StwOFw==", + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.8.tgz", + "integrity": "sha512-itaWrbYbqpGXkGhZPGUulwnhVf5Hpy1xiCFsGqyIGglbBxmG5vSjxQen3/WGOjPpNEv1RtBLKxbmVXm8HpJStQ==", "dev": true, + "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4", - "get-intrinsic": "^1.1.3", + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.4", "is-string": "^1.0.7" }, "engines": { @@ -494,19 +552,42 @@ "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, + "node_modules/array.prototype.findlastindex": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.5.tgz", + "integrity": "sha512-zfETvRFA8o7EiNn++N5f/kaCw221hrpGsDmcpndVupkPzEc1Wuf3VgC0qby1BbHs7f5DVYjgtEU2LLh5bqeGfQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-shim-unscopables": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/array.prototype.flat": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.1.tgz", - "integrity": "sha512-roTU0KWIOmJ4DRLmwKd19Otg0/mT3qPNt0Qb3GWW8iObuZXxrjB/pzn0R3hqpRSWg4HCwqx+0vwOnWnvlOyeIA==", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.2.tgz", + "integrity": "sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA==", "dev": true, + "license": "MIT", "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", "es-shim-unscopables": "^1.0.0" }, "engines": { @@ -517,14 +598,15 @@ } }, "node_modules/array.prototype.flatmap": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.1.tgz", - "integrity": "sha512-8UGn9O1FDVvMNB0UlLv4voxRMze7+FpHyF5mSMRjWHUMlpoDViniy05870VlxhfgTnLbpuwTzvD76MTtWxB/mQ==", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.2.tgz", + "integrity": "sha512-Ewyx0c9PmpcsByhSW4r+9zDU7sGjFc86qf/kKtuSCRdhfbk0SNLLkaT5qvcHnRGgc5NP/ly/y+qkXkqONX54CQ==", "dev": true, + "license": "MIT", "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", "es-shim-unscopables": "^1.0.0" }, "engines": { @@ -534,11 +616,38 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/arraybuffer.prototype.slice": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.3.tgz", + "integrity": "sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-buffer-byte-length": "^1.0.1", + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "es-abstract": "^1.22.3", + "es-errors": "^1.2.1", + "get-intrinsic": "^1.2.3", + "is-array-buffer": "^3.0.4", + "is-shared-array-buffer": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/available-typed-arrays": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", - "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", + "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", "dev": true, + "license": "MIT", + "dependencies": { + "possible-typed-array-names": "^1.0.0" + }, "engines": { "node": ">= 0.4" }, @@ -550,13 +659,15 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -567,6 +678,7 @@ "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, + "license": "MIT", "dependencies": { "fill-range": "^7.1.1" }, @@ -575,22 +687,30 @@ } }, "node_modules/builtins": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/builtins/-/builtins-5.0.1.tgz", - "integrity": "sha512-qwVpFEHNfhYJIzNRBvd2C1kyo6jz3ZSMPyyuR47OPdiKWlbYnZNyDWuyR175qDnAJLiCo5fBBqPb3RiXgWlkOQ==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/builtins/-/builtins-5.1.0.tgz", + "integrity": "sha512-SW9lzGTLvWTP1AY8xeAMZimqDrIaSdLQUcVr9DMef51niJ022Ri87SwRRKYm4A6iHfkPaiVUu/Duw2Wc4J7kKg==", "dev": true, + "license": "MIT", "dependencies": { "semver": "^7.0.0" } }, "node_modules/call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", "dev": true, + "license": "MIT", "dependencies": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -601,6 +721,7 @@ "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } @@ -610,6 +731,7 @@ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -626,6 +748,7 @@ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, + "license": "MIT", "dependencies": { "color-name": "~1.1.4" }, @@ -637,19 +760,22 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", "dev": true, + "license": "MIT", "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -659,13 +785,68 @@ "node": ">= 8" } }, + "node_modules/data-view-buffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.1.tgz", + "integrity": "sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.1.tgz", + "integrity": "sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-offset": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.0.tgz", + "integrity": "sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", "dev": true, + "license": "MIT", "dependencies": { - "ms": "2.1.2" + "ms": "^2.1.3" }, "engines": { "node": ">=6.0" @@ -680,14 +861,35 @@ "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", - "dev": true + "dev": true, + "license": "MIT" + }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/define-properties": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.0.tgz", - "integrity": "sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", "dev": true, + "license": "MIT", "dependencies": { + "define-data-property": "^1.0.1", "has-property-descriptors": "^1.0.0", "object-keys": "^1.1.1" }, @@ -703,6 +905,7 @@ "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", "dev": true, + "license": "MIT", "dependencies": { "path-type": "^4.0.0" }, @@ -715,6 +918,7 @@ "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", "dev": true, + "license": "Apache-2.0", "dependencies": { "esutils": "^2.0.2" }, @@ -723,45 +927,58 @@ } }, "node_modules/es-abstract": { - "version": "1.21.2", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.21.2.tgz", - "integrity": "sha512-y/B5POM2iBnIxCiernH1G7rC9qQoM77lLIMQLuob0zhp8C56Po81+2Nj0WFKnd0pNReDTnkYryc+zhOzpEIROg==", + "version": "1.23.3", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.3.tgz", + "integrity": "sha512-e+HfNH61Bj1X9/jLc5v1owaLYuHdeHHSQlkhCBiTK8rBvKaULl/beGMxwrMXjpYrv4pz22BlY570vVePA2ho4A==", "dev": true, + "license": "MIT", "dependencies": { - "array-buffer-byte-length": "^1.0.0", - "available-typed-arrays": "^1.0.5", - "call-bind": "^1.0.2", - "es-set-tostringtag": "^2.0.1", + "array-buffer-byte-length": "^1.0.1", + "arraybuffer.prototype.slice": "^1.0.3", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "data-view-buffer": "^1.0.1", + "data-view-byte-length": "^1.0.1", + "data-view-byte-offset": "^1.0.0", + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-set-tostringtag": "^2.0.3", "es-to-primitive": "^1.2.1", - "function.prototype.name": "^1.1.5", - "get-intrinsic": "^1.2.0", - "get-symbol-description": "^1.0.0", + "function.prototype.name": "^1.1.6", + "get-intrinsic": "^1.2.4", + "get-symbol-description": "^1.0.2", "globalthis": "^1.0.3", "gopd": "^1.0.1", - "has": "^1.0.3", - "has-property-descriptors": "^1.0.0", - "has-proto": "^1.0.1", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.0.3", "has-symbols": "^1.0.3", - "internal-slot": "^1.0.5", - "is-array-buffer": "^3.0.2", + "hasown": "^2.0.2", + "internal-slot": "^1.0.7", + "is-array-buffer": "^3.0.4", "is-callable": "^1.2.7", - "is-negative-zero": "^2.0.2", + "is-data-view": "^1.0.1", + "is-negative-zero": "^2.0.3", "is-regex": "^1.1.4", - "is-shared-array-buffer": "^1.0.2", + "is-shared-array-buffer": "^1.0.3", "is-string": "^1.0.7", - "is-typed-array": "^1.1.10", + "is-typed-array": "^1.1.13", "is-weakref": "^1.0.2", - "object-inspect": "^1.12.3", + "object-inspect": "^1.13.1", "object-keys": "^1.1.1", - "object.assign": "^4.1.4", - "regexp.prototype.flags": "^1.4.3", - "safe-regex-test": "^1.0.0", - "string.prototype.trim": "^1.2.7", - "string.prototype.trimend": "^1.0.6", - "string.prototype.trimstart": "^1.0.6", - "typed-array-length": "^1.0.4", + "object.assign": "^4.1.5", + "regexp.prototype.flags": "^1.5.2", + "safe-array-concat": "^1.1.2", + "safe-regex-test": "^1.0.3", + "string.prototype.trim": "^1.2.9", + "string.prototype.trimend": "^1.0.8", + "string.prototype.trimstart": "^1.0.8", + "typed-array-buffer": "^1.0.2", + "typed-array-byte-length": "^1.0.1", + "typed-array-byte-offset": "^1.0.2", + "typed-array-length": "^1.0.6", "unbox-primitive": "^1.0.2", - "which-typed-array": "^1.1.9" + "which-typed-array": "^1.1.15" }, "engines": { "node": ">= 0.4" @@ -770,27 +987,65 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz", + "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/es-set-tostringtag": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.1.tgz", - "integrity": "sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.3.tgz", + "integrity": "sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ==", "dev": true, + "license": "MIT", "dependencies": { - "get-intrinsic": "^1.1.3", - "has": "^1.0.3", - "has-tostringtag": "^1.0.0" + "get-intrinsic": "^1.2.4", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.1" }, "engines": { "node": ">= 0.4" } }, "node_modules/es-shim-unscopables": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.0.tgz", - "integrity": "sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.2.tgz", + "integrity": "sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw==", "dev": true, + "license": "MIT", "dependencies": { - "has": "^1.0.3" + "hasown": "^2.0.0" } }, "node_modules/es-to-primitive": { @@ -798,6 +1053,7 @@ "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", "dev": true, + "license": "MIT", "dependencies": { "is-callable": "^1.1.4", "is-date-object": "^1.0.1", @@ -815,6 +1071,7 @@ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true, + "license": "MIT", "engines": { "node": ">=10" }, @@ -823,27 +1080,30 @@ } }, "node_modules/eslint": { - "version": "8.40.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.40.0.tgz", - "integrity": "sha512-bvR+TsP9EHL3TqNtj9sCNJVAFK3fBN8Q7g5waghxyRsPLIMwL73XSKnZFK0hk/O2ANC+iAoq6PWMQ+IfBAJIiQ==", + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.1.tgz", + "integrity": "sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==", + "deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.", "dev": true, + "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.4.0", - "@eslint/eslintrc": "^2.0.3", - "@eslint/js": "8.40.0", - "@humanwhocodes/config-array": "^0.11.8", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.4", + "@eslint/js": "8.57.1", + "@humanwhocodes/config-array": "^0.13.0", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", - "ajv": "^6.10.0", + "@ungap/structured-clone": "^1.2.0", + "ajv": "^6.12.4", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", "debug": "^4.3.2", "doctrine": "^3.0.0", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.2.0", - "eslint-visitor-keys": "^3.4.1", - "espree": "^9.5.2", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", "esquery": "^1.4.2", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", @@ -851,22 +1111,19 @@ "find-up": "^5.0.0", "glob-parent": "^6.0.2", "globals": "^13.19.0", - "grapheme-splitter": "^1.0.4", + "graphemer": "^1.4.0", "ignore": "^5.2.0", - "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", "is-path-inside": "^3.0.3", - "js-sdsl": "^4.1.4", "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", - "optionator": "^0.9.1", + "optionator": "^0.9.3", "strip-ansi": "^6.0.1", - "strip-json-comments": "^3.1.0", "text-table": "^0.2.0" }, "bin": { @@ -892,6 +1149,8 @@ "eslint": ">=7.0.0" } }, + + "node_modules/eslint-config-semistandard": { "version": "17.0.0", "resolved": "https://registry.npmjs.org/eslint-config-semistandard/-/eslint-config-semistandard-17.0.0.tgz", @@ -937,14 +1196,15 @@ } }, "node_modules/eslint-import-resolver-node": { - "version": "0.3.7", - "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.7.tgz", - "integrity": "sha512-gozW2blMLJCeFpBwugLTGyvVjNoeo1knonXAcatC6bjPBZitotxdWf7Gimr25N4c0AAOo4eOUfaG82IJPDpqCA==", + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz", + "integrity": "sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==", "dev": true, + "license": "MIT", "dependencies": { "debug": "^3.2.7", - "is-core-module": "^2.11.0", - "resolve": "^1.22.1" + "is-core-module": "^2.13.0", + "resolve": "^1.22.4" } }, "node_modules/eslint-import-resolver-node/node_modules/debug": { @@ -952,15 +1212,17 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "dev": true, + "license": "MIT", "dependencies": { "ms": "^2.1.1" } }, "node_modules/eslint-module-utils": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.8.0.tgz", - "integrity": "sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==", + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.12.0.tgz", + "integrity": "sha512-wALZ0HFoytlyh/1+4wuZ9FJCD/leWHQzzrxJ8+rebyReSLk7LApMyd3WJaLVoN+D5+WIdJyDK1c6JnE65V4Zyg==", "dev": true, + "license": "MIT", "dependencies": { "debug": "^3.2.7" }, @@ -978,6 +1240,7 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "dev": true, + "license": "MIT", "dependencies": { "ms": "^2.1.1" } @@ -987,6 +1250,7 @@ "resolved": "https://registry.npmjs.org/eslint-plugin-es/-/eslint-plugin-es-4.1.0.tgz", "integrity": "sha512-GILhQTnjYE2WorX5Jyi5i4dz5ALWxBIdQECVQavL6s7cI76IZTDWleTHkxz/QT3kvcs2QlGHvKLYsSlPOlPXnQ==", "dev": true, + "license": "MIT", "dependencies": { "eslint-utils": "^2.0.0", "regexpp": "^3.0.0" @@ -1006,6 +1270,7 @@ "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", "dev": true, + "license": "MIT", "dependencies": { "eslint-visitor-keys": "^1.1.0" }, @@ -1021,37 +1286,43 @@ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", "dev": true, + "license": "Apache-2.0", "engines": { "node": ">=4" } }, "node_modules/eslint-plugin-import": { - "version": "2.27.5", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.27.5.tgz", - "integrity": "sha512-LmEt3GVofgiGuiE+ORpnvP+kAm3h6MLZJ4Q5HCyHADofsb4VzXFsRiWj3c0OFiV+3DWFh0qg3v9gcPlfc3zRow==", + "version": "2.31.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.31.0.tgz", + "integrity": "sha512-ixmkI62Rbc2/w8Vfxyh1jQRTdRTF52VxwRVHl/ykPAmqG+Nb7/kNn+byLP0LxPgI7zWA16Jt82SybJInmMia3A==", "dev": true, + "license": "MIT", "dependencies": { - "array-includes": "^3.1.6", - "array.prototype.flat": "^1.3.1", - "array.prototype.flatmap": "^1.3.1", + "@rtsao/scc": "^1.1.0", + "array-includes": "^3.1.8", + "array.prototype.findlastindex": "^1.2.5", + "array.prototype.flat": "^1.3.2", + "array.prototype.flatmap": "^1.3.2", "debug": "^3.2.7", "doctrine": "^2.1.0", - "eslint-import-resolver-node": "^0.3.7", - "eslint-module-utils": "^2.7.4", - "has": "^1.0.3", - "is-core-module": "^2.11.0", + "eslint-import-resolver-node": "^0.3.9", + "eslint-module-utils": "^2.12.0", + "hasown": "^2.0.2", + "is-core-module": "^2.15.1", "is-glob": "^4.0.3", "minimatch": "^3.1.2", - "object.values": "^1.1.6", - "resolve": "^1.22.1", - "semver": "^6.3.0", - "tsconfig-paths": "^3.14.1" + "object.fromentries": "^2.0.8", + "object.groupby": "^1.0.3", + "object.values": "^1.2.0", + "semver": "^6.3.1", + "string.prototype.trimend": "^1.0.8", + "tsconfig-paths": "^3.15.0" }, "engines": { "node": ">=4" }, "peerDependencies": { - "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8" + "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 || ^9" } }, "node_modules/eslint-plugin-import/node_modules/debug": { @@ -1059,6 +1330,7 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "dev": true, + "license": "MIT", "dependencies": { "ms": "^2.1.1" } @@ -1068,6 +1340,7 @@ "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", "dev": true, + "license": "Apache-2.0", "dependencies": { "esutils": "^2.0.2" }, @@ -1080,6 +1353,7 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, + "license": "ISC", "bin": { "semver": "bin/semver.js" } @@ -1089,6 +1363,7 @@ "resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-15.7.0.tgz", "integrity": "sha512-jDex9s7D/Qial8AGVIHq4W7NswpUD5DPDL2RH8Lzd9EloWUuvUkHfv4FRLMipH5q2UtyurorBkPeNi1wVWNh3Q==", "dev": true, + "license": "MIT", "dependencies": { "builtins": "^5.0.1", "eslint-plugin-es": "^4.1.0", @@ -1110,15 +1385,19 @@ } }, "node_modules/eslint-plugin-promise": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-6.1.1.tgz", - "integrity": "sha512-tjqWDwVZQo7UIPMeDReOpUgHCmCiH+ePnVT+5zVapL0uuHnegBUs2smM13CzOs2Xb5+MHMRFTs9v24yjba4Oig==", + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-6.6.0.tgz", + "integrity": "sha512-57Zzfw8G6+Gq7axm2Pdo3gW/Rx3h9Yywgn61uE/3elTCOePEHVrn2i5CdfBwA1BLK0Q0WqctICIUSqXZW/VprQ==", "dev": true, + "license": "ISC", "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, + "funding": { + "url": "https://opencollective.com/eslint" + }, "peerDependencies": { - "eslint": "^7.0.0 || ^8.0.0" + "eslint": "^7.0.0 || ^8.0.0 || ^9.0.0" } }, "node_modules/eslint-scope": { @@ -1126,6 +1405,7 @@ "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "esrecurse": "^4.3.0", "estraverse": "^4.1.1" @@ -1139,6 +1419,7 @@ "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", "dev": true, + "license": "MIT", "dependencies": { "eslint-visitor-keys": "^2.0.0" }, @@ -1157,15 +1438,17 @@ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", "dev": true, + "license": "Apache-2.0", "engines": { "node": ">=10" } }, "node_modules/eslint-visitor-keys": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.1.tgz", - "integrity": "sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==", + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", "dev": true, + "license": "Apache-2.0", "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, @@ -1174,10 +1457,11 @@ } }, "node_modules/eslint/node_modules/eslint-scope": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.0.tgz", - "integrity": "sha512-DYj5deGlHBfMt15J7rdtyKNq/Nqlv5KfU4iodrQ019XESsRnwXH9KAE0y3cwtUHDo2ob7CypAnCqefh6vioWRw==", + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "esrecurse": "^4.3.0", "estraverse": "^5.2.0" @@ -1194,17 +1478,19 @@ "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true, + "license": "BSD-2-Clause", "engines": { "node": ">=4.0" } }, "node_modules/espree": { - "version": "9.5.2", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.5.2.tgz", - "integrity": "sha512-7OASN1Wma5fum5SrNhFMAMJxOUAbhyfQ8dQ//PJaJbNw0URTPWqIghHWt1MmAANKhHZIYOHruW4Kw4ruUWOdGw==", + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { - "acorn": "^8.8.0", + "acorn": "^8.9.0", "acorn-jsx": "^5.3.2", "eslint-visitor-keys": "^3.4.1" }, @@ -1216,10 +1502,11 @@ } }, "node_modules/esquery": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", - "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", + "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "estraverse": "^5.1.0" }, @@ -1232,6 +1519,7 @@ "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true, + "license": "BSD-2-Clause", "engines": { "node": ">=4.0" } @@ -1241,6 +1529,7 @@ "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "estraverse": "^5.2.0" }, @@ -1253,6 +1542,7 @@ "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true, + "license": "BSD-2-Clause", "engines": { "node": ">=4.0" } @@ -1262,6 +1552,7 @@ "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", "dev": true, + "license": "BSD-2-Clause", "engines": { "node": ">=4.0" } @@ -1271,6 +1562,7 @@ "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "dev": true, + "license": "BSD-2-Clause", "engines": { "node": ">=0.10.0" } @@ -1279,13 +1571,15 @@ "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/fast-glob": { - "version": "3.2.12", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", - "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", "dev": true, + "license": "MIT", "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", @@ -1302,6 +1596,7 @@ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, + "license": "ISC", "dependencies": { "is-glob": "^4.0.1" }, @@ -1313,19 +1608,22 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/fastq": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", - "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", + "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", "dev": true, + "license": "ISC", "dependencies": { "reusify": "^1.0.4" } @@ -1335,6 +1633,7 @@ "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", "dev": true, + "license": "MIT", "dependencies": { "flat-cache": "^3.0.4" }, @@ -1347,6 +1646,7 @@ "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, + "license": "MIT", "dependencies": { "to-regex-range": "^5.0.1" }, @@ -1359,6 +1659,7 @@ "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", "dev": true, + "license": "MIT", "dependencies": { "locate-path": "^6.0.0", "path-exists": "^4.0.0" @@ -1371,12 +1672,14 @@ } }, "node_modules/flat-cache": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", - "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", + "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", "dev": true, + "license": "MIT", "dependencies": { - "flatted": "^3.1.0", + "flatted": "^3.2.9", + "keyv": "^4.5.3", "rimraf": "^3.0.2" }, "engines": { @@ -1384,16 +1687,18 @@ } }, "node_modules/flatted": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", - "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", - "dev": true + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", + "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==", + "dev": true, + "license": "ISC" }, "node_modules/for-each": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", "dev": true, + "license": "MIT", "dependencies": { "is-callable": "^1.1.3" } @@ -1402,24 +1707,30 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/function.prototype.name": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.5.tgz", - "integrity": "sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==", + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.6.tgz", + "integrity": "sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==", "dev": true, + "license": "MIT", "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.0", - "functions-have-names": "^1.2.2" + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "functions-have-names": "^1.2.3" }, "engines": { "node": ">= 0.4" @@ -1433,32 +1744,41 @@ "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", "dev": true, + "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/get-intrinsic": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.0.tgz", - "integrity": "sha512-L049y6nFOuom5wGyRc3/gdTLO94dySVKRACj1RmJZBQXlbTMhtNIgkWkUHq+jYmZvKf14EW1EoJnnjbmoHij0Q==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", "dev": true, + "license": "MIT", "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.3" + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/get-symbol-description": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz", - "integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.2.tgz", + "integrity": "sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==", "dev": true, + "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.1.1" + "call-bind": "^1.0.5", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4" }, "engines": { "node": ">= 0.4" @@ -1471,7 +1791,9 @@ "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", "dev": true, + "license": "ISC", "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -1492,6 +1814,7 @@ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", "dev": true, + "license": "ISC", "dependencies": { "is-glob": "^4.0.3" }, @@ -1500,10 +1823,11 @@ } }, "node_modules/globals": { - "version": "13.20.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", - "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", "dev": true, + "license": "MIT", "dependencies": { "type-fest": "^0.20.2" }, @@ -1515,12 +1839,14 @@ } }, "node_modules/globalthis": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz", - "integrity": "sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz", + "integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==", "dev": true, + "license": "MIT", "dependencies": { - "define-properties": "^1.1.3" + "define-properties": "^1.2.1", + "gopd": "^1.0.1" }, "engines": { "node": ">= 0.4" @@ -1534,6 +1860,7 @@ "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", "dev": true, + "license": "MIT", "dependencies": { "array-union": "^2.1.0", "dir-glob": "^3.0.1", @@ -1554,6 +1881,7 @@ "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", "dev": true, + "license": "MIT", "dependencies": { "get-intrinsic": "^1.1.3" }, @@ -1561,29 +1889,19 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/grapheme-splitter": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", - "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", - "dev": true - }, - "node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", "dev": true, - "dependencies": { - "function-bind": "^1.1.1" - }, - "engines": { - "node": ">= 0.4.0" - } + "license": "MIT" }, "node_modules/has-bigints": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", "dev": true, + "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -1593,27 +1911,30 @@ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/has-property-descriptors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", - "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", "dev": true, + "license": "MIT", "dependencies": { - "get-intrinsic": "^1.1.1" + "es-define-property": "^1.0.0" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/has-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", - "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -1626,6 +1947,7 @@ "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -1634,12 +1956,13 @@ } }, "node_modules/has-tostringtag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", - "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", "dev": true, + "license": "MIT", "dependencies": { - "has-symbols": "^1.0.2" + "has-symbols": "^1.0.3" }, "engines": { "node": ">= 0.4" @@ -1648,22 +1971,37 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/hint": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/hint/-/hint-2.0.0.tgz", "integrity": "sha512-T1sPD0we/dH8l+V57rQtx0QKz+wpugcuDfJLsj/lkO+1+4Rmz9oOtwcKB2ydTbeOXAez/2dsKxjP5scUEkSuyg==", "deprecated": "Versions prior to v3 are deprecated as project changed ownership and scope.", "dev": true, + "license": "MIT", "dependencies": { "insert-rule": "^2.1.0", "nib": "^1.0.3" } }, "node_modules/ignore": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", - "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", "dev": true, + "license": "MIT", "engines": { "node": ">= 4" } @@ -1673,6 +2011,7 @@ "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", "dev": true, + "license": "MIT", "dependencies": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" @@ -1689,6 +2028,7 @@ "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.8.19" } @@ -1697,7 +2037,9 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", "dev": true, + "license": "ISC", "dependencies": { "once": "^1.3.0", "wrappy": "1" @@ -1707,22 +2049,25 @@ "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/insert-rule": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/insert-rule/-/insert-rule-2.1.0.tgz", "integrity": "sha512-wc9EENu1wzZZNSVVRfb/j9COmIjqEHKA8oDT26dP62+zl57vy963EO873s8yAZBeNQIDcCuO0ZMYl57TjktSjA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/internal-slot": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.5.tgz", - "integrity": "sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.7.tgz", + "integrity": "sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==", "dev": true, + "license": "MIT", "dependencies": { - "get-intrinsic": "^1.2.0", - "has": "^1.0.3", + "es-errors": "^1.3.0", + "hasown": "^2.0.0", "side-channel": "^1.0.4" }, "engines": { @@ -1730,14 +2075,17 @@ } }, "node_modules/is-array-buffer": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.2.tgz", - "integrity": "sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.4.tgz", + "integrity": "sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==", "dev": true, + "license": "MIT", "dependencies": { "call-bind": "^1.0.2", - "get-intrinsic": "^1.2.0", - "is-typed-array": "^1.1.10" + "get-intrinsic": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -1748,6 +2096,7 @@ "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", "dev": true, + "license": "MIT", "dependencies": { "has-bigints": "^1.0.1" }, @@ -1760,6 +2109,7 @@ "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", "dev": true, + "license": "MIT", "dependencies": { "call-bind": "^1.0.2", "has-tostringtag": "^1.0.0" @@ -1776,6 +2126,7 @@ "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -1784,12 +2135,32 @@ } }, "node_modules/is-core-module": { - "version": "2.12.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.12.0.tgz", - "integrity": "sha512-RECHCBCd/viahWmwj6enj19sKbHfJrddi/6cBDsNTKbNq0f7VeaUkBo60BqzvPqo/W54ChS62Z5qyun7cfOMqQ==", + "version": "2.15.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.1.tgz", + "integrity": "sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-data-view": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.1.tgz", + "integrity": "sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==", "dev": true, + "license": "MIT", "dependencies": { - "has": "^1.0.3" + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -1800,6 +2171,7 @@ "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", "dev": true, + "license": "MIT", "dependencies": { "has-tostringtag": "^1.0.0" }, @@ -1815,6 +2187,7 @@ "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -1824,6 +2197,7 @@ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, + "license": "MIT", "dependencies": { "is-extglob": "^2.1.1" }, @@ -1832,10 +2206,11 @@ } }, "node_modules/is-negative-zero": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz", - "integrity": "sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz", + "integrity": "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -1848,6 +2223,7 @@ "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.12.0" } @@ -1857,6 +2233,7 @@ "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", "dev": true, + "license": "MIT", "dependencies": { "has-tostringtag": "^1.0.0" }, @@ -1872,6 +2249,7 @@ "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -1881,6 +2259,7 @@ "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", "dev": true, + "license": "MIT", "dependencies": { "call-bind": "^1.0.2", "has-tostringtag": "^1.0.0" @@ -1893,12 +2272,16 @@ } }, "node_modules/is-shared-array-buffer": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz", - "integrity": "sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.3.tgz", + "integrity": "sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==", "dev": true, + "license": "MIT", "dependencies": { - "call-bind": "^1.0.2" + "call-bind": "^1.0.7" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -1909,6 +2292,7 @@ "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", "dev": true, + "license": "MIT", "dependencies": { "has-tostringtag": "^1.0.0" }, @@ -1924,6 +2308,7 @@ "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", "dev": true, + "license": "MIT", "dependencies": { "has-symbols": "^1.0.2" }, @@ -1935,16 +2320,13 @@ } }, "node_modules/is-typed-array": { - "version": "1.1.10", - "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.10.tgz", - "integrity": "sha512-PJqgEHiWZvMpaFZ3uTc8kHPM4+4ADTlDniuQL7cU/UDA0Ql7F70yGfHph3cLNe+c9toaigv+DFzTJKhc2CtO6A==", + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.13.tgz", + "integrity": "sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==", "dev": true, + "license": "MIT", "dependencies": { - "available-typed-arrays": "^1.0.5", - "call-bind": "^1.0.2", - "for-each": "^0.3.3", - "gopd": "^1.0.1", - "has-tostringtag": "^1.0.0" + "which-typed-array": "^1.1.14" }, "engines": { "node": ">= 0.4" @@ -1958,6 +2340,7 @@ "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", "dev": true, + "license": "MIT", "dependencies": { "call-bind": "^1.0.2" }, @@ -1965,17 +2348,26 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true, + "license": "MIT" + }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/jasmine": { "version": "3.99.0", "resolved": "https://registry.npmjs.org/jasmine/-/jasmine-3.99.0.tgz", "integrity": "sha512-YIThBuHzaIIcjxeuLmPD40SjxkEcc8i//sGMDKCgkRMVgIwRJf5qyExtlJpQeh7pkeoBSOe6lQEdg+/9uKg9mw==", "dev": true, + "license": "MIT", "dependencies": { "glob": "^7.1.6", "jasmine-core": "~3.99.0" @@ -1988,23 +2380,15 @@ "version": "3.99.1", "resolved": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-3.99.1.tgz", "integrity": "sha512-Hu1dmuoGcZ7AfyynN3LsfruwMbxMALMka+YtZeGoLuDEySVmVAPaonkNoBRIw/ectu8b9tVQCJNgp4a4knp+tg==", - "dev": true - }, - "node_modules/js-sdsl": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.4.0.tgz", - "integrity": "sha512-FfVSdx6pJ41Oa+CF7RDaFmTnCaFhua+SNYQX74riGOpl96x+2jQCqEfQ2bnXu/5DPCqlRuiqyvTJM0Qjz26IVg==", "dev": true, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/js-sdsl" - } + "license": "MIT" }, "node_modules/js-yaml": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dev": true, + "license": "MIT", "dependencies": { "argparse": "^2.0.1" }, @@ -2012,23 +2396,33 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true, + "license": "MIT" + }, "node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/json-stable-stringify-without-jsonify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/json5": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", "dev": true, + "license": "MIT", "dependencies": { "minimist": "^1.2.0" }, @@ -2036,11 +2430,22 @@ "json5": "lib/cli.js" } }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "json-buffer": "3.0.1" + } + }, "node_modules/levn": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", "dev": true, + "license": "MIT", "dependencies": { "prelude-ls": "^1.2.1", "type-check": "~0.4.0" @@ -2054,6 +2459,7 @@ "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", "dev": true, + "license": "MIT", "dependencies": { "p-locate": "^5.0.0" }, @@ -2068,24 +2474,27 @@ "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", "dev": true, + "license": "MIT", "engines": { "node": ">= 8" } }, "node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dev": true, + "license": "MIT", "dependencies": { - "braces": "^3.0.2", + "braces": "^3.0.3", "picomatch": "^2.3.1" }, "engines": { @@ -2097,6 +2506,7 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" }, @@ -2109,33 +2519,38 @@ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", "dev": true, + "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" }, "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/natural-compare-lite": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz", "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/nib": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/nib/-/nib-1.2.0.tgz", "integrity": "sha512-7HgrnMl/3yOmWykueO8/D0q+0iWwe7Z+CK2Eaq/xQV8w1hK80WN1oReRQkfkrztbAAnp/nTHkUSl5EcVkor6JQ==", "dev": true, + "license": "MIT", "engines": { "node": "*" }, @@ -2144,10 +2559,14 @@ } }, "node_modules/object-inspect": { - "version": "1.12.3", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", - "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", + "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==", "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -2157,18 +2576,20 @@ "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.4" } }, "node_modules/object.assign": { - "version": "4.1.4", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz", - "integrity": "sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==", + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz", + "integrity": "sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==", "dev": true, + "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", "has-symbols": "^1.0.3", "object-keys": "^1.1.1" }, @@ -2179,15 +2600,50 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/object.fromentries": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.8.tgz", + "integrity": "sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object.groupby": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.3.tgz", + "integrity": "sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/object.values": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.6.tgz", - "integrity": "sha512-FVVTkD1vENCsAcwNs9k6jea2uHC/X0+JcjG8YA60FN5CMaJmG95wT9jek/xX9nornqGRrBkKtzuAu2wuHpKqvw==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.2.0.tgz", + "integrity": "sha512-yBYjY9QX2hnRmZHAjG/f13MzmBzxzYgQhFrke06TTyKY5zSTEqkOeukBzIdVA3j3ulu8Qa3MbVFShV7T2RmGtQ==", "dev": true, + "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" }, "engines": { "node": ">= 0.4" @@ -2201,22 +2657,24 @@ "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", "dev": true, + "license": "ISC", "dependencies": { "wrappy": "1" } }, "node_modules/optionator": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", - "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", "dev": true, + "license": "MIT", "dependencies": { "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", "levn": "^0.4.1", "prelude-ls": "^1.2.1", "type-check": "^0.4.0", - "word-wrap": "^1.2.3" + "word-wrap": "^1.2.5" }, "engines": { "node": ">= 0.8.0" @@ -2227,6 +2685,7 @@ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, + "license": "MIT", "dependencies": { "yocto-queue": "^0.1.0" }, @@ -2242,6 +2701,7 @@ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "dev": true, + "license": "MIT", "dependencies": { "p-limit": "^3.0.2" }, @@ -2257,6 +2717,7 @@ "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", "dev": true, + "license": "MIT", "dependencies": { "callsites": "^3.0.0" }, @@ -2269,6 +2730,7 @@ "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -2278,6 +2740,7 @@ "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -2287,6 +2750,7 @@ "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -2295,13 +2759,15 @@ "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/path-type": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -2311,6 +2777,7 @@ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "dev": true, + "license": "MIT", "engines": { "node": ">=8.6" }, @@ -2318,28 +2785,42 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/possible-typed-array-names": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz", + "integrity": "sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, "node_modules/prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.8.0" } }, "node_modules/punycode": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", - "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/qcobjects": { - "version": "2.4.84", - "resolved": "https://registry.npmjs.org/qcobjects/-/qcobjects-2.4.84.tgz", - "integrity": "sha512-9gHFzTwpl77tKn71RBkG2J0P37eNAG+NswSOQ6T2aZWYLmKF89ZaQl4k/BR6aah57OTWNva7bM32HHgs846GaQ==", + "version": "2.4.99", + "resolved": "https://registry.npmjs.org/qcobjects/-/qcobjects-2.4.99.tgz", + "integrity": "sha512-RtQJ1CKsEtxnEs1ZkX4kjaXaqBQirwYlMk+gC7zmOVufMlHNI8qm3HgN/tmACWe+vDXug5rPEZ5JSQjJNyJLhw==", + "dev": true, + "license": "LGPL-3.0", "peer": true, "engines": { "node": ">=18", @@ -2348,16 +2829,32 @@ "peerDependencies": { "@types/qcobjects": "github:QCObjects/-types-qcobjects", "@types/qcobjects-sdk": "github:QCObjects/-types-qcobjects-sdk", - "qcobjects-sdk": "^2.4.38" + "qcobjects-sdk": ">=2.4.64" } }, "node_modules/qcobjects-sdk": { - "version": "2.4.64", - "resolved": "https://registry.npmjs.org/qcobjects-sdk/-/qcobjects-sdk-2.4.64.tgz", - "integrity": "sha512-eh8VGvB3h4EoKokCZuB8OaeuqicF+6PIm0Wn+9cetKgPgEpaDQLtII/TcqmD4qjAmZvlYJmijDeAGYWMNMeHfQ==", - "peer": true, + "version": "2.4.66", + "resolved": "https://registry.npmjs.org/qcobjects-sdk/-/qcobjects-sdk-2.4.66.tgz", + "integrity": "sha512-8k6NVqQrsZryDYtAVPAkx2a3tj7aEfbAX5FDs+SJLvVyB+F41agkGhEp2dzcjqK3DTKXCPfHl4n+l2Jfs5sqcw==", + "dev": true, + "license": "LGPL-3.0", + "peerDependencies": { + "qcobjects": ">=2.4.99" + } + }, + "node_modules/qcobjects-tsconfig": { + "version": "2.4.10", + "resolved": "https://registry.npmjs.org/qcobjects-tsconfig/-/qcobjects-tsconfig-2.4.10.tgz", + "integrity": "sha512-sM2wfZNrbKPs9UL/u79KoBkDrubmRm5JNxDyWuehEBJL0UFPzpIbtpokqiUd0ASOH7hKq/kL5+fHFlxwLU0gRw==", + "dev": true, + "license": "LGPL-3.0", + "engines": { + "node": ">=18", + "npm": ">=9" + }, "peerDependencies": { - "qcobjects": ">=2.4.84" + "@types/qcobjects": "github:QCObjects/-types-qcobjects", + "@types/qcobjects-sdk": "github:QCObjects/-types-qcobjects-sdk" } }, "node_modules/queue-microtask": { @@ -2378,17 +2875,20 @@ "type": "consulting", "url": "https://feross.org/support" } - ] + ], + "license": "MIT" }, "node_modules/regexp.prototype.flags": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.0.tgz", - "integrity": "sha512-0SutC3pNudRKgquxGoRGIz946MZVHqbNfPjBdxeOhBrdgDKlRoXmYLQN9xRbrR09ZXWeGAdPuif7egofn6v5LA==", + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.3.tgz", + "integrity": "sha512-vqlC04+RQoFalODCbCumG2xIOvapzVMHwsyIGM/SIE8fRhFFsXeH8/QQ+s0T0kDAhKc4k30s73/0ydkHQz6HlQ==", "dev": true, + "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "functions-have-names": "^1.2.3" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-errors": "^1.3.0", + "set-function-name": "^2.0.2" }, "engines": { "node": ">= 0.4" @@ -2402,6 +2902,7 @@ "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" }, @@ -2410,12 +2911,13 @@ } }, "node_modules/resolve": { - "version": "1.22.2", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.2.tgz", - "integrity": "sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==", + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", "dev": true, + "license": "MIT", "dependencies": { - "is-core-module": "^2.11.0", + "is-core-module": "^2.13.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, @@ -2431,6 +2933,7 @@ "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true, + "license": "MIT", "engines": { "node": ">=4" } @@ -2440,6 +2943,7 @@ "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", "dev": true, + "license": "MIT", "engines": { "iojs": ">=1.0.0", "node": ">=0.10.0" @@ -2449,7 +2953,9 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", "dev": true, + "license": "ISC", "dependencies": { "glob": "^7.1.3" }, @@ -2479,29 +2985,54 @@ "url": "https://feross.org/support" } ], + "license": "MIT", "dependencies": { "queue-microtask": "^1.2.2" } }, + "node_modules/safe-array-concat": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.2.tgz", + "integrity": "sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "get-intrinsic": "^1.2.4", + "has-symbols": "^1.0.3", + "isarray": "^2.0.5" + }, + "engines": { + "node": ">=0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/safe-regex-test": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.0.tgz", - "integrity": "sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.3.tgz", + "integrity": "sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==", "dev": true, + "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.1.3", + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", "is-regex": "^1.1.4" }, + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/sax": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", - "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.3.0.tgz", + "integrity": "sha512-0s+oAmw9zLl1V1cS9BtZN7JAd0cW5e0QH4W3LWEK6a4LaLEA2OTpGYWDY+6XasBLtz6wkm3u1xRw95mRuJ59WA==", "dev": true, + "license": "ISC", "peer": true }, "node_modules/semver": { @@ -2509,6 +3040,7 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", "dev": true, + "license": "ISC", "bin": { "semver": "bin/semver.js" }, @@ -2516,11 +3048,46 @@ "node": ">=10" } }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/set-function-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", + "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "functions-have-names": "^1.2.3", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "dev": true, + "license": "MIT", "dependencies": { "shebang-regex": "^3.0.0" }, @@ -2533,19 +3100,25 @@ "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/side-channel": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", - "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", "dev": true, + "license": "MIT", "dependencies": { - "call-bind": "^1.0.0", - "get-intrinsic": "^1.0.2", - "object-inspect": "^1.9.0" + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -2556,6 +3129,7 @@ "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -2565,20 +3139,23 @@ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz", "integrity": "sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==", "dev": true, + "license": "BSD-3-Clause", "peer": true, "engines": { "node": ">= 8" } }, "node_modules/string.prototype.trim": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.7.tgz", - "integrity": "sha512-p6TmeT1T3411M8Cgg9wBTMRtY2q9+PNy9EV1i2lIXUN/btt763oIfxwN3RR8VU6wHX8j/1CFy0L+YuThm6bgOg==", + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.9.tgz", + "integrity": "sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==", "dev": true, + "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.0", + "es-object-atoms": "^1.0.0" }, "engines": { "node": ">= 0.4" @@ -2588,28 +3165,33 @@ } }, "node_modules/string.prototype.trimend": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.6.tgz", - "integrity": "sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.8.tgz", + "integrity": "sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ==", "dev": true, + "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/string.prototype.trimstart": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.6.tgz", - "integrity": "sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz", + "integrity": "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==", "dev": true, + "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -2620,6 +3202,7 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, + "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" }, @@ -2632,6 +3215,7 @@ "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", "dev": true, + "license": "MIT", "engines": { "node": ">=4" } @@ -2641,6 +3225,7 @@ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" }, @@ -2649,16 +3234,17 @@ } }, "node_modules/stylus": { - "version": "0.59.0", - "resolved": "https://registry.npmjs.org/stylus/-/stylus-0.59.0.tgz", - "integrity": "sha512-lQ9w/XIOH5ZHVNuNbWW8D822r+/wBSO/d6XvtyHLF7LW4KaCIDeVbvn5DF8fGCJAUCwVhVi/h6J0NUcnylUEjg==", + "version": "0.63.0", + "resolved": "https://registry.npmjs.org/stylus/-/stylus-0.63.0.tgz", + "integrity": "sha512-OMlgrTCPzE/ibtRMoeLVhOY0RcNuNWh0rhAVqeKnk/QwcuUKQbnqhZ1kg2vzD8VU/6h3FoPTq4RJPHgLBvX6Bw==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "@adobe/css-tools": "^4.0.1", + "@adobe/css-tools": "~4.3.3", "debug": "^4.3.2", "glob": "^7.1.6", - "sax": "~1.2.4", + "sax": "~1.3.0", "source-map": "^0.7.3" }, "bin": { @@ -2676,6 +3262,7 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, + "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -2688,6 +3275,7 @@ "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -2699,13 +3287,15 @@ "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "dev": true, + "license": "MIT", "dependencies": { "is-number": "^7.0.0" }, @@ -2714,10 +3304,11 @@ } }, "node_modules/tsconfig-paths": { - "version": "3.14.2", - "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.2.tgz", - "integrity": "sha512-o/9iXgCYc5L/JxCHPe3Hvh8Q/2xm5Z+p18PESBU6Ff33695QnCHBEjcytY2q19ua7Mbl/DavtBOLq+oG0RCL+g==", + "version": "3.15.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", + "integrity": "sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==", "dev": true, + "license": "MIT", "dependencies": { "@types/json5": "^0.0.29", "json5": "^1.0.2", @@ -2729,13 +3320,15 @@ "version": "1.14.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true + "dev": true, + "license": "0BSD" }, "node_modules/tsutils": { "version": "3.21.0", "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", "dev": true, + "license": "MIT", "dependencies": { "tslib": "^1.8.1" }, @@ -2751,6 +3344,7 @@ "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", "dev": true, + "license": "MIT", "dependencies": { "prelude-ls": "^1.2.1" }, @@ -2763,6 +3357,7 @@ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", "dev": true, + "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=10" }, @@ -2770,15 +3365,78 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/typed-array-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.2.tgz", + "integrity": "sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/typed-array-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.1.tgz", + "integrity": "sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-byte-offset": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.2.tgz", + "integrity": "sha512-Ous0vodHa56FviZucS2E63zkgtgrACj7omjwd/8lTEMEPFFyjfixMZ1ZXenpgCFBBt4EC1J2XsyVS2gkG0eTFA==", + "dev": true, + "license": "MIT", + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/typed-array-length": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.4.tgz", - "integrity": "sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.6.tgz", + "integrity": "sha512-/OxDN6OtAk5KBpGb28T+HZc2M+ADtvRxXrKKbUwtsLgdoxgX13hyy7ek6bFRl5+aBs2yZzB0c4CnQfAtVypW/g==", "dev": true, + "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", + "call-bind": "^1.0.7", "for-each": "^0.3.3", - "is-typed-array": "^1.1.9" + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13", + "possible-typed-array-names": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -2803,6 +3461,7 @@ "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", "dev": true, + "license": "MIT", "dependencies": { "call-bind": "^1.0.2", "has-bigints": "^1.0.2", @@ -2813,11 +3472,19 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true, + "license": "MIT" + }, "node_modules/uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "punycode": "^2.1.0" } @@ -2827,6 +3494,7 @@ "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, + "license": "ISC", "dependencies": { "isexe": "^2.0.0" }, @@ -2842,6 +3510,7 @@ "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", "dev": true, + "license": "MIT", "dependencies": { "is-bigint": "^1.0.1", "is-boolean-object": "^1.1.0", @@ -2854,17 +3523,17 @@ } }, "node_modules/which-typed-array": { - "version": "1.1.9", - "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.9.tgz", - "integrity": "sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA==", + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.15.tgz", + "integrity": "sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==", "dev": true, + "license": "MIT", "dependencies": { - "available-typed-arrays": "^1.0.5", - "call-bind": "^1.0.2", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", "for-each": "^0.3.3", "gopd": "^1.0.1", - "has-tostringtag": "^1.0.0", - "is-typed-array": "^1.1.10" + "has-tostringtag": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -2878,6 +3547,7 @@ "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -2886,13 +3556,15 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=10" }, diff --git a/package.json b/package.json index d77805e7..97be8f59 100644 --- a/package.json +++ b/package.json @@ -5,15 +5,16 @@ "main": "build/index.cjs", "module": "build/index.mjs", "browser": "browser/index.js", + "type": "commonjs", + "types": "src/**/*.d.ts", "exports": { ".": { - "require": "./src/index.cjs", - "import": "./src/index.mjs" + "require": "./build/index.cjs", + "import": "./build/index.mjs", + "types": "./src/types.d.ts" }, "./package.json": "./package.json" }, - "type": "commonjs", - "types": "./src/index.d.ts", "license": "LGPL-3.0", "scripts": { "build": "npm run build:ts && npm run build:browser", @@ -24,8 +25,16 @@ "lint": "(npx -y eslint@8.40.0 src/**/*.ts --fix --ext ts)", "preversion": "npm cache verify && npm test", "sync": "git add . && git commit -am ", - "postversion": "git push && git push --tags ", - "generate-readme-pdf": "npx markdown-pdf --paper-format \"Letter\" -o README.pdf README.md && npx markdown-pdf --paper-format \"Letter\" -o README-es.pdf README-es.md" + "postversion": "git push && git push --tags", + "v-patch": "qcobjects v-patch", + "v-minor": "qcobjects v-minor", + "v-major": "qcobjects v-major", + "qcobjects": "qcobjects", + "cli": "qcobjects", + "prepare": "node -e \"if(!require('fs').existsSync('.git')){process.exit(0)}\" || npx -y husky install", + "cli:help": "qcobjects --help", + "tree": "tree -d --gitignore", + "generate-readme-pdf": "(npx -y markdown-pdf --paper-format \"Letter\" -o README.pdf README.md && npx markdown-pdf --paper-format \"Letter\" -o README-es.pdf README-es.md) && npm uninstall markdown-pdf" }, "repository": { "type": "git", @@ -90,6 +99,8 @@ }, "homepage": "https://qcobjects.com", "devDependencies": { + "@types/qcobjects": "github:QCObjects/-types-qcobjects", + "@types/qcobjects-sdk": "github:QCObjects/-types-qcobjects-sdk", "@typescript-eslint/eslint-plugin": "^5.58.0", "@typescript-eslint/parser": "^5.58.0", "eslint": "^8.40.0", @@ -101,13 +112,16 @@ "eslint-plugin-promise": "^6.1.1", "hint": "^2.0.0", "jasmine": "^3.7.0", - "typescript": "^5.6.3" + "typescript": "^5.6.3", + "qcobjects-sdk": "^2.4.66", + "qcobjects-tsconfig": "^2.4.10" }, "peerDependencies": { "@types/qcobjects": "github:QCObjects/-types-qcobjects", "@types/qcobjects-sdk": "github:QCObjects/-types-qcobjects-sdk", "qcobjects-sdk": ">=2.4.64" }, + "dependencies": {}, "engines": { "npm": ">=10", "node": ">=20" diff --git a/src/QCObjects.js b/src/QCObjects.js index 1cee2b35..b867168f 100644 --- a/src/QCObjects.js +++ b/src/QCObjects.js @@ -28,1560 +28,1565 @@ /*eslint strict: "off"*/ /*eslint no-mixed-operators: "off"*/ -(function __qcobjects__ (_top) { - "use strict"; - if (typeof Object.defineProperty !== "undefined" && typeof _top !== "undefined"){ - try { - Object.defineProperty(_top,"__qcobjects__", { - enumerable: true, - configurable: false, - writable: false, - value: __qcobjects__, - }); - } catch (e){ - if (typeof _top.__qcobjects__ !== "undefined"){ - _top.__qcobjects__.loaded = true; - } - } + +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD + define([], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS + module.exports = factory(); + module.exports.default = factory(); + } else { + // Browser globals + root.qcobjects = factory(); } - if (typeof _top.__qcobjects__.loaded === "undefined"){ - _top.__qcobjects__.loaded = true; - - var global = _top; - _top.global = global; - - var isDeno = (typeof window !== "undefined" && "Deno" in window); - var isBrowser = (typeof window !== "undefined" && typeof window.self !== "undefined" && window === window.self) && !isDeno; - var isNodeCommonJS = (typeof module !== "undefined") ? (true): (false); - var deno_require = function (){ /* not yet implemented */}; - var _require_ = function (){ - return (isDeno)?(deno_require(...arguments)):(require(...arguments)); - }; - - var _protected_code_ = function (_) { - var __oldtoString = (typeof _.prototype !== "undefined") ? (_.prototype.toString) : (function () { - return ""; - }); - if (typeof _.prototype !== "undefined") { - _.prototype.toString = function () { - var _protected_symbols = [ - "__qcobjects__", - "__qcobjects_sdk__", - "__loaded__", - "ComplexStorageCache", - "css", - "append", - "attachIn", - "debug", - "info", - "warn", - "QC_Append", - "set", - "get", - "done", - "componentDone", - "_new_", - "__new__", - "Class", - "ClassFactory", - "New", - "Export", - "Package", - "Import", - "subelements", - "componentLoader", - "buildComponents", - "Controller", - "View", - "VO", - "Service", - "serviceLoader", - "JSONService", - "ConfigService", - "SourceJS", - "SourceCSS", - "ArrayList", - "ArrayCollection", - "Effect", - "Timer", - "sum", - "avg", - "table", - "max", - "min", - "range", - "matrix", - "matrix2d", - "matrix3d", - "unique", - "uniqueId", - "shortCode", - "NamespaceRef" - ]; - var _ret_; - if (_protected_symbols.includes(this.name)) { - _ret_ = this.name + "{ [QCObjects native code] }"; - } else { - _ret_ = __oldtoString.call(this); - } - return _ret_; - }; - } - }; - (_protected_code_)(Function); - var _methods_ = function (_) { - var _m = []; - for (var i in _) { - if ((typeof _[i]).toLowerCase() === "function") { - _m.push(_[i]); +}(typeof self !== 'undefined' ? self : this, function () { + + function __qcobjects__ (_top) { + + + if (typeof Object.defineProperty !== "undefined" && typeof _top !== "undefined") { + try { + Object.defineProperty(_top, "__qcobjects__", { + enumerable: true, + configurable: false, + writable: false, + value: __qcobjects__, + }); + } catch (e) { + if (typeof _top.__qcobjects__ !== "undefined") { + _top.__qcobjects__.loaded = true; } } - return _m; - }; - - String.prototype.__mAll__ = function (regex) { - // This is an alternative to old browsers that dont support String.prototype.matchAll - // https://github.com/tc39/proposal-string-matchall - var matches = []; - this.replace(regex, function () { - var match = Array.prototype.slice.call(arguments, 0, -2); - match.input = arguments[arguments.length - 1]; - match.index = arguments[arguments.length - 2]; - matches.push(match); - }); - return matches; - }; - if (typeof String.prototype.matchAll === "undefined") { - String.prototype.matchAll = String.prototype.__mAll__; - } - var _DOMCreateElement = function (elementName) { - var _ret_; - if (isBrowser) { - _ret_ = document.createElement(elementName); - } else { - _ret_ = {}; - } - return _ret_; - }; - - if (!isBrowser) { - const fs = _require_("fs"); } + if (typeof _top.__qcobjects__.loaded === "undefined") { + _top.__qcobjects__.loaded = true; + + var global = _top; + _top.global = global; + + var isDeno = (typeof window !== "undefined" && "Deno" in window); + var isBrowser = (typeof window !== "undefined" && typeof window.self !== "undefined" && window === window.self) && !isDeno; + var isNodeCommonJS = (typeof module !== "undefined") ? (true) : (false); + var deno_require = function () { /* not yet implemented */ }; + var _require_ = function () { + return (isDeno) ? (deno_require(...arguments)) : (require(...arguments)); + }; - var _DataStringify = function (data) { - var getCircularReplacer = function () { - var seen = new WeakSet(); - var _level = 0; - return function (key, value) { - if (typeof value === "object" && value !== null) { - if (seen.has(value)) { - _level += 1; - return (_level <= 3) ? (_LegacyCopy(value)) : (null); + var _protected_code_ = function (_) { + var __oldtoString = (typeof _.prototype !== "undefined") ? (_.prototype.toString) : (function () { + return ""; + }); + if (typeof _.prototype !== "undefined") { + _.prototype.toString = function () { + var _protected_symbols = [ + "__qcobjects__", + "__qcobjects_sdk__", + "__loaded__", + "ComplexStorageCache", + "css", + "append", + "attachIn", + "debug", + "info", + "warn", + "QC_Append", + "set", + "get", + "done", + "componentDone", + "_new_", + "__new__", + "Class", + "ClassFactory", + "New", + "Export", + "Package", + "Import", + "subelements", + "componentLoader", + "buildComponents", + "Controller", + "View", + "VO", + "Service", + "serviceLoader", + "JSONService", + "ConfigService", + "SourceJS", + "SourceCSS", + "ArrayList", + "ArrayCollection", + "Effect", + "Timer", + "sum", + "avg", + "table", + "max", + "min", + "range", + "matrix", + "matrix2d", + "matrix3d", + "unique", + "uniqueId", + "shortCode", + "NamespaceRef" + ]; + var _ret_; + if (_protected_symbols.includes(this.name)) { + _ret_ = this.name + "{ [QCObjects native code] }"; + } else { + _ret_ = __oldtoString.call(this); } - seen.add(value); + return _ret_; + }; + } + }; + (_protected_code_)(Function); + var _methods_ = function (_) { + var _m = []; + for (var i in _) { + if ((typeof _[i]).toLowerCase() === "function") { + _m.push(_[i]); } - return value; - }; + } + return _m; }; - return JSON.stringify(data, getCircularReplacer()); - }; - if (isBrowser) { - var _subelements = function subelements(selector) { - return [...this.querySelectorAll(selector)]; + String.prototype.__mAll__ = function (regex) { + // This is an alternative to old browsers that dont support String.prototype.matchAll + // https://github.com/tc39/proposal-string-matchall + var matches = []; + this.replace(regex, function () { + var match = Array.prototype.slice.call(arguments, 0, -2); + match.input = arguments[arguments.length - 1]; + match.index = arguments[arguments.length - 2]; + matches.push(match); + }); + return matches; }; - Element.prototype.subelements = _subelements; - HTMLDocument.prototype.subelements = _subelements; - HTMLElement.prototype.subelements = _subelements; - if (typeof ShadowRoot !== "undefined") { - ShadowRoot.prototype.subelements = _subelements; + if (typeof String.prototype.matchAll === "undefined") { + String.prototype.matchAll = String.prototype.__mAll__; } - } - if (isBrowser) { - try { - _top = (typeof window.top !== "undefined") ? (window.top) : (window); - _top["_allowed_"] = true; - } catch (e) { - try { - _top = document; - _top["_allowed_"] = true; - } catch (e2) { - try { - _top = global; - _top["_allowed_"] = true; - } catch (e3) { - _top = {}; - _top["_allowed_"] = true; - } - } - } - } else if (typeof global !== "undefined") { - _top = global; - } - var _domain_, _basePath_; - var _tag_filter_ = "quick-component:not([loaded]),component:not([loaded])"; - _basePath_ = ( - function () { - var _basePath = ""; + var _DOMCreateElement = function (elementName) { + var _ret_; if (isBrowser) { - var baseURI = _top.document.baseURI.split("?")[0].split("/"); - baseURI.pop(); - _basePath = baseURI.join("/") + "/"; + _ret_ = document.createElement(elementName); } else { - var process; - try { - process = _require_("process"); - } catch (e) { - // not a process module - } - if (typeof process !== "undefined") { - _basePath = `${process.cwd()}/`; - } else { - _basePath = ""; - } + _ret_ = {}; } - return _basePath; + return _ret_; + }; + + if (!isBrowser) { + const fs = _require_("fs"); } - )(); - if (isBrowser) { - /** - * Polyfilling Promise - */ - if (!("Promise" in _top)) { - _top.Promise = function (_f) { - var _p = { - then() {}, - catch () {}, - _then(response) { - this.then.call(_p, response); - }, - _catch(response) { - this.catch.call(_p, response); + + var _DataStringify = function (data) { + var getCircularReplacer = function () { + var seen = new WeakSet(); + var _level = 0; + return function (key, value) { + if (typeof value === "object" && value !== null) { + if (seen.has(value)) { + _level += 1; + return (_level <= 3) ? (_LegacyCopy(value)) : (null); + } + seen.add(value); } + return value; }; - _f.call(_p, _p._then, _p._catch); - return _p; }; + return JSON.stringify(data, getCircularReplacer()); + }; + + if (isBrowser) { + var _subelements = function subelements(selector) { + return [...this.querySelectorAll(selector)]; + }; + Element.prototype.subelements = _subelements; + HTMLDocument.prototype.subelements = _subelements; + HTMLElement.prototype.subelements = _subelements; + if (typeof ShadowRoot !== "undefined") { + ShadowRoot.prototype.subelements = _subelements; + } } - if (typeof _top.console === "undefined") { - _top.console = function () {}; - _top.console.prototype.log = function (message) {}; + if (isBrowser) { + try { + _top = (typeof window.top !== "undefined") ? (window.top) : (window); + _top["_allowed_"] = true; + } catch (e) { + try { + _top = document; + _top["_allowed_"] = true; + } catch (e2) { + try { + _top = global; + _top["_allowed_"] = true; + } catch (e3) { + _top = {}; + _top["_allowed_"] = true; + } + } + } + } else if (typeof global !== "undefined") { + _top = global; } - - _domain_ = ( + var _domain_, _basePath_; + var _tag_filter_ = "quick-component:not([loaded]),component:not([loaded])"; + _basePath_ = ( function () { - return (typeof document !== "undefined" && document.domain !== "") ? (document.domain) : ("localhost"); + var _basePath = ""; + if (isBrowser) { + var baseURI = _top.document.baseURI.split("?")[0].split("/"); + baseURI.pop(); + _basePath = baseURI.join("/") + "/"; + } else { + var process; + try { + process = _require_("process"); + } catch (e) { + // not a process module + } + if (typeof process !== "undefined") { + _basePath = `${process.cwd()}/`; + } else { + _basePath = ""; + } + } + return _basePath; } )(); - - var _secretKey = ( - function () { - var __secretKey = _top[(![] + [])[((+!+[]) + (+!+[]))] + (typeof ![])[(+!+[])] + (typeof [])[((+!+[]) + (+!+[])) * ((+!+[]) + (+!+[]))] + (![] + [])[(+!+[])] + (!![] + [])[(+[])] + ([] + [] + [][ - [] - ])[(+[+!+[] + [+[]]]) / ((+!+[]) + (+!+[]))] + (typeof ![])[(+!+[])] + ([] + [] + [][ - [] - ])[(+!+[])]]["h" + (typeof ![])[(+!+[])] + (![] + [])[(+!+[] + ((+!+[]) + (+!+[])))] + (!![] + [])[(+[])]].toLowerCase(); - return __secretKey; + if (isBrowser) { + /** + * Polyfilling Promise + */ + if (!("Promise" in _top)) { + _top.Promise = function (_f) { + var _p = { + then() { }, + catch() { }, + _then(response) { + this.then.call(_p, response); + }, + _catch(response) { + this.catch.call(_p, response); + } + }; + _f.call(_p, _p._then, _p._catch); + return _p; + }; } - )(); - var is_phonegap = ( - function () { - return (typeof cordova !== "undefined") ? (true) : (false); + if (typeof _top.console === "undefined") { + _top.console = function () { }; + _top.console.prototype.log = function (message) { }; } - )(); - } else { - // This is only for code integrity purpose using non-browser implementations - // like using node.js - var _secretKey = "secret"; - _domain_ = "localhost"; - } + _domain_ = ( + function () { + return (typeof document !== "undefined" && document.domain !== "") ? (document.domain) : ("localhost"); + } + )(); + + var _secretKey = ( + function () { + var __secretKey = _top[(![] + [])[((+!+[]) + (+!+[]))] + (typeof ![])[(+!+[])] + (typeof [])[((+!+[]) + (+!+[])) * ((+!+[]) + (+!+[]))] + (![] + [])[(+!+[])] + (!![] + [])[(+[])] + ([] + [] + [][ + [] + ])[(+[+!+[] + [+[]]]) / ((+!+[]) + (+!+[]))] + (typeof ![])[(+!+[])] + ([] + [] + [][ + [] + ])[(+!+[])]]["h" + (typeof ![])[(+!+[])] + (![] + [])[(+!+[] + ((+!+[]) + (+!+[])))] + (!![] + [])[(+[])]].toLowerCase(); + return __secretKey; + } + )(); + var is_phonegap = ( + function () { + return (typeof cordova !== "undefined") ? (true) : (false); + } + )(); - _top._asyncLoad = []; - var asyncLoad = function (callback, args) { - var asyncCallback = { - "func": callback, - "args": args, - "dispatch"() { - this.func.apply(null, this.args); - } + } else { + // This is only for code integrity purpose using non-browser implementations + // like using node.js + var _secretKey = "secret"; + _domain_ = "localhost"; + } + + _top._asyncLoad = []; + var asyncLoad = function (callback, args) { + var asyncCallback = { + "func": callback, + "args": args, + "dispatch"() { + this.func.apply(null, this.args); + } + }; + _top._asyncLoad.push(asyncCallback); + return asyncCallback; }; - _top._asyncLoad.push(asyncCallback); - return asyncCallback; - }; - if (isBrowser) { - var _fireAsyncLoad = function () { - if (document.readyState === "complete") { + if (isBrowser) { + var _fireAsyncLoad = function () { + if (document.readyState === "complete") { + _top._asyncLoad.map(function (fc) { + fc.dispatch.call(fc); + }); + } + }; + document.onreadystatechange = _fireAsyncLoad; + } else if (typeof _top.global !== "undefined") { + _top.global._fireAsyncLoad = function () { _top._asyncLoad.map(function (fc) { fc.dispatch.call(fc); }); - } - }; - document.onreadystatechange = _fireAsyncLoad; - } else if (typeof _top.global !== "undefined") { - _top.global._fireAsyncLoad = function () { - _top._asyncLoad.map(function (fc) { - fc.dispatch.call(fc); - }); - }; - } + }; + } - _top.asyncLoad = asyncLoad; - var Logger = function () { - return { - debugEnabled: true, - infoEnabled: true, - warnEnabled: true, - debug(message) { - if (this.debugEnabled) { - console.log("\x1b[35m%s\x1b[0m", `[DEBUG][${performance.now().toLocaleString()}] ${message}`); + _top.asyncLoad = asyncLoad; + var Logger = function () { + return { + debugEnabled: true, + infoEnabled: true, + warnEnabled: true, + debug(message) { + if (this.debugEnabled) { + console.log("\x1b[35m%s\x1b[0m", `[DEBUG][${performance.now().toLocaleString()}] ${message}`); + } + }, + info(message) { + var color; + if (this.infoEnabled) { + if (isBrowser) { + color = "\x1b[103m%s\x1b[0m"; + } else { + color = "\x1b[33m%s\x1b[0m"; + } + console.info(color, `[INFO][${performance.now().toLocaleString()}] ${message}`); + } + }, + warn(message) { + if (this.warnEnabled) { + console.warn("\x1b[31m%s\x1b[0m", `[WARN][${performance.now().toLocaleString()}] ${message}`); + } + } + }; + }; + var logger = new Logger(); + logger.debugEnabled = false; + logger.infoEnabled = true; + _top.logger = logger; + var Base64 = { + _keyStr: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", + encode(e) { + var t = ""; + var n, r, i, s, o, u, a; + var f = 0; + e = Base64._utf8_encode(e); + while (f < e.length) { + n = e.charCodeAt(f++); + r = e.charCodeAt(f++); + i = e.charCodeAt(f++); + s = n >> 2; + o = (n & 3) << 4 | r >> 4; + u = (r & 15) << 2 | i >> 6; + a = i & 63; + if (isNaN(r)) { + u = a = 64; + } else if (isNaN(i)) { + a = 64; + } + t = t + this._keyStr.charAt(s) + this._keyStr.charAt(o) + this._keyStr.charAt(u) + this._keyStr.charAt(a); } + return t; }, - info(message) { - var color; - if (this.infoEnabled) { - if (isBrowser) { - color = "\x1b[103m%s\x1b[0m"; + decode(e) { + var t = ""; + var n, r, i; + var s, o, u, a; + var f = 0; + e = e.replace(/[^A-Za-z0-9+/=]/g, ""); + while (f < e.length) { + s = this._keyStr.indexOf(e.charAt(f++)); + o = this._keyStr.indexOf(e.charAt(f++)); + u = this._keyStr.indexOf(e.charAt(f++)); + a = this._keyStr.indexOf(e.charAt(f++)); + n = s << 2 | o >> 4; + r = (o & 15) << 4 | u >> 2; + i = (u & 3) << 6 | a; + t = t + String.fromCharCode(n); + if (u !== 64) { + t = t + String.fromCharCode(r); + } + if (a !== 64) { + t = t + String.fromCharCode(i); + } + } + t = Base64._utf8_decode(t); + return t; + }, + _utf8_encode(e) { + e = e.replace(/rn/g, "n"); + var t = ""; + for (var n = 0; n < e.length; n++) { + var r = e.charCodeAt(n); + if (r < 128) { + t += String.fromCharCode(r); + } else if (r > 127 && r < 2048) { + t += String.fromCharCode(r >> 6 | 192); + t += String.fromCharCode(r & 63 | 128); } else { - color = "\x1b[33m%s\x1b[0m"; + t += String.fromCharCode(r >> 12 | 224); + t += String.fromCharCode(r >> 6 & 63 | 128); + t += String.fromCharCode(r & 63 | 128); } - console.info(color, `[INFO][${performance.now().toLocaleString()}] ${message}`); } + return t; }, - warn(message) { - if (this.warnEnabled) { - console.warn("\x1b[31m%s\x1b[0m", `[WARN][${performance.now().toLocaleString()}] ${message}`); + _utf8_decode(e) { + var t = ""; + var n = 0; + var r = 0; + var c1 = 0; + var c2 = 0; + var c3; + while (n < e.length) { + r = e.charCodeAt(n); + if (r < 128) { + t += String.fromCharCode(r); + n++; + } else if (r > 191 && r < 224) { + c2 = e.charCodeAt(n + 1); + t += String.fromCharCode((r & 31) << 6 | c2 & 63); + n += 2; + } else { + c2 = e.charCodeAt(n + 1); + c3 = e.charCodeAt(n + 2); + t += String.fromCharCode((r & 15) << 12 | (c2 & 63) << 6 | c3 & 63); + n += 3; + } } + return t; } }; - }; - var logger = new Logger(); - logger.debugEnabled = false; - logger.infoEnabled = true; - _top.logger = logger; - var Base64 = { - _keyStr: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", - encode(e) { - var t = ""; - var n, r, i, s, o, u, a; - var f = 0; - e = Base64._utf8_encode(e); - while (f < e.length) { - n = e.charCodeAt(f++); - r = e.charCodeAt(f++); - i = e.charCodeAt(f++); - s = n >> 2; - o = (n & 3) << 4 | r >> 4; - u = (r & 15) << 2 | i >> 6; - a = i & 63; - if (isNaN(r)) { - u = a = 64; - } else if (isNaN(i)) { - a = 64; - } - t = t + this._keyStr.charAt(s) + this._keyStr.charAt(o) + this._keyStr.charAt(u) + this._keyStr.charAt(a); - } - return t; - }, - decode(e) { - var t = ""; - var n, r, i; - var s, o, u, a; - var f = 0; - e = e.replace(/[^A-Za-z0-9+/=]/g, ""); - while (f < e.length) { - s = this._keyStr.indexOf(e.charAt(f++)); - o = this._keyStr.indexOf(e.charAt(f++)); - u = this._keyStr.indexOf(e.charAt(f++)); - a = this._keyStr.indexOf(e.charAt(f++)); - n = s << 2 | o >> 4; - r = (o & 15) << 4 | u >> 2; - i = (u & 3) << 6 | a; - t = t + String.fromCharCode(n); - if (u !== 64) { - t = t + String.fromCharCode(r); - } - if (a !== 64) { - t = t + String.fromCharCode(i); + var waitUntil = function (func, exp) { + var _waitUntil = function (func, exp) { + var maxWaitCycles = 2000; + var _w = 0; + var _t = setInterval(function () { + if (exp.call()) { + clearInterval(_t); + func.call(); + logger.debug("Ejecuting " + func.name + " after wait"); + } else { + if (_w < maxWaitCycles) { + _w += 1; + logger.debug("WAIT UNTIL " + func.name + " is true, " + _w.toString() + " cycles"); + } else { + logger.debug("Max execution time for " + func.name + " expression until true"); + clearInterval(_t); + } + } + }, 1); + }; + setTimeout(function () { + _waitUntil(func, exp); + }, 1); + }; + if (typeof localStorage === "undefined") { + /* Polyfill for localStorage */ + var localStorage = { + getItem(name) { + return (Object.hasOwnProperty.call(this, name)) ? (this[name]) : (null); + }, + setItem(name, value) { + this[name] = value; + }, + removeItem(name) { + delete this[name]; } - } - t = Base64._utf8_decode(t); - return t; - }, - _utf8_encode(e) { - e = e.replace(/rn/g, "n"); - var t = ""; - for (var n = 0; n < e.length; n++) { - var r = e.charCodeAt(n); - if (r < 128) { - t += String.fromCharCode(r); - } else if (r > 127 && r < 2048) { - t += String.fromCharCode(r >> 6 | 192); - t += String.fromCharCode(r & 63 | 128); + }; + /* end Polyfill for localStorage */ + } + var ComplexStorageCache = function (params) { + var object, load, alternate; + object = params.index; + if (typeof object !== "undefined") { + load = params.load; + alternate = params.alternate; + var cachedObjectID = this.getID(object); + var cachedResponse = localStorage.getItem(cachedObjectID); + if (this.isEmpty(cachedResponse)) { + var cachedNewResponse = load.call(null, { + "cachedObjectID": cachedObjectID, + "cachedResponse": cachedResponse, + "cache": this + }); + this.save(object, cachedNewResponse); + logger.debug("RESPONSE OF {{cachedObjectID}} CACHED".replace("{{cachedObjectID}}", cachedObjectID)); } else { - t += String.fromCharCode(r >> 12 | 224); - t += String.fromCharCode(r >> 6 & 63 | 128); - t += String.fromCharCode(r & 63 | 128); + var alternateResponse = alternate.call(null, { + "cachedObjectID": cachedObjectID, + "cachedResponse": cachedResponse, + "cache": this + }); + logger.debug("RESPONSE OF {{cachedObjectID}} IS ALREADY CACHED ".replace("{{cachedObjectID}}", cachedObjectID)); } + + } else { + throw new Error("ComplexStorageCache: index is undefined"); } - return t; - }, - _utf8_decode(e) { - var t = ""; - var n = 0; - var r = 0; - var c1 = 0; - var c2 = 0; - var c3; - while (n < e.length) { - r = e.charCodeAt(n); - if (r < 128) { - t += String.fromCharCode(r); - n++; - } else if (r > 191 && r < 224) { - c2 = e.charCodeAt(n + 1); - t += String.fromCharCode((r & 31) << 6 | c2 & 63); - n += 2; - } else { - c2 = e.charCodeAt(n + 1); - c3 = e.charCodeAt(n + 2); - t += String.fromCharCode((r & 15) << 12 | (c2 & 63) << 6 | c3 & 63); - n += 3; - } + return this; + }; + ComplexStorageCache.prototype.getItem = function (cachedObjectID) { + var retrievedObject = localStorage.getItem(cachedObjectID); + if (!this.isEmpty(retrievedObject)) { + return JSON.parse(retrievedObject); + } else { + return null; } - return t; - } - }; - var waitUntil = function (func, exp) { - var _waitUntil = function (func, exp) { - var maxWaitCycles = 2000; - var _w = 0; - var _t = setInterval(function () { - if (exp.call()) { - clearInterval(_t); - func.call(); - logger.debug("Ejecuting " + func.name + " after wait"); - } else { - if (_w < maxWaitCycles) { - _w += 1; - logger.debug("WAIT UNTIL " + func.name + " is true, " + _w.toString() + " cycles"); - } else { - logger.debug("Max execution time for " + func.name + " expression until true"); - clearInterval(_t); - } - } - }, 1); }; - setTimeout(function () { - _waitUntil(func, exp); - }, 1); - }; - if (typeof localStorage === "undefined") { - /* Polyfill for localStorage */ - var localStorage = { - getItem(name) { - return (Object.hasOwnProperty.call(this, name)) ? (this[name]) : (null); - }, - setItem(name, value) { - this[name] = value; - }, - removeItem(name) { - delete this[name]; + ComplexStorageCache.prototype.setItem = function (cachedObjectID, value) { + localStorage.setItem(cachedObjectID, _DataStringify(value)); + }; + ComplexStorageCache.prototype.isEmpty = function (object) { + var r = false; + switch (true) { + case (typeof object === "undefined"): + case (typeof object === "string" && object === ""): + case (typeof object === "string" && object === "undefined"): + case (typeof object === "number" && object === 0): + case (object === null): + r = true; + break; + default: + r = false; + } + return r; + }; + ComplexStorageCache.prototype.getID = function (object) { + var cachedObjectID; + if (typeof object !== "undefined") { + cachedObjectID = "cachedObject_" + Base64.encode(_DataStringify(object).replace(/\{|\}|,/g, "_")); } + return cachedObjectID; }; - /* end Polyfill for localStorage */ - } - var ComplexStorageCache = function (params) { - var object, load, alternate; - object = params.index; - if (typeof object !== "undefined") { - load = params.load; - alternate = params.alternate; + ComplexStorageCache.prototype.save = function (object, cachedNewResponse) { var cachedObjectID = this.getID(object); - var cachedResponse = localStorage.getItem(cachedObjectID); - if (this.isEmpty(cachedResponse)) { - var cachedNewResponse = load.call(null, { - "cachedObjectID": cachedObjectID, - "cachedResponse": cachedResponse, - "cache": this - }); - this.save(object, cachedNewResponse); - logger.debug("RESPONSE OF {{cachedObjectID}} CACHED".replace("{{cachedObjectID}}", cachedObjectID)); - } else { - var alternateResponse = alternate.call(null, { - "cachedObjectID": cachedObjectID, - "cachedResponse": cachedResponse, - "cache": this + logger.debug("CACHING THE RESPONSE OF {{cachedObjectID}} ".replace("{{cachedObjectID}}", cachedObjectID)); + this.setItem(cachedObjectID, cachedNewResponse); + }; + ComplexStorageCache.prototype.getCached = function (object) { + var cachedObjectID = this.getID(object); + return this.getItem(cachedObjectID); + }; + ComplexStorageCache.prototype.clear = function () { + Object.keys(localStorage).filter(function (k) { + return k.startsWith("cachedObject_"); + }).map(function (c) { + localStorage.removeItem(c); + }); + }; + + /** + * Detecting passive events feature + * + * https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md#feature-detection + **/ + + // Test via a getter in the options object to see if the passive property is accessed + if (isBrowser) { + var supportsPassive = false; + try { + var opts = Object.defineProperty({}, "passive", { + get() { + supportsPassive = true; + return supportsPassive; + } }); - logger.debug("RESPONSE OF {{cachedObjectID}} IS ALREADY CACHED ".replace("{{cachedObjectID}}", cachedObjectID)); - } + window.addEventListener("testPassive", null, opts); + window.removeEventListener("testPassive", null, opts); + } catch (e) { } + var captureFalse = function () { + return (supportsPassive) ? ({ + passive: true + }) : (false); + }; + + // Use our detect's results. passive applied if supported, capture will be false either way. + //elem.addEventListener('touchstart', fn, captureFalse); - } else { - throw new Error("ComplexStorageCache: index is undefined"); - } - return this; - }; - ComplexStorageCache.prototype.getItem = function (cachedObjectID) { - var retrievedObject = localStorage.getItem(cachedObjectID); - if (!this.isEmpty(retrievedObject)) { - return JSON.parse(retrievedObject); - } else { - return null; - } - }; - ComplexStorageCache.prototype.setItem = function (cachedObjectID, value) { - localStorage.setItem(cachedObjectID, _DataStringify(value)); - }; - ComplexStorageCache.prototype.isEmpty = function (object) { - var r = false; - switch (true) { - case (typeof object === "undefined"): - case (typeof object === "string" && object === ""): - case (typeof object === "string" && object === "undefined"): - case (typeof object === "number" && object === 0): - case (object === null): - r = true; - break; - default: - r = false; } - return r; - }; - ComplexStorageCache.prototype.getID = function (object) { - var cachedObjectID; - if (typeof object !== "undefined") { - cachedObjectID = "cachedObject_" + Base64.encode(_DataStringify(object).replace(/\{|\}|,/g, "_")); + + + /** + * Basic Type of all elements + */ + if (isBrowser) { + Element.prototype.find = function (tag) { + var _oo = []; + var _tags = document.subelements(tag); + _tags.map(function (_tt, _t) { + if ((typeof _tags[_t] !== "undefined") && _tags[_t].parentNode.tagName === this.parentNode.tagName) { + _oo.push(_Cast(_tt, (new Object()))); + } + }); + return _oo; + }; } - return cachedObjectID; - }; - ComplexStorageCache.prototype.save = function (object, cachedNewResponse) { - var cachedObjectID = this.getID(object); - logger.debug("CACHING THE RESPONSE OF {{cachedObjectID}} ".replace("{{cachedObjectID}}", cachedObjectID)); - this.setItem(cachedObjectID, cachedNewResponse); - }; - ComplexStorageCache.prototype.getCached = function (object) { - var cachedObjectID = this.getID(object); - return this.getItem(cachedObjectID); - }; - ComplexStorageCache.prototype.clear = function () { - Object.keys(localStorage).filter(function (k) { - return k.startsWith("cachedObject_"); - }).map(function (c) { - localStorage.removeItem(c); - }); - }; - /** - * Detecting passive events feature - * - * https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md#feature-detection - **/ + /** + * Primary instance ID of all objects + */ + var __instanceID; + // Adaptation of Production steps of ECMA-262, Edition 5, 15.2.3.5 + // Reference: http://es5.github.io/#x15.2.3.5 + var _Object_Create = (function () { + + // make a safe reference to Object.prototype.hasOwnProperty + var hasOwn = Object.prototype.hasOwnProperty; + + return function (O) { + // 1. If Type(O) is not Object or Null throw a TypeError exception. + if (typeof O !== "object") { + throw TypeError("Object prototype may only be an Object or null. The type is " + typeof (O)); + } - // Test via a getter in the options object to see if the passive property is accessed - if (isBrowser) { - var supportsPassive = false; - try { - var opts = Object.defineProperty({}, "passive", { - get() { - supportsPassive = true; - return supportsPassive; + // 2. Let obj be the result of creating a new object as if by the + // expression new Object() where Object is the standard built-in + // constructor with that name + // 3. Set the [[Prototype]] internal property of obj to O. + var QCObjects = function () { }; + QCObjects.prototype = O; + var obj = new QCObjects(); + + // Let's not keep a stray reference to O... + + // 4. If the argument Properties is present and not undefined, add + // own properties to obj as if by calling the standard built-in + // function Object.defineProperties with arguments obj and + // Properties. + if (arguments.length > 1) { + // Object.defineProperties does ToObject on its first argument. + var Properties = Object(arguments[1]); + for (var prop in Properties) { + if (hasOwn.call(Properties, prop)) { + obj[prop] = Properties[prop]; + } + } } + + // 5. Return obj + return obj; + }; + })(); + + // Object.assign Polyfilling + // Reference: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign#Polyfill + if (typeof Object.assign !== "function") { + // Must be writable: true, enumerable: false, configurable: true + Object.defineProperty(Object, "assign", { + value: function assign(target, varArgs) { // .length of function is 2 + "use strict"; + if (target === null) { // TypeError if undefined or null + throw new TypeError("Cannot convert undefined or null to object"); + } + + var to = Object(target); + + for (var index = 1; index < arguments.length; index++) { + var nextSource = arguments[index]; + + if (nextSource !== null) { // Skip over if undefined or null + for (var nextKey in nextSource) { + // Avoid bugs when hasOwnProperty is shadowed + if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) { + to[nextKey] = nextSource[nextKey]; + } + } + } + } + return to; + }, + writable: true, + configurable: true }); - window.addEventListener("testPassive", null, opts); - window.removeEventListener("testPassive", null, opts); - } catch (e) {} - var captureFalse = function () { - return (supportsPassive) ? ({ - passive: true - }) : (false); + } + + var __is_raw_class__ = function (o_c) { + return (typeof o_c === "function" && o_c.toString().startsWith("class")) ? (true) : (false); }; - // Use our detect's results. passive applied if supported, capture will be false either way. - //elem.addEventListener('touchstart', fn, captureFalse); + var _LegacyCopy = function (obj) { + var _value_; + switch (true) { + case typeof obj === "string": + _value_ = obj; + break; + case typeof obj === "number": + _value_ = obj; + break; + case typeof obj === "object": + _value_ = Object.assign({}, obj); + break; + case typeof obj === "function": + _value_ = obj.bind({}); + break; + case __is_raw_class__(obj): + _value_ = class extends obj { }; + break; + default: + break; + } + return _value_; + }; - } + var _QC_CLASSES = {}; + var _QC_PACKAGES = {}; + var _QC_PACKAGES_IMPORTED = []; + var _QC_READY_LISTENERS = []; - /** - * Basic Type of all elements - */ - if (isBrowser) { - Element.prototype.find = function (tag) { - var _oo = []; - var _tags = document.subelements(tag); - _tags.map(function (_tt, _t) { - if ((typeof _tags[_t] !== "undefined") && _tags[_t].parentNode.tagName === this.parentNode.tagName) { - _oo.push(_Cast(_tt, (new Object()))); - } - }); - return _oo; + /** + * Returns the object or function name + * + * @param Object or function + */ + var ObjectName = function (o) { + var ret = ""; + if (typeof o === "function" && Object.hasOwnProperty.call(o, "name") && o.name !== "") { + ret = o.name; + } else if (typeof o !== "undefined" && typeof o.constructor === "function" && o.constructor.name !== "") { + ret = o.constructor.name; + } else if (typeof o !== "undefined" && typeof o.constructor === "object") { + ret = o.constructor.toString().replace(/\[(.*?)\]/g, "$1").split(" ").slice(1).join(""); + } + return ret; }; - } - /** - * Primary instance ID of all objects - */ - var __instanceID; - // Adaptation of Production steps of ECMA-262, Edition 5, 15.2.3.5 - // Reference: http://es5.github.io/#x15.2.3.5 - var _Object_Create = (function () { - - // make a safe reference to Object.prototype.hasOwnProperty - var hasOwn = Object.prototype.hasOwnProperty; - - return function (O) { - // 1. If Type(O) is not Object or Null throw a TypeError exception. - if (typeof O !== "object") { - throw TypeError("Object prototype may only be an Object or null. The type is " + typeof (O)); + /** + * Casts an object to another object class type + * + * @param {Object} obj_source + * @param {Object} obj_dest + */ + var _Cast = function (obj_source, obj_dest) { + for (var v in obj_source) { + if (typeof obj_source[v] !== "undefined") { + try { + obj_dest[v] = obj_source[v]; + } catch (e) { + + } + } } + return obj_dest; + }; - // 2. Let obj be the result of creating a new object as if by the - // expression new Object() where Object is the standard built-in - // constructor with that name - // 3. Set the [[Prototype]] internal property of obj to O. - var QCObjects = function () {}; - QCObjects.prototype = O; - var obj = new QCObjects(); - - // Let's not keep a stray reference to O... - - // 4. If the argument Properties is present and not undefined, add - // own properties to obj as if by calling the standard built-in - // function Object.defineProperties with arguments obj and - // Properties. - if (arguments.length > 1) { - // Object.defineProperties does ToObject on its first argument. - var Properties = Object(arguments[1]); - for (var prop in Properties) { - if (hasOwn.call(Properties, prop)) { - obj[prop] = Properties[prop]; + /** + * Casts an object to another object class type. Only properties + * + * @param {Object} obj_source + * @param {Object} obj_dest + */ + var _CastProps = function (obj_source, obj_dest) { + for (var v in obj_source) { + if (typeof obj_source[v] !== "undefined" && typeof obj_source[v] !== "function") { + try { + obj_dest[v] = obj_source[v]; + } catch (e) { + // DO NOTHING + } + } else if (typeof obj_source[v] === "function") { + try { + obj_dest[v] = obj_source[v].bind(obj_dest); + } catch (e) { + logger.warn(e); } } } + return obj_dest; + }; - // 5. Return obj - return obj; + /** + * Internal use to determine the forbidden names for classes + * Reserved words + * + * @param {String} name + * @param {Object} type + * @param {Object} definition + */ + var __is__forbidden_name__ = function () { + return (["__proto__", "prototype", "Object", "Map", "defineProperty", "indexOf", "toString", "__instanceID"].indexOf(arguments[0]) !== -1) ? (true) : (false); }; - })(); - // Object.assign Polyfilling - // Reference: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign#Polyfill - if (typeof Object.assign !== "function") { - // Must be writable: true, enumerable: false, configurable: true - Object.defineProperty(Object, "assign", { - value: function assign(target, varArgs) { // .length of function is 2 - "use strict"; - if (target === null) { // TypeError if undefined or null - throw new TypeError("Cannot convert undefined or null to object"); - } + /** + * Determine the type of the Object for any QCObjects Object + * + * @param {Object} object + */ + var __getType__ = function __getType__(o_c) { + var _ret_ = ""; + switch (true) { + case __is_raw_class__(o_c) && !!o_c.name: + _ret_ = o_c.name; + break; + case typeof o_c === "object" && + (!!o_c.constructor && + !!o_c.constructor.name) + && o_c.constructor.name !== "": + _ret_ = o_c.constructor.name; + break; + case (!!o_c && !!o_c.__classType) && o_c.__classType !== "": + _ret_ = o_c.__classType; + break; + case (!!o_c && !!o_c.__definition) && (!!o_c.__definition.__classType) && o_c.__definition.__classType !== "": + _ret_ = o_c.__definition.__classType; + break; + case typeof o_c === "function" && !!o_c.name: + _ret_ = o_c.name; + break; + default: + _ret_ = ObjectName(o_c); + break; + } + return _ret_; + }; - var to = Object(target); + /** + * Returns if a class or object is from a determinated type + * @param {Object} object + * @param {String} typeName + */ + var is_a = function is_a(obj, typeName) { + return (typeof obj !== "undefined" && obj !== null && + (((isQCObjects_Class(obj) || isQCObjects_Object(obj)) && (obj.hierarchy().includes(typeName))) || + __getType__(obj) === typeName || + ObjectName(obj) === typeName || + typeof obj === typeName)) ? (true) : (false); + }; - for (var index = 1; index < arguments.length; index++) { - var nextSource = arguments[index]; - if (nextSource !== null) { // Skip over if undefined or null - for (var nextKey in nextSource) { - // Avoid bugs when hasOwnProperty is shadowed - if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) { - to[nextKey] = nextSource[nextKey]; - } - } + var __make_global__ = function (f) { + if (typeof f !== "undefined") { + if (isBrowser) { + try { + _top[f.name] = f; + window[f.name] = f; + } catch (e) { } + } else if (typeof global !== "undefined") { + if (!Object.hasOwnProperty.call(global, f.name)) { + global[f.name] = f; } } - return to; - }, - writable: true, - configurable: true - }); - } + } - var __is_raw_class__ = function (o_c) { - return (typeof o_c === "function" && o_c.toString().startsWith("class")) ? (true) : (false); - }; - - var _LegacyCopy = function (obj) { - var _value_; - switch (true) { - case typeof obj === "string": - _value_ = obj; - break; - case typeof obj === "number": - _value_ = obj; - break; - case typeof obj === "object": - _value_ = Object.assign({}, obj); - break; - case typeof obj === "function": - _value_ = obj.bind({}); - break; - case __is_raw_class__(obj): - _value_ = class extends obj {}; - break; - default: - break; - } - return _value_; - }; - - - var _QC_CLASSES = {}; - var _QC_PACKAGES = {}; - var _QC_PACKAGES_IMPORTED = []; - var _QC_READY_LISTENERS = []; - - /** - * Returns the object or function name - * - * @param Object or function - */ - var ObjectName = function (o) { - var ret = ""; - if (typeof o === "function" && Object.hasOwnProperty.call(o, "name") && o.name !== "") { - ret = o.name; - } else if (typeof o !== "undefined" && typeof o.constructor === "function" && o.constructor.name !== "") { - ret = o.constructor.name; - } else if (typeof o !== "undefined" && typeof o.constructor === "object") { - ret = o.constructor.toString().replace(/\[(.*?)\]/g, "$1").split(" ").slice(1).join(""); - } - return ret; - }; - - /** - * Casts an object to another object class type - * - * @param {Object} obj_source - * @param {Object} obj_dest - */ - var _Cast = function (obj_source, obj_dest) { - for (var v in obj_source) { - if (typeof obj_source[v] !== "undefined") { - try { - obj_dest[v] = obj_source[v]; - } catch (e) { + }; - } - } - } - return obj_dest; - }; - - /** - * Casts an object to another object class type. Only properties - * - * @param {Object} obj_source - * @param {Object} obj_dest - */ - var _CastProps = function (obj_source, obj_dest) { - for (var v in obj_source) { - if (typeof obj_source[v] !== "undefined" && typeof obj_source[v] !== "function") { - try { - obj_dest[v] = obj_source[v]; - } catch (e) { - // DO NOTHING - } - } else if (typeof obj_source[v] === "function") { - try { - obj_dest[v] = obj_source[v].bind(obj_dest); - } catch (e) { - logger.warn(e); - } + var __register_class__ = function (_class_, __namespace) { + var name = _class_.name || __getType__(_class_); + if (typeof _class_.__definition === "undefined") { + _class_.__definition = {}; } - } - return obj_dest; - }; - - /** - * Internal use to determine the forbidden names for classes - * Reserved words - * - * @param {String} name - * @param {Object} type - * @param {Object} definition - */ - var __is__forbidden_name__ = function () { - return (["__proto__", "prototype", "Object", "Map", "defineProperty", "indexOf", "toString", "__instanceID"].indexOf(arguments[0]) !== -1) ? (true) : (false); - }; - - /** - * Determine the type of the Object for any QCObjects Object - * - * @param {Object} object - */ - var __getType__ = function __getType__(o_c) { - var _ret_ = ""; - switch (true) { - case __is_raw_class__(o_c) && !!o_c.name: - _ret_ = o_c.name; - break; - case typeof o_c === "object" && - (!!o_c.constructor && - !!o_c.constructor.name) - && o_c.constructor.name !== "": - _ret_ = o_c.constructor.name; - break; - case (!!o_c && !!o_c.__classType) && o_c.__classType !== "": - _ret_ = o_c.__classType; - break; - case (!!o_c && !!o_c.__definition) && (!!o_c.__definition.__classType) && o_c.__definition.__classType !== "": - _ret_ = o_c.__definition.__classType; - break; - case typeof o_c === "function" && !!o_c.name: - _ret_ = o_c.name; - break; - default: - _ret_ = ObjectName(o_c); - break; - } - return _ret_; - }; - - /** - * Returns if a class or object is from a determinated type - * @param {Object} object - * @param {String} typeName - */ - var is_a = function is_a(obj, typeName) { - return (typeof obj !== "undefined" && obj !== null && - (((isQCObjects_Class(obj) || isQCObjects_Object(obj)) && (obj.hierarchy().includes(typeName))) || - __getType__(obj) === typeName || - ObjectName(obj) === typeName || - typeof obj === typeName)) ? (true) : (false); - }; - - - var __make_global__ = function (f) { - if (typeof f !== "undefined") { - if (isBrowser) { - try { - _top[f.name] = f; - window[f.name] = f; - } catch (e) {} - } else if (typeof global !== "undefined") { - if (!Object.hasOwnProperty.call(global, f.name)) { - global[f.name] = f; - } + _class_.__definition.__classType = name; + if (typeof __namespace !== "undefined") { + _class_.__definition.__namespace = __namespace; } - } - - }; - - var __register_class__ = function (_class_, __namespace) { - var name = _class_.name || __getType__(_class_); - if (typeof _class_.__definition === "undefined"){ - _class_.__definition = {}; - } - _class_.__definition.__classType = name; - if (typeof __namespace !== "undefined"){ - _class_.__definition.__namespace = __namespace; - } - _QC_CLASSES[name] = _class_; - _top[name] = _QC_CLASSES[name]; - return _top[name]; - }; - - var RegisterClass = function (_class_, __namespace) { - return __register_class__(_class_, __namespace); - }; - __make_global__(RegisterClass); - - /** - * Creates new object class of another object - * - * @param {String} name - * @param {Object} type - * @param {Object} definition - */ - var Class = function () { - var _types_ = {}; - var name, type, definition; - - switch (arguments.length) { - case 0: - return class {}; - case 1: - name = arguments[0]; - type = class {}; - definition = {}; - break; - case 2: - name = arguments[0]; - type = class {}; - definition = arguments[1]; - break; - case 3: - name = arguments[0]; - type = arguments[1]; - definition = arguments[2]; - break; - default: - break; - } - - if (typeof type !== "function") { - throw new Error("Class type must be a function or class"); - } + _QC_CLASSES[name] = _class_; + _top[name] = _QC_CLASSES[name]; + return _top[name]; + }; - if (__is__forbidden_name__.call(this, name)) { - throw new Error(`${name} is not an allowed word in the name of a class`); - } + var RegisterClass = function (_class_, __namespace) { + return __register_class__(_class_, __namespace); + }; + __make_global__(RegisterClass); - if (typeof type["__definition"] !== "undefined") { - definition["__definition"] = Object.assign(_LegacyCopy(type.__definition), type); - } + /** + * Creates new object class of another object + * + * @param {String} name + * @param {Object} type + * @param {Object} definition + */ + var Class = function () { + var _types_ = {}; + var name, type, definition; - _types_[type.name] = type; + switch (arguments.length) { + case 0: + return class { }; + case 1: + name = arguments[0]; + type = class { }; + definition = {}; + break; + case 2: + name = arguments[0]; + type = class { }; + definition = arguments[1]; + break; + case 3: + name = arguments[0]; + type = arguments[1]; + definition = arguments[2]; + break; + default: + break; + } - if (typeof definition === "undefined" || definition === null) { - definition = {}; - } else { - definition = _LegacyCopy(definition); - } + if (typeof type !== "function") { + throw new Error("Class type must be a function or class"); + } - /* hack to prevent duplicate __instanceID */ - if (typeof definition["__instanceID"] !== "undefined") { - delete definition["__instanceID"]; - } + if (__is__forbidden_name__.call(this, name)) { + throw new Error(`${name} is not an allowed word in the name of a class`); + } - _QC_CLASSES[name] = class extends _types_[type.name] { - __classType = name; - __definition = { - ...definition - }; + if (typeof type["__definition"] !== "undefined") { + definition["__definition"] = Object.assign(_LegacyCopy(type.__definition), type); + } - static hierarchy(__class__) { - var __classType = function (o_c) { - return (Object.hasOwnProperty.call(o_c, "__classType")) ? (o_c.__classType) : (__getType__.call(__class__, o_c)); - }; - var __hierarchy__proto__ = (c) => { - return (typeof c !== "undefined" && typeof c.__proto__ !== "undefined" && c.__proto__ !== null) ? (((__classType(c) !== "") ? ([__classType(c)]) : ([])).concat(__hierarchy__proto__(c.__proto__))) : ([]); - }; + _types_[type.name] = type; - if (typeof __class__ === "undefined" || __class__ === null) { - __class__ = this; - } - var __hierarchy = []; - __hierarchy.push(__classType(__class__)); - __hierarchy = __hierarchy.concat(__hierarchy__proto__(__class__.__proto__)); - return __hierarchy; + if (typeof definition === "undefined" || definition === null) { + definition = {}; + } else { + definition = _LegacyCopy(definition); } - static getParentClass() { - return Object.getPrototypeOf(this.prototype.constructor); + /* hack to prevent duplicate __instanceID */ + if (typeof definition["__instanceID"] !== "undefined") { + delete definition["__instanceID"]; } - constructor() { - var _o_; - if (arguments.length > 0) { - _o_ = { - ...arguments[0] + _QC_CLASSES[name] = class extends _types_[type.name] { + __classType = name; + __definition = { + ...definition + }; + + static hierarchy(__class__) { + var __classType = function (o_c) { + return (Object.hasOwnProperty.call(o_c, "__classType")) ? (o_c.__classType) : (__getType__.call(__class__, o_c)); }; - } else { - _o_ = {}; - } - super(_o_); - - let self = this; - __instanceID = (typeof __instanceID === "undefined" || __instanceID === null) ? (0) : (__instanceID + 1); - if (!self.__instanceID) { - Object.defineProperty(self, "__instanceID", { - value: __instanceID, - writable: false - }); + var __hierarchy__proto__ = (c) => { + return (typeof c !== "undefined" && typeof c.__proto__ !== "undefined" && c.__proto__ !== null) ? (((__classType(c) !== "") ? ([__classType(c)]) : ([])).concat(__hierarchy__proto__(c.__proto__))) : ([]); + }; + + if (typeof __class__ === "undefined" || __class__ === null) { + __class__ = this; + } + var __hierarchy = []; + __hierarchy.push(__classType(__class__)); + __hierarchy = __hierarchy.concat(__hierarchy__proto__(__class__.__proto__)); + return __hierarchy; } - if (typeof self.__definition !== "undefined") { - Object.keys(self.__definition).filter(function (k) { - return isNaN(k) && !["name", "__instanceID", "__classType", "__definition"].includes(k); - }).forEach(function (key) { - if (typeof self.__definition[key] === "function") { - self[key] = self.__definition[key].bind(self); - } else { - self[key] = self.__definition[key]; - } - }); + static getParentClass() { + return Object.getPrototypeOf(this.prototype.constructor); } - _methods_(_QC_CLASSES[self.__classType]).map(function (m) { - self[m.name] = m.bind(self); - }); - _methods_(self.__definition).map(function (m) { - self[m.name] = m.bind(self); - }); - - if (!!self["body"]){ - if (typeof self.__definition === "undefined" || (!Object.hasOwnProperty.call(self.__definition, "body")) || typeof self.__definition.body === "undefined") { - try { - if (isBrowser) { - self["body"] = _DOMCreateElement(self.__definition.__classType); + + constructor() { + var _o_; + if (arguments.length > 0) { + _o_ = { + ...arguments[0] + }; + } else { + _o_ = {}; + } + super(_o_); + + let self = this; + __instanceID = (typeof __instanceID === "undefined" || __instanceID === null) ? (0) : (__instanceID + 1); + if (!self.__instanceID) { + Object.defineProperty(self, "__instanceID", { + value: __instanceID, + writable: false + }); + } + + if (typeof self.__definition !== "undefined") { + Object.keys(self.__definition).filter(function (k) { + return isNaN(k) && !["name", "__instanceID", "__classType", "__definition"].includes(k); + }).forEach(function (key) { + if (typeof self.__definition[key] === "function") { + self[key] = self.__definition[key].bind(self); } else { + self[key] = self.__definition[key]; + } + }); + } + _methods_(_QC_CLASSES[self.__classType]).map(function (m) { + self[m.name] = m.bind(self); + }); + _methods_(self.__definition).map(function (m) { + self[m.name] = m.bind(self); + }); + + if (!!self["body"]) { + if (typeof self.__definition === "undefined" || (!Object.hasOwnProperty.call(self.__definition, "body")) || typeof self.__definition.body === "undefined") { + try { + if (isBrowser) { + self["body"] = _DOMCreateElement(self.__definition.__classType); + } else { + self["body"] = {}; + } + } catch (e) { self["body"] = {}; } - } catch (e) { - self["body"] = {}; + } else if (Object.hasOwnProperty.call(self.__definition, "body")) { + self["body"] = self.__definition.body; } - } else if (Object.hasOwnProperty.call(self.__definition, "body")) { - self["body"] = self.__definition.body; - } - } + } - try { - if (typeof self.__new__ === "function") { - self.__new__.call(self, _o_); - } else if (typeof super.__new__ === "function") { - self.__new__ = super.__new__.bind(self); - self.__new__.call(self, _o_); - } - if (typeof self === "object" && Object.hasOwnProperty.call(self, "_new_") && typeof self._new_.isCalled === "undefined") { - try { - self._new_.call(self, _o_); - self._new_.isCalled = true; - } catch (e) { - logger.warn(`${self.__classType}._new_() failed with error: ${e}`); + try { + if (typeof self.__new__ === "function") { + self.__new__.call(self, _o_); + } else if (typeof super.__new__ === "function") { + self.__new__ = super.__new__.bind(self); + self.__new__.call(self, _o_); + } + if (typeof self === "object" && Object.hasOwnProperty.call(self, "_new_") && typeof self._new_.isCalled === "undefined") { + try { + self._new_.call(self, _o_); + self._new_.isCalled = true; + } catch (e) { + logger.warn(`${self.__classType}._new_() failed with error: ${e}`); + } } + } catch (e) { + logger.warn(e); } - } catch (e) { - logger.warn(e); } - } - __new__(_o_) { - _CastProps(_o_, this); - } - _new_() {} + __new__(_o_) { + _CastProps(_o_, this); + } + _new_() { } - getClass() { - return Object.getPrototypeOf(this.constructor); - } + getClass() { + return Object.getPrototypeOf(this.constructor); + } - css(_css) { - if (typeof this["body"] !== "undefined" && this["body"]["style"] !== "undefined") { - logger.debug("body style"); - this["body"]["style"] = _Cast(_css, this["body"]["style"]); + css(_css) { + if (typeof this["body"] !== "undefined" && this["body"]["style"] !== "undefined") { + logger.debug("body style"); + this["body"]["style"] = _Cast(_css, this["body"]["style"]); + } + return this["body"]["style"]; } - return this["body"]["style"]; - } - hierarchy() { - var __instance__ = this; - return this.getClass().hierarchy(__instance__); - } + hierarchy() { + var __instance__ = this; + return this.getClass().hierarchy(__instance__); + } - append(child) { - logger.debug("append: start"); - if (is_a(child, "Component")) { - logger.debug("append: child is a Component"); - logger.debug(`appending the body of ${child.name}`); - } - var child = (arguments.length > 0) ? (arguments[0]) : (this["body"]); - if (typeof this["body"] !== "undefined") { - logger.debug("append element"); - if (arguments.lenght > 0) { - logger.debug("append to element"); - this["body"].append(child); - if (typeof this["childs"] === "undefined") { - this["childs"] = []; - } - this["childs"].push(child); - } else { - if (isBrowser) { - logger.debug("append to body"); - document.body.append(child); + append(child) { + logger.debug("append: start"); + if (is_a(child, "Component")) { + logger.debug("append: child is a Component"); + logger.debug(`appending the body of ${child.name}`); + } + var child = (arguments.length > 0) ? (arguments[0]) : (this["body"]); + if (typeof this["body"] !== "undefined") { + logger.debug("append element"); + if (arguments.lenght > 0) { + logger.debug("append to element"); + this["body"].append(child); + if (typeof this["childs"] === "undefined") { + this["childs"] = []; + } + this["childs"].push(child); + } else { + if (isBrowser) { + logger.debug("append to body"); + document.body.append(child); + } } } } - } - attachIn(tag) { - if (isBrowser) { - var tags = document.subelements(tag); - for (var i = 0, j = tags.length; i < j; i++) { - tags[i].append(this); + attachIn(tag) { + if (isBrowser) { + var tags = document.subelements(tag); + for (var i = 0, j = tags.length; i < j; i++) { + tags[i].append(this); + } + } else { + throw new Error("attachIn not yet implemented for non browser platforms"); } - } else { - throw new Error("attachIn not yet implemented for non browser platforms"); } - } - }; + }; + + // remove the keys from definition that exist in the prototype + + _QC_CLASSES[name] = _CastProps(definition, _QC_CLASSES[name]); + _QC_CLASSES[name]["__definition"] = definition; + _QC_CLASSES[name]["__definition"]["__classType"] = name; + _QC_CLASSES[name]["__definition"]["__new__"] = function __new__(_o_) { + _CastProps(_o_, this); + }; - // remove the keys from definition that exist in the prototype + _top[name] = _QC_CLASSES[name]; - _QC_CLASSES[name] = _CastProps(definition, _QC_CLASSES[name]); - _QC_CLASSES[name]["__definition"] = definition; - _QC_CLASSES[name]["__definition"]["__classType"] = name; - _QC_CLASSES[name]["__definition"]["__new__"] = function __new__(_o_) { - _CastProps(_o_, this); + return _top[name]; }; - _top[name] = _QC_CLASSES[name]; - - return _top[name]; - }; - - Class.prototype.toString = function () { - return "Class(name, type, definition) { [QCObjects native code] }"; - }; - - /** - * Returns the QCObjects Class Factory of a given ClassName - * - * @param {String} name - */ - - var ClassFactory = function (className) { - var _classFactory; - if (className !== null && className.indexOf(".") > -1) { - var packageName = className.split(".").slice(0, className.split(".").length - 1).join("."); - var _className = className.split(".").slice(-1).join(""); - var _package = Package(packageName); - var packageClasses = (typeof _package !== "undefined") ? (_package.filter(classFactory => { - return isQCObjects_Class(classFactory) && - (classFactory.__definition.__classType === _className || (typeof classFactory === "function" && !!classFactory.name) ) ; - }).reverse()) : ([]); - if (packageClasses.length > 0) { - _classFactory = packageClasses[0]; - } else { - throw Error (`Class ${className} not found.`); - } - } else if (className !== null && Object.hasOwnProperty.call(_QC_CLASSES, className)) { - _classFactory = _QC_CLASSES[className]; - } - return _classFactory; - }; + Class.prototype.toString = function () { + return "Class(name, type, definition) { [QCObjects native code] }"; + }; - if (isBrowser) { - Element.prototype.append = function QC_Append(child) { - if (isQCObjects_Object(child) || typeof child.body !== "undefined") { - this.appendChild(child.body); - } else { - this.appendChild(child); + /** + * Returns the QCObjects Class Factory of a given ClassName + * + * @param {String} name + */ + + var ClassFactory = function (className) { + var _classFactory; + if (className !== null && className.indexOf(".") > -1) { + var packageName = className.split(".").slice(0, className.split(".").length - 1).join("."); + var _className = className.split(".").slice(-1).join(""); + var _package = Package(packageName); + var packageClasses = (typeof _package !== "undefined") ? (_package.filter(classFactory => { + return isQCObjects_Class(classFactory) && + (classFactory.__definition.__classType === _className || (typeof classFactory === "function" && !!classFactory.name)); + }).reverse()) : ([]); + if (packageClasses.length > 0) { + _classFactory = packageClasses[0]; + } else { + throw Error(`Class ${className} not found.`); + } + } else if (className !== null && Object.hasOwnProperty.call(_QC_CLASSES, className)) { + _classFactory = _QC_CLASSES[className]; } + return _classFactory; }; - /** - * A replacement for direct using of innerHTML - * use: [element].render('content') where 'content' is the string corresponding - * to the DOM to insert in the element - **/ - Element.prototype.render = function QC_Render(content) { - var _self = this; - var _appendVDOM = function (_self, content) { - if (typeof document.implementation.createHTMLDocument !== "undefined") { - var doc = document.implementation.createHTMLDocument(""); - doc.innerHTML = content; - doc.body.subelements("*").map(function (element) { - return _self.append(element); - }); + if (isBrowser) { + Element.prototype.append = function QC_Append(child) { + if (isQCObjects_Object(child) || typeof child.body !== "undefined") { + this.appendChild(child.body); + } else { + this.appendChild(child); } }; - if (typeof this.innerHTML !== "undefined") { - try { - this.innerHTML += content; - } catch (e) { + + /** + * A replacement for direct using of innerHTML + * use: [element].render('content') where 'content' is the string corresponding + * to the DOM to insert in the element + **/ + Element.prototype.render = function QC_Render(content) { + var _self = this; + var _appendVDOM = function (_self, content) { + if (typeof document.implementation.createHTMLDocument !== "undefined") { + var doc = document.implementation.createHTMLDocument(""); + doc.innerHTML = content; + doc.body.subelements("*").map(function (element) { + return _self.append(element); + }); + } + }; + if (typeof this.innerHTML !== "undefined") { + try { + this.innerHTML += content; + } catch (e) { + _appendVDOM(_self, content); + } + } else { _appendVDOM(_self, content); } - } else { - _appendVDOM(_self, content); - } + }; + } + + /** + * Returns a method from a superior QCObjects Class + * It is useful for Class Inheritance in the _new_ and __new__ method constructors + * @example _super_('MySuperClass','MySuperMethod').call(this,params) #where this is the current instance and params are method parameters + * + * @param {String} className + * @param {String} classMethodName + * @param {Object} params + */ + var _super_ = function (className, classMethodName, params) { + return ClassFactory(className)[classMethodName]; + }; + _super_.prototype.toString = function () { + return "_super_(className,classMethodName,params) { [QCObjects native code] }"; }; - } - /** - * Returns a method from a superior QCObjects Class - * It is useful for Class Inheritance in the _new_ and __new__ method constructors - * @example _super_('MySuperClass','MySuperMethod').call(this,params) #where this is the current instance and params are method parameters - * - * @param {String} className - * @param {String} classMethodName - * @param {Object} params - */ - var _super_ = function (className, classMethodName, params) { - return ClassFactory(className)[classMethodName]; - }; - _super_.prototype.toString = function () { - return "_super_(className,classMethodName,params) { [QCObjects native code] }"; - }; - - /** - * Creates an object from a Class definition - * - * @param {QC_Object} o - * @param {Object} args - */ - - var New = function (__class__, args) { - args = (arguments.length > 1) ? (args) : ({}); - return (typeof __class__ === "undefined") ? (new Object()) : (new __class__(args)); - }; - - New.prototype.toString = function () { - return "New(QCObjectsClassName, args) { [QCObjects native code] }"; - }; - - - var Export = function (f) { - return __make_global__(f); - }; - Export.prototype.toString = function () { - return "Export(function or symbol) { [QCObjects native code] }"; - }; - - if (!isBrowser) { - var findPackageNodePath = function (packagename) { - const fs = _require_("fs"); - var sdkPath = null; - try { - var sdkPaths = [ - `${_top.CONFIG.get("projectPath")}${_top.CONFIG.get("relativeImportPath")}`, - `${_top.CONFIG.get("basePath")}${_top.CONFIG.get("relativeImportPath")}`, - `${_top.CONFIG.get("projectPath")}`, - `${_top.CONFIG.get("basePath")}`, - `${_top.CONFIG.get("relativeImportPath")}`, - `${process.cwd()}${_top.CONFIG.get("relativeImportPath")}`, - `${process.cwd()}/node_modules/` + packagename, - `${process.cwd()}/node_modules`, - `${process.cwd()}`, - "node_modules", - "./", - "" - ].concat(module.paths); - sdkPaths = sdkPaths.filter(p => { - return fs.existsSync(p + "/" + packagename); - }); - if (sdkPaths.length > 0) { - sdkPath = sdkPaths[0]; - logger.info(packagename + " is Installed."); - } else { - // logger.debug(packagename + ' is not in a standard path.'); - } - } catch (e) { - // do nothing - console.log(e); - } - return sdkPath; + /** + * Creates an object from a Class definition + * + * @param {QC_Object} o + * @param {Object} args + */ + + var New = function (__class__, args) { + args = (arguments.length > 1) ? (args) : ({}); + return (typeof __class__ === "undefined") ? (new Object()) : (new __class__(args)); }; - Export(findPackageNodePath); - } - Class("_Crypt", Object, { - last_string: "", - last_key: "", - construct: false, - _new_(o) { - var string = o["string"]; - var key = (o.hasOwnProperty.call(o, "key")) ? (o["key"]) : (null); - this.__new__(o); - key = (key === null) ? (this.__instanceID) : (key); - this.last_key = key; - this.last_string = string; - this.construct = true; - }, - _encrypt() { - var string = this.string; - var key = this.key; - var result = ""; - var char; - var keychar; - for (var i = 0; i < string.length; i++) { - char = string.substr(i, 1); - keychar = key.substr((i % key.length) - 1, 1); - char = String.fromCharCode(char.charCodeAt(0) + keychar.charCodeAt(0)); - result += char; - } - this.last_string = Base64.encode(result); - return this.last_string; - }, - _decrypt() { - var string = this.string; - var key = this.key; - var result = ""; - var char; - var keychar; - string = Base64.decode(string); - for (var i = 0; i < string.length; i++) { - char = string.substr(i, 1); - keychar = key.substr((i % key.length) - 1, 1); - char = String.fromCharCode(char.charCodeAt(0) - keychar.charCodeAt(0)); - result += char; - } + New.prototype.toString = function () { + return "New(QCObjectsClassName, args) { [QCObjects native code] }"; + }; - this.last_string = result; - return this.last_string; - }, - encrypt(string, key) { - var crypt = New(ClassFactory("_Crypt"), { - string: string, - key: (key !== "") ? (key) : ("12345678ABC") - }); - return crypt._encrypt(); - }, - decrypt(string, key) { - var crypt = New(ClassFactory("_Crypt"), { - string: string, - key: (key !== "") ? (key) : ("12345678ABC") - }); - return crypt._decrypt(); + + var Export = function (f) { + return __make_global__(f); + }; + Export.prototype.toString = function () { + return "Export(function or symbol) { [QCObjects native code] }"; + }; + + if (!isBrowser) { + var findPackageNodePath = function (packagename) { + const fs = _require_("fs"); + var sdkPath = null; + try { + var sdkPaths = [ + `${_top.CONFIG.get("projectPath")}${_top.CONFIG.get("relativeImportPath")}`, + `${_top.CONFIG.get("basePath")}${_top.CONFIG.get("relativeImportPath")}`, + `${_top.CONFIG.get("projectPath")}`, + `${_top.CONFIG.get("basePath")}`, + `${_top.CONFIG.get("relativeImportPath")}`, + `${process.cwd()}${_top.CONFIG.get("relativeImportPath")}`, + `${process.cwd()}/node_modules/` + packagename, + `${process.cwd()}/node_modules`, + `${process.cwd()}`, + "node_modules", + "./", + "" + ].concat(module.paths); + sdkPaths = sdkPaths.filter(p => { + return fs.existsSync(p + "/" + packagename); + }); + if (sdkPaths.length > 0) { + sdkPath = sdkPaths[0]; + logger.info(packagename + " is Installed."); + } else { + // logger.debug(packagename + ' is not in a standard path.'); + } + } catch (e) { + // do nothing + console.log(e); + } + return sdkPath; + }; + Export(findPackageNodePath); } - }); - - var _CryptObject = function (o) { - return ClassFactory("_Crypt").encrypt(_DataStringify(o), _secretKey); - }; - var _DecryptObject = function (s) { - return (s === "") ? ({}) : (JSON.parse(ClassFactory("_Crypt").decrypt(s, _secretKey))); - }; - - var shortCode = function () { - var length = 1000; - var code1 = ClassFactory("_Crypt").encrypt((Math.random() * length).toString().replace(".", ""), (new Date()).getTime().toString()); - var code2 = ClassFactory("_Crypt").encrypt((Math.random() * length).toString().replace(".", ""), (new Date((new Date()).getTime() - 1000 * 1000)).getTime().toString()); - var shortCode = code2.list().map((o1, index) => { - return code1.list()[index] === o1 ? null : o1; - }).filter(c => c !== null).join(""); - return shortCode; - }; - var uniqueId = shortCode; - Class("InheritClass", class {}, {}); - - class Processor extends ClassFactory("InheritClass") { - component = null; - __definition = {}; - __classType = "Processor"; - - static processors= { - "config"(component,arg) { - return _top.CONFIG.get(arg, ""); + + Class("_Crypt", Object, { + last_string: "", + last_key: "", + construct: false, + _new_(o) { + var string = o["string"]; + var key = (o.hasOwnProperty.call(o, "key")) ? (o["key"]) : (null); + this.__new__(o); + key = (key === null) ? (this.__instanceID) : (key); + this.last_key = key; + this.last_string = string; + this.construct = true; }, - "ENV"(component, arg) { - return (typeof process !== "undefined") ? (process.env[arg]) : (""); + _encrypt() { + var string = this.string; + var key = this.key; + var result = ""; + var char; + var keychar; + for (var i = 0; i < string.length; i++) { + char = string.substr(i, 1); + keychar = key.substr((i % key.length) - 1, 1); + char = String.fromCharCode(char.charCodeAt(0) + keychar.charCodeAt(0)); + result += char; + } + this.last_string = Base64.encode(result); + return this.last_string; + }, + _decrypt() { + var string = this.string; + var key = this.key; + var result = ""; + var char; + var keychar; + string = Base64.decode(string); + for (var i = 0; i < string.length; i++) { + char = string.substr(i, 1); + keychar = key.substr((i % key.length) - 1, 1); + char = String.fromCharCode(char.charCodeAt(0) - keychar.charCodeAt(0)); + result += char; + } + + this.last_string = result; + return this.last_string; }, - "global"(component, arg) { - return (typeof global !== "undefined") ? (global[arg]) : (""); + encrypt(string, key) { + var crypt = New(ClassFactory("_Crypt"), { + string: string, + key: (key !== "") ? (key) : ("12345678ABC") + }); + return crypt._encrypt(); + }, + decrypt(string, key) { + var crypt = New(ClassFactory("_Crypt"), { + string: string, + key: (key !== "") ? (key) : ("12345678ABC") + }); + return crypt._decrypt(); } + }); + + var _CryptObject = function (o) { + return ClassFactory("_Crypt").encrypt(_DataStringify(o), _secretKey); + }; + var _DecryptObject = function (s) { + return (s === "") ? ({}) : (JSON.parse(ClassFactory("_Crypt").decrypt(s, _secretKey))); }; - static setProcessor(_proc_) { - if (typeof _proc_ === "function" && _proc_.name !== "") { - this.processors[_proc_.name] = _proc_; - } - } - - constructor (){ - super(...arguments); - this.processors = Processor.processors; - this.process = Processor.process.bind(this); - this.processObject = Processor.processObject.bind(this); - this.setProcessor = Processor.setProcessor.bind(this); - this.execute = Processor.execute.bind(this); - } - static execute(component,processorName, args) { - var processorHandler = (typeof component !== "undefined" && component !== null)?(component.processorHandler):(this); - return processorHandler.processors[processorName].bind(processorHandler).apply(processorHandler,[component,...args.split(",")]); - } + var shortCode = function () { + var length = 1000; + var code1 = ClassFactory("_Crypt").encrypt((Math.random() * length).toString().replace(".", ""), (new Date()).getTime().toString()); + var code2 = ClassFactory("_Crypt").encrypt((Math.random() * length).toString().replace(".", ""), (new Date((new Date()).getTime() - 1000 * 1000)).getTime().toString()); + var shortCode = code2.list().map((o1, index) => { + return code1.list()[index] === o1 ? null : o1; + }).filter(c => c !== null).join(""); + return shortCode; + }; + var uniqueId = shortCode; + Class("InheritClass", class { }, {}); - static process(template, component = null) { - var processorHandler = (component !== null)?(component.processorHandler):( New(Processor,{component:null}) ) ; - if (typeof template === "string") { - Object.keys(processorHandler.processors).map(function (funcName) { - [...template.matchAll(new RegExp("\\$" + funcName + "\\((.*)\\).*", "g"))].map( - function (procesorMatch) { - var match0 = `$${funcName}(${procesorMatch[1]})`; - template = template.replace(match0, processorHandler.execute.bind(processorHandler).call(processorHandler, component, funcName, procesorMatch[1])); - } - ); - }); + class Processor extends ClassFactory("InheritClass") { + component = null; + __definition = {}; + __classType = "Processor"; + + static processors = { + "config"(component, arg) { + return _top.CONFIG.get(arg, ""); + }, + "ENV"(component, arg) { + return (typeof process !== "undefined") ? (process.env[arg]) : (""); + }, + "global"(component, arg) { + return (typeof global !== "undefined") ? (global[arg]) : (""); + } + }; + static setProcessor(_proc_) { + if (typeof _proc_ === "function" && _proc_.name !== "") { + this.processors[_proc_.name] = _proc_; + } } - return template; - } - static processObject(obj, component = null) { - var __instance__ = (component === null)?(this):(component.processorHandler); - if (typeof __instance__ === "undefined"){ - __instance__ = new Processor({component:component}); + constructor() { + super(...arguments); + this.processors = Processor.processors; + this.process = Processor.process.bind(this); + this.processObject = Processor.processObject.bind(this); + this.setProcessor = Processor.setProcessor.bind(this); + this.execute = Processor.execute.bind(this); + } + + static execute(component, processorName, args) { + var processorHandler = (typeof component !== "undefined" && component !== null) ? (component.processorHandler) : (this); + return processorHandler.processors[processorName].bind(processorHandler).apply(processorHandler, [component, ...args.split(",")]); + } + + static process(template, component = null) { + var processorHandler = (component !== null) ? (component.processorHandler) : (New(Processor, { component: null })); + if (typeof template === "string") { + Object.keys(processorHandler.processors).map(function (funcName) { + [...template.matchAll(new RegExp("\\$" + funcName + "\\((.*)\\).*", "g"))].map( + function (procesorMatch) { + var match0 = `$${funcName}(${procesorMatch[1]})`; + template = template.replace(match0, processorHandler.execute.bind(processorHandler).call(processorHandler, component, funcName, procesorMatch[1])); + } + ); + }); + } + return template; } - if (typeof obj === "object") { - Object.keys(obj).map( - function (_k) { - if (typeof obj[_k] === "object" && !obj[_k].hasOwnProperty.call(obj[_k], "call")) { - obj[_k] = __instance__.processObject.bind(__instance__)(obj[_k], component); - } else if (typeof obj[_k] === "string") { - obj[_k] = __instance__.process.bind(__instance__)(obj[_k], component); + + static processObject(obj, component = null) { + var __instance__ = (component === null) ? (this) : (component.processorHandler); + if (typeof __instance__ === "undefined") { + __instance__ = new Processor({ component: component }); + } + if (typeof obj === "object") { + Object.keys(obj).map( + function (_k) { + if (typeof obj[_k] === "object" && !obj[_k].hasOwnProperty.call(obj[_k], "call")) { + obj[_k] = __instance__.processObject.bind(__instance__)(obj[_k], component); + } else if (typeof obj[_k] === "string") { + obj[_k] = __instance__.process.bind(__instance__)(obj[_k], component); + } } - } - ); - } else if (typeof obj === "string") { - obj = __instance__.process.bind(__instance__)(obj, component); + ); + } else if (typeof obj === "string") { + obj = __instance__.process.bind(__instance__)(obj, component); + } + return obj; } - return obj; + } + Processor.__definition = {}; + Processor.__classType = "Processor"; + RegisterClass(Processor, "com.qcobjects"); + __make_global__(Processor); + + + class ConfigSettings { + static _instance = null; + static _CONFIG_ENC = null; + static get instance() { + + if (this._instance === null) { + var _config_settings = new ConfigSettings(); + _config_settings._CONFIG = { + "relativeImportPath": "", + "remoteImportsPath": "", + "remoteSDKPath": "https://sdk.qcobjects.dev/", + "asynchronousImportsLoad": false, + "removePackageScriptAfterLoading": true, + "componentsBasePath": "", + "delayForReady": 0, + "preserveComponentBodyTag": false, + "useConfigService": false, + "routingWay": "hash", + "useSDK": true, + "useLocalSDK": false, + "basePath": _basePath_ + }; + _config_settings._CONFIG_ENC = null; + this._instance = _config_settings; + } - } - Processor.__definition = {}; - Processor.__classType = "Processor"; - RegisterClass(Processor,"com.qcobjects"); - __make_global__(Processor); - - - class ConfigSettings { - static _instance = null; - static _CONFIG_ENC = null; - static get instance() { - - if (this._instance === null) { - var _config_settings = new ConfigSettings(); - _config_settings._CONFIG = { - "relativeImportPath": "", - "remoteImportsPath": "", - "remoteSDKPath": "https://sdk.qcobjects.dev/", - "asynchronousImportsLoad": false, - "removePackageScriptAfterLoading": true, - "componentsBasePath": "", - "delayForReady": 0, - "preserveComponentBodyTag": false, - "useConfigService": false, - "routingWay": "hash", - "useSDK": true, - "useLocalSDK": false, - "basePath": _basePath_ - }; - _config_settings._CONFIG_ENC = null; - this._instance = _config_settings; + return this._instance; } - return this._instance; + static set instance(value) { + this._instance = value; + } } + _QC_CLASSES["ConfigSettings"] = ConfigSettings; - static set instance(value) { - this._instance = value; - } - } - _QC_CLASSES["ConfigSettings"] = ConfigSettings; + Class("CONFIG", Object, { - Class("CONFIG", Object, { + get _CONFIG_ENC() { + return ClassFactory("ConfigSettings").instance._CONFIG_ENC; + }, - get _CONFIG_ENC() { - return ClassFactory("ConfigSettings").instance._CONFIG_ENC; - }, + get _CONFIG() { + return ClassFactory("ConfigSettings").instance._CONFIG; + }, - get _CONFIG() { - return ClassFactory("ConfigSettings").instance._CONFIG; - }, + set(name, value) { + logger.debug(`CONFIG.set ${name}: ${value}`); + // hack to force update basePath from CONFIG + if (name === "basePath") { + _basePath_ = value; + } + var _conf; + try { + _conf = ( + function (config) { + if (config._CONFIG_ENC === null) { + config._CONFIG_ENC = ClassFactory("_Crypt").encrypt(_DataStringify({}), _secretKey); + } + var _protectedEnc = config._CONFIG_ENC.valueOf(); + var _protectedConf = config._CONFIG.valueOf(); + return _CastProps(_protectedConf, _DecryptObject(_protectedEnc)); + } + )(ClassFactory("ConfigSettings").instance); + } catch (e) { + _conf = {}; + console.error(e); + logger.debug("failed to encrypt config"); + } - set(name, value) { - logger.debug(`CONFIG.set ${name}: ${value}`); - // hack to force update basePath from CONFIG - if (name === "basePath") { - _basePath_ = value; - } - var _conf; - try { - _conf = ( - function (config) { - if (config._CONFIG_ENC === null) { - config._CONFIG_ENC = ClassFactory("_Crypt").encrypt(_DataStringify({}), _secretKey); + _conf[name] = value; + ClassFactory("ConfigSettings").instance._CONFIG_ENC = _CryptObject(_conf); + if (Object.hasOwnProperty.call(ClassFactory("ConfigSettings").instance, "_CONFIG") && Object.hasOwnProperty.call(ClassFactory("ConfigSettings").instance._CONFIG, name)) { + ClassFactory("ConfigSettings").instance._CONFIG[name] = value; + } + }, + get(name, _default) { + var _value; + try { + var _conf = ( + function (config) { + if (config._CONFIG_ENC === null) { + config._CONFIG_ENC = ClassFactory("_Crypt").encrypt(_DataStringify({}), _secretKey); + } + var _protectedEnc = config._CONFIG_ENC.valueOf(); + var _protectedConf = config._CONFIG.valueOf(); + return _CastProps(_protectedConf, _DecryptObject(_protectedEnc)); } - var _protectedEnc = config._CONFIG_ENC.valueOf(); - var _protectedConf = config._CONFIG.valueOf(); - return _CastProps(_protectedConf, _DecryptObject(_protectedEnc)); + )(ClassFactory("ConfigSettings").instance); + if (typeof _conf[name] !== "undefined") { + _value = _conf[name]; + } else if (typeof _default !== "undefined") { + _value = _default; } - )(ClassFactory("ConfigSettings").instance); - } catch (e) { - _conf = {}; - console.error(e); - logger.debug("failed to encrypt config"); - } - - _conf[name] = value; - ClassFactory("ConfigSettings").instance._CONFIG_ENC = _CryptObject(_conf); - if (Object.hasOwnProperty.call(ClassFactory("ConfigSettings").instance, "_CONFIG") && Object.hasOwnProperty.call(ClassFactory("ConfigSettings").instance._CONFIG, name)) { - ClassFactory("ConfigSettings").instance._CONFIG[name] = value; - } - }, - get(name, _default) { - var _value; - try { - var _conf = ( - function (config) { - if (config._CONFIG_ENC === null) { - config._CONFIG_ENC = ClassFactory("_Crypt").encrypt(_DataStringify({}), _secretKey); - } - var _protectedEnc = config._CONFIG_ENC.valueOf(); - var _protectedConf = config._CONFIG.valueOf(); - return _CastProps(_protectedConf, _DecryptObject(_protectedEnc)); - } - )(ClassFactory("ConfigSettings").instance); - if (typeof _conf[name] !== "undefined") { - _value = _conf[name]; - } else if (typeof _default !== "undefined") { + } catch (e) { + console.error(e); + logger.debug("Something wrong when trying to get CONFIG values"); + logger.debug("No config value for: " + name); _value = _default; } - } catch (e) { - console.error(e); - logger.debug("Something wrong when trying to get CONFIG values"); - logger.debug("No config value for: " + name); - _value = _default; + return Processor.processObject.call(Processor, _value); } - return Processor.processObject.call(Processor, _value); - } - }); - - Export(waitUntil); - Export(_super_); - Export(ComplexStorageCache); - Export(ClassFactory); - Export(_DOMCreateElement); - Export(shortCode); - Export(__getType__); - Export(is_a); - - var isQCObjects_Object = function (_) { - return (typeof _ === "object" && - Object.hasOwnProperty.call(_, "__classType") && - (!!_.__instanceID) && - Object.hasOwnProperty.call(_, "__definition") && - typeof _.__definition !== "undefined" - ) ? (true) : (false); - }; - - var isQCObjects_Class = function (_) { - return (typeof _ === "function" && - (!_.__instanceID) && - (!!_.__definition) && - typeof _.__definition !== "undefined" && - !!_.__definition.__classType - ) ? (true) : (false); - }; - - /** - * Defines a package for Class classification - * - * @param {Object} namespace - * @param {Object} classes - */ - var Package = function (namespace, classes) { - if (_QC_PACKAGES.hasOwnProperty.call(_QC_PACKAGES, namespace) && - typeof _QC_PACKAGES[namespace] !== "undefined" && - _QC_PACKAGES[namespace].hasOwnProperty.call(_QC_PACKAGES[namespace], "length") && - _QC_PACKAGES[namespace].length > 0 && - typeof classes !== "undefined" && - classes.hasOwnProperty.call(classes, "length") && - classes.length > 0 - ) { - classes.filter( - function (_c1) { - return isQCObjects_Class(_c1); - } - ).map(function (_class_) { - _class_.__definition.__namespace = namespace; - _class_.__namespace = namespace; - }); - _QC_PACKAGES[namespace] = _QC_PACKAGES[namespace].concat(classes); - } else if (typeof classes !== "undefined") { - if (typeof classes === "object" && classes.hasOwnProperty.call(classes, "length")) { + }); + + Export(waitUntil); + Export(_super_); + Export(ComplexStorageCache); + Export(ClassFactory); + Export(_DOMCreateElement); + Export(shortCode); + Export(__getType__); + Export(is_a); + + var isQCObjects_Object = function (_) { + return (typeof _ === "object" && + Object.hasOwnProperty.call(_, "__classType") && + (!!_.__instanceID) && + Object.hasOwnProperty.call(_, "__definition") && + typeof _.__definition !== "undefined" + ) ? (true) : (false); + }; + + var isQCObjects_Class = function (_) { + return (typeof _ === "function" && + (!_.__instanceID) && + (!!_.__definition) && + typeof _.__definition !== "undefined" && + !!_.__definition.__classType + ) ? (true) : (false); + }; + + /** + * Defines a package for Class classification + * + * @param {Object} namespace + * @param {Object} classes + */ + var Package = function (namespace, classes) { + if (_QC_PACKAGES.hasOwnProperty.call(_QC_PACKAGES, namespace) && + typeof _QC_PACKAGES[namespace] !== "undefined" && + _QC_PACKAGES[namespace].hasOwnProperty.call(_QC_PACKAGES[namespace], "length") && + _QC_PACKAGES[namespace].length > 0 && + typeof classes !== "undefined" && + classes.hasOwnProperty.call(classes, "length") && + classes.length > 0 + ) { classes.filter( function (_c1) { return isQCObjects_Class(_c1); @@ -1590,157 +1595,175 @@ _class_.__definition.__namespace = namespace; _class_.__namespace = namespace; }); - } else if (isQCObjects_Class(classes)) { - classes.__definition.__namespace = namespace; - classes.__namespace = namespace; + _QC_PACKAGES[namespace] = _QC_PACKAGES[namespace].concat(classes); + } else if (typeof classes !== "undefined") { + if (typeof classes === "object" && classes.hasOwnProperty.call(classes, "length")) { + classes.filter( + function (_c1) { + return isQCObjects_Class(_c1); + } + ).map(function (_class_) { + _class_.__definition.__namespace = namespace; + _class_.__namespace = namespace; + }); + } else if (isQCObjects_Class(classes)) { + classes.__definition.__namespace = namespace; + classes.__namespace = namespace; + } + _QC_PACKAGES[namespace] = classes; } - _QC_PACKAGES[namespace] = classes; - } - if (Object.hasOwnProperty.call(_QC_PACKAGES, namespace)) { - _QC_PACKAGES[namespace].map(function (_class_) { - __register_class__(_class_, namespace); - }); - } - return (Object.hasOwnProperty.call(_QC_PACKAGES, namespace)) ? (_QC_PACKAGES[namespace]) : (undefined); - }; - Package.prototype.toString = function () { - return "Package(namespace, classes) { [QCObjects native code] }"; - }; - - Package("com.qcobjects",[Processor]); - - /** - * Declare Namespace - * - * @param {String} packageName - * @param {Object} package - */ - var NamespaceRef = function (namespace) { - let packageInstance = Package(namespace); - let classes = packageInstance.filter(c => isQCObjects_Class(c)).map(c => { - return { - [c.__definition.__classType]: c - }; - }).reduce((a, b) => Object.assign(a, b)); - return namespace.split(".").map(c => { - return { - [c]: classes - }; - }).reverse().reduce((a, b) => { - b[Object.keys(b)] = a; - return b; - }); - }; - - - /** - * Imports a script with the package nomenclature - * - * @param {Object} packagename - * @param {Object} ready - * @param {Boolean} external - */ - var Import = function () { - var packagename; - var ready = function () {}; - var external = false; - if (arguments.length < 1) { - return; - } else if (arguments.length === 1) { - packagename = arguments[0]; - } else if (arguments.length === 2) { - packagename = arguments[0]; - ready = arguments[1]; - } else if (arguments.length > 2) { - packagename = arguments[0]; - ready = arguments[1]; - external = arguments[2]; - logger.debug("[Import] Setting external=" + external.toString() + " resource to import: " + packagename); - } - if (external) { - logger.debug("[Import] Registering external resource to import: " + packagename); - } else { - logger.debug("[Import] Registering local resource to import: " + packagename); - } - var _promise_import_; - if (isBrowser) { - _promise_import_ = new Promise(function (resolve, reject) { + if (Object.hasOwnProperty.call(_QC_PACKAGES, namespace)) { + _QC_PACKAGES[namespace].map(function (_class_) { + __register_class__(_class_, namespace); + }); + } + return (Object.hasOwnProperty.call(_QC_PACKAGES, namespace)) ? (_QC_PACKAGES[namespace]) : (undefined); + }; + Package.prototype.toString = function () { + return "Package(namespace, classes) { [QCObjects native code] }"; + }; - var allPackagesImported = function () { - var ret = false; - var cp = 0; - for (var p in _QC_PACKAGES) { - cp++; - } - if (cp < _QC_PACKAGES_IMPORTED.length) { - ret = false; - } else { - ret = true; - } - return ret; - }; + Package("com.qcobjects", [Processor]); - var readyImported = function (e) { - _QC_PACKAGES_IMPORTED.push(ready); - if (allPackagesImported()) { - _QC_PACKAGES_IMPORTED.map(function (_imported_) { - _QC_READY_LISTENERS.push(_imported_); - }); - } - if (isBrowser && _top.CONFIG.get("removePackageScriptAfterLoading")) { - e.target.remove(); - } - resolve.call(_promise_import_, { - "_imported_": e.target, - "_package_name_": packagename - }); + /** + * Declare Namespace + * + * @param {String} packageName + * @param {Object} package + */ + var NamespaceRef = function (namespace) { + let packageInstance = Package(namespace); + let classes = packageInstance.filter(c => isQCObjects_Class(c)).map(c => { + return { + [c.__definition.__classType]: c + }; + }).reduce((a, b) => Object.assign(a, b)); + return namespace.split(".").map(c => { + return { + [c]: classes }; + }).reverse().reduce((a, b) => { + b[Object.keys(b)] = a; + return b; + }); + }; + + + /** + * Imports a script with the package nomenclature + * + * @param {Object} packagename + * @param {Object} ready + * @param {Boolean} external + */ + var Import = function () { + var packagename; + var ready = function () { }; + var external = false; + if (arguments.length < 1) { + return; + } else if (arguments.length === 1) { + packagename = arguments[0]; + } else if (arguments.length === 2) { + packagename = arguments[0]; + ready = arguments[1]; + } else if (arguments.length > 2) { + packagename = arguments[0]; + ready = arguments[1]; + external = arguments[2]; + logger.debug("[Import] Setting external=" + external.toString() + " resource to import: " + packagename); + } + if (external) { + logger.debug("[Import] Registering external resource to import: " + packagename); + } else { + logger.debug("[Import] Registering local resource to import: " + packagename); + } + var _promise_import_; + if (isBrowser) { + _promise_import_ = new Promise(function (resolve, reject) { - if (!_QC_PACKAGES.hasOwnProperty.call(_QC_PACKAGES, packagename)) { - var s1 = _DOMCreateElement("script"); - s1.type = _top.CONFIG.get("sourceType", "text/javascript"); - s1.async = (_top.CONFIG.get("asynchronousImportsLoad")) ? (true) : (false); - s1.onreadystatechange = function () { - if (s1.readyState === "complete") { - readyImported.call(); + var allPackagesImported = function () { + var ret = false; + var cp = 0; + for (var p in _QC_PACKAGES) { + cp++; + } + if (cp < _QC_PACKAGES_IMPORTED.length) { + ret = false; + } else { + ret = true; } + return ret; }; - s1.onload = readyImported; - s1.onerror = function (e) { - reject.call(_promise_import_, { - "_imported_": s1, + + var readyImported = function (e) { + _QC_PACKAGES_IMPORTED.push(ready); + if (allPackagesImported()) { + _QC_PACKAGES_IMPORTED.map(function (_imported_) { + _QC_READY_LISTENERS.push(_imported_); + }); + } + if (isBrowser && _top.CONFIG.get("removePackageScriptAfterLoading")) { + e.target.remove(); + } + resolve.call(_promise_import_, { + "_imported_": e.target, "_package_name_": packagename }); }; - s1.src = (external) ? (_top.CONFIG.get("remoteImportsPath") + packagename + ".js") : (_basePath_ + _top.CONFIG.get("relativeImportPath") + packagename + ".js"); - document.getElementsByTagName("head")[0].appendChild(s1); - } - }); - _promise_import_.catch(function () { - logger.debug("Import: Error loading a package "); - }); - } else { - // support to be used in a nodejs environment - _promise_import_ = new Promise(function (resolve, reject) { - try { - var standardNodePath = findPackageNodePath(packagename); - var packageAbsoluteName = ""; - if (standardNodePath !== null) { - packageAbsoluteName = standardNodePath + "/" + packagename; - } else { - var jsNodePath = findPackageNodePath(packagename + ".js"); - if (jsNodePath !== null) { - packageAbsoluteName = jsNodePath + "/" + packagename + ".js"; - } else { - packageAbsoluteName = _basePath_ + _top.CONFIG.get("relativeImportPath") + packagename; - } + if (!_QC_PACKAGES.hasOwnProperty.call(_QC_PACKAGES, packagename)) { + var s1 = _DOMCreateElement("script"); + s1.type = _top.CONFIG.get("sourceType", "text/javascript"); + s1.async = (_top.CONFIG.get("asynchronousImportsLoad")) ? (true) : (false); + s1.onreadystatechange = function () { + if (s1.readyState === "complete") { + readyImported.call(); + } + }; + s1.onload = readyImported; + s1.onerror = function (e) { + reject.call(_promise_import_, { + "_imported_": s1, + "_package_name_": packagename + }); + }; + s1.src = (external) ? (_top.CONFIG.get("remoteImportsPath") + packagename + ".js") : (_basePath_ + _top.CONFIG.get("relativeImportPath") + packagename + ".js"); + document.getElementsByTagName("head")[0].appendChild(s1); } + }); + _promise_import_.catch(function () { + logger.debug("Import: Error loading a package "); + }); + + } else { + // support to be used in a nodejs environment + _promise_import_ = new Promise(function (resolve, reject) { try { - resolve.call(_promise_import_, { - "_imported_": _require_(`${packageAbsoluteName}`), - "_package_name_": packagename - }); + var standardNodePath = findPackageNodePath(packagename); + var packageAbsoluteName = ""; + if (standardNodePath !== null) { + packageAbsoluteName = standardNodePath + "/" + packagename; + } else { + var jsNodePath = findPackageNodePath(packagename + ".js"); + if (jsNodePath !== null) { + packageAbsoluteName = jsNodePath + "/" + packagename + ".js"; + } else { + packageAbsoluteName = _basePath_ + _top.CONFIG.get("relativeImportPath") + packagename; + } + } + try { + resolve.call(_promise_import_, { + "_imported_": _require_(`${packageAbsoluteName}`), + "_package_name_": packagename + }); + } catch (e) { + reject.call(_promise_import_, { + "_imported_": null, + "_package_name_": packagename, + "error": e + }); + } } catch (e) { reject.call(_promise_import_, { "_imported_": null, @@ -1748,301 +1771,294 @@ "error": e }); } - } catch (e) { - reject.call(_promise_import_, { - "_imported_": null, - "_package_name_": packagename, - "error": e - }); - } - }).catch(function (e) { - // something wrong importing a package - logger.debug("Something happened when importing " + packagename); - console.warn(e); + }).catch(function (e) { + // something wrong importing a package + logger.debug("Something happened when importing " + packagename); + console.warn(e); + }); + } + _promise_import_.catch(function (e) { + logger.warn(_DataStringify(e)); }); + return _promise_import_; + }; + Import.prototype.toString = function () { + return "Import(packagename,ready,external) { [QCObjects native code] }"; + }; + + if (isBrowser) { + /** + * Adds a Cast functionality to every Element of DOM + */ + Element.prototype.Cast = function QC_Object(_o) { + _o.__definition.body = this; + var _o = New(_o); + return _o; + }; } - _promise_import_.catch(function (e) { - logger.warn(_DataStringify(e)); + + Class("TagElements", Array, { + show() { + this.map(function (element) { + return element.style.opacity = 1; + }); + }, + hide() { + this.map(function (element) { + return element.style.opacity = 0; + }); + }, + effect() { + var effectArguments = [...arguments].slice(1); + var effectClass = arguments[0]; + if ((typeof effectClass).toLowerCase() === "string") { + effectClass = ClassFactory(effectClass); + } + this.map(function (element) { + return effectClass.apply.apply(effectClass, [element].concat(effectArguments)); + }); + }, + findElements(elementName) { + var _o = New(ClassFactory("TagElements")); + if (isBrowser) { + for (var _k in this) { + if (typeof _k === "number" && typeof this[_k] !== "function" && this[_k].hasOwnProperty.call(this[_k], "subelements")) { + _o.push(this[_k].subelements(elementName)); + } + } + } else { + // not yet implemented. + } + return _o; + } }); - return _promise_import_; - }; - Import.prototype.toString = function () { - return "Import(packagename,ready,external) { [QCObjects native code] }"; - }; - if (isBrowser) { /** - * Adds a Cast functionality to every Element of DOM + * Gets the element of DOM found by tag name + * + * @param {Object} tagname + * @param {Object} innerHTML */ - Element.prototype.Cast = function QC_Object(_o) { - _o.__definition.body = this; - var _o = New(_o); - return _o; - }; - } - - Class("TagElements", Array, { - show() { - this.map(function (element) { - return element.style.opacity = 1; - }); - }, - hide() { - this.map(function (element) { - return element.style.opacity = 0; - }); - }, - effect() { - var effectArguments = [...arguments].slice(1); - var effectClass = arguments[0]; - if ((typeof effectClass).toLowerCase() === "string") { - effectClass = ClassFactory(effectClass); - } - this.map(function (element) { - return effectClass.apply.apply(effectClass, [element].concat(effectArguments)); - }); - }, - findElements(elementName) { + var Tag = function (tagname, innerHTML) { var _o = New(ClassFactory("TagElements")); if (isBrowser) { - for (var _k in this) { - if (typeof _k === "number" && typeof this[_k] !== "function" && this[_k].hasOwnProperty.call(this[_k], "subelements")) { - _o.push(this[_k].subelements(elementName)); + var o = document.subelements(tagname); + var addedKeys = []; + for (var _i = 0; _i < o.length; _i++) { + if (typeof innerHTML !== "undefined" && o[_i].hasOwnProperty.call(o[_i], "innerHTML")) { + o[_i].innerHTML = innerHTML; + } + if (addedKeys.indexOf(_i) < 0) { + _o.push(o[_i]); + addedKeys.push(_i); } } } else { // not yet implemented. } return _o; - } - }); - - /** - * Gets the element of DOM found by tag name - * - * @param {Object} tagname - * @param {Object} innerHTML - */ - var Tag = function (tagname, innerHTML) { - var _o = New(ClassFactory("TagElements")); - if (isBrowser) { - var o = document.subelements(tagname); - var addedKeys = []; - for (var _i = 0; _i < o.length; _i++) { - if (typeof innerHTML !== "undefined" && o[_i].hasOwnProperty.call(o[_i], "innerHTML")) { - o[_i].innerHTML = innerHTML; - } - if (addedKeys.indexOf(_i) < 0) { - _o.push(o[_i]); - addedKeys.push(_i); - } + }; + + /** + * Defines a Custom Ready listener + */ + function Ready(e) { + if (isBrowser) { + _QC_READY_LISTENERS.push(e.bind(window)); + } else if (typeof global !== "undefined") { + _QC_READY_LISTENERS.push(e.bind(global)); } - } else { - // not yet implemented. } - return _o; - }; + var ready = Ready; // case insensitive ready option - /** - * Defines a Custom Ready listener - */ - function Ready(e) { - if (isBrowser) { - _QC_READY_LISTENERS.push(e.bind(window)); - } else if (typeof global !== "undefined") { - _QC_READY_LISTENERS.push(e.bind(global)); - } - } - var ready = Ready; // case insensitive ready option - - /** - * Default Ready event function for window. Executes all micro ready events of Import calls - * - * @param {Object} e - */ - var _Ready = function (e) { - var _execReady = function () { - _QC_READY_LISTENERS.map(function (_ready_listener_, _r) { - if (typeof _ready_listener_ === "function") { - _ready_listener_.call(); - delete _QC_READY_LISTENERS[_r]; + /** + * Default Ready event function for window. Executes all micro ready events of Import calls + * + * @param {Object} e + */ + var _Ready = function (e) { + var _execReady = function () { + _QC_READY_LISTENERS.map(function (_ready_listener_, _r) { + if (typeof _ready_listener_ === "function") { + _ready_listener_.call(); + delete _QC_READY_LISTENERS[_r]; + } + }); + }; + if (_top.CONFIG.get("delayForReady") > 0) { + if (isBrowser) { + setTimeout(_execReady.bind(window), _top.CONFIG.get("delayForReady")); + } else if (typeof global !== "undefined") { + setTimeout(_execReady.bind(global), _top.CONFIG.get("delayForReady")); } - }); + } else { + _execReady.call(_top); + } }; - if (_top.CONFIG.get("delayForReady") > 0) { - if (isBrowser) { - setTimeout(_execReady.bind(window), _top.CONFIG.get("delayForReady")); - } else if (typeof global !== "undefined") { - setTimeout(_execReady.bind(global), _top.CONFIG.get("delayForReady")); + + if (isBrowser) { + window.onload = _Ready; + if (is_phonegap) { + document.addEventListener("deviceready", _Ready, captureFalse); } } else { - _execReady.call(_top); - } - }; - - if (isBrowser) { - window.onload = _Ready; - if (is_phonegap) { - document.addEventListener("deviceready", _Ready, captureFalse); + global.onload = _Ready; } - } else { - global.onload = _Ready; - } - /** - * Dynamic Data Objects Class - * Usage: - * Class('TestDDO',{ - * data: {}, - * _new_ (){ - * this.ddo = New(DDO,{ - * instance:this, - * name:'data', - * value:{}, - * fget (value){ - * logger.debug('returned value '+ value ); - * } - * }) - * } - * }); - * - */ - class DDO extends ClassFactory("InheritClass") { - constructor({ - instance, - name, - fget, - fset, - value - }) { - super({ + /** + * Dynamic Data Objects Class + * Usage: + * Class('TestDDO',{ + * data: {}, + * _new_ (){ + * this.ddo = New(DDO,{ + * instance:this, + * name:'data', + * value:{}, + * fget (value){ + * logger.debug('returned value '+ value ); + * } + * }) + * } + * }); + * + */ + class DDO extends ClassFactory("InheritClass") { + constructor({ instance, name, fget, fset, value - }); - this._new_({ + }) { + super({ + instance, + name, + fget, + fset, + value + }); + this._new_({ + instance, + name, + fget, + fset, + value + }); + + } + + _new_({ instance, name, fget, fset, value - }); - - } - - _new_({ - instance, - name, - fget, - fset, - value - }) { - var ddoInstance = this; - var name = (typeof name === "undefined") ? (ObjectName(ddoInstance)) : (name); - - Object.defineProperty(instance, name, { - set(val) { - let _value = val; - logger.debug("value changed " + name); - var ret; - if (typeof fset !== "undefined" && typeof fset === "function") { - ret = fset(_value); - } else { - ret = _value; - } - instance["_" + name] = ret; - return; - }, - get() { - let _value = instance["_" + name]; - logger.debug("returning value " + name); - var is_ddo = function (v) { - if (typeof v === "object" && Object.hasOwnProperty.call(v, "value")) { - return v.value; + }) { + var ddoInstance = this; + var name = (typeof name === "undefined") ? (ObjectName(ddoInstance)) : (name); + + Object.defineProperty(instance, name, { + set(val) { + let _value = val; + logger.debug("value changed " + name); + var ret; + if (typeof fset !== "undefined" && typeof fset === "function") { + ret = fset(_value); + } else { + ret = _value; } - return v; - }; - var ret; - if (typeof fget !== "undefined" && typeof fget === "function") { - ret = fget(is_ddo(_value)); - } else { - ret = is_ddo(_value); + instance["_" + name] = ret; + return; + }, + get() { + let _value = instance["_" + name]; + logger.debug("returning value " + name); + var is_ddo = function (v) { + if (typeof v === "object" && Object.hasOwnProperty.call(v, "value")) { + return v.value; + } + return v; + }; + var ret; + if (typeof fget !== "undefined" && typeof fget === "function") { + ret = fget(is_ddo(_value)); + } else { + ret = is_ddo(_value); + } + return ret; } - return ret; - } - }); - } + }); + } - } - Export(DDO); - - class DefaultTemplateHandler { - template= ""; - __definition = {}; - constructor ({component, template}){ - this.component = component; - this.template = template; } - assign(data) { - var templateInstance = this; - if (typeof templateInstance.component === "undefined") { - throw new Error("DefaultTemplateHandler.assign: component is undefined"); - } - if (typeof templateInstance.component.processorHandler === "undefined") { - throw new Error("DefaultTemplateHandler.assign: component.processorHandler is undefined"); + Export(DDO); + + class DefaultTemplateHandler { + template = ""; + __definition = {}; + constructor({ component, template }) { + this.component = component; + this.template = template; } - var processorHandler = templateInstance.component.processorHandler; - processorHandler.component = templateInstance.component; - var parsedAssignmentText = (typeof templateInstance.template !== "undefined") ? (templateInstance.template) : (""); - if (typeof data === "object") { - [...Object.keys(data)].map(function (k) { - var _value = data[k]; - if (typeof _value === "string" || typeof _value === "number" || (!isNaN(_value))) { - try { - _value = Processor.processObject.bind(processorHandler).call(processorHandler, _value, templateInstance.component); - parsedAssignmentText = parsedAssignmentText.replace((new RegExp(`{{${k}}}`, "g")), _value); - } catch (e) { - logger.warn(`${templateInstance.component.name} could not parse processors.`); - throw Error (`${templateInstance.component.name} could not parse processors. Reason: ${e.message}`); + assign(data) { + var templateInstance = this; + if (typeof templateInstance.component === "undefined") { + throw new Error("DefaultTemplateHandler.assign: component is undefined"); + } + if (typeof templateInstance.component.processorHandler === "undefined") { + throw new Error("DefaultTemplateHandler.assign: component.processorHandler is undefined"); + } + var processorHandler = templateInstance.component.processorHandler; + processorHandler.component = templateInstance.component; + var parsedAssignmentText = (typeof templateInstance.template !== "undefined") ? (templateInstance.template) : (""); + if (typeof data === "object") { + [...Object.keys(data)].map(function (k) { + var _value = data[k]; + if (typeof _value === "string" || typeof _value === "number" || (!isNaN(_value))) { + try { + _value = Processor.processObject.bind(processorHandler).call(processorHandler, _value, templateInstance.component); + parsedAssignmentText = parsedAssignmentText.replace((new RegExp(`{{${k}}}`, "g")), _value); + } catch (e) { + logger.warn(`${templateInstance.component.name} could not parse processors.`); + throw Error(`${templateInstance.component.name} could not parse processors. Reason: ${e.message}`); + } } - } - }); - } else { - logger.debug(`${templateInstance.component.name}.data is not an object`); - } - try { - parsedAssignmentText = Processor.processObject.call(processorHandler, parsedAssignmentText, templateInstance.component); - }catch (e){ - logger.warn(`${templateInstance.component.name} could not parse processors.`); - throw Error (`${templateInstance.component.name} could not parse processors. Reason: ${e.message}`); + }); + } else { + logger.debug(`${templateInstance.component.name}.data is not an object`); + } + try { + parsedAssignmentText = Processor.processObject.call(processorHandler, parsedAssignmentText, templateInstance.component); + } catch (e) { + logger.warn(`${templateInstance.component.name} could not parse processors.`); + throw Error(`${templateInstance.component.name} could not parse processors. Reason: ${e.message}`); + } + return parsedAssignmentText; } - return parsedAssignmentText; + } - - } - DefaultTemplateHandler.__definition = {}; - RegisterClass(DefaultTemplateHandler,"com.qcobjects"); + DefaultTemplateHandler.__definition = {}; + RegisterClass(DefaultTemplateHandler, "com.qcobjects"); + + var __routing_params__ = function (routing, routingPath) { + let standardRoutingPath = routing.path.replace(/{(.*?)}/g, "(?<$1>.*)"); //allowing {param} + return { + ...[...routingPath.matchAll((new RegExp(standardRoutingPath, "g")))][0]["groups"] + }; + }; - var __routing_params__ = function (routing, routingPath) { - let standardRoutingPath = routing.path.replace(/{(.*?)}/g, "(?<$1>.*)"); //allowing {param} - return { - ...[...routingPath.matchAll((new RegExp(standardRoutingPath, "g")))][0]["groups"] + var __valid_routings__ = function (routings, routingPath) { + return routings.filter(function (routing) { + var standardRoutingPath = routing.path.replace(/{(.*?)}/g, "(?<$1>.*)"); + return (new RegExp(standardRoutingPath, "g")).test(routingPath); + }).reverse(); }; - }; - - var __valid_routings__ = function (routings, routingPath) { - return routings.filter(function (routing) { - var standardRoutingPath = routing.path.replace(/{(.*?)}/g, "(?<$1>.*)"); - return (new RegExp(standardRoutingPath, "g")).test(routingPath); - }).reverse(); - }; - var __valid_routing_way__ = function (validRoutingWays, routingWay) { - return validRoutingWays.includes(routingWay); - }; - - var _buildComponentFromElement_ = function (element, __parent__){ + var __valid_routing_way__ = function (validRoutingWays, routingWay) { + return validRoutingWays.includes(routingWay); + }; + + var _buildComponentFromElement_ = function (element, __parent__) { var __shadowed_not_set = (element.getAttribute("shadowed") === null) ? (true) : (false); var __tplsource_attr_not_set = (element.getAttribute("template-source") === null) ? (true) : (false); var shadowed = (element.getAttribute("shadowed") === "true") ? (true) : (false); @@ -2117,1306 +2133,1434 @@ }; var newComponent = __create_component_instance_.call(this); return newComponent; - }; + }; - var _buildComponentsFromElements_ = function (elements, __parent__) { - var componentsBuiltWith = []; - if (isBrowser){ - componentsBuiltWith = elements.map( - function(element){ - return _buildComponentFromElement_(element, __parent__); - } - ); - } else { - logger.debug("[_buildComponentsFromElements_] not implemented for Non-Browser environments"); - } - return componentsBuiltWith; - }; - - - Package("com.qcobjects", [ - class Component extends ClassFactory("InheritClass") { - validRoutingWays= ["pathname", "hash", "search"]; - basePath= _basePath_; - domain= _domain_; - templateHandler= "DefaultTemplateHandler"; - processorHandler= null; - routingWay= null; - routingNodes= []; - routings= []; - routingPath= ""; - routingPaths=[]; - _componentHelpers= []; - subcomponents=[]; - splashScreenComponent=undefined; - controller=undefined; - view=undefined; - effect=undefined; - method = "GET"; - cached= true; - __promise__ = null; - __namespace = undefined; - - constructor ({ - __parent__, - templateURI= "", - template, - tplsource= "default", - tplextension, - url= "", - name= "", - method= "GET", - data= {}, - reload= false, - shadowed= false, - cached= true, - _body=_DOMCreateElement("div"), - __promise__= null, - __shadowRoot, + var _buildComponentsFromElements_ = function (elements, __parent__) { + var componentsBuiltWith = []; + if (isBrowser) { + componentsBuiltWith = elements.map( + function (element) { + return _buildComponentFromElement_(element, __parent__); + } + ); + } else { + logger.debug("[_buildComponentsFromElements_] not implemented for Non-Browser environments"); + } + return componentsBuiltWith; + }; + + + Package("com.qcobjects", [ + class Component extends ClassFactory("InheritClass") { + validRoutingWays = ["pathname", "hash", "search"]; + basePath = _basePath_; + domain = _domain_; + templateHandler = "DefaultTemplateHandler"; + processorHandler = null; + routingWay = null; + routingNodes = []; + routings = []; + routingPath = ""; + routingPaths = []; + _componentHelpers = []; + subcomponents = []; + splashScreenComponent = undefined; + controller = undefined; + view = undefined; + effect = undefined; + method = "GET"; + cached = true; + __promise__ = null; + __namespace = undefined; + + constructor({ + __parent__, + templateURI = "", + template, + tplsource = "default", + tplextension, + url = "", + name = "", + method = "GET", + data = {}, + reload = false, + shadowed = false, + cached = true, + _body = _DOMCreateElement("div"), + __promise__ = null, + __shadowRoot, body, shadowRoot, splashScreenComponent, controller, view - }){ - if (arguments.length<1){ - throw Error(`No arguments in component. You must at least give one argument.`); - } - super({ - __parent__, - templateURI, - template, - tplextension, - tplsource, - url, - name, - method, - data, - reload, - shadowed, - cached, - _body, - __promise__, - __shadowRoot, + }) { + if (arguments.length < 1) { + throw Error(`No arguments in component. You must at least give one argument.`); + } + super({ + __parent__, + templateURI, + template, + tplextension, + tplsource, + url, + name, + method, + data, + reload, + shadowed, + cached, + _body, + __promise__, + __shadowRoot, body, shadowRoot, splashScreenComponent, controller, view - }); - var self = this; - - if (typeof self.name === "undefined") { - logger.warn("A name is not defined for " + __getType__(self)); - } - - self.routingWay = _top.CONFIG.get("routingWay"); - - self.processorHandler = New(Processor, { - component: self - }); - - /* assign body data attributes to data */ - self.data = (typeof self.data === "undefined" || self.data === null)?({}):(self.data); - self.data = Object.assign(self.data, self.dataAttributes); + }); + var self = this; - self.createServiceInstance() - .then(function (serviceResponse){ - if (typeof self.__new__ === "function") { - self.__new__.call(self, self); + if (typeof self.name === "undefined") { + logger.warn("A name is not defined for " + __getType__(self)); } - self._generateRoutingPaths(self.body) - .then(function (){ - self._reroute_() - .then(function () { - return self.rebuild() + self.routingWay = _top.CONFIG.get("routingWay"); + + self.processorHandler = New(Processor, { + component: self + }); + + /* assign body data attributes to data */ + self.data = (typeof self.data === "undefined" || self.data === null) ? ({}) : (self.data); + self.data = Object.assign(self.data, self.dataAttributes); + + self.createServiceInstance() + .then(function (serviceResponse) { + if (typeof self.__new__ === "function") { + self.__new__.call(self, self); + } + + self._generateRoutingPaths(self.body) .then(function () { - logger.info(`Component._new_ The component ${self.name} was built successfully!`); - }).catch(function (standardResponse) { - logger.warn(`Component._new_ Something went wrong building the component ${self.name}`); - console.error(standardResponse); + self._reroute_() + .then(function () { + return self.rebuild() + .then(function () { + logger.info(`Component._new_ The component ${self.name} was built successfully!`); + }).catch(function (standardResponse) { + logger.warn(`Component._new_ Something went wrong building the component ${self.name}`); + console.error(standardResponse); + }); + }); }); + }); - }); - - }); - - } - - set body(value) { - var self = this; - self._body = value; - } - - get body() { - var self= this; - return self._body; - } - - set cacheIndex(value) { - // readonly - logger.debug("[cacheIndex] This property is readonly"); - } - - get cacheIndex() { - var self= this; - var __routing_path__ = _DataStringify(self.routingPath); - return Base64.encode(self.name + __routing_path__); - } - - set parsedAssignmentText(value) { - // readonly - logger.debug("[parsedAssignmentText] This property is readonly"); - } - - get parsedAssignmentText() { - var self= this; - self._parsedAssignmentText = self.parseTemplate(self.template); - if (typeof self._parsedAssignmentText === "undefined"){ - throw Error (`[Component][${this.name}][parsedAssignmentText] Could not generate content!`); - } - return self._parsedAssignmentText; - } - - - set shadowRoot(value) { - var self= this; - if (typeof self.__shadowRoot == "undefined") { - self.__shadowRoot = value; - } else { - logger.debug("[shadowRoot] This property can only be assigned once!"); + } - } - get shadowRoot() { - var self= this; - return self.__shadowRoot; - } - - - set routingSelected(value){ - logger.debug("[routingSelected] This is a read-only property of the component"); - } - - get routingSelected (){ - var self= this; - return __valid_routings__(self.routings, self.routingPath); - } - - set routingParams (value){ - logger.debug("[routingParams] This is a read-only property of the component"); - } - - get routingParams (){ - var component = this; - return [{}].concat(component.routingSelected.map(function (routing) { - return __routing_params__(routing, component.routingPath); - })).reduce(function (accumulator, colData, index) { - return Object.assign(accumulator, colData); - }); - } + set body(value) { + var self = this; + self._body = value; + } - createServiceInstance (){ - var component = this; - var body = component.body; - var data = this.data; - var __serviceClass; - var __classDefinition = component.getClass().__definition; - var _serviceClassName = (isBrowser && body.getAttribute("serviceClass") !== null) ? (body.getAttribute("serviceClass")) : (null); - - return new Promise (function (resolve, reject){ - /* __enable_service_class__ = true by default */ - var __enable_service_class__ = ( - (Object.hasOwnProperty.call(body, "enableServiceClass") && body.enableServiceClass) || - (!Object.hasOwnProperty.call(body, "enableServiceClass")) - ) ? (true) : (false); - var _response_to_data_ = (isBrowser && body.getAttribute("response-to") !== null && body.getAttribute("response-to") === "data") ? (true) : (false); - var _response_to_template_ = (isBrowser && body.getAttribute("response-to") !== null && body.getAttribute("response-to") === "template") ? (true) : (false); - - if (__enable_service_class__ && _serviceClassName !== null) { - __serviceClass = ClassFactory(_serviceClassName); - } - if (!_response_to_data_ && __classDefinition && Object.hasOwnProperty.call(__classDefinition, "responseTo")) { - _response_to_data_ = (__classDefinition.responseTo === "data") ? (true) : (false); - } else if (!_response_to_data_ && Object.hasOwnProperty.call(ClassFactory("Component"), "responseTo")) { - _response_to_data_ = (ClassFactory("Component").responseTo === "data") ? (true) : (false); - } - if (!_response_to_template_ && __classDefinition && Object.hasOwnProperty.call(__classDefinition, "responseTo")) { - _response_to_template_ = (__classDefinition.responseTo === "template") ? (true) : (false); - } else if (!_response_to_template_ && Object.hasOwnProperty.call(ClassFactory("Component"), "responseTo")) { - _response_to_template_ = (ClassFactory("Component").responseTo === "template") ? (true) : (false); + get body() { + var self = this; + return self._body; + } + + set cacheIndex(value) { + // readonly + logger.debug("[cacheIndex] This property is readonly"); + } + + get cacheIndex() { + var self = this; + var __routing_path__ = _DataStringify(self.routingPath); + return Base64.encode(self.name + __routing_path__); + } + + set parsedAssignmentText(value) { + // readonly + logger.debug("[parsedAssignmentText] This property is readonly"); + } + + get parsedAssignmentText() { + var self = this; + self._parsedAssignmentText = self.parseTemplate(self.template); + if (typeof self._parsedAssignmentText === "undefined") { + throw Error(`[Component][${this.name}][parsedAssignmentText] Could not generate content!`); } + return self._parsedAssignmentText; + } - if (typeof __serviceClass !== "undefined" && - (typeof __enable_service_class__ !== "undefined" && - __enable_service_class__ === true) && - (_response_to_data_ || _response_to_template_) - ) { - logger.info("Loading service " + _serviceClassName); - var serviceInstance = New(__serviceClass, { - data: data - }); - serviceLoader(serviceInstance).then(function ({ - request, - service - }) { - var serviceResponse; - if (typeof service.JSONresponse !== "undefined" && service.JSONresponse !== null){ - serviceResponse = service.JSONresponse; - } else { - serviceResponse = service.template; - } - if (_response_to_data_) { - if (typeof data === "object" && typeof serviceResponse === "object") { - data = Object.assign(data, serviceResponse); - } else { - data = serviceResponse; - } - component.data = data; - } - component.serviceInstance = serviceInstance; - component.serviceData = data; - if (_response_to_template_) { - component.template = serviceResponse; - } - resolve (serviceResponse); - }, function (rejectedResponse){ - logger.debug(`Service loading rejected for ${_serviceClassName} in ${component.name}`); - reject (rejectedResponse); - } ).catch(function (e) { - logger.debug("Something went wroing while trying to load the service " + _serviceClassName); - throw Error (`Error loading ${_serviceClassName} for ${component.name}. Detail: ${e}`); - }); + set shadowRoot(value) { + var self = this; + if (typeof self.__shadowRoot == "undefined") { + self.__shadowRoot = value; } else { - resolve(null); + logger.debug("[shadowRoot] This property can only be assigned once!"); } - }); - } + } - _bindroute_ () { - var _component_ = this; - if (!_component_._bindroute_.loaded){ - if (isBrowser) { + get shadowRoot() { + var self = this; + return self.__shadowRoot; + } - _component_.hostElements("a").map(function (a) { - a.oldclick = a.onclick; - a.onclick = function (e) { - var _ret_ = true; - if (!_top.global.get("routingPaths")) { - _top.global.set("routingPaths", []); - } - var routingWay = _top.CONFIG.get("routingWay"); - var routingPath = e.target[routingWay]; - if (_top.global.get("routingPaths").includes(routingPath) && - e.target[routingWay] !== document.location[routingWay] && - e.target.href !== document.location.href - ) { - logger.debug("A ROUTING WAS FOUND: " + routingPath); - window.history.pushState({ - href: e.target.href - }, e.target.href, e.target.href); - ClassFactory("Component").route(); - _ret_ = false; + + set routingSelected(value) { + logger.debug("[routingSelected] This is a read-only property of the component"); + } + + get routingSelected() { + var self = this; + return __valid_routings__(self.routings, self.routingPath); + } + + set routingParams(value) { + logger.debug("[routingParams] This is a read-only property of the component"); + } + + get routingParams() { + var component = this; + return [{}].concat(component.routingSelected.map(function (routing) { + return __routing_params__(routing, component.routingPath); + })).reduce(function (accumulator, colData, index) { + return Object.assign(accumulator, colData); + }); + } + + createServiceInstance() { + var component = this; + var body = component.body; + var data = this.data; + var __serviceClass; + var __classDefinition = component.getClass().__definition; + var _serviceClassName = (isBrowser && body.getAttribute("serviceClass") !== null) ? (body.getAttribute("serviceClass")) : (null); + + return new Promise(function (resolve, reject) { + /* __enable_service_class__ = true by default */ + var __enable_service_class__ = ( + (Object.hasOwnProperty.call(body, "enableServiceClass") && body.enableServiceClass) || + (!Object.hasOwnProperty.call(body, "enableServiceClass")) + ) ? (true) : (false); + var _response_to_data_ = (isBrowser && body.getAttribute("response-to") !== null && body.getAttribute("response-to") === "data") ? (true) : (false); + var _response_to_template_ = (isBrowser && body.getAttribute("response-to") !== null && body.getAttribute("response-to") === "template") ? (true) : (false); + + if (__enable_service_class__ && _serviceClassName !== null) { + __serviceClass = ClassFactory(_serviceClassName); + } + if (!_response_to_data_ && __classDefinition && Object.hasOwnProperty.call(__classDefinition, "responseTo")) { + _response_to_data_ = (__classDefinition.responseTo === "data") ? (true) : (false); + } else if (!_response_to_data_ && Object.hasOwnProperty.call(ClassFactory("Component"), "responseTo")) { + _response_to_data_ = (ClassFactory("Component").responseTo === "data") ? (true) : (false); + } + if (!_response_to_template_ && __classDefinition && Object.hasOwnProperty.call(__classDefinition, "responseTo")) { + _response_to_template_ = (__classDefinition.responseTo === "template") ? (true) : (false); + } else if (!_response_to_template_ && Object.hasOwnProperty.call(ClassFactory("Component"), "responseTo")) { + _response_to_template_ = (ClassFactory("Component").responseTo === "template") ? (true) : (false); + } + + if (typeof __serviceClass !== "undefined" && + (typeof __enable_service_class__ !== "undefined" && + __enable_service_class__ === true) && + (_response_to_data_ || _response_to_template_) + ) { + logger.info("Loading service " + _serviceClassName); + var serviceInstance = New(__serviceClass, { + data: data + }); + serviceLoader(serviceInstance).then(function ({ + request, + service + }) { + var serviceResponse; + if (typeof service.JSONresponse !== "undefined" && service.JSONresponse !== null) { + serviceResponse = service.JSONresponse; } else { - logger.debug("NO ROUTING FOUND FOR: " + routingPath); + serviceResponse = service.template; } - if (typeof e.target.oldclick !== "undefined" && typeof e.target.oldclick === "function") { - e.target.oldclick.call(e.target, e); + if (_response_to_data_) { + if (typeof data === "object" && typeof serviceResponse === "object") { + data = Object.assign(data, serviceResponse); + } else { + data = serviceResponse; + } + component.data = data; } - return _ret_; - }; - return null; - }); + component.serviceInstance = serviceInstance; + component.serviceData = data; + + if (_response_to_template_) { + component.template = serviceResponse; + } + resolve(serviceResponse); + }, function (rejectedResponse) { + logger.debug(`Service loading rejected for ${_serviceClassName} in ${component.name}`); + reject(rejectedResponse); + }).catch(function (e) { + logger.debug("Something went wroing while trying to load the service " + _serviceClassName); + throw Error(`Error loading ${_serviceClassName} for ${component.name}. Detail: ${e}`); + }); + } else { + resolve(null); + } + }); + } + + _bindroute_() { + var _component_ = this; + if (!_component_._bindroute_.loaded) { + if (isBrowser) { + + _component_.hostElements("a").map(function (a) { + a.oldclick = a.onclick; + a.onclick = function (e) { + var _ret_ = true; + if (!_top.global.get("routingPaths")) { + _top.global.set("routingPaths", []); + } + var routingWay = _top.CONFIG.get("routingWay"); + var routingPath = e.target[routingWay]; + if (_top.global.get("routingPaths").includes(routingPath) && + e.target[routingWay] !== document.location[routingWay] && + e.target.href !== document.location.href + ) { + logger.debug("A ROUTING WAS FOUND: " + routingPath); + window.history.pushState({ + href: e.target.href + }, e.target.href, e.target.href); + ClassFactory("Component").route(); + _ret_ = false; + } else { + logger.debug("NO ROUTING FOUND FOR: " + routingPath); + } + if (typeof e.target.oldclick !== "undefined" && typeof e.target.oldclick === "function") { + e.target.oldclick.call(e.target, e); + } + return _ret_; + }; + return null; + }); + } else { + // not yet implemented. + } + this._bindroute_.loaded = true; } else { - // not yet implemented. + logger.debug(`Routes already bound to popstate events for ${_component_.name}`); } - this._bindroute_.loaded = true; - } else { - logger.debug(`Routes already bound to popstate events for ${_component_.name}`); + } - - } - - done(standardResponse) { - var _ret_; - if (typeof standardResponse !== "undefined"){ - var {request, component} = standardResponse; - _ret_ = Promise.resolve({request, component}); - } - return _ret_; - } - createControllerInstance (){ - var _Controller; - if (isBrowser){ - if (typeof this.body === "undefined") { - throw new Error("The component has no body"); - } - var controllerName = this.body.getAttribute("controllerClass"); - if (!controllerName) { - controllerName = "Controller"; + done(standardResponse) { + var _ret_; + if (typeof standardResponse !== "undefined") { + var { request, component } = standardResponse; + _ret_ = Promise.resolve({ request, component }); } - _Controller = ClassFactory(controllerName); - if (typeof _Controller !== "undefined"){ - this.controller = New(_Controller, { - component: this - }); + return _ret_; + } + + createControllerInstance() { + var _Controller; + if (isBrowser) { + if (typeof this.body === "undefined") { + throw new Error("The component has no body"); + } + var controllerName = this.body.getAttribute("controllerClass"); + if (!controllerName) { + controllerName = "Controller"; + } + _Controller = ClassFactory(controllerName); + if (typeof _Controller !== "undefined") { + this.controller = New(_Controller, { + component: this + }); + } + } + return new Promise((resolve, reject) => { + if (isBrowser) { + if (typeof _Controller !== "undefined" && typeof this.controller !== "undefined") { + if (typeof this.controller.done === "function") { + try { + this.controller.done.call(this.controller); + } catch (e) { + throw Error(e); + } + } else { + logger.debug(`${controllerName} does not have a done() method.`); + reject(`${controllerName} does not have a done() method.`); + } + if (typeof this.controller.createRoutingController === "function") { + this.controller.createRoutingController.call(this.controller); + } else { + logger.debug(`${controllerName} does not have a createRoutingController() method.`); + } + } + } + resolve({ component: this, controller: this.controller }); + }); + } + + createEffectInstance() { + var _component_ = this; + return new Promise(function (resolve, reject) { + if (isBrowser) { + var effectClassName = _component_.body.getAttribute("effectClass"); + var applyEffectTo = _component_.body.getAttribute("apply-effect-to"); + applyEffectTo = (applyEffectTo !== null) ? (applyEffectTo) : ("load"); + if (effectClassName !== null && applyEffectTo === "observe") { + _component_.applyObserveTransitionEffect(effectClassName); + } else if (effectClassName !== null && applyEffectTo === "load") { + _component_.applyTransitionEffect(effectClassName); + } + } + resolve({ component: _component_, effect: _component_.effect }); + }); } - return new Promise ( (resolve, reject) => { - if (isBrowser){ - if (typeof _Controller !== "undefined" && typeof this.controller !== "undefined") { - if (typeof this.controller.done === "function") { - try { - this.controller.done.call(this.controller); - } catch (e){ - throw Error (e); + createViewInstance() { + var _component_ = this; + return new Promise(function (resolve, reject) { + var viewName = (isBrowser) ? (_component_.body.getAttribute("viewClass")) : (null); + if (viewName !== null) { + var _View = ClassFactory(viewName); + if (typeof _View !== "undefined") { + _component_.view = New(_View, { + component: _component_ + }); // Initializes the main view for the component + if (Object.hasOwnProperty.call(_component_.view, "done") && typeof _component_.view.done === "function") { + _component_.view.done.call(_component_.view); } - } else { - logger.debug(`${controllerName} does not have a done() method.`); - reject(`${controllerName} does not have a done() method.`); - } - if (typeof this.controller.createRoutingController === "function") { - this.controller.createRoutingController.call(this.controller); - } else { - logger.debug(`${controllerName} does not have a createRoutingController() method.`); } + } - } - resolve ({component:this,controller:this.controller}); - }); - } + resolve({ component: _component_, view: _component_.view }); + + }); + } - createEffectInstance (){ - var _component_ = this; - return new Promise (function (resolve, reject){ - if (isBrowser){ - var effectClassName = _component_.body.getAttribute("effectClass"); - var applyEffectTo = _component_.body.getAttribute("apply-effect-to"); - applyEffectTo = (applyEffectTo !== null) ? (applyEffectTo) : ("load"); - if (effectClassName !== null && applyEffectTo === "observe") { - _component_.applyObserveTransitionEffect(effectClassName); - } else if (effectClassName !== null && applyEffectTo === "load") { - _component_.applyTransitionEffect(effectClassName); + __done__() { + var _component_ = this; + var componentDone = function () { + if (typeof _component_ === "undefined") { + throw new Error("componentDone() has lost its context"); } - } - resolve({component:_component_, effect:_component_.effect}); - }); - } + if (typeof _component_.body === "undefined") { + throw new Error("The component has no body"); + } + _component_.createViewInstance(); + _component_.createControllerInstance(); + _component_.createEffectInstance(); - createViewInstance(){ - var _component_ = this; - return new Promise (function (resolve, reject){ - var viewName = (isBrowser)?(_component_.body.getAttribute("viewClass")):(null); - if (viewName !== null){ - var _View = ClassFactory(viewName); - if (typeof _View !== "undefined") { - _component_.view = New(_View, { - component: _component_ - }); // Initializes the main view for the component - if (Object.hasOwnProperty.call(_component_.view, "done") && typeof _component_.view.done === "function") { - _component_.view.done.call(_component_.view); - } + logger.debug(`Trying to run component helpers for ${_component_.name}...`); + try { + _component_.runComponentHelpers(); + logger.debug(`Component helpers for ${_component_.name} executed.`); + } catch (e) { + logger.debug(`Component helpers for ${_component_.name} could not be executed.`); + throw Error(e); } - - } - resolve({component:_component_, view:_component_.view}); - }); - } + _component_.subcomponents = _component_.__buildSubComponents__(); - __done__ () { - var _component_ = this; - var componentDone = function () { - if (typeof _component_ === "undefined") { - throw new Error("componentDone() has lost its context"); - } - if (typeof _component_.body === "undefined") { - throw new Error("The component has no body"); - } - _component_.createViewInstance(); - _component_.createControllerInstance(); - _component_.createEffectInstance(); + _component_._bindroute_(); + if (isBrowser) { + _component_.body.setAttribute("loaded", true); + } + }; - logger.debug(`Trying to run component helpers for ${_component_.name}...`); - try { - _component_.runComponentHelpers(); - logger.debug(`Component helpers for ${_component_.name} executed.`); - } catch (e){ - logger.debug(`Component helpers for ${_component_.name} could not be executed.`); - throw Error(e); - } + return new Promise(function (resolve, reject) { + try { + resolve(componentDone.call(_component_)); + } catch (e) { + reject(e); + } + }); - _component_.subcomponents = _component_.__buildSubComponents__(); + } - _component_._bindroute_(); - if (isBrowser){ - _component_.body.setAttribute("loaded", true); - } - }; + hostElements(tagFilter) { + var _component_ = this; + var elementList = []; + if (isBrowser) { + elementList = (_component_.shadowed && (typeof _component_.shadowRoot !== "undefined")) ? ( + _component_.shadowRoot.subelements(tagFilter) + ) : ( + _component_.body.subelements(tagFilter) + ); - return new Promise (function (resolve, reject){ - try { - resolve(componentDone.call(_component_)); - } catch (e){ - reject(e); } - }); - - } + return elementList; + } - hostElements(tagFilter){ - var _component_ = this; - var elementList = []; - if (isBrowser){ - elementList = (_component_.shadowed && (typeof _component_.shadowRoot !== "undefined"))?( - _component_.shadowRoot.subelements(tagFilter) - ):( - _component_.body.subelements(tagFilter) - ); + get subtags() { + var _component_ = this; + var tagFilter = _tag_filter_; + return _component_.hostElements(tagFilter); + } + get bodyAttributes() { + var _component_ = this; + var c = _component_.body; + return (isBrowser) ? ([...c.getAttributeNames()].map(a => { return { [a]: c.getAttribute(a) }; }).reduce((accumulator, colData, index) => { return Object.assign(accumulator, colData); })) : ({}); } - return elementList; - } - get subtags(){ - var _component_ = this; - var tagFilter = _tag_filter_; - return _component_.hostElements(tagFilter); - } + get dataAttributes() { + var _component_ = this; + var c = _component_.body; + return (isBrowser) ? ([{}].concat([...c.getAttributeNames()].filter(n => n.startsWith("data-")).map(a => { return { [a.split("-")[1]]: c.getAttribute(a) }; })).reduce((accumulator, colData, index) => { return Object.assign(accumulator, colData); })) : ({}); + } - get bodyAttributes() { - var _component_ = this; - var c = _component_.body; - return (isBrowser)?([...c.getAttributeNames()].map (a => {return {[a]:c.getAttribute(a)};}).reduce ((accumulator,colData, index) => {return Object.assign(accumulator, colData);} )):({}); - } + __buildSubComponents__(rebuildObjects = false) { + var _component_ = this; + var elementList = _component_.subtags; + if (!rebuildObjects) { + elementList = elementList.filter(t => t.getAttribute("loaded") !== "true"); + } + if ((typeof _component_ !== "undefined") || _component_.subcomponents.length < 1) { + _component_.subcomponents = _buildComponentsFromElements_(elementList, _component_); + } + return _component_.subcomponents; + } - get dataAttributes(){ - var _component_ = this; - var c = _component_.body; - return (isBrowser)?([{}].concat([...c.getAttributeNames()].filter(n=>n.startsWith("data-")).map (a => {return {[a.split("-")[1]]:c.getAttribute(a)};})).reduce ((accumulator,colData, index) => {return Object.assign(accumulator, colData);} )):({}); - } + fail(standardResponse) { + var _ret_; + if (typeof standardResponse !== "undefined") { + var { error, component } = standardResponse; + _ret_ = Promise.resolve({ error, component }); + } + return _ret_; + } - __buildSubComponents__ (rebuildObjects = false) { - var _component_ = this; - var elementList = _component_.subtags; - if (!rebuildObjects){ - elementList = elementList.filter(t=>t.getAttribute("loaded") !== "true"); + set(name, value) { + this[name] = value; } - if ((typeof _component_ !== "undefined") || _component_.subcomponents.length<1){ - _component_.subcomponents = _buildComponentsFromElements_(elementList, _component_); + + get(name) { + return this[name]; } - return _component_.subcomponents; - } - - fail(standardResponse) { - var _ret_; - if (typeof standardResponse !== "undefined"){ - var {error, component} = standardResponse; - _ret_ = Promise.resolve({error, component}); - } - return _ret_; - } - - set(name, value) { - this[name] = value; - } - - get(name) { - return this[name]; - } - - feedComponent() { - var _component_ = this; - logger.debug(`[Component][${this.name}][feedComponent] start feeding component...`); - var _feedComponent_InBrowser = function (_component_) { - if (typeof _component_.container === "undefined" && typeof _component_.body === "undefined") { - logger.warn("COMPONENT {{NAME}} has an undefined container and body".replace("{{NAME}}", _component_.name)); - return; - } - var container = (typeof _component_.container === "undefined" || _component_.container === null) ? (_component_.body) : (_component_.container); - var parsedAssignmentText = _component_.parsedAssignmentText; - _component_.innerHTML = parsedAssignmentText; - if (_component_.shadowed) { - logger.debug("COMPONENT {{NAME}} is shadowed".replace("{{NAME}}", _component_.name)); - logger.debug("Preparing slots for Shadowed COMPONENT {{NAME}}".replace("{{NAME}}", _component_.name)); - var tmp_shadowContainer = _DOMCreateElement("div"); - container.subelements("[slot]").map( - function (c) { - if (c.parentElement === container) { - tmp_shadowContainer.appendChild(c); - } - }); - logger.debug("Creating shadowedContainer for COMPONENT {{NAME}}".replace("{{NAME}}", _component_.name)); - var shadowContainer = _DOMCreateElement("div"); - shadowContainer.classList.add("shadowHost"); - try { - _component_.shadowRoot = shadowContainer.attachShadow({ - mode: "open" - }); - } catch (e) { + + feedComponent() { + var _component_ = this; + logger.debug(`[Component][${this.name}][feedComponent] start feeding component...`); + var _feedComponent_InBrowser = function (_component_) { + if (typeof _component_.container === "undefined" && typeof _component_.body === "undefined") { + logger.warn("COMPONENT {{NAME}} has an undefined container and body".replace("{{NAME}}", _component_.name)); + return; + } + var container = (typeof _component_.container === "undefined" || _component_.container === null) ? (_component_.body) : (_component_.container); + var parsedAssignmentText = _component_.parsedAssignmentText; + _component_.innerHTML = parsedAssignmentText; + if (_component_.shadowed) { + logger.debug("COMPONENT {{NAME}} is shadowed".replace("{{NAME}}", _component_.name)); + logger.debug("Preparing slots for Shadowed COMPONENT {{NAME}}".replace("{{NAME}}", _component_.name)); + var tmp_shadowContainer = _DOMCreateElement("div"); + container.subelements("[slot]").map( + function (c) { + if (c.parentElement === container) { + tmp_shadowContainer.appendChild(c); + } + }); + logger.debug("Creating shadowedContainer for COMPONENT {{NAME}}".replace("{{NAME}}", _component_.name)); + var shadowContainer = _DOMCreateElement("div"); + shadowContainer.classList.add("shadowHost"); try { - logger.debug("Shadowed COMPONENT {{NAME}} is repeated".replace("{{NAME}}", _component_.name)); - _component_.shadowRoot = shadowContainer.shadowRoot; + _component_.shadowRoot = shadowContainer.attachShadow({ + mode: "open" + }); } catch (e) { - logger.warn("Shadowed COMPONENT {{NAME}} is not allowed on this browser".replace("{{NAME}}", _component_.name)); + try { + logger.debug("Shadowed COMPONENT {{NAME}} is repeated".replace("{{NAME}}", _component_.name)); + _component_.shadowRoot = shadowContainer.shadowRoot; + } catch (e) { + logger.warn("Shadowed COMPONENT {{NAME}} is not allowed on this browser".replace("{{NAME}}", _component_.name)); + } } - } - if (typeof _component_.shadowRoot !== "undefined" && _component_.shadowRoot !== null) { - if (_component_.reload) { - logger.debug("FORCED RELOADING OF CONTAINER FOR Shadowed COMPONENT {{NAME}}".replace("{{NAME}}", _component_.name)); - shadowContainer.shadowRoot.innerHTML = _component_.innerHTML; + if (typeof _component_.shadowRoot !== "undefined" && _component_.shadowRoot !== null) { + if (_component_.reload) { + logger.debug("FORCED RELOADING OF CONTAINER FOR Shadowed COMPONENT {{NAME}}".replace("{{NAME}}", _component_.name)); + shadowContainer.shadowRoot.innerHTML = _component_.innerHTML; + } else { + tmp_shadowContainer.innerHTML = _component_.parseTemplate(tmp_shadowContainer.innerHTML); + logger.debug("ADDING Shadowed COMPONENT {{NAME}} ".replace("{{NAME}}", _component_.name)); + shadowContainer.shadowRoot.innerHTML += _component_.innerHTML; + } + logger.debug("ADDING Slots to Shadowed COMPONENT {{NAME}} ".replace("{{NAME}}", _component_.name)); + shadowContainer.innerHTML += tmp_shadowContainer.innerHTML; + logger.debug("APPENDING Shadowed COMPONENT {{NAME}} to Container ".replace("{{NAME}}", _component_.name)); + var qs = container.querySelector(".shadowHost"); + if (!(typeof qs !== "undefined" && qs !== null)) { + container.appendChild(shadowContainer); + } else { + logger.debug("Shadowed Container for COMPONENT {{NAME}} is already present in the tree ".replace("{{NAME}}", _component_.name)); + _component_.shadowRoot.innerHTML = shadowContainer.shadowRoot.innerHTML; + } } else { - tmp_shadowContainer.innerHTML = _component_.parseTemplate(tmp_shadowContainer.innerHTML); - logger.debug("ADDING Shadowed COMPONENT {{NAME}} ".replace("{{NAME}}", _component_.name)); - shadowContainer.shadowRoot.innerHTML += _component_.innerHTML; + logger.warn("Shadowed COMPONENT {{NAME}} is bad configured".replace("{{NAME}}", _component_.name)); } - logger.debug("ADDING Slots to Shadowed COMPONENT {{NAME}} ".replace("{{NAME}}", _component_.name)); - shadowContainer.innerHTML += tmp_shadowContainer.innerHTML; - logger.debug("APPENDING Shadowed COMPONENT {{NAME}} to Container ".replace("{{NAME}}", _component_.name)); - var qs = container.querySelector(".shadowHost"); - if (!(typeof qs !== "undefined" && qs !== null)) { - container.appendChild(shadowContainer); + } else { + if (_component_.reload) { + logger.debug("FORCED RELOADING OF CONTAINER FOR COMPONENT {{NAME}}".replace("{{NAME}}", _component_.name)); + container.innerHTML = _component_.innerHTML; + } else if (container && _component_) { + logger.debug("ADDING COMPONENT {{NAME}} ".replace("{{NAME}}", _component_.name)); + container.innerHTML += _component_.innerHTML; } else { - logger.debug("Shadowed Container for COMPONENT {{NAME}} is already present in the tree ".replace("{{NAME}}", _component_.name)); - _component_.shadowRoot.innerHTML = shadowContainer.shadowRoot.innerHTML; + logger.warn("COMPONENT {{NAME}} is not added to the DOM".replace("{{NAME}}", _component_.name)); } - } else { - logger.warn("Shadowed COMPONENT {{NAME}} is bad configured".replace("{{NAME}}", _component_.name)); } + + }; + + var _feedComponent_InNode = function (_component_) { + var parsedAssignmentText = _component_.parsedAssignmentText; + _component_.innerHTML = parsedAssignmentText; + }; + + var _ret_; + if (!is_a(_component_, "Component")) { + logger.warn("Trying to feed a non component object"); + return; + } + if (isBrowser) { + _ret_ = _feedComponent_InBrowser(_component_); } else { - if (_component_.reload) { - logger.debug("FORCED RELOADING OF CONTAINER FOR COMPONENT {{NAME}}".replace("{{NAME}}", _component_.name)); - container.innerHTML = _component_.innerHTML; - } else if (container && _component_) { - logger.debug("ADDING COMPONENT {{NAME}} ".replace("{{NAME}}", _component_.name)); - container.innerHTML += _component_.innerHTML; - } else { - logger.warn("COMPONENT {{NAME}} is not added to the DOM".replace("{{NAME}}", _component_.name)); - } + _ret_ = _feedComponent_InNode(_component_); } - - }; - - var _feedComponent_InNode = function (_component_) { - var parsedAssignmentText = _component_.parsedAssignmentText; - _component_.innerHTML = parsedAssignmentText; - }; - - var _ret_; - if (!is_a(_component_, "Component")) { - logger.warn("Trying to feed a non component object"); - return; - } - if (isBrowser) { - _ret_ = _feedComponent_InBrowser(_component_); - } else { - _ret_ = _feedComponent_InNode(_component_); + return _ret_; } - return _ret_; - } - - rebuild() { - var _component = this; - var _promise = new Promise(function (resolve, reject) { - if (typeof _component === "undefined" || _component === null) { - reject("Component is undefined"); - } - if (isQCObjects_Object(_component) && is_a(_component, "Component")) { - switch (true) { - case (_component.get("tplsource") === "none"): - logger.debug("Component " + _component.name + " has specified template-source=none, so no template load was done"); - var standardResponse = { - request: null, - component: _component - }; - _component.__done__().then(function (){ - if (typeof _component.done === "function") { - _component.done.call(_component, standardResponse); - } - resolve.call(_promise, standardResponse); - }, function (){ - reject.call(_promise, standardResponse); - }); - break; - case (_component.get("tplsource") === "inline"): - logger.debug("Component " + _component.name + " has specified template-source=inline, so it is assumed that template is already declared"); - (async function (_component){ - _component.feedComponent.bind(_component)(); - })(_component); - var standardResponse = { - request: null, - component: _component - }; - _component.__done__().then(function (){ - if (typeof _component.done === "function") { - _component.done.call(_component, standardResponse); - } - resolve.call(_promise, standardResponse); - }, function (){ - reject.call(_promise, standardResponse); - }); - break; - case (_component.get("tplsource") === "default" && - _component.get("templateURI") !== ""): - _component.set("url", _component.get("basePath") + _component.get("templateURI")); - componentLoader(_component, false).then( - function (standardResponse) { + + rebuild() { + var _component = this; + var _promise = new Promise(function (resolve, reject) { + if (typeof _component === "undefined" || _component === null) { + reject("Component is undefined"); + } + if (isQCObjects_Object(_component) && is_a(_component, "Component")) { + switch (true) { + case (_component.get("tplsource") === "none"): + logger.debug("Component " + _component.name + " has specified template-source=none, so no template load was done"); + var standardResponse = { + request: null, + component: _component + }; + _component.__done__().then(function () { + if (typeof _component.done === "function") { + _component.done.call(_component, standardResponse); + } resolve.call(_promise, standardResponse); - }, - function (standardResponse) { + }, function () { reject.call(_promise, standardResponse); }); - break; - case (_component.get("tplsource") === "external" && - _component.get("templateURI") !== ""): - _component.set("url", _component.get("templateURI")); - componentLoader(_component, false).then( - function (standardResponse) { + break; + case (_component.get("tplsource") === "inline"): + logger.debug("Component " + _component.name + " has specified template-source=inline, so it is assumed that template is already declared"); + (async function (_component) { + _component.feedComponent.bind(_component)(); + })(_component); + var standardResponse = { + request: null, + component: _component + }; + _component.__done__().then(function () { + if (typeof _component.done === "function") { + _component.done.call(_component, standardResponse); + } resolve.call(_promise, standardResponse); - }, - function (standardResponse) { + }, function () { reject.call(_promise, standardResponse); }); - break; - case _component.get("tplsource") === "default" && _component.get("templateURI", "") === "": - logger.debug(`Component ${_component.name} template-source is ${_component.get("tplsource")} and no templateURI is present`); - reject.call(_promise, `Component ${_component.name} template-source is ${_component.get("tplsource")} and no templateURI is present`); - break; - default: - logger.debug("Component " + _component.name + " will not be rebuilt because no templateURI is present"); - reject.call(_promise, { - request: null, - component: _component - }); - break; - } - - } - }); - return _promise; - } - - Cast(oClass) { - /* Cast method for components has been deprecated. Don't use this method, it is available only for compatibility purposes */ - let o = _methods_(oClass).map(m => m.name.replace(/bound /g, "")).map(m => { - return { - [m]: oClass[m].bind(this) - }; - }).reduce((c, p) => Object.assign(c, p), {}); - return _Cast(this, o); - } - - static route() { - var componentClass = this; /* is can be class or object*/ - var _route_promise_; - var isValidInstance = ( isQCObjects_Object(componentClass) && is_a(componentClass,"Component") ) ? (true) : (false); - var __route__ = function (componentList) { - var _componentNames_ = []; - var _promises_ = componentList.filter(function (rc) { - return typeof rc !== "undefined"; - }).map(function (rc) { - if (typeof rc.name !== "undefined") { - _componentNames_.push(rc.name); - } else { - throw new Error(__getType__(rc) + " does not have a name"); - } - return new Promise(function (resolve, reject) { - var _promise_; - if (typeof rc !== "undefined" && !!rc._reroute_) { - _promise_ = rc._reroute_() - .then(function () { - rc.reload = true; - return rc.rebuild(); - }) - .then(function (_rc_) { - if (Object.hasOwnProperty.call(rc, "subcomponents") && - typeof rc.subcomponents !== "undefined" && - rc.subcomponents.length > 0 - ) { - logger.debug("LOOKING FOR ROUTINGS IN SUBCOMPONENTS FOR: " + rc.name); - return __route__.call(rc, rc.subcomponents); - } else { - logger.debug("No subcomponents to look for routings in: " + rc.name); - if (rc.subtags.length>0){ - rc.subcomponents = rc.__buildSubComponents__(true); - } - resolve(rc); - } + break; + case (_component.get("tplsource") === "default" && + _component.get("templateURI") !== ""): + _component.set("url", _component.get("basePath") + _component.get("templateURI")); + componentLoader(_component, false).then( + function (standardResponse) { + resolve.call(_promise, standardResponse); + }, + function (standardResponse) { + reject.call(_promise, standardResponse); + }); + break; + case (_component.get("tplsource") === "external" && + _component.get("templateURI") !== ""): + _component.set("url", _component.get("templateURI")); + componentLoader(_component, false).then( + function (standardResponse) { + resolve.call(_promise, standardResponse); + }, + function (standardResponse) { + reject.call(_promise, standardResponse); + }); + break; + case _component.get("tplsource") === "default" && _component.get("templateURI", "") === "": + logger.debug(`Component ${_component.name} template-source is ${_component.get("tplsource")} and no templateURI is present`); + reject.call(_promise, `Component ${_component.name} template-source is ${_component.get("tplsource")} and no templateURI is present`); + break; + default: + logger.debug("Component " + _component.name + " will not be rebuilt because no templateURI is present"); + reject.call(_promise, { + request: null, + component: _component }); - } else if (typeof rc !== "undefined") { - reject("Component " + rc.name + " is not an instance of Component"); + break; } - return _promise_; - }); + + } }); - return Promise.all(_promises_) - .then(function () { - logger.debug("ROUTING COMPLETED FOR " + _componentNames_.join(", ")); - }).catch(function (err) { - logger.warn("ROUTING FAILED FOR " + _componentNames_.join(", ") + ": " + err); + return _promise; + } + + Cast(oClass) { + /* Cast method for components has been deprecated. Don't use this method, it is available only for compatibility purposes */ + let o = _methods_(oClass).map(m => m.name.replace(/bound /g, "")).map(m => { + return { + [m]: oClass[m].bind(this) + }; + }).reduce((c, p) => Object.assign(c, p), {}); + return _Cast(this, o); + } + + static route() { + var componentClass = this; /* is can be class or object*/ + var _route_promise_; + var isValidInstance = (isQCObjects_Object(componentClass) && is_a(componentClass, "Component")) ? (true) : (false); + var __route__ = function (componentList) { + var _componentNames_ = []; + var _promises_ = componentList.filter(function (rc) { + return typeof rc !== "undefined"; + }).map(function (rc) { + if (typeof rc.name !== "undefined") { + _componentNames_.push(rc.name); + } else { + throw new Error(__getType__(rc) + " does not have a name"); + } + return new Promise(function (resolve, reject) { + var _promise_; + if (typeof rc !== "undefined" && !!rc._reroute_) { + _promise_ = rc._reroute_() + .then(function () { + rc.reload = true; + return rc.rebuild(); + }) + .then(function (_rc_) { + if (Object.hasOwnProperty.call(rc, "subcomponents") && + typeof rc.subcomponents !== "undefined" && + rc.subcomponents.length > 0 + ) { + logger.debug("LOOKING FOR ROUTINGS IN SUBCOMPONENTS FOR: " + rc.name); + return __route__.call(rc, rc.subcomponents); + } else { + logger.debug("No subcomponents to look for routings in: " + rc.name); + if (rc.subtags.length > 0) { + rc.subcomponents = rc.__buildSubComponents__(true); + } + resolve(rc); + } + }); + } else if (typeof rc !== "undefined") { + reject("Component " + rc.name + " is not an instance of Component"); + } + return _promise_; + }); }); - }; - if (isValidInstance || !!_top.componentsStack) { - if (isValidInstance) { - logger.debug("loading routings for instance " + componentClass.name); + return Promise.all(_promises_) + .then(function () { + logger.debug("ROUTING COMPLETED FOR " + _componentNames_.join(", ")); + }).catch(function (err) { + logger.warn("ROUTING FAILED FOR " + _componentNames_.join(", ") + ": " + err); + }); + }; + if (isValidInstance || !!_top.componentsStack) { + if (isValidInstance) { + logger.debug("loading routings for instance " + componentClass.name); + } + _route_promise_ = __route__.call(componentClass, (isValidInstance) ? (componentClass.subcomponents) : (_top.componentsStack)); + } else { + logger.debug("An undetermined result expected if load routings. So will not be loaded this time."); + throw Error(`There is no valid instance and no components stack available to apply rountings`); } - _route_promise_ = __route__.call(componentClass, (isValidInstance) ? (componentClass.subcomponents) : (_top.componentsStack)); - } else { - logger.debug("An undetermined result expected if load routings. So will not be loaded this time."); - throw Error (`There is no valid instance and no components stack available to apply rountings`); + return _route_promise_; } - return _route_promise_; - } - - fullscreen() { - if (isBrowser) { - var elem = this.body; - if (elem.requestFullscreen) { - elem.requestFullscreen(); - } else if (elem.mozRequestFullScreen) { - /* Firefox */ - elem.mozRequestFullScreen(); - } else if (elem.webkitRequestFullscreen) { - /* Chrome, Safari & Opera */ - elem.webkitRequestFullscreen(); - } else if (elem.msRequestFullscreen) { - /* IE/Edge */ - elem.msRequestFullscreen(); + + fullscreen() { + if (isBrowser) { + var elem = this.body; + if (elem.requestFullscreen) { + elem.requestFullscreen(); + } else if (elem.mozRequestFullScreen) { + /* Firefox */ + elem.mozRequestFullScreen(); + } else if (elem.webkitRequestFullscreen) { + /* Chrome, Safari & Opera */ + elem.webkitRequestFullscreen(); + } else if (elem.msRequestFullscreen) { + /* IE/Edge */ + elem.msRequestFullscreen(); + } + } else { + // not yet implemented. } - } else { - // not yet implemented. } - } - - closefullscreen() { - if (isBrowser) { - if (document.exitFullscreen) { - document.exitFullscreen(); - } else if (document.mozCancelFullScreen) { - document.mozCancelFullScreen(); - } else if (document.webkitExitFullscreen) { - document.webkitExitFullscreen(); - } else if (document.msExitFullscreen) { - document.msExitFullscreen(); + + closefullscreen() { + if (isBrowser) { + if (document.exitFullscreen) { + document.exitFullscreen(); + } else if (document.mozCancelFullScreen) { + document.mozCancelFullScreen(); + } else if (document.webkitExitFullscreen) { + document.webkitExitFullscreen(); + } else if (document.msExitFullscreen) { + document.msExitFullscreen(); + } + } else { + // noy yet implemented. } - } else { - // noy yet implemented. } - } - - _generateRoutingPaths(componentBody) { - var component = this; - return new Promise(function (resolve, reject){ - if (isBrowser) { - if (__valid_routing_way__(component.validRoutingWays, component.routingWay)) { - if (typeof componentBody !== "undefined") { - component.innerHTML = componentBody.innerHTML; - component.routingNodes = componentBody.subelements("routing"); - component.routings = []; - component.routingNodes.map(function (routingNode, r) { - var attributeNames = routingNode.getAttributeNames(); - var routing = {}; - attributeNames.map(function (attributeName, a) { - routing[attributeNames[a]] = routingNode.getAttribute(attributeNames[a]); + + _generateRoutingPaths(componentBody) { + var component = this; + return new Promise(function (resolve, reject) { + if (isBrowser) { + if (__valid_routing_way__(component.validRoutingWays, component.routingWay)) { + if (typeof componentBody !== "undefined") { + component.innerHTML = componentBody.innerHTML; + component.routingNodes = componentBody.subelements("routing"); + component.routings = []; + component.routingNodes.map(function (routingNode, r) { + var attributeNames = routingNode.getAttributeNames(); + var routing = {}; + attributeNames.map(function (attributeName, a) { + routing[attributeNames[a]] = routingNode.getAttribute(attributeNames[a]); + }); + component.routings.push(routing); + if (!component.routingPaths) { + component.routingPaths = []; + } + if (!component.routingPaths.includes(routing.path)) { + component.routingPaths.push(routing.path); + } + if (!_top.global.get("routingPaths")) { + _top.global.set("routingPaths", []); + } + if (!_top.global.get("routingPaths").includes(routing.path)) { + _top.global.get("routingPaths").push(routing.path); + } }); - component.routings.push(routing); - if (!component.routingPaths) { - component.routingPaths = []; - } - if (!component.routingPaths.includes(routing.path)) { - component.routingPaths.push(routing.path); - } - if (!_top.global.get("routingPaths")) { - _top.global.set("routingPaths", []); - } - if (!_top.global.get("routingPaths").includes(routing.path)) { - _top.global.get("routingPaths").push(routing.path); - } - }); + } } + } else { + // not yet implemented. } - } else { - // not yet implemented. - } - resolve(); - - }); - } - - parseTemplate(template) { - var _self = this; - var _parsedAssignmentText; - var value = template; - if (Object.hasOwnProperty.call(_self, "templateHandler")) { - var templateHandlerName = _self.templateHandler; - logger.debug(`[Component][${this.name}][parseTemplate] Attempting to use ${templateHandlerName} ...`); - var templateHandlerClass = ClassFactory(templateHandlerName); - var templateInstance = New(templateHandlerClass, { - component: _self, - template: value + resolve(); + }); - templateInstance.component = _self; - var selfData = _self.data; - if (Object.hasOwnProperty.call(_self, "assignRoutingParams") && _self.assignRoutingParams) { - try { - selfData = Object.assign(selfData, _self.routingParams); - } catch (e) { - logger.debug("[parseTemplate] it was not possible to assign the routing params to the template"); + } + + parseTemplate(template) { + var _self = this; + var _parsedAssignmentText; + var value = template; + if (Object.hasOwnProperty.call(_self, "templateHandler")) { + var templateHandlerName = _self.templateHandler; + logger.debug(`[Component][${this.name}][parseTemplate] Attempting to use ${templateHandlerName} ...`); + var templateHandlerClass = ClassFactory(templateHandlerName); + var templateInstance = New(templateHandlerClass, { + component: _self, + template: value + }); + templateInstance.component = _self; + var selfData = _self.data; + if (Object.hasOwnProperty.call(_self, "assignRoutingParams") && _self.assignRoutingParams) { + try { + selfData = Object.assign(selfData, _self.routingParams); + } catch (e) { + logger.debug("[parseTemplate] it was not possible to assign the routing params to the template"); + } } + _parsedAssignmentText = templateInstance.assign(selfData); + } else { + logger.debug(`[Component][${this.name}][parseTemplate] No value for templateHandler. Using raw content...`); + _parsedAssignmentText = value; } - _parsedAssignmentText = templateInstance.assign(selfData); - } else { - logger.debug(`[Component][${this.name}][parseTemplate] No value for templateHandler. Using raw content...`); - _parsedAssignmentText = value; + return _parsedAssignmentText; } - return _parsedAssignmentText; - } - - _reroute_() { - /* This method set the selected routing and makes the switch to the templateURI */ - var rc = this; - return new Promise(function (resolve, reject) { - if (isBrowser) { - if (__valid_routing_way__(rc.validRoutingWays, rc.routingWay)) { - rc.routingPath = document.location[rc.routingWay]; - rc.routingSelected.map(function (routing, r) { - var componentURI = ComponentURI({ - "COMPONENTS_BASE_PATH": _top.CONFIG.get("componentsBasePath"), - "COMPONENT_NAME": routing.name.toString(), - "TPLEXTENSION": (Object.hasOwnProperty.call(routing, "tplextension")) ? (routing.tplextension) : (rc.tplextension), - "TPL_SOURCE": "default" /* here is always default in order to get the right uri */ + + _reroute_() { + /* This method set the selected routing and makes the switch to the templateURI */ + var rc = this; + return new Promise(function (resolve, reject) { + if (isBrowser) { + if (__valid_routing_way__(rc.validRoutingWays, rc.routingWay)) { + rc.routingPath = document.location[rc.routingWay]; + rc.routingSelected.map(function (routing, r) { + var componentURI = ComponentURI({ + "COMPONENTS_BASE_PATH": _top.CONFIG.get("componentsBasePath"), + "COMPONENT_NAME": routing.name.toString(), + "TPLEXTENSION": (Object.hasOwnProperty.call(routing, "tplextension")) ? (routing.tplextension) : (rc.tplextension), + "TPL_SOURCE": "default" /* here is always default in order to get the right uri */ + }); + rc.templateURI = componentURI; }); - rc.templateURI = componentURI; - }); - if (rc.routingSelected.length > 0) { - rc.template = ""; - rc.body.innerHTML = ""; + if (rc.routingSelected.length > 0) { + rc.template = ""; + rc.body.innerHTML = ""; + } } } - } - resolve(rc); - - }); - } - - lazyLoadImages() { - if (isBrowser) { - var component = this; - var _componentRoot = (component.shadowed) ? (component.shadowRoot) : (component.body); - var _imgLazyLoaded = [..._componentRoot.subelements("img[lazy-src]")]; - var _lazyLoadImages = function (image) { - image.setAttribute("src", image.getAttribute("lazy-src")); - image.onload = () => { - image.removeAttribute("lazy-src"); + resolve(rc); + + }); + } + + lazyLoadImages() { + if (isBrowser) { + var component = this; + var _componentRoot = (component.shadowed) ? (component.shadowRoot) : (component.body); + var _imgLazyLoaded = [..._componentRoot.subelements("img[lazy-src]")]; + var _lazyLoadImages = function (image) { + image.setAttribute("src", image.getAttribute("lazy-src")); + image.onload = () => { + image.removeAttribute("lazy-src"); + }; }; - }; - if ("IntersectionObserver" in window) { - var observer = new IntersectionObserver((items, observer) => { - items.forEach((item) => { - if (item.isIntersecting) { - _lazyLoadImages(item.target); - observer.unobserve(item.target); - } + if ("IntersectionObserver" in window) { + var observer = new IntersectionObserver((items, observer) => { + items.forEach((item) => { + if (item.isIntersecting) { + _lazyLoadImages(item.target); + observer.unobserve(item.target); + } + }); }); - }); - _imgLazyLoaded.map(function (img) { - return observer.observe(img); - }); + _imgLazyLoaded.map(function (img) { + return observer.observe(img); + }); + } else { + _imgLazyLoaded.map(_lazyLoadImages); + } + } else { - _imgLazyLoaded.map(_lazyLoadImages); + // not yet implemented } - - } else { - // not yet implemented + return null; } - return null; - } - - applyTransitionEffect(effectClassName) { - var _Effect = ClassFactory(effectClassName); - if (typeof _Effect === "undefined" ){ - throw Error (`${effectClassName} not found.`); - } - if (typeof _Effect !== "undefined" && is_a(_Effect, "TransitionEffect")) { - this.effect = New(_Effect, { - component: this - }); - this.effect.apply(this.effect.defaultParams); - } else { - logger.debug(`${effectClassName} is ${__getType__(_Effect)} but is not a TransitionEffect`); + + applyTransitionEffect(effectClassName) { + var _Effect = ClassFactory(effectClassName); + if (typeof _Effect === "undefined") { + throw Error(`${effectClassName} not found.`); + } + if (typeof _Effect !== "undefined" && is_a(_Effect, "TransitionEffect")) { + this.effect = New(_Effect, { + component: this + }); + this.effect.apply(this.effect.defaultParams); + } else { + logger.debug(`${effectClassName} is ${__getType__(_Effect)} but is not a TransitionEffect`); + } } - } - - applyObserveTransitionEffect(effectClassName) { - if (isBrowser) { - var component = this; - var _componentRoot = (component.shadowed) ? (component.shadowRoot.host) : (component.body); - var _applyEffect_ = function (element) { - component.applyTransitionEffect(effectClassName); - }; - if ("IntersectionObserver" in window) { - var observer = new IntersectionObserver((items, observer) => { - items.forEach((item) => { - if (item.isIntersecting) { - _applyEffect_(item.target); - observer.unobserve(item.target); - } + + applyObserveTransitionEffect(effectClassName) { + if (isBrowser) { + var component = this; + var _componentRoot = (component.shadowed) ? (component.shadowRoot.host) : (component.body); + var _applyEffect_ = function (element) { + component.applyTransitionEffect(effectClassName); + }; + if ("IntersectionObserver" in window) { + var observer = new IntersectionObserver((items, observer) => { + items.forEach((item) => { + if (item.isIntersecting) { + _applyEffect_(item.target); + observer.unobserve(item.target); + } + }); }); - }); - observer.observe(_componentRoot); + observer.observe(_componentRoot); + } else { + _applyEffect_(_componentRoot); + } } else { - _applyEffect_(_componentRoot); + // not yet implemented } - } else { - // not yet implemented + return null; } - return null; - } - - scrollIntoHash() { - if (isBrowser) { - var component = this; - if (document.location.hash !== "") { - var _componentRoot = (component.shadowed) ? (component.shadowRoot) : (component.body); - _componentRoot.subelements(document.location.hash).map( - function (element) { - if (typeof element.scrollIntoView === "function") { - element.scrollIntoView( - _top.CONFIG.get("scrollIntoHash", { - behavior: "auto", - block: "top", - inline: "top" - }) - ); + + scrollIntoHash() { + if (isBrowser) { + var component = this; + if (document.location.hash !== "") { + var _componentRoot = (component.shadowed) ? (component.shadowRoot) : (component.body); + _componentRoot.subelements(document.location.hash).map( + function (element) { + if (typeof element.scrollIntoView === "function") { + element.scrollIntoView( + _top.CONFIG.get("scrollIntoHash", { + behavior: "auto", + block: "top", + inline: "top" + }) + ); + } } - } - ); + ); + } + } else { + // not yet implemented } - } else { - // not yet implemented } - } - - i18n_translate() { - if (isBrowser) { - if (_top.CONFIG.get("use_i18n")) { - var component = this; - var _componentRoot = (component.shadowed) ? (component.shadowRoot) : (component.body); - var lang1 = _top.CONFIG.get("lang", "en"); - var lang2 = navigator.language.slice(0, 2); - var i18n = _top.global.get("i18n"); - if ((lang1 !== lang2) && (typeof i18n === "object" && Object.hasOwnProperty.call(i18n, "messages"))) { - var callback_i18n = function () { - var component = this; - return new Promise(function (resolve, reject) { - var messages = i18n.messages.filter(function (message) { - return Object.hasOwnProperty.call(message, lang1) && Object.hasOwnProperty.call(message, lang2); - }); - _componentRoot.subelements("ul,li,h1,h2,h3,a,b,p,input,textarea,summary,details,option,component") - .map(function (element) { - messages.map(function (message) { - var _innerHTML = element.innerHTML; - _innerHTML = _innerHTML.replace(new RegExp(`${message[lang1]}`, "g"), message[lang2]); - element.innerHTML = _innerHTML; - return null; - }); - return element; + + i18n_translate() { + if (isBrowser) { + if (_top.CONFIG.get("use_i18n")) { + var component = this; + var _componentRoot = (component.shadowed) ? (component.shadowRoot) : (component.body); + var lang1 = _top.CONFIG.get("lang", "en"); + var lang2 = navigator.language.slice(0, 2); + var i18n = _top.global.get("i18n"); + if ((lang1 !== lang2) && (typeof i18n === "object" && Object.hasOwnProperty.call(i18n, "messages"))) { + var callback_i18n = function () { + var component = this; + return new Promise(function (resolve, reject) { + var messages = i18n.messages.filter(function (message) { + return Object.hasOwnProperty.call(message, lang1) && Object.hasOwnProperty.call(message, lang2); }); - resolve(); + _componentRoot.subelements("ul,li,h1,h2,h3,a,b,p,input,textarea,summary,details,option,component") + .map(function (element) { + messages.map(function (message) { + var _innerHTML = element.innerHTML; + _innerHTML = _innerHTML.replace(new RegExp(`${message[lang1]}`, "g"), message[lang2]); + element.innerHTML = _innerHTML; + return null; + }); + return element; + }); + resolve(); + }); + }; + callback_i18n.call(component).then(function () { + logger.debug("i18n loaded for component: " + component.name); }); - }; - callback_i18n.call(component).then(function () { - logger.debug("i18n loaded for component: " + component.name); - }); - + + } } + } else { + // not yet implemented } - } else { - // not yet implemented } - } - - addComponentHelper(componentHelper) { - var component = this; - component._componentHelpers.push(componentHelper); - } - - runComponentHelpers() { - if (isBrowser) { + + addComponentHelper(componentHelper) { var component = this; - var __component_helpers__ = []; - /* - * BEGIN use i18n translation - */ - __component_helpers__.push(component.i18n_translate.bind(component)); - /* - * END use i18n translation - */ - - /* - * BEGIN component scrollIntoHash - */ - __component_helpers__.push(component.scrollIntoHash.bind(component)); - /* - * END component scrollIntoHash - */ - - /* - * BEGIN component images lazy-load - */ - - __component_helpers__.push(component.lazyLoadImages.bind(component)); - - /* - * END component images lazy-load - */ - - __component_helpers__ = __component_helpers__.concat(component._componentHelpers); - - __component_helpers__.map( - function (_component_helper_) { - logger.debug(`Executing ${_component_helper_.name} as component helper for ${component.name}...`); - _component_helper_(); - } - ); - - } else { - // not yet implemented + component._componentHelpers.push(componentHelper); } - + + runComponentHelpers() { + if (isBrowser) { + var component = this; + var __component_helpers__ = []; + /* + * BEGIN use i18n translation + */ + __component_helpers__.push(component.i18n_translate.bind(component)); + /* + * END use i18n translation + */ + + /* + * BEGIN component scrollIntoHash + */ + __component_helpers__.push(component.scrollIntoHash.bind(component)); + /* + * END component scrollIntoHash + */ + + /* + * BEGIN component images lazy-load + */ + + __component_helpers__.push(component.lazyLoadImages.bind(component)); + + /* + * END component images lazy-load + */ + + __component_helpers__ = __component_helpers__.concat(component._componentHelpers); + + __component_helpers__.map( + function (_component_helper_) { + logger.debug(`Executing ${_component_helper_.name} as component helper for ${component.name}...`); + _component_helper_(); + } + ); + + } else { + // not yet implemented + } + + } + } - - } - - ]); - - (_methods_)(ClassFactory("Component")).map(function (__c__) { - (_protected_code_)(__c__); - }); - - if (isBrowser){ - window.addEventListener("popstate",function (popStateEvent){ - popStateEvent.stopImmediatePropagation(); - popStateEvent.stopPropagation(); - ClassFactory("Component").route(); + + ]); + + (_methods_)(ClassFactory("Component")).map(function (__c__) { + (_protected_code_)(__c__); }); - } - Package("com.qcobjects.controllers", [ - class Controller extends ClassFactory("InheritClass") { - component = null; - dependencies = []; - constructor ({ - component, - dependencies - }){ - super ({component, dependencies}); - this.component = component; - this.dependencies = dependencies; - if (typeof this.component === "undefined" || this.component === "null"){ - throw Error (`${__getType__(this)} must be called with a component`); + if (isBrowser) { + window.addEventListener("popstate", function (popStateEvent) { + popStateEvent.stopImmediatePropagation(); + popStateEvent.stopPropagation(); + ClassFactory("Component").route(); + }); + } + + Package("com.qcobjects.controllers", [ + class Controller extends ClassFactory("InheritClass") { + component = null; + dependencies = []; + constructor({ + component, + dependencies + }) { + super({ component, dependencies }); + this.component = component; + this.dependencies = dependencies; + if (typeof this.component === "undefined" || this.component === "null") { + throw Error(`${__getType__(this)} must be called with a component`); + } } - } - routingSelectedAttr(attrName) { - return this.component.routingSelected.map(function (r) { - return r[attrName]; - }).filter(function (v) { - return v; - }).pop(); - } + routingSelectedAttr(attrName) { + return this.component.routingSelected.map(function (r) { + return r[attrName]; + }).filter(function (v) { + return v; + }).pop(); + } - isTouchable() { - return ("ontouchstart" in window) || - (navigator.MaxTouchPoints > 0) || - (navigator.msMaxTouchPoints > 0); - } + isTouchable() { + return ("ontouchstart" in window) || + (navigator.MaxTouchPoints > 0) || + (navigator.msMaxTouchPoints > 0); + } - onpress(subelementSelector, handler) { - try { - if (this.isTouchable()) { - this.component.body.subelements(subelementSelector)[0].addEventListener("touchstart", handler, { - passive: true - }); - } else { - this.component.body.subelements(subelementSelector)[0].addEventListener("click", handler, { - passive: true - }); + onpress(subelementSelector, handler) { + try { + if (this.isTouchable()) { + this.component.body.subelements(subelementSelector)[0].addEventListener("touchstart", handler, { + passive: true + }); + } else { + this.component.body.subelements(subelementSelector)[0].addEventListener("click", handler, { + passive: true + }); + } + } catch (e) { + logger.debug("No button to assign press event"); } - } catch (e) { - logger.debug("No button to assign press event"); } - } - createRoutingController() { - var controller = this; - var component = controller.component; - var controllerName = controller.routingSelectedAttr("controllerclass"); - if (typeof controllerName !== "undefined") { - var _Controller = ClassFactory(controllerName); - if (typeof _Controller !== "undefined") { - component.routingController = New(_Controller, { - component: component - }); // Initializes the main controller for the component - if (Object.hasOwnProperty.call(component.routingController, "done") && typeof component.routingController.done === "function") { - component.routingController.done.call(component.routingController); + createRoutingController() { + var controller = this; + var component = controller.component; + var controllerName = controller.routingSelectedAttr("controllerclass"); + if (typeof controllerName !== "undefined") { + var _Controller = ClassFactory(controllerName); + if (typeof _Controller !== "undefined") { + component.routingController = New(_Controller, { + component: component + }); // Initializes the main controller for the component + if (Object.hasOwnProperty.call(component.routingController, "done") && typeof component.routingController.done === "function") { + component.routingController.done.call(component.routingController); + } } } } + + done() { } } + ]); - done(){} - } - ]); + Package("com.qcobjects.views", [ + class View extends ClassFactory("InheritClass") { + constructor({ component = undefined, dependencies = [] }) { + super(...arguments); + if (typeof this.component === "undefined" || this.component === "null") { + throw Error(`${__getType__(this)} must be called with a component`); + } - Package("com.qcobjects.views",[ - class View extends ClassFactory("InheritClass") { - constructor ({component = undefined, dependencies = []}){ - super(...arguments); - if (typeof this.component === "undefined" || this.component === "null"){ - throw Error (`${__getType__(this)} must be called with a component`); } - - } - } - ]); - - Package("com.qcobjects.api", [ - class Service extends ClassFactory("InheritClass") { - kind= "rest"; - /* it can be rest, mockup, local */ - domain= _domain_; - basePath= _basePath_; - url= ""; - method= "GET"; - data= {}; - reload= false; - cached= false; - - constructor () { - super(...arguments); } + ]); - set(name, value) { - this[name] = value; - } + Package("com.qcobjects.api", [ + class Service extends ClassFactory("InheritClass") { + kind = "rest"; + /* it can be rest, mockup, local */ + domain = _domain_; + basePath = _basePath_; + url = ""; + method = "GET"; + data = {}; + reload = false; + cached = false; + + constructor() { + super(...arguments); + } - get(name) { - return this[name]; - } - - } + set(name, value) { + this[name] = value; + } - ]); + get(name) { + return this[name]; + } - Package("com.qcobjects.api.services", [ - class JSONService extends ClassFactory("Service") { - method= "GET"; - cached= false; - headers= { - "Content-Type": "application/json", - "charset": "utf-8" - }; - JSONresponse= null; - done(result) { - logger.debug("***** RECEIVED RESPONSE:"); - logger.debug(result.service.template); - this.JSONresponse = JSON.parse(result.service.template); - } - - constructor (){ - super(...arguments); } - } - ]); - - Package("com.qcobjects.api.config", [ - class ConfigService extends ClassFactory("JSONService"){ - method= "GET"; - cached= false; - configFileName= "config.json"; - headers= { - "Content-Type": "application/json", - "charset": "utf-8" - }; - JSONresponse= null; - done(result) { - logger.debug("***** CONFIG LOADED:"); - logger.debug(result.service.template); - this.JSONresponse = JSON.parse(result.service.template); - if (Object.hasOwnProperty.call(this.JSONresponse, "__encoded__")) { - this.JSONresponse = JSON.parse(ClassFactory("_Crypt").decrypt(this.JSONresponse.__encoded__, _secretKey)); - } - for (var k in this.JSONresponse) { - _top.CONFIG.set(k, this.JSONresponse[k]); - } - this.configLoaded.call(this); - } - fail(result) { - this.configLoaded.call(this); + ]); + + Package("com.qcobjects.api.services", [ + class JSONService extends ClassFactory("Service") { + method = "GET"; + cached = false; + headers = { + "Content-Type": "application/json", + "charset": "utf-8" + }; + JSONresponse = null; + done(result) { + logger.debug("***** RECEIVED RESPONSE:"); + logger.debug(result.service.template); + this.JSONresponse = JSON.parse(result.service.template); + } + + constructor() { + super(...arguments); + } + } + ]); - constructor (){ - super(...arguments); - this.set("url", this.get("basePath") + this.get("configFileName")); + Package("com.qcobjects.api.config", [ + class ConfigService extends ClassFactory("JSONService") { + method = "GET"; + cached = false; + configFileName = "config.json"; + headers = { + "Content-Type": "application/json", + "charset": "utf-8" + }; + JSONresponse = null; + done(result) { + logger.debug("***** CONFIG LOADED:"); + logger.debug(result.service.template); + this.JSONresponse = JSON.parse(result.service.template); + if (Object.hasOwnProperty.call(this.JSONresponse, "__encoded__")) { + this.JSONresponse = JSON.parse(ClassFactory("_Crypt").decrypt(this.JSONresponse.__encoded__, _secretKey)); + } + for (var k in this.JSONresponse) { + _top.CONFIG.set(k, this.JSONresponse[k]); + } + this.configLoaded.call(this); + } + fail(result) { + this.configLoaded.call(this); + } + + constructor() { + super(...arguments); + this.set("url", this.get("basePath") + this.get("configFileName")); + } } - } - ]); + ]); - Package("com.qcobjects.valueObjects", [ - class VO extends ClassFactory("InheritClass") { - constructor (){ - super(...arguments); + Package("com.qcobjects.valueObjects", [ + class VO extends ClassFactory("InheritClass") { + constructor() { + super(...arguments); + } } - } - ]); - - /** - * Returns a standarized uri for a component - * @example - * templateURI = ComponentURI({'COMPONENTS_BASE_PATH':'','COMPONENT_NAME':'','TPLEXTENSION':'','TPL_SOURCE':''}) - * @author: Jean Machuca - * @param params an object with the params to build the uri path - */ - var ComponentURI = ({TPL_SOURCE ,COMPONENTS_BASE_PATH, COMPONENT_NAME, TPLEXTENSION}) => { - const templateURI = (TPL_SOURCE === "default")?(`${COMPONENTS_BASE_PATH}${COMPONENT_NAME}.${TPLEXTENSION}`):(""); - return templateURI; - }; - - /** - * Loads a simple component from a template - * - * @author: Jean Machuca - * @param component a Component object - */ - var componentLoader = function (component, _async) { - var __promise__; - var _componentLoaderInBrowser = function (component, _async) { - __promise__ = new Promise(function (resolve, reject) { - var _promise = component.__promise__; - var container = (Object.hasOwnProperty.call(component, "container") && typeof component.container !== "undefined" && component.container !== null) ? (component.container) : (component.body); - if (container !== null) { + ]); + + /** + * Returns a standarized uri for a component + * @example + * templateURI = ComponentURI({'COMPONENTS_BASE_PATH':'','COMPONENT_NAME':'','TPLEXTENSION':'','TPL_SOURCE':''}) + * @author: Jean Machuca + * @param params an object with the params to build the uri path + */ + var ComponentURI = ({ TPL_SOURCE, COMPONENTS_BASE_PATH, COMPONENT_NAME, TPLEXTENSION }) => { + const templateURI = (TPL_SOURCE === "default") ? (`${COMPONENTS_BASE_PATH}${COMPONENT_NAME}.${TPLEXTENSION}`) : (""); + return templateURI; + }; + + /** + * Loads a simple component from a template + * + * @author: Jean Machuca + * @param component a Component object + */ + var componentLoader = function (component, _async) { + var __promise__; + var _componentLoaderInBrowser = function (component, _async) { + __promise__ = new Promise(function (resolve, reject) { + var _promise = component.__promise__; + var container = (Object.hasOwnProperty.call(component, "container") && typeof component.container !== "undefined" && component.container !== null) ? (component.container) : (component.body); + if (container !== null) { + var _feedComponent_ = function (component) { + component.feedComponent(); + var standardResponse = { + "request": xhr, + "component": component + }; + resolve.call(_promise, standardResponse); + }; + logger.debug("LOADING COMPONENT DATA {{DATA}} FROM {{URL}}".replace("{{DATA}}", _DataStringify(component.data)).replace("{{URL}}", component.url)); + + var _componentLoaded = function () { + var successStatus = (is_file) ? (0) : (200); + if (xhr.status === successStatus) { + var response = xhr.responseText; + logger.debug("Data received {{DATA}}".replace("{{DATA}}", _DataStringify(response))); + logger.debug("CREATING COMPONENT {{NAME}}".replace("{{NAME}}", component.name)); + component.template = response; + if (component.cached && (typeof cache !== "undefined")) { + cache.save(component.name, component.template); + } + _feedComponent_.call(this, component); + } else { + var standardResponse = { + "request": xhr, + "component": component + }; + reject.call(_promise, standardResponse); + + } + }; + if (typeof component.template === "string" && component.template !== "") { + // component already has a template it does not need to be reloaded + _feedComponent_.call(this, component); + } else { + var is_file = (component.url.startsWith("file:")) ? (true) : (false); + var xhr = new XMLHttpRequest(); + if (!is_file) { + try { + logger.debug("Calling the url of component in async mode."); + xhr.open(component.method, component.url, true); + } catch (e) { + logger.debug("Last try has failed... The component cannot be loaded."); + } + } else { + if ("fetch" in _top) { + logger.debug("I can use fetch..."); + logger.debug("It is a file to be loaded, so I will try to use fetch"); + var _p = fetch(component.url).then(response => { + logger.debug("I got a response from fetch, so I'll feed the component"); + response.text().then(text => { + component.template = text; + _feedComponent_.call(this, component); + }); + }); + } + } + if (!is_phonegap && !is_file) { + xhr.setRequestHeader("Content-Type", "text/html"); + } + if (!is_file) { + xhr.onload = _componentLoaded; + } + var _directLoad = function (is_file) { + is_file = (typeof is_file === "undefined" || !is_file) ? (false) : (true); + logger.debug("SENDING THE NORMAL REQUEST "); + if (is_file) { + if (!("fetch" in _top)) { + logger.debug("I have to try to load the file using xhr... "); + xhr.send(null); + if (xhr.status === XMLHttpRequest.DONE) { + _componentLoaded.call(this); + } + } + } else { + logger.debug("Trying to send the data to the component... "); + xhr.send(_DataStringify(component.data)); + } + }; + + if (component.cached && (!is_file)) { + logger.debug("USING CACHE FOR COMPONENT: " + component.name); + var cache = new ComplexStorageCache({ + index: component.cacheIndex, + load(cacheController) { + _directLoad.call(this, is_file); + }, + alternate(cacheController) { + if (component.method === "GET") { + component.template = cacheController.cache.getCached(component.cacheIndex); + _feedComponent_.call(this, component); + } else { + _directLoad.call(this, is_file); + } + return; + } + }); + global.lastCache = cache; + } else { + logger.debug("NOT USING CACHE FOR COMPONENT: " + component.name); + _directLoad.call(this, is_file); + } + + } + } else { + logger.debug("CONTAINER DOESNT EXIST"); + } + }); + __promise__.then(function (standardResponse) { + return component.__done__().then(function () { + var _ret_; + if (typeof component.done === "function") { + _ret_ = component.done.call(component, standardResponse); + } + return Promise.resolve(_ret_); + }); + }, function (standardResponse) { + var _ret_; + if (typeof component.fail === "function") { + _ret_ = component.fail.call(component, standardResponse); + } + return Promise.reject(_ret_); + }).catch(function (e) { + logger.debug("Something wrong loading the component"); + }); + return __promise__; + }; + var _componentLoaderInNode = function (component, _async) { + __promise__ = new Promise(function (resolve, reject) { + var _promise = __promise__; var _feedComponent_ = function (component) { component.feedComponent(); var standardResponse = { - "request": xhr, + "request": null, "component": component }; resolve.call(_promise, standardResponse); }; logger.debug("LOADING COMPONENT DATA {{DATA}} FROM {{URL}}".replace("{{DATA}}", _DataStringify(component.data)).replace("{{URL}}", component.url)); - var _componentLoaded = function () { - var successStatus = (is_file) ? (0) : (200); - if (xhr.status === successStatus) { - var response = xhr.responseText; + var _componentLoaded = function (err, responseText) { + if (!err) { + var response = responseText.toString(); logger.debug("Data received {{DATA}}".replace("{{DATA}}", _DataStringify(response))); logger.debug("CREATING COMPONENT {{NAME}}".replace("{{NAME}}", component.name)); component.template = response; @@ -3426,75 +3570,36 @@ _feedComponent_.call(this, component); } else { var standardResponse = { - "request": xhr, + "request": null, "component": component }; reject.call(_promise, standardResponse); - } }; if (typeof component.template === "string" && component.template !== "") { // component already has a template it does not need to be reloaded _feedComponent_.call(this, component); } else { - var is_file = (component.url.startsWith("file:")) ? (true) : (false); - var xhr = new XMLHttpRequest(); - if (!is_file) { - try { - logger.debug("Calling the url of component in async mode."); - xhr.open(component.method, component.url, true); - } catch (e) { - logger.debug("Last try has failed... The component cannot be loaded."); - } - } else { - if ("fetch" in _top) { - logger.debug("I can use fetch..."); - logger.debug("It is a file to be loaded, so I will try to use fetch"); - var _p = fetch(component.url).then(response => { - logger.debug("I got a response from fetch, so I'll feed the component"); - response.text().then(text => { - component.template = text; - _feedComponent_.call(this, component); - }); - }); - } - } - if (!is_phonegap && !is_file) { - xhr.setRequestHeader("Content-Type", "text/html"); - } - if (!is_file) { - xhr.onload = _componentLoaded; - } + logger.debug("Loading the component as a local file in server..."); var _directLoad = function (is_file) { - is_file = (typeof is_file === "undefined" || !is_file) ? (false) : (true); + const fs = _require_("fs"); logger.debug("SENDING THE NORMAL REQUEST "); - if (is_file) { - if (!("fetch" in _top)) { - logger.debug("I have to try to load the file using xhr... "); - xhr.send(null); - if (xhr.status === XMLHttpRequest.DONE) { - _componentLoaded.call(this); - } - } - } else { - logger.debug("Trying to send the data to the component... "); - xhr.send(_DataStringify(component.data)); - } + fs.readFile(component.url, _componentLoaded); }; - if (component.cached && (!is_file)) { + if (component.cached) { logger.debug("USING CACHE FOR COMPONENT: " + component.name); var cache = new ComplexStorageCache({ index: component.cacheIndex, load(cacheController) { - _directLoad.call(this, is_file); + _directLoad.call(this); }, alternate(cacheController) { if (component.method === "GET") { component.template = cacheController.cache.getCached(component.cacheIndex); _feedComponent_.call(this, component); } else { - _directLoad.call(this, is_file); + _directLoad.call(this); } return; } @@ -3502,1745 +3607,1657 @@ global.lastCache = cache; } else { logger.debug("NOT USING CACHE FOR COMPONENT: " + component.name); - _directLoad.call(this, is_file); + _directLoad.call(this); } } - } else { - logger.debug("CONTAINER DOESNT EXIST"); - } - }); - __promise__.then(function (standardResponse) { - return component.__done__().then (function (){ - var _ret_; - if (typeof component.done === "function") { - _ret_ = component.done.call(component, standardResponse); - } - return Promise.resolve(_ret_); }); - }, function (standardResponse) { - var _ret_; - if (typeof component.fail === "function") { - _ret_ = component.fail.call(component, standardResponse); - } - return Promise.reject(_ret_); - }).catch(function (e) { - logger.debug("Something wrong loading the component"); - }); - return __promise__; - }; - var _componentLoaderInNode = function (component, _async) { - __promise__ = new Promise(function (resolve, reject) { - var _promise = __promise__; - var _feedComponent_ = function (component) { - component.feedComponent(); - var standardResponse = { - "request": null, - "component": component - }; - resolve.call(_promise, standardResponse); - }; - logger.debug("LOADING COMPONENT DATA {{DATA}} FROM {{URL}}".replace("{{DATA}}", _DataStringify(component.data)).replace("{{URL}}", component.url)); - - var _componentLoaded = function (err, responseText) { - if (!err) { - var response = responseText.toString(); - logger.debug("Data received {{DATA}}".replace("{{DATA}}", _DataStringify(response))); - logger.debug("CREATING COMPONENT {{NAME}}".replace("{{NAME}}", component.name)); - component.template = response; - if (component.cached && (typeof cache !== "undefined")) { - cache.save(component.name, component.template); + __promise__.then(function (standardResponse) { + return component.__done__().then(function () { + var _ret_; + if (typeof component.done === "function") { + _ret_ = component.done.call(component, standardResponse); } - _feedComponent_.call(this, component); - } else { - var standardResponse = { - "request": null, - "component": component - }; - reject.call(_promise, standardResponse); - } - }; - if (typeof component.template === "string" && component.template !== "") { - // component already has a template it does not need to be reloaded - _feedComponent_.call(this, component); - } else { - logger.debug("Loading the component as a local file in server..."); - var _directLoad = function (is_file) { - const fs = _require_("fs"); - logger.debug("SENDING THE NORMAL REQUEST "); - fs.readFile(component.url, _componentLoaded); - }; - - if (component.cached) { - logger.debug("USING CACHE FOR COMPONENT: " + component.name); - var cache = new ComplexStorageCache({ - index: component.cacheIndex, - load(cacheController) { - _directLoad.call(this); - }, - alternate(cacheController) { - if (component.method === "GET") { - component.template = cacheController.cache.getCached(component.cacheIndex); - _feedComponent_.call(this, component); - } else { - _directLoad.call(this); - } - return; - } - }); - global.lastCache = cache; - } else { - logger.debug("NOT USING CACHE FOR COMPONENT: " + component.name); - _directLoad.call(this); - } - - } - }); - __promise__.then(function (standardResponse) { - return component.__done__().then (function (){ + return Promise.resolve(_ret_); + }); + }, function (standardResponse) { var _ret_; - if (typeof component.done === "function") { - _ret_ = component.done.call(component, standardResponse); + if (typeof component.fail === "function") { + _ret_ = component.fail.call(component, standardResponse); } - return Promise.resolve(_ret_); + return Promise.reject(_ret_); + }).catch(function (e) { + logger.debug(`Something wrong loading the component: ${e}`); }); - }, function (standardResponse) { - var _ret_; - if (typeof component.fail === "function") { - _ret_ = component.fail.call(component, standardResponse); - } - return Promise.reject(_ret_); - }).catch(function (e) { - logger.debug(`Something wrong loading the component: ${e}`); - }); - return __promise__; - }; + return __promise__; + }; - var _ret_; - if (isBrowser) { - if (typeof _async !== "undefined" && _async) { - _ret_ = asyncLoad(_componentLoaderInBrowser, arguments); + var _ret_; + if (isBrowser) { + if (typeof _async !== "undefined" && _async) { + _ret_ = asyncLoad(_componentLoaderInBrowser, arguments); + } else { + _ret_ = _componentLoaderInBrowser(component, _async); + } } else { - _ret_ = _componentLoaderInBrowser(component, _async); + _ret_ = _componentLoaderInNode(component, _async); } - } else { - _ret_ = _componentLoaderInNode(component, _async); - } - return _ret_; - }; - - /** - * Loads a simple component from a template - * - * @author: Jean Machuca - * @param service a Service object - */ - var serviceLoader = function (service, _async) { - var _serviceLoaderInBrowser = function (service, _async) { - var _promise = new Promise( - function (resolve, reject) { - - logger.debug("LOADING SERVICE DATA {{DATA}} FROM {{URL}}".replace("{{DATA}}", _DataStringify(service.data)).replace("{{URL}}", service.url)); - var xhr = new XMLHttpRequest(); - xhr.withCredentials = service.withCredentials; - var xhrasync = true; // always async because xhr sync is deprecated - xhr.open(service.method, service.url, xhrasync); - for (var header in service.headers) { - try { - if (typeof service.headers[header] !== "function") { - xhr.setRequestHeader(header, service.headers[header]); + return _ret_; + }; + + /** + * Loads a simple component from a template + * + * @author: Jean Machuca + * @param service a Service object + */ + var serviceLoader = function (service, _async) { + var _serviceLoaderInBrowser = function (service, _async) { + var _promise = new Promise( + function (resolve, reject) { + + logger.debug("LOADING SERVICE DATA {{DATA}} FROM {{URL}}".replace("{{DATA}}", _DataStringify(service.data)).replace("{{URL}}", service.url)); + var xhr = new XMLHttpRequest(); + xhr.withCredentials = service.withCredentials; + var xhrasync = true; // always async because xhr sync is deprecated + xhr.open(service.method, service.url, xhrasync); + for (var header in service.headers) { + try { + if (typeof service.headers[header] !== "function") { + xhr.setRequestHeader(header, service.headers[header]); + } + } catch (e) { + logger.debug("Something went wrong when assign the header " + header); } - } catch (e) { - logger.debug("Something went wrong when assign the header " + header); } - } - xhr.onload = function () { - if (xhr.status === 200) { - var response = xhr.responseText; - logger.debug("Data received {{DATA}}".replace("{{DATA}}", _DataStringify(response))); - logger.debug("CREATING SERVICE {{NAME}}".replace("{{NAME}}", service.name)); - service.template = response; - if (service.cached && (typeof cache !== "undefined")) { - cache.save(service.name, service.template); - } - if (typeof service.done === "function") { - var standardResponse = { - "request": xhr, - "service": service - }; - service.done.call(service, standardResponse); - resolve.call(_promise, standardResponse); + xhr.onload = function () { + if (xhr.status === 200) { + var response = xhr.responseText; + logger.debug("Data received {{DATA}}".replace("{{DATA}}", _DataStringify(response))); + logger.debug("CREATING SERVICE {{NAME}}".replace("{{NAME}}", service.name)); + service.template = response; + if (service.cached && (typeof cache !== "undefined")) { + cache.save(service.name, service.template); + } + if (typeof service.done === "function") { + var standardResponse = { + "request": xhr, + "service": service + }; + service.done.call(service, standardResponse); + resolve.call(_promise, standardResponse); + } + } else { + if (typeof service.fail === "function") { + var standardResponse = { + "request": xhr, + "service": service + }; + service.fail.call(service, standardResponse); + reject.call(_promise, standardResponse); + } } - } else { - if (typeof service.fail === "function") { - var standardResponse = { - "request": xhr, - "service": service - }; - service.fail.call(service, standardResponse); - reject.call(_promise, standardResponse); + }; + + var _directLoad = function () { + logger.debug("SENDING THE NORMAL REQUEST "); + try { + xhr.send(_DataStringify(service.data)); + } catch (e) { + logger.debug("SOMETHING WRONG WITH REQUEST "); + reject.call(_promise, { + request: xhr, + service: service + }); } - } - }; + }; - var _directLoad = function () { - logger.debug("SENDING THE NORMAL REQUEST "); - try { - xhr.send(_DataStringify(service.data)); - } catch (e) { - logger.debug("SOMETHING WRONG WITH REQUEST "); - reject.call(_promise, { - request: xhr, - service: service + if (service.cached) { + var cache = new ComplexStorageCache({ + index: service.data, + load(cacheController) { + _directLoad.call(this); + }, + alternate(cacheController) { + if (service.method === "GET") { + service.template = cacheController.cache.getCached(service.name); + if (typeof service.done === "function") { + var standardResponse = { + "request": xhr, + "service": service + }; + service.done.call(service, standardResponse); + resolve.call(_promise, standardResponse); + } + } else { + _directLoad.call(this); + } + return; + } }); + global.lastCache = cache; + } else { + _directLoad.call(this); } - }; - if (service.cached) { - var cache = new ComplexStorageCache({ - index: service.data, - load(cacheController) { - _directLoad.call(this); - }, - alternate(cacheController) { - if (service.method === "GET") { - service.template = cacheController.cache.getCached(service.name); - if (typeof service.done === "function") { - var standardResponse = { - "request": xhr, - "service": service - }; - service.done.call(service, standardResponse); - resolve.call(_promise, standardResponse); - } - } else { - _directLoad.call(this); - } - return; - } - }); - global.lastCache = cache; - } else { - _directLoad.call(this); + return xhr; } + ); + return _promise; + }; - return xhr; - } - ); - return _promise; - }; - - var _serviceLoaderInNode = function (service, _async) { - var _promise = new Promise( - function (resolve, reject) { - if (typeof URL === "undefined") { - global.URL = _require_("url").URL; - let URL = global.URL; - } - var serviceURL = new URL(service.url); - var req; - service.useHTTP2 = Object.hasOwnProperty.call(service, "useHTTP2") && service.useHTTP2; + var _serviceLoaderInNode = function (service, _async) { + var _promise = new Promise( + function (resolve, reject) { + if (typeof URL === "undefined") { + global.URL = _require_("url").URL; + let URL = global.URL; + } + var serviceURL = new URL(service.url); + var req; + service.useHTTP2 = Object.hasOwnProperty.call(service, "useHTTP2") && service.useHTTP2; - var captureEvents = function (req) { - logger.debug("LOADING SERVICE DATA (non-browser) {{DATA}} FROM {{URL}}".replace("{{DATA}}", _DataStringify(service.data)).replace("{{URL}}", service.url)); - var dataXML; - var standardResponse = { - "http2Client": client, - "request": req, - "service": service, - "responseHeaders": null - }; + var captureEvents = function (req) { + logger.debug("LOADING SERVICE DATA (non-browser) {{DATA}} FROM {{URL}}".replace("{{DATA}}", _DataStringify(service.data)).replace("{{URL}}", service.url)); + var dataXML; + var standardResponse = { + "http2Client": client, + "request": req, + "service": service, + "responseHeaders": null + }; - if (typeof service.data === "object" && service.data !== null) { - if (service.useHTTP2) { - try { - logger.debug("Sending data..."); - let buffer = new Buffer(_DataStringify(service.data)); - req.write(buffer); - } catch (e) { - logger.debug("It was not possible to send any data"); + if (typeof service.data === "object" && service.data !== null) { + if (service.useHTTP2) { + try { + logger.debug("Sending data..."); + let buffer = new Buffer(_DataStringify(service.data)); + req.write(buffer); + } catch (e) { + logger.debug("It was not possible to send any data"); + } } } - } - dataXML = ""; - req.on("response", (responseHeaders, flags) => { - logger.debug("receiving response..."); - standardResponse.responseHeaders = responseHeaders; - /* - for (const name in responseHeaders) { - logger.debug(`${name}: ${responseHeaders[name]}`); - } - */ dataXML = ""; - }); - req.on("data", (chunk) => { - logger.debug("receiving data..."); - // do something with the data - dataXML += "" + chunk.toString(); - service.template = dataXML; - }); - if (service.useHTTP2) { - req.resume(); - } - req.on("end", () => { - logger.debug("ending call..."); - service.template = dataXML; - if (Object.hasOwnProperty.call(service, "useHTTP2") && service.useHTTP2) { - client.destroy(); - } else { - req.destroy(); + req.on("response", (responseHeaders, flags) => { + logger.debug("receiving response..."); + standardResponse.responseHeaders = responseHeaders; + /* + for (const name in responseHeaders) { + logger.debug(`${name}: ${responseHeaders[name]}`); + } + */ + dataXML = ""; + }); + req.on("data", (chunk) => { + logger.debug("receiving data..."); + // do something with the data + dataXML += "" + chunk.toString(); + service.template = dataXML; + }); + if (service.useHTTP2) { + req.resume(); + } + req.on("end", () => { + logger.debug("ending call..."); + service.template = dataXML; + if (Object.hasOwnProperty.call(service, "useHTTP2") && service.useHTTP2) { + client.destroy(); + } else { + req.destroy(); + } + service.done.call(service, standardResponse); + resolve.call(_promise, standardResponse); + }); + if (service.useHTTP2) { + req.end(); } - service.done.call(service, standardResponse); - resolve.call(_promise, standardResponse); - }); - if (service.useHTTP2) { - req.end(); - } - }; + }; - try { - var requestOptions; - if (service.useHTTP2) { - logger.debug("using http2"); - var http2 = _require_("http2"); - var client = http2.connect(serviceURL.origin); - requestOptions = Object.assign({ - ":method": service.method, - ":path": serviceURL.pathname - }, service.options); - requestOptions = Object.assign(requestOptions, service.headers); - req = client.request(requestOptions); - req.setEncoding("utf8"); - captureEvents(req); - } else { - if (serviceURL.protocol === "http:") { - var http = _require_("http"); - var request = http.request; + try { + var requestOptions; + if (service.useHTTP2) { + logger.debug("using http2"); + var http2 = _require_("http2"); + var client = http2.connect(serviceURL.origin); requestOptions = Object.assign({ - "url": service.url, - headers: service.headers + ":method": service.method, + ":path": serviceURL.pathname }, service.options); - var req = request(service.url); + requestOptions = Object.assign(requestOptions, service.headers); + req = client.request(requestOptions); + req.setEncoding("utf8"); captureEvents(req); - } else if (serviceURL.protocol === "https:") { - var https = _require_("https"); - requestOptions = Object.assign({ - hostname: serviceURL.hostname, - port: serviceURL.port, - path: serviceURL.pathname, - method: service.method, - headers: service.headers - }, service.options); - var _req_ = https.request(requestOptions, function (req) { - captureEvents(req); - }); - _req_.end(); } else { - var e = "Protocol not supported: " + serviceURL.protocol; - logger.debug(e); - throw new Error(e); + if (serviceURL.protocol === "http:") { + var http = _require_("http"); + var request = http.request; + requestOptions = Object.assign({ + "url": service.url, + headers: service.headers + }, service.options); + var req = request(service.url); + captureEvents(req); + } else if (serviceURL.protocol === "https:") { + var https = _require_("https"); + requestOptions = Object.assign({ + hostname: serviceURL.hostname, + port: serviceURL.port, + path: serviceURL.pathname, + method: service.method, + headers: service.headers + }, service.options); + var _req_ = https.request(requestOptions, function (req) { + captureEvents(req); + }); + _req_.end(); + } else { + var e = "Protocol not supported: " + serviceURL.protocol; + logger.debug(e); + throw new Error(e); + } } - } - } catch (e) { - logger.debug(e); + } catch (e) { + logger.debug(e); + service.fail.call(service, e); + reject.call(_promise, e); + + } + }).catch(function (e) { + console.log(e); + logger.debug("Something happened when trying to call the service: " + service.name); service.fail.call(service, e); - reject.call(_promise, e); + }); + return _promise; - } - }).catch(function (e) { - console.log(e); - logger.debug("Something happened when trying to call the service: " + service.name); - service.fail.call(service, e); - }); - return _promise; + }; - }; + var _serviceLoaderMockup = function (service, _async) { + var _promise = new Promise( + function (resolve, reject) { + logger.debug(`Calling mockup service ${service.name} ...`); + var standardResponse = { + "request": null, + "service": service, + "responseHeaders": service.responseHeaders + }; + if (typeof service.mockup === "function") { + service.mockup.call(service, standardResponse); + } else { + service.done.call(service, standardResponse); + } + resolve.call(_promise, standardResponse); + }); + return _promise; + }; + var _serviceLoaderLocal = function (service, _async) { + var _promise = new Promise( + function (resolve, reject) { + logger.debug(`Calling local service ${service.name} ...`); + var standardResponse = { + "request": null, + "service": service, + "responseHeaders": service.responseHeaders + }; + if (typeof service.local === "function") { + service.local.call(service, standardResponse); + } else { + service.done.call(service, standardResponse); + } + resolve.call(_promise, standardResponse); + }); + return _promise; + }; - var _serviceLoaderMockup = function (service, _async) { - var _promise = new Promise( - function (resolve, reject) { - logger.debug(`Calling mockup service ${service.name} ...`); - var standardResponse = { - "request": null, - "service": service, - "responseHeaders": service.responseHeaders - }; - if (typeof service.mockup === "function") { - service.mockup.call(service, standardResponse); - } else { - service.done.call(service, standardResponse); - } - resolve.call(_promise, standardResponse); - }); - return _promise; - }; - var _serviceLoaderLocal = function (service, _async) { - var _promise = new Promise( - function (resolve, reject) { - logger.debug(`Calling local service ${service.name} ...`); - var standardResponse = { - "request": null, - "service": service, - "responseHeaders": service.responseHeaders - }; - if (typeof service.local === "function") { - service.local.call(service, standardResponse); + var _ret_; + switch (service.kind) { + case "rest": + if (isBrowser) { + if (typeof _async !== "undefined" && _async) { + _ret_ = asyncLoad(_serviceLoaderInBrowser, arguments); + } else { + _ret_ = _serviceLoaderInBrowser(service, _async); + } } else { - service.done.call(service, standardResponse); + _ret_ = _serviceLoaderInNode(service, _async); } - resolve.call(_promise, standardResponse); - }); - return _promise; + break; + case "mockup": + _ret_ = _serviceLoaderMockup(service, _async); + break; + case "local": + _ret_ = _serviceLoaderLocal(service, _async); + break; + default: + logger.debug(`The value of the kind property of the service ${service.name} is not valid`); + break; + } + return _ret_; }; + Export(serviceLoader); + Export(componentLoader); + Export(ComponentURI); + Export(ObjectName); + Export(_DataStringify); + Export(isQCObjects_Class); + Export(isQCObjects_Object); + Export(NamespaceRef); - var _ret_; - switch (service.kind) { - case "rest": - if (isBrowser) { - if (typeof _async !== "undefined" && _async) { - _ret_ = asyncLoad(_serviceLoaderInBrowser, arguments); - } else { - _ret_ = _serviceLoaderInBrowser(service, _async); - } - } else { - _ret_ = _serviceLoaderInNode(service, _async); - } - break; - case "mockup": - _ret_ = _serviceLoaderMockup(service, _async); - break; - case "local": - _ret_ = _serviceLoaderLocal(service, _async); - break; - default: - logger.debug(`The value of the kind property of the service ${service.name} is not valid`); - break; - } - return _ret_; - }; - Export(serviceLoader); - Export(componentLoader); - Export(ComponentURI); - Export(ObjectName); - Export(_DataStringify); - Export(isQCObjects_Class); - Export(isQCObjects_Object); - Export(NamespaceRef); - - - if (isBrowser) { - - Element.prototype.buildComponents = function (rebuildObjects = false) { - var tagFilter = _tag_filter_; - var d = this; - var elements = d.subelements(tagFilter); - return _buildComponentsFromElements_(elements, null); - }; - HTMLDocument.prototype.buildComponents = Element.prototype.buildComponents; - HTMLElement.prototype.buildComponents = Element.prototype.buildComponents; - var _ComponentWidget_ = class extends HTMLElement { - constructor() { - super(...arguments); - const componentWidget = this; - const componentName = componentWidget.nodeName.toLowerCase(); - const componentBody = _DOMCreateElement("quick-component"); - const __enabled__atributes__ = componentWidget.getAttributeNames(); - componentBody.setAttribute("name", componentName); - - if (!componentWidget.hasAttribute("shadowed")) { - componentBody.setAttribute("shadowed", "true"); - } - __enabled__atributes__.map(function (attributeName) { - if (componentWidget.hasAttribute(attributeName)) { - componentBody.setAttribute(attributeName, componentWidget.getAttribute(attributeName)); - componentWidget.removeAttribute(attributeName); + if (isBrowser) { + + Element.prototype.buildComponents = function (rebuildObjects = false) { + var tagFilter = _tag_filter_; + var d = this; + var elements = d.subelements(tagFilter); + return _buildComponentsFromElements_(elements, null); + }; + + HTMLDocument.prototype.buildComponents = Element.prototype.buildComponents; + HTMLElement.prototype.buildComponents = Element.prototype.buildComponents; + var _ComponentWidget_ = class extends HTMLElement { + constructor() { + super(...arguments); + const componentWidget = this; + const componentName = componentWidget.nodeName.toLowerCase(); + const componentBody = _DOMCreateElement("quick-component"); + const __enabled__atributes__ = componentWidget.getAttributeNames(); + componentBody.setAttribute("name", componentName); + + if (!componentWidget.hasAttribute("shadowed")) { + componentBody.setAttribute("shadowed", "true"); } - }); - var data_attributenames = componentWidget.getAttributeNames().filter(function (a) { - return a.startsWith("data-"); - }).map(function (a) { - return a.split("-")[1]; - }); - data_attributenames.map(function (_attribute_name_) { - componentBody.setAttribute("data-" + _attribute_name_, componentWidget.getAttribute("data-" + _attribute_name_)); - componentWidget.removeAttribute("data-" + _attribute_name_); - }); - [...componentWidget.children].map(function (element) { - componentBody.appendChild(element.cloneNode(true)); - element.remove(); - }); + __enabled__atributes__.map(function (attributeName) { + if (componentWidget.hasAttribute(attributeName)) { + componentBody.setAttribute(attributeName, componentWidget.getAttribute(attributeName)); + componentWidget.removeAttribute(attributeName); + } + }); + var data_attributenames = componentWidget.getAttributeNames().filter(function (a) { + return a.startsWith("data-"); + }).map(function (a) { + return a.split("-")[1]; + }); + data_attributenames.map(function (_attribute_name_) { + componentBody.setAttribute("data-" + _attribute_name_, componentWidget.getAttribute("data-" + _attribute_name_)); + componentWidget.removeAttribute("data-" + _attribute_name_); + }); + [...componentWidget.children].map(function (element) { + componentBody.appendChild(element.cloneNode(true)); + element.remove(); + }); - componentWidget.append(componentBody); - } - }; - Export(_ComponentWidget_); - var RegisterWidget = function (widgetName) { - customElements.define(widgetName, class extends _ComponentWidget_ {}); - }; - var RegisterWidgets = function () { - var widgetList = [...arguments]; - widgetList.filter(function (widgetName) { - return typeof widgetName === "string"; - }).map(function (widgetName) { - RegisterWidget(widgetName); - }); - }; - (_protected_code_)(RegisterWidget); - (_protected_code_)(RegisterWidgets); - Export(RegisterWidget); - Export(RegisterWidgets); + componentWidget.append(componentBody); + } + }; + Export(_ComponentWidget_); + var RegisterWidget = function (widgetName) { + customElements.define(widgetName, class extends _ComponentWidget_ { }); + }; + var RegisterWidgets = function () { + var widgetList = [...arguments]; + widgetList.filter(function (widgetName) { + return typeof widgetName === "string"; + }).map(function (widgetName) { + RegisterWidget(widgetName); + }); + }; + (_protected_code_)(RegisterWidget); + (_protected_code_)(RegisterWidgets); + Export(RegisterWidget); + Export(RegisterWidgets); - } else { - // not yet implemented. - } + } else { + // not yet implemented. + } - if (!isBrowser) { + if (!isBrowser) { + + Package("com.qcobjects.api", [ + class BackendMicroservice extends ClassFactory("InheritClass") { + + constructor({ + domain = _domain_, + basePath = _basePath_, + body = null, + stream = null, + request = null + }) { + super(...arguments); + logger.debug("Initializing BackendMicroservice..."); + let microservice = this; + if (typeof this.body === "undefined") { + this.body = null; + } + if (typeof body !== "undefined") { + this.body = body; + } + this.cors(); + microservice.stream = stream; + stream.on("data", (data) => { + // data from POST, GET + var requestMethod = request.method.toLowerCase(); + var supportedMethods = { + "post": microservice.post, + }; + if (Object.hasOwnProperty.call(supportedMethods, requestMethod)) { + supportedMethods[requestMethod].call(microservice, data); + } + }); - Package("com.qcobjects.api", [ - class BackendMicroservice extends ClassFactory("InheritClass") { - - constructor ({ - domain= _domain_, - basePath= _basePath_, - body = null, - stream= null, - request= null - }){ - super(...arguments); - logger.debug("Initializing BackendMicroservice..."); - let microservice = this; - if (typeof this.body === "undefined") { - this.body = null; - } - if (typeof body !== "undefined"){ - this.body = body; - } - this.cors(); - microservice.stream = stream; - stream.on("data", (data) => { // data from POST, GET var requestMethod = request.method.toLowerCase(); var supportedMethods = { - "post": microservice.post, + "get": microservice.get, + "head": microservice.head, + "put": microservice.put, + "delete": microservice.delete, + "connect": microservice.connect, + "options": microservice.options, + "trace": microservice.trace, + "patch": microservice.patch }; if (Object.hasOwnProperty.call(supportedMethods, requestMethod)) { - supportedMethods[requestMethod].call(microservice, data); + supportedMethods[requestMethod].call(microservice); } - }); - - // data from POST, GET - var requestMethod = request.method.toLowerCase(); - var supportedMethods = { - "get": microservice.get, - "head": microservice.head, - "put": microservice.put, - "delete": microservice.delete, - "connect": microservice.connect, - "options": microservice.options, - "trace": microservice.trace, - "patch": microservice.patch - }; - if (Object.hasOwnProperty.call(supportedMethods, requestMethod)) { - supportedMethods[requestMethod].call(microservice); + + } - - - } - - cors() { - if (this.route.cors) { - logger.debug("Validating CORS..."); - let { - allow_origins, - allow_credentials, - allow_methods, - allow_headers - } = this.route.cors; - var microservice = this; - if (typeof microservice.headers !== "object") { - microservice.headers = {}; - } - if (typeof microservice.route.responseHeaders !== "object") { - microservice.route.responseHeaders = {}; - } - if (typeof allow_origins !== "undefined") { - logger.debug("CORS: allow_origins available. Validating origins..."); - // an example of allow_origins is ['https://example.com','http://www.example.com'] - if (allow_origins === "*" || (typeof microservice.request.headers.origin === "undefined") || [...allow_origins].indexOf(microservice.request.headers.origin) !== -1) { - // for compatibility with all browsers allways return a wildcard when the origin is allowed + + cors() { + if (this.route.cors) { + logger.debug("Validating CORS..."); + let { + allow_origins, + allow_credentials, + allow_methods, + allow_headers + } = this.route.cors; + var microservice = this; + if (typeof microservice.headers !== "object") { + microservice.headers = {}; + } + if (typeof microservice.route.responseHeaders !== "object") { + microservice.route.responseHeaders = {}; + } + if (typeof allow_origins !== "undefined") { + logger.debug("CORS: allow_origins available. Validating origins..."); + // an example of allow_origins is ['https://example.com','http://www.example.com'] + if (allow_origins === "*" || (typeof microservice.request.headers.origin === "undefined") || [...allow_origins].indexOf(microservice.request.headers.origin) !== -1) { + // for compatibility with all browsers allways return a wildcard when the origin is allowed + logger.debug("CORS: Adding header Access-Control-Allow-Origin=*"); + microservice.route.responseHeaders["Access-Control-Allow-Origin"] = "*"; + } else { + logger.debug("CORS: Origin is not allowed: " + microservice.request.headers.origin); + logger.debug("CORS: Forcing to finish the response..."); + this.body = {}; + try { + this.done(); + } catch (e) { + logger.debug(`It was not possible to finish the call to the microservice: ${e}`); + } + } + } else { + logger.debug("CORS: no allow_origins available. Allowing all origins..."); logger.debug("CORS: Adding header Access-Control-Allow-Origin=*"); microservice.route.responseHeaders["Access-Control-Allow-Origin"] = "*"; + } + if (typeof allow_credentials !== "undefined") { + logger.debug(`CORS: allow_credentials present. Allowing ${allow_credentials}...`); + microservice.route.responseHeaders["Access-Control-Allow-Credentials"] = allow_credentials.toString(); } else { - logger.debug("CORS: Origin is not allowed: " + microservice.request.headers.origin); - logger.debug("CORS: Forcing to finish the response..."); - this.body = {}; - try { - this.done(); - } catch (e) { - logger.debug(`It was not possible to finish the call to the microservice: ${e}`); - } + logger.debug("CORS: No allow_credentials present. Allowing all credentials."); + microservice.route.responseHeaders["Access-Control-Allow-Credentials"] = "true"; + } + if (typeof allow_methods !== "undefined") { + logger.debug(`CORS: allow_methods present. Allowing ${allow_methods}...`); + microservice.route.responseHeaders["Access-Control-Allow-Methods"] = [...allow_methods].join(","); + } else { + logger.debug("CORS: No allow_methods present. Allowing only GET, OPTIONS and POST"); + microservice.route.responseHeaders["Access-Control-Allow-Methods"] = "GET, OPTIONS, POST"; + } + if (typeof allow_headers !== "undefined") { + logger.debug(`CORS: allow_headers present. Allowing ${allow_headers}...`); + microservice.route.responseHeaders["Access-Control-Allow-Headers"] = [...allow_headers].join(","); + } else { + logger.debug(`CORS: No allow_headers present. Allowing all headers...`); + microservice.route.responseHeaders["Access-Control-Allow-Headers"] = "*"; } } else { - logger.debug("CORS: no allow_origins available. Allowing all origins..."); - logger.debug("CORS: Adding header Access-Control-Allow-Origin=*"); - microservice.route.responseHeaders["Access-Control-Allow-Origin"] = "*"; - } - if (typeof allow_credentials !== "undefined") { - logger.debug(`CORS: allow_credentials present. Allowing ${allow_credentials}...`); - microservice.route.responseHeaders["Access-Control-Allow-Credentials"] = allow_credentials.toString(); - } else { - logger.debug("CORS: No allow_credentials present. Allowing all credentials."); - microservice.route.responseHeaders["Access-Control-Allow-Credentials"] = "true"; - } - if (typeof allow_methods !== "undefined") { - logger.debug(`CORS: allow_methods present. Allowing ${allow_methods}...`); - microservice.route.responseHeaders["Access-Control-Allow-Methods"] = [...allow_methods].join(","); - } else { - logger.debug("CORS: No allow_methods present. Allowing only GET, OPTIONS and POST"); - microservice.route.responseHeaders["Access-Control-Allow-Methods"] = "GET, OPTIONS, POST"; - } - if (typeof allow_headers !== "undefined") { - logger.debug(`CORS: allow_headers present. Allowing ${allow_headers}...`); - microservice.route.responseHeaders["Access-Control-Allow-Headers"] = [...allow_headers].join(","); - } else { - logger.debug(`CORS: No allow_headers present. Allowing all headers...`); - microservice.route.responseHeaders["Access-Control-Allow-Headers"] = "*"; + logger.debug("No CORS validation available. You can specify cors in CONFIG.backend.routes[].cors"); } - } else { - logger.debug("No CORS validation available. You can specify cors in CONFIG.backend.routes[].cors"); } - } - - - head(formData) { - this.done(); - } - - get(formData) { - logger.debug(`[BackendMicroservice.get] Data received: ${_DataStringify(formData)}`); - this.done(); - } - - post(formData) { - this.done(); - } - - put(formData) { - this.done(); - } - - delete(formData) { - this.done(); - } - - connect(formData) { - this.done(); - } - - options(formData) { - this.done(); - } - - trace(formData) { - this.done(); - } - - patch(formData) { - this.done(); - } - - finishWithBody(stream) { - try { - logger.debug("[BackendMicroservice.finishWithBody] Ending the stream..."); - logger.debug(`[BackendMicroservice.finishWithBody] type of body is: ${typeof this.body}`); - if (typeof this.body !== "string"){ - this.body = _DataStringify(this.body); - } - logger.debug(`[BackendMicroservice.finishWithBody] \n body: ${this.body} `); - stream.write(this.body); - stream.end(); - logger.debug(`[BackendMicroservice.finishWithBody] Stream ended.`); - } catch (e) { - logger.debug(`[BackendMicroservice.finishWithBody] Something went wrong ending the stream: ${e}`); + + + head(formData) { + this.done(); } - } - - done() { - logger.debug(`[BackendMicroservice.done] Finalizing the response...`); - var microservice = this; - var stream = microservice.stream; - try { - logger.debug(`[BackendMicroservice.done] Sending response headers...`); - if (microservice.route.responseHeaders){ - logger.debug(`[BackendMicroservice.done] Response headers present: ${Object.keys(microservice.route.responseHeaders)}`); - stream.respond(microservice.route.responseHeaders); - } else { - throw Error(`[BackendMicroservice.done] No headers present.`); + + get(formData) { + logger.debug(`[BackendMicroservice.get] Data received: ${_DataStringify(formData)}`); + this.done(); + } + + post(formData) { + this.done(); + } + + put(formData) { + this.done(); + } + + delete(formData) { + this.done(); + } + + connect(formData) { + this.done(); + } + + options(formData) { + this.done(); + } + + trace(formData) { + this.done(); + } + + patch(formData) { + this.done(); + } + + finishWithBody(stream) { + try { + logger.debug("[BackendMicroservice.finishWithBody] Ending the stream..."); + logger.debug(`[BackendMicroservice.finishWithBody] type of body is: ${typeof this.body}`); + if (typeof this.body !== "string") { + this.body = _DataStringify(this.body); + } + logger.debug(`[BackendMicroservice.finishWithBody] \n body: ${this.body} `); + stream.write(this.body); + stream.end(); + logger.debug(`[BackendMicroservice.finishWithBody] Stream ended.`); + } catch (e) { + logger.debug(`[BackendMicroservice.finishWithBody] Something went wrong ending the stream: ${e}`); } - } catch (e) { - logger.debug(`[BackendMicroservice.done] Something went wrong sending response headers: ${e}`); } - if (microservice.body !== null) { + + done() { + logger.debug(`[BackendMicroservice.done] Finalizing the response...`); + var microservice = this; + var stream = microservice.stream; try { - logger.debug(`[BackendMicroservice.done] A body of message is present. Finalizing the response...`); - microservice.finishWithBody.call(microservice, stream); + logger.debug(`[BackendMicroservice.done] Sending response headers...`); + if (microservice.route.responseHeaders) { + logger.debug(`[BackendMicroservice.done] Response headers present: ${Object.keys(microservice.route.responseHeaders)}`); + stream.respond(microservice.route.responseHeaders); + } else { + throw Error(`[BackendMicroservice.done] No headers present.`); + } } catch (e) { - logger.debug(`[BackendMicroservice.done] Something went wrong finalizing the response: ${e}`); + logger.debug(`[BackendMicroservice.done] Something went wrong sending response headers: ${e}`); + } + if (microservice.body !== null) { + try { + logger.debug(`[BackendMicroservice.done] A body of message is present. Finalizing the response...`); + microservice.finishWithBody.call(microservice, stream); + } catch (e) { + logger.debug(`[BackendMicroservice.done] Something went wrong finalizing the response: ${e}`); + } + } else { + logger.debug("[BackendMicroservice.done] No body present. Ending stream..."); + stream.end(); } - } else { - logger.debug("[BackendMicroservice.done] No body present. Ending stream..."); - stream.end(); } - } - - - } - ]); - } + } + ]); + - Class("SourceJS", Object, { - domain: _domain_, - basePath: _basePath_, - body: _DOMCreateElement("script"), - type: "text/javascript", - containerTag: "body", - url: "", - data: {}, - async: false, - external: false, - set(name, value) { - this[name] = value; - }, - get(name) { - return this[name]; - }, - status: false, - done() {}, - fail() {}, - rebuild() { - var context = this; - try { - document.getElementsByTagName(context.containerTag)[0].appendChild( - (function (s, url, context) { - s.type = context.type; - s.src = url; - s.crossOrigin = (Object.hasOwnProperty.call(context, "crossOrigin")) ? (context.crossOrigin) : ("anonymous"); - s.async = context.async; - s.onreadystatechange = function () { - if (this.readyState === "complete") { - context.done.call(context); - } - }; - s.onload = function (e) { - context.status = true; - context.done.call(context, e); - }; - s.onerror = function (e) { - context.status = false; - context.fail.call(context, e); - }; - context.body = s; - return s; - }).call(this, - _DOMCreateElement("script"), - (this.external) ? (this.url) : (this.basePath + this.url), context)); - } catch (e) { - context.status = false; - context.fail.call(context, e); - } - }, - Cast(o) { - return _Cast(this, o); - }, - _new_(properties) { - this.__new__(properties); - this.rebuild(); } - }); - Class("SourceCSS", Object, { - domain: _domain_, - basePath: _basePath_, - body: _DOMCreateElement("link"), - url: "", - data: {}, - async: false, - external: false, - set(name, value) { - this[name] = value; - }, - get(name) { - return this[name]; - }, - done() {}, - rebuild() { - var context = this; - if (isBrowser) { - window.document.getElementsByTagName("head")[0].appendChild( - (function (s, url, context) { - s.type = "text/css"; - s.rel = "stylesheet"; - s.href = url; - s.crossOrigin = "anonymous"; - s.onreadystatechange = function () { - if (this.readyState === "complete") { - context.done.call(context); - } - }; - s.onload = context.done; - context.body = s; - return s; - }).call(this, - _DOMCreateElement("link"), - (this.external) ? (this.url) : (this.basePath + this.url), context)); + + Class("SourceJS", Object, { + domain: _domain_, + basePath: _basePath_, + body: _DOMCreateElement("script"), + type: "text/javascript", + containerTag: "body", + url: "", + data: {}, + async: false, + external: false, + set(name, value) { + this[name] = value; + }, + get(name) { + return this[name]; + }, + status: false, + done() { }, + fail() { }, + rebuild() { + var context = this; + try { + document.getElementsByTagName(context.containerTag)[0].appendChild( + (function (s, url, context) { + s.type = context.type; + s.src = url; + s.crossOrigin = (Object.hasOwnProperty.call(context, "crossOrigin")) ? (context.crossOrigin) : ("anonymous"); + s.async = context.async; + s.onreadystatechange = function () { + if (this.readyState === "complete") { + context.done.call(context); + } + }; + s.onload = function (e) { + context.status = true; + context.done.call(context, e); + }; + s.onerror = function (e) { + context.status = false; + context.fail.call(context, e); + }; + context.body = s; + return s; + }).call(this, + _DOMCreateElement("script"), + (this.external) ? (this.url) : (this.basePath + this.url), context)); + } catch (e) { + context.status = false; + context.fail.call(context, e); + } + }, + Cast(o) { + return _Cast(this, o); + }, + _new_(properties) { + this.__new__(properties); + this.rebuild(); } - }, - Cast(o) { - return _Cast(this, o); - }, - _new_(properties) { - this.__new__(properties); - this.rebuild(); - } - }); - - /** - * Array math functions - */ - var __to_number = function (value) { - return (isNaN(value)) ? (new Number(0)) : (new Number(value)); - }; - Array.prototype.unique = function () { - return this.filter(function (value, index, self) { - return self.indexOf(value) === index; }); - }; - Array.unique = function (a) { - return a.unique(); - }; - (_protected_code_)(Array.unique); - (_protected_code_)(Array.prototype.unique); - Array.prototype.table = function () { - console.table(this); - }; - Array.table = function (a) { - return a.table(); - }; - (_protected_code_)(Array.table); - (_protected_code_)(Array.prototype.table); - Array.prototype.sum = function () { - return this.reduce(function (prev, current) { - return __to_number(prev) + __to_number(current); - }, 0); - }; - Array.sum = function (a) { - return a.sum(); - }; - (_protected_code_)(Array.sum); - (_protected_code_)(Array.prototype.sum); - Array.prototype.avg = function () { - return (this.length < 1) ? (0) : (this.reduce(function (prev, current) { - return ((__to_number(prev) + __to_number(current)) / 2); - })); - }; - Array.avg = function (a) { - return a.avg(); - }; - (_protected_code_)(Array.avg); - (_protected_code_)(Array.prototype.avg); - Array.prototype.min = function () { - return this.reduce(function (prev, current) { - return (__to_number(prev) <= __to_number(current)) ? (prev) : (current); - }, Infinity); - }; - Array.min = function (a) { - return a.min(); - }; - (_protected_code_)(Array.min); - (_protected_code_)(Array.prototype.min); - Array.prototype.max = function () { - return this.reduce(function (prev, current) { - return (__to_number(prev) >= __to_number(current)) ? (prev) : (current); - }, 0); - }; - Array.max = function (a) { - return a.max(); - }; - (_protected_code_)(Array.max); - (_protected_code_)(Array.prototype.max); - Array.prototype.sortBy = function (propName, sortAsc = true) { - var sort_function = (sortAsc) ? ( - function (prev, current) { - return current[propName] < prev[propName] ? 1 : -1; - } - ) : ( - function (prev, current) { - return current[propName] > prev[propName] ? 1 : -1; + Class("SourceCSS", Object, { + domain: _domain_, + basePath: _basePath_, + body: _DOMCreateElement("link"), + url: "", + data: {}, + async: false, + external: false, + set(name, value) { + this[name] = value; + }, + get(name) { + return this[name]; + }, + done() { }, + rebuild() { + var context = this; + if (isBrowser) { + window.document.getElementsByTagName("head")[0].appendChild( + (function (s, url, context) { + s.type = "text/css"; + s.rel = "stylesheet"; + s.href = url; + s.crossOrigin = "anonymous"; + s.onreadystatechange = function () { + if (this.readyState === "complete") { + context.done.call(context); + } + }; + s.onload = context.done; + context.body = s; + return s; + }).call(this, + _DOMCreateElement("link"), + (this.external) ? (this.url) : (this.basePath + this.url), context)); + } + }, + Cast(o) { + return _Cast(this, o); + }, + _new_(properties) { + this.__new__(properties); + this.rebuild(); } - ); - return this.sort(sort_function); - }; - Array.sortBy = function (a, propName, sortAsc = true) { - return a.sortBy(propName, sortAsc); - }; - (_protected_code_)(Array.sortBy); - (_protected_code_)(Array.prototype.sortBy); - - Array.matrix = function (_length, _fillValue = 0) { - var x_func = function (x) { - return _fillValue; + }); + + /** + * Array math functions + */ + var __to_number = function (value) { + return (isNaN(value)) ? (new Number(0)) : (new Number(value)); + }; + Array.prototype.unique = function () { + return this.filter(function (value, index, self) { + return self.indexOf(value) === index; + }); + }; + Array.unique = function (a) { + return a.unique(); }; - return Array.from({ - length: _length - }, x_func); - }; - (_protected_code_)(Array.matrix); - - Array.matrix2d = function (_length, _fillValue = 0) { - var y_func = function (y) { - return _fillValue; + (_protected_code_)(Array.unique); + (_protected_code_)(Array.prototype.unique); + Array.prototype.table = function () { + console.table(this); }; - var x_func = function (x) { + Array.table = function (a) { + return a.table(); + }; + (_protected_code_)(Array.table); + (_protected_code_)(Array.prototype.table); + Array.prototype.sum = function () { + return this.reduce(function (prev, current) { + return __to_number(prev) + __to_number(current); + }, 0); + }; + Array.sum = function (a) { + return a.sum(); + }; + (_protected_code_)(Array.sum); + (_protected_code_)(Array.prototype.sum); + Array.prototype.avg = function () { + return (this.length < 1) ? (0) : (this.reduce(function (prev, current) { + return ((__to_number(prev) + __to_number(current)) / 2); + })); + }; + Array.avg = function (a) { + return a.avg(); + }; + (_protected_code_)(Array.avg); + (_protected_code_)(Array.prototype.avg); + Array.prototype.min = function () { + return this.reduce(function (prev, current) { + return (__to_number(prev) <= __to_number(current)) ? (prev) : (current); + }, Infinity); + }; + Array.min = function (a) { + return a.min(); + }; + (_protected_code_)(Array.min); + (_protected_code_)(Array.prototype.min); + Array.prototype.max = function () { + return this.reduce(function (prev, current) { + return (__to_number(prev) >= __to_number(current)) ? (prev) : (current); + }, 0); + }; + Array.max = function (a) { + return a.max(); + }; + (_protected_code_)(Array.max); + (_protected_code_)(Array.prototype.max); + Array.prototype.sortBy = function (propName, sortAsc = true) { + var sort_function = (sortAsc) ? ( + function (prev, current) { + return current[propName] < prev[propName] ? 1 : -1; + } + ) : ( + function (prev, current) { + return current[propName] > prev[propName] ? 1 : -1; + } + ); + return this.sort(sort_function); + }; + Array.sortBy = function (a, propName, sortAsc = true) { + return a.sortBy(propName, sortAsc); + }; + (_protected_code_)(Array.sortBy); + (_protected_code_)(Array.prototype.sortBy); + + Array.matrix = function (_length, _fillValue = 0) { + var x_func = function (x) { + return _fillValue; + }; return Array.from({ length: _length - }, y_func); + }, x_func); }; - return Array.from({ - length: _length - }, x_func); - }; - (_protected_code_)(Array.matrix2d); - - Array.matrix3d = function (_length, _fillValue = 0) { - var y_func = function (y) { + (_protected_code_)(Array.matrix); + + Array.matrix2d = function (_length, _fillValue = 0) { + var y_func = function (y) { + return _fillValue; + }; + var x_func = function (x) { + return Array.from({ + length: _length + }, y_func); + }; return Array.from({ length: _length - }, function () { - return _fillValue; - }); + }, x_func); }; - var x_func = function (x) { + (_protected_code_)(Array.matrix2d); + + Array.matrix3d = function (_length, _fillValue = 0) { + var y_func = function (y) { + return Array.from({ + length: _length + }, function () { + return _fillValue; + }); + }; + var x_func = function (x) { + return Array.from({ + length: _length + }, y_func); + }; return Array.from({ length: _length - }, y_func); + }, x_func); }; - return Array.from({ - length: _length - }, x_func); - }; - (_protected_code_)(Array.matrix3d); - - _top.range = function (start, stop = 0, step = 1) { - if (stop === 0 || typeof stop === "undefined") { - stop = start; - start = 0; - } - return Array.from({ - length: (stop - start) / step + 1 - }, function (_, i) { - return start + (i * step); - }); - }; - (_protected_code_)(_top.range); + (_protected_code_)(Array.matrix3d); - String.prototype.list = function () { - var __instance = this; - return _top.range(0, __instance.length - 1).map(function (i) { - return __instance[i]; - }); - }; - (_protected_code_)(String.prototype.list); - - _top.getDocumentLayout = function () { - var h = (w, h) => { - return w > h ? "landscape" : null; + _top.range = function (start, stop = 0, step = 1) { + if (stop === 0 || typeof stop === "undefined") { + stop = start; + start = 0; + } + return Array.from({ + length: (stop - start) / step + 1 + }, function (_, i) { + return start + (i * step); + }); }; - var v = (w, h) => { - return h > w ? "portrait" : null; + (_protected_code_)(_top.range); + + String.prototype.list = function () { + var __instance = this; + return _top.range(0, __instance.length - 1).map(function (i) { + return __instance[i]; + }); }; - var square = (w, h) => { - return w === h ? "square" : null; + (_protected_code_)(String.prototype.list); + + _top.getDocumentLayout = function () { + var h = (w, h) => { + return w > h ? "landscape" : null; + }; + var v = (w, h) => { + return h > w ? "portrait" : null; + }; + var square = (w, h) => { + return w === h ? "square" : null; + }; + return [ + h(document.documentElement.clientWidth, document.documentElement.clientHeight), + v(document.documentElement.clientWidth, document.documentElement.clientHeight), + square(document.documentElement.clientWidth, document.documentElement.clientHeight) + ].filter(e => e !== null).pop(); }; - return [ - h(document.documentElement.clientWidth, document.documentElement.clientHeight), - v(document.documentElement.clientWidth, document.documentElement.clientHeight), - square(document.documentElement.clientWidth, document.documentElement.clientHeight) - ].filter(e => e !== null).pop(); - }; - - - /** - * End of array math functions - */ - - - Class("ArrayList", Array, []); - ClassFactory("ArrayList").matrix = Array.matrix; - ClassFactory("ArrayList").matrix2d = Array.matrix2d; - ClassFactory("ArrayList").matrix3d = Array.matrix3d; - (_protected_code_)(ClassFactory("ArrayList").matrix); - (_protected_code_)(ClassFactory("ArrayList").matrix2d); - (_protected_code_)(ClassFactory("ArrayList").matrix3d); - - Class("ArrayCollection", Object, { - source: New(ClassFactory("ArrayList"), []), - changed(prop, value) { - logger.debug("VALUE CHANGED"); - logger.debug(prop); - logger.debug(value); - }, - push(value) { - var self = this; - logger.debug("VALUE ADDED"); - logger.debug(value); - self.source.push(value); - }, - pop(value) { - var self = this; - logger.debug("VALUE POPPED"); - logger.debug(value); - self.source.pop(value); - }, - _new_(source) { - var self = this; - var _index = 0; - self.source = New(ClassFactory("ArrayList"), source); - for (var _k in self.source) { - if (!isNaN(_k)) { - logger.debug("binding " + _k.toString()); - (function (_pname) { - Object.defineProperty(self, _pname, { - set(value) { - logger.debug("setting " + _pname + "=" + value); - self.source[_pname] = value; - self.changed(_pname, value); - }, - get() { - return self.source[_pname]; + + + /** + * End of array math functions + */ + + + Class("ArrayList", Array, []); + ClassFactory("ArrayList").matrix = Array.matrix; + ClassFactory("ArrayList").matrix2d = Array.matrix2d; + ClassFactory("ArrayList").matrix3d = Array.matrix3d; + (_protected_code_)(ClassFactory("ArrayList").matrix); + (_protected_code_)(ClassFactory("ArrayList").matrix2d); + (_protected_code_)(ClassFactory("ArrayList").matrix3d); + + Class("ArrayCollection", Object, { + source: New(ClassFactory("ArrayList"), []), + changed(prop, value) { + logger.debug("VALUE CHANGED"); + logger.debug(prop); + logger.debug(value); + }, + push(value) { + var self = this; + logger.debug("VALUE ADDED"); + logger.debug(value); + self.source.push(value); + }, + pop(value) { + var self = this; + logger.debug("VALUE POPPED"); + logger.debug(value); + self.source.pop(value); + }, + _new_(source) { + var self = this; + var _index = 0; + self.source = New(ClassFactory("ArrayList"), source); + for (var _k in self.source) { + if (!isNaN(_k)) { + logger.debug("binding " + _k.toString()); + (function (_pname) { + Object.defineProperty(self, _pname, { + set(value) { + logger.debug("setting " + _pname + "=" + value); + self.source[_pname] = value; + self.changed(_pname, value); + }, + get() { + return self.source[_pname]; + } + }); + })(_k); + _index++; + } + + } + self.source.length = _index; + Object.defineProperty(self, "length", { + get() { + return self.source.length; + } + }); + } + }); + + Package("com.qcobjects.effects.base", [ + class Effect extends ClassFactory("InheritClass") { + duration = 1000; + + constructor() { + super(...arguments); + } + + animate({ + timing, + draw, + duration + }) { + + let start = performance.now(); + + requestAnimationFrame(function animate(time) { + // timeFraction goes from 0 to 1 + let timeFraction = (time - start) / duration; + if (timeFraction > 1) timeFraction = 1; + + // calculate the current animation state + let progress = timing(timeFraction); + + draw(Math.round(progress * 100)); // draw it + + if (timeFraction < 1) { + requestAnimationFrame(animate); + } else { + // if this is an object with a done method + if (typeof this !== "undefined" && + this !== null && + Object.hasOwnProperty.call(this, "done") && + (typeof this.done).toLowerCase() === "function") { + this.done.call(this); } - }); - })(_k); - _index++; + } + + }); } } - self.source.length = _index; - Object.defineProperty(self, "length", { - get() { - return self.source.length; + ]); + + Package("com.qcobjects.effects.transitions.base", [ + + class TransitionEffect extends ClassFactory("Effect") { + duration = 385; + defaultParams = { + alphaFrom: 0, + alphaTo: 1, + angleFrom: 180, + angleTo: 0, + radiusFrom: 0, + radiusTo: 30, + scaleFrom: 0, + scaleTo: 1 + }; + fitToHeight = false; + fitToWidth = false; + effects = []; + + constructor() { + super(...arguments); + logger.info("DECLARING TransitionEffect "); + this.component.defaultParams = this.defaultParams; } - }); - } - }); - Package("com.qcobjects.effects.base", [ - class Effect extends ClassFactory("InheritClass") { - duration = 1000; + apply({ + alphaFrom, + alphaTo, + angleFrom, + angleTo, + radiusFrom, + radiusTo, + scaleFrom, + scaleTo + }) { + var _transition_ = this; + logger.info("EXECUTING TransitionEffect "); + var componentRoot = (_transition_.component.shadowed) ? (_transition_.component.shadowRoot.host) : (_transition_.component.body); + if (_transition_.fitToHeight) { + componentRoot.height = (typeof componentRoot.offsetParent === "object" && componentRoot.offsetParent !== null) ? (componentRoot.offsetParent.scrollHeight) : (componentRoot.getBoundingClientRect().height); + } + if (_transition_.fitToWidth) { + componentRoot.width = (typeof componentRoot.offsetParent === "object" && componentRoot.offsetParent !== null) ? (componentRoot.offsetParent.scrollWidth) : (componentRoot.getBoundingClientRect().width); + } + componentRoot.style.display = "block"; + _transition_.effects.map(function (effectClassName, eff) { + var __effectClass__ = ClassFactory(effectClassName); + var effectObj = new __effectClass__({}); + var effectClassMethod = effectObj.apply; + var args = [componentRoot].concat(Object.values({ + alphaFrom, + alphaTo, + angleFrom, + angleTo, + radiusFrom, + radiusTo, + scaleFrom, + scaleTo + })); + effectClassMethod.apply(_transition_, args); + }); + } + + } + ]); + + Package("com.qcobjects.timing", [ + class Timer extends ClassFactory("InheritClass") { + + constructor() { + super(...arguments); + } + + duration = 1000; + alive = true; + thread({ + timing, + intervalInterceptor, + duration + }) { + var timer = this; + + let start = performance.now(); + + requestAnimationFrame(function thread(time) { + // timeFraction goes from 0 to 1 + let elapsed = (time - start); + let timeFraction = elapsed / duration; + if (timeFraction > 1) timeFraction = 1; + + // calculate the current progress state + let progress = timing(timeFraction, elapsed); - constructor (){ - super(...arguments); - } + intervalInterceptor(Math.round(progress * 100)); // draw it - animate({ - timing, - draw, - duration - }) { - - let start = performance.now(); - - requestAnimationFrame(function animate(time) { - // timeFraction goes from 0 to 1 - let timeFraction = (time - start) / duration; - if (timeFraction > 1) timeFraction = 1; - - // calculate the current animation state - let progress = timing(timeFraction); - - draw(Math.round(progress * 100)); // draw it - - if (timeFraction < 1) { - requestAnimationFrame(animate); - } else { - // if this is an object with a done method - if (typeof this !== "undefined" && - this !== null && - Object.hasOwnProperty.call(this, "done") && - (typeof this.done).toLowerCase() === "function") { - this.done.call(this); + if ((timeFraction < 1 || duration === -1) && timer.alive) { + requestAnimationFrame(thread); } - } - - }); - } - - } - ]); - - Package("com.qcobjects.effects.transitions.base", [ - - class TransitionEffect extends ClassFactory("Effect") { - duration= 385; - defaultParams= { - alphaFrom: 0, - alphaTo: 1, - angleFrom: 180, - angleTo: 0, - radiusFrom: 0, - radiusTo: 30, - scaleFrom: 0, - scaleTo: 1 - }; - fitToHeight= false; - fitToWidth= false; - effects= []; - - constructor (){ - super(...arguments); - logger.info("DECLARING TransitionEffect "); - this.component.defaultParams = this.defaultParams; - } - apply({ - alphaFrom, - alphaTo, - angleFrom, - angleTo, - radiusFrom, - radiusTo, - scaleFrom, - scaleTo - }) { - var _transition_ = this; - logger.info("EXECUTING TransitionEffect "); - var componentRoot = (_transition_.component.shadowed)?(_transition_.component.shadowRoot.host):(_transition_.component.body); - if (_transition_.fitToHeight) { - componentRoot.height = (typeof componentRoot.offsetParent === "object" && componentRoot.offsetParent !== null)?(componentRoot.offsetParent.scrollHeight):(componentRoot.getBoundingClientRect().height); - } - if (_transition_.fitToWidth) { - componentRoot.width = (typeof componentRoot.offsetParent === "object" && componentRoot.offsetParent !== null)?(componentRoot.offsetParent.scrollWidth):(componentRoot.getBoundingClientRect().width); - } - componentRoot.style.display = "block"; - _transition_.effects.map(function (effectClassName, eff) { - var __effectClass__ = ClassFactory(effectClassName); - var effectObj = new __effectClass__({}); - var effectClassMethod = effectObj.apply; - var args = [componentRoot].concat(Object.values({ - alphaFrom, - alphaTo, - angleFrom, - angleTo, - radiusFrom, - radiusTo, - scaleFrom, - scaleTo - })); - effectClassMethod.apply(_transition_, args); - }); - } - - } - ]); + }); + } - Package("com.qcobjects.timing", [ - class Timer extends ClassFactory("InheritClass") { - constructor (){ - super(...arguments); } + ]); - duration= 1000; - alive= true; - thread({ - timing, - intervalInterceptor, - duration - }) { - var timer = this; - - let start = performance.now(); - - requestAnimationFrame(function thread(time) { - // timeFraction goes from 0 to 1 - let elapsed = (time - start); - let timeFraction = elapsed / duration; - if (timeFraction > 1) timeFraction = 1; - - // calculate the current progress state - let progress = timing(timeFraction, elapsed); - - intervalInterceptor(Math.round(progress * 100)); // draw it - - if ((timeFraction < 1 || duration === -1) && timer.alive) { - requestAnimationFrame(thread); - } - - }); - } - + Package("com.qcobjects.tools.essentials", [ + class Toggle extends ClassFactory("InheritClass") { + _toggle = false; + _inverse = true; + _positive = null; + _negative = null; + _dispatched = null; + _args = {}; - } - ]); - - Package("com.qcobjects.tools.essentials", [ - class Toggle extends ClassFactory("InheritClass") { - _toggle= false; - _inverse= true; - _positive= null; - _negative= null; - _dispatched= null; - _args= {}; - - constructor (){ - super(...arguments); - this._new_(...arguments); - } + constructor() { + super(...arguments); + this._new_(...arguments); + } - changeToggle() { - this._toggle = (this._toggle) ? (false) : (true); - } + changeToggle() { + this._toggle = (this._toggle) ? (false) : (true); + } - _new_({ - positive, - negative, - args - }) { - this._positive = positive; - this._negative = negative; - this._args = args; - } + _new_({ + positive, + negative, + args + }) { + this._positive = positive; + this._negative = negative; + this._args = args; + } + + fire() { + var toggle = this; + var _promise = new Promise(function (resolve, reject) { - fire() { - var toggle = this; - var _promise = new Promise(function (resolve, reject) { - - if (typeof toggle._positive === "function" && typeof toggle._negative === "function") { - if (toggle._inverse) { - toggle._dispatched = (toggle._toggle) ? (toggle._negative.bind(toggle)) : (toggle._positive.bind(toggle)); + if (typeof toggle._positive === "function" && typeof toggle._negative === "function") { + if (toggle._inverse) { + toggle._dispatched = (toggle._toggle) ? (toggle._negative.bind(toggle)) : (toggle._positive.bind(toggle)); + } else { + toggle._dispatched = (toggle._toggle) ? (toggle._positive.bind(toggle)) : (toggle._negative.bind(toggle)); + } + toggle._dispatched.call(toggle, toggle._args); + resolve.call(_promise, toggle); } else { - toggle._dispatched = (toggle._toggle) ? (toggle._positive.bind(toggle)) : (toggle._negative.bind(toggle)); + logger.debug("Toggle functions are not declared"); + reject.call(_promise, toggle); } - toggle._dispatched.call(toggle, toggle._args); - resolve.call(_promise, toggle); - } else { - logger.debug("Toggle functions are not declared"); - reject.call(_promise, toggle); - } - }).then(function (toggle) { - toggle.changeToggle(); - }).catch(function (e) { - logger.debug(e.toString()); - }); - return _promise; + }).then(function (toggle) { + toggle.changeToggle(); + }).catch(function (e) { + logger.debug(e.toString()); + }); + return _promise; + } + + } - - } + ]); - ]); + // Set Processors + (function (_top) { - // Set Processors - (function (_top) { + let mapper = function (componentInstance, componentName, valueName) { + /* + * Mapper processor + * @usage + * $mapper(,) + * + * Where componentName is the name of the component (same value as in attribute tag name) without quotes + * and valueName is the name of the variable that contains the value to map, it can be either a property of + * the component instance, the data object or a global value + */ - let mapper = function (componentInstance,componentName, valueName) { - /* - * Mapper processor - * @usage - * $mapper(,) - * - * Where componentName is the name of the component (same value as in attribute tag name) without quotes - * and valueName is the name of the variable that contains the value to map, it can be either a property of - * the component instance, the data object or a global value - */ + var self = this; + if (typeof componentInstance === "undefined" || componentInstance === null) { + throw Error(`mapper.${componentName}.${valueName} does not have a component instance or it is null.`); + } + let globalValue = _top.global.get(valueName); + let componentValue = componentInstance.get(valueName); + let dataValue = componentInstance.data[valueName]; + let list = (typeof dataValue !== "undefined") ? (dataValue) : ((typeof componentValue !== "undefined") ? (componentValue) : (globalValue)); + let listItems = ""; + if (typeof list !== "undefined" && typeof list["map"] !== "undefined") { + listItems = list.map(function (element) { + let dataItems = [...Object.keys(element)].map(k => ` data-${k}="${(typeof element[k] !== "undefined" && element[k] !== null) ? (element[k].toString()) : ("")}"`).join(""); + return ``; + }).join(""); + } else { + logger.debug(`${componentName}.${valueName} does not have a map property`); + } + return listItems; + }; + Processor.setProcessor(mapper); - var self = this; - if (typeof componentInstance === "undefined" || componentInstance === null){ - throw Error (`mapper.${componentName}.${valueName} does not have a component instance or it is null.`); - } - let globalValue = _top.global.get(valueName); - let componentValue = componentInstance.get(valueName); - let dataValue = componentInstance.data[valueName]; - let list = (typeof dataValue !== "undefined") ? (dataValue) : ((typeof componentValue !== "undefined") ? (componentValue) : (globalValue)); - let listItems = ""; - if (typeof list !== "undefined" && typeof list["map"] !== "undefined") { - listItems = list.map(function (element) { - let dataItems = [...Object.keys(element)].map(k => ` data-${k}="${(typeof element[k] !== "undefined" && element[k] !== null)?(element[k].toString()):("")}"`).join(""); - return ``; - }).join(""); - } else { - logger.debug(`${componentName}.${valueName} does not have a map property`); - } - return listItems; - }; - Processor.setProcessor(mapper); - - let layout = function (componentInstance, layoutname, cssfile) { - /* - * Layout processor - * @usage - * $layout(, ) - * Where layoutname can be "portrait" or "landscape" without quotes - * cssfile is the uri for the css file to import - */ + let layout = function (componentInstance, layoutname, cssfile) { + /* + * Layout processor + * @usage + * $layout(, ) + * Where layoutname can be "portrait" or "landscape" without quotes + * cssfile is the uri for the css file to import + */ - var layout_portrait = ` - /* CSS Document for Mobile Imports */ - @import url("${cssfile}") (orientation:portrait); - @import url("${cssfile}") (max-width:460px); - @import url("${cssfile}") (aspect-ratio: 9/16); - @import url("${cssfile}") (aspect-ratio: 10/16); - @import url("${cssfile}") (aspect-ratio: 5/8); - @import url("${cssfile}") (aspect-ratio: 3/4); - @import url("${cssfile}") (aspect-ratio: 2/3); - `; - var layout_landscape = ` - @import url("${cssfile}") (orientation:landscape) and (min-width:460px); - @import url("${cssfile}") (aspect-ratio: 16/9) and (min-width:460px); - @import url("${cssfile}") (aspect-ratio: 16/10) and (min-width:460px); - @import url("${cssfile}") (aspect-ratio: 8/5) and (min-width:460px); - @import url("${cssfile}") (aspect-ratio: 4/3) and (min-width:460px); - @import url("${cssfile}") (aspect-ratio: 3/2) and (min-width:460px); - `; - var layout_code = { - "landscape": layout_landscape, - "portrait": layout_portrait + var layout_portrait = ` + /* CSS Document for Mobile Imports */ + @import url("${cssfile}") (orientation:portrait); + @import url("${cssfile}") (max-width:460px); + @import url("${cssfile}") (aspect-ratio: 9/16); + @import url("${cssfile}") (aspect-ratio: 10/16); + @import url("${cssfile}") (aspect-ratio: 5/8); + @import url("${cssfile}") (aspect-ratio: 3/4); + @import url("${cssfile}") (aspect-ratio: 2/3); + `; + var layout_landscape = ` + @import url("${cssfile}") (orientation:landscape) and (min-width:460px); + @import url("${cssfile}") (aspect-ratio: 16/9) and (min-width:460px); + @import url("${cssfile}") (aspect-ratio: 16/10) and (min-width:460px); + @import url("${cssfile}") (aspect-ratio: 8/5) and (min-width:460px); + @import url("${cssfile}") (aspect-ratio: 4/3) and (min-width:460px); + @import url("${cssfile}") (aspect-ratio: 3/2) and (min-width:460px); + `; + var layout_code = { + "landscape": layout_landscape, + "portrait": layout_portrait + }; + + return (Object.hasOwnProperty.call(layout_code, layoutname)) ? (layout_code[layoutname]) : (""); }; - return (Object.hasOwnProperty.call(layout_code, layoutname)) ? (layout_code[layoutname]) : (""); - }; + Processor.setProcessor(layout); - Processor.setProcessor(layout); + let component = function () { + /* + * component processor + * @usage + * $component(name=, componentClass=, ...) + * Returns a component tag declaration like: + * ...> + */ + let arg = [...arguments].slice(1).map(function (a) { + return { + [a.split("=")[0]]: a.split("=")[1] + }; + }).reduce(function (k1, k2) { + return Object.assign(k1, k2); + }); + let attrs = [...Object.keys(arg)].map(function (a) { + return `${a}=${arg[a]}`; + }).join(" "); + return ``; + }; - let component = function () { - /* - * component processor - * @usage - * $component(name=, componentClass=, ...) - * Returns a component tag declaration like: - * ...> - */ - let arg = [...arguments].slice(1).map(function (a) { - return { - [a.split("=")[0]]: a.split("=")[1] - }; - }).reduce(function (k1, k2) { - return Object.assign(k1, k2); - }); - let attrs = [...Object.keys(arg)].map(function (a) { - return `${a}=${arg[a]}`; - }).join(" "); - return ``; - }; + Processor.setProcessor(component); - Processor.setProcessor(component); + let quick_component = function () { + /* + * component processor + * @usage + * $quick_component(name=, componentClass=, ...) + * Returns a component tag declaration like: + * ...> + */ + let arg = [...arguments].slice(1).map(function (a) { + return { + [a.split("=")[0]]: a.split("=")[1] + }; + }).reduce(function (k1, k2) { + return Object.assign(k1, k2); + }); + let attrs = [...Object.keys(arg)].map(function (a) { + return `${a}=${arg[a]}`; + }).join(" "); + return ``; + }; - let quick_component = function () { - /* - * component processor - * @usage - * $quick_component(name=, componentClass=, ...) - * Returns a component tag declaration like: - * ...> - */ - let arg = [...arguments].slice(1).map(function (a) { - return { - [a.split("=")[0]]: a.split("=")[1] - }; - }).reduce(function (k1, k2) { - return Object.assign(k1, k2); - }); - let attrs = [...Object.keys(arg)].map(function (a) { - return `${a}=${arg[a]}`; - }).join(" "); - return ``; - }; + Processor.setProcessor(quick_component); - Processor.setProcessor(quick_component); + let repeat = function (componentInstance, length, text) { + /* + * Repeat processor + * @usage + * $repeat(, ) + * Where length is the number of occurrences of text + */ + return _top.range(length).map( + function (index) { + return text.replace("{{index}}", index.toString()); + } + ).join(""); + }; - let repeat = function (componentInstance, length, text) { - /* - * Repeat processor - * @usage - * $repeat(, ) - * Where length is the number of occurrences of text - */ - return _top.range(length).map( - function (index) { - return text.replace("{{index}}", index.toString()); - } - ).join(""); - }; + Processor.setProcessor(repeat); - Processor.setProcessor(repeat); + })(_top); - })(_top); + /** + * Load every component tag declared in the body + **/ + Ready(function () { + if (!_top.CONFIG.get("useSDK")) { + _top.__start__(); + } + }); - /** - * Load every component tag declared in the body - **/ - Ready(function () { - if (!_top.CONFIG.get("useSDK")) { - _top.__start__(); - } - }); - - /* - Public variables and functions - */ - Export(Export); /* exports the same Export function once */ - Export(Import); - Export(Package); - Export(Class); - Export(New); - Export(Tag); - Export(Ready); - Export(ready); - Export(isBrowser); - Export(_methods_); - - (function (_top){ - Package("com.qcobjects", [ - class GlobalSettings extends ClassFactory("InheritClass"){ - _GLOBAL= {}; - __definition = {}; - __classType = "GlobalSettings"; - - constructor(){ - super(...arguments); - this.set = GlobalSettings.set.bind(this); - this.get = GlobalSettings.get.bind(this); - this.__start__ = GlobalSettings.__start__.bind(this); - } + /* + Public variables and functions + */ + Export(Export); /* exports the same Export function once */ + Export(Import); + Export(Package); + Export(Class); + Export(New); + Export(Tag); + Export(Ready); + Export(ready); + Export(isBrowser); + Export(_methods_); + + (function (_top) { + Package("com.qcobjects", [ + class GlobalSettings extends ClassFactory("InheritClass") { + _GLOBAL = {}; + __definition = {}; + __classType = "GlobalSettings"; + + constructor() { + super(...arguments); + this.set = GlobalSettings.set.bind(this); + this.get = GlobalSettings.get.bind(this); + this.__start__ = GlobalSettings.__start__.bind(this); + } - static set(name, value) { - this._GLOBAL[name] = value; - } + static set(name, value) { + this._GLOBAL[name] = value; + } - static get(name, _default) { - var _value; - if (typeof this._GLOBAL[name] !== "undefined") { - _value = this._GLOBAL[name]; - } else if (typeof _default !== "undefined") { - _value = _default; + static get(name, _default) { + var _value; + if (typeof this._GLOBAL[name] !== "undefined") { + _value = this._GLOBAL[name]; + } else if (typeof _default !== "undefined") { + _value = _default; + } + return _value; } - return _value; - } - static __start__() { - var __load__serviceWorker = function () { - var _promise; - if (isBrowser) { - _promise = new Promise(function (resolve, reject) { - if (("serviceWorker" in navigator) && - (typeof _top.CONFIG.get("serviceWorkerURI") !== "undefined")) { - _top.CONFIG.set("serviceWorkerScope", _top.CONFIG.get("serviceWorkerScope") ? (_top.CONFIG.get("serviceWorkerScope")) : ("/")); - navigator.serviceWorker.register(_top.CONFIG.get("serviceWorkerURI"), { + static __start__() { + var __load__serviceWorker = function () { + var _promise; + if (isBrowser) { + _promise = new Promise(function (resolve, reject) { + if (("serviceWorker" in navigator) && + (typeof _top.CONFIG.get("serviceWorkerURI") !== "undefined")) { + _top.CONFIG.set("serviceWorkerScope", _top.CONFIG.get("serviceWorkerScope") ? (_top.CONFIG.get("serviceWorkerScope")) : ("/")); + navigator.serviceWorker.register(_top.CONFIG.get("serviceWorkerURI"), { scope: _top.CONFIG.get("serviceWorkerScope") }) - .then(function (registration) { - logger.debug("Service Worker Registered"); + .then(function (registration) { + logger.debug("Service Worker Registered"); + resolve.call(_promise, registration); + }, function (registration) { + logger.debug("Error registering Service Worker"); + reject.call(_promise, registration); + }); + navigator.serviceWorker.ready.then(function (registration) { + logger.debug("Service Worker Ready"); resolve.call(_promise, registration); }, function (registration) { - logger.debug("Error registering Service Worker"); + logger.debug("Error loading Service Worker"); reject.call(_promise, registration); }); - navigator.serviceWorker.ready.then(function (registration) { - logger.debug("Service Worker Ready"); - resolve.call(_promise, registration); - }, function (registration) { - logger.debug("Error loading Service Worker"); - reject.call(_promise, registration); - }); + } + }); + } + return _promise; + }; + var _buildComponents = function () { + return new Promise((resolve, reject) => { + if (isBrowser) { + logger.debug("Starting to building components"); + try { + _top.componentsStack = document.buildComponents.call(document); + } catch (e) { + throw Error(`Something went wrong trying to start components tree: ${e.message}`); + } + logger.debug("Initializing the service worker"); + __load__serviceWorker.call(_top) + .catch(function (e) { + logger.debug(`error loading the service worker ${e}`); + }); } + resolve(); }); + }; + logger.debug("Starting to load the config settings..."); + if (_top.CONFIG.get("useConfigService", false)) { + logger.debug("Loading settings using local configuration file..."); + _top.global.configService = New(ClassFactory("ConfigService")); + _top.global.configService.configLoaded = _buildComponents; + serviceLoader(_top.global.configService); + } else { + logger.debug("Starting to load the components..."); + _buildComponents.call(this); } - return _promise; - }; - var _buildComponents = function () { - return new Promise ((resolve, reject) => { - if (isBrowser) { - logger.debug("Starting to building components"); - try { - _top.componentsStack = document.buildComponents.call(document); - }catch (e){ - throw Error (`Something went wrong trying to start components tree: ${e.message}`); - } - logger.debug("Initializing the service worker"); - __load__serviceWorker.call(_top) - .catch(function (e) { - logger.debug(`error loading the service worker ${e}`); - }); - } - resolve(); - }); - }; - logger.debug("Starting to load the config settings..."); - if (_top.CONFIG.get("useConfigService", false)) { - logger.debug("Loading settings using local configuration file..."); - _top.global.configService = New(ClassFactory("ConfigService")); - _top.global.configService.configLoaded = _buildComponents; - serviceLoader(_top.global.configService); - } else { - logger.debug("Starting to load the components..."); - _buildComponents.call(this); } + } - - } - ]); - Export(ClassFactory("GlobalSettings")); - global = New(ClassFactory("GlobalSettings")); - _top = _CastProps(global, _top); + ]); + Export(ClassFactory("GlobalSettings")); + global = New(ClassFactory("GlobalSettings")); + _top = _CastProps(global, _top); - Object.defineProperty(_top, "PackagesNameList", { - set(val) { - logger.debug("PackagesNameList is readonly"); - return; - }, - get() { - var _get_packages_names = function (_packages) { - var _keys = []; - for (var _k in _packages) { - if ( - typeof _packages[_k] !== "undefined" && - typeof _packages[_k] !== "function" && - Object.hasOwnProperty.call(_packages[_k], "length") && - _packages[_k].length > 0 - ) { - _keys.push(_k); - _keys = _keys.concat(_get_packages_names(_packages[_k])); + Object.defineProperty(_top, "PackagesNameList", { + set(val) { + logger.debug("PackagesNameList is readonly"); + return; + }, + get() { + var _get_packages_names = function (_packages) { + var _keys = []; + for (var _k in _packages) { + if ( + typeof _packages[_k] !== "undefined" && + typeof _packages[_k] !== "function" && + Object.hasOwnProperty.call(_packages[_k], "length") && + _packages[_k].length > 0 + ) { + _keys.push(_k); + _keys = _keys.concat(_get_packages_names(_packages[_k])); + } } - } - return _keys; - }; - return _get_packages_names(_QC_PACKAGES); - } - }); - - Object.defineProperty(_top, "PackagesList", { - set(value) { - logger.debug("PackagesList is readonly"); - return; - }, - get() { - return _top.PackagesNameList.map(function (packagename) { - let _classesList = Package(packagename); - let _ret_; - if (_classesList) { - _ret_ = { - packageName: packagename, - classesList: _classesList.filter(function (_packageClass) { - return isQCObjects_Class(_packageClass); - }) - }; - } - return _ret_; - }).filter(function (_p) { - return typeof _p !== "undefined"; - }); - } - }); + return _keys; + }; + return _get_packages_names(_QC_PACKAGES); + } + }); - Object.defineProperty(_top, "ClassesList", { - set(value) { - logger.debug("ClassesList is readonly"); - return; - }, - get() { - var _classesList = []; - _top.PackagesList.map(function (_package_element) { - _classesList = _classesList.concat(_package_element.classesList.map( - function (_class_element) { - return { - packageName: _package_element.packageName, - className: _package_element.packageName + "." + _class_element.__definition.__classType, - classFactory: _class_element + Object.defineProperty(_top, "PackagesList", { + set(value) { + logger.debug("PackagesList is readonly"); + return; + }, + get() { + return _top.PackagesNameList.map(function (packagename) { + let _classesList = Package(packagename); + let _ret_; + if (_classesList) { + _ret_ = { + packageName: packagename, + classesList: _classesList.filter(function (_packageClass) { + return isQCObjects_Class(_packageClass); + }) }; } - )); - return _package_element; - }); + return _ret_; + }).filter(function (_p) { + return typeof _p !== "undefined"; + }); + } + }); - return _classesList; - } - }); + Object.defineProperty(_top, "ClassesList", { + set(value) { + logger.debug("ClassesList is readonly"); + return; + }, + get() { + var _classesList = []; + _top.PackagesList.map(function (_package_element) { + _classesList = _classesList.concat(_package_element.classesList.map( + function (_class_element) { + return { + packageName: _package_element.packageName, + className: _package_element.packageName + "." + _class_element.__definition.__classType, + classFactory: _class_element + }; + } + )); + return _package_element; + }); - Object.defineProperty(_top, "ClassesNameList", { - set(value) { - logger.debug("ClassesNameList is readonly"); - return; - }, - get() { - return _top.ClassesList.map(function (_class_element) { - return _class_element.className; - }); - } - }); + return _classesList; + } + }); - if (isBrowser) { - // use of GLOBAL word is deprecated in node.js - // this is only for compatibility purpose with old versions of QCObjects in browsers - Class("GLOBAL", _QC_CLASSES["global"]); // case insensitive for compatibility con old versions; - Export(ClassFactory("GLOBAL")); - } - Export(global); + Object.defineProperty(_top, "ClassesNameList", { + set(value) { + logger.debug("ClassesNameList is readonly"); + return; + }, + get() { + return _top.ClassesList.map(function (_class_element) { + return _class_element.className; + }); + } + }); + + if (isBrowser) { + // use of GLOBAL word is deprecated in node.js + // this is only for compatibility purpose with old versions of QCObjects in browsers + Class("GLOBAL", _QC_CLASSES["global"]); // case insensitive for compatibility con old versions; + Export(ClassFactory("GLOBAL")); + } + Export(global); - if (_top.CONFIG.get("useSDK")) { - (function (_top) { - var remoteImportsPath = _top.CONFIG.get("remoteImportsPath"); - var external = (!_top.CONFIG.get("useLocalSDK")) ? (true) : (false); - _top.CONFIG.set("remoteImportsPath", _top.CONFIG.get("remoteSDKPath")); + if (_top.CONFIG.get("useSDK")) { + (function (_top) { + var remoteImportsPath = _top.CONFIG.get("remoteImportsPath"); + var external = (!_top.CONFIG.get("useLocalSDK")) ? (true) : (false); + _top.CONFIG.set("remoteImportsPath", _top.CONFIG.get("remoteSDKPath")); - var tryImportingSDK = false; - var sdkName = "QCObjects-SDK"; - if (isBrowser) { - tryImportingSDK = true; - } else { - var sdkPath = findPackageNodePath("qcobjects-sdk"); - if (sdkPath !== null) { - sdkName = "qcobjects-sdk"; + var tryImportingSDK = false; + var sdkName = "QCObjects-SDK"; + if (isBrowser) { tryImportingSDK = true; } else { - sdkName = "node_modules/qcobjects-sdk/QCObjects-SDK"; - tryImportingSDK = true; + var sdkPath = findPackageNodePath("qcobjects-sdk"); + if (sdkPath !== null) { + sdkName = "qcobjects-sdk"; + tryImportingSDK = true; + } else { + sdkName = "node_modules/qcobjects-sdk/QCObjects-SDK"; + tryImportingSDK = true; + } } - } - if (tryImportingSDK) { - logger.info("Importing SDK... " + sdkName); - if (isNodeCommonJS && typeof require !== "undefined"){ - let sdk = require("qcobjects-sdk"); + if (tryImportingSDK) { + logger.info("Importing SDK... " + sdkName); + if (isNodeCommonJS && typeof require !== "undefined") { + let sdk = require("qcobjects-sdk"); + } else { + Import(sdkName, function () { + if (external) { + logger.debug("QCObjects-SDK.js loaded from remote location"); + } else { + logger.debug("QCObjects-SDK.js loaded from local"); + } + _top.CONFIG.set("remoteImportsPath", remoteImportsPath); + }, external); + } } else { - Import(sdkName, function () { - if (external) { - logger.debug("QCObjects-SDK.js loaded from remote location"); - } else { - logger.debug("QCObjects-SDK.js loaded from local"); - } - _top.CONFIG.set("remoteImportsPath", remoteImportsPath); - }, external); + logger.debug("SDK has not been imported as it is not available at the moment"); } - } else { - logger.debug("SDK has not been imported as it is not available at the moment"); - } - })(_top); - } - })(_top); + })(_top); + } + })(_top); - if (isBrowser) { - asyncLoad(function () { - Ready(function () { + if (isBrowser) { + asyncLoad(function () { + Ready(function () { - /* - * scroll management custom events - * usage: document.addEventListener('percentY90',function(e){console.log(e.detail.percentY)}); - * possible events: scrollpercent, defaultscroll, percentY0, percentY25, percentY50, percentY75, percentY90 - */ + /* + * scroll management custom events + * usage: document.addEventListener('percentY90',function(e){console.log(e.detail.percentY)}); + * possible events: scrollpercent, defaultscroll, percentY0, percentY25, percentY50, percentY75, percentY90 + */ - (function (_top) { - let lastKnownScrollPosition = 0; - let ticking = false; - let scrollHeight = Math.max( - document.body.scrollHeight, document.documentElement.scrollHeight, - document.body.offsetHeight, document.documentElement.offsetHeight, - document.body.clientHeight, document.documentElement.clientHeight - ); + (function (_top) { + let lastKnownScrollPosition = 0; + let ticking = false; + let scrollHeight = Math.max( + document.body.scrollHeight, document.documentElement.scrollHeight, + document.body.offsetHeight, document.documentElement.offsetHeight, + document.body.clientHeight, document.documentElement.clientHeight + ); - let scrollWidth = Math.max( - document.body.scrollWidth, document.documentElement.scrollWidth, - document.body.offsetWidth, document.documentElement.offsetWidth, - document.body.clientWidth, document.documentElement.clientWidth - ); + let scrollWidth = Math.max( + document.body.scrollWidth, document.documentElement.scrollWidth, + document.body.offsetWidth, document.documentElement.offsetWidth, + document.body.clientWidth, document.documentElement.clientWidth + ); - function scrollDispatcher(event) { - var percentY = Math.round(_top.scrollY * 100 / scrollHeight); - var percentX = Math.round(_top.scrollX * 100 / scrollWidth); - var scrollPercentEventEvent = new CustomEvent("scrollpercent", { - detail: { - percentX: percentX, - percentY: percentY - } - }); - event.target.dispatchEvent(scrollPercentEventEvent); - var secondaryEventName = "defaultscroll"; - var __valid_scrolls__ = [0, 5, 10, 25, 50, 75, 90, 95, 100]; - __valid_scrolls__.filter(function (p) { - return p === percentY; - }).map(function (pY) { - secondaryEventName = "percentY" + percentY.toString(); - var secondaryCustomEvent = new CustomEvent(secondaryEventName, { + function scrollDispatcher(event) { + var percentY = Math.round(_top.scrollY * 100 / scrollHeight); + var percentX = Math.round(_top.scrollX * 100 / scrollWidth); + var scrollPercentEventEvent = new CustomEvent("scrollpercent", { detail: { percentX: percentX, percentY: percentY } }); - event.target.dispatchEvent(secondaryCustomEvent); - }); - - } - - document.addEventListener("scroll", function (event) { - - if (!ticking) { - requestAnimationFrame(function () { - scrollDispatcher(event); - ticking = false; + event.target.dispatchEvent(scrollPercentEventEvent); + var secondaryEventName = "defaultscroll"; + var __valid_scrolls__ = [0, 5, 10, 25, 50, 75, 90, 95, 100]; + __valid_scrolls__.filter(function (p) { + return p === percentY; + }).map(function (pY) { + secondaryEventName = "percentY" + percentY.toString(); + var secondaryCustomEvent = new CustomEvent(secondaryEventName, { + detail: { + percentX: percentX, + percentY: percentY + } + }); + event.target.dispatchEvent(secondaryCustomEvent); }); - ticking = true; } - }); - })(_top); + document.addEventListener("scroll", function (event) { - }); - }, null); - } + if (!ticking) { + requestAnimationFrame(function () { + scrollDispatcher(event); + ticking = false; + }); + + ticking = true; + } + }); - if (!isBrowser) { - if (typeof _top.global !== "undefined" && Object.hasOwnProperty.call(_top.global, "_fireAsyncLoad")) { - _top.global._fireAsyncLoad.call(this); + })(_top); + + }); + }, null); } - if (typeof _top.global !== "undefined" && Object.hasOwnProperty.call(_top.global, "onload")) { - _top.global.onload.call(this); + + if (!isBrowser) { + if (typeof _top.global !== "undefined" && Object.hasOwnProperty.call(_top.global, "_fireAsyncLoad")) { + _top.global._fireAsyncLoad.call(this); + } + if (typeof _top.global !== "undefined" && Object.hasOwnProperty.call(_top.global, "onload")) { + _top.global.onload.call(this); + } } - } - /* Freezing Object && Object.prototype to prevent prototype pollution risks */ - (function (isBrowser) { - var __freeze__ = function () { - Object.freeze(Object.prototype); - Object.freeze(Object); - }; - if (isBrowser && _top.CONFIG.get("secureObjects", false)) { - Ready(function () { + /* Freezing Object && Object.prototype to prevent prototype pollution risks */ + (function (isBrowser) { + var __freeze__ = function () { + Object.freeze(Object.prototype); + Object.freeze(Object); + }; + if (isBrowser && _top.CONFIG.get("secureObjects", false)) { + Ready(function () { + __freeze__(); + }); + } else if (_top.CONFIG.get("secureObjects", false)) { __freeze__(); - }); - } else if (_top.CONFIG.get("secureObjects", false)) { - __freeze__(); - } - })(isBrowser); + } + })(isBrowser); + } + } -}).call(null, (typeof module === "object" && typeof module.exports === "object") ? ( - module.exports = (typeof globalThis !== "undefined" - ? globalThis - : typeof self !== "undefined" - ? self - : typeof window !== "undefined" - ? window - : typeof global !== "undefined" - ? global - : {}) -) : ((typeof global === "object") ? (global) : ( - (typeof window === "object") ? (window) : ({}) -))); \ No newline at end of file + + const _top = (__qcobjects__(self))(); + + return { + default: { + __qcobjects__: __qcobjects__, + global: _top + }, + __qcobjects__: __qcobjects__, + global: _top + }; +})); diff --git a/src/index.cjs b/src/index.cts similarity index 100% rename from src/index.cjs rename to src/index.cts diff --git a/src/index.mjs b/src/index.mts similarity index 100% rename from src/index.mjs rename to src/index.mts diff --git a/src/types.d.ts b/src/types.d.ts new file mode 100644 index 00000000..a8ef8e3b --- /dev/null +++ b/src/types.d.ts @@ -0,0 +1,20 @@ +declare module "QCObjects" { + export function __qcobjects__(_top: any): void; + const _top: any; + let _default: { + __qcobjects__: (_top: any) => void; + global: any; + } | { + default: { + __qcobjects__: (_top: any) => void; + global: any; + }; + __qcobjects__: (_top: any) => void; + global: any; + }; + export { _default as default, _top as global }; +} +declare module "index" { + import QCObjects from "QCObjects"; + export default QCObjects; +} diff --git a/tsconfig.d.json b/tsconfig.d.json new file mode 100644 index 00000000..fdf55d0f --- /dev/null +++ b/tsconfig.d.json @@ -0,0 +1,18 @@ +{ + "extends": "qcobjects-tsconfig/tsconfig.d.json", + "compilerOptions": { + "strict": true, // Enables all strict type-checking options + "noImplicitAny": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "strictPropertyInitialization": true, + "noImplicitThis": true, + "alwaysStrict": true, + "outFile": "src/types.d.ts", + "typeRoots": ["types", "node_modules/@types", "@typescript-eslint"], + "allowSyntheticDefaultImports":true, + "esModuleInterop": true + }, + "include": ["src/**/*.ts", "src/static/js/packages/components/*.d.ts"], + "exclude": ["src/**/*.spec.js", "src/*.js", "src/*.d.ts", "src/**/*.d.ts"] +} diff --git a/tsconfig.json b/tsconfig.json index 84ad5ff2..32f1424f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,18 +1,15 @@ { + "extends": ["qcobjects-tsconfig/tsconfig.json"], "compilerOptions": { "target": "ESNext", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ "lib": ["ESNext", "DOM"], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ "module": "NodeNext", /* Specify what module code is generated. */ "rootDir": "src", /* Specify the root folder within your source files. */ - "resolveJsonModule": true, /* Enable importing .json files. */ "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ - "outDir": "build", /* Specify an output folder for all emitted files. */ - "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ - "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ - "strict": true, /* Enable all strict type-checking options. */ - "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ - "skipLibCheck": true /* Skip type checking all .d.ts files. */ + "outDir": "build", /* Specify an output folder for all emitted files. */ + "allowSyntheticDefaultImports":true, + "esModuleInterop": true }, - "include": ["src/**/*.ts"], - "exclude": ["src/**/*.spec.ts", "src/*.js"] + "include": ["src/**/*.ts", "src/**/*.mts", "src/**/*.cts"], + "exclude": ["src/**/*.spec.js", "src/*.js"] }