@ozdao/prometheus-framework 0.2.230 → 0.2.232
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/builder.js +44 -1
- package/dist/builder.mjs +44 -1
- package/dist/prometheus-framework/src/components/Button/Button.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Button/Button.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.cjs +4 -3
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.js +4 -3
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.js.map +1 -1
- package/dist/prometheus-framework/src/modules/pages/pages.client.cjs +283 -288
- package/dist/prometheus-framework/src/modules/pages/pages.client.js +283 -288
- package/package.json +1 -1
- package/src/builder/templates/screen.js +36 -0
- package/src/builder/webpack/webpack.config.spa.js +1 -1
- package/src/modules/events/components/elements/ButtonCheck.vue +14 -17
- package/src/modules/events/components/elements/ButtonCheck1.vue +107 -0
- package/src/modules/events/components/elements/ButtonCheck2.vue +76 -0
package/dist/builder.js
CHANGED
@@ -690,6 +690,49 @@ var webpack_config_server = (projectRoot) => {
|
|
690
690
|
]
|
691
691
|
};
|
692
692
|
};
|
693
|
+
var screen;
|
694
|
+
var hasRequiredScreen;
|
695
|
+
function requireScreen() {
|
696
|
+
if (hasRequiredScreen) return screen;
|
697
|
+
hasRequiredScreen = 1;
|
698
|
+
screen = `
|
699
|
+
<!DOCTYPE html>
|
700
|
+
<html lang="en">
|
701
|
+
<head>
|
702
|
+
<meta charset="UTF-8">
|
703
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
704
|
+
<title>NMS</title>
|
705
|
+
|
706
|
+
<script async src="https://www.googletagmanager.com/gtag/js?id={{googleTagId}}"></script>
|
707
|
+
<script>
|
708
|
+
window.dataLayer = window.dataLayer || [];
|
709
|
+
function gtag(){dataLayer.push(arguments);}
|
710
|
+
gtag('js', new Date());
|
711
|
+
|
712
|
+
gtag('config', '{{googleTagId}}');
|
713
|
+
</script>
|
714
|
+
<script>(function(){var s;(s=document.currentScript||document.scripts[document.scripts.length-1]).parentNode.removeChild(s);}());</script>
|
715
|
+
|
716
|
+
<link rel="apple-touch-icon" sizes="180x180" href="/favicon/apple-touch-icon.png">
|
717
|
+
<link rel="icon" type="image/png" sizes="32x32" href="/favicon/favicon-32x32.png">
|
718
|
+
<link rel="icon" type="image/png" sizes="16x16" href="/favicon/favicon-16x16.png">
|
719
|
+
<link rel="manifest" href="/favicon/site.webmanifest">
|
720
|
+
<link rel="mask-icon" href="/favicon/safari-pinned-tab.svg" color="#5bbad5">
|
721
|
+
|
722
|
+
<link rel="stylesheet" type="text/css" href="/main.css">
|
723
|
+
|
724
|
+
<meta name="msapplication-TileColor" content="#000000">
|
725
|
+
<meta name="theme-color" content="#ffffff">
|
726
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
|
727
|
+
</head>
|
728
|
+
<body>
|
729
|
+
<div id="app"></div>
|
730
|
+
</body>
|
731
|
+
</body>
|
732
|
+
</html>
|
733
|
+
`;
|
734
|
+
return screen;
|
735
|
+
}
|
693
736
|
const path$1 = require$$0$1;
|
694
737
|
const webpack$2 = require$$1;
|
695
738
|
const { merge: merge$1 } = require$$3$2;
|
@@ -722,7 +765,7 @@ var webpack_config_spa = (projectRoot) => {
|
|
722
765
|
}),
|
723
766
|
new HtmlWebpackPlugin({
|
724
767
|
templateContent: async () => {
|
725
|
-
const template2 =
|
768
|
+
const template2 = requireScreen();
|
726
769
|
const meta = {
|
727
770
|
htmlAttrs: 'lang="en"',
|
728
771
|
headAttrs: "",
|
package/dist/builder.mjs
CHANGED
@@ -667,6 +667,49 @@ var webpack_config_server = (projectRoot) => {
|
|
667
667
|
]
|
668
668
|
};
|
669
669
|
};
|
670
|
+
var screen;
|
671
|
+
var hasRequiredScreen;
|
672
|
+
function requireScreen() {
|
673
|
+
if (hasRequiredScreen) return screen;
|
674
|
+
hasRequiredScreen = 1;
|
675
|
+
screen = `
|
676
|
+
<!DOCTYPE html>
|
677
|
+
<html lang="en">
|
678
|
+
<head>
|
679
|
+
<meta charset="UTF-8">
|
680
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
681
|
+
<title>NMS</title>
|
682
|
+
|
683
|
+
<script async src="https://www.googletagmanager.com/gtag/js?id={{googleTagId}}"></script>
|
684
|
+
<script>
|
685
|
+
window.dataLayer = window.dataLayer || [];
|
686
|
+
function gtag(){dataLayer.push(arguments);}
|
687
|
+
gtag('js', new Date());
|
688
|
+
|
689
|
+
gtag('config', '{{googleTagId}}');
|
690
|
+
</script>
|
691
|
+
<script>(function(){var s;(s=document.currentScript||document.scripts[document.scripts.length-1]).parentNode.removeChild(s);}());</script>
|
692
|
+
|
693
|
+
<link rel="apple-touch-icon" sizes="180x180" href="/favicon/apple-touch-icon.png">
|
694
|
+
<link rel="icon" type="image/png" sizes="32x32" href="/favicon/favicon-32x32.png">
|
695
|
+
<link rel="icon" type="image/png" sizes="16x16" href="/favicon/favicon-16x16.png">
|
696
|
+
<link rel="manifest" href="/favicon/site.webmanifest">
|
697
|
+
<link rel="mask-icon" href="/favicon/safari-pinned-tab.svg" color="#5bbad5">
|
698
|
+
|
699
|
+
<link rel="stylesheet" type="text/css" href="/main.css">
|
700
|
+
|
701
|
+
<meta name="msapplication-TileColor" content="#000000">
|
702
|
+
<meta name="theme-color" content="#ffffff">
|
703
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
|
704
|
+
</head>
|
705
|
+
<body>
|
706
|
+
<div id="app"></div>
|
707
|
+
</body>
|
708
|
+
</body>
|
709
|
+
</html>
|
710
|
+
`;
|
711
|
+
return screen;
|
712
|
+
}
|
670
713
|
const path$1 = require$$0$1;
|
671
714
|
const webpack$2 = require$$1;
|
672
715
|
const { merge: merge$1 } = require$$3$2;
|
@@ -699,7 +742,7 @@ var webpack_config_spa = (projectRoot) => {
|
|
699
742
|
}),
|
700
743
|
new HtmlWebpackPlugin({
|
701
744
|
templateContent: async () => {
|
702
|
-
const template2 =
|
745
|
+
const template2 = requireScreen();
|
703
746
|
const meta = {
|
704
747
|
htmlAttrs: 'lang="en"',
|
705
748
|
headAttrs: "",
|
@@ -1,7 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
3
3
|
const vue = require("vue");
|
4
|
-
const Loader = require("../Loader/Loader.
|
4
|
+
const Loader = require("../Loader/Loader.vue.cjs");
|
5
5
|
;/* empty css */
|
6
6
|
const _hoisted_1 = ["disabled"];
|
7
7
|
const _hoisted_2 = { key: 0 };
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { ref, openBlock, createElementBlock, withModifiers, createVNode, Transition, withCtx, renderSlot, toDisplayString, createCommentVNode } from "vue";
|
2
|
-
import Loader from "../Loader/Loader.
|
2
|
+
import Loader from "../Loader/Loader.vue.js";
|
3
3
|
/* empty css */
|
4
4
|
const _hoisted_1 = ["disabled"];
|
5
5
|
const _hoisted_2 = { key: 0 };
|
package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.cjs
CHANGED
@@ -27,7 +27,8 @@ const _sfc_main = {
|
|
27
27
|
await index.BarcodeScanner.removeAllListeners();
|
28
28
|
});
|
29
29
|
async function startScan() {
|
30
|
-
var _a;
|
30
|
+
var _a, _b;
|
31
|
+
(_a = document.querySelector("body")) == null ? void 0 : _a.classList.add("barcode-scanner-active");
|
31
32
|
try {
|
32
33
|
const { camera } = await index.BarcodeScanner.checkPermissions();
|
33
34
|
if (camera !== "granted") {
|
@@ -36,7 +37,7 @@ const _sfc_main = {
|
|
36
37
|
throw new Error("Camera permission is required to scan barcodes");
|
37
38
|
}
|
38
39
|
}
|
39
|
-
(
|
40
|
+
(_b = document.querySelector("body")) == null ? void 0 : _b.classList.add("barcode-scanner-active");
|
40
41
|
isScanning.value = true;
|
41
42
|
await index.BarcodeScanner.addListener("barcodeScanned", async (result) => {
|
42
43
|
await processBarcode(result.barcode);
|
@@ -99,6 +100,6 @@ const _sfc_main = {
|
|
99
100
|
};
|
100
101
|
}
|
101
102
|
};
|
102
|
-
const ButtonCheck = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-
|
103
|
+
const ButtonCheck = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-f8a6dd40"]]);
|
103
104
|
exports.default = ButtonCheck;
|
104
105
|
//# sourceMappingURL=ButtonCheck.vue.cjs.map
|
package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.cjs.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ButtonCheck.vue.cjs","sources":["../../../../../../../src/modules/events/components/elements/ButtonCheck.vue"],"sourcesContent":["<template>\n <div>\n <Button @click=\"startScan\" class=\"bg-main button-small radius-extra button\">\n Check Tickets\n </Button>\n <div v-if=\"isScanning\" class=\"barcode-scanner-modal\">\n <!-- Add any UI elements for the scanner here -->\n <Button @click=\"stopScan\" class=\"stop-scan-button\">Stop Scan</Button>\n </div>\n </div>\n</template>\n\n<script setup>\nimport { ref, onMounted, onUnmounted } from 'vue'\nimport { BarcodeScanner } from '@capacitor-mlkit/barcode-scanning'\nimport Button from '@pf/src/components/Button/Button.vue'\nimport * as tickets from '@pf/src/modules/events/store/tickets'\n\nconst emits = defineEmits(['qrcodecheck'])\nconst error = ref('')\nconst isScanning = ref(false)\n\nonMounted(async () => {\n const { supported } = await BarcodeScanner.isSupported()\n if (!supported) {\n error.value = 'Barcode scanning is not supported on this device'\n }\n})\n\nonUnmounted(async () => {\n await BarcodeScanner.removeAllListeners()\n})\n\nasync function startScan() {\n try {\n const { camera } = await BarcodeScanner.checkPermissions()\n if (camera !== 'granted') {\n const { camera: newStatus } = await BarcodeScanner.requestPermissions()\n if (newStatus !== 'granted') {\n throw new Error('Camera permission is required to scan barcodes')\n }\n }\n\n document.querySelector('body')?.classList.add('barcode-scanner-active')\n isScanning.value = true\n\n await BarcodeScanner.addListener('barcodeScanned', async (result) => {\n await processBarcode(result.barcode)\n })\n\n await BarcodeScanner.startScan()\n } catch (e) {\n error.value = e.message\n alert(`Error: ${error.value}`)\n }\n}\n\nasync function stopScan() {\n try {\n document.querySelector('body')?.classList.remove('barcode-scanner-active')
|
1
|
+
{"version":3,"file":"ButtonCheck.vue.cjs","sources":["../../../../../../../src/modules/events/components/elements/ButtonCheck.vue"],"sourcesContent":["<template>\n <div>\n <Button @click=\"startScan\" class=\"bg-main button-small radius-extra button\">\n Check Tickets\n </Button>\n <div v-if=\"isScanning\" class=\"barcode-scanner-modal\">\n <!-- Add any UI elements for the scanner here -->\n <Button @click=\"stopScan\" class=\"stop-scan-button\">Stop Scan</Button>\n </div>\n </div>\n</template>\n\n<script setup>\nimport { ref, onMounted, onUnmounted } from 'vue'\nimport { BarcodeScanner } from '@capacitor-mlkit/barcode-scanning'\nimport Button from '@pf/src/components/Button/Button.vue'\nimport * as tickets from '@pf/src/modules/events/store/tickets'\n\nconst emits = defineEmits(['qrcodecheck'])\nconst error = ref('')\nconst isScanning = ref(false)\n\nonMounted(async () => {\n const { supported } = await BarcodeScanner.isSupported()\n if (!supported) {\n error.value = 'Barcode scanning is not supported on this device'\n }\n})\n\nonUnmounted(async () => {\n await BarcodeScanner.removeAllListeners()\n})\n\nasync function startScan() {\n document.querySelector('body')?.classList.add('barcode-scanner-active');\n\n try {\n const { camera } = await BarcodeScanner.checkPermissions()\n if (camera !== 'granted') {\n const { camera: newStatus } = await BarcodeScanner.requestPermissions()\n if (newStatus !== 'granted') {\n throw new Error('Camera permission is required to scan barcodes')\n }\n }\n\n document.querySelector('body')?.classList.add('barcode-scanner-active')\n isScanning.value = true\n\n await BarcodeScanner.addListener('barcodeScanned', async (result) => {\n await processBarcode(result.barcode)\n })\n\n await BarcodeScanner.startScan()\n } catch (e) {\n error.value = e.message\n alert(`Error: ${error.value}`)\n }\n}\n\nasync function stopScan() {\n try {\n document.querySelector('body')?.classList.remove('barcode-scanner-active');\n isScanning.value = false\n await BarcodeScanner.stopScan()\n await BarcodeScanner.removeAllListeners()\n } catch (e) {\n error.value = e.message\n alert(`Error stopping scan: ${error.value}`)\n }\n}\n\nasync function processBarcode(barcode) {\n try {\n if (!barcode) {\n throw new Error('Troubles with barcode reading')\n }\n const response = await tickets.actions.update({ _id: barcode, status: 'used', check: true })\n alert(\"Ticket checked. And it's all right!\")\n } catch (e) {\n alert(`Ticket is not found, already used or deactivated!`)\n } finally {\n emits('qrcodecheck')\n await stopScan()\n }\n}\n</script>\n\n<style scoped>\nbody.barcode-scanner-active {\n visibility: hidden;\n --background: transparent;\n --ion-background-color: transparent;\n}\n.barcode-scanner-modal {\n visibility: visible;\n}\n\n@media (prefers-color-scheme: dark) {\n .barcode-scanner-modal {\n --background: transparent;\n --ion-background-color: transparent;\n }\n}\n</style>"],"names":["ref","onMounted","BarcodeScanner","onUnmounted","tickets.actions"],"mappings":";;;;;;;;;;;;;;;;AAkBA,UAAM,QAAQ;AACd,UAAM,QAAQA,IAAG,IAAC,EAAE;AACpB,UAAM,aAAaA,IAAG,IAAC,KAAK;AAE5BC,QAAAA,UAAU,YAAY;AACpB,YAAM,EAAE,UAAS,IAAK,MAAMC,MAAAA,eAAe,YAAa;AACxD,UAAI,CAAC,WAAW;AACd,cAAM,QAAQ;AAAA,MACf;AAAA,IACH,CAAC;AAEDC,QAAAA,YAAY,YAAY;AACtB,YAAMD,MAAAA,eAAe,mBAAoB;AAAA,IAC3C,CAAC;AAED,mBAAe,YAAY;;AACzB,qBAAS,cAAc,MAAM,MAA7B,mBAAgC,UAAU,IAAI;AAE9C,UAAI;AACF,cAAM,EAAE,OAAM,IAAK,MAAMA,MAAAA,eAAe,iBAAkB;AAC1D,YAAI,WAAW,WAAW;AACxB,gBAAM,EAAE,QAAQ,UAAW,IAAG,MAAMA,MAAAA,eAAe,mBAAoB;AACvE,cAAI,cAAc,WAAW;AAC3B,kBAAM,IAAI,MAAM,gDAAgD;AAAA,UACjE;AAAA,QACF;AAED,uBAAS,cAAc,MAAM,MAA7B,mBAAgC,UAAU,IAAI;AAC9C,mBAAW,QAAQ;AAEnB,cAAMA,qBAAe,YAAY,kBAAkB,OAAO,WAAW;AACnE,gBAAM,eAAe,OAAO,OAAO;AAAA,QACzC,CAAK;AAED,cAAMA,MAAAA,eAAe,UAAW;AAAA,MACjC,SAAQ,GAAG;AACV,cAAM,QAAQ,EAAE;AAChB,cAAM,UAAU,MAAM,KAAK,EAAE;AAAA,MAC9B;AAAA,IACH;AAEA,mBAAe,WAAW;;AACxB,UAAI;AACF,uBAAS,cAAc,MAAM,MAA7B,mBAAgC,UAAU,OAAO;AACjD,mBAAW,QAAQ;AACnB,cAAMA,MAAAA,eAAe,SAAU;AAC/B,cAAMA,MAAAA,eAAe,mBAAoB;AAAA,MAC1C,SAAQ,GAAG;AACV,cAAM,QAAQ,EAAE;AAChB,cAAM,wBAAwB,MAAM,KAAK,EAAE;AAAA,MAC5C;AAAA,IACH;AAEA,mBAAe,eAAe,SAAS;AACrC,UAAI;AACF,YAAI,CAAC,SAAS;AACZ,gBAAM,IAAI,MAAM,+BAA+B;AAAA,QAChD;AACD,cAAM,WAAW,MAAME,gBAAgB,OAAO,EAAE,KAAK,SAAS,QAAQ,QAAQ,OAAO,KAAI,CAAE;AAC3F,cAAM,qCAAqC;AAAA,MAC5C,SAAQ,GAAG;AACV,cAAM,mDAAmD;AAAA,MAC7D,UAAY;AACR,cAAM,aAAa;AACnB,cAAM,SAAU;AAAA,MACjB;AAAA,IACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
@@ -25,7 +25,8 @@ const _sfc_main = {
|
|
25
25
|
await BarcodeScanner.removeAllListeners();
|
26
26
|
});
|
27
27
|
async function startScan() {
|
28
|
-
var _a;
|
28
|
+
var _a, _b;
|
29
|
+
(_a = document.querySelector("body")) == null ? void 0 : _a.classList.add("barcode-scanner-active");
|
29
30
|
try {
|
30
31
|
const { camera } = await BarcodeScanner.checkPermissions();
|
31
32
|
if (camera !== "granted") {
|
@@ -34,7 +35,7 @@ const _sfc_main = {
|
|
34
35
|
throw new Error("Camera permission is required to scan barcodes");
|
35
36
|
}
|
36
37
|
}
|
37
|
-
(
|
38
|
+
(_b = document.querySelector("body")) == null ? void 0 : _b.classList.add("barcode-scanner-active");
|
38
39
|
isScanning.value = true;
|
39
40
|
await BarcodeScanner.addListener("barcodeScanned", async (result) => {
|
40
41
|
await processBarcode(result.barcode);
|
@@ -97,7 +98,7 @@ const _sfc_main = {
|
|
97
98
|
};
|
98
99
|
}
|
99
100
|
};
|
100
|
-
const ButtonCheck = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
101
|
+
const ButtonCheck = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-f8a6dd40"]]);
|
101
102
|
export {
|
102
103
|
ButtonCheck as default
|
103
104
|
};
|
package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ButtonCheck.vue.js","sources":["../../../../../../../src/modules/events/components/elements/ButtonCheck.vue"],"sourcesContent":["<template>\n <div>\n <Button @click=\"startScan\" class=\"bg-main button-small radius-extra button\">\n Check Tickets\n </Button>\n <div v-if=\"isScanning\" class=\"barcode-scanner-modal\">\n <!-- Add any UI elements for the scanner here -->\n <Button @click=\"stopScan\" class=\"stop-scan-button\">Stop Scan</Button>\n </div>\n </div>\n</template>\n\n<script setup>\nimport { ref, onMounted, onUnmounted } from 'vue'\nimport { BarcodeScanner } from '@capacitor-mlkit/barcode-scanning'\nimport Button from '@pf/src/components/Button/Button.vue'\nimport * as tickets from '@pf/src/modules/events/store/tickets'\n\nconst emits = defineEmits(['qrcodecheck'])\nconst error = ref('')\nconst isScanning = ref(false)\n\nonMounted(async () => {\n const { supported } = await BarcodeScanner.isSupported()\n if (!supported) {\n error.value = 'Barcode scanning is not supported on this device'\n }\n})\n\nonUnmounted(async () => {\n await BarcodeScanner.removeAllListeners()\n})\n\nasync function startScan() {\n try {\n const { camera } = await BarcodeScanner.checkPermissions()\n if (camera !== 'granted') {\n const { camera: newStatus } = await BarcodeScanner.requestPermissions()\n if (newStatus !== 'granted') {\n throw new Error('Camera permission is required to scan barcodes')\n }\n }\n\n document.querySelector('body')?.classList.add('barcode-scanner-active')\n isScanning.value = true\n\n await BarcodeScanner.addListener('barcodeScanned', async (result) => {\n await processBarcode(result.barcode)\n })\n\n await BarcodeScanner.startScan()\n } catch (e) {\n error.value = e.message\n alert(`Error: ${error.value}`)\n }\n}\n\nasync function stopScan() {\n try {\n document.querySelector('body')?.classList.remove('barcode-scanner-active')
|
1
|
+
{"version":3,"file":"ButtonCheck.vue.js","sources":["../../../../../../../src/modules/events/components/elements/ButtonCheck.vue"],"sourcesContent":["<template>\n <div>\n <Button @click=\"startScan\" class=\"bg-main button-small radius-extra button\">\n Check Tickets\n </Button>\n <div v-if=\"isScanning\" class=\"barcode-scanner-modal\">\n <!-- Add any UI elements for the scanner here -->\n <Button @click=\"stopScan\" class=\"stop-scan-button\">Stop Scan</Button>\n </div>\n </div>\n</template>\n\n<script setup>\nimport { ref, onMounted, onUnmounted } from 'vue'\nimport { BarcodeScanner } from '@capacitor-mlkit/barcode-scanning'\nimport Button from '@pf/src/components/Button/Button.vue'\nimport * as tickets from '@pf/src/modules/events/store/tickets'\n\nconst emits = defineEmits(['qrcodecheck'])\nconst error = ref('')\nconst isScanning = ref(false)\n\nonMounted(async () => {\n const { supported } = await BarcodeScanner.isSupported()\n if (!supported) {\n error.value = 'Barcode scanning is not supported on this device'\n }\n})\n\nonUnmounted(async () => {\n await BarcodeScanner.removeAllListeners()\n})\n\nasync function startScan() {\n document.querySelector('body')?.classList.add('barcode-scanner-active');\n\n try {\n const { camera } = await BarcodeScanner.checkPermissions()\n if (camera !== 'granted') {\n const { camera: newStatus } = await BarcodeScanner.requestPermissions()\n if (newStatus !== 'granted') {\n throw new Error('Camera permission is required to scan barcodes')\n }\n }\n\n document.querySelector('body')?.classList.add('barcode-scanner-active')\n isScanning.value = true\n\n await BarcodeScanner.addListener('barcodeScanned', async (result) => {\n await processBarcode(result.barcode)\n })\n\n await BarcodeScanner.startScan()\n } catch (e) {\n error.value = e.message\n alert(`Error: ${error.value}`)\n }\n}\n\nasync function stopScan() {\n try {\n document.querySelector('body')?.classList.remove('barcode-scanner-active');\n isScanning.value = false\n await BarcodeScanner.stopScan()\n await BarcodeScanner.removeAllListeners()\n } catch (e) {\n error.value = e.message\n alert(`Error stopping scan: ${error.value}`)\n }\n}\n\nasync function processBarcode(barcode) {\n try {\n if (!barcode) {\n throw new Error('Troubles with barcode reading')\n }\n const response = await tickets.actions.update({ _id: barcode, status: 'used', check: true })\n alert(\"Ticket checked. And it's all right!\")\n } catch (e) {\n alert(`Ticket is not found, already used or deactivated!`)\n } finally {\n emits('qrcodecheck')\n await stopScan()\n }\n}\n</script>\n\n<style scoped>\nbody.barcode-scanner-active {\n visibility: hidden;\n --background: transparent;\n --ion-background-color: transparent;\n}\n.barcode-scanner-modal {\n visibility: visible;\n}\n\n@media (prefers-color-scheme: dark) {\n .barcode-scanner-modal {\n --background: transparent;\n --ion-background-color: transparent;\n }\n}\n</style>"],"names":["tickets.actions"],"mappings":";;;;;;;;;;;;;;AAkBA,UAAM,QAAQ;AACd,UAAM,QAAQ,IAAI,EAAE;AACpB,UAAM,aAAa,IAAI,KAAK;AAE5B,cAAU,YAAY;AACpB,YAAM,EAAE,UAAS,IAAK,MAAM,eAAe,YAAa;AACxD,UAAI,CAAC,WAAW;AACd,cAAM,QAAQ;AAAA,MACf;AAAA,IACH,CAAC;AAED,gBAAY,YAAY;AACtB,YAAM,eAAe,mBAAoB;AAAA,IAC3C,CAAC;AAED,mBAAe,YAAY;;AACzB,qBAAS,cAAc,MAAM,MAA7B,mBAAgC,UAAU,IAAI;AAE9C,UAAI;AACF,cAAM,EAAE,OAAM,IAAK,MAAM,eAAe,iBAAkB;AAC1D,YAAI,WAAW,WAAW;AACxB,gBAAM,EAAE,QAAQ,UAAW,IAAG,MAAM,eAAe,mBAAoB;AACvE,cAAI,cAAc,WAAW;AAC3B,kBAAM,IAAI,MAAM,gDAAgD;AAAA,UACjE;AAAA,QACF;AAED,uBAAS,cAAc,MAAM,MAA7B,mBAAgC,UAAU,IAAI;AAC9C,mBAAW,QAAQ;AAEnB,cAAM,eAAe,YAAY,kBAAkB,OAAO,WAAW;AACnE,gBAAM,eAAe,OAAO,OAAO;AAAA,QACzC,CAAK;AAED,cAAM,eAAe,UAAW;AAAA,MACjC,SAAQ,GAAG;AACV,cAAM,QAAQ,EAAE;AAChB,cAAM,UAAU,MAAM,KAAK,EAAE;AAAA,MAC9B;AAAA,IACH;AAEA,mBAAe,WAAW;;AACxB,UAAI;AACF,uBAAS,cAAc,MAAM,MAA7B,mBAAgC,UAAU,OAAO;AACjD,mBAAW,QAAQ;AACnB,cAAM,eAAe,SAAU;AAC/B,cAAM,eAAe,mBAAoB;AAAA,MAC1C,SAAQ,GAAG;AACV,cAAM,QAAQ,EAAE;AAChB,cAAM,wBAAwB,MAAM,KAAK,EAAE;AAAA,MAC5C;AAAA,IACH;AAEA,mBAAe,eAAe,SAAS;AACrC,UAAI;AACF,YAAI,CAAC,SAAS;AACZ,gBAAM,IAAI,MAAM,+BAA+B;AAAA,QAChD;AACD,cAAM,WAAW,MAAMA,QAAgB,OAAO,EAAE,KAAK,SAAS,QAAQ,QAAQ,OAAO,KAAI,CAAE;AAC3F,cAAM,qCAAqC;AAAA,MAC5C,SAAQ,GAAG;AACV,cAAM,mDAAmD;AAAA,MAC7D,UAAY;AACR,cAAM,aAAa;AACnB,cAAM,SAAU;AAAA,MACjB;AAAA,IACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|