@platforma-sdk/ui-vue 1.42.24 → 1.42.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/.turbo/turbo-build.log +12 -12
  2. package/.turbo/turbo-type-check.log +1 -1
  3. package/CHANGELOG.md +13 -0
  4. package/dist/plugins/Monetization/LimitCard.vue2.js +59 -46
  5. package/dist/plugins/Monetization/LimitCard.vue2.js.map +1 -1
  6. package/dist/plugins/Monetization/LimitCard.vue3.js +21 -17
  7. package/dist/plugins/Monetization/LimitCard.vue3.js.map +1 -1
  8. package/dist/plugins/Monetization/MonetizationSidebar.vue.js +39 -39
  9. package/dist/plugins/Monetization/MonetizationSidebar.vue.js.map +1 -1
  10. package/dist/plugins/Monetization/RunStatus.vue.d.ts +1 -0
  11. package/dist/plugins/Monetization/RunStatus.vue2.js +17 -20
  12. package/dist/plugins/Monetization/RunStatus.vue2.js.map +1 -1
  13. package/dist/plugins/Monetization/RunStatus.vue3.js +15 -13
  14. package/dist/plugins/Monetization/RunStatus.vue3.js.map +1 -1
  15. package/dist/plugins/Monetization/UserCabinetCard.vue.d.ts +1 -0
  16. package/dist/plugins/Monetization/UserCabinetCard.vue2.js +42 -34
  17. package/dist/plugins/Monetization/UserCabinetCard.vue2.js.map +1 -1
  18. package/dist/plugins/Monetization/UserCabinetCard.vue3.js +17 -15
  19. package/dist/plugins/Monetization/UserCabinetCard.vue3.js.map +1 -1
  20. package/dist/plugins/Monetization/useInfo.js +5 -5
  21. package/dist/plugins/Monetization/useInfo.js.map +1 -1
  22. package/package.json +7 -7
  23. package/src/plugins/Monetization/LimitCard.vue +94 -40
  24. package/src/plugins/Monetization/MonetizationSidebar.vue +3 -5
  25. package/src/plugins/Monetization/RunStatus.vue +11 -15
  26. package/src/plugins/Monetization/UserCabinetCard.vue +23 -1
  27. package/src/plugins/Monetization/useInfo.ts +1 -1
@@ -1,10 +1,10 @@
1
1
   WARN  Issue while reading "/home/runner/_work/platforma/platforma/.npmrc". Failed to replace env in config: ${NPMJS_TOKEN}
2
2
 
3
- > @platforma-sdk/ui-vue@1.42.24 build /home/runner/_work/platforma/platforma/sdk/ui-vue
3
+ > @platforma-sdk/ui-vue@1.42.34 build /home/runner/_work/platforma/platforma/sdk/ui-vue
4
4
  > ts-builder build --target browser-lib
5
5
 
6
6
  Building browser-lib project...
7
- ↳ vite.js build --config configs/vite.browser-lib.config.js --mode production
7
+ ↳ vite.js build --config /configs/vite.browser-lib.config.js --mode production
8
8
  vite v6.3.5 building for production...
9
9
  transforming...
10
10
  ✓ 238 modules transformed.
@@ -144,35 +144,34 @@ computing gzip size...
144
144
  dist/node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/coerce.js  1.18 kB │ gzip: 0.58 kB │ map: 3.54 kB
145
145
  dist/node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/min-version.js  1.20 kB │ gzip: 0.57 kB │ map: 2.88 kB
146
146
  dist/components/PlMultiSequenceAlignment/multi-sequence-alignment.js  1.23 kB │ gzip: 0.70 kB │ map: 4.70 kB
147
- dist/plugins/Monetization/UserCabinetCard.vue3.js  1.24 kB │ gzip: 0.66 kB │ map: 0.11 kB
147
+ dist/plugins/Monetization/RunStatus.vue2.js  1.27 kB │ gzip: 0.59 kB │ map: 2.46 kB
148
148
  dist/components/PlAgDataTable/PlAgOverlayLoading.vue.js  1.30 kB │ gzip: 0.66 kB │ map: 1.40 kB
149
- dist/plugins/Monetization/RunStatus.vue2.js  1.32 kB │ gzip: 0.61 kB │ map: 2.66 kB
150
149
  dist/createModel.js  1.39 kB │ gzip: 0.65 kB │ map: 3.91 kB
151
150
  dist/components/PlAgDataTable/types.js  1.40 kB │ gzip: 0.56 kB │ map: 9.46 kB
152
151
  dist/utils.js  1.51 kB │ gzip: 0.69 kB │ map: 3.53 kB
153
152
  dist/node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/outside.js  1.55 kB │ gzip: 0.65 kB │ map: 3.99 kB
153
+ dist/plugins/Monetization/UserCabinetCard.vue3.js  1.55 kB │ gzip: 0.77 kB │ map: 0.11 kB
154
154
  dist/components/PlAgDataTable/sources/focus-row.js  1.57 kB │ gzip: 0.75 kB │ map: 2.65 kB
155
155
  dist/components/PlAgCsvExporter/export-csv.js  1.60 kB │ gzip: 0.73 kB │ map: 3.72 kB
156
156
  dist/AgGridVue/createAgGridColDef.js  1.61 kB │ gzip: 0.72 kB │ map: 9.40 kB
157
- dist/plugins/Monetization/RunStatus.vue3.js  1.63 kB │ gzip: 0.77 kB │ map: 0.11 kB
158
157
  dist/aggrid.js  1.65 kB │ gzip: 0.79 kB │ map: 3.09 kB
159
158
  dist/internal/createAppModel.js  1.73 kB │ gzip: 0.77 kB │ map: 4.81 kB
159
+ dist/plugins/Monetization/RunStatus.vue3.js  1.79 kB │ gzip: 0.82 kB │ map: 0.11 kB
160
160
  dist/internal/UpdateSerializer.js  1.86 kB │ gzip: 0.80 kB │ map: 4.63 kB
161
161
  dist/components/PlMultiSequenceAlignment/markup.js  1.99 kB │ gzip: 1.02 kB │ map: 6.53 kB
162
- dist/plugins/Monetization/UserCabinetCard.vue2.js  2.11 kB │ gzip: 0.88 kB │ map: 3.01 kB
163
162
  dist/defineApp.js  2.15 kB │ gzip: 0.96 kB │ map: 9.58 kB
164
- dist/plugins/Monetization/useInfo.js  2.19 kB │ gzip: 0.81 kB │ map: 4.33 kB
163
+ dist/plugins/Monetization/useInfo.js  2.18 kB │ gzip: 0.80 kB │ map: 4.32 kB
165
164
  dist/components/PlAgTextAndButtonCell/PlAgTextAndButtonCell.vue.js  2.20 kB │ gzip: 1.05 kB │ map: 2.83 kB
166
165
  dist/components/PlAnnotations/components/PlAnnotationCreateDialog.vue.js  2.35 kB │ gzip: 0.96 kB │ map: 2.64 kB
167
- dist/plugins/Monetization/LimitCard.vue3.js  2.55 kB │ gzip: 0.92 kB │ map: 0.11 kB
166
+ dist/plugins/Monetization/UserCabinetCard.vue2.js  2.36 kB │ gzip: 0.95 kB │ map: 3.49 kB
168
167
  dist/components/PlAgDataTable/PlAgDataTableSheets.vue2.js  2.57 kB │ gzip: 1.16 kB │ map: 5.30 kB
169
168
  dist/components/PlTableFilters/PlTableFiltersV2.vue3.js  2.58 kB │ gzip: 0.94 kB │ map: 0.12 kB
170
169
  dist/components/PlTableFilters/filters-state.js  2.60 kB │ gzip: 1.08 kB │ map: 7.95 kB
171
- dist/plugins/Monetization/LimitCard.vue2.js  2.61 kB │ gzip: 0.88 kB │ map: 4.83 kB
172
170
  dist/node_modules/.pnpm/semver@7.7.2/node_modules/semver/classes/comparator.js  2.65 kB │ gzip: 0.94 kB │ map: 6.36 kB
