From 608d26bf64764ff04fcfa18caaf70133b4a08592 Mon Sep 17 00:00:00 2001 From: Nancy <42977925+mantis-toboggan-md@users.noreply.github.com> Date: Tue, 24 Oct 2023 11:44:05 -0700 Subject: [PATCH 1/4] add build/publih extension workflow (#7) --- .github/workflows/build-extension-charts.yml | 129 +++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 .github/workflows/build-extension-charts.yml diff --git a/.github/workflows/build-extension-charts.yml b/.github/workflows/build-extension-charts.yml new file mode 100644 index 0000000..00da975 --- /dev/null +++ b/.github/workflows/build-extension-charts.yml @@ -0,0 +1,129 @@ +name: Build and Release Extension Charts + +on: + workflow_dispatch: + release: + types: [released] + +env: + ACTIONS_RUNNER_DEBUG: false + CI_COMMIT_MESSAGE: CI Build Artifacts + TARGET_BRANCH: gh-pages + +defaults: + run: + shell: bash + working-directory: ./ + +jobs: + build-extension-artifact: + name: Build extension artifact + runs-on: ubuntu-latest + permissions: + actions: write + contents: read + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Configure Git + run: | + git config user.name 'github-actions[bot]' + git config user.email 'github-actions[bot]@users.noreply.github.com' + + - name: Setup Helm + uses: azure/setup-helm@v3 + with: + version: v3.8.0 + + - name: Setup yq + uses: chrisdickinson/setup-yq@v1.0.1 + with: + yq-version: v4.34.2 + + - name: Setup Nodejs and npm + uses: actions/setup-node@v3 + with: + node-version: '16' + + - name: Setup yarn + run: npm install -g yarn + + - name: Setup Nodejs with yarn caching + uses: actions/setup-node@v3 + with: + node-version: '16' + cache: yarn + + - name: Install dependencies + run: yarn + + - name: Parse Extension Name + if: github.ref_type == 'tag' + id: parsed-name + env: + GH_TOKEN: ${{ github.token }} + run: | + chmod +x ./node_modules/@rancher/shell/scripts/extension/parse-tag-name + yarn parse-tag-name ${{ github.ref_name }} ${{ github.run_id }} "charts" + + - name: Run build script + shell: bash + id: build_script + run: | + publish="yarn publish-pkgs -s ${{ github.repository }} -b ${{ env.TARGET_BRANCH }}" + + if [[ -n "${{ github.ref_name }}" ]]; then + publish="$publish -t ${{ github.ref_name }}" + fi + + $publish + + - name: Upload charts artifact + if: github.ref_type == 'tag' || (github.ref == 'refs/heads/main' && github.event_name != 'pull_request') + uses: actions/upload-artifact@v3 + with: + name: charts + path: tmp + + release: + name: Release Build + if: github.ref_type == 'tag' || (github.ref == 'refs/heads/main' && github.event_name != 'pull_request') + needs: build-extension-artifact + runs-on: ubuntu-latest + permissions: + actions: write + contents: write + deployments: write + pages: write + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + ref: "${{ env.TARGET_BRANCH }}" + + - name: Configure Git + run: | + git config user.name 'github-actions[bot]' + git config user.email 'github-actions[bot]@users.noreply.github.com' + + - name: Download build artifact + uses: actions/download-artifact@v3 + with: + name: charts + + - name: Commit build + run: | + git add ./{assets,charts,extensions,index.yaml} + git commit -a -m "${{ env.CI_COMMIT_MESSAGE }}" + git push + + - name: Run chart-releaser + uses: helm/chart-releaser-action@v1.4.1 + with: + charts_dir: ./charts/* + env: + CR_TOKEN: '${{ secrets.GITHUB_TOKEN }}' + CR_SKIP_EXISTING: true \ No newline at end of file From 96dd1446d6fc5c779fd5eb1d6818d1dfbeb8e030 Mon Sep 17 00:00:00 2001 From: Nancy <42977925+mantis-toboggan-md@users.noreply.github.com> Date: Tue, 24 Oct 2023 12:09:33 -0700 Subject: [PATCH 2/4] create build and release catalog workflow (#8) --- .github/workflows/build-extension-catalog.yml | 28 ++++ .github/workflows/build-extension-charts.yml | 129 ------------------ pkg/capi/package.json | 2 +- 3 files changed, 29 insertions(+), 130 deletions(-) create mode 100644 .github/workflows/build-extension-catalog.yml delete mode 100644 .github/workflows/build-extension-charts.yml diff --git a/.github/workflows/build-extension-catalog.yml b/.github/workflows/build-extension-catalog.yml new file mode 100644 index 0000000..37f333d --- /dev/null +++ b/.github/workflows/build-extension-catalog.yml @@ -0,0 +1,28 @@ +name: Build and Release Extension Catalog + +on: + workflow_dispatch: + push: + branches: + - main + pull_request: + branches: + - main + +defaults: + run: + shell: bash + working-directory: ./ + +jobs: + build-extension-catalog: + uses: rancher/dashboard/.github/workflows/build-extension-catalog.yml@master + permissions: + actions: write + contents: read + packages: write + with: + registry_target: ghcr.io + registry_user: ${{ github.actor }} + secrets: + registry_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/build-extension-charts.yml b/.github/workflows/build-extension-charts.yml deleted file mode 100644 index 00da975..0000000 --- a/.github/workflows/build-extension-charts.yml +++ /dev/null @@ -1,129 +0,0 @@ -name: Build and Release Extension Charts - -on: - workflow_dispatch: - release: - types: [released] - -env: - ACTIONS_RUNNER_DEBUG: false - CI_COMMIT_MESSAGE: CI Build Artifacts - TARGET_BRANCH: gh-pages - -defaults: - run: - shell: bash - working-directory: ./ - -jobs: - build-extension-artifact: - name: Build extension artifact - runs-on: ubuntu-latest - permissions: - actions: write - contents: read - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Configure Git - run: | - git config user.name 'github-actions[bot]' - git config user.email 'github-actions[bot]@users.noreply.github.com' - - - name: Setup Helm - uses: azure/setup-helm@v3 - with: - version: v3.8.0 - - - name: Setup yq - uses: chrisdickinson/setup-yq@v1.0.1 - with: - yq-version: v4.34.2 - - - name: Setup Nodejs and npm - uses: actions/setup-node@v3 - with: - node-version: '16' - - - name: Setup yarn - run: npm install -g yarn - - - name: Setup Nodejs with yarn caching - uses: actions/setup-node@v3 - with: - node-version: '16' - cache: yarn - - - name: Install dependencies - run: yarn - - - name: Parse Extension Name - if: github.ref_type == 'tag' - id: parsed-name - env: - GH_TOKEN: ${{ github.token }} - run: | - chmod +x ./node_modules/@rancher/shell/scripts/extension/parse-tag-name - yarn parse-tag-name ${{ github.ref_name }} ${{ github.run_id }} "charts" - - - name: Run build script - shell: bash - id: build_script - run: | - publish="yarn publish-pkgs -s ${{ github.repository }} -b ${{ env.TARGET_BRANCH }}" - - if [[ -n "${{ github.ref_name }}" ]]; then - publish="$publish -t ${{ github.ref_name }}" - fi - - $publish - - - name: Upload charts artifact - if: github.ref_type == 'tag' || (github.ref == 'refs/heads/main' && github.event_name != 'pull_request') - uses: actions/upload-artifact@v3 - with: - name: charts - path: tmp - - release: - name: Release Build - if: github.ref_type == 'tag' || (github.ref == 'refs/heads/main' && github.event_name != 'pull_request') - needs: build-extension-artifact - runs-on: ubuntu-latest - permissions: - actions: write - contents: write - deployments: write - pages: write - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - ref: "${{ env.TARGET_BRANCH }}" - - - name: Configure Git - run: | - git config user.name 'github-actions[bot]' - git config user.email 'github-actions[bot]@users.noreply.github.com' - - - name: Download build artifact - uses: actions/download-artifact@v3 - with: - name: charts - - - name: Commit build - run: | - git add ./{assets,charts,extensions,index.yaml} - git commit -a -m "${{ env.CI_COMMIT_MESSAGE }}" - git push - - - name: Run chart-releaser - uses: helm/chart-releaser-action@v1.4.1 - with: - charts_dir: ./charts/* - env: - CR_TOKEN: '${{ secrets.GITHUB_TOKEN }}' - CR_SKIP_EXISTING: true \ No newline at end of file diff --git a/pkg/capi/package.json b/pkg/capi/package.json index 8c7bcb8..5321180 100644 --- a/pkg/capi/package.json +++ b/pkg/capi/package.json @@ -5,7 +5,7 @@ "private": false, "rancher": { "annotations": { - "catalog.cattle.io/rancher-version": ">= v2.7.6" + "catalog.cattle.io/rancher-version": ">= v2.7.8" } }, "scripts": { From 76ff2e4ee68e3936f8bcb08d54da100a1ae07804 Mon Sep 17 00:00:00 2001 From: Nancy <42977925+mantis-toboggan-md@users.noreply.github.com> Date: Tue, 24 Oct 2023 12:39:36 -0700 Subject: [PATCH 3/4] add build extension charts yaml (#9) --- .github/workflows/build-extension-charts.yml | 23 ++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/build-extension-charts.yml diff --git a/.github/workflows/build-extension-charts.yml b/.github/workflows/build-extension-charts.yml new file mode 100644 index 0000000..e83a68f --- /dev/null +++ b/.github/workflows/build-extension-charts.yml @@ -0,0 +1,23 @@ +name: Build and Release Extension Charts + +on: + workflow_dispatch: + push: + branches: + - main + +defaults: + run: + shell: bash + working-directory: ./ + +jobs: + build-extension-charts: + uses: rancher/dashboard/.github/workflows/build-extension-charts.yml@master + permissions: + actions: write + contents: write + deployments: write + pages: write + with: + target_branch: gh-pages \ No newline at end of file From d2e0041dbec2b90e1045039d2514aaa4bd497206 Mon Sep 17 00:00:00 2001 From: Evgeniya Vashkevich Date: Tue, 24 Oct 2023 14:01:59 -0700 Subject: [PATCH 4/4] Build --- .gitignore | 2 +- assets/capi/capi-0.1.0.tgz | Bin 0 -> 1183 bytes assets/index.yaml | 23 ++++++++ charts/capi/0.1.0/Chart.yaml | 15 +++++ charts/capi/0.1.0/templates/_helpers.tpl | 52 ++++++++++++++++++ charts/capi/0.1.0/templates/cr.yaml | 12 ++++ charts/capi/0.1.0/values.yaml | 6 ++ extensions/capi/0.1.0/files.txt | 11 ++++ .../capi/0.1.0/plugin/capi-0.1.0.umd.min.2.js | 2 + .../0.1.0/plugin/capi-0.1.0.umd.min.2.js.map | 1 + .../capi/0.1.0/plugin/capi-0.1.0.umd.min.3.js | 2 + .../0.1.0/plugin/capi-0.1.0.umd.min.3.js.map | 1 + .../capi/0.1.0/plugin/capi-0.1.0.umd.min.4.js | 2 + .../0.1.0/plugin/capi-0.1.0.umd.min.4.js.map | 1 + .../plugin/capi-0.1.0.umd.min.formatters.js | 2 + .../capi-0.1.0.umd.min.formatters.js.map | 1 + .../capi/0.1.0/plugin/capi-0.1.0.umd.min.js | 2 + .../0.1.0/plugin/capi-0.1.0.umd.min.js.map | 1 + extensions/capi/0.1.0/plugin/package.json | 19 +++++++ index.yaml | 23 ++++++++ 20 files changed, 177 insertions(+), 1 deletion(-) create mode 100644 assets/capi/capi-0.1.0.tgz create mode 100644 assets/index.yaml create mode 100644 charts/capi/0.1.0/Chart.yaml create mode 100644 charts/capi/0.1.0/templates/_helpers.tpl create mode 100644 charts/capi/0.1.0/templates/cr.yaml create mode 100644 charts/capi/0.1.0/values.yaml create mode 100644 extensions/capi/0.1.0/files.txt create mode 100644 extensions/capi/0.1.0/plugin/capi-0.1.0.umd.min.2.js create mode 100644 extensions/capi/0.1.0/plugin/capi-0.1.0.umd.min.2.js.map create mode 100644 extensions/capi/0.1.0/plugin/capi-0.1.0.umd.min.3.js create mode 100644 extensions/capi/0.1.0/plugin/capi-0.1.0.umd.min.3.js.map create mode 100644 extensions/capi/0.1.0/plugin/capi-0.1.0.umd.min.4.js create mode 100644 extensions/capi/0.1.0/plugin/capi-0.1.0.umd.min.4.js.map create mode 100644 extensions/capi/0.1.0/plugin/capi-0.1.0.umd.min.formatters.js create mode 100644 extensions/capi/0.1.0/plugin/capi-0.1.0.umd.min.formatters.js.map create mode 100644 extensions/capi/0.1.0/plugin/capi-0.1.0.umd.min.js create mode 100644 extensions/capi/0.1.0/plugin/capi-0.1.0.umd.min.js.map create mode 100644 extensions/capi/0.1.0/plugin/package.json create mode 100644 index.yaml diff --git a/.gitignore b/.gitignore index 58669c1..d6dc500 100644 --- a/.gitignore +++ b/.gitignore @@ -52,7 +52,7 @@ typings/ .node_repl_history # Output of 'npm pack' -*.tgz +#*.tgz # Yarn Integrity file .yarn-integrity diff --git a/assets/capi/capi-0.1.0.tgz b/assets/capi/capi-0.1.0.tgz new file mode 100644 index 0000000000000000000000000000000000000000..a2c976b0a573d3ddeac23fbcfdfe6eab838dffd2 GIT binary patch literal 1183 zcmV;Q1Yr9giwG0|00000|0w_~VMtOiV@ORlOnEsqVl!4SWK%V1T2nbTPgYhoO;>Dc zVQyr3R8em|NM&qo0PI-bkK48nzi0mygz+u<<2%c8l3ojA9WZozC^odi4(lEZMP?GA zvaCvS?t)zZ_d$~5B);q}-F8=O2w$SeB=sRhQj|E;B7ePL#*r1P<=K4@rIemeCgGP- zI{c+C#-p=h^1L{wV@iwh87)QyrDs6z1zFyCe|xQ=asLuxN;Qr-(I{Ic0Gv4{ zn>pdkIf+CxIY;BfOkh=lVTv!%9Ax|0PBB}ev7%8WJpS$#6r?yOG^6k>6lC<$4<8>C zRjfv<8OIXhWY&sI%XThQW>?l>eNe2iB}k##tAk%Pnp!xU^<3Y;rBGFKX%Dh@rtMp> z9FZ5~qen+B}AKS!nAn5S!X#)nAZJYN(w@g3N1H6 zyD;T5v=dFdtKv-JR(^e^wG=$;U$Wd+a@_uh{9iKJqP@2Qa992pljpot=1@rc>2EO70M zh~jWQ4nt92w6mGGf;3B^(}k+?!z93bZIC$x*011e)e1hfOok4{pN7EzlKhTQci?w^ z1#gUnDRS0Y1l!aIKebad3LV;L_DrCxEHHy0MJ*gw;2LlXVd2Si6iC`AV(i@!m5^VfucGV*=icNOg40GQH-q$%%^ulwpertVe4HH~ z?uXybzWSu;4nV)BVQ;%YiCmIRQ696ufqlEVL!);69mieA2-jdxOU4n>|EG|CNWVO* zn!0XOgldm~8W|(j16`!IPk_zEwQ<;vgs-++Jx2xnx)`F`RL7y4*c={9GaUQ z#1cFITm2U6137GqP}VWUao>{NEbPqq+6U5!9+U?CA2;`K3%sNME9is{`oHmHJUaD% z4?(+c5jWp2mPPVWsH%kD-ux0@AZm21VvhN{;1M-x+qZ z{(QIwB~*pV!Nkk^&dlT6-dg_}*8X-I1fN)}muTS0pbOeLST?;-T$l{*#!sJ;cSg*G zVsfJ&RizuDTnP*3v@P@8uuC!*ZqZI#i^g|Ps2t% xGokW+$_B1Hz6}MBZ0_iOANGNFpH9cYiB5E)6a9DTj{pDw|NkWcn(P1^003= 1.16.0-0 < 1.28.0-0' + catalog.cattle.io/namespace: cattle-ui-plugin-system + catalog.cattle.io/os: linux + catalog.cattle.io/permits-os: linux, windows + catalog.cattle.io/rancher-version: '>= v2.7.8' + catalog.cattle.io/scope: management + catalog.cattle.io/ui-component: plugins + apiVersion: v2 + appVersion: 0.1.0 + created: "2023-10-24T13:58:51.409462-07:00" + description: capi plugin + digest: a1c11eef2f31646e284ef33ff76d68707dc11256ee14e0cae1b91f75c2329d35 + name: capi + type: application + urls: + - assets/capi/capi-0.1.0.tgz + version: 0.1.0 +generated: "2023-10-24T13:58:51.40921-07:00" diff --git a/charts/capi/0.1.0/Chart.yaml b/charts/capi/0.1.0/Chart.yaml new file mode 100644 index 0000000..0ffc4db --- /dev/null +++ b/charts/capi/0.1.0/Chart.yaml @@ -0,0 +1,15 @@ +annotations: + catalog.cattle.io/certified: rancher + catalog.cattle.io/kube-version: '>= 1.16.0-0 < 1.28.0-0' + catalog.cattle.io/namespace: cattle-ui-plugin-system + catalog.cattle.io/os: linux + catalog.cattle.io/permits-os: linux, windows + catalog.cattle.io/rancher-version: '>= v2.7.8' + catalog.cattle.io/scope: management + catalog.cattle.io/ui-component: plugins +apiVersion: v2 +appVersion: 0.1.0 +description: capi plugin +name: capi +type: application +version: 0.1.0 diff --git a/charts/capi/0.1.0/templates/_helpers.tpl b/charts/capi/0.1.0/templates/_helpers.tpl new file mode 100644 index 0000000..bd2ec19 --- /dev/null +++ b/charts/capi/0.1.0/templates/_helpers.tpl @@ -0,0 +1,52 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "extension-server.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "extension-server.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "extension-server.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "extension-server.labels" -}} +helm.sh/chart: {{ include "extension-server.chart" . }} +{{ include "extension-server.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "extension-server.selectorLabels" -}} +app.kubernetes.io/name: {{ include "extension-server.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} diff --git a/charts/capi/0.1.0/templates/cr.yaml b/charts/capi/0.1.0/templates/cr.yaml new file mode 100644 index 0000000..8967087 --- /dev/null +++ b/charts/capi/0.1.0/templates/cr.yaml @@ -0,0 +1,12 @@ +apiVersion: catalog.cattle.io/v1 +kind: UIPlugin +metadata: + name: {{ include "extension-server.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: {{ include "extension-server.labels" . | nindent 4 }} +spec: + plugin: + name: {{ include "extension-server.fullname" . }} + version: {{ (semver (default .Chart.AppVersion .Values.plugin.versionOverride)).Original }} + endpoint: https://raw.githubusercontent.com/https://github.com/rancher/capi-ui-extension.git/main/extensions/capi/0.1.0 + noCache: {{ .Values.plugin.noCache }} diff --git a/charts/capi/0.1.0/values.yaml b/charts/capi/0.1.0/values.yaml new file mode 100644 index 0000000..9cc1bd5 --- /dev/null +++ b/charts/capi/0.1.0/values.yaml @@ -0,0 +1,6 @@ +nameOverride: "" +fullnameOverride: "" +plugin: + enabled: true + versionOverride: "" + noCache: false diff --git a/extensions/capi/0.1.0/files.txt b/extensions/capi/0.1.0/files.txt new file mode 100644 index 0000000..2b2fb82 --- /dev/null +++ b/extensions/capi/0.1.0/files.txt @@ -0,0 +1,11 @@ +plugin/capi-0.1.0.umd.min.2.js +plugin/capi-0.1.0.umd.min.2.js.map +plugin/capi-0.1.0.umd.min.3.js +plugin/capi-0.1.0.umd.min.3.js.map +plugin/capi-0.1.0.umd.min.4.js +plugin/capi-0.1.0.umd.min.4.js.map +plugin/capi-0.1.0.umd.min.formatters.js +plugin/capi-0.1.0.umd.min.formatters.js.map +plugin/capi-0.1.0.umd.min.js +plugin/capi-0.1.0.umd.min.js.map +plugin/package.json diff --git a/extensions/capi/0.1.0/plugin/capi-0.1.0.umd.min.2.js b/extensions/capi/0.1.0/plugin/capi-0.1.0.umd.min.2.js new file mode 100644 index 0000000..01b4179 --- /dev/null +++ b/extensions/capi/0.1.0/plugin/capi-0.1.0.umd.min.2.js @@ -0,0 +1,2 @@ +(("undefined"!==typeof self?self:this)["webpackJsonpcapi_0_1_0"]=("undefined"!==typeof self?self:this)["webpackJsonpcapi_0_1_0"]||[]).push([[2],{"0d7f":function(e,t,i){var o=i("5eaa");t=o(!1),t.push([e.i,'.checkbox-outer-container{display:inline-flex;flex-direction:column}.checkbox-outer-container-description{color:var(--input-label);font-size:14px;margin-left:19px;margin-top:5px;opacity:.8}.checkbox-container{position:relative;display:inline-flex;align-items:center;margin:0;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;border-radius:var(--border-radius)}.checkbox-container .checkbox-label{color:var(--input-label);display:inline-flex;margin:0 10px 0 5px}.checkbox-container .checkbox-label.checkbox-primary{color:inherit;font-weight:600}.checkbox-container .checkbox-info{line-height:normal;margin-left:2px}.checkbox-container .checkbox-custom{height:14px;width:14px;background-color:var(--body-bg);border-radius:var(--border-radius);transition:all .3s ease-out;border:1px solid var(--border)}.checkbox-container input{opacity:0;position:absolute;z-index:-1}.checkbox-container input:checked~.checkbox-custom{background-color:var(--primary);transform:rotate(0deg) scale(1);opacity:1;border:1px solid var(--primary)}.checkbox-container .checkbox-custom:after{position:absolute;content:"";left:0;top:0;height:0;width:0;border-radius:var(--border-radius);border:solid;border-color:var(--input-text);border-width:0 3px 3px 0;transform:rotate(0deg) scale(0);opacity:1}.checkbox-container input:checked~.checkbox-custom:after{transform:rotate(45deg) scale(1);opacity:1;left:4px;width:4px;height:10px;border:solid;border-color:var(--checkbox-tick);border-width:0 2px 2px 0;background-color:transparent}.checkbox-container input:checked~.checkbox-custom.indeterminate:after{transform:scale(1);opacity:1;left:3px;top:2px;width:6px;height:5px;border:solid;border-color:var(--checkbox-tick);border-width:0 0 2px 0;background-color:transparent}.checkbox-container.disabled .checkbox-custom,.checkbox-container.disabled input:checked~.checkbox-custom{background-color:var(--checkbox-disabled-bg);border-color:var(--checkbox-disabled-bg)}.checkbox-container.disabled input:checked~.checkbox-custom:after{border-color:var(--checkbox-tick-disabled)}.checkbox-container.disabled{cursor:not-allowed}.checkbox-container .checkbox-view{display:flex;flex-direction:column}.checkbox-container .checkbox-view LABEL{color:var(--input-label)}',""]),e.exports=t},"13cb":function(e,t,i){"use strict";i("806a")},"64c9":function(e,t,i){"use strict";i.r(t);var o=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",[t("Checkbox",{attrs:{value:e.capiLabel,"label-key":"capi.autoImport.checkbox.label"},on:{input:e.toggleCapiLabel}},[t("br"),e._v(" "+e._s({...e.resource})+" ")])],1)},r=[],a=i("8bbf"),c=i.n(a),l=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{staticClass:"checkbox-outer-container",attrs:{"data-checkbox-ctrl":""}},[t("label",{staticClass:"checkbox-container",class:{disabled:e.isDisabled},attrs:{for:e.id},on:{keydown:[function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:(t.preventDefault(),e.clicked(t))},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"space",32,t.key,[" ","Spacebar"])?null:(t.preventDefault(),e.clicked(t))}],click:function(t){return e.clicked(t)}}},[t("input",{attrs:{type:"checkbox",tabindex:-1,name:e.id},domProps:{checked:e.isChecked,value:e.valueWhenTrue},on:{click:function(e){e.stopPropagation(),e.preventDefault()}}}),t("span",{staticClass:"checkbox-custom",class:{indeterminate:e.indeterminate},attrs:{tabindex:e.isDisabled?-1:0,"aria-label":e.label,"aria-checked":!!e.value,role:"checkbox"}}),e.$slots.label||e.label||e.labelKey||e.tooltipKey||e.tooltip?t("span",{staticClass:"checkbox-label",class:{"checkbox-primary":e.primary}},[e._t("label",(function(){return[e.labelKey?t("t",{attrs:{k:e.labelKey,raw:!0}}):e.label?[e._v(e._s(e.label))]:e._e(),e.tooltipKey?t("i",{directives:[{name:"clean-tooltip",rawName:"v-clean-tooltip",value:e.t(e.tooltipKey),expression:"t(tooltipKey)"}],staticClass:"checkbox-info icon icon-info icon-lg"}):e.tooltip?t("i",{directives:[{name:"clean-tooltip",rawName:"v-clean-tooltip",value:e.tooltip,expression:"tooltip"}],staticClass:"checkbox-info icon icon-info icon-lg"}):e._e()]}))],2):e._e()]),e.descriptionKey||e.description?t("div",{staticClass:"checkbox-outer-container-description"},[e.descriptionKey?t("t",{attrs:{k:e.descriptionKey}}):e.description?[e._v(" "+e._s(e.description)+" ")]:e._e()],2):e._e()])},n=[],s=i("da25"),d=i("bddd"),u=i("736a"),b=i.n(u),p=c.a.extend({name:"Checkbox",props:{value:{type:[Boolean,Array,String],default:!1},label:{type:String,default:null},labelKey:{type:String,default:null},id:{type:String,default:String(1e3*Math.random())},disabled:{type:Boolean,default:!1},indeterminate:{type:Boolean,default:!1},mode:{type:String,default:s["c"]},tooltip:{type:[String,Object],default:null},tooltipKey:{type:String,default:null},valueWhenTrue:{type:[Boolean,String,Number],default:!0},descriptionKey:{type:String,default:null},description:{type:String,default:null},primary:{type:Boolean,default:!1}},computed:{isDisabled(){return this.disabled||this.mode===s["d"]},isChecked(){return this.isMulti(this.value)?this.findTrueValues(this.value):this.value===this.valueWhenTrue}},methods:{clicked(e){if("A"===e.target.tagName&&e.target.href)return!0;if(e.stopPropagation(),e.preventDefault(),this.isDisabled)return;const t={bubbles:!0,cancelable:!1,shiftKey:e.shiftKey,altKey:e.altKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey},i=new CustomEvent("click",t),o=b()(this.value);this.isMulti(o)?(this.isChecked?Object(d["c"])(o,this.valueWhenTrue):Object(d["a"])(o,this.valueWhenTrue),this.$emit("input",o)):this.isString(this.valueWhenTrue)?this.isChecked?this.$emit("input",null):this.$emit("input",this.valueWhenTrue):(this.$emit("input",!o),this.$el.dispatchEvent(i))},isMulti(e){return Array.isArray(e)},isString(e){return"string"===typeof e},findTrueValues(e){return e.find(e=>e===this.valueWhenTrue)||!1}}}),h=p,x=(i("13cb"),i("d802")),k=Object(x["a"])(h,l,n,!1,null,null,null),f=k.exports,y=i("7e89"),m=c.a.extend({name:"CAPIAutoImportConfiguration",components:{Checkbox:f},props:{resource:{type:Object,required:!0},mode:{type:String,default:"create"}},methods:{toggleCapiLabel(e){e?this.$set(this.resource.metadata.labels,y["b"].AUTO_IMPORT,"true"):delete this.resource.metadata.labels[y["b"].AUTO_IMPORT]}},computed:{capiLabel(){var e;return"true"===(null===(e=this.resource)||void 0===e||null===(e=e.metadata.labels)||void 0===e?void 0:e[y["b"].AUTO_IMPORT])},labels(){return this.resource.labels}}}),v=m,g=Object(x["a"])(v,o,r,!1,null,null,null);t["default"]=g.exports},"806a":function(e,t,i){var o=i("0d7f");o.__esModule&&(o=o.default),"string"===typeof o&&(o=[[e.i,o,""]]),o.locals&&(e.exports=o.locals);var r=i("0ed3").default;r("47eb6368",o,!0,{sourceMap:!1,shadowMode:!1})}}]); +//# sourceMappingURL=capi-0.1.0.umd.min.2.js.map \ No newline at end of file diff --git a/extensions/capi/0.1.0/plugin/capi-0.1.0.umd.min.2.js.map b/extensions/capi/0.1.0/plugin/capi-0.1.0.umd.min.2.js.map new file mode 100644 index 0000000..64fb6dc --- /dev/null +++ b/extensions/capi/0.1.0/plugin/capi-0.1.0.umd.min.2.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack://capi-0.1.0//Users/evashkevich/development/capi-ui-extension/node_modules/@rancher/shell/rancher-components/Form/Checkbox/Checkbox.vue?0303","webpack://capi-0.1.0//Users/evashkevich/development/capi-ui-extension/node_modules/@rancher/shell/rancher-components/Form/Checkbox/Checkbox.vue?4dcf","webpack://capi-0.1.0/./components/AutoImport.vue","webpack://capi-0.1.0//Users/evashkevich/development/capi-ui-extension/node_modules/@rancher/shell/rancher-components/Form/Checkbox/Checkbox.vue","webpack://capi-0.1.0//Users/evashkevich/development/capi-ui-extension/node_modules/@rancher/shell/rancher-components/Form/Checkbox/Checkbox.vue?4914","webpack://capi-0.1.0//Users/evashkevich/development/capi-ui-extension/node_modules/@rancher/shell/rancher-components/Form/Checkbox/Checkbox.vue?91b6","webpack://capi-0.1.0//Users/evashkevich/development/capi-ui-extension/node_modules/@rancher/shell/rancher-components/Form/Checkbox/Checkbox.vue?8f9e","webpack://capi-0.1.0/components/AutoImport.vue","webpack://capi-0.1.0/./components/AutoImport.vue?b5b6","webpack://capi-0.1.0/./components/AutoImport.vue?0296","webpack://capi-0.1.0//Users/evashkevich/development/capi-ui-extension/node_modules/@rancher/shell/rancher-components/Form/Checkbox/Checkbox.vue?3620"],"names":["___CSS_LOADER_API_IMPORT___","exports","push","module","i","render","_vm","this","_c","_self","_setupProxy","attrs","capiLabel","on","toggleCapiLabel","_v","_s","resource","staticRenderFns","staticClass","class","isDisabled","id","$event","type","indexOf","_k","keyCode","key","preventDefault","clicked","domProps","isChecked","valueWhenTrue","stopPropagation","indeterminate","label","value","$slots","labelKey","tooltipKey","tooltip","primary","_t","_e","directives","name","rawName","t","expression","descriptionKey","description","Vue","extend","props","Boolean","Array","String","default","Math","random","disabled","mode","_EDIT","Object","Number","computed","_VIEW","isMulti","findTrueValues","methods","event","target","tagName","href","customEvent","bubbles","cancelable","shiftKey","altKey","ctrlKey","metaKey","click","CustomEvent","cloneDeep","removeObject","addObject","$emit","isString","$el","dispatchEvent","isArray","find","v","component","components","Checkbox","required","e","$set","metadata","labels","LABELS","AUTO_IMPORT","_this$resource","content","__esModule","locals","add"],"mappings":"wKACA,IAAIA,EAA8B,EAAQ,QAC1CC,EAAUD,GAA4B,GAEtCC,EAAQC,KAAK,CAACC,EAAOC,EAAI,gtEAAmtE,KAE5uED,EAAOF,QAAUA,G,oCCNjB,W,2CCAA,IAAII,EAAS,WAAkB,I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C,WAAY,EAAM,YAAa","file":"capi-0.1.0.umd.min.2.js","sourcesContent":["// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../../@vue/cli-service/node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \".checkbox-outer-container{display:inline-flex;flex-direction:column}.checkbox-outer-container-description{color:var(--input-label);font-size:14px;margin-left:19px;margin-top:5px;opacity:.8}.checkbox-container{position:relative;display:inline-flex;align-items:center;margin:0;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;border-radius:var(--border-radius)}.checkbox-container .checkbox-label{color:var(--input-label);display:inline-flex;margin:0 10px 0 5px}.checkbox-container .checkbox-label.checkbox-primary{color:inherit;font-weight:600}.checkbox-container .checkbox-info{line-height:normal;margin-left:2px}.checkbox-container .checkbox-custom{height:14px;width:14px;background-color:var(--body-bg);border-radius:var(--border-radius);transition:all .3s ease-out;border:1px solid var(--border)}.checkbox-container input{opacity:0;position:absolute;z-index:-1}.checkbox-container input:checked~.checkbox-custom{background-color:var(--primary);transform:rotate(0deg) scale(1);opacity:1;border:1px solid var(--primary)}.checkbox-container .checkbox-custom:after{position:absolute;content:\\\"\\\";left:0;top:0;height:0;width:0;border-radius:var(--border-radius);border:solid;border-color:var(--input-text);border-width:0 3px 3px 0;transform:rotate(0deg) scale(0);opacity:1}.checkbox-container input:checked~.checkbox-custom:after{transform:rotate(45deg) scale(1);opacity:1;left:4px;width:4px;height:10px;border:solid;border-color:var(--checkbox-tick);border-width:0 2px 2px 0;background-color:transparent}.checkbox-container input:checked~.checkbox-custom.indeterminate:after{transform:scale(1);opacity:1;left:3px;top:2px;width:6px;height:5px;border:solid;border-color:var(--checkbox-tick);border-width:0 0 2px 0;background-color:transparent}.checkbox-container.disabled .checkbox-custom,.checkbox-container.disabled input:checked~.checkbox-custom{background-color:var(--checkbox-disabled-bg);border-color:var(--checkbox-disabled-bg)}.checkbox-container.disabled input:checked~.checkbox-custom:after{border-color:var(--checkbox-tick-disabled)}.checkbox-container.disabled{cursor:not-allowed}.checkbox-container .checkbox-view{display:flex;flex-direction:column}.checkbox-container .checkbox-view LABEL{color:var(--input-label)}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","export * from \"-!../../../../../vue-style-loader/index.js??ref--10-oneOf-1-0!../../../../../@vue/cli-service/node_modules/css-loader/dist/cjs.js??ref--10-oneOf-1-1!../../../../../@vue/cli-service/node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../../postcss-loader/src/index.js??ref--10-oneOf-1-2!../../../../../postcss-loader/src/index.js??ref--10-oneOf-1-3!../../../../../sass-loader/dist/cjs.js??ref--10-oneOf-1-4!../../../../../cache-loader/dist/cjs.js??ref--2-0!../../../../../@vue/cli-service/node_modules/vue-loader/lib/index.js??vue-loader-options!./Checkbox.vue?vue&type=style&index=0&id=1fdb6d7b&prod&lang=scss&\"","var render = function render(){var _vm=this,_c=_vm._self._c,_setup=_vm._self._setupProxy;return _c('div',[_c('Checkbox',{attrs:{\"value\":_vm.capiLabel,\"label-key\":\"capi.autoImport.checkbox.label\"},on:{\"input\":_vm.toggleCapiLabel}},[_c('br'),_vm._v(\" \"+_vm._s({..._vm.resource})+\" \")])],1)\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","var render = function render(){var _vm=this,_c=_vm._self._c,_setup=_vm._self._setupProxy;return _c('div',{staticClass:\"checkbox-outer-container\",attrs:{\"data-checkbox-ctrl\":\"\"}},[_c('label',{staticClass:\"checkbox-container\",class:{ 'disabled': _vm.isDisabled},attrs:{\"for\":_vm.id},on:{\"keydown\":[function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,\"enter\",13,$event.key,\"Enter\"))return null;$event.preventDefault();return _vm.clicked($event)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,\"space\",32,$event.key,[\" \",\"Spacebar\"]))return null;$event.preventDefault();return _vm.clicked($event)}],\"click\":function($event){return _vm.clicked($event)}}},[_c('input',{attrs:{\"type\":\"checkbox\",\"tabindex\":-1,\"name\":_vm.id},domProps:{\"checked\":_vm.isChecked,\"value\":_vm.valueWhenTrue},on:{\"click\":function($event){$event.stopPropagation();$event.preventDefault();}}}),_c('span',{staticClass:\"checkbox-custom\",class:{indeterminate: _vm.indeterminate},attrs:{\"tabindex\":_vm.isDisabled ? -1 : 0,\"aria-label\":_vm.label,\"aria-checked\":!!_vm.value,\"role\":\"checkbox\"}}),(_vm.$slots.label || _vm.label || _vm.labelKey || _vm.tooltipKey || _vm.tooltip)?_c('span',{staticClass:\"checkbox-label\",class:{ 'checkbox-primary': _vm.primary }},[_vm._t(\"label\",function(){return [(_vm.labelKey)?_c('t',{attrs:{\"k\":_vm.labelKey,\"raw\":true}}):(_vm.label)?[_vm._v(_vm._s(_vm.label))]:_vm._e(),(_vm.tooltipKey)?_c('i',{directives:[{name:\"clean-tooltip\",rawName:\"v-clean-tooltip\",value:(_vm.t(_vm.tooltipKey)),expression:\"t(tooltipKey)\"}],staticClass:\"checkbox-info icon icon-info icon-lg\"}):(_vm.tooltip)?_c('i',{directives:[{name:\"clean-tooltip\",rawName:\"v-clean-tooltip\",value:(_vm.tooltip),expression:\"tooltip\"}],staticClass:\"checkbox-info icon icon-info icon-lg\"}):_vm._e()]})],2):_vm._e()]),(_vm.descriptionKey || _vm.description)?_c('div',{staticClass:\"checkbox-outer-container-description\"},[(_vm.descriptionKey)?_c('t',{attrs:{\"k\":_vm.descriptionKey}}):(_vm.description)?[_vm._v(\" \"+_vm._s(_vm.description)+\" \")]:_vm._e()],2):_vm._e()])\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\nimport Vue, { PropType } from 'vue';\nimport { _EDIT, _VIEW } from '@shell/config/query-params';\nimport { addObject, removeObject } from '@shell/utils/array';\nimport cloneDeep from 'lodash/cloneDeep';\n\nexport default Vue.extend({\n name: 'Checkbox',\n\n props: {\n /**\n * The checkbox value.\n */\n value: {\n type: [Boolean, Array, String] as PropType,\n default: false\n },\n\n /**\n * The checkbox label.\n */\n label: {\n type: String,\n default: null\n },\n\n /**\n * The i18n key to use for the checkbox label.\n */\n labelKey: {\n type: String,\n default: null\n },\n\n /**\n * Random ID generated for binding label to input.\n */\n id: {\n type: String,\n default: String(Math.random() * 1000)\n },\n\n /**\n * Disable the checkbox.\n */\n disabled: {\n type: Boolean,\n default: false\n },\n\n /**\n * Display an indeterminate state. Useful for cases where a checkbox might\n * be the parent to child checkboxes, and we need to show that a subset of\n * children are checked.\n */\n indeterminate: {\n type: Boolean,\n default: false\n },\n\n /**\n * The checkbox editing mode.\n * @values _EDIT, _VIEW\n */\n mode: {\n type: String,\n default: _EDIT\n },\n\n /**\n * The contents of the checkbox tooltip.\n */\n tooltip: {\n type: [String, Object],\n default: null\n },\n\n /**\n * The i18n key to use for the checkbox tooltip.\n */\n tooltipKey: {\n type: String,\n default: null\n },\n\n /**\n * A custom value to use when the checkbox is checked.\n */\n valueWhenTrue: {\n type: [Boolean, String, Number],\n default: true\n },\n\n /**\n * The i18n key to use for the checkbox description.\n */\n descriptionKey: {\n type: String,\n default: null\n },\n\n /**\n * The checkbox description.\n */\n description: {\n type: String,\n default: null\n },\n\n /**\n * Primary checkbox displays label so that it stands out more\n */\n primary: {\n type: Boolean,\n default: false\n },\n },\n\n computed: {\n /**\n * Determines if the checkbox is disabled.\n * @returns boolean: True when the disabled prop is true or when mode is\n * View.\n */\n isDisabled(): boolean {\n return (this.disabled || this.mode === _VIEW);\n },\n /**\n * Determines if the checkbox is checked when using custom values or\n * multiple values.\n * @returns boolean: True when at least one value is true in a collection or\n * when value matches `this.valueWhenTrue`.\n */\n isChecked(): boolean {\n return this.isMulti(this.value) ? this.findTrueValues(this.value) : this.value === this.valueWhenTrue;\n }\n },\n\n methods: {\n /**\n * Toggles the checked state for the checkbox and emits an 'input' event.\n */\n clicked(event: MouseEvent): boolean | void {\n if ((event.target as HTMLLinkElement).tagName === 'A' && (event.target as HTMLLinkElement).href) {\n // Ignore links inside the checkbox label so you can click them\n return true;\n }\n\n event.stopPropagation();\n event.preventDefault();\n\n if (this.isDisabled) {\n return;\n }\n\n const customEvent = {\n bubbles: true,\n cancelable: false,\n shiftKey: event.shiftKey,\n altKey: event.altKey,\n ctrlKey: event.ctrlKey,\n metaKey: event.metaKey\n };\n\n const click = new CustomEvent('click', customEvent);\n\n // Flip the value\n const value = cloneDeep(this.value);\n\n if (this.isMulti(value)) {\n if (this.isChecked) {\n removeObject(value, this.valueWhenTrue);\n } else {\n addObject(value, this.valueWhenTrue);\n }\n this.$emit('input', value);\n } else if (this.isString(this.valueWhenTrue)) {\n if (this.isChecked) {\n this.$emit('input', null);\n } else {\n this.$emit('input', this.valueWhenTrue);\n }\n } else {\n this.$emit('input', !value);\n this.$el.dispatchEvent(click);\n }\n },\n\n /**\n * Determines if there are multiple values for the checkbox.\n */\n isMulti(value: boolean | boolean[] | string): value is boolean[] {\n return Array.isArray(value);\n },\n\n isString(value: boolean | number | string): value is boolean {\n return typeof value === 'string';\n },\n\n /**\n * Finds the first true value for multiple checkboxes.\n * @param value A collection of values for the checkbox.\n */\n findTrueValues(value: boolean[]): boolean {\n return value.find((v) => v === this.valueWhenTrue) || false;\n }\n }\n});\n","import mod from \"-!../../../../../cache-loader/dist/cjs.js??ref--15-0!../../../../../thread-loader/dist/cjs.js!../../../../../babel-loader/lib/index.js!../../../../../ts-loader/index.js??ref--15-3!../../../../../cache-loader/dist/cjs.js??ref--2-0!../../../../../@vue/cli-service/node_modules/vue-loader/lib/index.js??vue-loader-options!./Checkbox.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../../../cache-loader/dist/cjs.js??ref--15-0!../../../../../thread-loader/dist/cjs.js!../../../../../babel-loader/lib/index.js!../../../../../ts-loader/index.js??ref--15-3!../../../../../cache-loader/dist/cjs.js??ref--2-0!../../../../../@vue/cli-service/node_modules/vue-loader/lib/index.js??vue-loader-options!./Checkbox.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./Checkbox.vue?vue&type=template&id=1fdb6d7b&\"\nimport script from \"./Checkbox.vue?vue&type=script&lang=ts&\"\nexport * from \"./Checkbox.vue?vue&type=script&lang=ts&\"\nimport style0 from \"./Checkbox.vue?vue&type=style&index=0&id=1fdb6d7b&prod&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../../@vue/cli-service/node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","\n\n\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--2-0!../../../node_modules/@vue/cli-service/node_modules/vue-loader/lib/index.js??vue-loader-options!./AutoImport.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--2-0!../../../node_modules/@vue/cli-service/node_modules/vue-loader/lib/index.js??vue-loader-options!./AutoImport.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./AutoImport.vue?vue&type=template&id=ea5d47f6&\"\nimport script from \"./AutoImport.vue?vue&type=script&lang=js&\"\nexport * from \"./AutoImport.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/@vue/cli-service/node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","// style-loader: Adds some css to the DOM by adding a \n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--2-0!../../../node_modules/@vue/cli-service/node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--2-0!../../../node_modules/@vue/cli-service/node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=337ae8b8&scoped=true&\"\nimport script from \"./index.vue?vue&type=script&lang=js&\"\nexport * from \"./index.vue?vue&type=script&lang=js&\"\nimport style0 from \"./index.vue?vue&type=style&index=0&id=337ae8b8&prod&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/@vue/cli-service/node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"337ae8b8\",\n null\n \n)\n\nexport default component.exports","import Dashboard from '../pages/index.vue';\n\nconst routes = [\n {\n name: 'c-cluster-manager-capi',\n path: '/c/:cluster/manager/capi',\n component: Dashboard,\n },\n];\n\nexport default routes;\n","import { LABELS } from '../types/capi';\n\nexport default function(resource: any) {\n if (resource?.metadata?.labels?.[LABELS.AUTO_IMPORT] === 'true') {\n delete resource.metadata.labels[LABELS.AUTO_IMPORT];\n } else {\n resource.metadata.labels[LABELS.AUTO_IMPORT] = 'true';\n }\n try {\n resource.save();\n } catch (err) {\n const title = resource.t('resource.errors.update', { name: resource.name });\n\n resource.$dispatch('growl/error', {\n title, message: err, timeout: 5000\n }, { root: true });\n }\n}\n","import { importTypes } from '@rancher/auto-import';\nimport {\n ActionLocation, IPlugin, PanelLocation, TableColumnLocation, TabLocation\n} from '@shell/core/types';\nimport { _CLONE, _CREATE, _EDIT } from '@shell/config/query-params';\nimport { LABELS } from './types/capi';\nimport capiRouting from './routes/capi-routing';\nimport toggleAutoImport from './util/auto-import';\n\n// Init the package\nexport default function(plugin: IPlugin): void {\n // Auto-import model, detail, edit from the folders\n importTypes(plugin);\n\n // Provide plugin metadata from package.json\n plugin.metadata = require('./package.json');\n\n plugin.addProduct(require('./config/capi'));\n\n // Add Vue Routes\n plugin.addRoutes(capiRouting);\n\n // add tab to namespace edit\n plugin.addTab(\n TabLocation.RESOURCE_DETAIL,\n {\n resource: ['namespace'],\n cluster: ['local'],\n mode: [_CREATE, _CLONE, _EDIT, 'config']\n },\n {\n name: 'capi-auto-import',\n labelKey: 'capi.autoImport.label',\n weight: -5,\n showHeader: true,\n component: () => import('./components/AutoImport.vue')\n }\n );\n\n // add enable auto-import action to namespace table\n plugin.addAction(ActionLocation.TABLE,\n { path: [{ urlPath: '/c/local/explorer/projectsnamespaces', exact: true }, { urlPath: 'cluster.x-k8s.io.cluster', endsWith: true }] },\n {\n labelKey: 'capi.autoImport.enableAction',\n icon: 'icon-plus',\n enabled(target: any) {\n return target.metadata.labels[LABELS.AUTO_IMPORT] !== 'true';\n },\n invoke(opts, resources = []) {\n resources.forEach((ns) => {\n toggleAutoImport(ns);\n });\n }\n });\n\n // add disable auto-import action to namespace table\n plugin.addAction(ActionLocation.TABLE,\n { path: [{ urlPath: '/c/local/explorer/projectsnamespaces', exact: true }, { urlPath: 'cluster.x-k8s.io.cluster', endsWith: true }] },\n {\n labelKey: 'capi.autoImport.disableAction',\n icon: 'icon-minus',\n enabled(target: any) {\n return target.metadata.labels[LABELS.AUTO_IMPORT] === 'true';\n },\n invoke(opts, resources = []) {\n resources.forEach((ns) => {\n toggleAutoImport(ns);\n });\n }\n });\n\n // add column to namespace table\n plugin.addTableColumn(\n TableColumnLocation.RESOURCE,\n { path: [{ urlPath: '/c/local/explorer/projectsnamespaces', exact: true }] },\n {\n name: 'capi-auto-import',\n labelKey: 'capi.autoImport.label',\n getValue: (row: any) => {\n return row.labels[LABELS.AUTO_IMPORT] === 'true';\n },\n width: 100,\n formatter: 'AutoImportState'\n }\n );\n\n // add warning to cluster mgmt resource list\n plugin.addPanel(PanelLocation.RESOURCE_LIST,\n { resource: ['provisioning.cattle.io.cluster'] },\n { component: () => import('./components/ClusterListBanner.vue') }\n );\n}\n","import './setPublicPath'\nimport mod from '~entry'\nexport default mod\nexport * from '~entry'\n","var ListCache = require('./_ListCache'),\n stackClear = require('./_stackClear'),\n stackDelete = require('./_stackDelete'),\n stackGet = require('./_stackGet'),\n stackHas = require('./_stackHas'),\n stackSet = require('./_stackSet');\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\nmodule.exports = Stack;\n","export * from \"-!../../../node_modules/vue-style-loader/index.js??ref--10-oneOf-1-0!../../../node_modules/@vue/cli-service/node_modules/css-loader/dist/cjs.js??ref--10-oneOf-1-1!../../../node_modules/@vue/cli-service/node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-2!../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-3!../../../node_modules/sass-loader/dist/cjs.js??ref--10-oneOf-1-4!../../../node_modules/cache-loader/dist/cjs.js??ref--2-0!../../../node_modules/@vue/cli-service/node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=style&index=0&id=337ae8b8&prod&lang=scss&scoped=true&\"","/**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n}\n\nmodule.exports = arrayMap;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Promise = getNative(root, 'Promise');\n\nmodule.exports = Promise;\n","var MapCache = require('./_MapCache'),\n setCacheAdd = require('./_setCacheAdd'),\n setCacheHas = require('./_setCacheHas');\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\nmodule.exports = SetCache;\n","var isKeyable = require('./_isKeyable');\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\nmodule.exports = getMapData;\n","/**\n * The base implementation of `_.hasIn` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\nfunction baseHasIn(object, key) {\n return object != null && key in Object(object);\n}\n\nmodule.exports = baseHasIn;\n","var Symbol = require('./_Symbol'),\n arrayMap = require('./_arrayMap'),\n isArray = require('./isArray'),\n isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isArray(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return arrayMap(value, baseToString) + '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nmodule.exports = baseToString;\n","var baseIsEqual = require('./_baseIsEqual'),\n get = require('./get'),\n hasIn = require('./hasIn'),\n isKey = require('./_isKey'),\n isStrictComparable = require('./_isStrictComparable'),\n matchesStrictComparable = require('./_matchesStrictComparable'),\n toKey = require('./_toKey');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.\n *\n * @private\n * @param {string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatchesProperty(path, srcValue) {\n if (isKey(path) && isStrictComparable(srcValue)) {\n return matchesStrictComparable(toKey(path), srcValue);\n }\n return function(object) {\n var objValue = get(object, path);\n return (objValue === undefined && objValue === srcValue)\n ? hasIn(object, path)\n : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);\n };\n}\n\nmodule.exports = baseMatchesProperty;\n","var Symbol = require('./_Symbol');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n","export function camelToTitle(str) {\n return dasherize((str || '')).split('-').map((str) => {\n return ucFirst(str);\n }).join(' ');\n}\n\nexport function ucFirst(str) {\n str = str || '';\n\n return str.substr(0, 1).toUpperCase() + str.substr(1);\n}\n\nexport function lcFirst(str) {\n str = str || '';\n\n return str.substr(0, 1).toLowerCase() + str.substr(1);\n}\n\nexport function strPad(str, toLength, padChars = ' ', right = false) {\n str = `${ str }`;\n\n if (str.length >= toLength) {\n return str;\n }\n\n const neededLen = toLength - str.length + 1;\n const padStr = (new Array(neededLen)).join(padChars).substr(0, neededLen);\n\n if (right) {\n return str + padStr;\n } else {\n return padStr + str;\n }\n}\n\n// Turn thing1 into thing00000001 so that the numbers sort numerically\nexport function sortableNumericSuffix(str) {\n str = str || '';\n const match = str.match(/^(.*[^0-9])([0-9]+)$/);\n\n if (match) {\n return match[1] + strPad(match[2], 8, '0');\n }\n\n return str;\n}\n\nconst entityMap = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": ''',\n '/': '/'\n};\n\nexport function escapeHtml(html) {\n return String(html).replace(/[&<>\"']/g, (s) => {\n return entityMap[s];\n });\n}\n\n/**\n * Return HTML markup from escaped HTML string, allowing specific tags\n * @param text string\n * @returns string\n */\nexport function decodeHtml(text) {\n const div = document.createElement('div');\n\n div.innerHTML = text;\n\n return div.textContent || div.innerText || '';\n}\n\nexport function escapeRegex(string) {\n return string.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'); // $& means the whole matched string\n}\n\nexport function random32(count) {\n count = Math.max(0, count || 1);\n\n const out = [];\n let i;\n\n if (window.crypto && window.crypto.getRandomValues) {\n const tmp = new Uint32Array(count);\n\n window.crypto.getRandomValues(tmp);\n for (i = 0; i < tmp.length; i++) {\n out[i] = tmp[i];\n }\n } else {\n for (i = 0; i < count; i++) {\n out[i] = Math.random() * 4294967296; // Math.pow(2,32);\n }\n }\n\n if (count === 1) {\n return out[0];\n } else {\n return out;\n }\n}\n\nconst alpha = 'abcdefghijklmnopqrstuvwxyz';\nconst num = '0123456789';\nconst sym = '!@#$%^&*()_+-=[]{};:,./<>?|';\n\nexport const CHARSET = {\n NUMERIC: num,\n NO_VOWELS: 'bcdfghjklmnpqrstvwxz2456789',\n ALPHA: alpha + alpha.toUpperCase(),\n ALPHA_NUM: alpha + alpha.toUpperCase() + num,\n ALPHA_LOWER: alpha,\n ALPHA_UPPER: alpha.toUpperCase(),\n HEX: `${ num }ABCDEF`,\n PASSWORD: alpha + alpha.toUpperCase() + num + alpha + alpha.toUpperCase() + num + sym,\n // ^-- includes alpha / ALPHA / num twice to reduce the occurrence of symbols\n};\n\nexport function randomStr(length = 16, chars = CHARSET.ALPHA_NUM) {\n if (!chars || !chars.length) {\n return null;\n }\n\n return random32(length).map((val) => {\n return chars[val % chars.length];\n }).join('');\n}\n\nexport function formatPercent(value, maxPrecision = 2) {\n if (value < 1 && maxPrecision >= 2) {\n return `${ Math.round(value * 100) / 100 }%`;\n } else if (value < 10 && maxPrecision >= 1) {\n return `${ Math.round(value * 10) / 10 }%`;\n } else {\n return `${ Math.round(value) }%`;\n }\n}\n\nexport function pluralize(str) {\n if ( str.match(/.*[^aeiou]y$/i) ) {\n return `${ str.substr(0, str.length - 1) }ies`;\n } else if ( str.endsWith('ics') ) {\n return str;\n } else if ( str.endsWith('s') ) {\n return `${ str }es`;\n } else {\n return `${ str }s`;\n }\n}\n\nexport function resourceNames(names, plusMore, t) {\n return names.reduce((res, name, i) => {\n if (i >= 5) {\n return res;\n }\n res += `${ escapeHtml( name ) }`;\n if (i === names.length - 1) {\n res += plusMore;\n } else {\n res += i === names.length - 2 ? t('generic.and') : t('generic.comma');\n }\n\n return res;\n }, '');\n}\n\nexport function indent(lines, count = 2, token = ' ', afterRegex = null) {\n if (typeof lines === 'string') {\n lines = lines.split(/\\n/);\n } else {\n lines = lines || [];\n }\n\n const padStr = (new Array(count + 1)).join(token);\n\n const out = lines.map((line) => {\n let prefix = '';\n let suffix = line;\n\n if (afterRegex) {\n const match = line.match(afterRegex);\n\n if (match) {\n prefix = match[match.length - 1];\n suffix = line.substr(match[0].length);\n }\n }\n\n return `${ prefix }${ padStr }${ suffix }`;\n });\n\n const str = out.join('\\n');\n\n return str;\n}\n\nconst decamelizeRegex = /([a-z\\d])([A-Z])/g;\n\nexport function decamelize(str) {\n return str.replace(decamelizeRegex, '$1_$2').toLowerCase();\n}\n\nconst dasherizeRegex = /[ _]/g;\n\nexport function dasherize(str) {\n return decamelize(str).replace(dasherizeRegex, '-');\n}\n\nexport function asciiLike(str) {\n str = str || '';\n\n if ( str.match(/[^\\r\\n\\t\\x20-\\x7F]/) ) {\n return false;\n }\n\n return true;\n}\n\nexport function coerceStringTypeToScalarType(val, type) {\n if ( type === 'float' ) {\n // Coerce strings to floats\n val = parseFloat(val) || null; // NaN becomes null\n } else if ( type === 'int' ) {\n // Coerce strings to ints\n val = parseInt(val, 10);\n\n if ( isNaN(val) ) {\n val = null;\n }\n } else if ( type === 'boolean') {\n // Coerce strings to boolean\n if (val.toLowerCase() === 'true') {\n val = true;\n } else if (val.toLowerCase() === 'false') {\n val = false;\n }\n }\n\n return val;\n}\n\nexport function matchesSomeRegex(stringRaw, regexes = []) {\n return regexes.some((regexRaw) => {\n const string = stringRaw || '';\n const regex = ensureRegex(regexRaw);\n\n return string.match(regex);\n });\n}\n\nexport function ensureRegex(strOrRegex, exact = true) {\n if ( typeof strOrRegex === 'string' ) {\n if ( exact ) {\n return new RegExp(`^${ escapeRegex(strOrRegex) }$`, 'i');\n } else {\n return new RegExp(`${ escapeRegex(strOrRegex) }`, 'i');\n }\n }\n\n return strOrRegex;\n}\n\nexport function nlToBr(value) {\n return escapeHtml(value || '').replace(/(\\r\\n|\\r|\\n)/g, '
\\n');\n}\n\nconst quotedMatch = /[^.\"']+|\"([^\"]*)\"|'([^']*)'/g;\n\nexport function splitObjectPath(path) {\n if ( path.includes('\"') || path.includes(\"'\") ) {\n // Path with quoted section\n return path.match(quotedMatch).map((x) => x.replace(/['\"]/g, ''));\n }\n\n // Regular path\n return path.split('.');\n}\n\nexport function joinObjectPath(ary) {\n let out = '';\n\n for ( const p of ary ) {\n if ( p.includes('.') ) {\n out += `.\"${ p }\"`;\n } else {\n out += `.${ p }`;\n }\n }\n\n if ( out.startsWith('.') ) {\n out = out.substr(1);\n }\n\n return out;\n}\n\nexport function shortenedImage(image) {\n return (image || '')\n .replace(/^(index\\.)?docker.io\\/(library\\/)?/, '')\n .replace(/:latest$/, '')\n .replace(/^(.*@sha256:)([0-9a-f]{8})[0-9a-f]+$/i, '$1$2…');\n}\n\nexport function isIpv4(ip) {\n const reg = /^((25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}(25[0-5]|2[0-4]\\d|[01]?\\d\\d?)$/;\n\n return reg.test(ip);\n}\n\nexport function sanitizeKey(k) {\n return (k || '').replace(/[^a-z0-9./_-]/ig, '');\n}\n\nexport function sanitizeValue(v) {\n return (v || '').replace(/[^a-z0-9._-]/ig, '');\n}\n\nexport function sanitizeIP(v) {\n return (v || '').replace(/[^a-z0-9.:_-]/ig, '');\n}\n","/**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n}\n\nmodule.exports = arrayEach;\n","var assignValue = require('./_assignValue'),\n baseAssignValue = require('./_baseAssignValue');\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n}\n\nmodule.exports = copyObject;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\nmodule.exports = listCacheSet;\n","/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\nmodule.exports = stackHas;\n","var baseHasIn = require('./_baseHasIn'),\n hasPath = require('./_hasPath');\n\n/**\n * Checks if `path` is a direct or inherited property of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.hasIn(object, 'a');\n * // => true\n *\n * _.hasIn(object, 'a.b');\n * // => true\n *\n * _.hasIn(object, ['a', 'b']);\n * // => true\n *\n * _.hasIn(object, 'b');\n * // => false\n */\nfunction hasIn(object, path) {\n return object != null && hasPath(object, path, baseHasIn);\n}\n\nmodule.exports = hasIn;\n","var baseIsEqualDeep = require('./_baseIsEqualDeep'),\n isObjectLike = require('./isObjectLike');\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n}\n\nmodule.exports = baseIsEqual;\n","var baseIsMap = require('./_baseIsMap'),\n baseUnary = require('./_baseUnary'),\n nodeUtil = require('./_nodeUtil');\n\n/* Node.js helper references. */\nvar nodeIsMap = nodeUtil && nodeUtil.isMap;\n\n/**\n * Checks if `value` is classified as a `Map` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n * @example\n *\n * _.isMap(new Map);\n * // => true\n *\n * _.isMap(new WeakMap);\n * // => false\n */\nvar isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;\n\nmodule.exports = isMap;\n","var isArrayLike = require('./isArrayLike'),\n isObjectLike = require('./isObjectLike');\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\nmodule.exports = isArrayLikeObject;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Set = getNative(root, 'Set');\n\nmodule.exports = Set;\n","var baseIndexOf = require('./_baseIndexOf');\n\n/**\n * A specialized version of `_.includes` for arrays without support for\n * specifying an index to search from.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\nfunction arrayIncludes(array, value) {\n var length = array == null ? 0 : array.length;\n return !!length && baseIndexOf(array, value, 0) > -1;\n}\n\nmodule.exports = arrayIncludes;\n","var overArg = require('./_overArg');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\nmodule.exports = nativeKeys;\n","var getNative = require('./_getNative');\n\nvar defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n}());\n\nmodule.exports = defineProperty;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView');\n\nmodule.exports = DataView;\n","var nativeCreate = require('./_nativeCreate');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\nmodule.exports = hashHas;\n","// style-loader: Adds some css to the DOM by adding a