173
171
  dist/components/PlMultiSequenceAlignment/MultiSequenceAlignmentView.vue3.js  2.71 kB │ gzip: 1.14 kB │ map: 0.13 kB
174
172
  dist/node_modules/.pnpm/fast-json-patch@3.1.1/node_modules/fast-json-patch/module/helpers.js  2.79 kB │ gzip: 1.21 kB │ map: 8.92 kB
175
173
  dist/components/PlAgDataTable/sources/row-number.js  3.10 kB │ gzip: 1.34 kB │ map: 8.36 kB
174
+ dist/plugins/Monetization/LimitCard.vue3.js  3.10 kB │ gzip: 1.09 kB │ map: 0.11 kB
176
175
  dist/components/PlMultiSequenceAlignment/SeqLogo.vue.js  3.11 kB │ gzip: 1.26 kB │ map: 6.04 kB
177
176
  dist/composition/fileContent.js  3.15 kB │ gzip: 1.17 kB │ map: 9.49 kB
178
177
  dist/components/PlTableFilters/PlTableAddFilterV2.vue.js  3.16 kB │ gzip: 1.27 kB │ map: 3.95 kB
@@ -186,11 +185,12 @@ computing gzip size...
186
185
  dist/components/PlMultiSequenceAlignment/MultiSequenceAlignmentView.vue2.js  3.56 kB │ gzip: 1.19 kB │ map: 5.67 kB
187
186
  dist/node_modules/.pnpm/semver@7.7.2/node_modules/semver/index.js  3.67 kB │ gzip: 1.01 kB │ map: 5.45 kB
188
187
  dist/components/PlAgGridColumnManager/PlAgGridColumnManager.vue2.js  3.84 kB │ gzip: 1.52 kB │ map: 4.99 kB
188
+ dist/plugins/Monetization/LimitCard.vue2.js  3.84 kB │ gzip: 1.15 kB │ map: 7.17 kB
189
189
  dist/components/PlAnnotations/components/PlAnnotationsModal.vue2.js  3.89 kB │ gzip: 1.38 kB │ map: 5.48 kB
190
190
  dist/node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/re.js  4.03 kB │ gzip: 1.23 kB │ map: 12.92 kB
191
191
  dist/components/PlAnnotations/components/FilterSidebar.vue2.js  4.50 kB │ gzip: 1.67 kB │ map: 5.97 kB
192
192
  dist/components/PlAnnotations/components/DynamicForm.vue2.js  4.52 kB │ gzip: 1.41 kB │ map: 6.96 kB
193
- dist/plugins/Monetization/MonetizationSidebar.vue.js  4.73 kB │ gzip: 1.76 kB │ map: 5.01 kB
193
+ dist/plugins/Monetization/MonetizationSidebar.vue.js  4.70 kB │ gzip: 1.74 kB │ map: 4.91 kB
194
194
  dist/components/PlMultiSequenceAlignment/chemical-properties.js  4.75 kB │ gzip: 1.67 kB │ map: 11.78 kB
195
195
  dist/components/BlockLayout.vue2.js  4.96 kB │ gzip: 1.83 kB │ map: 2.96 kB
196
196
  dist/components/PlAnnotations/components/FilterSidebar.vue3.js  5.48 kB │ gzip: 1.59 kB │ map: 0.11 kB
@@ -215,7 +215,7 @@ computing gzip size...
215
215
  dist/components/PlAgRowNumHeader.vue.js 44.65 kB │ gzip: 29.29 kB │ map: 3.70 kB
216
216
  dist/AgGridVue/useAgGridOptions.js 49.29 kB │ gzip: 30.15 kB │ map: 16.35 kB
217
217
  dist/components/PlAgDataTable/PlAgDataTableV2.vue2.js 50.33 kB │ gzip: 31.04 kB │ map: 33.70 kB
218
- [vite:dts] Declaration files built in 8654ms.
218
+ [vite:dts] Declaration files built in 9971ms.
219
219
 
220
- ✓ built in 10.58s
220
+ ✓ built in 11.87s
221
221
  Build completed successfully
@@ -1,6 +1,6 @@
1
1
   WARN  Issue while reading "/home/runner/_work/platforma/platforma/.npmrc". Failed to replace env in config: ${NPMJS_TOKEN}
2
2
 
3
- > @platforma-sdk/ui-vue@1.42.24 type-check /home/runner/_work/platforma/platforma/sdk/ui-vue
3
+ > @platforma-sdk/ui-vue@1.42.34 type-check /home/runner/_work/platforma/platforma/sdk/ui-vue
4
4
  > ts-builder types --target browser-lib
5
5
 
6
6
  ↳ vue-tsc.js --noEmit --project ./tsconfig.json
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @platforma-sdk/ui-vue
2
2
 
3
+ ## 1.42.34
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [e8f0e58]
8
+ - @milaboratories/uikit@2.4.6
9
+
10
+ ## 1.42.26
11
+
12
+ ### Patch Changes
13
+
14
+ - 5714f79: Fix Monetization sidebar appearance
15
+
3
16
  ## 1.42.24
4
17
 
5
18
  ### Patch Changes
@@ -1,5 +1,5 @@
1
- import { defineComponent as g, computed as i, createElementBlock as u, openBlock as d, normalizeClass as n, createElementVNode as l, toDisplayString as t, createTextVNode as o, normalizeStyle as p } from "vue";
2
- const S = { key: 0 }, B = { key: 1 }, c = /* @__PURE__ */ g({
1
+ import { defineComponent as w, computed as i, createElementBlock as u, openBlock as r, normalizeClass as t, createElementVNode as n, toDisplayString as o, createTextVNode as y, createCommentVNode as p, normalizeStyle as b } from "vue";
2
+ const F = { key: 0 }, N = { key: 1 }, A = { key: 0 }, C = { key: 1 }, T = /* @__PURE__ */ w({
3
3
  __name: "LimitCard",
4
4
  props: {
5
5
  type: {},
@@ -9,57 +9,70 @@ const S = { key: 0 }, B = { key: 1 }, c = /* @__PURE__ */ g({
9
9
  available: {},
10
10
  unit: {}
11
11
  },
12
- setup(m) {
13
- const s = m, v = i(() => s.available === null ? 0 : s.toSpend / s.available * 100), y = i(() => s.available === null ? 0 : s.used / s.available * 100), b = i(() => s.available === null ? 100 : 100 - y.value - v.value), $ = i(() => s.type === "unique_launches" ? "Runs Limits" : s.type === "volume_limit" ? "Volume Limits" : s.label), f = (e) => (e / 1024 / 1024 / 1024).toFixed(2) + " GB", r = (e) => s.type === "volume_limit" ? f(e) : e;
14
- return (e, a) => (d(), u("div", {
15
- class: n(e.$style.container)
12
+ setup(B) {
13
+ const l = B, s = i(() => l.available === null ? null : l.available + l.toSpend + l.used), v = i(() => l.available === null ? !1 : l.available < 0), $ = i(() => l.available === null ? null : l.available + l.toSpend), m = (e) => Math.max(0, Math.min(100, e)), g = i(() => s.value === null || s.value === 0 || v.value ? 0 : m(l.toSpend / s.value * 100)), S = i(() => s.value === null || s.value === 0 ? 0 : m(l.used / s.value * 100)), k = i(() => l.available === null || s.value === null || s.value === 0 ? 100 : v.value ? 0 : m(l.available / s.value * 100)), c = i(() => l.type === "unique_launches" ? "Runs Limits" : l.type === "volume_limit" ? "Volume Limits" : l.label), L = (e) => (e / 1024 / 1024 / 1024).toFixed(2) + " GB", d = (e) => l.type === "volume_limit" ? L(e) : e, f = (e) => Number(e.toFixed(2)) > 0;
14
+ return (e, a) => (r(), u("div", {
15
+ class: t(e.$style.container)
16
16
  }, [
17
- l("span", {
18
- class: n(e.$style.label)
19
- }, t($.value), 3),
20
- l("div", {
21
- class: n(e.$style.content)
17
+ n("span", {
18
+ class: t(e.$style.label)
19
+ }, o(c.value), 3),
20
+ n("div", {
21
+ class: t(e.$style.content)
22
22
  }, [
23
- l("div", {
24
- class: n(e.$style.contentAvailable)
23
+ n("div", {
24
+ class: t(e.$style.contentAvailable)
25
25
  }, [
26
- a[0] || (a[0] = o(" Available: ")),
27
- a[1] || (a[1] = l("div", { style: { flex: "1" } }, null, -1)),
28
- e.available !== null ? (d(), u("span", S, [
29
- l("strong", null, t(r(e.available)), 1),
30
- o(" / " + t(r(e.available + e.toSpend + e.used)), 1)
31
- ])) : (d(), u("span", B, "Unlimited"))
32
- ], 2),
33
- l("div", {
34
- class: n(e.$style.progressBar)
35
- }, [
36
- l("span", {
37
- class: n(e.$style.progressBarAvailable),
38
- style: p({ width: `${b.value}%` })
39
- }, null, 6),
40
- l("span", {
41
- class: n(e.$style.progressBarToSpend),
42
- style: p({ width: `${v.value}%` })
43
- }, null, 6),
44
- l("span", {
45
- class: n(e.$style.progressBarUsed),
46
- style: p({ width: `${y.value}%` })
47
- }, null, 6)
26
+ n("div", null, [
27
+ a[0] || (a[0] = y(" Available: ")),
28
+ a[1] || (a[1] = n("div", { style: { flex: "1" } }, null, -1)),
29
+ $.value !== null ? (r(), u("span", F, [
30
+ n("strong", null, o(d($.value)), 1),
31
+ y(" / " + o(d(e.available + e.toSpend + e.used)), 1)
32
+ ])) : (r(), u("span", N, "Unlimited"))
33
+ ]),
34
+ n("div", {
35
+ class: t([e.$style.afterRun, { [e.$style.exceeded]: v.value }])
36
+ }, [
37
+ v.value ? (r(), u("span", A, "Too many files selected")) : p("", !0),
38
+ a[2] || (a[2] = n("span", { style: { flex: "1" } }, null, -1)),
39
+ a[3] || (a[3] = n("span", null, "After run:", -1)),
40
+ e.available !== null ? (r(), u("span", C, o(d(e.available)) + " / " + o(d(e.available + e.toSpend + e.used)), 1)) : p("", !0)
41
+ ], 2),
42
+ n("div", {
43
+ class: t([e.$style.progressBar, { [e.$style.exceeded]: v.value }])
44
+ }, [
45
+ f(k.value) ? (r(), u("span", {
46
+ key: 0,
47
+ class: t(e.$style.progressBarAvailable),
48
+ style: b({ width: `${k.value.toFixed(2)}%` })
49
+ }, null, 6)) : p("", !0),
50
+ f(g.value) ? (r(), u("span", {
51
+ key: 1,
52
+ class: t(e.$style.progressBarToSpend),
53
+ style: b({ width: `${g.value.toFixed(2)}%` })
54
+ }, null, 6)) : p("", !0),
55
+ f(S.value) ? (r(), u("span", {
56
+ key: 2,
57
+ class: t(e.$style.progressBarUsed),
58
+ style: b({ width: `${S.value.toFixed(2)}%` })
59
+ }, null, 6)) : p("", !0)
60
+ ], 2)
48
61
  ], 2),
49
- l("div", {
50
- class: n(e.$style.legends)
62
+ n("div", {
63
+ class: t(e.$style.legends)
51
64
  }, [
52
- l("div", {
53
- class: n(e.$style.usedLegend)
65
+ n("div", {
66
+ class: t(e.$style.toSpendLegend)
54
67
  }, [
55
- a[2] || (a[2] = l("span", null, null, -1)),
56
- o(" Used: " + t(r(e.used)), 1)
68
+ a[4] || (a[4] = n("span", null, null, -1)),
69
+ y(" To spend: " + o(d(e.toSpend)), 1)
57
70
  ], 2),
58
- l("div", {
59
- class: n(e.$style.toSpendLegend)
71
+ n("div", {
72
+ class: t(e.$style.usedLegend)
60
73
  }, [
61
- a[3] || (a[3] = l("span", null, null, -1)),
62
- o(" To spend: " + t(r(e.toSpend)), 1)
74
+ a[5] || (a[5] = n("span", null, null, -1)),
75
+ y(" Used: " + o(d(e.used)), 1)
63
76
  ], 2)
64
77
  ], 2)
65
78
  ], 2)
@@ -67,6 +80,6 @@ const S = { key: 0 }, B = { key: 1 }, c = /* @__PURE__ */ g({
67
80
  }
68
81
  });
69
82
  export {
70
- c as default
83
+ T as default
71
84
  };
72
85
  //# sourceMappingURL=LimitCard.vue2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"LimitCard.vue2.js","sources":["../../../src/plugins/Monetization/LimitCard.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from 'vue';\n\nconst props = defineProps<{\n type: 'unique_launches' | 'volume_limit';\n label: string;\n used: number;\n toSpend: number;\n available: number | null; // If available is null it means Unlimited\n unit?: string;\n}>();\n\nconst toSpendPercentage = computed(() => {\n if (props.available === null) return 0;\n return (props.toSpend / props.available) * 100;\n});\n\nconst usedPercentage = computed(() => {\n if (props.available === null) return 0;\n return (props.used / props.available) * 100;\n});\n\nconst availablePercentage = computed(() => {\n if (props.available === null) return 100;\n return 100 - usedPercentage.value - toSpendPercentage.value;\n});\n\nconst computedLabel = computed(() => {\n if (props.type === 'unique_launches') return 'Runs Limits';\n if (props.type === 'volume_limit') return 'Volume Limits';\n return props.label;\n});\n\nconst toGB = (v: number) => {\n return (v / 1024 / 1024 / 1024).toFixed(2) + ' GB';\n};\n\nconst formatUnit = (v: number) => {\n if (props.type === 'volume_limit') return toGB(v);\n return v;\n};\n</script>\n\n<template>\n <div :class=\"$style.container\">\n <span :class=\"$style.label\">{{ computedLabel }}</span>\n <div :class=\"$style.content\">\n <div :class=\"$style.contentAvailable\">\n Available:\n <div style=\"flex: 1\" />\n <span v-if=\"available !== null\"><strong>{{ formatUnit(available) }}</strong> / {{ formatUnit(available + toSpend + used) }}</span>\n <span v-else>Unlimited</span>\n </div>\n <div :class=\"$style.progressBar\">\n <span :class=\"$style.progressBarAvailable\" :style=\"{ width: `${availablePercentage}%` }\" />\n <span :class=\"$style.progressBarToSpend\" :style=\"{ width: `${toSpendPercentage}%` }\" />\n <span :class=\"$style.progressBarUsed\" :style=\"{ width: `${usedPercentage}%` }\" />\n </div>\n <div :class=\"$style.legends\">\n <div :class=\"$style.usedLegend\">\n <span/>\n Used: {{ formatUnit(used) }}\n </div>\n <div :class=\"$style.toSpendLegend\">\n <span/>\n To spend: {{ formatUnit(toSpend) }}\n </div>\n </div>\n </div>\n </div>\n</template>\n\n<style module>\n.container {\n display: flex;\n flex-direction: column;\n gap: 8px;\n background-color: var(--bg-base-light);\n border-radius: 6px;\n padding: 10px 12px 16px 12px;\n color: var(--txt-01);\n font-size: 14px;\n font-weight: 500;\n line-height: 20px;\n border: 1px solid var(--border-color-div-grey);\n}\n\n.label {\n display: block;\n margin-bottom: 30px;\n color: var(--txt-01);\n font-size: 14px;\n font-weight: 600;\n line-height: 20px; /* 142.857% */\n}\n\n.content {\n display: flex;\n flex-direction: column;\n gap: 20px;\n}\n\n.contentAvailable {\n display: flex;\n align-items: flex-start;\n gap: 8px;\n strong {\n font-size: 28px;\n font-weight: 500;\n line-height: 36px; /* 128.571% */\n letter-spacing: -0.56px;\n }\n}\n\n.progressBar {\n width: 100%;\n height: 8px;\n background-color: #E0E0E0;\n border-radius: 4px;\n display: flex;\n align-items: center;\n border: 1px solid var(--border-color-default);\n > span {\n display: block;\n height: 100%;\n }\n}\n\n.progressBarAvailable {\n background-color: #49CC49;\n border-radius: 4px;\n}\n\n.progressBarUsed {\n background-color: #FFCECC;\n border-radius: 4px;\n}\n\n.progressBarToSpend {\n background-color: #FAF5AA;\n border-radius: 4px;\n}\n\n.legends {\n display: flex;\n gap: 8px;\n\n > div {\n flex: 1;\n }\n\n span {\n display: block;\n border-radius: 1px;\n border: 1px solid var(--border-color-default);\n width: 16px;\n height: 16px;\n }\n}\n\n.usedLegend {\n display: flex;\n align-items: center;\n gap: 8px;\n span {\n background: #FFCECC;\n }\n}\n\n.toSpendLegend {\n display: flex;\n align-items: center;\n gap: 8px;\n span {\n background: #FAF5AA;\n }\n}\n</style>\n"],"names":["props","__props","toSpendPercentage","computed","usedPercentage","availablePercentage","computedLabel","toGB","v","formatUnit"],"mappings":";;;;;;;;;;;;AAGA,UAAMA,IAAQC,GASRC,IAAoBC,EAAS,MAC7BH,EAAM,cAAc,OAAa,IAC7BA,EAAM,UAAUA,EAAM,YAAa,GAC5C,GAEKI,IAAiBD,EAAS,MAC1BH,EAAM,cAAc,OAAa,IAC7BA,EAAM,OAAOA,EAAM,YAAa,GACzC,GAEKK,IAAsBF,EAAS,MAC/BH,EAAM,cAAc,OAAa,MAC9B,MAAMI,EAAe,QAAQF,EAAkB,KACvD,GAEKI,IAAgBH,EAAS,MACzBH,EAAM,SAAS,oBAA0B,gBACzCA,EAAM,SAAS,iBAAuB,kBACnCA,EAAM,KACd,GAEKO,IAAO,CAACC,OACJA,IAAI,OAAO,OAAO,MAAM,QAAQ,CAAC,IAAI,OAGzCC,IAAa,CAACD,MACdR,EAAM,SAAS,iBAAuBO,EAAKC,CAAC,IACzCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"LimitCard.vue2.js","sources":["../../../src/plugins/Monetization/LimitCard.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from 'vue';\n\nconst props = defineProps<{\n type: 'unique_launches' | 'volume_limit';\n label: string;\n used: number;\n toSpend: number;\n available: number | null; // If available is null it means Unlimited\n unit?: string;\n}>();\n\nconst total = computed(() => {\n if (props.available === null) return null;\n return props.available + props.toSpend + props.used;\n});\n\nconst exceeded = computed(() => {\n if (props.available === null) return false;\n return props.available < 0;\n});\n\nconst availableNow = computed(() => {\n if (props.available === null) return null;\n return props.available + props.toSpend;\n});\n\nconst clampPercentage = (n: number) => Math.max(0, Math.min(100, n));\n\nconst toSpendPercentage = computed(() => {\n if (total.value === null) return 0;\n if (total.value === 0) return 0;\n if (exceeded.value) return 0;\n return clampPercentage((props.toSpend / total.value) * 100);\n});\n\nconst usedPercentage = computed(() => {\n if (total.value === null) return 0;\n if (total.value === 0) return 0;\n return clampPercentage((props.used / total.value) * 100);\n});\n\nconst availablePercentage = computed(() => {\n if (props.available === null) return 100;\n if (total.value === null) return 100;\n if (total.value === 0) return 100;\n if (exceeded.value) return 0;\n return clampPercentage(props.available / total.value * 100);\n});\n\nconst computedLabel = computed(() => {\n if (props.type === 'unique_launches') return 'Runs Limits';\n if (props.type === 'volume_limit') return 'Volume Limits';\n return props.label;\n});\n\nconst toGB = (v: number) => {\n return (v / 1024 / 1024 / 1024).toFixed(2) + ' GB';\n};\n\nconst formatUnit = (v: number) => {\n if (props.type === 'volume_limit') return toGB(v);\n return v;\n};\n\nconst showBar = (n: number) => {\n return Number(n.toFixed(2)) > 0;\n};\n</script>\n\n<template>\n <div :class=\"$style.container\">\n <span :class=\"$style.label\">{{ computedLabel }}</span>\n <div :class=\"$style.content\">\n <div :class=\"$style.contentAvailable\">\n <div>\n Available:\n <div style=\"flex: 1\" />\n <span v-if=\"availableNow !== null\"><strong>{{ formatUnit(availableNow) }}</strong> / {{ formatUnit(available! + toSpend + used) }}</span>\n <span v-else>Unlimited</span>\n </div>\n <div :class=\"[$style.afterRun, { [$style.exceeded]: exceeded }]\">\n <span v-if=\"exceeded\">Too many files selected</span>\n <span style=\"flex: 1\" />\n <span>After run:</span>\n <span v-if=\"available !== null\">{{ formatUnit(available) }} / {{ formatUnit(available + toSpend + used) }}</span>\n </div>\n <div :class=\"[$style.progressBar, { [$style.exceeded]: exceeded }]\">\n <span v-if=\"showBar(availablePercentage)\" :class=\"$style.progressBarAvailable\" :style=\"{ width: `${availablePercentage.toFixed(2)}%` }\" />\n <span v-if=\"showBar(toSpendPercentage)\" :class=\"$style.progressBarToSpend\" :style=\"{ width: `${toSpendPercentage.toFixed(2)}%` }\" />\n <span v-if=\"showBar(usedPercentage)\" :class=\"$style.progressBarUsed\" :style=\"{ width: `${usedPercentage.toFixed(2)}%` }\" />\n </div>\n </div>\n <div :class=\"$style.legends\">\n <div :class=\"$style.toSpendLegend\">\n <span/>\n To spend: {{ formatUnit(toSpend) }}\n </div>\n <div :class=\"$style.usedLegend\">\n <span/>\n Used: {{ formatUnit(used) }}\n </div>\n </div>\n </div>\n </div>\n</template>\n\n<style module>\n.container {\n display: flex;\n flex-direction: column;\n background-color: var(--bg-base-light);\n border-radius: 6px;\n padding: 10px 12px 16px 12px;\n color: var(--txt-01);\n font-size: 14px;\n font-weight: 500;\n line-height: 20px;\n border: 1px solid var(--border-color-div-grey);\n}\n\n.label {\n display: block;\n min-height: 36px;\n margin-bottom: 8px;\n color: var(--txt-01);\n font-size: 14px;\n font-weight: 600;\n line-height: 20px; /* 142.857% */\n}\n\n.content {\n display: flex;\n flex-direction: column;\n gap: 16px;\n}\n\n.contentAvailable {\n display: flex;\n flex-direction: column;\n gap: 6px;\n > div {\n display: flex;\n align-items: flex-start;\n }\n >div:first-child {\n gap: 8px;\n strong {\n font-size: 28px;\n font-weight: 500;\n line-height: 36px; /* 128.571% */\n letter-spacing: -0.56px;\n }\n }\n}\n\n.afterRun {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n gap: 4px;\n font-size: 12px;\n font-style: normal;\n font-weight: 500;\n line-height: 16px;\n color: var(--txt-03);\n &.exceeded {\n color: var(--txt-error);\n }\n}\n\n.progressBar {\n width: 100%;\n height: 12px;\n background-color: #E0E0E0;\n display: flex;\n align-items: center;\n border: 1px solid var(--border-color-default);\n > span {\n display: block;\n height: 100%;\n outline: 1px solid var(--border-color-default);\n }\n &.exceeded {\n opacity: 0.2;\n }\n}\n\n.progressBarAvailable {\n background: linear-gradient(270deg, #A1E59C 0%, #D0F5B0 98.81%);\n}\n\n.progressBarUsed {\n background-color: #FFCECC;\n}\n\n.progressBarToSpend {\n background-color: #FAF5AA;\n}\n\n.legends {\n display: flex;\n justify-content: space-between;\n gap: 8px;\n\n span {\n display: block;\n border-radius: 1px;\n border: 1px solid var(--border-color-default);\n width: 12px;\n height: 12px;\n }\n}\n\n.usedLegend {\n display: flex;\n align-items: center;\n gap: 8px;\n span {\n background: #FFCECC;\n }\n}\n\n.toSpendLegend {\n display: flex;\n align-items: center;\n gap: 8px;\n span {\n background: #FAF5AA;\n }\n}\n</style>\n"],"names":["props","__props","total","computed","exceeded","availableNow","clampPercentage","n","toSpendPercentage","usedPercentage","availablePercentage","computedLabel","toGB","v","formatUnit","showBar"],"mappings":";;;;;;;;;;;;AAGA,UAAMA,IAAQC,GASRC,IAAQC,EAAS,MACjBH,EAAM,cAAc,OAAa,OAC9BA,EAAM,YAAYA,EAAM,UAAUA,EAAM,IAChD,GAEKI,IAAWD,EAAS,MACpBH,EAAM,cAAc,OAAa,KAC9BA,EAAM,YAAY,CAC1B,GAEKK,IAAeF,EAAS,MACxBH,EAAM,cAAc,OAAa,OAC9BA,EAAM,YAAYA,EAAM,OAChC,GAEKM,IAAkB,CAACC,MAAc,KAAK,IAAI,GAAG,KAAK,IAAI,KAAKA,CAAC,CAAC,GAE7DC,IAAoBL,EAAS,MAC7BD,EAAM,UAAU,QAChBA,EAAM,UAAU,KAChBE,EAAS,QAAc,IACpBE,EAAiBN,EAAM,UAAUE,EAAM,QAAS,GAAG,CAC3D,GAEKO,IAAiBN,EAAS,MAC1BD,EAAM,UAAU,QAChBA,EAAM,UAAU,IAAU,IACvBI,EAAiBN,EAAM,OAAOE,EAAM,QAAS,GAAG,CACxD,GAEKQ,IAAsBP,EAAS,MAC/BH,EAAM,cAAc,QACpBE,EAAM,UAAU,QAChBA,EAAM,UAAU,IAAU,MAC1BE,EAAS,QAAc,IACpBE,EAAgBN,EAAM,YAAYE,EAAM,QAAQ,GAAG,CAC3D,GAEKS,IAAgBR,EAAS,MACzBH,EAAM,SAAS,oBAA0B,gBACzCA,EAAM,SAAS,iBAAuB,kBACnCA,EAAM,KACd,GAEKY,IAAO,CAACC,OACJA,IAAI,OAAO,OAAO,MAAM,QAAQ,CAAC,IAAI,OAGzCC,IAAa,CAACD,MACdb,EAAM,SAAS,iBAAuBY,EAAKC,CAAC,IACzCA,GAGHE,IAAU,CAACR,MACR,OAAOA,EAAE,QAAQ,CAAC,CAAC,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,29 +1,33 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode("._container_1qgbe_2{display:flex;flex-direction:column;gap:8px;background-color:var(--bg-base-light);border-radius:6px;padding:10px 12px 16px;color:var(--txt-01);font-size:14px;font-weight:500;line-height:20px;border:1px solid var(--border-color-div-grey)}._label_1qgbe_16{display:block;margin-bottom:30px;color:var(--txt-01);font-size:14px;font-weight:600;line-height:20px}._content_1qgbe_25{display:flex;flex-direction:column;gap:20px}._contentAvailable_1qgbe_31{display:flex;align-items:flex-start;gap:8px}._contentAvailable_1qgbe_31 strong{font-size:28px;font-weight:500;line-height:36px;letter-spacing:-.56px}._progressBar_1qgbe_43{width:100%;height:8px;background-color:#e0e0e0;border-radius:4px;display:flex;align-items:center;border:1px solid var(--border-color-default)}._progressBar_1qgbe_43>span{display:block;height:100%}._progressBarAvailable_1qgbe_57{background-color:#49cc49;border-radius:4px}._progressBarUsed_1qgbe_62{background-color:#ffcecc;border-radius:4px}._progressBarToSpend_1qgbe_67{background-color:#faf5aa;border-radius:4px}._legends_1qgbe_72{display:flex;gap:8px}._legends_1qgbe_72>div{flex:1}._legends_1qgbe_72 span{display:block;border-radius:1px;border:1px solid var(--border-color-default);width:16px;height:16px}._usedLegend_1qgbe_89{display:flex;align-items:center;gap:8px}._usedLegend_1qgbe_89 span{background:#ffcecc}._toSpendLegend_1qgbe_98{display:flex;align-items:center;gap:8px}._toSpendLegend_1qgbe_98 span{background:#faf5aa}")),document.head.appendChild(e)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
2
- const e = "_container_1qgbe_2", s = "_label_1qgbe_16", n = "_content_1qgbe_25", o = "_contentAvailable_1qgbe_31", r = "_progressBar_1qgbe_43", t = "_progressBarAvailable_1qgbe_57", _ = "_progressBarUsed_1qgbe_62", a = "_progressBarToSpend_1qgbe_67", g = "_legends_1qgbe_72", l = "_usedLegend_1qgbe_89", d = "_toSpendLegend_1qgbe_98", c = {
1
+ (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode("._container_17ssa_2{display:flex;flex-direction:column;background-color:var(--bg-base-light);border-radius:6px;padding:10px 12px 16px;color:var(--txt-01);font-size:14px;font-weight:500;line-height:20px;border:1px solid var(--border-color-div-grey)}._label_17ssa_15{display:block;min-height:36px;margin-bottom:8px;color:var(--txt-01);font-size:14px;font-weight:600;line-height:20px}._content_17ssa_25{display:flex;flex-direction:column;gap:16px}._contentAvailable_17ssa_31{display:flex;flex-direction:column;gap:6px}._contentAvailable_17ssa_31>div{display:flex;align-items:flex-start}._contentAvailable_17ssa_31>div:first-child{gap:8px}._contentAvailable_17ssa_31>div:first-child strong{font-size:28px;font-weight:500;line-height:36px;letter-spacing:-.56px}._afterRun_17ssa_50{display:flex;align-items:center;justify-content:flex-end;gap:4px;font-size:12px;font-style:normal;font-weight:500;line-height:16px;color:var(--txt-03)}._afterRun_17ssa_50._exceeded_17ssa_60{color:var(--txt-error)}._progressBar_17ssa_65{width:100%;height:12px;background-color:#e0e0e0;display:flex;align-items:center;border:1px solid var(--border-color-default)}._progressBar_17ssa_65>span{display:block;height:100%;outline:1px solid var(--border-color-default)}._progressBar_17ssa_65._exceeded_17ssa_60{opacity:.2}._progressBarAvailable_17ssa_82{background:linear-gradient(270deg,#a1e59c,#d0f5b0 98.81%)}._progressBarUsed_17ssa_86{background-color:#ffcecc}._progressBarToSpend_17ssa_90{background-color:#faf5aa}._legends_17ssa_94{display:flex;justify-content:space-between;gap:8px}._legends_17ssa_94 span{display:block;border-radius:1px;border:1px solid var(--border-color-default);width:12px;height:12px}._usedLegend_17ssa_108{display:flex;align-items:center;gap:8px}._usedLegend_17ssa_108 span{background:#ffcecc}._toSpendLegend_17ssa_117{display:flex;align-items:center;gap:8px}._toSpendLegend_17ssa_117 span{background:#faf5aa}")),document.head.appendChild(e)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})();
2
+ const e = "_container_17ssa_2", s = "_label_17ssa_15", n = "_content_17ssa_25", a = "_contentAvailable_17ssa_31", r = "_afterRun_17ssa_50", o = "_exceeded_17ssa_60", _ = "_progressBar_17ssa_65", t = "_progressBarAvailable_17ssa_82", d = "_progressBarUsed_17ssa_86", c = "_progressBarToSpend_17ssa_90", l = "_legends_17ssa_94", g = "_usedLegend_17ssa_108", p = "_toSpendLegend_17ssa_117", B = {
3
3
  container: e,
4
4
  label: s,
5
5
  content: n,
6
- contentAvailable: o,
7
- progressBar: r,
6
+ contentAvailable: a,
7
+ afterRun: r,
8
+ exceeded: o,
9
+ progressBar: _,
8
10
  progressBarAvailable: t,
9
- progressBarUsed: _,
10
- progressBarToSpend: a,
11
- legends: g,
12
- usedLegend: l,
13
- toSpendLegend: d
11
+ progressBarUsed: d,
12
+ progressBarToSpend: c,
13
+ legends: l,
14
+ usedLegend: g,
15
+ toSpendLegend: p
14
16
  };
15
17
  export {
18
+ r as afterRun,
16
19
  e as container,
17
20
  n as content,
18
- o as contentAvailable,
19
- c as default,
21
+ a as contentAvailable,
22
+ B as default,
23
+ o as exceeded,
20
24
  s as label,
21
- g as legends,
22
- r as progressBar,
25
+ l as legends,
26
+ _ as progressBar,
23
27
  t as progressBarAvailable,
24
- a as progressBarToSpend,
25
- _ as progressBarUsed,
26
- d as toSpendLegend,
27
- l as usedLegend
28
+ c as progressBarToSpend,
29
+ d as progressBarUsed,
30
+ p as toSpendLegend,
31
+ g as usedLegend
28
32
  };
29
33
  //# sourceMappingURL=LimitCard.vue3.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"LimitCard.vue3.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;"}
1
+ {"version":3,"file":"LimitCard.vue3.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;"}
@@ -1,39 +1,39 @@
1
- import { defineComponent as h, ref as T, computed as s, createElementBlock as P, openBlock as n, Fragment as S, createBlock as l, createCommentVNode as u, unref as e, withCtx as i, createVNode as d, createTextVNode as x, toDisplayString as E, renderList as L, createElementVNode as N, Teleport as M, withModifiers as R } from "vue";
1
+ import { defineComponent as T, ref as U, computed as s, createElementBlock as P, openBlock as n, Fragment as S, createBlock as l, createCommentVNode as u, unref as e, withCtx as i, createVNode as d, createTextVNode as x, toDisplayString as E, renderList as L, createElementVNode as N, Teleport as M, withModifiers as R } from "vue";
2
2
  import { PlSlideModal as I, PlDropdown as O, PlBtnSecondary as q, PlAlert as D, PlBtnGhost as $, PlIcon24 as A } from "@milaboratories/uikit";
3
3
  import { useButtonTarget as F } from "./useButtonTarget.js";
4
4
  import { useInfo as G } from "./useInfo.js";
5
5
  import K from "./UserCabinetCard.vue.js";
6
- import W from "./RunStatus.vue.js";
7
- import j from "./LimitCard.vue.js";
8
- import H from "./EndOfPeriod.vue.js";
9
- const oe = /* @__PURE__ */ h({
6
+ import j from "./RunStatus.vue.js";
7
+ import H from "./LimitCard.vue.js";
8
+ import J from "./EndOfPeriod.vue.js";
9
+ const oe = /* @__PURE__ */ T({
10
10
  __name: "MonetizationSidebar",
11
- setup(J) {
12
- const p = T(!1), {
11
+ setup(Q) {
12
+ const p = U(!1), {
13
13
  result: o,
14
- error: m,
14
+ error: f,
15
15
  hasMonetization: c,
16
- canRun: f,
17
- status: v,
18
- customerEmail: b,
19
- endOfBillingPeriod: y,
20
- limits: g,
21
- refresh: w,
22
- isLoading: B
23
- } = G(), k = F(c), V = s(() => {
16
+ canRun: v,
17
+ status: B,
18
+ customerEmail: m,
19
+ endOfBillingPeriod: b,
20
+ limits: y,
21
+ refresh: V,
22
+ isLoading: g
23
+ } = G(), k = F(c), _ = s(() => {
24
24
  var a;
25
25
  return (a = o.value) == null ? void 0 : a.productName;
26
26
  }), C = s(() => {
27
27
  if (!o.value) return;
28
28
  const a = new URL(`https://scientist.platforma.bio/product/${o.value.productKey}`);
29
- return b.value && a.searchParams.set("email", b.value), a.toString();
30
- }), z = s(() => o.value ? [
29
+ return m.value && a.searchParams.set("email", m.value), a.toString();
30
+ }), h = s(() => o.value ? [
31
31
  {
32
32
  label: o.value.productName,
33
33
  value: o.value.productName
34
34
  }
35
- ] : []), U = s(() => {
36
- switch (v.value) {
35
+ ] : []), w = s(() => {
36
+ switch (B.value) {
37
37
  case "active":
38
38
  return "";
39
39
  case "limits_exceeded":
@@ -44,12 +44,10 @@ const oe = /* @__PURE__ */ h({
44
44
  return "Select a subscription plan in the Scientist Cabinet.";
45
45
  case "inactive":
46
46
  return "Not found billing period.";
47
- case "awaiting":
48
- return "Waiting for monetization information";
49
47
  default:
50
- return "Unknown status: " + v.value;
48
+ return "";
51
49
  }
52
- }), _ = s(() => f.value ? "monetization-on" : "monetization-off");
50
+ }), z = s(() => v.value ? "monetization-on" : "monetization-off");
53
51
  return (a, r) => (n(), P(S, null, [
54
52
  e(c) ? (n(), l(e(I), {
55
53
  key: 0,
@@ -65,12 +63,13 @@ const oe = /* @__PURE__ */ h({
65
63
  d(e(O), {
66
64
  label: "Product",
67
65
  readonly: "",
68
- "model-value": V.value,
69
- options: z.value
66
+ "model-value": _.value,
67
+ options: h.value
70
68
  }, null, 8, ["model-value", "options"]),
71
- d(W, {
72
- "can-run": e(f),
73
- "status-text": U.value
69
+ d(j, {
70
+ "can-run": e(v),
71
+ "is-loading": e(g),
72
+ "status-text": w.value
74
73
  }, {
75
74
  default: i(() => [
76
75
  d(e(q), {
@@ -79,30 +78,31 @@ const oe = /* @__PURE__ */ h({
79
78
  size: "small",
80
79
  style: { "margin-left": "auto" },
81
80
  icon: "loading",
82
- loading: e(B),
83
- onClick: e(w)
81
+ loading: e(g),
82
+ onClick: e(V)
84
83
  }, null, 8, ["loading", "onClick"])
85
84
  ]),
86
85
  _: 1
87
- }, 8, ["can-run", "status-text"]),
88
- e(m) ? (n(), l(e(D), {
86
+ }, 8, ["can-run", "is-loading", "status-text"]),
87
+ e(f) ? (n(), l(e(D), {
89
88
  key: 0,
90
89
  type: "error"
91
90
  }, {
92
91
  default: i(() => [
93
- x(E(e(m)), 1)
92
+ x(E(e(f)), 1)
94
93
  ]),
95
94
  _: 1
96
95
  })) : u("", !0),
97
96
  C.value ? (n(), l(K, {
98
97
  key: 1,
98
+ email: e(m),
99
99
  "user-cabinet-url": C.value
100
- }, null, 8, ["user-cabinet-url"])) : u("", !0),
101
- e(y) ? (n(), l(H, {
100
+ }, null, 8, ["email", "user-cabinet-url"])) : u("", !0),
101
+ e(b) ? (n(), l(J, {
102
102
  key: 2,
103
- "end-of-period": e(y)
103
+ "end-of-period": e(b)
104
104
  }, null, 8, ["end-of-period"])) : u("", !0),
105
- e(g) ? (n(!0), P(S, { key: 3 }, L(e(g), (t) => (n(), l(j, {
105
+ e(y) ? (n(!0), P(S, { key: 3 }, L(e(y), (t) => (n(), l(H, {
106
106
  key: t.type,
107
107
  type: t.type,
108
108
  label: t.type,
@@ -121,7 +121,7 @@ const oe = /* @__PURE__ */ h({
121
121
  onClick: r[1] || (r[1] = R((t) => p.value = !0, ["stop"]))
122
122
  }, {
123
123
  append: i(() => [
124
- d(e(A), { name: _.value }, null, 8, ["name"])
124
+ d(e(A), { name: z.value }, null, 8, ["name"])
125
125
  ]),
126
126
  default: i(() => [
127
127
  r[3] || (r[3] = x(" Subscription "))
@@ -1 +1 @@
1
- {"version":3,"file":"MonetizationSidebar.vue.js","sources":["../../../src/plugins/Monetization/MonetizationSidebar.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ref, computed } from 'vue';\nimport { PlSlideModal, PlBtnGhost, PlDropdown, PlAlert, PlIcon24, PlBtnSecondary } from '@milaboratories/uikit';\nimport { useButtonTarget } from './useButtonTarget';\nimport { useInfo } from './useInfo';\nimport UserCabinetCard from './UserCabinetCard.vue';\nimport RunStatus from './RunStatus.vue';\nimport LimitCard from './LimitCard.vue';\nimport EndOfPeriod from './EndOfPeriod.vue';\n\nconst isOpen = ref(false);\n\nconst {\n result,\n error,\n hasMonetization,\n canRun,\n status,\n customerEmail,\n endOfBillingPeriod,\n limits,\n refresh,\n isLoading,\n} = useInfo();\n\nconst teleportTarget = useButtonTarget(hasMonetization);\n\nconst productName = computed(() => result.value?.productName);\n\nconst userCabinetUrl = computed(() => {\n if (!result.value) return undefined;\n\n const u = new URL(`https://scientist.platforma.bio/product/${result.value.productKey}`);\n\n if (customerEmail.value) {\n u.searchParams.set('email', customerEmail.value);\n }\n\n return u.toString();\n});\n\nconst options = computed(() => {\n if (!result.value) return [];\n\n return [\n {\n label: result.value.productName,\n value: result.value.productName,\n },\n ];\n});\n\nconst statusText = computed(() => {\n switch (status.value) {\n case 'active':\n return '';\n case 'limits_exceeded':\n return 'Usage limits exceeded for the current billing period.';\n case 'payment_required':\n return 'Payment required to continue using the service.';\n case 'select-tariff':\n return 'Select a subscription plan in the Scientist Cabinet.';\n case 'inactive':\n return 'Not found billing period.';\n case 'awaiting':\n return 'Waiting for monetization information';\n default:\n return 'Unknown status: ' + status.value;\n }\n});\n\nconst btnIcon = computed(() => {\n if (canRun.value) return 'monetization-on';\n return 'monetization-off';\n});\n</script>\n\n<template>\n <PlSlideModal v-if=\"hasMonetization\" v-model=\"isOpen\">\n <template #title>\n <div class=\"flex items-center gap-2\">\n <span>Subscription</span>\n </div>\n </template>\n <PlDropdown label=\"Product\" readonly :model-value=\"productName\" :options=\"options\" />\n <RunStatus :can-run=\"canRun\" :status-text=\"statusText\">\n <PlBtnSecondary\n title=\"Refresh status\"\n round\n size=\"small\"\n style=\"margin-left: auto;\"\n icon=\"loading\"\n :loading=\"isLoading\"\n @click=\"refresh\"\n />\n </RunStatus>\n <PlAlert v-if=\"error\" type=\"error\">\n {{ error }}\n </PlAlert>\n <UserCabinetCard v-if=\"userCabinetUrl\" :user-cabinet-url=\"userCabinetUrl\" />\n <EndOfPeriod v-if=\"endOfBillingPeriod\" :end-of-period=\"endOfBillingPeriod\" />\n <template v-if=\"limits\">\n <LimitCard\n v-for=\"limit in limits\"\n :key=\"limit.type\"\n :type=\"limit.type\"\n :label=\"limit.type\"\n :used=\"limit.used\"\n :to-spend=\"limit.toSpend\"\n :available=\"limit.available\"\n />\n </template>\n </PlSlideModal>\n <!-- Teleport to the title slot -->\n <Teleport v-if=\"hasMonetization && teleportTarget\" :to=\"teleportTarget\">\n <PlBtnGhost @click.stop=\"isOpen = true\">\n Subscription\n <template #append>\n <PlIcon24 :name=\"btnIcon\" />\n </template>\n </PlBtnGhost>\n </Teleport>\n</template>\n"],"names":["isOpen","ref","result","error","hasMonetization","canRun","status","customerEmail","endOfBillingPeriod","limits","refresh","isLoading","useInfo","teleportTarget","useButtonTarget","productName","computed","_a","userCabinetUrl","u","options","statusText","btnIcon"],"mappings":";;;;;;;;;;;AAUA,UAAMA,IAASC,EAAI,EAAK,GAElB;AAAA,MACJ,QAAAC;AAAA,MACA,OAAAC;AAAA,MACA,iBAAAC;AAAA,MACA,QAAAC;AAAA,MACA,QAAAC;AAAA,MACA,eAAAC;AAAA,MACA,oBAAAC;AAAA,MACA,QAAAC;AAAA,MACA,SAAAC;AAAA,MACA,WAAAC;AAAA,IAAA,IACEC,EAAA,GAEEC,IAAiBC,EAAgBV,CAAe,GAEhDW,IAAcC,EAAS,MAAA;;AAAM,cAAAC,IAAAf,EAAO,UAAP,gBAAAe,EAAc;AAAA,KAAW,GAEtDC,IAAiBF,EAAS,MAAM;AACpC,UAAI,CAACd,EAAO,MAAO;AAEnB,YAAMiB,IAAI,IAAI,IAAI,2CAA2CjB,EAAO,MAAM,UAAU,EAAE;AAEtF,aAAIK,EAAc,SAChBY,EAAE,aAAa,IAAI,SAASZ,EAAc,KAAK,GAG1CY,EAAE,SAAA;AAAA,IACX,CAAC,GAEKC,IAAUJ,EAAS,MAClBd,EAAO,QAEL;AAAA,MACL;AAAA,QACE,OAAOA,EAAO,MAAM;AAAA,QACpB,OAAOA,EAAO,MAAM;AAAA,MAAA;AAAA,IACtB,IANwB,CAAA,CAQ3B,GAEKmB,IAAaL,EAAS,MAAM;AAChC,cAAQV,EAAO,OAAA;AAAA,QACb,KAAK;AACH,iBAAO;AAAA,QACT,KAAK;AACH,iBAAO;AAAA,QACT,KAAK;AACH,iBAAO;AAAA,QACT,KAAK;AACH,iBAAO;AAAA,QACT,KAAK;AACH,iBAAO;AAAA,QACT,KAAK;AACH,iBAAO;AAAA,QACT;AACE,iBAAO,qBAAqBA,EAAO;AAAA,MAAA;AAAA,IAEzC,CAAC,GAEKgB,IAAUN,EAAS,MACnBX,EAAO,QAAc,oBAClB,kBACR;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"MonetizationSidebar.vue.js","sources":["../../../src/plugins/Monetization/MonetizationSidebar.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ref, computed } from 'vue';\nimport { PlSlideModal, PlBtnGhost, PlDropdown, PlAlert, PlIcon24, PlBtnSecondary } from '@milaboratories/uikit';\nimport { useButtonTarget } from './useButtonTarget';\nimport { useInfo } from './useInfo';\nimport UserCabinetCard from './UserCabinetCard.vue';\nimport RunStatus from './RunStatus.vue';\nimport LimitCard from './LimitCard.vue';\nimport EndOfPeriod from './EndOfPeriod.vue';\n\nconst isOpen = ref(false);\n\nconst {\n result,\n error,\n hasMonetization,\n canRun,\n status,\n customerEmail,\n endOfBillingPeriod,\n limits,\n refresh,\n isLoading,\n} = useInfo();\n\nconst teleportTarget = useButtonTarget(hasMonetization);\n\nconst productName = computed(() => result.value?.productName);\n\nconst userCabinetUrl = computed(() => {\n if (!result.value) return undefined;\n\n const u = new URL(`https://scientist.platforma.bio/product/${result.value.productKey}`);\n\n if (customerEmail.value) {\n u.searchParams.set('email', customerEmail.value);\n }\n\n return u.toString();\n});\n\nconst options = computed(() => {\n if (!result.value) return [];\n\n return [\n {\n label: result.value.productName,\n value: result.value.productName,\n },\n ];\n});\n\nconst statusText = computed(() => {\n switch (status.value) {\n case 'active':\n return '';\n case 'limits_exceeded':\n return 'Usage limits exceeded for the current billing period.';\n case 'payment_required':\n return 'Payment required to continue using the service.';\n case 'select-tariff':\n return 'Select a subscription plan in the Scientist Cabinet.';\n case 'inactive':\n return 'Not found billing period.';\n default:\n return '';\n }\n});\n\nconst btnIcon = computed(() => {\n if (canRun.value) return 'monetization-on';\n return 'monetization-off';\n});\n</script>\n\n<template>\n <PlSlideModal v-if=\"hasMonetization\" v-model=\"isOpen\">\n <template #title>\n <div class=\"flex items-center gap-2\">\n <span>Subscription</span>\n </div>\n </template>\n <PlDropdown label=\"Product\" readonly :model-value=\"productName\" :options=\"options\" />\n <RunStatus :can-run=\"canRun\" :is-loading=\"isLoading\" :status-text=\"statusText\">\n <PlBtnSecondary\n title=\"Refresh status\"\n round\n size=\"small\"\n style=\"margin-left: auto;\"\n icon=\"loading\"\n :loading=\"isLoading\"\n @click=\"refresh\"\n />\n </RunStatus>\n <PlAlert v-if=\"error\" type=\"error\">\n {{ error }}\n </PlAlert>\n <UserCabinetCard v-if=\"userCabinetUrl\" :email=\"customerEmail\" :user-cabinet-url=\"userCabinetUrl\" />\n <EndOfPeriod v-if=\"endOfBillingPeriod\" :end-of-period=\"endOfBillingPeriod\" />\n <template v-if=\"limits\">\n <LimitCard\n v-for=\"limit in limits\"\n :key=\"limit.type\"\n :type=\"limit.type\"\n :label=\"limit.type\"\n :used=\"limit.used\"\n :to-spend=\"limit.toSpend\"\n :available=\"limit.available\"\n />\n </template>\n </PlSlideModal>\n <!-- Teleport to the title slot -->\n <Teleport v-if=\"hasMonetization && teleportTarget\" :to=\"teleportTarget\">\n <PlBtnGhost @click.stop=\"isOpen = true\">\n Subscription\n <template #append>\n <PlIcon24 :name=\"btnIcon\" />\n </template>\n </PlBtnGhost>\n </Teleport>\n</template>\n"],"names":["isOpen","ref","result","error","hasMonetization","canRun","status","customerEmail","endOfBillingPeriod","limits","refresh","isLoading","useInfo","teleportTarget","useButtonTarget","productName","computed","_a","userCabinetUrl","u","options","statusText","btnIcon"],"mappings":";;;;;;;;;;;AAUA,UAAMA,IAASC,EAAI,EAAK,GAElB;AAAA,MACJ,QAAAC;AAAA,MACA,OAAAC;AAAA,MACA,iBAAAC;AAAA,MACA,QAAAC;AAAA,MACA,QAAAC;AAAA,MACA,eAAAC;AAAA,MACA,oBAAAC;AAAA,MACA,QAAAC;AAAA,MACA,SAAAC;AAAA,MACA,WAAAC;AAAA,IAAA,IACEC,EAAA,GAEEC,IAAiBC,EAAgBV,CAAe,GAEhDW,IAAcC,EAAS,MAAA;;AAAM,cAAAC,IAAAf,EAAO,UAAP,gBAAAe,EAAc;AAAA,KAAW,GAEtDC,IAAiBF,EAAS,MAAM;AACpC,UAAI,CAACd,EAAO,MAAO;AAEnB,YAAMiB,IAAI,IAAI,IAAI,2CAA2CjB,EAAO,MAAM,UAAU,EAAE;AAEtF,aAAIK,EAAc,SAChBY,EAAE,aAAa,IAAI,SAASZ,EAAc,KAAK,GAG1CY,EAAE,SAAA;AAAA,IACX,CAAC,GAEKC,IAAUJ,EAAS,MAClBd,EAAO,QAEL;AAAA,MACL;AAAA,QACE,OAAOA,EAAO,MAAM;AAAA,QACpB,OAAOA,EAAO,MAAM;AAAA,MAAA;AAAA,IACtB,IANwB,CAAA,CAQ3B,GAEKmB,IAAaL,EAAS,MAAM;AAChC,cAAQV,EAAO,OAAA;AAAA,QACb,KAAK;AACH,iBAAO;AAAA,QACT,KAAK;AACH,iBAAO;AAAA,QACT,KAAK;AACH,iBAAO;AAAA,QACT,KAAK;AACH,iBAAO;AAAA,QACT,KAAK;AACH,iBAAO;AAAA,QACT;AACE,iBAAO;AAAA,MAAA;AAAA,IAEb,CAAC,GAEKgB,IAAUN,EAAS,MACnBX,EAAO,QAAc,oBAClB,kBACR;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,6 +1,7 @@
1
1
  type __VLS_Props = {
2
2
  canRun: boolean | undefined;
3
3
  statusText: string | undefined;
4
+ isLoading?: boolean;
4
5
  };
5
6
  declare function __VLS_template(): {
6
7
  attrs: Partial<{}>;
@@ -1,44 +1,41 @@
1
- import { defineComponent as p, computed as a, createElementBlock as r, openBlock as l, createElementVNode as n, createCommentVNode as o, normalizeClass as t, renderSlot as d, toDisplayString as u } from "vue";
2
- import "@milaboratories/uikit";
3
- const $ = /* @__PURE__ */ p({
1
+ import { defineComponent as i, computed as d, createElementBlock as a, openBlock as l, createElementVNode as n, createCommentVNode as p, normalizeClass as s, renderSlot as y, toDisplayString as o } from "vue";
2
+ const g = /* @__PURE__ */ i({
4
3
  __name: "RunStatus",
5
4
  props: {
6
5
  canRun: { type: Boolean },
7
- statusText: {}
6
+ statusText: {},
7
+ isLoading: { type: Boolean }
8
8
  },
9
- setup(i) {
10
- const s = i;
11
- a(() => s.canRun ? "Can run" : "Cannot run: check your monetization settings");
12
- const c = a(() => s.canRun ? "Ready to run" : "Cannot run");
13
- return (e, m) => (l(), r("div", null, [
9
+ setup(r) {
10
+ const t = r, u = d(() => t.isLoading ? "Updating..." : t.canRun ? "Ready to run" : "Cannot run");
11
+ return (e, c) => (l(), a("div", null, [
14
12
  n("div", {
15
- class: t([{ [e.$style["can-run"]]: e.canRun }, e.$style.container])
13
+ class: s([{ [e.$style["can-run"]]: e.canRun, [e.$style.loading]: e.isLoading }, e.$style.container])
16
14
  }, [
17
15
  n("div", {
18
- class: t(e.$style.badge)
16
+ class: s(e.$style.badge)
19
17
  }, [
20
18
  n("i", {
21
- class: t(e.$style.blob)
19
+ class: s(e.$style.blob)
22
20
  }, [
23
21
  n("span", null, [
24
22
  n("span", {
25
- class: t(e.$style.dot)
23
+ class: s(e.$style.dot)
26
24
  }, null, 2)
27
25
  ])
28
26
  ], 2),
29
- n("span", null, u(c.value), 1)
27
+ n("span", null, o(u.value), 1)
30
28
  ], 2),
31
- o("", !0),
32
- d(e.$slots, "default")
29
+ y(e.$slots, "default")
33
30
  ], 2),
34
- e.statusText ? (l(), r("div", {
31
+ e.statusText ? (l(), a("div", {
35
32
  key: 0,
36
- class: t(e.$style.statusText)
37
- }, u(e.statusText), 3)) : o("", !0)
33
+ class: s(e.$style.statusText)
34
+ }, o(e.statusText), 3)) : p("", !0)
38
35
  ]));
39
36
  }
40
37
  });
41
38
  export {
42
- $ as default
39
+ g as default
43
40
  };
44
41
  //# sourceMappingURL=RunStatus.vue2.js.map