@cling-se/widget 0.13.1 → 0.13.3

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 (136) hide show
  1. package/README.md +27 -22
  2. package/dist/{AddClientCallout-fd6dc000.js → AddClientCallout-D9a9MCUX.js} +11 -16
  3. package/dist/{AnswerModal-7c83d608.js → AnswerModal-D8x72yGp.js} +1931 -1948
  4. package/dist/{AttachmentItem-468fd65c.js → AttachmentItem-BvRfBRk6.js} +15 -18
  5. package/dist/{BaseDatePicker-1975be7c.js → BaseDatePicker-BmvP7mNA.js} +139 -142
  6. package/dist/{BaseInput-2ca68242.js → BaseInput-DDxP_o2d.js} +77 -56
  7. package/dist/{BaseUpload-a37ee3a3.js → BaseUpload-BYXTgBXu.js} +208 -212
  8. package/dist/{BlockMedia-9fa610ce.js → BlockMedia-BjasKSPl.js} +6 -8
  9. package/dist/{CCallout-4c253200.js → CCallout-D66Z5Gmx.js} +26 -16
  10. package/dist/{CDropdownItem-7e71da85.js → CDropdownItem-CsY-c0bJ.js} +51 -50
  11. package/dist/{CField-823448be.js → CField-P1DJ6Xte.js} +75 -58
  12. package/dist/{CPhoneFormat-54baa501.js → CPhoneFormat-CWaOjZ6c.js} +5 -7
  13. package/dist/{CSlider.vue_vue_type_style_index_0_lang-ceb19661.js → CTabs.vue_vue_type_style_index_0_scoped_e02a6440_lang-ZmW20zh4.js} +6 -8
  14. package/dist/{ClientAutocomplete-186cc118.js → ClientAutocomplete-CS5EWC8m.js} +11 -13
  15. package/dist/{ClientModal-c5ee3885.js → ClientModal-JsCpUq7_.js} +25 -32
  16. package/dist/{ColorPicker-65a47379.js → ColorPicker-D2qM7zAH.js} +5 -7
  17. package/dist/{CompanyModal-564e2b35.js → CompanyModal-Cy41VR2V.js} +28 -30
  18. package/dist/{ContentWrapper-ac56e749.js → ContentWrapper-BZV21UxA.js} +25 -43
  19. package/dist/{CoverBlockSettings-8949a330.js → CoverBlockSettings-BKSeVFDE.js} +20 -31
  20. package/dist/{DocAnswer-2c0cb58f.js → DocAnswer-kP7uwYPw.js} +5 -12
  21. package/dist/{DocDetails-6522bb1b.js → DocDetails-CQokGcQU.js} +47 -59
  22. package/dist/{DocForm-983d41f5.js → DocForm--8jg79O2.js} +4871 -4946
  23. package/dist/{DocFormSend-787ce614.js → DocFormSend-yMGm0yem.js} +15 -33
  24. package/dist/DocLinks-tR60r1YR.js +38 -0
  25. package/dist/{DocModalBase-60c69c7f.js → DocModalBase-CTK46Brc.js} +8 -10
  26. package/dist/{DocPrint-78c501ca.js → DocPrint-GY73q9cl.js} +6 -10
  27. package/dist/{DocReceipt-ac44b93f.js → DocReceipt-pTTh1XRW.js} +11 -15
  28. package/dist/{DocSendReminder-6cf2424c.js → DocSendReminder-C4MsDwmQ.js} +2 -6
  29. package/dist/{DocTextEditor-81f63135.js → DocTextEditor-C-22iwpJ.js} +2509 -2529
  30. package/dist/{DocTimeline-35106a94.js → DocTimeline-CwcPVMLq.js} +26 -37
  31. package/dist/{DocumentClient-eda56a3c.js → DocumentClient-C9Lm9899.js} +15 -22
  32. package/dist/{DocumentLayout-4005baa4.js → DocumentLayout-BijbYCjw.js} +4510 -4527
  33. package/dist/{DocumentLogotype-0d7d5080.js → DocumentLogotype-EyAhhuyy.js} +20 -22
  34. package/dist/DocumentVoided-D5t8akG5.js +25 -0
  35. package/dist/{EmbedInput-8c301d27.js → EmbedInput-BgRj0APU.js} +9 -12
  36. package/dist/{EmbedSettings-05ab2762.js → EmbedSettings-D2AVYJsR.js} +6 -9
  37. package/dist/ErrorCallout-C2Hz9_Kw.js +28 -0
  38. package/dist/{FilePreviewModal-743fe489.js → FilePreviewModal-qE7IG4wX.js} +8 -14
  39. package/dist/{Flag-a6b545e0.js → Flag-BCpOsl81.js} +18 -20
  40. package/dist/{HeaderSettings-b739ddbb.js → HeaderSettings-BZNxb77S.js} +34 -49
  41. package/dist/{ImageSelectModal-b626ef57.js → ImageSelectModal-FTD0imPM.js} +12 -20
  42. package/dist/{ImageUploadWrapper-be047810.js → ImageUploadWrapper-Dt-_sMWf.js} +356 -384
  43. package/dist/{Index-ea1e223d.js → Index-21Rqe72Y.js} +16 -18
  44. package/dist/{Index-54f457ee.js → Index-5j91zO6f.js} +10 -12
  45. package/dist/{Index-848bb05c.js → Index-BCXTn1sC.js} +11 -13
  46. package/dist/{Index-01224b38.js → Index-BDET3dI8.js} +233 -273
  47. package/dist/{Index-071b97c8.js → Index-BFaUGjUB.js} +24 -26
  48. package/dist/{Index-8cfeac73.js → Index-BKlCGLNd.js} +80 -90
  49. package/dist/{Index-c349151b.js → Index-BoLTPa35.js} +7 -9
  50. package/dist/{Index-ecbffb52.js → Index-CBbfIsZN.js} +18 -31
  51. package/dist/{Index-8f237754.js → Index-CFdROMC3.js} +6 -8
  52. package/dist/{Index-8ea1a895.js → Index-CJODaFN6.js} +16 -21
  53. package/dist/{Index-4298f3e2.js → Index-C_xGmfku.js} +13 -15
  54. package/dist/Index-CcukWQRL.js +21 -0
  55. package/dist/Index-Cl5xExRO.js +24 -0
  56. package/dist/{Index-b56a2d94.js → Index-Cp6jRq1R.js} +20 -23
  57. package/dist/{Index-4b09d0fa.js → Index-CuoBquDv.js} +116 -118
  58. package/dist/{Index-4f119d80.js → Index-Cwl2NC2m.js} +459 -510
  59. package/dist/{Index-fe0e805b.js → Index-D-bjhn09.js} +51 -58
  60. package/dist/{Index-a52df5e2.js → Index-D2nfeQ5x.js} +14 -21
  61. package/dist/{Index-caebb616.js → Index-D5bdxU_9.js} +4 -6
  62. package/dist/{Index-6b66b9ff.js → Index-DFtgMiak.js} +4 -6
  63. package/dist/{Index-3f02e8ca.js → Index-DGZ31KnZ.js} +8 -11
  64. package/dist/{Index-5bf8b9b7.js → Index-DJR3xxCd.js} +8 -10
  65. package/dist/{Index-8ebe3371.js → Index-DMY-Sq_M.js} +19 -26
  66. package/dist/Index-DlhEipBL.js +26 -0
  67. package/dist/Index-Dv7cLrE4.js +52 -0
  68. package/dist/{Index-b2de3af8.js → Index-In1yv5wC.js} +2 -4
  69. package/dist/{Index-8e82da74.js → Index-UamytEM4.js} +12 -15
  70. package/dist/{Index-63aea2b8.js → Index-WMiYQ88f.js} +12 -21
  71. package/dist/{Index-a3920b7b.js → Index-WNn-Ygm3.js} +9 -11
  72. package/dist/{Index-56e4127a.js → Index-_IbAcZwx.js} +29 -29
  73. package/dist/{Index-f1bf6520.js → Index-djTZz7Ns.js} +6 -8
  74. package/dist/{Index-c049a6e2.js → Index-sfUDC-CQ.js} +7 -9
  75. package/dist/Index-tPwll4sB.js +49 -0
  76. package/dist/{Index-97c18be1.js → Index-xgTLuqmb.js} +5 -9
  77. package/dist/{InputToggleRow-f86fdf91.js → InputToggleRow-BEO32u0P.js} +3 -5
  78. package/dist/{ManualPopover-d7c2a780.js → ManualPopover-BBh0cUw5.js} +1 -3
  79. package/dist/{MediaWrapper-2381bc95.js → MediaWrapper-CoMogZxx.js} +3 -6
  80. package/dist/{NotBindingText-a9eae0b2.js → NotBindingText-BT1Q6RMl.js} +5 -7
  81. package/dist/{PackageGroup-95d99d03.js → PackageGroup-FdTMDsjx.js} +35 -59
  82. package/dist/{PdfTerms-4a6d6067.js → PdfTerms-DyPWsQVj.js} +11 -18
  83. package/dist/{PdfViewer-8d7f2143.js → PdfViewer-DypsavPs.js} +25 -29
  84. package/dist/{PlainHtml-9d3f71d6.js → PlainHtml-BfBjldPv.js} +5 -7
  85. package/dist/{PriceHeader-f2cb6529.js → PriceHeader-C7uxm0UF.js} +113 -130
  86. package/dist/SearchApi-BFRaO76p.js +161 -0
  87. package/dist/{Setup-74c47337.js → Setup-5Bd2oKy5.js} +9 -11
  88. package/dist/{TermsSettings-0c5a6cad.js → TermsSettings-qp4QTvSS.js} +6 -12
  89. package/dist/{ThemeColorRow-bbf4f527.js → ThemeColorRow-BVO3w229.js} +8 -10
  90. package/dist/{ToggleBinding-50af6f0f.js → ToggleBinding-kUXMHL_T.js} +7 -9
  91. package/dist/{UploadModal-d2757015.js → UploadModal-pc_pdLKq.js} +16 -19
  92. package/dist/{VideoPlayerInput-cb6c91e8.js → VideoPlayerInput-D_pGBwqs.js} +6 -8
  93. package/dist/{VideoPlayerSettings-bff30628.js → VideoPlayerSettings-j923whT9.js} +7 -11
  94. package/dist/{VideoSelectModal-9ec9ecfc.js → VideoSelectModal-YwoeiHje.js} +20 -28
  95. package/dist/{answerDocumentMixin-9368852c.js → answerDocumentMixin-B_U73rNw.js} +5 -5
  96. package/dist/{debounce-f8aeabc5.js → debounce-BsRaWg59.js} +3 -3
  97. package/dist/{dom-962579a6.js → dom-CPYqHOIw.js} +2 -2
  98. package/dist/{focusDrawerMixin-e2312605.js → focusDrawerMixin-JAewKqED.js} +1 -1
  99. package/dist/{formComponentsInstall-6894b988.js → formComponentsInstall-D4n0po7Z.js} +1198 -1171
  100. package/dist/{formDrawerState-b99be3a7.js → formDrawerState-zC8aJ2vd.js} +1 -1
  101. package/dist/{formValidationMixin-a9a35060.js → formValidationMixin-BZkYLjQt.js} +2 -2
  102. package/dist/{index-b2348f09.js → index-B3HvM0tt.js} +39 -44
  103. package/dist/{index-96e9db00.js → index-CoyXZLrG.js} +41 -59
  104. package/dist/{index-c9186403.js → index-DMs1rzm_.js} +14 -16
  105. package/dist/{IsPremiumPreStep-27645ee9.js → index-DNfDl5X3.js} +531 -566
  106. package/dist/{index-d35e9363.js → index-RA-At4z5.js} +5 -3
  107. package/dist/{index-9d1ade78.js → index-g89MyoBh.js} +3 -5
  108. package/dist/index.es.js +3 -3
  109. package/dist/index.umd.js +1019 -1028
  110. package/dist/{main-b9ea9725.js → main-DdTHuJSP.js} +21733 -21943
  111. package/dist/{mapFormMixin-de4a37c3.js → mapFormMixin-jUVHvbDZ.js} +1 -2
  112. package/dist/{vuedraggable.umd-1b113186.js → omit-Cu3_dgaV.js} +143 -133
  113. package/dist/{publicSenderState-a2c0cc9d.js → publicSenderState-DbENjyL4.js} +1 -1
  114. package/dist/{splitpanes-ba7897bf.js → splitpanes-BHUVsCZF.js} +38 -42
  115. package/dist/style.css +2 -2
  116. package/dist/{throttle-53a6c735.js → throttle-DP3fD_7G.js} +2 -2
  117. package/dist/{tinycolor-071e269c.js → tinycolor-BK1IhVpb.js} +6 -6
  118. package/dist/{tippy.esm-1b89bf69.js → tippy.esm-BZYdaq3J.js} +226 -232
  119. package/dist/{utils-44a35f52.js → utils-D8WP6t_z.js} +1 -1
  120. package/package.json +2 -2
  121. package/dist/DocLinks-d6b1b080.js +0 -41
  122. package/dist/DocumentVoided-fe1bd505.js +0 -27
  123. package/dist/ErrorCallout-87033b39.js +0 -30
  124. package/dist/Index-6bfbbbd2.js +0 -61
  125. package/dist/Index-6c21af02.js +0 -28
  126. package/dist/Index-cbd0f3f6.js +0 -23
  127. package/dist/Index-f006e9fe.js +0 -26
  128. package/dist/Index-fc0516f6.js +0 -54
  129. package/dist/SearchApi-2a59cdc7.js +0 -167
  130. package/dist/index-3671e1b7.js +0 -14
  131. package/dist/index-805c56e4.js +0 -4
  132. /package/dist/{CField.vue_vue_type_style_index_0_lang-4ed993c7.js → CField.vue_vue_type_style_index_0_lang-l0sNRNKZ.js} +0 -0
  133. /package/dist/{anime.es-e284c852.js → anime.es-BrPTThYb.js} +0 -0
  134. /package/dist/{color-c1606adc.js → color-TdtKxwVa.js} +0 -0
  135. /package/dist/{i18nMessages-6b279c15.js → i18nMessages-Chz_lxGG.js} +0 -0
  136. /package/dist/{vuex.esm-4a0fff7c.js → vuex.esm-DKGl8mcw.js} +0 -0
@@ -1,797 +1,28 @@
1
- import { a as nt } from "./anime.es-e284c852.js";
2
- import { aq as It, h as Ct, n as ot, ar as Mt, L as Tt, as as Rt, at as $t, au as Dt, g as wt, e as At, J as Bt } from "./main-b9ea9725.js";
3
- import { a as Ut } from "./vuex.esm-4a0fff7c.js";
4
- import { m as ft } from "./mapFormMixin-de4a37c3.js";
5
- import { C as Lt } from "./CField-823448be.js";
6
- import "./CField.vue_vue_type_style_index_0_lang-4ed993c7.js";
7
- const Nt = () => {
8
- const v = window.location.host.split(".");
9
- return v && v[0];
10
- }, Ot = Nt() === "fortnox";
11
- const zt = [
12
- "enjoyedExperience",
13
- // boolean value
14
- "whatToImprove"
15
- // string value
16
- ], Yt = {
17
- props: {
18
- publicId: {
19
- type: String,
20
- default: ""
21
- }
22
- },
23
- mixins: [ft([])],
24
- created() {
25
- this.$nextTick(() => {
26
- this.startAnimation();
27
- });
28
- },
29
- data() {
30
- return {
31
- page: "start",
32
- whatToImprove: ""
33
- };
34
- },
35
- methods: {
36
- async submitFeedback({ type: v, data: r }) {
37
- if (!this.publicId)
38
- throw Error("Missing param publicId");
39
- if (!v)
40
- throw Error("Missing param type");
41
- if (!zt.includes(v))
42
- throw Error("Invalid feedback type");
43
- if (!r)
44
- throw Error("Missing param data");
45
- let n = "positive";
46
- try {
47
- It.feedback(this.publicId, { type: v, data: r }), v === "enjoyedExperience" && !r.value && (n = "negative"), v === "whatToImprove" && (n = "negative.success"), Ot && n !== "negative" && (n = "custom");
48
- } catch (g) {
49
- Ct(g, { showMessage: !1 });
50
- } finally {
51
- this.goTo(n);
52
- }
53
- },
54
- async goTo(v) {
55
- if (this.$emit("page", v), v === "positive" || v === "negative") {
56
- this.$refs.start.style.opacity = 0, this.page = "intermediate", setTimeout(() => {
57
- this.page = v;
58
- }, 2e3);
59
- return;
60
- }
61
- this.page = v;
62
- },
63
- startAnimation() {
64
- const v = this.$refs.feedbackBg;
65
- v.gradOneXPos = 0, v.gradOneYPos = 0, v.gradTwoXPos = 80, v.gradTwoYPos = 20, v.gradThreeXPos = 20, v.gradThreeYPos = 80, v.gradFourXPos = 80, v.gradFourYPos = 80, nt({
66
- targets: v,
67
- duration: 12e3,
68
- direction: "alternate",
69
- easing: "linear",
70
- loop: !0,
71
- gradOneXPos: [10, 5, 0, -10],
72
- gradOneYPos: [10, 20, 25, 30],
73
- gradTwoXPos: [25, 20, 15, 10, 25],
74
- gradTwoYPos: [65, 55, 40, 65, 80],
75
- gradThreeXPos: [25, 20, 10, 15, 25],
76
- gradThreeYPos: [65, 50, 45, 60, 80],
77
- gradFourXPos: [85, 80, 75, 70, 95],
78
- gradFourYPos: [90, 100, 120, 100, 85],
79
- update() {
80
- v.style.setProperty(
81
- "--gradOneXPos",
82
- `${v.gradOneXPos}%`
83
- ), v.style.setProperty(
84
- "--gradOneYPos",
85
- `${v.gradOneYPos}%`
86
- ), v.style.setProperty(
87
- "--gradTwoXPos",
88
- `${v.gradTwoXPos}%`
89
- ), v.style.setProperty(
90
- "--gradTwoYPos",
91
- `${v.gradTwoYPos}%`
92
- ), v.style.setProperty(
93
- "--gradThreeXPos",
94
- `${v.gradThreeXPos}%`
95
- ), v.style.setProperty(
96
- "--gradThreeYPos",
97
- `${v.gradThreeYPos}%`
98
- ), v.style.setProperty(
99
- "--gradFourXPos",
100
- `${v.gradFourXPos}%`
101
- ), v.style.setProperty(
102
- "--gradFourYPos",
103
- `${v.gradFourYPos}%`
104
- );
105
- }
106
- });
107
- },
108
- // animations
109
- leave(v, r) {
110
- nt({
111
- targets: v,
112
- // height: 0,
113
- // opacity: [1, 0],
114
- opacity: 0,
115
- duration: 500,
116
- easing: "easeInOutCubic",
117
- complete: r
118
- });
119
- },
120
- enter(v, r) {
121
- nt({
122
- targets: v,
123
- delay: this.page === "intermediate" ? 250 : 0,
124
- duration: 500,
125
- opacity: [0, 1],
126
- easing: "easeInOutCubic",
127
- complete: r
128
- });
129
- }
130
- }
131
- };
132
- var Wt = function() {
133
- var r = this, n = r._self._c;
134
- return n("div", { staticClass: "f-feedback" }, [n("div", { ref: "feedbackBg", staticClass: "f-bg" }), n("div", { staticClass: "f-container" }, [n("transition", { attrs: { css: !1, mode: "out-in" }, on: { enter: r.enter, leave: r.leave } }, [r.page === "start" ? n("div", { key: "start", ref: "start", staticClass: "flex w-full flex-col items-center justify-center", staticStyle: { transition: "opacity 250ms" } }, [n("div", { staticStyle: { "padding-bottom": "calc(1.5 * var(--rem))", "font-size": "14px", "font-weight": "500" }, domProps: { textContent: r._s(r._document.$t("answerFeedback.start.title")) } }), n("div", [n("CButton", { staticClass: "feedback-btn", attrs: { "icon-left": "thumbsdown", size: "small", pattern: "secondary" }, on: { click: function(g) {
135
- return r.submitFeedback({
136
- type: "enjoyedExperience",
137
- data: { value: !1 }
138
- });
139
- } } }, [r._v(r._s(r._document.$t("answerFeedback.start.no")))]), n("CButton", { staticClass: "feedback-btn", staticStyle: { "margin-left": "calc(0.75 * var(--rem))" }, attrs: { "icon-left": "thumbsup", size: "small", pattern: "secondary" }, on: { click: function(g) {
140
- return r.submitFeedback({
141
- type: "enjoyedExperience",
142
- data: { value: !0 }
143
- });
144
- } } }, [r._v(r._s(r._document.$t("answerFeedback.start.yes")))])], 1)]) : r.page === "intermediate" ? n("div", { key: "intermediate", staticStyle: { height: "100%", display: "flex", "flex-direction": "column" } }, [n("div", { staticStyle: { flex: "1 1 auto", display: "flex", "flex-direction": "column", "justify-content": "center", "align-items": "center" } }, [n("div", { staticClass: "f-title", domProps: { textContent: r._s(r._document.$t("answerFeedback.intermediate.title")) } })])]) : r.page === "positive" ? n("div", { key: "positive", staticStyle: { height: "100%", display: "flex", "flex-direction": "column" } }, [n("div", { staticStyle: { flex: "1 1 auto", display: "flex", "flex-direction": "column", "justify-content": "center", "align-items": "center" } }, [n("div", { staticClass: "f-title", domProps: { textContent: r._s(r._document.$t("answerFeedback.yes.title")) } }), n("div", { domProps: { textContent: r._s(r._document.$t("answerFeedback.yes.text")) } })]), n("CButton", { staticClass: "a-btn", staticStyle: { "margin-bottom": "0.5em" }, attrs: { type: "secondary", wide: "", tag: "a", href: "/register?utm_source=document&utm_medium=feedback-modal&utm_campaign=signup&utm_content=positive-exp", target: "_blank" }, domProps: { textContent: r._s(r._document.$t("answerFeedback.yes.action")) } }), n("CButton", { staticClass: "a-btn", attrs: { wide: "", tag: "a", href: `https://${r.$t(
145
- "_common:brand.domain"
146
- )}?utm_source=document&utm_medium=feedback-modal&utm_campaign=learn-more&utm_content=positive-exp`, target: "_blank" }, domProps: { textContent: r._s(r._document.$t("answerFeedback.yes.secondary")) } })], 1) : r.page === "negative" ? n("div", { key: "negative", staticStyle: { height: "100%", display: "flex", "flex-direction": "column" } }, [n("div", { staticStyle: { flex: "1 1 auto", display: "flex", "flex-direction": "column", "justify-content": "center", "align-items": "center" } }, [n("div", { staticClass: "f-title", domProps: { textContent: r._s(r._document.$t("answerFeedback.no.start.title")) } }), n("div", { domProps: { textContent: r._s(r._document.$t("answerFeedback.no.start.text")) } }), n("CInput", { staticClass: "input-style", staticStyle: { margin: "2em 0" }, attrs: { placeholder: r._document.$t("answerFeedback.no.start.placeholder"), type: "textarea" }, model: { value: r.whatToImprove, callback: function(g) {
147
- r.whatToImprove = g;
148
- }, expression: "whatToImprove" } })], 1), n("CButton", { staticClass: "a-btn", attrs: { wide: "" }, domProps: { textContent: r._s(r._document.$t("answerFeedback.no.start.action")) }, on: { click: function(g) {
149
- return r.submitFeedback({
150
- type: "whatToImprove",
151
- data: { value: r.whatToImprove }
152
- });
153
- } } })], 1) : r.page === "negative.success" ? n("div", { key: "success", staticStyle: { height: "100%", display: "flex", "flex-direction": "column" } }, [n("div", { staticStyle: { flex: "1 1 auto", display: "flex", "flex-direction": "column", "justify-content": "center", "align-items": "center" } }, [n("div", { staticClass: "f-title", domProps: { textContent: r._s(r._document.$t("answerFeedback.no.success.title")) } }), n("div", { domProps: { textContent: r._s(r._document.$t("answerFeedback.no.success.text")) } })]), n("CButton", { staticClass: "a-btn", staticStyle: { "margin-bottom": "0.5em" }, attrs: { tag: "a", href: `https://${r.$t(
154
- "_common:brand.domain"
155
- )}?utm_source=document&utm_medium=feedback-modal&utm_campaign=learn-more&utm_content=negative-exp`, target: "_blank", wide: "", type: "secondary" }, domProps: { textContent: r._s(r._document.$t("answerFeedback.no.success.action")) } }), n("CButton", { staticClass: "a-btn", attrs: { wide: "" }, domProps: { textContent: r._s(r._document.$t("answerFeedback.no.success.secondary")) }, on: { click: function(g) {
156
- return r.$emit("close");
157
- } } })], 1) : r.page === "custom" ? n("div", { key: "success", staticStyle: { height: "100%", display: "flex", "flex-direction": "column" } }, [n("div", { staticStyle: { flex: "1 1 auto", display: "flex", "flex-direction": "column", "justify-content": "center", "align-items": "center" } }, [n("div", { staticClass: "f-title", domProps: { textContent: r._s(r._document.$t("answerFeedback.custom.title")) } }), n("div", { domProps: { textContent: r._s(r._document.$t("answerFeedback.custom.text")) } })]), n("CButton", { staticClass: "a-btn", attrs: { type: "secondary", wide: "" }, domProps: { textContent: r._s(r._document.$t("answerFeedback.custom.action")) }, on: { click: function(g) {
158
- return r.$emit("close");
159
- } } })], 1) : r._e()])], 1)]);
160
- }, Ht = [], jt = /* @__PURE__ */ ot(
161
- Yt,
162
- Wt,
163
- Ht,
164
- !1,
165
- null,
166
- "67b518b8",
167
- null,
168
- null
169
- );
170
- const Gt = jt.exports;
1
+ import { m as ft } from "./mapFormMixin-jUVHvbDZ.js";
2
+ import { as as It, L as Tt, h as Et, at as Mt, au as Rt, av as $t, n as ot, aw as Dt, g as yt, e as At, J as Bt } from "./main-DdTHuJSP.js";
3
+ import { a as nt } from "./anime.es-BrPTThYb.js";
4
+ import { a as Ut } from "./vuex.esm-DKGl8mcw.js";
5
+ import { C as Lt } from "./CField-P1DJ6Xte.js";
171
6
  /*!
172
- * Signature Pad v4.0.10 | https://github.com/szimek/signature_pad
173
- * (c) 2022 Szymon Nowak | Released under the MIT license
7
+ * vue-qrcode v1.0.2
8
+ * https://fengyuanchen.github.io/vue-qrcode
9
+ *
10
+ * Copyright 2018-present Chen Fengyuan
11
+ * Released under the MIT license
12
+ *
13
+ * Date: 2020-01-18T06:04:33.222Z
174
14
  */
175
- class pt {
176
- constructor(r, n, g, u) {
177
- if (isNaN(r) || isNaN(n))
178
- throw new Error(`Point is invalid: (${r}, ${n})`);
179
- this.x = +r, this.y = +n, this.pressure = g || 0, this.time = u || Date.now();
180
- }
181
- distanceTo(r) {
182
- return Math.sqrt(Math.pow(this.x - r.x, 2) + Math.pow(this.y - r.y, 2));
183
- }
184
- equals(r) {
185
- return this.x === r.x && this.y === r.y && this.pressure === r.pressure && this.time === r.time;
186
- }
187
- velocityFrom(r) {
188
- return this.time !== r.time ? this.distanceTo(r) / (this.time - r.time) : 0;
189
- }
190
- }
191
- class bt {
192
- constructor(r, n, g, u, h, d) {
193
- this.startPoint = r, this.control2 = n, this.control1 = g, this.endPoint = u, this.startWidth = h, this.endWidth = d;
194
- }
195
- static fromPoints(r, n) {
196
- const g = this.calculateControlPoints(r[0], r[1], r[2]).c2, u = this.calculateControlPoints(r[1], r[2], r[3]).c1;
197
- return new bt(r[1], g, u, r[2], n.start, n.end);
198
- }
199
- static calculateControlPoints(r, n, g) {
200
- const u = r.x - n.x, h = r.y - n.y, d = n.x - g.x, c = n.y - g.y, i = { x: (r.x + n.x) / 2, y: (r.y + n.y) / 2 }, s = { x: (n.x + g.x) / 2, y: (n.y + g.y) / 2 }, f = Math.sqrt(u * u + h * h), a = Math.sqrt(d * d + c * c), w = i.x - s.x, x = i.y - s.y, b = a / (f + a), A = { x: s.x + w * b, y: s.y + x * b }, F = n.x - A.x, M = n.y - A.y;
201
- return {
202
- c1: new pt(i.x + F, i.y + M),
203
- c2: new pt(s.x + F, s.y + M)
204
- };
205
- }
206
- length() {
207
- let n = 0, g, u;
208
- for (let h = 0; h <= 10; h += 1) {
209
- const d = h / 10, c = this.point(d, this.startPoint.x, this.control1.x, this.control2.x, this.endPoint.x), i = this.point(d, this.startPoint.y, this.control1.y, this.control2.y, this.endPoint.y);
210
- if (h > 0) {
211
- const s = c - g, f = i - u;
212
- n += Math.sqrt(s * s + f * f);
213
- }
214
- g = c, u = i;
215
- }
216
- return n;
217
- }
218
- point(r, n, g, u, h) {
219
- return n * (1 - r) * (1 - r) * (1 - r) + 3 * g * (1 - r) * (1 - r) * r + 3 * u * (1 - r) * r * r + h * r * r * r;
220
- }
221
- }
222
- class Kt {
223
- constructor() {
224
- try {
225
- this._et = new EventTarget();
226
- } catch {
227
- this._et = document;
228
- }
229
- }
230
- addEventListener(r, n, g) {
231
- this._et.addEventListener(r, n, g);
232
- }
233
- dispatchEvent(r) {
234
- return this._et.dispatchEvent(r);
235
- }
236
- removeEventListener(r, n, g) {
237
- this._et.removeEventListener(r, n, g);
238
- }
15
+ function gt() {
16
+ throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs");
239
17
  }
240
- function Vt(v, r = 250) {
241
- let n = 0, g = null, u, h, d;
242
- const c = () => {
243
- n = Date.now(), g = null, u = v.apply(h, d), g || (h = null, d = []);
244
- };
245
- return function(...s) {
246
- const f = Date.now(), a = r - (f - n);
247
- return h = this, d = s, a <= 0 || a > r ? (g && (clearTimeout(g), g = null), n = f, u = v.apply(h, d), g || (h = null, d = [])) : g || (g = window.setTimeout(c, a)), u;
248
- };
18
+ function Nt(v, r) {
19
+ return r = { exports: {} }, v(r, r.exports), r.exports;
249
20
  }
250
- let Jt = class Et extends Kt {
251
- constructor(r, n = {}) {
252
- super(), this.canvas = r, this._handleMouseDown = (g) => {
253
- g.buttons === 1 && (this._drawningStroke = !0, this._strokeBegin(g));
254
- }, this._handleMouseMove = (g) => {
255
- this._drawningStroke && this._strokeMoveUpdate(g);
256
- }, this._handleMouseUp = (g) => {
257
- g.buttons === 1 && this._drawningStroke && (this._drawningStroke = !1, this._strokeEnd(g));
258
- }, this._handleTouchStart = (g) => {
259
- if (g.cancelable && g.preventDefault(), g.targetTouches.length === 1) {
260
- const u = g.changedTouches[0];
261
- this._strokeBegin(u);
262
- }
263
- }, this._handleTouchMove = (g) => {
264
- g.cancelable && g.preventDefault();
265
- const u = g.targetTouches[0];
266
- this._strokeMoveUpdate(u);
267
- }, this._handleTouchEnd = (g) => {
268
- if (g.target === this.canvas) {
269
- g.cancelable && g.preventDefault();
270
- const h = g.changedTouches[0];
271
- this._strokeEnd(h);
272
- }
273
- }, this._handlePointerStart = (g) => {
274
- this._drawningStroke = !0, g.preventDefault(), this._strokeBegin(g);
275
- }, this._handlePointerMove = (g) => {
276
- this._drawningStroke && (g.preventDefault(), this._strokeMoveUpdate(g));
277
- }, this._handlePointerEnd = (g) => {
278
- this._drawningStroke && (g.preventDefault(), this._drawningStroke = !1, this._strokeEnd(g));
279
- }, this.velocityFilterWeight = n.velocityFilterWeight || 0.7, this.minWidth = n.minWidth || 0.5, this.maxWidth = n.maxWidth || 2.5, this.throttle = "throttle" in n ? n.throttle : 16, this.minDistance = "minDistance" in n ? n.minDistance : 5, this.dotSize = n.dotSize || 0, this.penColor = n.penColor || "black", this.backgroundColor = n.backgroundColor || "rgba(0,0,0,0)", this._strokeMoveUpdate = this.throttle ? Vt(Et.prototype._strokeUpdate, this.throttle) : Et.prototype._strokeUpdate, this._ctx = r.getContext("2d"), this.clear(), this.on();
280
- }
281
- clear() {
282
- const { _ctx: r, canvas: n } = this;
283
- r.fillStyle = this.backgroundColor, r.clearRect(0, 0, n.width, n.height), r.fillRect(0, 0, n.width, n.height), this._data = [], this._reset(this._getPointGroupOptions()), this._isEmpty = !0;
284
- }
285
- fromDataURL(r, n = {}) {
286
- return new Promise((g, u) => {
287
- const h = new Image(), d = n.ratio || window.devicePixelRatio || 1, c = n.width || this.canvas.width / d, i = n.height || this.canvas.height / d, s = n.xOffset || 0, f = n.yOffset || 0;
288
- this._reset(this._getPointGroupOptions()), h.onload = () => {
289
- this._ctx.drawImage(h, s, f, c, i), g();
290
- }, h.onerror = (a) => {
291
- u(a);
292
- }, h.crossOrigin = "anonymous", h.src = r, this._isEmpty = !1;
293
- });
294
- }
295
- toDataURL(r = "image/png", n) {
296
- switch (r) {
297
- case "image/svg+xml":
298
- return this._toSVG();
299
- default:
300
- return this.canvas.toDataURL(r, n);
301
- }
302
- }
303
- on() {
304
- this.canvas.style.touchAction = "none", this.canvas.style.msTouchAction = "none", this.canvas.style.userSelect = "none";
305
- const r = /Macintosh/.test(navigator.userAgent) && "ontouchstart" in document;
306
- window.PointerEvent && !r ? this._handlePointerEvents() : (this._handleMouseEvents(), "ontouchstart" in window && this._handleTouchEvents());
307
- }
308
- off() {
309
- this.canvas.style.touchAction = "auto", this.canvas.style.msTouchAction = "auto", this.canvas.style.userSelect = "auto", this.canvas.removeEventListener("pointerdown", this._handlePointerStart), this.canvas.removeEventListener("pointermove", this._handlePointerMove), this.canvas.ownerDocument.removeEventListener("pointerup", this._handlePointerEnd), this.canvas.removeEventListener("mousedown", this._handleMouseDown), this.canvas.removeEventListener("mousemove", this._handleMouseMove), this.canvas.ownerDocument.removeEventListener("mouseup", this._handleMouseUp), this.canvas.removeEventListener("touchstart", this._handleTouchStart), this.canvas.removeEventListener("touchmove", this._handleTouchMove), this.canvas.removeEventListener("touchend", this._handleTouchEnd);
310
- }
311
- isEmpty() {
312
- return this._isEmpty;
313
- }
314
- fromData(r, { clear: n = !0 } = {}) {
315
- n && this.clear(), this._fromData(r, this._drawCurve.bind(this), this._drawDot.bind(this)), this._data = this._data.concat(r);
316
- }
317
- toData() {
318
- return this._data;
319
- }
320
- _getPointGroupOptions(r) {
321
- return {
322
- penColor: r && "penColor" in r ? r.penColor : this.penColor,
323
- dotSize: r && "dotSize" in r ? r.dotSize : this.dotSize,
324
- minWidth: r && "minWidth" in r ? r.minWidth : this.minWidth,
325
- maxWidth: r && "maxWidth" in r ? r.maxWidth : this.maxWidth,
326
- velocityFilterWeight: r && "velocityFilterWeight" in r ? r.velocityFilterWeight : this.velocityFilterWeight
327
- };
328
- }
329
- _strokeBegin(r) {
330
- this.dispatchEvent(new CustomEvent("beginStroke", { detail: r }));
331
- const n = this._getPointGroupOptions(), g = Object.assign(Object.assign({}, n), { points: [] });
332
- this._data.push(g), this._reset(n), this._strokeUpdate(r);
333
- }
334
- _strokeUpdate(r) {
335
- if (this._data.length === 0) {
336
- this._strokeBegin(r);
337
- return;
338
- }
339
- this.dispatchEvent(new CustomEvent("beforeUpdateStroke", { detail: r }));
340
- const n = r.clientX, g = r.clientY, u = r.pressure !== void 0 ? r.pressure : r.force !== void 0 ? r.force : 0, h = this._createPoint(n, g, u), d = this._data[this._data.length - 1], c = d.points, i = c.length > 0 && c[c.length - 1], s = i ? h.distanceTo(i) <= this.minDistance : !1, f = this._getPointGroupOptions(d);
341
- if (!i || !(i && s)) {
342
- const a = this._addPoint(h, f);
343
- i ? a && this._drawCurve(a, f) : this._drawDot(h, f), c.push({
344
- time: h.time,
345
- x: h.x,
346
- y: h.y,
347
- pressure: h.pressure
348
- });
349
- }
350
- this.dispatchEvent(new CustomEvent("afterUpdateStroke", { detail: r }));
351
- }
352
- _strokeEnd(r) {
353
- this._strokeUpdate(r), this.dispatchEvent(new CustomEvent("endStroke", { detail: r }));
354
- }
355
- _handlePointerEvents() {
356
- this._drawningStroke = !1, this.canvas.addEventListener("pointerdown", this._handlePointerStart), this.canvas.addEventListener("pointermove", this._handlePointerMove), this.canvas.ownerDocument.addEventListener("pointerup", this._handlePointerEnd);
357
- }
358
- _handleMouseEvents() {
359
- this._drawningStroke = !1, this.canvas.addEventListener("mousedown", this._handleMouseDown), this.canvas.addEventListener("mousemove", this._handleMouseMove), this.canvas.ownerDocument.addEventListener("mouseup", this._handleMouseUp);
360
- }
361
- _handleTouchEvents() {
362
- this.canvas.addEventListener("touchstart", this._handleTouchStart), this.canvas.addEventListener("touchmove", this._handleTouchMove), this.canvas.addEventListener("touchend", this._handleTouchEnd);
363
- }
364
- _reset(r) {
365
- this._lastPoints = [], this._lastVelocity = 0, this._lastWidth = (r.minWidth + r.maxWidth) / 2, this._ctx.fillStyle = r.penColor;
366
- }
367
- _createPoint(r, n, g) {
368
- const u = this.canvas.getBoundingClientRect();
369
- return new pt(r - u.left, n - u.top, g, (/* @__PURE__ */ new Date()).getTime());
370
- }
371
- _addPoint(r, n) {
372
- const { _lastPoints: g } = this;
373
- if (g.push(r), g.length > 2) {
374
- g.length === 3 && g.unshift(g[0]);
375
- const u = this._calculateCurveWidths(g[1], g[2], n), h = bt.fromPoints(g, u);
376
- return g.shift(), h;
377
- }
378
- return null;
379
- }
380
- _calculateCurveWidths(r, n, g) {
381
- const u = g.velocityFilterWeight * n.velocityFrom(r) + (1 - g.velocityFilterWeight) * this._lastVelocity, h = this._strokeWidth(u, g), d = {
382
- end: h,
383
- start: this._lastWidth
384
- };
385
- return this._lastVelocity = u, this._lastWidth = h, d;
386
- }
387
- _strokeWidth(r, n) {
388
- return Math.max(n.maxWidth / (r + 1), n.minWidth);
389
- }
390
- _drawCurveSegment(r, n, g) {
391
- const u = this._ctx;
392
- u.moveTo(r, n), u.arc(r, n, g, 0, 2 * Math.PI, !1), this._isEmpty = !1;
393
- }
394
- _drawCurve(r, n) {
395
- const g = this._ctx, u = r.endWidth - r.startWidth, h = Math.ceil(r.length()) * 2;
396
- g.beginPath(), g.fillStyle = n.penColor;
397
- for (let d = 0; d < h; d += 1) {
398
- const c = d / h, i = c * c, s = i * c, f = 1 - c, a = f * f, w = a * f;
399
- let x = w * r.startPoint.x;
400
- x += 3 * a * c * r.control1.x, x += 3 * f * i * r.control2.x, x += s * r.endPoint.x;
401
- let b = w * r.startPoint.y;
402
- b += 3 * a * c * r.control1.y, b += 3 * f * i * r.control2.y, b += s * r.endPoint.y;
403
- const A = Math.min(r.startWidth + s * u, n.maxWidth);
404
- this._drawCurveSegment(x, b, A);
405
- }
406
- g.closePath(), g.fill();
407
- }
408
- _drawDot(r, n) {
409
- const g = this._ctx, u = n.dotSize > 0 ? n.dotSize : (n.minWidth + n.maxWidth) / 2;
410
- g.beginPath(), this._drawCurveSegment(r.x, r.y, u), g.closePath(), g.fillStyle = n.penColor, g.fill();
411
- }
412
- _fromData(r, n, g) {
413
- for (const u of r) {
414
- const { points: h } = u, d = this._getPointGroupOptions(u);
415
- if (h.length > 1)
416
- for (let c = 0; c < h.length; c += 1) {
417
- const i = h[c], s = new pt(i.x, i.y, i.pressure, i.time);
418
- c === 0 && this._reset(d);
419
- const f = this._addPoint(s, d);
420
- f && n(f, d);
421
- }
422
- else
423
- this._reset(d), g(h[0], d);
424
- }
425
- }
426
- _toSVG() {
427
- const r = this._data, n = Math.max(window.devicePixelRatio || 1, 1), g = 0, u = 0, h = this.canvas.width / n, d = this.canvas.height / n, c = document.createElementNS("http://www.w3.org/2000/svg", "svg");
428
- c.setAttribute("width", this.canvas.width.toString()), c.setAttribute("height", this.canvas.height.toString()), this._fromData(r, (x, { penColor: b }) => {
429
- const A = document.createElement("path");
430
- if (!isNaN(x.control1.x) && !isNaN(x.control1.y) && !isNaN(x.control2.x) && !isNaN(x.control2.y)) {
431
- const F = `M ${x.startPoint.x.toFixed(3)},${x.startPoint.y.toFixed(3)} C ${x.control1.x.toFixed(3)},${x.control1.y.toFixed(3)} ${x.control2.x.toFixed(3)},${x.control2.y.toFixed(3)} ${x.endPoint.x.toFixed(3)},${x.endPoint.y.toFixed(3)}`;
432
- A.setAttribute("d", F), A.setAttribute("stroke-width", (x.endWidth * 2.25).toFixed(3)), A.setAttribute("stroke", b), A.setAttribute("fill", "none"), A.setAttribute("stroke-linecap", "round"), c.appendChild(A);
433
- }
434
- }, (x, { penColor: b, dotSize: A, minWidth: F, maxWidth: M }) => {
435
- const C = document.createElement("circle"), B = A > 0 ? A : (F + M) / 2;
436
- C.setAttribute("r", B.toString()), C.setAttribute("cx", x.x.toString()), C.setAttribute("cy", x.y.toString()), C.setAttribute("fill", b), c.appendChild(C);
437
- });
438
- const i = "data:image/svg+xml;base64,", s = `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="${g} ${u} ${h} ${d}" width="${h}" height="${d}">`;
439
- let f = c.innerHTML;
440
- if (f === void 0) {
441
- const x = document.createElement("dummy"), b = c.childNodes;
442
- x.innerHTML = "";
443
- for (let A = 0; A < b.length; A += 1)
444
- x.appendChild(b[A].cloneNode(!0));
445
- f = x.innerHTML;
446
- }
447
- const a = "</svg>", w = s + f + a;
448
- return i + btoa(w);
449
- }
450
- }, Xt = class extends Jt {
451
- fromText(r, n = {}) {
452
- if (this.clear(), !r)
453
- return;
454
- const { font: g, x: u = 10, y: h = 50 } = n;
455
- let { maxWidth: d } = n;
456
- if (!d) {
457
- const { clientWidth: c = 300 } = this.canvas;
458
- d = Math.floor(c - 2 * u);
459
- }
460
- this._ctx.font = g, this._ctx.fillText(r, u, h, d), this._isEmpty = !1;
461
- }
462
- };
463
- const Qt = {
464
- name: "SignaturePad",
465
- props: {
466
- type: {
467
- type: String,
468
- default: "text",
469
- validator: (v) => ["text", "draw"].includes(v)
470
- },
471
- text: {
472
- type: String,
473
- default: ""
474
- },
475
- width: {
476
- type: String,
477
- default: "100%"
478
- },
479
- height: {
480
- type: String,
481
- default: "100%"
482
- },
483
- customStyle: {
484
- type: Object,
485
- default: () => ({})
486
- },
487
- options: {
488
- type: Object,
489
- default: () => ({})
490
- },
491
- /**
492
- * Obj on format like {
493
- beginStroke: () => {},
494
- endStroke: () => {},
495
- },
496
- */
497
- signEvents: {
498
- type: Object,
499
- default: () => ({})
500
- },
501
- images: {
502
- type: Array,
503
- default: () => []
504
- }
505
- },
506
- data() {
507
- return {
508
- signaturePad: {},
509
- onResizeHandler: null,
510
- signatureData: "",
511
- defaultOptions: {
512
- dotSize: 1.5,
513
- minWidth: 0.5,
514
- maxWidth: 2.5,
515
- throttle: 16,
516
- minDistance: 3,
517
- backgroundColor: "rgba(0,0,0,0)",
518
- penColor: "black",
519
- velocityFilterWeight: 0.5
520
- },
521
- validTypes: ["image/png", "image/jpeg", "image/svg+xml"]
522
- };
523
- },
524
- watch: {
525
- type() {
526
- this.initType();
527
- },
528
- text(v) {
529
- this.drawText(v);
530
- }
531
- },
532
- mounted() {
533
- const { options: v, defaultOptions: r } = this, n = this.$refs.signaturePadCanvas;
534
- this.signaturePad = new Xt(n, {
535
- ...r,
536
- ...v
537
- }), this.onResizeHandler = this.resizeCanvas.bind(this), window.addEventListener("resize", this.onResizeHandler, !1), Object.keys(this.signEvents).forEach((g) => {
538
- this.signaturePad.addEventListener(g, () => {
539
- this.signEvents[g]();
540
- });
541
- }), this.initType(), this.resizeCanvas();
542
- },
543
- beforeDestroy() {
544
- this.onResizeHandler && window.removeEventListener("resize", this.onResizeHandler, !1);
545
- },
546
- methods: {
547
- initType() {
548
- this.type === "draw" ? this.openSignaturePad() : this.lockSignaturePad();
549
- },
550
- resizeCanvas() {
551
- const v = this.$refs.signaturePadCanvas, r = Math.max(window.devicePixelRatio || 1, 1);
552
- if (v.width = v.offsetWidth * r, v.height = v.offsetHeight * r, v.getContext("2d").scale(r, r), this.signaturePad.clear(), this.signatureData = "", this.type === "draw") {
553
- const n = this.signaturePad.toData();
554
- n != null && n.length && this.signaturePad.fromData(n);
555
- } else
556
- this.type === "text" && this.drawText(this.text);
557
- },
558
- saveSignature(v = {}) {
559
- const { type: r = "image/png", trim: n = !0, encoderOptions: g } = v || {}, u = { isEmpty: !1, data: void 0 };
560
- if (!this.validTypes.includes(r)) {
561
- const h = this.validTypes.join(", ");
562
- throw new Error(
563
- `The Image type is incorrect! We only support ${h} types.`
564
- );
565
- }
566
- if (this.signaturePad.isEmpty())
567
- return { ...u, isEmpty: !0 };
568
- if (n) {
569
- const h = this.$refs.signaturePadCanvas, d = h ? this.trimCanvas(h) : null;
570
- this.signatureData = d ? d.toDataURL(r, g) : "";
571
- } else
572
- this.signatureData = this.signaturePad.toDataURL(r, g);
573
- return {
574
- ...u,
575
- data: this.signatureData
576
- };
577
- },
578
- undoSignature() {
579
- const { signaturePad: v } = this, r = v.toData();
580
- r && v.fromData(r.slice(0, -1));
581
- },
582
- drawText(v) {
583
- this.signaturePad.fromText(v, {
584
- font: '40px "Nothing You Could Do"',
585
- x: 10,
586
- y: 100
587
- });
588
- },
589
- // Extend of module methods
590
- fromText(...v) {
591
- return this.signaturePad.fromText(...v);
592
- },
593
- fromDataURL(...v) {
594
- return this.signaturePad.fromDataURL(...v);
595
- },
596
- fromData(...v) {
597
- return this.signaturePad.fromData(...v);
598
- },
599
- toData(...v) {
600
- return this.signaturePad.toData(...v);
601
- },
602
- lockSignaturePad() {
603
- return this.signaturePad.off();
604
- },
605
- openSignaturePad() {
606
- return this.signaturePad.on();
607
- },
608
- isEmpty() {
609
- return this.signaturePad.isEmpty();
610
- },
611
- clearSignature() {
612
- return this.signaturePad.clear();
613
- },
614
- trimCanvas(v) {
615
- const r = document.createElement("canvas"), n = r.getContext("2d");
616
- r.width = v.width, r.height = v.height, n.drawImage(v, 0, 0);
617
- let g = r.width, u = r.height;
618
- const h = { x: [], y: [] }, d = n.getImageData(
619
- 0,
620
- 0,
621
- r.width,
622
- r.height
623
- );
624
- let c = 0;
625
- for (let f = 0; f < u; f++)
626
- for (let a = 0; a < g; a++)
627
- c = (f * g + a) * 4, d.data[c + 3] > 0 && (h.x.push(a), h.y.push(f));
628
- h.x.sort((f, a) => f - a), h.y.sort((f, a) => f - a);
629
- const i = h.x.length - 1;
630
- g = h.x[i] - h.x[0], u = h.y[i] - h.y[0];
631
- const s = n.getImageData(h.x[0], h.y[0], g, u);
632
- return r.height = u, n.putImageData(s, 0, 0), r;
633
- }
634
- },
635
- render(v) {
636
- const { width: r, height: n, customStyle: g } = this;
637
- return v(
638
- "div",
639
- {
640
- style: {
641
- width: r,
642
- height: n,
643
- ...g
644
- }
645
- },
646
- [
647
- v("canvas", {
648
- style: {
649
- width: "100%",
650
- height: "100%"
651
- },
652
- ref: "signaturePadCanvas"
653
- })
654
- ]
655
- );
656
- }
657
- }, qt = null, Zt = null;
658
- var te = /* @__PURE__ */ ot(
659
- Qt,
660
- qt,
661
- Zt,
662
- !1,
663
- null,
664
- null,
665
- null,
666
- null
667
- );
668
- const ee = te.exports;
669
- function re({ rel: v, href: r, crossorigin: n = !1 }) {
670
- const g = document.createElement("link");
671
- g.rel = v, g.href = r, g.crossorigin = n, document.head.appendChild(g);
672
- }
673
- const ne = [
674
- { rel: "preconnect", href: "https://fonts.googleapis.com" },
675
- { rel: "preconnect", href: "https://fonts.gstatic.com", crossorigin: !0 },
676
- {
677
- rel: "stylesheet",
678
- href: "https://fonts.googleapis.com/css2?family=Nothing+You+Could+Do&display=swap"
679
- }
680
- ], ie = {
681
- name: "SignatureAnswer",
682
- components: {
683
- CField: Lt,
684
- SignaturePad: ee
685
- },
686
- props: {
687
- onCompleteFunc: {
688
- type: Function,
689
- default: null
690
- }
691
- },
692
- mixins: [ft([])],
693
- data() {
694
- return {
695
- mode: "text",
696
- text: "",
697
- isEmpty: !0,
698
- penColor: "hsl(220, 100%, 50%)"
699
- };
700
- },
701
- watch: {
702
- mode(v) {
703
- this.reset(), this.$refs.signaturePad && v === "text" && this.focusName();
704
- },
705
- text() {
706
- this.$refs.signaturePad && this.$nextTick(() => {
707
- this.isEmpty = this.$refs.signaturePad.isEmpty();
708
- });
709
- },
710
- isEmpty: {
711
- immediate: !0,
712
- handler(v) {
713
- this.$emit("invalid", v);
714
- }
715
- }
716
- },
717
- created() {
718
- ne.forEach(re);
719
- },
720
- mounted() {
721
- this.focusName();
722
- },
723
- methods: {
724
- reset() {
725
- this.$refs.signaturePad && (this.$refs.signaturePad.clearSignature(), this.text && (this.text = ""), this.isEmpty = this.$refs.signaturePad.isEmpty());
726
- },
727
- undo() {
728
- this.$refs.signaturePad && (this.mode === "text" && this.text ? this.text = this.text.slice(0, this.text.length - 1) : this.$refs.signaturePad.undoSignature(), this.isEmpty = this.$refs.signaturePad.isEmpty());
729
- },
730
- getSignatureData() {
731
- let v = { type: "image/png", trim: !0 };
732
- this.mode === "draw" && (v = { type: "image/svg+xml", trim: !1 });
733
- const { isEmpty: r, data: n } = this.$refs.signaturePad ? this.$refs.signaturePad.saveSignature(v) : {};
734
- if (r || !n)
735
- throw Error("Missing signatureData");
736
- return n;
737
- },
738
- async submit({ answer: v }) {
739
- const r = this.getSignatureData();
740
- await v({ body: { isAccepted: !0, signatureDataURL: r } }), typeof this.onCompleteFunc == "function" && this.onCompleteFunc();
741
- },
742
- focusName() {
743
- this.$nextTick(
744
- () => this.$refs.nameInput ? this.$refs.nameInput.focus() : null
745
- );
746
- }
747
- }
748
- };
749
- var ae = function() {
750
- var r = this, n = r._self._c;
751
- return n("div", { staticStyle: { "text-align": "left" } }, [n("div", { staticClass: "flex w-full items-center justify-between", staticStyle: { "font-size": "16px", "padding-bottom": "1em", "font-weight": "500", color: "hsl(0, 0%, 11%)" } }, [n("div", [r._v(r._s(r._document.$t("answerModal.signature.component.subTitle")))]), n("div", { staticClass: "sign-toggle" }, [n("div", { staticClass: "sign-toggle-button", class: { active: r.mode === "text" }, on: { click: function(g) {
752
- r.mode = "text";
753
- } } }, [r._v(" " + r._s(r._document.$t("answerModal.signature.component.text.tab")) + " ")]), n("div", { staticClass: "sign-toggle-button", class: { active: r.mode === "draw" }, on: { click: function(g) {
754
- r.mode = "draw";
755
- } } }, [r._v(" " + r._s(r._document.$t("answerModal.signature.component.draw.tab")) + " ")])])]), r.mode === "text" ? n("CField", { attrs: { label: r._document.$t("answerModal.signature.component.text.nameLabel") } }, [n("CInput", { ref: "nameInput", attrs: { placeholder: r._document.$t("answerModal.signature.component.text.namePlaceholder") }, model: { value: r.text, callback: function(g) {
756
- r.text = g;
757
- }, expression: "text" } })], 1) : r._e(), n("div", { staticClass: "wrapper", staticStyle: { "padding-bottom": "5px" } }, [n("div", { staticClass: "background-image" }, [n("svg", { attrs: { xmlns: "http://www.w3.org/2000/svg", width: "100%", height: "100%" } }, [n("line", { attrs: { x1: "0", y1: "75%", x2: "100%", y2: "75%", stroke: "hsl(0,0%, 70%)", "stroke-width": "1", "stroke-linecap": "round", "stroke-dasharray": "3", "shape-rendering": "crispEdges", "pointer-events": "none" } })])]), n("div", { staticStyle: { position: "absolute", left: "1em", top: "0.75em", "font-size": "12px", color: "hsl(0, 0%, 50%)" } }, [r._v(" " + r._s(r._document.$t(`answerModal.signature.component.${r.mode}.canvasLabel`)) + " ")]), n("span", { staticStyle: { "font-family": "'Nothing You Could Do', cursive" } }), n("SignaturePad", { ref: "signaturePad", staticClass: "signature-pad", attrs: { type: r.mode, text: r.text, options: {
758
- penColor: r.penColor
759
- }, signEvents: {
760
- endStroke: () => {
761
- r.isEmpty = r.$refs.signaturePad ? r.$refs.signaturePad.isEmpty() : !0;
762
- }
763
- } } })], 1), n("div", { directives: [{ name: "show", rawName: "v-show", value: r.mode === "draw", expression: "mode === 'draw'" }], staticClass: "flex w-full justify-end" }, [n("CButton", { attrs: { disabled: r.isEmpty, type: "text", size: "small", pattern: "tertiary", circle: "", icon: "trash" }, on: { click: r.reset } }), n("CButton", { attrs: { disabled: r.isEmpty, type: "text", size: "small", pattern: "tertiary", circle: "", icon: "rotate-left" }, on: { click: r.undo } })], 1), n("div", { staticClass: "text-center", staticStyle: { "font-size": "12px", color: "hsl(0, 0%, 45%)", "padding-top": "10px" } }, [r._v(" " + r._s(r._document.$t("answerModal.signature.component.terms")) + " ")])], 1);
764
- }, oe = [], se = /* @__PURE__ */ ot(
765
- ie,
766
- ae,
767
- oe,
768
- !1,
769
- null,
770
- "2545fee5",
771
- null,
772
- null
773
- );
774
- const ue = se.exports;
775
- /*!
776
- * vue-qrcode v1.0.2
777
- * https://fengyuanchen.github.io/vue-qrcode
778
- *
779
- * Copyright 2018-present Chen Fengyuan
780
- * Released under the MIT license
781
- *
782
- * Date: 2020-01-18T06:04:33.222Z
783
- */
784
- function gt() {
785
- throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs");
786
- }
787
- function le(v, r) {
788
- return r = { exports: {} }, v(r, r.exports), r.exports;
789
- }
790
- var xt = le(function(v, r) {
21
+ var xt = Nt(function(v, r) {
791
22
  (function(n) {
792
23
  v.exports = n();
793
24
  })(function() {
794
- return function() {
25
+ return (/* @__PURE__ */ function() {
795
26
  function n(g, u, h) {
796
27
  function d(s, f) {
797
28
  if (!u[s]) {
@@ -799,10 +30,10 @@ var xt = le(function(v, r) {
799
30
  var a = typeof gt == "function" && gt;
800
31
  if (!f && a)
801
32
  return a(s, !0);
802
- if (c)
803
- return c(s, !0);
804
- var w = new Error("Cannot find module '" + s + "'");
805
- throw w.code = "MODULE_NOT_FOUND", w;
33
+ if (l)
34
+ return l(s, !0);
35
+ var y = new Error("Cannot find module '" + s + "'");
36
+ throw y.code = "MODULE_NOT_FOUND", y;
806
37
  }
807
38
  var x = u[s] = { exports: {} };
808
39
  g[s][0].call(x.exports, function(b) {
@@ -812,29 +43,29 @@ var xt = le(function(v, r) {
812
43
  }
813
44
  return u[s].exports;
814
45
  }
815
- for (var c = typeof gt == "function" && gt, i = 0; i < h.length; i++)
46
+ for (var l = typeof gt == "function" && gt, i = 0; i < h.length; i++)
816
47
  d(h[i]);
817
48
  return d;
818
49
  }
819
50
  return n;
820
- }()({ 1: [function(n, g, u) {
51
+ }())({ 1: [function(n, g, u) {
821
52
  g.exports = function() {
822
53
  return typeof Promise == "function" && Promise.prototype && Promise.prototype.then;
823
54
  };
824
55
  }, {}], 2: [function(n, g, u) {
825
56
  var h = n("./utils").getSymbolSize;
826
- u.getRowColCoords = function(c) {
827
- if (c === 1)
57
+ u.getRowColCoords = function(l) {
58
+ if (l === 1)
828
59
  return [];
829
- for (var i = Math.floor(c / 7) + 2, s = h(c), f = s === 145 ? 26 : Math.ceil((s - 13) / (2 * i - 2)) * 2, a = [s - 7], w = 1; w < i - 1; w++)
830
- a[w] = a[w - 1] - f;
60
+ for (var i = Math.floor(l / 7) + 2, s = h(l), f = s === 145 ? 26 : Math.ceil((s - 13) / (2 * i - 2)) * 2, a = [s - 7], y = 1; y < i - 1; y++)
61
+ a[y] = a[y - 1] - f;
831
62
  return a.push(6), a.reverse();
832
- }, u.getPositions = function(c) {
833
- for (var i = [], s = u.getRowColCoords(c), f = s.length, a = 0; a < f; a++)
834
- for (var w = 0; w < f; w++)
835
- a === 0 && w === 0 || // top-left
836
- a === 0 && w === f - 1 || // bottom-left
837
- a === f - 1 && w === 0 || i.push([s[a], s[w]]);
63
+ }, u.getPositions = function(l) {
64
+ for (var i = [], s = u.getRowColCoords(l), f = s.length, a = 0; a < f; a++)
65
+ for (var y = 0; y < f; y++)
66
+ a === 0 && y === 0 || // top-left
67
+ a === 0 && y === f - 1 || // bottom-left
68
+ a === f - 1 && y === 0 || i.push([s[a], s[y]]);
838
69
  return i;
839
70
  };
840
71
  }, { "./utils": 21 }], 3: [function(n, g, u) {
@@ -885,76 +116,76 @@ var xt = le(function(v, r) {
885
116
  "/",
886
117
  ":"
887
118
  ];
888
- function c(i) {
119
+ function l(i) {
889
120
  this.mode = h.ALPHANUMERIC, this.data = i;
890
121
  }
891
- c.getBitsLength = function(s) {
122
+ l.getBitsLength = function(s) {
892
123
  return 11 * Math.floor(s / 2) + 6 * (s % 2);
893
- }, c.prototype.getLength = function() {
124
+ }, l.prototype.getLength = function() {
894
125
  return this.data.length;
895
- }, c.prototype.getBitsLength = function() {
896
- return c.getBitsLength(this.data.length);
897
- }, c.prototype.write = function(s) {
126
+ }, l.prototype.getBitsLength = function() {
127
+ return l.getBitsLength(this.data.length);
128
+ }, l.prototype.write = function(s) {
898
129
  var f;
899
130
  for (f = 0; f + 2 <= this.data.length; f += 2) {
900
131
  var a = d.indexOf(this.data[f]) * 45;
901
132
  a += d.indexOf(this.data[f + 1]), s.put(a, 11);
902
133
  }
903
134
  this.data.length % 2 && s.put(d.indexOf(this.data[f]), 6);
904
- }, g.exports = c;
135
+ }, g.exports = l;
905
136
  }, { "./mode": 14 }], 4: [function(n, g, u) {
906
137
  function h() {
907
138
  this.buffer = [], this.length = 0;
908
139
  }
909
140
  h.prototype = {
910
141
  get: function(d) {
911
- var c = Math.floor(d / 8);
912
- return (this.buffer[c] >>> 7 - d % 8 & 1) === 1;
142
+ var l = Math.floor(d / 8);
143
+ return (this.buffer[l] >>> 7 - d % 8 & 1) === 1;
913
144
  },
914
- put: function(d, c) {
915
- for (var i = 0; i < c; i++)
916
- this.putBit((d >>> c - i - 1 & 1) === 1);
145
+ put: function(d, l) {
146
+ for (var i = 0; i < l; i++)
147
+ this.putBit((d >>> l - i - 1 & 1) === 1);
917
148
  },
918
149
  getLengthInBits: function() {
919
150
  return this.length;
920
151
  },
921
152
  putBit: function(d) {
922
- var c = Math.floor(this.length / 8);
923
- this.buffer.length <= c && this.buffer.push(0), d && (this.buffer[c] |= 128 >>> this.length % 8), this.length++;
153
+ var l = Math.floor(this.length / 8);
154
+ this.buffer.length <= l && this.buffer.push(0), d && (this.buffer[l] |= 128 >>> this.length % 8), this.length++;
924
155
  }
925
156
  }, g.exports = h;
926
157
  }, {}], 5: [function(n, g, u) {
927
158
  var h = n("../utils/buffer");
928
- function d(c) {
929
- if (!c || c < 1)
159
+ function d(l) {
160
+ if (!l || l < 1)
930
161
  throw new Error("BitMatrix size must be defined and greater than 0");
931
- this.size = c, this.data = h.alloc(c * c), this.reservedBit = h.alloc(c * c);
162
+ this.size = l, this.data = h.alloc(l * l), this.reservedBit = h.alloc(l * l);
932
163
  }
933
- d.prototype.set = function(c, i, s, f) {
934
- var a = c * this.size + i;
164
+ d.prototype.set = function(l, i, s, f) {
165
+ var a = l * this.size + i;
935
166
  this.data[a] = s, f && (this.reservedBit[a] = !0);
936
- }, d.prototype.get = function(c, i) {
937
- return this.data[c * this.size + i];
938
- }, d.prototype.xor = function(c, i, s) {
939
- this.data[c * this.size + i] ^= s;
940
- }, d.prototype.isReserved = function(c, i) {
941
- return this.reservedBit[c * this.size + i];
167
+ }, d.prototype.get = function(l, i) {
168
+ return this.data[l * this.size + i];
169
+ }, d.prototype.xor = function(l, i, s) {
170
+ this.data[l * this.size + i] ^= s;
171
+ }, d.prototype.isReserved = function(l, i) {
172
+ return this.reservedBit[l * this.size + i];
942
173
  }, g.exports = d;
943
174
  }, { "../utils/buffer": 28 }], 6: [function(n, g, u) {
944
175
  var h = n("../utils/buffer"), d = n("./mode");
945
- function c(i) {
176
+ function l(i) {
946
177
  this.mode = d.BYTE, this.data = h.from(i);
947
178
  }
948
- c.getBitsLength = function(s) {
179
+ l.getBitsLength = function(s) {
949
180
  return s * 8;
950
- }, c.prototype.getLength = function() {
181
+ }, l.prototype.getLength = function() {
951
182
  return this.data.length;
952
- }, c.prototype.getBitsLength = function() {
953
- return c.getBitsLength(this.data.length);
954
- }, c.prototype.write = function(i) {
183
+ }, l.prototype.getBitsLength = function() {
184
+ return l.getBitsLength(this.data.length);
185
+ }, l.prototype.write = function(i) {
955
186
  for (var s = 0, f = this.data.length; s < f; s++)
956
187
  i.put(this.data[s], 8);
957
- }, g.exports = c;
188
+ }, g.exports = l;
958
189
  }, { "../utils/buffer": 28, "./mode": 14 }], 7: [function(n, g, u) {
959
190
  var h = n("./error-correction-level"), d = [
960
191
  // L M Q H
@@ -1118,7 +349,7 @@ var xt = le(function(v, r) {
1118
349
  49,
1119
350
  68,
1120
351
  81
1121
- ], c = [
352
+ ], l = [
1122
353
  // L M Q H
1123
354
  7,
1124
355
  10,
@@ -1297,13 +528,13 @@ var xt = le(function(v, r) {
1297
528
  }, u.getTotalCodewordsCount = function(s, f) {
1298
529
  switch (f) {
1299
530
  case h.L:
1300
- return c[(s - 1) * 4 + 0];
531
+ return l[(s - 1) * 4 + 0];
1301
532
  case h.M:
1302
- return c[(s - 1) * 4 + 1];
533
+ return l[(s - 1) * 4 + 1];
1303
534
  case h.Q:
1304
- return c[(s - 1) * 4 + 2];
535
+ return l[(s - 1) * 4 + 2];
1305
536
  case h.H:
1306
- return c[(s - 1) * 4 + 3];
537
+ return l[(s - 1) * 4 + 3];
1307
538
  default:
1308
539
  return;
1309
540
  }
@@ -1313,8 +544,8 @@ var xt = le(function(v, r) {
1313
544
  function h(d) {
1314
545
  if (typeof d != "string")
1315
546
  throw new Error("Param is not a string");
1316
- var c = d.toLowerCase();
1317
- switch (c) {
547
+ var l = d.toLowerCase();
548
+ switch (l) {
1318
549
  case "l":
1319
550
  case "low":
1320
551
  return u.L;
@@ -1331,13 +562,13 @@ var xt = le(function(v, r) {
1331
562
  throw new Error("Unknown EC Level: " + d);
1332
563
  }
1333
564
  }
1334
- u.isValid = function(c) {
1335
- return c && typeof c.bit < "u" && c.bit >= 0 && c.bit < 4;
1336
- }, u.from = function(c, i) {
1337
- if (u.isValid(c))
1338
- return c;
565
+ u.isValid = function(l) {
566
+ return l && typeof l.bit < "u" && l.bit >= 0 && l.bit < 4;
567
+ }, u.from = function(l, i) {
568
+ if (u.isValid(l))
569
+ return l;
1339
570
  try {
1340
- return h(c);
571
+ return h(l);
1341
572
  } catch {
1342
573
  return i;
1343
574
  }
@@ -1356,40 +587,40 @@ var xt = le(function(v, r) {
1356
587
  ];
1357
588
  };
1358
589
  }, { "./utils": 21 }], 10: [function(n, g, u) {
1359
- var h = n("./utils"), d = 1335, c = 21522, i = h.getBCHDigit(d);
590
+ var h = n("./utils"), d = 1335, l = 21522, i = h.getBCHDigit(d);
1360
591
  u.getEncodedBits = function(f, a) {
1361
- for (var w = f.bit << 3 | a, x = w << 10; h.getBCHDigit(x) - i >= 0; )
592
+ for (var y = f.bit << 3 | a, x = y << 10; h.getBCHDigit(x) - i >= 0; )
1362
593
  x ^= d << h.getBCHDigit(x) - i;
1363
- return (w << 10 | x) ^ c;
594
+ return (y << 10 | x) ^ l;
1364
595
  };
1365
596
  }, { "./utils": 21 }], 11: [function(n, g, u) {
1366
- var h = n("../utils/buffer"), d = h.alloc(512), c = h.alloc(256);
597
+ var h = n("../utils/buffer"), d = h.alloc(512), l = h.alloc(256);
1367
598
  (function() {
1368
599
  for (var s = 1, f = 0; f < 255; f++)
1369
- d[f] = s, c[s] = f, s <<= 1, s & 256 && (s ^= 285);
600
+ d[f] = s, l[s] = f, s <<= 1, s & 256 && (s ^= 285);
1370
601
  for (f = 255; f < 512; f++)
1371
602
  d[f] = d[f - 255];
1372
603
  })(), u.log = function(s) {
1373
604
  if (s < 1)
1374
605
  throw new Error("log(" + s + ")");
1375
- return c[s];
606
+ return l[s];
1376
607
  }, u.exp = function(s) {
1377
608
  return d[s];
1378
609
  }, u.mul = function(s, f) {
1379
- return s === 0 || f === 0 ? 0 : d[c[s] + c[f]];
610
+ return s === 0 || f === 0 ? 0 : d[l[s] + l[f]];
1380
611
  };
1381
612
  }, { "../utils/buffer": 28 }], 12: [function(n, g, u) {
1382
613
  var h = n("./mode"), d = n("./utils");
1383
- function c(i) {
614
+ function l(i) {
1384
615
  this.mode = h.KANJI, this.data = i;
1385
616
  }
1386
- c.getBitsLength = function(s) {
617
+ l.getBitsLength = function(s) {
1387
618
  return s * 13;
1388
- }, c.prototype.getLength = function() {
619
+ }, l.prototype.getLength = function() {
1389
620
  return this.data.length;
1390
- }, c.prototype.getBitsLength = function() {
1391
- return c.getBitsLength(this.data.length);
1392
- }, c.prototype.write = function(i) {
621
+ }, l.prototype.getBitsLength = function() {
622
+ return l.getBitsLength(this.data.length);
623
+ }, l.prototype.write = function(i) {
1393
624
  var s;
1394
625
  for (s = 0; s < this.data.length; s++) {
1395
626
  var f = d.toSJIS(this.data[s]);
@@ -1404,7 +635,7 @@ Make sure your charset is UTF-8`
1404
635
  );
1405
636
  f = (f >>> 8 & 255) * 192 + (f & 255), i.put(f, 13);
1406
637
  }
1407
- }, g.exports = c;
638
+ }, g.exports = l;
1408
639
  }, { "./mode": 14, "./utils": 21 }], 13: [function(n, g, u) {
1409
640
  u.Patterns = {
1410
641
  PATTERN000: 0,
@@ -1427,37 +658,37 @@ Make sure your charset is UTF-8`
1427
658
  }, u.from = function(i) {
1428
659
  return u.isValid(i) ? parseInt(i, 10) : void 0;
1429
660
  }, u.getPenaltyN1 = function(i) {
1430
- for (var s = i.size, f = 0, a = 0, w = 0, x = null, b = null, A = 0; A < s; A++) {
1431
- a = w = 0, x = b = null;
661
+ for (var s = i.size, f = 0, a = 0, y = 0, x = null, b = null, A = 0; A < s; A++) {
662
+ a = y = 0, x = b = null;
1432
663
  for (var F = 0; F < s; F++) {
1433
664
  var M = i.get(A, F);
1434
- M === x ? a++ : (a >= 5 && (f += h.N1 + (a - 5)), x = M, a = 1), M = i.get(F, A), M === b ? w++ : (w >= 5 && (f += h.N1 + (w - 5)), b = M, w = 1);
665
+ M === x ? a++ : (a >= 5 && (f += h.N1 + (a - 5)), x = M, a = 1), M = i.get(F, A), M === b ? y++ : (y >= 5 && (f += h.N1 + (y - 5)), b = M, y = 1);
1435
666
  }
1436
- a >= 5 && (f += h.N1 + (a - 5)), w >= 5 && (f += h.N1 + (w - 5));
667
+ a >= 5 && (f += h.N1 + (a - 5)), y >= 5 && (f += h.N1 + (y - 5));
1437
668
  }
1438
669
  return f;
1439
670
  }, u.getPenaltyN2 = function(i) {
1440
671
  for (var s = i.size, f = 0, a = 0; a < s - 1; a++)
1441
- for (var w = 0; w < s - 1; w++) {
1442
- var x = i.get(a, w) + i.get(a, w + 1) + i.get(a + 1, w) + i.get(a + 1, w + 1);
672
+ for (var y = 0; y < s - 1; y++) {
673
+ var x = i.get(a, y) + i.get(a, y + 1) + i.get(a + 1, y) + i.get(a + 1, y + 1);
1443
674
  (x === 4 || x === 0) && f++;
1444
675
  }
1445
676
  return f * h.N2;
1446
677
  }, u.getPenaltyN3 = function(i) {
1447
- for (var s = i.size, f = 0, a = 0, w = 0, x = 0; x < s; x++) {
1448
- a = w = 0;
678
+ for (var s = i.size, f = 0, a = 0, y = 0, x = 0; x < s; x++) {
679
+ a = y = 0;
1449
680
  for (var b = 0; b < s; b++)
1450
- a = a << 1 & 2047 | i.get(x, b), b >= 10 && (a === 1488 || a === 93) && f++, w = w << 1 & 2047 | i.get(b, x), b >= 10 && (w === 1488 || w === 93) && f++;
681
+ a = a << 1 & 2047 | i.get(x, b), b >= 10 && (a === 1488 || a === 93) && f++, y = y << 1 & 2047 | i.get(b, x), b >= 10 && (y === 1488 || y === 93) && f++;
1451
682
  }
1452
683
  return f * h.N3;
1453
684
  }, u.getPenaltyN4 = function(i) {
1454
685
  for (var s = 0, f = i.data.length, a = 0; a < f; a++)
1455
686
  s += i.data[a];
1456
- var w = Math.abs(Math.ceil(s * 100 / f / 5) - 10);
1457
- return w * h.N4;
687
+ var y = Math.abs(Math.ceil(s * 100 / f / 5) - 10);
688
+ return y * h.N4;
1458
689
  };
1459
- function d(c, i, s) {
1460
- switch (c) {
690
+ function d(l, i, s) {
691
+ switch (l) {
1461
692
  case u.Patterns.PATTERN000:
1462
693
  return (i + s) % 2 === 0;
1463
694
  case u.Patterns.PATTERN001:
@@ -1475,18 +706,18 @@ Make sure your charset is UTF-8`
1475
706
  case u.Patterns.PATTERN111:
1476
707
  return (i * s % 3 + (i + s) % 2) % 2 === 0;
1477
708
  default:
1478
- throw new Error("bad maskPattern:" + c);
709
+ throw new Error("bad maskPattern:" + l);
1479
710
  }
1480
711
  }
1481
712
  u.applyMask = function(i, s) {
1482
713
  for (var f = s.size, a = 0; a < f; a++)
1483
- for (var w = 0; w < f; w++)
1484
- s.isReserved(w, a) || s.xor(w, a, d(i, w, a));
714
+ for (var y = 0; y < f; y++)
715
+ s.isReserved(y, a) || s.xor(y, a, d(i, y, a));
1485
716
  }, u.getBestMask = function(i, s) {
1486
- for (var f = Object.keys(u.Patterns).length, a = 0, w = 1 / 0, x = 0; x < f; x++) {
717
+ for (var f = Object.keys(u.Patterns).length, a = 0, y = 1 / 0, x = 0; x < f; x++) {
1487
718
  s(x), u.applyMask(x, i);
1488
719
  var b = u.getPenaltyN1(i) + u.getPenaltyN2(i) + u.getPenaltyN3(i) + u.getPenaltyN4(i);
1489
- u.applyMask(x, i), b < w && (w = b, a = x);
720
+ u.applyMask(x, i), b < y && (y = b, a = x);
1490
721
  }
1491
722
  return a;
1492
723
  };
@@ -1525,7 +756,7 @@ Make sure your charset is UTF-8`
1525
756
  }, u.isValid = function(s) {
1526
757
  return s && s.bit && s.ccBits;
1527
758
  };
1528
- function c(i) {
759
+ function l(i) {
1529
760
  if (typeof i != "string")
1530
761
  throw new Error("Param is not a string");
1531
762
  var s = i.toLowerCase();
@@ -1546,15 +777,15 @@ Make sure your charset is UTF-8`
1546
777
  if (u.isValid(s))
1547
778
  return s;
1548
779
  try {
1549
- return c(s);
780
+ return l(s);
1550
781
  } catch {
1551
782
  return f;
1552
783
  }
1553
784
  };
1554
785
  }, { "./regex": 19, "./version-check": 22 }], 15: [function(n, g, u) {
1555
786
  var h = n("./mode");
1556
- function d(c) {
1557
- this.mode = h.NUMERIC, this.data = c.toString();
787
+ function d(l) {
788
+ this.mode = h.NUMERIC, this.data = l.toString();
1558
789
  }
1559
790
  d.getBitsLength = function(i) {
1560
791
  return 10 * Math.floor(i / 3) + (i % 3 ? i % 3 * 3 + 1 : 0);
@@ -1566,20 +797,20 @@ Make sure your charset is UTF-8`
1566
797
  var s, f, a;
1567
798
  for (s = 0; s + 3 <= this.data.length; s += 3)
1568
799
  f = this.data.substr(s, 3), a = parseInt(f, 10), i.put(a, 10);
1569
- var w = this.data.length - s;
1570
- w > 0 && (f = this.data.substr(s), a = parseInt(f, 10), i.put(a, w * 3 + 1));
800
+ var y = this.data.length - s;
801
+ y > 0 && (f = this.data.substr(s), a = parseInt(f, 10), i.put(a, y * 3 + 1));
1571
802
  }, g.exports = d;
1572
803
  }, { "./mode": 14 }], 16: [function(n, g, u) {
1573
804
  var h = n("../utils/buffer"), d = n("./galois-field");
1574
805
  u.mul = function(i, s) {
1575
806
  for (var f = h.alloc(i.length + s.length - 1), a = 0; a < i.length; a++)
1576
- for (var w = 0; w < s.length; w++)
1577
- f[a + w] ^= d.mul(i[a], s[w]);
807
+ for (var y = 0; y < s.length; y++)
808
+ f[a + y] ^= d.mul(i[a], s[y]);
1578
809
  return f;
1579
810
  }, u.mod = function(i, s) {
1580
811
  for (var f = h.from(i); f.length - s.length >= 0; ) {
1581
- for (var a = f[0], w = 0; w < s.length; w++)
1582
- f[w] ^= d.mul(s[w], a);
812
+ for (var a = f[0], y = 0; y < s.length; y++)
813
+ f[y] ^= d.mul(s[y], a);
1583
814
  for (var x = 0; x < f.length && f[x] === 0; )
1584
815
  x++;
1585
816
  f = f.slice(x);
@@ -1591,7 +822,7 @@ Make sure your charset is UTF-8`
1591
822
  return s;
1592
823
  };
1593
824
  }, { "../utils/buffer": 28, "./galois-field": 11 }], 17: [function(n, g, u) {
1594
- var h = n("../utils/buffer"), d = n("./utils"), c = n("./error-correction-level"), i = n("./bit-buffer"), s = n("./bit-matrix"), f = n("./alignment-pattern"), a = n("./finder-pattern"), w = n("./mask-pattern"), x = n("./error-correction-code"), b = n("./reed-solomon-encoder"), A = n("./version"), F = n("./format-info"), M = n("./mode"), C = n("./segments"), B = n("isarray");
825
+ var h = n("../utils/buffer"), d = n("./utils"), l = n("./error-correction-level"), i = n("./bit-buffer"), s = n("./bit-matrix"), f = n("./alignment-pattern"), a = n("./finder-pattern"), y = n("./mask-pattern"), x = n("./error-correction-code"), b = n("./reed-solomon-encoder"), A = n("./version"), F = n("./format-info"), M = n("./mode"), E = n("./segments"), B = n("isarray");
1595
826
  function I($, D) {
1596
827
  for (var U = $.size, R = a.getPositions(D), O = 0; O < R.length; O++)
1597
828
  for (var z = R[O][0], N = R[O][1], Y = -1; Y <= 7; Y++)
@@ -1621,7 +852,7 @@ Make sure your charset is UTF-8`
1621
852
  N = (O >> z & 1) === 1, z < 6 ? $.set(z, 8, N, !0) : z < 8 ? $.set(z + 1, 8, N, !0) : $.set(R - 15 + z, 8, N, !0), z < 8 ? $.set(8, R - z - 1, N, !0) : z < 9 ? $.set(8, 15 - z - 1 + 1, N, !0) : $.set(8, 15 - z - 1, N, !0);
1622
853
  $.set(R - 8, 8, 1, !0);
1623
854
  }
1624
- function E($, D) {
855
+ function C($, D) {
1625
856
  for (var U = $.size, R = -1, O = U - 1, z = 7, N = 0, Y = U - 1; Y > 0; Y -= 2)
1626
857
  for (Y === 6 && Y--; ; ) {
1627
858
  for (var j = 0; j < 2; j++)
@@ -1649,32 +880,32 @@ Make sure your charset is UTF-8`
1649
880
  }
1650
881
  function L($, D, U) {
1651
882
  for (var R = d.getSymbolTotalCodewords(D), O = x.getTotalCodewordsCount(D, U), z = R - O, N = x.getBlocksCount(D, U), Y = R % N, j = N - Y, et = Math.floor(R / N), X = Math.floor(z / N), mt = X + 1, J = et - X, q = new b(J), at = 0, it = new Array(N), st = new Array(N), ut = 0, vt = h.from($.buffer), rt = 0; rt < N; rt++) {
1652
- var lt = rt < j ? X : mt;
1653
- it[rt] = vt.slice(at, at + lt), st[rt] = q.encode(it[rt]), at += lt, ut = Math.max(ut, lt);
883
+ var ct = rt < j ? X : mt;
884
+ it[rt] = vt.slice(at, at + ct), st[rt] = q.encode(it[rt]), at += ct, ut = Math.max(ut, ct);
1654
885
  }
1655
- var ct = h.alloc(R), ht = 0, tt, Q;
886
+ var lt = h.alloc(R), ht = 0, tt, Q;
1656
887
  for (tt = 0; tt < ut; tt++)
1657
888
  for (Q = 0; Q < N; Q++)
1658
- tt < it[Q].length && (ct[ht++] = it[Q][tt]);
889
+ tt < it[Q].length && (lt[ht++] = it[Q][tt]);
1659
890
  for (tt = 0; tt < J; tt++)
1660
891
  for (Q = 0; Q < N; Q++)
1661
- ct[ht++] = st[Q][tt];
1662
- return ct;
892
+ lt[ht++] = st[Q][tt];
893
+ return lt;
1663
894
  }
1664
895
  function W($, D, U, R) {
1665
896
  var O;
1666
897
  if (B($))
1667
- O = C.fromArray($);
898
+ O = E.fromArray($);
1668
899
  else if (typeof $ == "string") {
1669
900
  var z = D;
1670
901
  if (!z) {
1671
- var N = C.rawSplit($);
902
+ var N = E.rawSplit($);
1672
903
  z = A.getBestVersionForData(
1673
904
  N,
1674
905
  U
1675
906
  );
1676
907
  }
1677
- O = C.fromString($, z || 40);
908
+ O = E.fromString($, z || 40);
1678
909
  } else
1679
910
  throw new Error("Invalid data");
1680
911
  var Y = A.getBestVersionForData(
@@ -1693,10 +924,10 @@ Minimum version required to store current data is: ` + Y + `.
1693
924
  `
1694
925
  );
1695
926
  var j = T(D, U, O), et = d.getSymbolSize(D), X = new s(et);
1696
- return I(X, D), k(X), _(X, D), p(X, U, 0), D >= 7 && m(X, D), E(X, j), isNaN(R) && (R = w.getBestMask(
927
+ return I(X, D), k(X), _(X, D), p(X, U, 0), D >= 7 && m(X, D), C(X, j), isNaN(R) && (R = y.getBestMask(
1697
928
  X,
1698
929
  p.bind(null, X, U)
1699
- )), w.applyMask(R, X), p(X, U, R), {
930
+ )), y.applyMask(R, X), p(X, U, R), {
1700
931
  modules: X,
1701
932
  version: D,
1702
933
  errorCorrectionLevel: U,
@@ -1707,11 +938,11 @@ Minimum version required to store current data is: ` + Y + `.
1707
938
  u.create = function(D, U) {
1708
939
  if (typeof D > "u" || D === "")
1709
940
  throw new Error("No input text");
1710
- var R = c.M, O, z;
1711
- return typeof U < "u" && (R = c.from(U.errorCorrectionLevel, c.M), O = A.from(U.version), z = w.from(U.maskPattern), U.toSJISFunc && d.setToSJISFunction(U.toSJISFunc)), W(D, O, R, z);
941
+ var R = l.M, O, z;
942
+ return typeof U < "u" && (R = l.from(U.errorCorrectionLevel, l.M), O = A.from(U.version), z = y.from(U.maskPattern), U.toSJISFunc && d.setToSJISFunction(U.toSJISFunc)), W(D, O, R, z);
1712
943
  };
1713
944
  }, { "../utils/buffer": 28, "./alignment-pattern": 2, "./bit-buffer": 4, "./bit-matrix": 5, "./error-correction-code": 7, "./error-correction-level": 8, "./finder-pattern": 9, "./format-info": 10, "./mask-pattern": 13, "./mode": 14, "./reed-solomon-encoder": 18, "./segments": 20, "./utils": 21, "./version": 23, isarray: 33 }], 18: [function(n, g, u) {
1714
- var h = n("../utils/buffer"), d = n("./polynomial"), c = n("buffer").Buffer;
945
+ var h = n("../utils/buffer"), d = n("./polynomial"), l = n("buffer").Buffer;
1715
946
  function i(s) {
1716
947
  this.genPoly = void 0, this.degree = s, this.degree && this.initialize(this.degree);
1717
948
  }
@@ -1720,7 +951,7 @@ Minimum version required to store current data is: ` + Y + `.
1720
951
  }, i.prototype.encode = function(f) {
1721
952
  if (!this.genPoly)
1722
953
  throw new Error("Encoder not initialized");
1723
- var a = h.alloc(this.degree), w = c.concat([f, a], f.length + this.degree), x = d.mod(w, this.genPoly), b = this.degree - x.length;
954
+ var a = h.alloc(this.degree), y = l.concat([f, a], f.length + this.degree), x = d.mod(y, this.genPoly), b = this.degree - x.length;
1724
955
  if (b > 0) {
1725
956
  var A = h.alloc(this.degree);
1726
957
  return x.copy(A, b), A;
@@ -1728,12 +959,12 @@ Minimum version required to store current data is: ` + Y + `.
1728
959
  return x;
1729
960
  }, g.exports = i;
1730
961
  }, { "../utils/buffer": 28, "./polynomial": 16, buffer: 30 }], 19: [function(n, g, u) {
1731
- var h = "[0-9]+", d = "[A-Z $%*+\\-./:]+", c = "(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";
1732
- c = c.replace(/u/g, "\\u");
1733
- var i = "(?:(?![A-Z0-9 $%*+\\-./:]|" + c + `)(?:.|[\r
962
+ var h = "[0-9]+", d = "[A-Z $%*+\\-./:]+", l = "(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";
963
+ l = l.replace(/u/g, "\\u");
964
+ var i = "(?:(?![A-Z0-9 $%*+\\-./:]|" + l + `)(?:.|[\r
1734
965
  ]))+`;
1735
- u.KANJI = new RegExp(c, "g"), u.BYTE_KANJI = new RegExp("[^A-Z0-9 $%*+\\-./:]+", "g"), u.BYTE = new RegExp(i, "g"), u.NUMERIC = new RegExp(h, "g"), u.ALPHANUMERIC = new RegExp(d, "g");
1736
- var s = new RegExp("^" + c + "$"), f = new RegExp("^" + h + "$"), a = new RegExp("^[A-Z0-9 $%*+\\-./:]+$");
966
+ u.KANJI = new RegExp(l, "g"), u.BYTE_KANJI = new RegExp("[^A-Z0-9 $%*+\\-./:]+", "g"), u.BYTE = new RegExp(i, "g"), u.NUMERIC = new RegExp(h, "g"), u.ALPHANUMERIC = new RegExp(d, "g");
967
+ var s = new RegExp("^" + l + "$"), f = new RegExp("^" + h + "$"), a = new RegExp("^[A-Z0-9 $%*+\\-./:]+$");
1737
968
  u.testKanji = function(x) {
1738
969
  return s.test(x);
1739
970
  }, u.testNumeric = function(x) {
@@ -1742,24 +973,24 @@ Minimum version required to store current data is: ` + Y + `.
1742
973
  return a.test(x);
1743
974
  };
1744
975
  }, {}], 20: [function(n, g, u) {
1745
- var h = n("./mode"), d = n("./numeric-data"), c = n("./alphanumeric-data"), i = n("./byte-data"), s = n("./kanji-data"), f = n("./regex"), a = n("./utils"), w = n("dijkstrajs");
976
+ var h = n("./mode"), d = n("./numeric-data"), l = n("./alphanumeric-data"), i = n("./byte-data"), s = n("./kanji-data"), f = n("./regex"), a = n("./utils"), y = n("dijkstrajs");
1746
977
  function x(k) {
1747
978
  return unescape(encodeURIComponent(k)).length;
1748
979
  }
1749
980
  function b(k, _, m) {
1750
- for (var p = [], E; (E = k.exec(m)) !== null; )
981
+ for (var p = [], C; (C = k.exec(m)) !== null; )
1751
982
  p.push({
1752
- data: E[0],
1753
- index: E.index,
983
+ data: C[0],
984
+ index: C.index,
1754
985
  mode: _,
1755
- length: E[0].length
986
+ length: C[0].length
1756
987
  });
1757
988
  return p;
1758
989
  }
1759
990
  function A(k) {
1760
- var _ = b(f.NUMERIC, h.NUMERIC, k), m = b(f.ALPHANUMERIC, h.ALPHANUMERIC, k), p, E;
1761
- a.isKanjiModeEnabled() ? (p = b(f.BYTE, h.BYTE, k), E = b(f.KANJI, h.KANJI, k)) : (p = b(f.BYTE_KANJI, h.BYTE, k), E = []);
1762
- var T = _.concat(m, p, E);
991
+ var _ = b(f.NUMERIC, h.NUMERIC, k), m = b(f.ALPHANUMERIC, h.ALPHANUMERIC, k), p, C;
992
+ a.isKanjiModeEnabled() ? (p = b(f.BYTE, h.BYTE, k), C = b(f.KANJI, h.KANJI, k)) : (p = b(f.BYTE_KANJI, h.BYTE, k), C = []);
993
+ var T = _.concat(m, p, C);
1763
994
  return T.sort(function(L, W) {
1764
995
  return L.index - W.index;
1765
996
  }).map(function(L) {
@@ -1775,7 +1006,7 @@ Minimum version required to store current data is: ` + Y + `.
1775
1006
  case h.NUMERIC:
1776
1007
  return d.getBitsLength(k);
1777
1008
  case h.ALPHANUMERIC:
1778
- return c.getBitsLength(k);
1009
+ return l.getBitsLength(k);
1779
1010
  case h.KANJI:
1780
1011
  return s.getBitsLength(k);
1781
1012
  case h.BYTE:
@@ -1788,7 +1019,7 @@ Minimum version required to store current data is: ` + Y + `.
1788
1019
  return p && p.mode === m.mode ? (_[_.length - 1].data += m.data, _) : (_.push(m), _);
1789
1020
  }, []);
1790
1021
  }
1791
- function C(k) {
1022
+ function E(k) {
1792
1023
  for (var _ = [], m = 0; m < k.length; m++) {
1793
1024
  var p = k[m];
1794
1025
  switch (p.mode) {
@@ -1820,19 +1051,19 @@ Minimum version required to store current data is: ` + Y + `.
1820
1051
  return _;
1821
1052
  }
1822
1053
  function B(k, _) {
1823
- for (var m = {}, p = { start: {} }, E = ["start"], T = 0; T < k.length; T++) {
1054
+ for (var m = {}, p = { start: {} }, C = ["start"], T = 0; T < k.length; T++) {
1824
1055
  for (var L = k[T], W = [], $ = 0; $ < L.length; $++) {
1825
1056
  var D = L[$], U = "" + T + $;
1826
1057
  W.push(U), m[U] = { node: D, lastCount: 0 }, p[U] = {};
1827
- for (var R = 0; R < E.length; R++) {
1828
- var O = E[R];
1058
+ for (var R = 0; R < C.length; R++) {
1059
+ var O = C[R];
1829
1060
  m[O] && m[O].node.mode === D.mode ? (p[O][U] = F(m[O].lastCount + D.length, D.mode) - F(m[O].lastCount, D.mode), m[O].lastCount += D.length) : (m[O] && (m[O].lastCount = D.length), p[O][U] = F(D.length, D.mode) + 4 + h.getCharCountIndicator(D.mode, _));
1830
1061
  }
1831
1062
  }
1832
- E = W;
1063
+ C = W;
1833
1064
  }
1834
- for (R = 0; R < E.length; R++)
1835
- p[E[R]].end = 0;
1065
+ for (R = 0; R < C.length; R++)
1066
+ p[C[R]].end = 0;
1836
1067
  return { map: p, table: m };
1837
1068
  }
1838
1069
  function I(k, _) {
@@ -1844,7 +1075,7 @@ Minimum version required to store current data is: ` + Y + `.
1844
1075
  case h.NUMERIC:
1845
1076
  return new d(k);
1846
1077
  case h.ALPHANUMERIC:
1847
- return new c(k);
1078
+ return new l(k);
1848
1079
  case h.KANJI:
1849
1080
  return new s(k);
1850
1081
  case h.BYTE:
@@ -1856,7 +1087,7 @@ Minimum version required to store current data is: ` + Y + `.
1856
1087
  return typeof p == "string" ? m.push(I(p, null)) : p.data && m.push(I(p.data, p.mode)), m;
1857
1088
  }, []);
1858
1089
  }, u.fromString = function(_, m) {
1859
- for (var p = A(_, a.isKanjiModeEnabled()), E = C(p), T = B(E, m), L = w.find_path(T.map, "start", "end"), W = [], $ = 1; $ < L.length - 1; $++)
1090
+ for (var p = A(_, a.isKanjiModeEnabled()), C = E(p), T = B(C, m), L = y.find_path(T.map, "start", "end"), W = [], $ = 1; $ < L.length - 1; $++)
1860
1091
  W.push(T.table[L[$]].node);
1861
1092
  return u.fromArray(M(W));
1862
1093
  }, u.rawSplit = function(_) {
@@ -1917,9 +1148,9 @@ Minimum version required to store current data is: ` + Y + `.
1917
1148
  return i * 4 + 17;
1918
1149
  }, u.getSymbolTotalCodewords = function(i) {
1919
1150
  return d[i];
1920
- }, u.getBCHDigit = function(c) {
1921
- for (var i = 0; c !== 0; )
1922
- i++, c >>>= 1;
1151
+ }, u.getBCHDigit = function(l) {
1152
+ for (var i = 0; l !== 0; )
1153
+ i++, l >>>= 1;
1923
1154
  return i;
1924
1155
  }, u.setToSJISFunction = function(i) {
1925
1156
  if (typeof i != "function")
@@ -1935,39 +1166,39 @@ Minimum version required to store current data is: ` + Y + `.
1935
1166
  return !isNaN(d) && d >= 1 && d <= 40;
1936
1167
  };
1937
1168
  }, {}], 23: [function(n, g, u) {
1938
- var h = n("./utils"), d = n("./error-correction-code"), c = n("./error-correction-level"), i = n("./mode"), s = n("./version-check"), f = n("isarray"), a = 7973, w = h.getBCHDigit(a);
1939
- function x(M, C, B) {
1169
+ var h = n("./utils"), d = n("./error-correction-code"), l = n("./error-correction-level"), i = n("./mode"), s = n("./version-check"), f = n("isarray"), a = 7973, y = h.getBCHDigit(a);
1170
+ function x(M, E, B) {
1940
1171
  for (var I = 1; I <= 40; I++)
1941
- if (C <= u.getCapacity(I, B, M))
1172
+ if (E <= u.getCapacity(I, B, M))
1942
1173
  return I;
1943
1174
  }
1944
- function b(M, C) {
1945
- return i.getCharCountIndicator(M, C) + 4;
1175
+ function b(M, E) {
1176
+ return i.getCharCountIndicator(M, E) + 4;
1946
1177
  }
1947
- function A(M, C) {
1178
+ function A(M, E) {
1948
1179
  var B = 0;
1949
1180
  return M.forEach(function(I) {
1950
- var k = b(I.mode, C);
1181
+ var k = b(I.mode, E);
1951
1182
  B += k + I.getBitsLength();
1952
1183
  }), B;
1953
1184
  }
1954
- function F(M, C) {
1185
+ function F(M, E) {
1955
1186
  for (var B = 1; B <= 40; B++) {
1956
1187
  var I = A(M, B);
1957
- if (I <= u.getCapacity(B, C, i.MIXED))
1188
+ if (I <= u.getCapacity(B, E, i.MIXED))
1958
1189
  return B;
1959
1190
  }
1960
1191
  }
1961
- u.from = function(C, B) {
1962
- return s.isValid(C) ? parseInt(C, 10) : B;
1963
- }, u.getCapacity = function(C, B, I) {
1964
- if (!s.isValid(C))
1192
+ u.from = function(E, B) {
1193
+ return s.isValid(E) ? parseInt(E, 10) : B;
1194
+ }, u.getCapacity = function(E, B, I) {
1195
+ if (!s.isValid(E))
1965
1196
  throw new Error("Invalid QR Code version");
1966
1197
  typeof I > "u" && (I = i.BYTE);
1967
- var k = h.getSymbolTotalCodewords(C), _ = d.getTotalCodewordsCount(C, B), m = (k - _) * 8;
1198
+ var k = h.getSymbolTotalCodewords(E), _ = d.getTotalCodewordsCount(E, B), m = (k - _) * 8;
1968
1199
  if (I === i.MIXED)
1969
1200
  return m;
1970
- var p = m - b(I, C);
1201
+ var p = m - b(I, E);
1971
1202
  switch (I) {
1972
1203
  case i.NUMERIC:
1973
1204
  return Math.floor(p / 10 * 3);
@@ -1979,40 +1210,40 @@ Minimum version required to store current data is: ` + Y + `.
1979
1210
  default:
1980
1211
  return Math.floor(p / 8);
1981
1212
  }
1982
- }, u.getBestVersionForData = function(C, B) {
1983
- var I, k = c.from(B, c.M);
1984
- if (f(C)) {
1985
- if (C.length > 1)
1986
- return F(C, k);
1987
- if (C.length === 0)
1213
+ }, u.getBestVersionForData = function(E, B) {
1214
+ var I, k = l.from(B, l.M);
1215
+ if (f(E)) {
1216
+ if (E.length > 1)
1217
+ return F(E, k);
1218
+ if (E.length === 0)
1988
1219
  return 1;
1989
- I = C[0];
1220
+ I = E[0];
1990
1221
  } else
1991
- I = C;
1222
+ I = E;
1992
1223
  return x(I.mode, I.getLength(), k);
1993
- }, u.getEncodedBits = function(C) {
1994
- if (!s.isValid(C) || C < 7)
1224
+ }, u.getEncodedBits = function(E) {
1225
+ if (!s.isValid(E) || E < 7)
1995
1226
  throw new Error("Invalid QR Code version");
1996
- for (var B = C << 12; h.getBCHDigit(B) - w >= 0; )
1997
- B ^= a << h.getBCHDigit(B) - w;
1998
- return C << 12 | B;
1227
+ for (var B = E << 12; h.getBCHDigit(B) - y >= 0; )
1228
+ B ^= a << h.getBCHDigit(B) - y;
1229
+ return E << 12 | B;
1999
1230
  };
2000
1231
  }, { "./error-correction-code": 7, "./error-correction-level": 8, "./mode": 14, "./utils": 21, "./version-check": 22, isarray: 33 }], 24: [function(n, g, u) {
2001
- var h = n("./can-promise"), d = n("./core/qrcode"), c = n("./renderer/canvas"), i = n("./renderer/svg-tag.js");
2002
- function s(f, a, w, x, b) {
1232
+ var h = n("./can-promise"), d = n("./core/qrcode"), l = n("./renderer/canvas"), i = n("./renderer/svg-tag.js");
1233
+ function s(f, a, y, x, b) {
2003
1234
  var A = [].slice.call(arguments, 1), F = A.length, M = typeof A[F - 1] == "function";
2004
1235
  if (!M && !h())
2005
1236
  throw new Error("Callback required as last argument");
2006
1237
  if (M) {
2007
1238
  if (F < 2)
2008
1239
  throw new Error("Too few arguments provided");
2009
- F === 2 ? (b = w, w = a, a = x = void 0) : F === 3 && (a.getContext && typeof b > "u" ? (b = x, x = void 0) : (b = x, x = w, w = a, a = void 0));
1240
+ F === 2 ? (b = y, y = a, a = x = void 0) : F === 3 && (a.getContext && typeof b > "u" ? (b = x, x = void 0) : (b = x, x = y, y = a, a = void 0));
2010
1241
  } else {
2011
1242
  if (F < 1)
2012
1243
  throw new Error("Too few arguments provided");
2013
- return F === 1 ? (w = a, a = x = void 0) : F === 2 && !a.getContext && (x = w, w = a, a = void 0), new Promise(function(B, I) {
1244
+ return F === 1 ? (y = a, a = x = void 0) : F === 2 && !a.getContext && (x = y, y = a, a = void 0), new Promise(function(B, I) {
2014
1245
  try {
2015
- var k = d.create(w, x);
1246
+ var k = d.create(y, x);
2016
1247
  B(f(k, a, x));
2017
1248
  } catch (_) {
2018
1249
  I(_);
@@ -2020,21 +1251,21 @@ Minimum version required to store current data is: ` + Y + `.
2020
1251
  });
2021
1252
  }
2022
1253
  try {
2023
- var C = d.create(w, x);
2024
- b(null, f(C, a, x));
1254
+ var E = d.create(y, x);
1255
+ b(null, f(E, a, x));
2025
1256
  } catch (B) {
2026
1257
  b(B);
2027
1258
  }
2028
1259
  }
2029
- u.create = d.create, u.toCanvas = s.bind(null, c.render), u.toDataURL = s.bind(null, c.renderToDataURL), u.toString = s.bind(null, function(f, a, w) {
2030
- return i.render(f, w);
1260
+ u.create = d.create, u.toCanvas = s.bind(null, l.render), u.toDataURL = s.bind(null, l.renderToDataURL), u.toString = s.bind(null, function(f, a, y) {
1261
+ return i.render(f, y);
2031
1262
  });
2032
1263
  }, { "./can-promise": 1, "./core/qrcode": 17, "./renderer/canvas": 25, "./renderer/svg-tag.js": 26 }], 25: [function(n, g, u) {
2033
1264
  var h = n("./utils");
2034
1265
  function d(i, s, f) {
2035
1266
  i.clearRect(0, 0, s.width, s.height), s.style || (s.style = {}), s.height = f, s.width = f, s.style.height = f + "px", s.style.width = f + "px";
2036
1267
  }
2037
- function c() {
1268
+ function l() {
2038
1269
  try {
2039
1270
  return document.createElement("canvas");
2040
1271
  } catch {
@@ -2042,85 +1273,85 @@ Minimum version required to store current data is: ` + Y + `.
2042
1273
  }
2043
1274
  }
2044
1275
  u.render = function(s, f, a) {
2045
- var w = a, x = f;
2046
- typeof w > "u" && (!f || !f.getContext) && (w = f, f = void 0), f || (x = c()), w = h.getOptions(w);
2047
- var b = h.getImageWidth(s.modules.size, w), A = x.getContext("2d"), F = A.createImageData(b, b);
2048
- return h.qrToImageData(F.data, s, w), d(A, x, b), A.putImageData(F, 0, 0), x;
1276
+ var y = a, x = f;
1277
+ typeof y > "u" && (!f || !f.getContext) && (y = f, f = void 0), f || (x = l()), y = h.getOptions(y);
1278
+ var b = h.getImageWidth(s.modules.size, y), A = x.getContext("2d"), F = A.createImageData(b, b);
1279
+ return h.qrToImageData(F.data, s, y), d(A, x, b), A.putImageData(F, 0, 0), x;
2049
1280
  }, u.renderToDataURL = function(s, f, a) {
2050
- var w = a;
2051
- typeof w > "u" && (!f || !f.getContext) && (w = f, f = void 0), w || (w = {});
2052
- var x = u.render(s, f, w), b = w.type || "image/png", A = w.rendererOpts || {};
1281
+ var y = a;
1282
+ typeof y > "u" && (!f || !f.getContext) && (y = f, f = void 0), y || (y = {});
1283
+ var x = u.render(s, f, y), b = y.type || "image/png", A = y.rendererOpts || {};
2053
1284
  return x.toDataURL(b, A.quality);
2054
1285
  };
2055
1286
  }, { "./utils": 27 }], 26: [function(n, g, u) {
2056
1287
  var h = n("./utils");
2057
1288
  function d(s, f) {
2058
- var a = s.a / 255, w = f + '="' + s.hex + '"';
2059
- return a < 1 ? w + " " + f + '-opacity="' + a.toFixed(2).slice(1) + '"' : w;
1289
+ var a = s.a / 255, y = f + '="' + s.hex + '"';
1290
+ return a < 1 ? y + " " + f + '-opacity="' + a.toFixed(2).slice(1) + '"' : y;
2060
1291
  }
2061
- function c(s, f, a) {
2062
- var w = s + f;
2063
- return typeof a < "u" && (w += " " + a), w;
1292
+ function l(s, f, a) {
1293
+ var y = s + f;
1294
+ return typeof a < "u" && (y += " " + a), y;
2064
1295
  }
2065
1296
  function i(s, f, a) {
2066
- for (var w = "", x = 0, b = !1, A = 0, F = 0; F < s.length; F++) {
2067
- var M = Math.floor(F % f), C = Math.floor(F / f);
2068
- !M && !b && (b = !0), s[F] ? (A++, F > 0 && M > 0 && s[F - 1] || (w += b ? c("M", M + a, 0.5 + C + a) : c("m", x, 0), x = 0, b = !1), M + 1 < f && s[F + 1] || (w += c("h", A), A = 0)) : x++;
1297
+ for (var y = "", x = 0, b = !1, A = 0, F = 0; F < s.length; F++) {
1298
+ var M = Math.floor(F % f), E = Math.floor(F / f);
1299
+ !M && !b && (b = !0), s[F] ? (A++, F > 0 && M > 0 && s[F - 1] || (y += b ? l("M", M + a, 0.5 + E + a) : l("m", x, 0), x = 0, b = !1), M + 1 < f && s[F + 1] || (y += l("h", A), A = 0)) : x++;
2069
1300
  }
2070
- return w;
1301
+ return y;
2071
1302
  }
2072
- u.render = function(f, a, w) {
2073
- var x = h.getOptions(a), b = f.modules.size, A = f.modules.data, F = b + x.margin * 2, M = x.color.light.a ? "<path " + d(x.color.light, "fill") + ' d="M0 0h' + F + "v" + F + 'H0z"/>' : "", C = "<path " + d(x.color.dark, "stroke") + ' d="' + i(A, b, x.margin) + '"/>', B = 'viewBox="0 0 ' + F + " " + F + '"', I = x.width ? 'width="' + x.width + '" height="' + x.width + '" ' : "", k = '<svg xmlns="http://www.w3.org/2000/svg" ' + I + B + ' shape-rendering="crispEdges">' + M + C + `</svg>
1303
+ u.render = function(f, a, y) {
1304
+ var x = h.getOptions(a), b = f.modules.size, A = f.modules.data, F = b + x.margin * 2, M = x.color.light.a ? "<path " + d(x.color.light, "fill") + ' d="M0 0h' + F + "v" + F + 'H0z"/>' : "", E = "<path " + d(x.color.dark, "stroke") + ' d="' + i(A, b, x.margin) + '"/>', B = 'viewBox="0 0 ' + F + " " + F + '"', I = x.width ? 'width="' + x.width + '" height="' + x.width + '" ' : "", k = '<svg xmlns="http://www.w3.org/2000/svg" ' + I + B + ' shape-rendering="crispEdges">' + M + E + `</svg>
2074
1305
  `;
2075
- return typeof w == "function" && w(null, k), k;
1306
+ return typeof y == "function" && y(null, k), k;
2076
1307
  };
2077
1308
  }, { "./utils": 27 }], 27: [function(n, g, u) {
2078
1309
  function h(d) {
2079
1310
  if (typeof d == "number" && (d = d.toString()), typeof d != "string")
2080
1311
  throw new Error("Color should be defined as hex string");
2081
- var c = d.slice().replace("#", "").split("");
2082
- if (c.length < 3 || c.length === 5 || c.length > 8)
1312
+ var l = d.slice().replace("#", "").split("");
1313
+ if (l.length < 3 || l.length === 5 || l.length > 8)
2083
1314
  throw new Error("Invalid hex color: " + d);
2084
- (c.length === 3 || c.length === 4) && (c = Array.prototype.concat.apply([], c.map(function(s) {
1315
+ (l.length === 3 || l.length === 4) && (l = Array.prototype.concat.apply([], l.map(function(s) {
2085
1316
  return [s, s];
2086
- }))), c.length === 6 && c.push("F", "F");
2087
- var i = parseInt(c.join(""), 16);
1317
+ }))), l.length === 6 && l.push("F", "F");
1318
+ var i = parseInt(l.join(""), 16);
2088
1319
  return {
2089
1320
  r: i >> 24 & 255,
2090
1321
  g: i >> 16 & 255,
2091
1322
  b: i >> 8 & 255,
2092
1323
  a: i & 255,
2093
- hex: "#" + c.slice(0, 6).join("")
1324
+ hex: "#" + l.slice(0, 6).join("")
2094
1325
  };
2095
1326
  }
2096
- u.getOptions = function(c) {
2097
- c || (c = {}), c.color || (c.color = {});
2098
- var i = typeof c.margin > "u" || c.margin === null || c.margin < 0 ? 4 : c.margin, s = c.width && c.width >= 21 ? c.width : void 0, f = c.scale || 4;
1327
+ u.getOptions = function(l) {
1328
+ l || (l = {}), l.color || (l.color = {});
1329
+ var i = typeof l.margin > "u" || l.margin === null || l.margin < 0 ? 4 : l.margin, s = l.width && l.width >= 21 ? l.width : void 0, f = l.scale || 4;
2099
1330
  return {
2100
1331
  width: s,
2101
1332
  scale: s ? 4 : f,
2102
1333
  margin: i,
2103
1334
  color: {
2104
- dark: h(c.color.dark || "#000000ff"),
2105
- light: h(c.color.light || "#ffffffff")
1335
+ dark: h(l.color.dark || "#000000ff"),
1336
+ light: h(l.color.light || "#ffffffff")
2106
1337
  },
2107
- type: c.type,
2108
- rendererOpts: c.rendererOpts || {}
1338
+ type: l.type,
1339
+ rendererOpts: l.rendererOpts || {}
2109
1340
  };
2110
- }, u.getScale = function(c, i) {
2111
- return i.width && i.width >= c + i.margin * 2 ? i.width / (c + i.margin * 2) : i.scale;
2112
- }, u.getImageWidth = function(c, i) {
2113
- var s = u.getScale(c, i);
2114
- return Math.floor((c + i.margin * 2) * s);
2115
- }, u.qrToImageData = function(c, i, s) {
2116
- for (var f = i.modules.size, a = i.modules.data, w = u.getScale(f, s), x = Math.floor((f + s.margin * 2) * w), b = s.margin * w, A = [s.color.light, s.color.dark], F = 0; F < x; F++)
1341
+ }, u.getScale = function(l, i) {
1342
+ return i.width && i.width >= l + i.margin * 2 ? i.width / (l + i.margin * 2) : i.scale;
1343
+ }, u.getImageWidth = function(l, i) {
1344
+ var s = u.getScale(l, i);
1345
+ return Math.floor((l + i.margin * 2) * s);
1346
+ }, u.qrToImageData = function(l, i, s) {
1347
+ for (var f = i.modules.size, a = i.modules.data, y = u.getScale(f, s), x = Math.floor((f + s.margin * 2) * y), b = s.margin * y, A = [s.color.light, s.color.dark], F = 0; F < x; F++)
2117
1348
  for (var M = 0; M < x; M++) {
2118
- var C = (F * x + M) * 4, B = s.color.light;
1349
+ var E = (F * x + M) * 4, B = s.color.light;
2119
1350
  if (F >= b && M >= b && F < x - b && M < x - b) {
2120
- var I = Math.floor((F - b) / w), k = Math.floor((M - b) / w);
1351
+ var I = Math.floor((F - b) / y), k = Math.floor((M - b) / y);
2121
1352
  B = A[a[I * f + k] ? 1 : 0];
2122
1353
  }
2123
- c[C++] = B.r, c[C++] = B.g, c[C++] = B.b, c[C] = B.a;
1354
+ l[E++] = B.r, l[E++] = B.g, l[E++] = B.b, l[E] = B.a;
2124
1355
  }
2125
1356
  };
2126
1357
  }, {}], 28: [function(n, g, u) {
@@ -2136,9 +1367,9 @@ Minimum version required to store current data is: ` + Y + `.
2136
1367
  }
2137
1368
  }
2138
1369
  i.TYPED_ARRAY_SUPPORT = d();
2139
- var c = i.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823;
1370
+ var l = i.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823;
2140
1371
  function i(_, m, p) {
2141
- return !i.TYPED_ARRAY_SUPPORT && !(this instanceof i) ? new i(_, m, p) : typeof _ == "number" ? w(this, _) : k(this, _, m, p);
1372
+ return !i.TYPED_ARRAY_SUPPORT && !(this instanceof i) ? new i(_, m, p) : typeof _ == "number" ? y(this, _) : k(this, _, m, p);
2142
1373
  }
2143
1374
  i.TYPED_ARRAY_SUPPORT && (i.prototype.__proto__ = Uint8Array.prototype, i.__proto__ = Uint8Array, typeof Symbol < "u" && Symbol.species && i[Symbol.species] === i && Object.defineProperty(i, Symbol.species, {
2144
1375
  value: null,
@@ -2147,8 +1378,8 @@ Minimum version required to store current data is: ` + Y + `.
2147
1378
  writable: !1
2148
1379
  }));
2149
1380
  function s(_) {
2150
- if (_ >= c)
2151
- throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + c.toString(16) + " bytes");
1381
+ if (_ >= l)
1382
+ throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + l.toString(16) + " bytes");
2152
1383
  return _ | 0;
2153
1384
  }
2154
1385
  function f(_) {
@@ -2158,34 +1389,34 @@ Minimum version required to store current data is: ` + Y + `.
2158
1389
  var p;
2159
1390
  return i.TYPED_ARRAY_SUPPORT ? (p = new Uint8Array(m), p.__proto__ = i.prototype) : (p = _, p === null && (p = new i(m)), p.length = m), p;
2160
1391
  }
2161
- function w(_, m) {
1392
+ function y(_, m) {
2162
1393
  var p = a(_, m < 0 ? 0 : s(m) | 0);
2163
1394
  if (!i.TYPED_ARRAY_SUPPORT)
2164
- for (var E = 0; E < m; ++E)
2165
- p[E] = 0;
1395
+ for (var C = 0; C < m; ++C)
1396
+ p[C] = 0;
2166
1397
  return p;
2167
1398
  }
2168
1399
  function x(_, m) {
2169
- var p = C(m) | 0, E = a(_, p), T = E.write(m);
2170
- return T !== p && (E = E.slice(0, T)), E;
1400
+ var p = E(m) | 0, C = a(_, p), T = C.write(m);
1401
+ return T !== p && (C = C.slice(0, T)), C;
2171
1402
  }
2172
1403
  function b(_, m) {
2173
- for (var p = m.length < 0 ? 0 : s(m.length) | 0, E = a(_, p), T = 0; T < p; T += 1)
2174
- E[T] = m[T] & 255;
2175
- return E;
1404
+ for (var p = m.length < 0 ? 0 : s(m.length) | 0, C = a(_, p), T = 0; T < p; T += 1)
1405
+ C[T] = m[T] & 255;
1406
+ return C;
2176
1407
  }
2177
- function A(_, m, p, E) {
1408
+ function A(_, m, p, C) {
2178
1409
  if (p < 0 || m.byteLength < p)
2179
1410
  throw new RangeError("'offset' is out of bounds");
2180
- if (m.byteLength < p + (E || 0))
1411
+ if (m.byteLength < p + (C || 0))
2181
1412
  throw new RangeError("'length' is out of bounds");
2182
1413
  var T;
2183
- return p === void 0 && E === void 0 ? T = new Uint8Array(m) : E === void 0 ? T = new Uint8Array(m, p) : T = new Uint8Array(m, p, E), i.TYPED_ARRAY_SUPPORT ? T.__proto__ = i.prototype : T = b(_, T), T;
1414
+ return p === void 0 && C === void 0 ? T = new Uint8Array(m) : C === void 0 ? T = new Uint8Array(m, p) : T = new Uint8Array(m, p, C), i.TYPED_ARRAY_SUPPORT ? T.__proto__ = i.prototype : T = b(_, T), T;
2184
1415
  }
2185
1416
  function F(_, m) {
2186
1417
  if (i.isBuffer(m)) {
2187
- var p = s(m.length) | 0, E = a(_, p);
2188
- return E.length === 0 || m.copy(E, 0, 0, p), E;
1418
+ var p = s(m.length) | 0, C = a(_, p);
1419
+ return C.length === 0 || m.copy(C, 0, 0, p), C;
2189
1420
  }
2190
1421
  if (m) {
2191
1422
  if (typeof ArrayBuffer < "u" && m.buffer instanceof ArrayBuffer || "length" in m)
@@ -2197,13 +1428,13 @@ Minimum version required to store current data is: ` + Y + `.
2197
1428
  }
2198
1429
  function M(_, m) {
2199
1430
  m = m || 1 / 0;
2200
- for (var p, E = _.length, T = null, L = [], W = 0; W < E; ++W) {
1431
+ for (var p, C = _.length, T = null, L = [], W = 0; W < C; ++W) {
2201
1432
  if (p = _.charCodeAt(W), p > 55295 && p < 57344) {
2202
1433
  if (!T) {
2203
1434
  if (p > 56319) {
2204
1435
  (m -= 3) > -1 && L.push(239, 191, 189);
2205
1436
  continue;
2206
- } else if (W + 1 === E) {
1437
+ } else if (W + 1 === C) {
2207
1438
  (m -= 3) > -1 && L.push(239, 191, 189);
2208
1439
  continue;
2209
1440
  }
@@ -2250,7 +1481,7 @@ Minimum version required to store current data is: ` + Y + `.
2250
1481
  }
2251
1482
  return L;
2252
1483
  }
2253
- function C(_) {
1484
+ function E(_) {
2254
1485
  if (i.isBuffer(_))
2255
1486
  return _.length;
2256
1487
  if (typeof ArrayBuffer < "u" && typeof ArrayBuffer.isView == "function" && (ArrayBuffer.isView(_) || _ instanceof ArrayBuffer))
@@ -2259,28 +1490,28 @@ Minimum version required to store current data is: ` + Y + `.
2259
1490
  var m = _.length;
2260
1491
  return m === 0 ? 0 : M(_).length;
2261
1492
  }
2262
- function B(_, m, p, E) {
2263
- for (var T = 0; T < E && !(T + p >= m.length || T >= _.length); ++T)
1493
+ function B(_, m, p, C) {
1494
+ for (var T = 0; T < C && !(T + p >= m.length || T >= _.length); ++T)
2264
1495
  m[T + p] = _[T];
2265
1496
  return T;
2266
1497
  }
2267
- function I(_, m, p, E) {
2268
- return B(M(m, _.length - p), _, p, E);
1498
+ function I(_, m, p, C) {
1499
+ return B(M(m, _.length - p), _, p, C);
2269
1500
  }
2270
- function k(_, m, p, E) {
1501
+ function k(_, m, p, C) {
2271
1502
  if (typeof m == "number")
2272
1503
  throw new TypeError('"value" argument must not be a number');
2273
- return typeof ArrayBuffer < "u" && m instanceof ArrayBuffer ? A(_, m, p, E) : typeof m == "string" ? x(_, m) : F(_, m);
1504
+ return typeof ArrayBuffer < "u" && m instanceof ArrayBuffer ? A(_, m, p, C) : typeof m == "string" ? x(_, m) : F(_, m);
2274
1505
  }
2275
- i.prototype.write = function(m, p, E) {
2276
- p === void 0 ? (E = this.length, p = 0) : E === void 0 && typeof p == "string" ? (E = this.length, p = 0) : isFinite(p) && (p = p | 0, isFinite(E) ? E = E | 0 : E = void 0);
1506
+ i.prototype.write = function(m, p, C) {
1507
+ p === void 0 ? (C = this.length, p = 0) : C === void 0 && typeof p == "string" ? (C = this.length, p = 0) : isFinite(p) && (p = p | 0, isFinite(C) ? C = C | 0 : C = void 0);
2277
1508
  var T = this.length - p;
2278
- if ((E === void 0 || E > T) && (E = T), m.length > 0 && (E < 0 || p < 0) || p > this.length)
1509
+ if ((C === void 0 || C > T) && (C = T), m.length > 0 && (C < 0 || p < 0) || p > this.length)
2279
1510
  throw new RangeError("Attempt to write outside buffer bounds");
2280
- return I(this, m, p, E);
1511
+ return I(this, m, p, C);
2281
1512
  }, i.prototype.slice = function(m, p) {
2282
- var E = this.length;
2283
- m = ~~m, p = p === void 0 ? E : ~~p, m < 0 ? (m += E, m < 0 && (m = 0)) : m > E && (m = E), p < 0 ? (p += E, p < 0 && (p = 0)) : p > E && (p = E), p < m && (p = m);
1513
+ var C = this.length;
1514
+ m = ~~m, p = p === void 0 ? C : ~~p, m < 0 ? (m += C, m < 0 && (m = 0)) : m > C && (m = C), p < 0 ? (p += C, p < 0 && (p = 0)) : p > C && (p = C), p < m && (p = m);
2284
1515
  var T;
2285
1516
  if (i.TYPED_ARRAY_SUPPORT)
2286
1517
  T = this.subarray(m, p), T.__proto__ = i.prototype;
@@ -2291,50 +1522,50 @@ Minimum version required to store current data is: ` + Y + `.
2291
1522
  T[W] = this[W + m];
2292
1523
  }
2293
1524
  return T;
2294
- }, i.prototype.copy = function(m, p, E, T) {
2295
- if (E || (E = 0), !T && T !== 0 && (T = this.length), p >= m.length && (p = m.length), p || (p = 0), T > 0 && T < E && (T = E), T === E || m.length === 0 || this.length === 0)
1525
+ }, i.prototype.copy = function(m, p, C, T) {
1526
+ if (C || (C = 0), !T && T !== 0 && (T = this.length), p >= m.length && (p = m.length), p || (p = 0), T > 0 && T < C && (T = C), T === C || m.length === 0 || this.length === 0)
2296
1527
  return 0;
2297
1528
  if (p < 0)
2298
1529
  throw new RangeError("targetStart out of bounds");
2299
- if (E < 0 || E >= this.length)
1530
+ if (C < 0 || C >= this.length)
2300
1531
  throw new RangeError("sourceStart out of bounds");
2301
1532
  if (T < 0)
2302
1533
  throw new RangeError("sourceEnd out of bounds");
2303
- T > this.length && (T = this.length), m.length - p < T - E && (T = m.length - p + E);
2304
- var L = T - E, W;
2305
- if (this === m && E < p && p < T)
1534
+ T > this.length && (T = this.length), m.length - p < T - C && (T = m.length - p + C);
1535
+ var L = T - C, W;
1536
+ if (this === m && C < p && p < T)
2306
1537
  for (W = L - 1; W >= 0; --W)
2307
- m[W + p] = this[W + E];
1538
+ m[W + p] = this[W + C];
2308
1539
  else if (L < 1e3 || !i.TYPED_ARRAY_SUPPORT)
2309
1540
  for (W = 0; W < L; ++W)
2310
- m[W + p] = this[W + E];
1541
+ m[W + p] = this[W + C];
2311
1542
  else
2312
1543
  Uint8Array.prototype.set.call(
2313
1544
  m,
2314
- this.subarray(E, E + L),
1545
+ this.subarray(C, C + L),
2315
1546
  p
2316
1547
  );
2317
1548
  return L;
2318
- }, i.prototype.fill = function(m, p, E) {
1549
+ }, i.prototype.fill = function(m, p, C) {
2319
1550
  if (typeof m == "string") {
2320
- if (typeof p == "string" ? (p = 0, E = this.length) : typeof E == "string" && (E = this.length), m.length === 1) {
1551
+ if (typeof p == "string" ? (p = 0, C = this.length) : typeof C == "string" && (C = this.length), m.length === 1) {
2321
1552
  var T = m.charCodeAt(0);
2322
1553
  T < 256 && (m = T);
2323
1554
  }
2324
1555
  } else
2325
1556
  typeof m == "number" && (m = m & 255);
2326
- if (p < 0 || this.length < p || this.length < E)
1557
+ if (p < 0 || this.length < p || this.length < C)
2327
1558
  throw new RangeError("Out of range index");
2328
- if (E <= p)
1559
+ if (C <= p)
2329
1560
  return this;
2330
- p = p >>> 0, E = E === void 0 ? this.length : E >>> 0, m || (m = 0);
1561
+ p = p >>> 0, C = C === void 0 ? this.length : C >>> 0, m || (m = 0);
2331
1562
  var L;
2332
1563
  if (typeof m == "number")
2333
- for (L = p; L < E; ++L)
1564
+ for (L = p; L < C; ++L)
2334
1565
  this[L] = m;
2335
1566
  else {
2336
1567
  var W = i.isBuffer(m) ? m : new i(m), $ = W.length;
2337
- for (L = 0; L < E - p; ++L)
1568
+ for (L = 0; L < C - p; ++L)
2338
1569
  this[L + p] = W[L % $];
2339
1570
  }
2340
1571
  return this;
@@ -2343,19 +1574,19 @@ Minimum version required to store current data is: ` + Y + `.
2343
1574
  throw new TypeError('"list" argument must be an Array of Buffers');
2344
1575
  if (m.length === 0)
2345
1576
  return a(null, 0);
2346
- var E;
1577
+ var C;
2347
1578
  if (p === void 0)
2348
- for (p = 0, E = 0; E < m.length; ++E)
2349
- p += m[E].length;
2350
- var T = w(null, p), L = 0;
2351
- for (E = 0; E < m.length; ++E) {
2352
- var W = m[E];
1579
+ for (p = 0, C = 0; C < m.length; ++C)
1580
+ p += m[C].length;
1581
+ var T = y(null, p), L = 0;
1582
+ for (C = 0; C < m.length; ++C) {
1583
+ var W = m[C];
2353
1584
  if (!i.isBuffer(W))
2354
1585
  throw new TypeError('"list" argument must be an Array of Buffers');
2355
1586
  W.copy(T, L), L += W.length;
2356
1587
  }
2357
1588
  return T;
2358
- }, i.byteLength = C, i.prototype._isBuffer = !0, i.isBuffer = function(m) {
1589
+ }, i.byteLength = E, i.prototype._isBuffer = !0, i.isBuffer = function(m) {
2359
1590
  return !!(m != null && m._isBuffer);
2360
1591
  }, g.exports.alloc = function(_) {
2361
1592
  var m = new i(_);
@@ -2364,55 +1595,55 @@ Minimum version required to store current data is: ` + Y + `.
2364
1595
  return new i(_);
2365
1596
  };
2366
1597
  }, { isarray: 33 }], 29: [function(n, g, u) {
2367
- u.byteLength = w, u.toByteArray = b, u.fromByteArray = M;
2368
- for (var h = [], d = [], c = typeof Uint8Array < "u" ? Uint8Array : Array, i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", s = 0, f = i.length; s < f; ++s)
1598
+ u.byteLength = y, u.toByteArray = b, u.fromByteArray = M;
1599
+ for (var h = [], d = [], l = typeof Uint8Array < "u" ? Uint8Array : Array, i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", s = 0, f = i.length; s < f; ++s)
2369
1600
  h[s] = i[s], d[i.charCodeAt(s)] = s;
2370
- d["-".charCodeAt(0)] = 62, d["_".charCodeAt(0)] = 63;
2371
- function a(C) {
2372
- var B = C.length;
1601
+ d[45] = 62, d[95] = 63;
1602
+ function a(E) {
1603
+ var B = E.length;
2373
1604
  if (B % 4 > 0)
2374
1605
  throw new Error("Invalid string. Length must be a multiple of 4");
2375
- var I = C.indexOf("=");
1606
+ var I = E.indexOf("=");
2376
1607
  I === -1 && (I = B);
2377
1608
  var k = I === B ? 0 : 4 - I % 4;
2378
1609
  return [I, k];
2379
1610
  }
2380
- function w(C) {
2381
- var B = a(C), I = B[0], k = B[1];
1611
+ function y(E) {
1612
+ var B = a(E), I = B[0], k = B[1];
2382
1613
  return (I + k) * 3 / 4 - k;
2383
1614
  }
2384
- function x(C, B, I) {
1615
+ function x(E, B, I) {
2385
1616
  return (B + I) * 3 / 4 - I;
2386
1617
  }
2387
- function b(C) {
2388
- var B, I = a(C), k = I[0], _ = I[1], m = new c(x(C, k, _)), p = 0, E = _ > 0 ? k - 4 : k, T;
2389
- for (T = 0; T < E; T += 4)
2390
- B = d[C.charCodeAt(T)] << 18 | d[C.charCodeAt(T + 1)] << 12 | d[C.charCodeAt(T + 2)] << 6 | d[C.charCodeAt(T + 3)], m[p++] = B >> 16 & 255, m[p++] = B >> 8 & 255, m[p++] = B & 255;
2391
- return _ === 2 && (B = d[C.charCodeAt(T)] << 2 | d[C.charCodeAt(T + 1)] >> 4, m[p++] = B & 255), _ === 1 && (B = d[C.charCodeAt(T)] << 10 | d[C.charCodeAt(T + 1)] << 4 | d[C.charCodeAt(T + 2)] >> 2, m[p++] = B >> 8 & 255, m[p++] = B & 255), m;
1618
+ function b(E) {
1619
+ var B, I = a(E), k = I[0], _ = I[1], m = new l(x(E, k, _)), p = 0, C = _ > 0 ? k - 4 : k, T;
1620
+ for (T = 0; T < C; T += 4)
1621
+ B = d[E.charCodeAt(T)] << 18 | d[E.charCodeAt(T + 1)] << 12 | d[E.charCodeAt(T + 2)] << 6 | d[E.charCodeAt(T + 3)], m[p++] = B >> 16 & 255, m[p++] = B >> 8 & 255, m[p++] = B & 255;
1622
+ return _ === 2 && (B = d[E.charCodeAt(T)] << 2 | d[E.charCodeAt(T + 1)] >> 4, m[p++] = B & 255), _ === 1 && (B = d[E.charCodeAt(T)] << 10 | d[E.charCodeAt(T + 1)] << 4 | d[E.charCodeAt(T + 2)] >> 2, m[p++] = B >> 8 & 255, m[p++] = B & 255), m;
2392
1623
  }
2393
- function A(C) {
2394
- return h[C >> 18 & 63] + h[C >> 12 & 63] + h[C >> 6 & 63] + h[C & 63];
1624
+ function A(E) {
1625
+ return h[E >> 18 & 63] + h[E >> 12 & 63] + h[E >> 6 & 63] + h[E & 63];
2395
1626
  }
2396
- function F(C, B, I) {
1627
+ function F(E, B, I) {
2397
1628
  for (var k, _ = [], m = B; m < I; m += 3)
2398
- k = (C[m] << 16 & 16711680) + (C[m + 1] << 8 & 65280) + (C[m + 2] & 255), _.push(A(k));
1629
+ k = (E[m] << 16 & 16711680) + (E[m + 1] << 8 & 65280) + (E[m + 2] & 255), _.push(A(k));
2399
1630
  return _.join("");
2400
1631
  }
2401
- function M(C) {
2402
- for (var B, I = C.length, k = I % 3, _ = [], m = 16383, p = 0, E = I - k; p < E; p += m)
1632
+ function M(E) {
1633
+ for (var B, I = E.length, k = I % 3, _ = [], m = 16383, p = 0, C = I - k; p < C; p += m)
2403
1634
  _.push(F(
2404
- C,
1635
+ E,
2405
1636
  p,
2406
- p + m > E ? E : p + m
1637
+ p + m > C ? C : p + m
2407
1638
  ));
2408
- return k === 1 ? (B = C[I - 1], _.push(
1639
+ return k === 1 ? (B = E[I - 1], _.push(
2409
1640
  h[B >> 2] + h[B << 4 & 63] + "=="
2410
- )) : k === 2 && (B = (C[I - 2] << 8) + C[I - 1], _.push(
1641
+ )) : k === 2 && (B = (E[I - 2] << 8) + E[I - 1], _.push(
2411
1642
  h[B >> 10] + h[B >> 4 & 63] + h[B << 2 & 63] + "="
2412
1643
  )), _.join("");
2413
1644
  }
2414
1645
  }, {}], 30: [function(n, g, u) {
2415
- var h = n("base64-js"), d = n("ieee754"), c = typeof Symbol == "function" && typeof Symbol.for == "function" ? Symbol.for("nodejs.util.inspect.custom") : null;
1646
+ var h = n("base64-js"), d = n("ieee754"), l = typeof Symbol == "function" && typeof Symbol.for == "function" ? Symbol.for("nodejs.util.inspect.custom") : null;
2416
1647
  u.Buffer = a, u.SlowBuffer = k, u.INSPECT_MAX_BYTES = 50;
2417
1648
  var i = 2147483647;
2418
1649
  u.kMaxLength = i, a.TYPED_ARRAY_SUPPORT = s(), !a.TYPED_ARRAY_SUPPORT && typeof console < "u" && typeof console.error == "function" && console.error(
@@ -2455,7 +1686,7 @@ Minimum version required to store current data is: ` + Y + `.
2455
1686
  );
2456
1687
  return A(o);
2457
1688
  }
2458
- return w(o, t, e);
1689
+ return y(o, t, e);
2459
1690
  }
2460
1691
  typeof Symbol < "u" && Symbol.species != null && a[Symbol.species] === a && Object.defineProperty(a, Symbol.species, {
2461
1692
  value: null,
@@ -2463,7 +1694,7 @@ Minimum version required to store current data is: ` + Y + `.
2463
1694
  enumerable: !1,
2464
1695
  writable: !1
2465
1696
  }), a.poolSize = 8192;
2466
- function w(o, t, e) {
1697
+ function y(o, t, e) {
2467
1698
  if (typeof o == "string")
2468
1699
  return F(o, t);
2469
1700
  if (ArrayBuffer.isView(o))
@@ -2473,17 +1704,17 @@ Minimum version required to store current data is: ` + Y + `.
2473
1704
  "The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof o
2474
1705
  );
2475
1706
  if (Q(o, ArrayBuffer) || o && Q(o.buffer, ArrayBuffer))
2476
- return C(o, t, e);
1707
+ return E(o, t, e);
2477
1708
  if (typeof o == "number")
2478
1709
  throw new TypeError(
2479
1710
  'The "value" argument must not be of type number. Received type number'
2480
1711
  );
2481
- var l = o.valueOf && o.valueOf();
2482
- if (l != null && l !== o)
2483
- return a.from(l, t, e);
2484
- var y = B(o);
2485
- if (y)
2486
- return y;
1712
+ var c = o.valueOf && o.valueOf();
1713
+ if (c != null && c !== o)
1714
+ return a.from(c, t, e);
1715
+ var w = B(o);
1716
+ if (w)
1717
+ return w;
2487
1718
  if (typeof Symbol < "u" && Symbol.toPrimitive != null && typeof o[Symbol.toPrimitive] == "function")
2488
1719
  return a.from(
2489
1720
  o[Symbol.toPrimitive]("string"),
@@ -2495,7 +1726,7 @@ Minimum version required to store current data is: ` + Y + `.
2495
1726
  );
2496
1727
  }
2497
1728
  a.from = function(o, t, e) {
2498
- return w(o, t, e);
1729
+ return y(o, t, e);
2499
1730
  }, Object.setPrototypeOf(a.prototype, Uint8Array.prototype), Object.setPrototypeOf(a, Uint8Array);
2500
1731
  function x(o) {
2501
1732
  if (typeof o != "number")
@@ -2520,21 +1751,21 @@ Minimum version required to store current data is: ` + Y + `.
2520
1751
  function F(o, t) {
2521
1752
  if ((typeof t != "string" || t === "") && (t = "utf8"), !a.isEncoding(t))
2522
1753
  throw new TypeError("Unknown encoding: " + t);
2523
- var e = _(o, t) | 0, l = f(e), y = l.write(o, t);
2524
- return y !== e && (l = l.slice(0, y)), l;
1754
+ var e = _(o, t) | 0, c = f(e), w = c.write(o, t);
1755
+ return w !== e && (c = c.slice(0, w)), c;
2525
1756
  }
2526
1757
  function M(o) {
2527
- for (var t = o.length < 0 ? 0 : I(o.length) | 0, e = f(t), l = 0; l < t; l += 1)
2528
- e[l] = o[l] & 255;
1758
+ for (var t = o.length < 0 ? 0 : I(o.length) | 0, e = f(t), c = 0; c < t; c += 1)
1759
+ e[c] = o[c] & 255;
2529
1760
  return e;
2530
1761
  }
2531
- function C(o, t, e) {
1762
+ function E(o, t, e) {
2532
1763
  if (t < 0 || o.byteLength < t)
2533
1764
  throw new RangeError('"offset" is outside of buffer bounds');
2534
1765
  if (o.byteLength < t + (e || 0))
2535
1766
  throw new RangeError('"length" is outside of buffer bounds');
2536
- var l;
2537
- return t === void 0 && e === void 0 ? l = new Uint8Array(o) : e === void 0 ? l = new Uint8Array(o, t) : l = new Uint8Array(o, t, e), Object.setPrototypeOf(l, a.prototype), l;
1767
+ var c;
1768
+ return t === void 0 && e === void 0 ? c = new Uint8Array(o) : e === void 0 ? c = new Uint8Array(o, t) : c = new Uint8Array(o, t, e), Object.setPrototypeOf(c, a.prototype), c;
2538
1769
  }
2539
1770
  function B(o) {
2540
1771
  if (a.isBuffer(o)) {
@@ -2542,7 +1773,7 @@ Minimum version required to store current data is: ` + Y + `.
2542
1773
  return e.length === 0 || o.copy(e, 0, 0, t), e;
2543
1774
  }
2544
1775
  if (o.length !== void 0)
2545
- return typeof o.length != "number" || yt(o.length) ? f(0) : M(o);
1776
+ return typeof o.length != "number" || wt(o.length) ? f(0) : M(o);
2546
1777
  if (o.type === "Buffer" && Array.isArray(o.data))
2547
1778
  return M(o.data);
2548
1779
  }
@@ -2563,12 +1794,12 @@ Minimum version required to store current data is: ` + Y + `.
2563
1794
  );
2564
1795
  if (t === e)
2565
1796
  return 0;
2566
- for (var l = t.length, y = e.length, P = 0, S = Math.min(l, y); P < S; ++P)
1797
+ for (var c = t.length, w = e.length, P = 0, S = Math.min(c, w); P < S; ++P)
2567
1798
  if (t[P] !== e[P]) {
2568
- l = t[P], y = e[P];
1799
+ c = t[P], w = e[P];
2569
1800
  break;
2570
1801
  }
2571
- return l < y ? -1 : y < l ? 1 : 0;
1802
+ return c < w ? -1 : w < c ? 1 : 0;
2572
1803
  }, a.isEncoding = function(t) {
2573
1804
  switch (String(t).toLowerCase()) {
2574
1805
  case "hex":
@@ -2591,18 +1822,18 @@ Minimum version required to store current data is: ` + Y + `.
2591
1822
  throw new TypeError('"list" argument must be an Array of Buffers');
2592
1823
  if (t.length === 0)
2593
1824
  return a.alloc(0);
2594
- var l;
1825
+ var c;
2595
1826
  if (e === void 0)
2596
- for (e = 0, l = 0; l < t.length; ++l)
2597
- e += t[l].length;
2598
- var y = a.allocUnsafe(e), P = 0;
2599
- for (l = 0; l < t.length; ++l) {
2600
- var S = t[l];
1827
+ for (e = 0, c = 0; c < t.length; ++c)
1828
+ e += t[c].length;
1829
+ var w = a.allocUnsafe(e), P = 0;
1830
+ for (c = 0; c < t.length; ++c) {
1831
+ var S = t[c];
2601
1832
  if (Q(S, Uint8Array) && (S = a.from(S)), !a.isBuffer(S))
2602
1833
  throw new TypeError('"list" argument must be an Array of Buffers');
2603
- S.copy(y, P), P += S.length;
1834
+ S.copy(w, P), P += S.length;
2604
1835
  }
2605
- return y;
1836
+ return w;
2606
1837
  };
2607
1838
  function _(o, t) {
2608
1839
  if (a.isBuffer(o))
@@ -2613,10 +1844,10 @@ Minimum version required to store current data is: ` + Y + `.
2613
1844
  throw new TypeError(
2614
1845
  'The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof o
2615
1846
  );
2616
- var e = o.length, l = arguments.length > 2 && arguments[2] === !0;
2617
- if (!l && e === 0)
1847
+ var e = o.length, c = arguments.length > 2 && arguments[2] === !0;
1848
+ if (!c && e === 0)
2618
1849
  return 0;
2619
- for (var y = !1; ; )
1850
+ for (var w = !1; ; )
2620
1851
  switch (t) {
2621
1852
  case "ascii":
2622
1853
  case "latin1":
@@ -2635,14 +1866,14 @@ Minimum version required to store current data is: ` + Y + `.
2635
1866
  case "base64":
2636
1867
  return ht(o).length;
2637
1868
  default:
2638
- if (y)
2639
- return l ? -1 : rt(o).length;
2640
- t = ("" + t).toLowerCase(), y = !0;
1869
+ if (w)
1870
+ return c ? -1 : rt(o).length;
1871
+ t = ("" + t).toLowerCase(), w = !0;
2641
1872
  }
2642
1873
  }
2643
1874
  a.byteLength = _;
2644
1875
  function m(o, t, e) {
2645
- var l = !1;
1876
+ var c = !1;
2646
1877
  if ((t === void 0 || t < 0) && (t = 0), t > this.length || ((e === void 0 || e > this.length) && (e = this.length), e <= 0) || (e >>>= 0, t >>>= 0, e <= t))
2647
1878
  return "";
2648
1879
  for (o || (o = "utf8"); ; )
@@ -2665,15 +1896,15 @@ Minimum version required to store current data is: ` + Y + `.
2665
1896
  case "utf-16le":
2666
1897
  return mt(this, t, e);
2667
1898
  default:
2668
- if (l)
1899
+ if (c)
2669
1900
  throw new TypeError("Unknown encoding: " + o);
2670
- o = (o + "").toLowerCase(), l = !0;
1901
+ o = (o + "").toLowerCase(), c = !0;
2671
1902
  }
2672
1903
  }
2673
1904
  a.prototype._isBuffer = !0;
2674
1905
  function p(o, t, e) {
2675
- var l = o[t];
2676
- o[t] = o[e], o[e] = l;
1906
+ var c = o[t];
1907
+ o[t] = o[e], o[e] = c;
2677
1908
  }
2678
1909
  a.prototype.swap16 = function() {
2679
1910
  var t = this.length;
@@ -2706,49 +1937,49 @@ Minimum version required to store current data is: ` + Y + `.
2706
1937
  }, a.prototype.inspect = function() {
2707
1938
  var t = "", e = u.INSPECT_MAX_BYTES;
2708
1939
  return t = this.toString("hex", 0, e).replace(/(.{2})/g, "$1 ").trim(), this.length > e && (t += " ... "), "<Buffer " + t + ">";
2709
- }, c && (a.prototype[c] = a.prototype.inspect), a.prototype.compare = function(t, e, l, y, P) {
1940
+ }, l && (a.prototype[l] = a.prototype.inspect), a.prototype.compare = function(t, e, c, w, P) {
2710
1941
  if (Q(t, Uint8Array) && (t = a.from(t, t.offset, t.byteLength)), !a.isBuffer(t))
2711
1942
  throw new TypeError(
2712
1943
  'The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof t
2713
1944
  );
2714
- if (e === void 0 && (e = 0), l === void 0 && (l = t ? t.length : 0), y === void 0 && (y = 0), P === void 0 && (P = this.length), e < 0 || l > t.length || y < 0 || P > this.length)
1945
+ if (e === void 0 && (e = 0), c === void 0 && (c = t ? t.length : 0), w === void 0 && (w = 0), P === void 0 && (P = this.length), e < 0 || c > t.length || w < 0 || P > this.length)
2715
1946
  throw new RangeError("out of range index");
2716
- if (y >= P && e >= l)
1947
+ if (w >= P && e >= c)
2717
1948
  return 0;
2718
- if (y >= P)
1949
+ if (w >= P)
2719
1950
  return -1;
2720
- if (e >= l)
1951
+ if (e >= c)
2721
1952
  return 1;
2722
- if (e >>>= 0, l >>>= 0, y >>>= 0, P >>>= 0, this === t)
1953
+ if (e >>>= 0, c >>>= 0, w >>>= 0, P >>>= 0, this === t)
2723
1954
  return 0;
2724
- for (var S = P - y, H = l - e, G = Math.min(S, H), K = this.slice(y, P), Z = t.slice(e, l), V = 0; V < G; ++V)
1955
+ for (var S = P - w, H = c - e, G = Math.min(S, H), K = this.slice(w, P), Z = t.slice(e, c), V = 0; V < G; ++V)
2725
1956
  if (K[V] !== Z[V]) {
2726
1957
  S = K[V], H = Z[V];
2727
1958
  break;
2728
1959
  }
2729
1960
  return S < H ? -1 : H < S ? 1 : 0;
2730
1961
  };
2731
- function E(o, t, e, l, y) {
1962
+ function C(o, t, e, c, w) {
2732
1963
  if (o.length === 0)
2733
1964
  return -1;
2734
- if (typeof e == "string" ? (l = e, e = 0) : e > 2147483647 ? e = 2147483647 : e < -2147483648 && (e = -2147483648), e = +e, yt(e) && (e = y ? 0 : o.length - 1), e < 0 && (e = o.length + e), e >= o.length) {
2735
- if (y)
1965
+ if (typeof e == "string" ? (c = e, e = 0) : e > 2147483647 ? e = 2147483647 : e < -2147483648 && (e = -2147483648), e = +e, wt(e) && (e = w ? 0 : o.length - 1), e < 0 && (e = o.length + e), e >= o.length) {
1966
+ if (w)
2736
1967
  return -1;
2737
1968
  e = o.length - 1;
2738
1969
  } else if (e < 0)
2739
- if (y)
1970
+ if (w)
2740
1971
  e = 0;
2741
1972
  else
2742
1973
  return -1;
2743
- if (typeof t == "string" && (t = a.from(t, l)), a.isBuffer(t))
2744
- return t.length === 0 ? -1 : T(o, t, e, l, y);
1974
+ if (typeof t == "string" && (t = a.from(t, c)), a.isBuffer(t))
1975
+ return t.length === 0 ? -1 : T(o, t, e, c, w);
2745
1976
  if (typeof t == "number")
2746
- return t = t & 255, typeof Uint8Array.prototype.indexOf == "function" ? y ? Uint8Array.prototype.indexOf.call(o, t, e) : Uint8Array.prototype.lastIndexOf.call(o, t, e) : T(o, [t], e, l, y);
1977
+ return t = t & 255, typeof Uint8Array.prototype.indexOf == "function" ? w ? Uint8Array.prototype.indexOf.call(o, t, e) : Uint8Array.prototype.lastIndexOf.call(o, t, e) : T(o, [t], e, c, w);
2747
1978
  throw new TypeError("val must be string, number or Buffer");
2748
1979
  }
2749
- function T(o, t, e, l, y) {
1980
+ function T(o, t, e, c, w) {
2750
1981
  var P = 1, S = o.length, H = t.length;
2751
- if (l !== void 0 && (l = String(l).toLowerCase(), l === "ucs2" || l === "ucs-2" || l === "utf16le" || l === "utf-16le")) {
1982
+ if (c !== void 0 && (c = String(c).toLowerCase(), c === "ucs2" || c === "ucs-2" || c === "utf16le" || c === "utf-16le")) {
2752
1983
  if (o.length < 2 || t.length < 2)
2753
1984
  return -1;
2754
1985
  P = 2, S /= 2, H /= 2, e /= 2;
@@ -2757,7 +1988,7 @@ Minimum version required to store current data is: ` + Y + `.
2757
1988
  return P === 1 ? Pt[St] : Pt.readUInt16BE(St * P);
2758
1989
  }
2759
1990
  var K;
2760
- if (y) {
1991
+ if (w) {
2761
1992
  var Z = -1;
2762
1993
  for (K = e; K < S; K++)
2763
1994
  if (G(o, K) === G(t, Z === -1 ? 0 : K - Z)) {
@@ -2777,80 +2008,80 @@ Minimum version required to store current data is: ` + Y + `.
2777
2008
  }
2778
2009
  return -1;
2779
2010
  }
2780
- a.prototype.includes = function(t, e, l) {
2781
- return this.indexOf(t, e, l) !== -1;
2782
- }, a.prototype.indexOf = function(t, e, l) {
2783
- return E(this, t, e, l, !0);
2784
- }, a.prototype.lastIndexOf = function(t, e, l) {
2785
- return E(this, t, e, l, !1);
2011
+ a.prototype.includes = function(t, e, c) {
2012
+ return this.indexOf(t, e, c) !== -1;
2013
+ }, a.prototype.indexOf = function(t, e, c) {
2014
+ return C(this, t, e, c, !0);
2015
+ }, a.prototype.lastIndexOf = function(t, e, c) {
2016
+ return C(this, t, e, c, !1);
2786
2017
  };
2787
- function L(o, t, e, l) {
2018
+ function L(o, t, e, c) {
2788
2019
  e = Number(e) || 0;
2789
- var y = o.length - e;
2790
- l ? (l = Number(l), l > y && (l = y)) : l = y;
2020
+ var w = o.length - e;
2021
+ c ? (c = Number(c), c > w && (c = w)) : c = w;
2791
2022
  var P = t.length;
2792
- l > P / 2 && (l = P / 2);
2793
- for (var S = 0; S < l; ++S) {
2023
+ c > P / 2 && (c = P / 2);
2024
+ for (var S = 0; S < c; ++S) {
2794
2025
  var H = parseInt(t.substr(S * 2, 2), 16);
2795
- if (yt(H))
2026
+ if (wt(H))
2796
2027
  return S;
2797
2028
  o[e + S] = H;
2798
2029
  }
2799
2030
  return S;
2800
2031
  }
2801
- function W(o, t, e, l) {
2802
- return tt(rt(t, o.length - e), o, e, l);
2032
+ function W(o, t, e, c) {
2033
+ return tt(rt(t, o.length - e), o, e, c);
2803
2034
  }
2804
- function $(o, t, e, l) {
2805
- return tt(lt(t), o, e, l);
2035
+ function $(o, t, e, c) {
2036
+ return tt(ct(t), o, e, c);
2806
2037
  }
2807
- function D(o, t, e, l) {
2808
- return $(o, t, e, l);
2038
+ function D(o, t, e, c) {
2039
+ return $(o, t, e, c);
2809
2040
  }
2810
- function U(o, t, e, l) {
2811
- return tt(ht(t), o, e, l);
2041
+ function U(o, t, e, c) {
2042
+ return tt(ht(t), o, e, c);
2812
2043
  }
2813
- function R(o, t, e, l) {
2814
- return tt(ct(t, o.length - e), o, e, l);
2044
+ function R(o, t, e, c) {
2045
+ return tt(lt(t, o.length - e), o, e, c);
2815
2046
  }
2816
- a.prototype.write = function(t, e, l, y) {
2047
+ a.prototype.write = function(t, e, c, w) {
2817
2048
  if (e === void 0)
2818
- y = "utf8", l = this.length, e = 0;
2819
- else if (l === void 0 && typeof e == "string")
2820
- y = e, l = this.length, e = 0;
2049
+ w = "utf8", c = this.length, e = 0;
2050
+ else if (c === void 0 && typeof e == "string")
2051
+ w = e, c = this.length, e = 0;
2821
2052
  else if (isFinite(e))
2822
- e = e >>> 0, isFinite(l) ? (l = l >>> 0, y === void 0 && (y = "utf8")) : (y = l, l = void 0);
2053
+ e = e >>> 0, isFinite(c) ? (c = c >>> 0, w === void 0 && (w = "utf8")) : (w = c, c = void 0);
2823
2054
  else
2824
2055
  throw new Error(
2825
2056
  "Buffer.write(string, encoding, offset[, length]) is no longer supported"
2826
2057
  );
2827
2058
  var P = this.length - e;
2828
- if ((l === void 0 || l > P) && (l = P), t.length > 0 && (l < 0 || e < 0) || e > this.length)
2059
+ if ((c === void 0 || c > P) && (c = P), t.length > 0 && (c < 0 || e < 0) || e > this.length)
2829
2060
  throw new RangeError("Attempt to write outside buffer bounds");
2830
- y || (y = "utf8");
2061
+ w || (w = "utf8");
2831
2062
  for (var S = !1; ; )
2832
- switch (y) {
2063
+ switch (w) {
2833
2064
  case "hex":
2834
- return L(this, t, e, l);
2065
+ return L(this, t, e, c);
2835
2066
  case "utf8":
2836
2067
  case "utf-8":
2837
- return W(this, t, e, l);
2068
+ return W(this, t, e, c);
2838
2069
  case "ascii":
2839
- return $(this, t, e, l);
2070
+ return $(this, t, e, c);
2840
2071
  case "latin1":
2841
2072
  case "binary":
2842
- return D(this, t, e, l);
2073
+ return D(this, t, e, c);
2843
2074
  case "base64":
2844
- return U(this, t, e, l);
2075
+ return U(this, t, e, c);
2845
2076
  case "ucs2":
2846
2077
  case "ucs-2":
2847
2078
  case "utf16le":
2848
2079
  case "utf-16le":
2849
- return R(this, t, e, l);
2080
+ return R(this, t, e, c);
2850
2081
  default:
2851
2082
  if (S)
2852
- throw new TypeError("Unknown encoding: " + y);
2853
- y = ("" + y).toLowerCase(), S = !0;
2083
+ throw new TypeError("Unknown encoding: " + w);
2084
+ w = ("" + w).toLowerCase(), S = !0;
2854
2085
  }
2855
2086
  }, a.prototype.toJSON = function() {
2856
2087
  return {
@@ -2863,591 +2094,1343 @@ Minimum version required to store current data is: ` + Y + `.
2863
2094
  }
2864
2095
  function z(o, t, e) {
2865
2096
  e = Math.min(o.length, e);
2866
- for (var l = [], y = t; y < e; ) {
2867
- var P = o[y], S = null, H = P > 239 ? 4 : P > 223 ? 3 : P > 191 ? 2 : 1;
2868
- if (y + H <= e) {
2097
+ for (var c = [], w = t; w < e; ) {
2098
+ var P = o[w], S = null, H = P > 239 ? 4 : P > 223 ? 3 : P > 191 ? 2 : 1;
2099
+ if (w + H <= e) {
2869
2100
  var G, K, Z, V;
2870
2101
  switch (H) {
2871
2102
  case 1:
2872
2103
  P < 128 && (S = P);
2873
2104
  break;
2874
2105
  case 2:
2875
- G = o[y + 1], (G & 192) === 128 && (V = (P & 31) << 6 | G & 63, V > 127 && (S = V));
2106
+ G = o[w + 1], (G & 192) === 128 && (V = (P & 31) << 6 | G & 63, V > 127 && (S = V));
2876
2107
  break;
2877
2108
  case 3:
2878
- G = o[y + 1], K = o[y + 2], (G & 192) === 128 && (K & 192) === 128 && (V = (P & 15) << 12 | (G & 63) << 6 | K & 63, V > 2047 && (V < 55296 || V > 57343) && (S = V));
2109
+ G = o[w + 1], K = o[w + 2], (G & 192) === 128 && (K & 192) === 128 && (V = (P & 15) << 12 | (G & 63) << 6 | K & 63, V > 2047 && (V < 55296 || V > 57343) && (S = V));
2879
2110
  break;
2880
2111
  case 4:
2881
- G = o[y + 1], K = o[y + 2], Z = o[y + 3], (G & 192) === 128 && (K & 192) === 128 && (Z & 192) === 128 && (V = (P & 15) << 18 | (G & 63) << 12 | (K & 63) << 6 | Z & 63, V > 65535 && V < 1114112 && (S = V));
2112
+ G = o[w + 1], K = o[w + 2], Z = o[w + 3], (G & 192) === 128 && (K & 192) === 128 && (Z & 192) === 128 && (V = (P & 15) << 18 | (G & 63) << 12 | (K & 63) << 6 | Z & 63, V > 65535 && V < 1114112 && (S = V));
2113
+ }
2114
+ }
2115
+ S === null ? (S = 65533, H = 1) : S > 65535 && (S -= 65536, c.push(S >>> 10 & 1023 | 55296), S = 56320 | S & 1023), c.push(S), w += H;
2116
+ }
2117
+ return Y(c);
2118
+ }
2119
+ var N = 4096;
2120
+ function Y(o) {
2121
+ var t = o.length;
2122
+ if (t <= N)
2123
+ return String.fromCharCode.apply(String, o);
2124
+ for (var e = "", c = 0; c < t; )
2125
+ e += String.fromCharCode.apply(
2126
+ String,
2127
+ o.slice(c, c += N)
2128
+ );
2129
+ return e;
2130
+ }
2131
+ function j(o, t, e) {
2132
+ var c = "";
2133
+ e = Math.min(o.length, e);
2134
+ for (var w = t; w < e; ++w)
2135
+ c += String.fromCharCode(o[w] & 127);
2136
+ return c;
2137
+ }
2138
+ function et(o, t, e) {
2139
+ var c = "";
2140
+ e = Math.min(o.length, e);
2141
+ for (var w = t; w < e; ++w)
2142
+ c += String.fromCharCode(o[w]);
2143
+ return c;
2144
+ }
2145
+ function X(o, t, e) {
2146
+ var c = o.length;
2147
+ (!t || t < 0) && (t = 0), (!e || e < 0 || e > c) && (e = c);
2148
+ for (var w = "", P = t; P < e; ++P)
2149
+ w += kt[o[P]];
2150
+ return w;
2151
+ }
2152
+ function mt(o, t, e) {
2153
+ for (var c = o.slice(t, e), w = "", P = 0; P < c.length; P += 2)
2154
+ w += String.fromCharCode(c[P] + c[P + 1] * 256);
2155
+ return w;
2156
+ }
2157
+ a.prototype.slice = function(t, e) {
2158
+ var c = this.length;
2159
+ t = ~~t, e = e === void 0 ? c : ~~e, t < 0 ? (t += c, t < 0 && (t = 0)) : t > c && (t = c), e < 0 ? (e += c, e < 0 && (e = 0)) : e > c && (e = c), e < t && (e = t);
2160
+ var w = this.subarray(t, e);
2161
+ return Object.setPrototypeOf(w, a.prototype), w;
2162
+ };
2163
+ function J(o, t, e) {
2164
+ if (o % 1 !== 0 || o < 0)
2165
+ throw new RangeError("offset is not uint");
2166
+ if (o + t > e)
2167
+ throw new RangeError("Trying to access beyond buffer length");
2168
+ }
2169
+ a.prototype.readUIntLE = function(t, e, c) {
2170
+ t = t >>> 0, e = e >>> 0, c || J(t, e, this.length);
2171
+ for (var w = this[t], P = 1, S = 0; ++S < e && (P *= 256); )
2172
+ w += this[t + S] * P;
2173
+ return w;
2174
+ }, a.prototype.readUIntBE = function(t, e, c) {
2175
+ t = t >>> 0, e = e >>> 0, c || J(t, e, this.length);
2176
+ for (var w = this[t + --e], P = 1; e > 0 && (P *= 256); )
2177
+ w += this[t + --e] * P;
2178
+ return w;
2179
+ }, a.prototype.readUInt8 = function(t, e) {
2180
+ return t = t >>> 0, e || J(t, 1, this.length), this[t];
2181
+ }, a.prototype.readUInt16LE = function(t, e) {
2182
+ return t = t >>> 0, e || J(t, 2, this.length), this[t] | this[t + 1] << 8;
2183
+ }, a.prototype.readUInt16BE = function(t, e) {
2184
+ return t = t >>> 0, e || J(t, 2, this.length), this[t] << 8 | this[t + 1];
2185
+ }, a.prototype.readUInt32LE = function(t, e) {
2186
+ return t = t >>> 0, e || J(t, 4, this.length), (this[t] | this[t + 1] << 8 | this[t + 2] << 16) + this[t + 3] * 16777216;
2187
+ }, a.prototype.readUInt32BE = function(t, e) {
2188
+ return t = t >>> 0, e || J(t, 4, this.length), this[t] * 16777216 + (this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3]);
2189
+ }, a.prototype.readIntLE = function(t, e, c) {
2190
+ t = t >>> 0, e = e >>> 0, c || J(t, e, this.length);
2191
+ for (var w = this[t], P = 1, S = 0; ++S < e && (P *= 256); )
2192
+ w += this[t + S] * P;
2193
+ return P *= 128, w >= P && (w -= Math.pow(2, 8 * e)), w;
2194
+ }, a.prototype.readIntBE = function(t, e, c) {
2195
+ t = t >>> 0, e = e >>> 0, c || J(t, e, this.length);
2196
+ for (var w = e, P = 1, S = this[t + --w]; w > 0 && (P *= 256); )
2197
+ S += this[t + --w] * P;
2198
+ return P *= 128, S >= P && (S -= Math.pow(2, 8 * e)), S;
2199
+ }, a.prototype.readInt8 = function(t, e) {
2200
+ return t = t >>> 0, e || J(t, 1, this.length), this[t] & 128 ? (255 - this[t] + 1) * -1 : this[t];
2201
+ }, a.prototype.readInt16LE = function(t, e) {
2202
+ t = t >>> 0, e || J(t, 2, this.length);
2203
+ var c = this[t] | this[t + 1] << 8;
2204
+ return c & 32768 ? c | 4294901760 : c;
2205
+ }, a.prototype.readInt16BE = function(t, e) {
2206
+ t = t >>> 0, e || J(t, 2, this.length);
2207
+ var c = this[t + 1] | this[t] << 8;
2208
+ return c & 32768 ? c | 4294901760 : c;
2209
+ }, a.prototype.readInt32LE = function(t, e) {
2210
+ return t = t >>> 0, e || J(t, 4, this.length), this[t] | this[t + 1] << 8 | this[t + 2] << 16 | this[t + 3] << 24;
2211
+ }, a.prototype.readInt32BE = function(t, e) {
2212
+ return t = t >>> 0, e || J(t, 4, this.length), this[t] << 24 | this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3];
2213
+ }, a.prototype.readFloatLE = function(t, e) {
2214
+ return t = t >>> 0, e || J(t, 4, this.length), d.read(this, t, !0, 23, 4);
2215
+ }, a.prototype.readFloatBE = function(t, e) {
2216
+ return t = t >>> 0, e || J(t, 4, this.length), d.read(this, t, !1, 23, 4);
2217
+ }, a.prototype.readDoubleLE = function(t, e) {
2218
+ return t = t >>> 0, e || J(t, 8, this.length), d.read(this, t, !0, 52, 8);
2219
+ }, a.prototype.readDoubleBE = function(t, e) {
2220
+ return t = t >>> 0, e || J(t, 8, this.length), d.read(this, t, !1, 52, 8);
2221
+ };
2222
+ function q(o, t, e, c, w, P) {
2223
+ if (!a.isBuffer(o))
2224
+ throw new TypeError('"buffer" argument must be a Buffer instance');
2225
+ if (t > w || t < P)
2226
+ throw new RangeError('"value" argument is out of bounds');
2227
+ if (e + c > o.length)
2228
+ throw new RangeError("Index out of range");
2229
+ }
2230
+ a.prototype.writeUIntLE = function(t, e, c, w) {
2231
+ if (t = +t, e = e >>> 0, c = c >>> 0, !w) {
2232
+ var P = Math.pow(2, 8 * c) - 1;
2233
+ q(this, t, e, c, P, 0);
2234
+ }
2235
+ var S = 1, H = 0;
2236
+ for (this[e] = t & 255; ++H < c && (S *= 256); )
2237
+ this[e + H] = t / S & 255;
2238
+ return e + c;
2239
+ }, a.prototype.writeUIntBE = function(t, e, c, w) {
2240
+ if (t = +t, e = e >>> 0, c = c >>> 0, !w) {
2241
+ var P = Math.pow(2, 8 * c) - 1;
2242
+ q(this, t, e, c, P, 0);
2243
+ }
2244
+ var S = c - 1, H = 1;
2245
+ for (this[e + S] = t & 255; --S >= 0 && (H *= 256); )
2246
+ this[e + S] = t / H & 255;
2247
+ return e + c;
2248
+ }, a.prototype.writeUInt8 = function(t, e, c) {
2249
+ return t = +t, e = e >>> 0, c || q(this, t, e, 1, 255, 0), this[e] = t & 255, e + 1;
2250
+ }, a.prototype.writeUInt16LE = function(t, e, c) {
2251
+ return t = +t, e = e >>> 0, c || q(this, t, e, 2, 65535, 0), this[e] = t & 255, this[e + 1] = t >>> 8, e + 2;
2252
+ }, a.prototype.writeUInt16BE = function(t, e, c) {
2253
+ return t = +t, e = e >>> 0, c || q(this, t, e, 2, 65535, 0), this[e] = t >>> 8, this[e + 1] = t & 255, e + 2;
2254
+ }, a.prototype.writeUInt32LE = function(t, e, c) {
2255
+ return t = +t, e = e >>> 0, c || q(this, t, e, 4, 4294967295, 0), this[e + 3] = t >>> 24, this[e + 2] = t >>> 16, this[e + 1] = t >>> 8, this[e] = t & 255, e + 4;
2256
+ }, a.prototype.writeUInt32BE = function(t, e, c) {
2257
+ return t = +t, e = e >>> 0, c || q(this, t, e, 4, 4294967295, 0), this[e] = t >>> 24, this[e + 1] = t >>> 16, this[e + 2] = t >>> 8, this[e + 3] = t & 255, e + 4;
2258
+ }, a.prototype.writeIntLE = function(t, e, c, w) {
2259
+ if (t = +t, e = e >>> 0, !w) {
2260
+ var P = Math.pow(2, 8 * c - 1);
2261
+ q(this, t, e, c, P - 1, -P);
2262
+ }
2263
+ var S = 0, H = 1, G = 0;
2264
+ for (this[e] = t & 255; ++S < c && (H *= 256); )
2265
+ t < 0 && G === 0 && this[e + S - 1] !== 0 && (G = 1), this[e + S] = (t / H >> 0) - G & 255;
2266
+ return e + c;
2267
+ }, a.prototype.writeIntBE = function(t, e, c, w) {
2268
+ if (t = +t, e = e >>> 0, !w) {
2269
+ var P = Math.pow(2, 8 * c - 1);
2270
+ q(this, t, e, c, P - 1, -P);
2271
+ }
2272
+ var S = c - 1, H = 1, G = 0;
2273
+ for (this[e + S] = t & 255; --S >= 0 && (H *= 256); )
2274
+ t < 0 && G === 0 && this[e + S + 1] !== 0 && (G = 1), this[e + S] = (t / H >> 0) - G & 255;
2275
+ return e + c;
2276
+ }, a.prototype.writeInt8 = function(t, e, c) {
2277
+ return t = +t, e = e >>> 0, c || q(this, t, e, 1, 127, -128), t < 0 && (t = 255 + t + 1), this[e] = t & 255, e + 1;
2278
+ }, a.prototype.writeInt16LE = function(t, e, c) {
2279
+ return t = +t, e = e >>> 0, c || q(this, t, e, 2, 32767, -32768), this[e] = t & 255, this[e + 1] = t >>> 8, e + 2;
2280
+ }, a.prototype.writeInt16BE = function(t, e, c) {
2281
+ return t = +t, e = e >>> 0, c || q(this, t, e, 2, 32767, -32768), this[e] = t >>> 8, this[e + 1] = t & 255, e + 2;
2282
+ }, a.prototype.writeInt32LE = function(t, e, c) {
2283
+ return t = +t, e = e >>> 0, c || q(this, t, e, 4, 2147483647, -2147483648), this[e] = t & 255, this[e + 1] = t >>> 8, this[e + 2] = t >>> 16, this[e + 3] = t >>> 24, e + 4;
2284
+ }, a.prototype.writeInt32BE = function(t, e, c) {
2285
+ return t = +t, e = e >>> 0, c || q(this, t, e, 4, 2147483647, -2147483648), t < 0 && (t = 4294967295 + t + 1), this[e] = t >>> 24, this[e + 1] = t >>> 16, this[e + 2] = t >>> 8, this[e + 3] = t & 255, e + 4;
2286
+ };
2287
+ function at(o, t, e, c, w, P) {
2288
+ if (e + c > o.length)
2289
+ throw new RangeError("Index out of range");
2290
+ if (e < 0)
2291
+ throw new RangeError("Index out of range");
2292
+ }
2293
+ function it(o, t, e, c, w) {
2294
+ return t = +t, e = e >>> 0, w || at(o, t, e, 4), d.write(o, t, e, c, 23, 4), e + 4;
2295
+ }
2296
+ a.prototype.writeFloatLE = function(t, e, c) {
2297
+ return it(this, t, e, !0, c);
2298
+ }, a.prototype.writeFloatBE = function(t, e, c) {
2299
+ return it(this, t, e, !1, c);
2300
+ };
2301
+ function st(o, t, e, c, w) {
2302
+ return t = +t, e = e >>> 0, w || at(o, t, e, 8), d.write(o, t, e, c, 52, 8), e + 8;
2303
+ }
2304
+ a.prototype.writeDoubleLE = function(t, e, c) {
2305
+ return st(this, t, e, !0, c);
2306
+ }, a.prototype.writeDoubleBE = function(t, e, c) {
2307
+ return st(this, t, e, !1, c);
2308
+ }, a.prototype.copy = function(t, e, c, w) {
2309
+ if (!a.isBuffer(t))
2310
+ throw new TypeError("argument should be a Buffer");
2311
+ if (c || (c = 0), !w && w !== 0 && (w = this.length), e >= t.length && (e = t.length), e || (e = 0), w > 0 && w < c && (w = c), w === c || t.length === 0 || this.length === 0)
2312
+ return 0;
2313
+ if (e < 0)
2314
+ throw new RangeError("targetStart out of bounds");
2315
+ if (c < 0 || c >= this.length)
2316
+ throw new RangeError("Index out of range");
2317
+ if (w < 0)
2318
+ throw new RangeError("sourceEnd out of bounds");
2319
+ w > this.length && (w = this.length), t.length - e < w - c && (w = t.length - e + c);
2320
+ var P = w - c;
2321
+ if (this === t && typeof Uint8Array.prototype.copyWithin == "function")
2322
+ this.copyWithin(e, c, w);
2323
+ else if (this === t && c < e && e < w)
2324
+ for (var S = P - 1; S >= 0; --S)
2325
+ t[S + e] = this[S + c];
2326
+ else
2327
+ Uint8Array.prototype.set.call(
2328
+ t,
2329
+ this.subarray(c, w),
2330
+ e
2331
+ );
2332
+ return P;
2333
+ }, a.prototype.fill = function(t, e, c, w) {
2334
+ if (typeof t == "string") {
2335
+ if (typeof e == "string" ? (w = e, e = 0, c = this.length) : typeof c == "string" && (w = c, c = this.length), w !== void 0 && typeof w != "string")
2336
+ throw new TypeError("encoding must be a string");
2337
+ if (typeof w == "string" && !a.isEncoding(w))
2338
+ throw new TypeError("Unknown encoding: " + w);
2339
+ if (t.length === 1) {
2340
+ var P = t.charCodeAt(0);
2341
+ (w === "utf8" && P < 128 || w === "latin1") && (t = P);
2342
+ }
2343
+ } else
2344
+ typeof t == "number" ? t = t & 255 : typeof t == "boolean" && (t = Number(t));
2345
+ if (e < 0 || this.length < e || this.length < c)
2346
+ throw new RangeError("Out of range index");
2347
+ if (c <= e)
2348
+ return this;
2349
+ e = e >>> 0, c = c === void 0 ? this.length : c >>> 0, t || (t = 0);
2350
+ var S;
2351
+ if (typeof t == "number")
2352
+ for (S = e; S < c; ++S)
2353
+ this[S] = t;
2354
+ else {
2355
+ var H = a.isBuffer(t) ? t : a.from(t, w), G = H.length;
2356
+ if (G === 0)
2357
+ throw new TypeError('The value "' + t + '" is invalid for argument "value"');
2358
+ for (S = 0; S < c - e; ++S)
2359
+ this[S + e] = H[S % G];
2360
+ }
2361
+ return this;
2362
+ };
2363
+ var ut = /[^+/0-9A-Za-z-_]/g;
2364
+ function vt(o) {
2365
+ if (o = o.split("=")[0], o = o.trim().replace(ut, ""), o.length < 2)
2366
+ return "";
2367
+ for (; o.length % 4 !== 0; )
2368
+ o = o + "=";
2369
+ return o;
2370
+ }
2371
+ function rt(o, t) {
2372
+ t = t || 1 / 0;
2373
+ for (var e, c = o.length, w = null, P = [], S = 0; S < c; ++S) {
2374
+ if (e = o.charCodeAt(S), e > 55295 && e < 57344) {
2375
+ if (!w) {
2376
+ if (e > 56319) {
2377
+ (t -= 3) > -1 && P.push(239, 191, 189);
2378
+ continue;
2379
+ } else if (S + 1 === c) {
2380
+ (t -= 3) > -1 && P.push(239, 191, 189);
2381
+ continue;
2382
+ }
2383
+ w = e;
2384
+ continue;
2882
2385
  }
2386
+ if (e < 56320) {
2387
+ (t -= 3) > -1 && P.push(239, 191, 189), w = e;
2388
+ continue;
2389
+ }
2390
+ e = (w - 55296 << 10 | e - 56320) + 65536;
2391
+ } else
2392
+ w && (t -= 3) > -1 && P.push(239, 191, 189);
2393
+ if (w = null, e < 128) {
2394
+ if ((t -= 1) < 0)
2395
+ break;
2396
+ P.push(e);
2397
+ } else if (e < 2048) {
2398
+ if ((t -= 2) < 0)
2399
+ break;
2400
+ P.push(
2401
+ e >> 6 | 192,
2402
+ e & 63 | 128
2403
+ );
2404
+ } else if (e < 65536) {
2405
+ if ((t -= 3) < 0)
2406
+ break;
2407
+ P.push(
2408
+ e >> 12 | 224,
2409
+ e >> 6 & 63 | 128,
2410
+ e & 63 | 128
2411
+ );
2412
+ } else if (e < 1114112) {
2413
+ if ((t -= 4) < 0)
2414
+ break;
2415
+ P.push(
2416
+ e >> 18 | 240,
2417
+ e >> 12 & 63 | 128,
2418
+ e >> 6 & 63 | 128,
2419
+ e & 63 | 128
2420
+ );
2421
+ } else
2422
+ throw new Error("Invalid code point");
2423
+ }
2424
+ return P;
2425
+ }
2426
+ function ct(o) {
2427
+ for (var t = [], e = 0; e < o.length; ++e)
2428
+ t.push(o.charCodeAt(e) & 255);
2429
+ return t;
2430
+ }
2431
+ function lt(o, t) {
2432
+ for (var e, c, w, P = [], S = 0; S < o.length && !((t -= 2) < 0); ++S)
2433
+ e = o.charCodeAt(S), c = e >> 8, w = e % 256, P.push(w), P.push(c);
2434
+ return P;
2435
+ }
2436
+ function ht(o) {
2437
+ return h.toByteArray(vt(o));
2438
+ }
2439
+ function tt(o, t, e, c) {
2440
+ for (var w = 0; w < c && !(w + e >= t.length || w >= o.length); ++w)
2441
+ t[w + e] = o[w];
2442
+ return w;
2443
+ }
2444
+ function Q(o, t) {
2445
+ return o instanceof t || o != null && o.constructor != null && o.constructor.name != null && o.constructor.name === t.name;
2446
+ }
2447
+ function wt(o) {
2448
+ return o !== o;
2449
+ }
2450
+ var kt = function() {
2451
+ for (var o = "0123456789abcdef", t = new Array(256), e = 0; e < 16; ++e)
2452
+ for (var c = e * 16, w = 0; w < 16; ++w)
2453
+ t[c + w] = o[e] + o[w];
2454
+ return t;
2455
+ }();
2456
+ }, { "base64-js": 29, ieee754: 32 }], 31: [function(n, g, u) {
2457
+ var h = {
2458
+ single_source_shortest_paths: function(d, l, i) {
2459
+ var s = {}, f = {};
2460
+ f[l] = 0;
2461
+ var a = h.PriorityQueue.make();
2462
+ a.push(l, 0);
2463
+ for (var y, x, b, A, F, M, E, B, I; !a.empty(); ) {
2464
+ y = a.pop(), x = y.value, A = y.cost, F = d[x] || {};
2465
+ for (b in F)
2466
+ F.hasOwnProperty(b) && (M = F[b], E = A + M, B = f[b], I = typeof f[b] > "u", (I || B > E) && (f[b] = E, a.push(b, E), s[b] = x));
2467
+ }
2468
+ if (typeof i < "u" && typeof f[i] > "u") {
2469
+ var k = ["Could not find a path from ", l, " to ", i, "."].join("");
2470
+ throw new Error(k);
2471
+ }
2472
+ return s;
2473
+ },
2474
+ extract_shortest_path_from_predecessor_list: function(d, l) {
2475
+ for (var i = [], s = l; s; )
2476
+ i.push(s), d[s], s = d[s];
2477
+ return i.reverse(), i;
2478
+ },
2479
+ find_path: function(d, l, i) {
2480
+ var s = h.single_source_shortest_paths(d, l, i);
2481
+ return h.extract_shortest_path_from_predecessor_list(
2482
+ s,
2483
+ i
2484
+ );
2485
+ },
2486
+ /**
2487
+ * A very naive priority queue implementation.
2488
+ */
2489
+ PriorityQueue: {
2490
+ make: function(d) {
2491
+ var l = h.PriorityQueue, i = {}, s;
2492
+ d = d || {};
2493
+ for (s in l)
2494
+ l.hasOwnProperty(s) && (i[s] = l[s]);
2495
+ return i.queue = [], i.sorter = d.sorter || l.default_sorter, i;
2496
+ },
2497
+ default_sorter: function(d, l) {
2498
+ return d.cost - l.cost;
2499
+ },
2500
+ /**
2501
+ * Add a new item to the queue and ensure the highest priority element
2502
+ * is at the front of the queue.
2503
+ */
2504
+ push: function(d, l) {
2505
+ var i = { value: d, cost: l };
2506
+ this.queue.push(i), this.queue.sort(this.sorter);
2507
+ },
2508
+ /**
2509
+ * Return the highest priority element in the queue.
2510
+ */
2511
+ pop: function() {
2512
+ return this.queue.shift();
2513
+ },
2514
+ empty: function() {
2515
+ return this.queue.length === 0;
2883
2516
  }
2884
- S === null ? (S = 65533, H = 1) : S > 65535 && (S -= 65536, l.push(S >>> 10 & 1023 | 55296), S = 56320 | S & 1023), l.push(S), y += H;
2885
2517
  }
2886
- return Y(l);
2887
- }
2888
- var N = 4096;
2889
- function Y(o) {
2890
- var t = o.length;
2891
- if (t <= N)
2892
- return String.fromCharCode.apply(String, o);
2893
- for (var e = "", l = 0; l < t; )
2894
- e += String.fromCharCode.apply(
2895
- String,
2896
- o.slice(l, l += N)
2897
- );
2898
- return e;
2899
- }
2900
- function j(o, t, e) {
2901
- var l = "";
2902
- e = Math.min(o.length, e);
2903
- for (var y = t; y < e; ++y)
2904
- l += String.fromCharCode(o[y] & 127);
2905
- return l;
2906
- }
2907
- function et(o, t, e) {
2908
- var l = "";
2909
- e = Math.min(o.length, e);
2910
- for (var y = t; y < e; ++y)
2911
- l += String.fromCharCode(o[y]);
2912
- return l;
2913
- }
2914
- function X(o, t, e) {
2915
- var l = o.length;
2916
- (!t || t < 0) && (t = 0), (!e || e < 0 || e > l) && (e = l);
2917
- for (var y = "", P = t; P < e; ++P)
2918
- y += kt[o[P]];
2919
- return y;
2920
- }
2921
- function mt(o, t, e) {
2922
- for (var l = o.slice(t, e), y = "", P = 0; P < l.length; P += 2)
2923
- y += String.fromCharCode(l[P] + l[P + 1] * 256);
2924
- return y;
2925
- }
2926
- a.prototype.slice = function(t, e) {
2927
- var l = this.length;
2928
- t = ~~t, e = e === void 0 ? l : ~~e, t < 0 ? (t += l, t < 0 && (t = 0)) : t > l && (t = l), e < 0 ? (e += l, e < 0 && (e = 0)) : e > l && (e = l), e < t && (e = t);
2929
- var y = this.subarray(t, e);
2930
- return Object.setPrototypeOf(y, a.prototype), y;
2931
2518
  };
2932
- function J(o, t, e) {
2933
- if (o % 1 !== 0 || o < 0)
2934
- throw new RangeError("offset is not uint");
2935
- if (o + t > e)
2936
- throw new RangeError("Trying to access beyond buffer length");
2937
- }
2938
- a.prototype.readUIntLE = function(t, e, l) {
2939
- t = t >>> 0, e = e >>> 0, l || J(t, e, this.length);
2940
- for (var y = this[t], P = 1, S = 0; ++S < e && (P *= 256); )
2941
- y += this[t + S] * P;
2942
- return y;
2943
- }, a.prototype.readUIntBE = function(t, e, l) {
2944
- t = t >>> 0, e = e >>> 0, l || J(t, e, this.length);
2945
- for (var y = this[t + --e], P = 1; e > 0 && (P *= 256); )
2946
- y += this[t + --e] * P;
2947
- return y;
2948
- }, a.prototype.readUInt8 = function(t, e) {
2949
- return t = t >>> 0, e || J(t, 1, this.length), this[t];
2950
- }, a.prototype.readUInt16LE = function(t, e) {
2951
- return t = t >>> 0, e || J(t, 2, this.length), this[t] | this[t + 1] << 8;
2952
- }, a.prototype.readUInt16BE = function(t, e) {
2953
- return t = t >>> 0, e || J(t, 2, this.length), this[t] << 8 | this[t + 1];
2954
- }, a.prototype.readUInt32LE = function(t, e) {
2955
- return t = t >>> 0, e || J(t, 4, this.length), (this[t] | this[t + 1] << 8 | this[t + 2] << 16) + this[t + 3] * 16777216;
2956
- }, a.prototype.readUInt32BE = function(t, e) {
2957
- return t = t >>> 0, e || J(t, 4, this.length), this[t] * 16777216 + (this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3]);
2958
- }, a.prototype.readIntLE = function(t, e, l) {
2959
- t = t >>> 0, e = e >>> 0, l || J(t, e, this.length);
2960
- for (var y = this[t], P = 1, S = 0; ++S < e && (P *= 256); )
2961
- y += this[t + S] * P;
2962
- return P *= 128, y >= P && (y -= Math.pow(2, 8 * e)), y;
2963
- }, a.prototype.readIntBE = function(t, e, l) {
2964
- t = t >>> 0, e = e >>> 0, l || J(t, e, this.length);
2965
- for (var y = e, P = 1, S = this[t + --y]; y > 0 && (P *= 256); )
2966
- S += this[t + --y] * P;
2967
- return P *= 128, S >= P && (S -= Math.pow(2, 8 * e)), S;
2968
- }, a.prototype.readInt8 = function(t, e) {
2969
- return t = t >>> 0, e || J(t, 1, this.length), this[t] & 128 ? (255 - this[t] + 1) * -1 : this[t];
2970
- }, a.prototype.readInt16LE = function(t, e) {
2971
- t = t >>> 0, e || J(t, 2, this.length);
2972
- var l = this[t] | this[t + 1] << 8;
2973
- return l & 32768 ? l | 4294901760 : l;
2974
- }, a.prototype.readInt16BE = function(t, e) {
2975
- t = t >>> 0, e || J(t, 2, this.length);
2976
- var l = this[t + 1] | this[t] << 8;
2977
- return l & 32768 ? l | 4294901760 : l;
2978
- }, a.prototype.readInt32LE = function(t, e) {
2979
- return t = t >>> 0, e || J(t, 4, this.length), this[t] | this[t + 1] << 8 | this[t + 2] << 16 | this[t + 3] << 24;
2980
- }, a.prototype.readInt32BE = function(t, e) {
2981
- return t = t >>> 0, e || J(t, 4, this.length), this[t] << 24 | this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3];
2982
- }, a.prototype.readFloatLE = function(t, e) {
2983
- return t = t >>> 0, e || J(t, 4, this.length), d.read(this, t, !0, 23, 4);
2984
- }, a.prototype.readFloatBE = function(t, e) {
2985
- return t = t >>> 0, e || J(t, 4, this.length), d.read(this, t, !1, 23, 4);
2986
- }, a.prototype.readDoubleLE = function(t, e) {
2987
- return t = t >>> 0, e || J(t, 8, this.length), d.read(this, t, !0, 52, 8);
2988
- }, a.prototype.readDoubleBE = function(t, e) {
2989
- return t = t >>> 0, e || J(t, 8, this.length), d.read(this, t, !1, 52, 8);
2519
+ typeof g < "u" && (g.exports = h);
2520
+ }, {}], 32: [function(n, g, u) {
2521
+ u.read = function(h, d, l, i, s) {
2522
+ var f, a, y = s * 8 - i - 1, x = (1 << y) - 1, b = x >> 1, A = -7, F = l ? s - 1 : 0, M = l ? -1 : 1, E = h[d + F];
2523
+ for (F += M, f = E & (1 << -A) - 1, E >>= -A, A += y; A > 0; f = f * 256 + h[d + F], F += M, A -= 8)
2524
+ ;
2525
+ for (a = f & (1 << -A) - 1, f >>= -A, A += i; A > 0; a = a * 256 + h[d + F], F += M, A -= 8)
2526
+ ;
2527
+ if (f === 0)
2528
+ f = 1 - b;
2529
+ else {
2530
+ if (f === x)
2531
+ return a ? NaN : (E ? -1 : 1) * (1 / 0);
2532
+ a = a + Math.pow(2, i), f = f - b;
2533
+ }
2534
+ return (E ? -1 : 1) * a * Math.pow(2, f - i);
2535
+ }, u.write = function(h, d, l, i, s, f) {
2536
+ var a, y, x, b = f * 8 - s - 1, A = (1 << b) - 1, F = A >> 1, M = s === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, E = i ? 0 : f - 1, B = i ? 1 : -1, I = d < 0 || d === 0 && 1 / d < 0 ? 1 : 0;
2537
+ for (d = Math.abs(d), isNaN(d) || d === 1 / 0 ? (y = isNaN(d) ? 1 : 0, a = A) : (a = Math.floor(Math.log(d) / Math.LN2), d * (x = Math.pow(2, -a)) < 1 && (a--, x *= 2), a + F >= 1 ? d += M / x : d += M * Math.pow(2, 1 - F), d * x >= 2 && (a++, x /= 2), a + F >= A ? (y = 0, a = A) : a + F >= 1 ? (y = (d * x - 1) * Math.pow(2, s), a = a + F) : (y = d * Math.pow(2, F - 1) * Math.pow(2, s), a = 0)); s >= 8; h[l + E] = y & 255, E += B, y /= 256, s -= 8)
2538
+ ;
2539
+ for (a = a << s | y, b += s; b > 0; h[l + E] = a & 255, E += B, a /= 256, b -= 8)
2540
+ ;
2541
+ h[l + E - B] |= I * 128;
2990
2542
  };
2991
- function q(o, t, e, l, y, P) {
2992
- if (!a.isBuffer(o))
2993
- throw new TypeError('"buffer" argument must be a Buffer instance');
2994
- if (t > y || t < P)
2995
- throw new RangeError('"value" argument is out of bounds');
2996
- if (e + l > o.length)
2997
- throw new RangeError("Index out of range");
2543
+ }, {}], 33: [function(n, g, u) {
2544
+ var h = {}.toString;
2545
+ g.exports = Array.isArray || function(d) {
2546
+ return h.call(d) == "[object Array]";
2547
+ };
2548
+ }, {}] }, {}, [24])(24);
2549
+ });
2550
+ }), Ot = {
2551
+ name: "qrcode",
2552
+ props: {
2553
+ /**
2554
+ * The value of the QR code.
2555
+ */
2556
+ value: null,
2557
+ /**
2558
+ * The options for the QR code generator.
2559
+ * {@link https://github.com/soldair/node-qrcode#qr-code-options}
2560
+ */
2561
+ options: Object,
2562
+ /**
2563
+ * The tag name of the component's root element.
2564
+ */
2565
+ tag: {
2566
+ type: String,
2567
+ default: "canvas"
2568
+ }
2569
+ },
2570
+ render: function(r) {
2571
+ return r(this.tag, this.$slots.default);
2572
+ },
2573
+ watch: {
2574
+ $props: {
2575
+ deep: !0,
2576
+ immediate: !0,
2577
+ /**
2578
+ * Update the QR code when props changed.
2579
+ */
2580
+ handler: function() {
2581
+ this.$el && this.generate();
2998
2582
  }
2999
- a.prototype.writeUIntLE = function(t, e, l, y) {
3000
- if (t = +t, e = e >>> 0, l = l >>> 0, !y) {
3001
- var P = Math.pow(2, 8 * l) - 1;
3002
- q(this, t, e, l, P, 0);
3003
- }
3004
- var S = 1, H = 0;
3005
- for (this[e] = t & 255; ++H < l && (S *= 256); )
3006
- this[e + H] = t / S & 255;
3007
- return e + l;
3008
- }, a.prototype.writeUIntBE = function(t, e, l, y) {
3009
- if (t = +t, e = e >>> 0, l = l >>> 0, !y) {
3010
- var P = Math.pow(2, 8 * l) - 1;
3011
- q(this, t, e, l, P, 0);
3012
- }
3013
- var S = l - 1, H = 1;
3014
- for (this[e + S] = t & 255; --S >= 0 && (H *= 256); )
3015
- this[e + S] = t / H & 255;
3016
- return e + l;
3017
- }, a.prototype.writeUInt8 = function(t, e, l) {
3018
- return t = +t, e = e >>> 0, l || q(this, t, e, 1, 255, 0), this[e] = t & 255, e + 1;
3019
- }, a.prototype.writeUInt16LE = function(t, e, l) {
3020
- return t = +t, e = e >>> 0, l || q(this, t, e, 2, 65535, 0), this[e] = t & 255, this[e + 1] = t >>> 8, e + 2;
3021
- }, a.prototype.writeUInt16BE = function(t, e, l) {
3022
- return t = +t, e = e >>> 0, l || q(this, t, e, 2, 65535, 0), this[e] = t >>> 8, this[e + 1] = t & 255, e + 2;
3023
- }, a.prototype.writeUInt32LE = function(t, e, l) {
3024
- return t = +t, e = e >>> 0, l || q(this, t, e, 4, 4294967295, 0), this[e + 3] = t >>> 24, this[e + 2] = t >>> 16, this[e + 1] = t >>> 8, this[e] = t & 255, e + 4;
3025
- }, a.prototype.writeUInt32BE = function(t, e, l) {
3026
- return t = +t, e = e >>> 0, l || q(this, t, e, 4, 4294967295, 0), this[e] = t >>> 24, this[e + 1] = t >>> 16, this[e + 2] = t >>> 8, this[e + 3] = t & 255, e + 4;
3027
- }, a.prototype.writeIntLE = function(t, e, l, y) {
3028
- if (t = +t, e = e >>> 0, !y) {
3029
- var P = Math.pow(2, 8 * l - 1);
3030
- q(this, t, e, l, P - 1, -P);
3031
- }
3032
- var S = 0, H = 1, G = 0;
3033
- for (this[e] = t & 255; ++S < l && (H *= 256); )
3034
- t < 0 && G === 0 && this[e + S - 1] !== 0 && (G = 1), this[e + S] = (t / H >> 0) - G & 255;
3035
- return e + l;
3036
- }, a.prototype.writeIntBE = function(t, e, l, y) {
3037
- if (t = +t, e = e >>> 0, !y) {
3038
- var P = Math.pow(2, 8 * l - 1);
3039
- q(this, t, e, l, P - 1, -P);
2583
+ }
2584
+ },
2585
+ methods: {
2586
+ /**
2587
+ * Generate QR code.
2588
+ */
2589
+ generate: function() {
2590
+ var r = this, n = this.options, g = this.tag, u = String(this.value);
2591
+ g === "canvas" ? xt.toCanvas(this.$el, u, n, function(h) {
2592
+ if (h)
2593
+ throw h;
2594
+ }) : g === "img" ? xt.toDataURL(u, n, function(h, d) {
2595
+ if (h)
2596
+ throw h;
2597
+ r.$el.src = d;
2598
+ }) : xt.toString(u, n, function(h, d) {
2599
+ if (h)
2600
+ throw h;
2601
+ r.$el.innerHTML = d;
2602
+ });
2603
+ }
2604
+ },
2605
+ mounted: function() {
2606
+ this.generate();
2607
+ }
2608
+ };
2609
+ class zt {
2610
+ constructor() {
2611
+ this._activePolls = {}, this._pollingInterval = 1e3;
2612
+ }
2613
+ _startPolling(r) {
2614
+ const { handler: n, interval: g } = this._activePolls[r], u = async () => {
2615
+ var h;
2616
+ await n(), (h = this._activePolls[r]) != null && h.pollActive && setTimeout(u, g || this._pollingInterval);
2617
+ };
2618
+ u();
2619
+ }
2620
+ /**
2621
+ * Add a new poll to the active polls list.
2622
+ * @param {string} options.id - Unique identifier for the poll.
2623
+ * @param {function} options.handler - Function to be executed when the poll is activated.
2624
+ * @param {number} options.interval - Time interval in milliseconds at which the poll should run.
2625
+ * @param {number} [options.removeAfterMs=0] - Optional. Time in milliseconds after which the poll should be automatically removed.
2626
+ * @param {boolean} [options.startImmediately=true] - Optional. If true, the poll will start immediately after being added.
2627
+ * @param {*} [options.data] - Optional. Additional data associated with the poll.
2628
+ * @returns {function} - A function that can be used to manually remove the poll from the active polls list.
2629
+ */
2630
+ addPoll({
2631
+ id: r,
2632
+ handler: n,
2633
+ interval: g,
2634
+ removeAfterMs: u = 0,
2635
+ startImmediately: h = !0,
2636
+ data: d
2637
+ }) {
2638
+ if (!r || typeof n != "function")
2639
+ throw new Error("Invalid poll definition");
2640
+ if (this._activePolls[r])
2641
+ throw new Error("Poll with the same ID already exists");
2642
+ return this._activePolls[r] = { handler: n, interval: g, pollActive: !1, data: d }, h && setTimeout(() => {
2643
+ this.activatePoll(r);
2644
+ }, 0), u && setTimeout(() => {
2645
+ this._activePolls[r] && this.removePoll(r);
2646
+ }, u), () => this.removePoll(r);
2647
+ }
2648
+ activatePoll(r) {
2649
+ if (!this._activePolls[r])
2650
+ throw new Error("Poll not found");
2651
+ this._activePolls[r].pollActive || (this._activePolls[r].pollActive = !0, this._startPolling(r));
2652
+ }
2653
+ deactivatePoll(r) {
2654
+ if (!this._activePolls[r]) {
2655
+ console.warn("[deactivatePoll] Poll not found");
2656
+ return;
2657
+ }
2658
+ this._activePolls[r].pollActive = !1;
2659
+ }
2660
+ removePoll(r) {
2661
+ if (!this._activePolls[r]) {
2662
+ console.warn("[removePoll] Poll not found");
2663
+ return;
2664
+ }
2665
+ delete this._activePolls[r];
2666
+ }
2667
+ }
2668
+ let _t = null;
2669
+ function Ft() {
2670
+ return _t || (_t = new zt()), _t;
2671
+ }
2672
+ function Yt(v) {
2673
+ window.history.replaceState({}, "", window.location.href);
2674
+ let r = "";
2675
+ const n = (navigator == null ? void 0 : navigator.userAgent) || "";
2676
+ return n.match("CriOS") ? r = "googlechromes://" : n.match("FxiOS") ? r = "firefox://" : n.match("GSA") && (r = "googleapp://open-url?url="), r + encodeURIComponent(`${window.location.href}#${v}`);
2677
+ }
2678
+ const Wt = {
2679
+ name: "BankIdAnswer",
2680
+ components: {
2681
+ QrCode: Ot
2682
+ },
2683
+ mixins: [ft([])],
2684
+ props: {
2685
+ onCompleteFunc: {
2686
+ type: Function,
2687
+ default: null
2688
+ }
2689
+ },
2690
+ data() {
2691
+ return {
2692
+ signAnswerId: null,
2693
+ view: "form",
2694
+ errorMessage: "",
2695
+ isLoading: !1,
2696
+ qrCode: null,
2697
+ autoStartToken: null,
2698
+ isMobile: !1
2699
+ };
2700
+ },
2701
+ computed: {
2702
+ viewText() {
2703
+ const v = (r) => this._document.$t(`answerModal.bankId.component.viewText.${r}`);
2704
+ return {
2705
+ new: {
2706
+ title: v("new.title"),
2707
+ text: v("new.text"),
2708
+ spinnerText: v("new.spinnerText")
2709
+ },
2710
+ waiting: {
2711
+ title: v("waiting.title"),
2712
+ text: v("waiting.text"),
2713
+ spinnerText: v("waiting.spinnerText")
2714
+ },
2715
+ started: {
2716
+ title: v("waiting.title"),
2717
+ text: v("waiting.text"),
2718
+ spinnerText: v("waiting.spinnerText")
2719
+ },
2720
+ signing: {
2721
+ title: v("signing.title"),
2722
+ text: v("signing.text"),
2723
+ spinnerText: v("signing.spinnerText")
2724
+ },
2725
+ error: {
2726
+ title: v("error.title"),
2727
+ text: v("error.text")
2728
+ },
2729
+ canceled: {
2730
+ title: v("canceled.title"),
2731
+ text: v("canceled.text")
3040
2732
  }
3041
- var S = l - 1, H = 1, G = 0;
3042
- for (this[e + S] = t & 255; --S >= 0 && (H *= 256); )
3043
- t < 0 && G === 0 && this[e + S + 1] !== 0 && (G = 1), this[e + S] = (t / H >> 0) - G & 255;
3044
- return e + l;
3045
- }, a.prototype.writeInt8 = function(t, e, l) {
3046
- return t = +t, e = e >>> 0, l || q(this, t, e, 1, 127, -128), t < 0 && (t = 255 + t + 1), this[e] = t & 255, e + 1;
3047
- }, a.prototype.writeInt16LE = function(t, e, l) {
3048
- return t = +t, e = e >>> 0, l || q(this, t, e, 2, 32767, -32768), this[e] = t & 255, this[e + 1] = t >>> 8, e + 2;
3049
- }, a.prototype.writeInt16BE = function(t, e, l) {
3050
- return t = +t, e = e >>> 0, l || q(this, t, e, 2, 32767, -32768), this[e] = t >>> 8, this[e + 1] = t & 255, e + 2;
3051
- }, a.prototype.writeInt32LE = function(t, e, l) {
3052
- return t = +t, e = e >>> 0, l || q(this, t, e, 4, 2147483647, -2147483648), this[e] = t & 255, this[e + 1] = t >>> 8, this[e + 2] = t >>> 16, this[e + 3] = t >>> 24, e + 4;
3053
- }, a.prototype.writeInt32BE = function(t, e, l) {
3054
- return t = +t, e = e >>> 0, l || q(this, t, e, 4, 2147483647, -2147483648), t < 0 && (t = 4294967295 + t + 1), this[e] = t >>> 24, this[e + 1] = t >>> 16, this[e + 2] = t >>> 8, this[e + 3] = t & 255, e + 4;
3055
2733
  };
3056
- function at(o, t, e, l, y, P) {
3057
- if (e + l > o.length)
3058
- throw new RangeError("Index out of range");
3059
- if (e < 0)
3060
- throw new RangeError("Index out of range");
2734
+ }
2735
+ },
2736
+ watch: {
2737
+ isLoading(v) {
2738
+ this.$emit("loading", v);
2739
+ }
2740
+ },
2741
+ created() {
2742
+ this.isMobile = It(), this.tryResumeSigningSession();
2743
+ },
2744
+ methods: {
2745
+ tryResumeSigningSession() {
2746
+ var n, g;
2747
+ const v = Ft(), r = Object.keys(v._activePolls).find(
2748
+ (u) => u.includes("bankId-")
2749
+ );
2750
+ try {
2751
+ if (r) {
2752
+ const { signAnswerId: u, autoStartToken: h, qrCode: d } = ((n = v._activePolls[r]) == null ? void 0 : n.data) || {};
2753
+ this.signAnswerId = u, this.autoStartToken = h, this.qrCode = d, v.removePoll(r), (g = window.location) != null && g.hash && window.history.replaceState(
2754
+ {},
2755
+ "",
2756
+ window.location.pathname
2757
+ // clears search + hash
2758
+ ), this.isLoading = !0, this.startPolling();
2759
+ }
2760
+ } catch {
2761
+ const h = this._document.$t(
2762
+ "answerModal.bankId.component.viewText.error.text"
2763
+ );
2764
+ Tt("error", h);
3061
2765
  }
3062
- function it(o, t, e, l, y) {
3063
- return t = +t, e = e >>> 0, y || at(o, t, e, 4), d.write(o, t, e, l, 23, 4), e + 4;
2766
+ },
2767
+ async submit({ answer: v }) {
2768
+ try {
2769
+ this.isLoading = !0;
2770
+ const { id: r, autoStartToken: n, qrCodeData: g } = await v({
2771
+ body: { isAccepted: !0 }
2772
+ });
2773
+ n && (this.autoStartToken = n), g && (this.qrCode = g), this.signAnswerId = r, this.startPolling(), this.isMobile && this.triggerAutoStart();
2774
+ return;
2775
+ } catch (r) {
2776
+ this.onError(r);
3064
2777
  }
3065
- a.prototype.writeFloatLE = function(t, e, l) {
3066
- return it(this, t, e, !0, l);
3067
- }, a.prototype.writeFloatBE = function(t, e, l) {
3068
- return it(this, t, e, !1, l);
3069
- };
3070
- function st(o, t, e, l, y) {
3071
- return t = +t, e = e >>> 0, y || at(o, t, e, 8), d.write(o, t, e, l, 52, 8), e + 8;
3072
- }
3073
- a.prototype.writeDoubleLE = function(t, e, l) {
3074
- return st(this, t, e, !0, l);
3075
- }, a.prototype.writeDoubleBE = function(t, e, l) {
3076
- return st(this, t, e, !1, l);
3077
- }, a.prototype.copy = function(t, e, l, y) {
3078
- if (!a.isBuffer(t))
3079
- throw new TypeError("argument should be a Buffer");
3080
- if (l || (l = 0), !y && y !== 0 && (y = this.length), e >= t.length && (e = t.length), e || (e = 0), y > 0 && y < l && (y = l), y === l || t.length === 0 || this.length === 0)
3081
- return 0;
3082
- if (e < 0)
3083
- throw new RangeError("targetStart out of bounds");
3084
- if (l < 0 || l >= this.length)
3085
- throw new RangeError("Index out of range");
3086
- if (y < 0)
3087
- throw new RangeError("sourceEnd out of bounds");
3088
- y > this.length && (y = this.length), t.length - e < y - l && (y = t.length - e + l);
3089
- var P = y - l;
3090
- if (this === t && typeof Uint8Array.prototype.copyWithin == "function")
3091
- this.copyWithin(e, l, y);
3092
- else if (this === t && l < e && e < y)
3093
- for (var S = P - 1; S >= 0; --S)
3094
- t[S + e] = this[S + l];
3095
- else
3096
- Uint8Array.prototype.set.call(
3097
- t,
3098
- this.subarray(l, y),
3099
- e
3100
- );
3101
- return P;
3102
- }, a.prototype.fill = function(t, e, l, y) {
3103
- if (typeof t == "string") {
3104
- if (typeof e == "string" ? (y = e, e = 0, l = this.length) : typeof l == "string" && (y = l, l = this.length), y !== void 0 && typeof y != "string")
3105
- throw new TypeError("encoding must be a string");
3106
- if (typeof y == "string" && !a.isEncoding(y))
3107
- throw new TypeError("Unknown encoding: " + y);
3108
- if (t.length === 1) {
3109
- var P = t.charCodeAt(0);
3110
- (y === "utf8" && P < 128 || y === "latin1") && (t = P);
3111
- }
3112
- } else
3113
- typeof t == "number" ? t = t & 255 : typeof t == "boolean" && (t = Number(t));
3114
- if (e < 0 || this.length < e || this.length < l)
3115
- throw new RangeError("Out of range index");
3116
- if (l <= e)
3117
- return this;
3118
- e = e >>> 0, l = l === void 0 ? this.length : l >>> 0, t || (t = 0);
3119
- var S;
3120
- if (typeof t == "number")
3121
- for (S = e; S < l; ++S)
3122
- this[S] = t;
3123
- else {
3124
- var H = a.isBuffer(t) ? t : a.from(t, y), G = H.length;
3125
- if (G === 0)
3126
- throw new TypeError('The value "' + t + '" is invalid for argument "value"');
3127
- for (S = 0; S < l - e; ++S)
3128
- this[S + e] = H[S % G];
2778
+ },
2779
+ async startPolling() {
2780
+ if (!this.signAnswerId)
2781
+ throw Error("Missing signAnswerId");
2782
+ const v = Ft(), r = `bankId-${this.signAnswerId}`, n = async () => {
2783
+ if (!this.signAnswerId)
2784
+ throw Error("Missing signAnswerId");
2785
+ const g = () => {
2786
+ this.clearSignState(), v.removePoll(r);
2787
+ };
2788
+ try {
2789
+ const { data: u } = await Rt.get(this.signAnswerId);
2790
+ u.qrCodeData && (this.qrCode = u.qrCodeData), ["completed", "canceled"].includes(u.status) && g(), u.status === "completed" ? this.onComplete() : u.status === "canceled" ? this.onCanceled() : this.view = u.status;
2791
+ } catch (u) {
2792
+ this.onError(u), g();
3129
2793
  }
3130
- return this;
3131
2794
  };
3132
- var ut = /[^+/0-9A-Za-z-_]/g;
3133
- function vt(o) {
3134
- if (o = o.split("=")[0], o = o.trim().replace(ut, ""), o.length < 2)
3135
- return "";
3136
- for (; o.length % 4 !== 0; )
3137
- o = o + "=";
3138
- return o;
3139
- }
3140
- function rt(o, t) {
3141
- t = t || 1 / 0;
3142
- for (var e, l = o.length, y = null, P = [], S = 0; S < l; ++S) {
3143
- if (e = o.charCodeAt(S), e > 55295 && e < 57344) {
3144
- if (!y) {
3145
- if (e > 56319) {
3146
- (t -= 3) > -1 && P.push(239, 191, 189);
3147
- continue;
3148
- } else if (S + 1 === l) {
3149
- (t -= 3) > -1 && P.push(239, 191, 189);
3150
- continue;
3151
- }
3152
- y = e;
3153
- continue;
3154
- }
3155
- if (e < 56320) {
3156
- (t -= 3) > -1 && P.push(239, 191, 189), y = e;
3157
- continue;
3158
- }
3159
- e = (y - 55296 << 10 | e - 56320) + 65536;
3160
- } else
3161
- y && (t -= 3) > -1 && P.push(239, 191, 189);
3162
- if (y = null, e < 128) {
3163
- if ((t -= 1) < 0)
3164
- break;
3165
- P.push(e);
3166
- } else if (e < 2048) {
3167
- if ((t -= 2) < 0)
3168
- break;
3169
- P.push(
3170
- e >> 6 | 192,
3171
- e & 63 | 128
3172
- );
3173
- } else if (e < 65536) {
3174
- if ((t -= 3) < 0)
3175
- break;
3176
- P.push(
3177
- e >> 12 | 224,
3178
- e >> 6 & 63 | 128,
3179
- e & 63 | 128
3180
- );
3181
- } else if (e < 1114112) {
3182
- if ((t -= 4) < 0)
3183
- break;
3184
- P.push(
3185
- e >> 18 | 240,
3186
- e >> 12 & 63 | 128,
3187
- e >> 6 & 63 | 128,
3188
- e & 63 | 128
3189
- );
3190
- } else
3191
- throw new Error("Invalid code point");
3192
- }
3193
- return P;
3194
- }
3195
- function lt(o) {
3196
- for (var t = [], e = 0; e < o.length; ++e)
3197
- t.push(o.charCodeAt(e) & 255);
3198
- return t;
2795
+ try {
2796
+ v.addPoll({
2797
+ id: r,
2798
+ handler: n,
2799
+ interval: 1e3,
2800
+ data: {
2801
+ signAnswerId: this.signAnswerId,
2802
+ autoStartToken: this.autoStartToken,
2803
+ qrCode: this.qrCode
2804
+ }
2805
+ });
2806
+ } catch {
2807
+ this.clearSignState();
2808
+ const u = this._document.$t(
2809
+ "answerModal.bankId.component.viewText.error.text"
2810
+ );
2811
+ Tt("error", u);
3199
2812
  }
3200
- function ct(o, t) {
3201
- for (var e, l, y, P = [], S = 0; S < o.length && !((t -= 2) < 0); ++S)
3202
- e = o.charCodeAt(S), l = e >> 8, y = e % 256, P.push(y), P.push(l);
3203
- return P;
2813
+ },
2814
+ clearSignState() {
2815
+ this.autoStartToken = null, this.qrCode = null, this.isLoading = !1;
2816
+ },
2817
+ onComplete() {
2818
+ typeof this.onCompleteFunc == "function" && this.onCompleteFunc();
2819
+ },
2820
+ onCanceled() {
2821
+ this.view = "canceled", this.errorMessage = this._document.$t(
2822
+ "answerModal.bankId.component.signingInterrupted"
2823
+ );
2824
+ },
2825
+ onError(v) {
2826
+ var n, g;
2827
+ if (v.httpStatusCode === 409)
2828
+ throw v;
2829
+ this.$emit("error"), this.view = "error";
2830
+ const r = (g = (n = v.response) == null ? void 0 : n.data) == null ? void 0 : g.errorCode;
2831
+ switch (r) {
2832
+ case 9001:
2833
+ case 9002:
2834
+ case 9003:
2835
+ case 9004:
2836
+ case 9005:
2837
+ case 9006:
2838
+ case 9007:
2839
+ Mt.warn(v);
2840
+ break;
2841
+ case 9009:
2842
+ this.$emit("complete");
2843
+ break;
2844
+ default:
2845
+ Et(v, { showMessage: !1 });
3204
2846
  }
3205
- function ht(o) {
3206
- return h.toByteArray(vt(o));
2847
+ this.errorMessage = this.$i18n.te(`errors:${r}`) && this._document.$t(`answerModal.bankId.component.errors.${r}`) || this._document.$t("answerModal.bankId.component.defaultError");
2848
+ },
2849
+ triggerAutoStart() {
2850
+ if (!this.autoStartToken)
2851
+ return;
2852
+ let v = "bankid://", r = "null";
2853
+ if (this.isMobile) {
2854
+ const g = $t(), u = (navigator == null ? void 0 : navigator.userAgent) || (navigator == null ? void 0 : navigator.vendor) || (window == null ? void 0 : window.opera), h = g === "iOS" && (/Version\/[\d.]+.*Safari/.test(u) || /GSA/.test(u)), d = g === "Android" && /Version\/[\d.]+.*Chrome/.test(u);
2855
+ (h || d) && (v = "https://app.bankid.com"), g === "iOS" && this.$view !== "widget" && (r = Yt(this.signAnswerId));
3207
2856
  }
3208
- function tt(o, t, e, l) {
3209
- for (var y = 0; y < l && !(y + e >= t.length || y >= o.length); ++y)
3210
- t[y + e] = o[y];
3211
- return y;
2857
+ const n = `${v}/?autostarttoken=${this.autoStartToken}&redirect=${r}`;
2858
+ this.isMobile ? document.location = n : this.$refs.autoStartFrame.src = n;
2859
+ }
2860
+ }
2861
+ };
2862
+ var Ht = function() {
2863
+ var g;
2864
+ var r = this, n = r._self._c;
2865
+ return n("div", { staticClass: "-my-4 flex flex-col items-center" }, [n("iframe", { ref: "autoStartFrame", staticClass: "hidden", attrs: { height: "0", width: "0" } }), ["form", "signing", "error", "canceled"].includes(r.view) ? n("div", { staticClass: "flex h-[250px] w-[250px] items-center justify-center rounded-xl bg-gray-100" }, [n("CIcon", { staticClass: "text-gray-500", attrs: { type: "bankId", size: "50" } })], 1) : r._e(), ["new", "waiting", "started"].includes(r.view) ? [r.qrCode ? n("QrCode", { attrs: { value: r.qrCode, options: {
2866
+ width: 250,
2867
+ errorCorrectionLevel: "L",
2868
+ color: { dark: "#000000" }
2869
+ } } }) : r._e()] : r._e(), n("Animation", { staticClass: "w-full" }, [n("div", { key: "a", staticClass: "min-h-[20px] pt-4 text-sm text-gray-500", domProps: { textContent: r._s((g = r.viewText[r.view]) == null ? void 0 : g.spinnerText) } }), !r.isMobile && ["new", "waiting", "started"].includes(r.view) ? n("CButton", { key: "b", staticClass: "mt-4", attrs: { type: "none", pattern: "secondary", size: "small" }, on: { click: r.triggerAutoStart } }, [r._v(" " + r._s(r._document.$t("answerModal.bankId.component.startOnThisDevice")) + " ")]) : r._e()], 1), ["form", "new", "waiting", "started"].includes(r.view) ? r._e() : n("div", [n("transition", { attrs: { name: "pop-in" } }, [n("div", { staticClass: "bankid-popup", on: { click: () => {
2870
+ r.view = "form", r.isLoading = !1;
2871
+ } } }, [n("div", { staticClass: "flex flex-col items-center justify-center", staticStyle: { "background-color": "#183e4f", padding: "calc(2.5 * var(--rem)) calc(3 * var(--rem))" } }, [n("CIcon", { staticClass: "text-white", attrs: { type: "bankId", size: "34" } }), n("div", { staticClass: "pt-4 text-sm font-medium text-white opacity-75", domProps: { textContent: r._s(r.viewText[r.view].text) } })], 1), n("div", { staticClass: "flex w-full flex-col items-center justify-center text-center", staticStyle: { padding: "calc(3 * var(--rem)) calc(2 * var(--rem))" } }, [r.view === "signing" ? [n("div", { staticClass: "spinner" }), n("div", { staticClass: "pt-8 text-gray-500", domProps: { textContent: r._s(r.viewText[r.view].spinnerText) } })] : ["error", "canceled"].includes(r.view) ? [n("CIcon", { staticClass: "mb-2.5 text-gray-400", attrs: { type: "error", size: "22" } }), n("div", { staticStyle: { "font-size": "14px" }, domProps: { textContent: r._s(r.errorMessage) } }), n("CButton", { staticStyle: { "margin-top": "calc(2.5 * var(--rem))", padding: "1em", height: "initial" }, attrs: { loading: r.isLoading, type: "none", pattern: "secondary", size: "small" }, on: { click: function(u) {
2872
+ r.view = "form";
2873
+ } } }, [r._v(" " + r._s(r._document.$t("tryAgain")) + " ")])] : r._e()], 2)])])], 1)], 2);
2874
+ }, jt = [], Gt = /* @__PURE__ */ ot(
2875
+ Wt,
2876
+ Ht,
2877
+ jt,
2878
+ !1,
2879
+ null,
2880
+ "0a367679"
2881
+ );
2882
+ const Kt = Gt.exports, Vt = {
2883
+ name: "DenyAnswer",
2884
+ mixins: [ft([])],
2885
+ props: {
2886
+ onCompleteFunc: {
2887
+ type: Function,
2888
+ default: null
2889
+ }
2890
+ },
2891
+ data() {
2892
+ return {
2893
+ rejectReason: ""
2894
+ };
2895
+ },
2896
+ methods: {
2897
+ async submit({ update: v, answer: r }) {
2898
+ const n = [];
2899
+ this.rejectReason && n.push({
2900
+ key: "unclear-other",
2901
+ category: "misc",
2902
+ description: this.rejectReason,
2903
+ sentAt: this._document.lastSentAt
2904
+ }), await v({ body: { "data.rejectReasons": n } }), await r({ body: { isAccepted: !1 } }), typeof this.onCompleteFunc == "function" && this.onCompleteFunc();
2905
+ }
2906
+ }
2907
+ };
2908
+ var Jt = function() {
2909
+ var r = this, n = r._self._c;
2910
+ return n("div", { staticClass: "text-left" }, [n("label", [r._v(r._s(r._document.$t("answerModal.decline.component.label")))]), n("CInput", { staticStyle: { "margin-bottom": "calc(1.5 * var(--rem))" }, attrs: { type: "textarea", filled: "", "custom-class": "decline-input" }, model: { value: r.rejectReason, callback: function(g) {
2911
+ r.rejectReason = g;
2912
+ }, expression: "rejectReason" } })], 1);
2913
+ }, Xt = [], Qt = /* @__PURE__ */ ot(
2914
+ Vt,
2915
+ Jt,
2916
+ Xt,
2917
+ !1,
2918
+ null,
2919
+ null
2920
+ );
2921
+ const qt = Qt.exports;
2922
+ /*!
2923
+ * Signature Pad v4.0.10 | https://github.com/szimek/signature_pad
2924
+ * (c) 2022 Szymon Nowak | Released under the MIT license
2925
+ */
2926
+ class pt {
2927
+ constructor(r, n, g, u) {
2928
+ if (isNaN(r) || isNaN(n))
2929
+ throw new Error(`Point is invalid: (${r}, ${n})`);
2930
+ this.x = +r, this.y = +n, this.pressure = g || 0, this.time = u || Date.now();
2931
+ }
2932
+ distanceTo(r) {
2933
+ return Math.sqrt(Math.pow(this.x - r.x, 2) + Math.pow(this.y - r.y, 2));
2934
+ }
2935
+ equals(r) {
2936
+ return this.x === r.x && this.y === r.y && this.pressure === r.pressure && this.time === r.time;
2937
+ }
2938
+ velocityFrom(r) {
2939
+ return this.time !== r.time ? this.distanceTo(r) / (this.time - r.time) : 0;
2940
+ }
2941
+ }
2942
+ class bt {
2943
+ constructor(r, n, g, u, h, d) {
2944
+ this.startPoint = r, this.control2 = n, this.control1 = g, this.endPoint = u, this.startWidth = h, this.endWidth = d;
2945
+ }
2946
+ static fromPoints(r, n) {
2947
+ const g = this.calculateControlPoints(r[0], r[1], r[2]).c2, u = this.calculateControlPoints(r[1], r[2], r[3]).c1;
2948
+ return new bt(r[1], g, u, r[2], n.start, n.end);
2949
+ }
2950
+ static calculateControlPoints(r, n, g) {
2951
+ const u = r.x - n.x, h = r.y - n.y, d = n.x - g.x, l = n.y - g.y, i = { x: (r.x + n.x) / 2, y: (r.y + n.y) / 2 }, s = { x: (n.x + g.x) / 2, y: (n.y + g.y) / 2 }, f = Math.sqrt(u * u + h * h), a = Math.sqrt(d * d + l * l), y = i.x - s.x, x = i.y - s.y, b = a / (f + a), A = { x: s.x + y * b, y: s.y + x * b }, F = n.x - A.x, M = n.y - A.y;
2952
+ return {
2953
+ c1: new pt(i.x + F, i.y + M),
2954
+ c2: new pt(s.x + F, s.y + M)
2955
+ };
2956
+ }
2957
+ length() {
2958
+ let n = 0, g, u;
2959
+ for (let h = 0; h <= 10; h += 1) {
2960
+ const d = h / 10, l = this.point(d, this.startPoint.x, this.control1.x, this.control2.x, this.endPoint.x), i = this.point(d, this.startPoint.y, this.control1.y, this.control2.y, this.endPoint.y);
2961
+ if (h > 0) {
2962
+ const s = l - g, f = i - u;
2963
+ n += Math.sqrt(s * s + f * f);
3212
2964
  }
3213
- function Q(o, t) {
3214
- return o instanceof t || o != null && o.constructor != null && o.constructor.name != null && o.constructor.name === t.name;
2965
+ g = l, u = i;
2966
+ }
2967
+ return n;
2968
+ }
2969
+ point(r, n, g, u, h) {
2970
+ return n * (1 - r) * (1 - r) * (1 - r) + 3 * g * (1 - r) * (1 - r) * r + 3 * u * (1 - r) * r * r + h * r * r * r;
2971
+ }
2972
+ }
2973
+ class Zt {
2974
+ constructor() {
2975
+ try {
2976
+ this._et = new EventTarget();
2977
+ } catch {
2978
+ this._et = document;
2979
+ }
2980
+ }
2981
+ addEventListener(r, n, g) {
2982
+ this._et.addEventListener(r, n, g);
2983
+ }
2984
+ dispatchEvent(r) {
2985
+ return this._et.dispatchEvent(r);
2986
+ }
2987
+ removeEventListener(r, n, g) {
2988
+ this._et.removeEventListener(r, n, g);
2989
+ }
2990
+ }
2991
+ function te(v, r = 250) {
2992
+ let n = 0, g = null, u, h, d;
2993
+ const l = () => {
2994
+ n = Date.now(), g = null, u = v.apply(h, d), g || (h = null, d = []);
2995
+ };
2996
+ return function(...s) {
2997
+ const f = Date.now(), a = r - (f - n);
2998
+ return h = this, d = s, a <= 0 || a > r ? (g && (clearTimeout(g), g = null), n = f, u = v.apply(h, d), g || (h = null, d = [])) : g || (g = window.setTimeout(l, a)), u;
2999
+ };
3000
+ }
3001
+ let ee = class Ct extends Zt {
3002
+ constructor(r, n = {}) {
3003
+ super(), this.canvas = r, this._handleMouseDown = (g) => {
3004
+ g.buttons === 1 && (this._drawningStroke = !0, this._strokeBegin(g));
3005
+ }, this._handleMouseMove = (g) => {
3006
+ this._drawningStroke && this._strokeMoveUpdate(g);
3007
+ }, this._handleMouseUp = (g) => {
3008
+ g.buttons === 1 && this._drawningStroke && (this._drawningStroke = !1, this._strokeEnd(g));
3009
+ }, this._handleTouchStart = (g) => {
3010
+ if (g.cancelable && g.preventDefault(), g.targetTouches.length === 1) {
3011
+ const u = g.changedTouches[0];
3012
+ this._strokeBegin(u);
3215
3013
  }
3216
- function yt(o) {
3217
- return o !== o;
3014
+ }, this._handleTouchMove = (g) => {
3015
+ g.cancelable && g.preventDefault();
3016
+ const u = g.targetTouches[0];
3017
+ this._strokeMoveUpdate(u);
3018
+ }, this._handleTouchEnd = (g) => {
3019
+ if (g.target === this.canvas) {
3020
+ g.cancelable && g.preventDefault();
3021
+ const h = g.changedTouches[0];
3022
+ this._strokeEnd(h);
3218
3023
  }
3219
- var kt = function() {
3220
- for (var o = "0123456789abcdef", t = new Array(256), e = 0; e < 16; ++e)
3221
- for (var l = e * 16, y = 0; y < 16; ++y)
3222
- t[l + y] = o[e] + o[y];
3223
- return t;
3224
- }();
3225
- }, { "base64-js": 29, ieee754: 32 }], 31: [function(n, g, u) {
3226
- var h = {
3227
- single_source_shortest_paths: function(d, c, i) {
3228
- var s = {}, f = {};
3229
- f[c] = 0;
3230
- var a = h.PriorityQueue.make();
3231
- a.push(c, 0);
3232
- for (var w, x, b, A, F, M, C, B, I; !a.empty(); ) {
3233
- w = a.pop(), x = w.value, A = w.cost, F = d[x] || {};
3234
- for (b in F)
3235
- F.hasOwnProperty(b) && (M = F[b], C = A + M, B = f[b], I = typeof f[b] > "u", (I || B > C) && (f[b] = C, a.push(b, C), s[b] = x));
3236
- }
3237
- if (typeof i < "u" && typeof f[i] > "u") {
3238
- var k = ["Could not find a path from ", c, " to ", i, "."].join("");
3239
- throw new Error(k);
3240
- }
3241
- return s;
3242
- },
3243
- extract_shortest_path_from_predecessor_list: function(d, c) {
3244
- for (var i = [], s = c; s; )
3245
- i.push(s), d[s], s = d[s];
3246
- return i.reverse(), i;
3247
- },
3248
- find_path: function(d, c, i) {
3249
- var s = h.single_source_shortest_paths(d, c, i);
3250
- return h.extract_shortest_path_from_predecessor_list(
3251
- s,
3252
- i
3253
- );
3254
- },
3255
- /**
3256
- * A very naive priority queue implementation.
3257
- */
3258
- PriorityQueue: {
3259
- make: function(d) {
3260
- var c = h.PriorityQueue, i = {}, s;
3261
- d = d || {};
3262
- for (s in c)
3263
- c.hasOwnProperty(s) && (i[s] = c[s]);
3264
- return i.queue = [], i.sorter = d.sorter || c.default_sorter, i;
3265
- },
3266
- default_sorter: function(d, c) {
3267
- return d.cost - c.cost;
3268
- },
3269
- /**
3270
- * Add a new item to the queue and ensure the highest priority element
3271
- * is at the front of the queue.
3272
- */
3273
- push: function(d, c) {
3274
- var i = { value: d, cost: c };
3275
- this.queue.push(i), this.queue.sort(this.sorter);
3276
- },
3277
- /**
3278
- * Return the highest priority element in the queue.
3279
- */
3280
- pop: function() {
3281
- return this.queue.shift();
3282
- },
3283
- empty: function() {
3284
- return this.queue.length === 0;
3285
- }
3286
- }
3287
- };
3288
- typeof g < "u" && (g.exports = h);
3289
- }, {}], 32: [function(n, g, u) {
3290
- u.read = function(h, d, c, i, s) {
3291
- var f, a, w = s * 8 - i - 1, x = (1 << w) - 1, b = x >> 1, A = -7, F = c ? s - 1 : 0, M = c ? -1 : 1, C = h[d + F];
3292
- for (F += M, f = C & (1 << -A) - 1, C >>= -A, A += w; A > 0; f = f * 256 + h[d + F], F += M, A -= 8)
3293
- ;
3294
- for (a = f & (1 << -A) - 1, f >>= -A, A += i; A > 0; a = a * 256 + h[d + F], F += M, A -= 8)
3295
- ;
3296
- if (f === 0)
3297
- f = 1 - b;
3298
- else {
3299
- if (f === x)
3300
- return a ? NaN : (C ? -1 : 1) * (1 / 0);
3301
- a = a + Math.pow(2, i), f = f - b;
3024
+ }, this._handlePointerStart = (g) => {
3025
+ this._drawningStroke = !0, g.preventDefault(), this._strokeBegin(g);
3026
+ }, this._handlePointerMove = (g) => {
3027
+ this._drawningStroke && (g.preventDefault(), this._strokeMoveUpdate(g));
3028
+ }, this._handlePointerEnd = (g) => {
3029
+ this._drawningStroke && (g.preventDefault(), this._drawningStroke = !1, this._strokeEnd(g));
3030
+ }, this.velocityFilterWeight = n.velocityFilterWeight || 0.7, this.minWidth = n.minWidth || 0.5, this.maxWidth = n.maxWidth || 2.5, this.throttle = "throttle" in n ? n.throttle : 16, this.minDistance = "minDistance" in n ? n.minDistance : 5, this.dotSize = n.dotSize || 0, this.penColor = n.penColor || "black", this.backgroundColor = n.backgroundColor || "rgba(0,0,0,0)", this._strokeMoveUpdate = this.throttle ? te(Ct.prototype._strokeUpdate, this.throttle) : Ct.prototype._strokeUpdate, this._ctx = r.getContext("2d"), this.clear(), this.on();
3031
+ }
3032
+ clear() {
3033
+ const { _ctx: r, canvas: n } = this;
3034
+ r.fillStyle = this.backgroundColor, r.clearRect(0, 0, n.width, n.height), r.fillRect(0, 0, n.width, n.height), this._data = [], this._reset(this._getPointGroupOptions()), this._isEmpty = !0;
3035
+ }
3036
+ fromDataURL(r, n = {}) {
3037
+ return new Promise((g, u) => {
3038
+ const h = new Image(), d = n.ratio || window.devicePixelRatio || 1, l = n.width || this.canvas.width / d, i = n.height || this.canvas.height / d, s = n.xOffset || 0, f = n.yOffset || 0;
3039
+ this._reset(this._getPointGroupOptions()), h.onload = () => {
3040
+ this._ctx.drawImage(h, s, f, l, i), g();
3041
+ }, h.onerror = (a) => {
3042
+ u(a);
3043
+ }, h.crossOrigin = "anonymous", h.src = r, this._isEmpty = !1;
3044
+ });
3045
+ }
3046
+ toDataURL(r = "image/png", n) {
3047
+ switch (r) {
3048
+ case "image/svg+xml":
3049
+ return this._toSVG();
3050
+ default:
3051
+ return this.canvas.toDataURL(r, n);
3052
+ }
3053
+ }
3054
+ on() {
3055
+ this.canvas.style.touchAction = "none", this.canvas.style.msTouchAction = "none", this.canvas.style.userSelect = "none";
3056
+ const r = /Macintosh/.test(navigator.userAgent) && "ontouchstart" in document;
3057
+ window.PointerEvent && !r ? this._handlePointerEvents() : (this._handleMouseEvents(), "ontouchstart" in window && this._handleTouchEvents());
3058
+ }
3059
+ off() {
3060
+ this.canvas.style.touchAction = "auto", this.canvas.style.msTouchAction = "auto", this.canvas.style.userSelect = "auto", this.canvas.removeEventListener("pointerdown", this._handlePointerStart), this.canvas.removeEventListener("pointermove", this._handlePointerMove), this.canvas.ownerDocument.removeEventListener("pointerup", this._handlePointerEnd), this.canvas.removeEventListener("mousedown", this._handleMouseDown), this.canvas.removeEventListener("mousemove", this._handleMouseMove), this.canvas.ownerDocument.removeEventListener("mouseup", this._handleMouseUp), this.canvas.removeEventListener("touchstart", this._handleTouchStart), this.canvas.removeEventListener("touchmove", this._handleTouchMove), this.canvas.removeEventListener("touchend", this._handleTouchEnd);
3061
+ }
3062
+ isEmpty() {
3063
+ return this._isEmpty;
3064
+ }
3065
+ fromData(r, { clear: n = !0 } = {}) {
3066
+ n && this.clear(), this._fromData(r, this._drawCurve.bind(this), this._drawDot.bind(this)), this._data = this._data.concat(r);
3067
+ }
3068
+ toData() {
3069
+ return this._data;
3070
+ }
3071
+ _getPointGroupOptions(r) {
3072
+ return {
3073
+ penColor: r && "penColor" in r ? r.penColor : this.penColor,
3074
+ dotSize: r && "dotSize" in r ? r.dotSize : this.dotSize,
3075
+ minWidth: r && "minWidth" in r ? r.minWidth : this.minWidth,
3076
+ maxWidth: r && "maxWidth" in r ? r.maxWidth : this.maxWidth,
3077
+ velocityFilterWeight: r && "velocityFilterWeight" in r ? r.velocityFilterWeight : this.velocityFilterWeight
3078
+ };
3079
+ }
3080
+ _strokeBegin(r) {
3081
+ this.dispatchEvent(new CustomEvent("beginStroke", { detail: r }));
3082
+ const n = this._getPointGroupOptions(), g = Object.assign(Object.assign({}, n), { points: [] });
3083
+ this._data.push(g), this._reset(n), this._strokeUpdate(r);
3084
+ }
3085
+ _strokeUpdate(r) {
3086
+ if (this._data.length === 0) {
3087
+ this._strokeBegin(r);
3088
+ return;
3089
+ }
3090
+ this.dispatchEvent(new CustomEvent("beforeUpdateStroke", { detail: r }));
3091
+ const n = r.clientX, g = r.clientY, u = r.pressure !== void 0 ? r.pressure : r.force !== void 0 ? r.force : 0, h = this._createPoint(n, g, u), d = this._data[this._data.length - 1], l = d.points, i = l.length > 0 && l[l.length - 1], s = i ? h.distanceTo(i) <= this.minDistance : !1, f = this._getPointGroupOptions(d);
3092
+ if (!i || !(i && s)) {
3093
+ const a = this._addPoint(h, f);
3094
+ i ? a && this._drawCurve(a, f) : this._drawDot(h, f), l.push({
3095
+ time: h.time,
3096
+ x: h.x,
3097
+ y: h.y,
3098
+ pressure: h.pressure
3099
+ });
3100
+ }
3101
+ this.dispatchEvent(new CustomEvent("afterUpdateStroke", { detail: r }));
3102
+ }
3103
+ _strokeEnd(r) {
3104
+ this._strokeUpdate(r), this.dispatchEvent(new CustomEvent("endStroke", { detail: r }));
3105
+ }
3106
+ _handlePointerEvents() {
3107
+ this._drawningStroke = !1, this.canvas.addEventListener("pointerdown", this._handlePointerStart), this.canvas.addEventListener("pointermove", this._handlePointerMove), this.canvas.ownerDocument.addEventListener("pointerup", this._handlePointerEnd);
3108
+ }
3109
+ _handleMouseEvents() {
3110
+ this._drawningStroke = !1, this.canvas.addEventListener("mousedown", this._handleMouseDown), this.canvas.addEventListener("mousemove", this._handleMouseMove), this.canvas.ownerDocument.addEventListener("mouseup", this._handleMouseUp);
3111
+ }
3112
+ _handleTouchEvents() {
3113
+ this.canvas.addEventListener("touchstart", this._handleTouchStart), this.canvas.addEventListener("touchmove", this._handleTouchMove), this.canvas.addEventListener("touchend", this._handleTouchEnd);
3114
+ }
3115
+ _reset(r) {
3116
+ this._lastPoints = [], this._lastVelocity = 0, this._lastWidth = (r.minWidth + r.maxWidth) / 2, this._ctx.fillStyle = r.penColor;
3117
+ }
3118
+ _createPoint(r, n, g) {
3119
+ const u = this.canvas.getBoundingClientRect();
3120
+ return new pt(r - u.left, n - u.top, g, (/* @__PURE__ */ new Date()).getTime());
3121
+ }
3122
+ _addPoint(r, n) {
3123
+ const { _lastPoints: g } = this;
3124
+ if (g.push(r), g.length > 2) {
3125
+ g.length === 3 && g.unshift(g[0]);
3126
+ const u = this._calculateCurveWidths(g[1], g[2], n), h = bt.fromPoints(g, u);
3127
+ return g.shift(), h;
3128
+ }
3129
+ return null;
3130
+ }
3131
+ _calculateCurveWidths(r, n, g) {
3132
+ const u = g.velocityFilterWeight * n.velocityFrom(r) + (1 - g.velocityFilterWeight) * this._lastVelocity, h = this._strokeWidth(u, g), d = {
3133
+ end: h,
3134
+ start: this._lastWidth
3135
+ };
3136
+ return this._lastVelocity = u, this._lastWidth = h, d;
3137
+ }
3138
+ _strokeWidth(r, n) {
3139
+ return Math.max(n.maxWidth / (r + 1), n.minWidth);
3140
+ }
3141
+ _drawCurveSegment(r, n, g) {
3142
+ const u = this._ctx;
3143
+ u.moveTo(r, n), u.arc(r, n, g, 0, 2 * Math.PI, !1), this._isEmpty = !1;
3144
+ }
3145
+ _drawCurve(r, n) {
3146
+ const g = this._ctx, u = r.endWidth - r.startWidth, h = Math.ceil(r.length()) * 2;
3147
+ g.beginPath(), g.fillStyle = n.penColor;
3148
+ for (let d = 0; d < h; d += 1) {
3149
+ const l = d / h, i = l * l, s = i * l, f = 1 - l, a = f * f, y = a * f;
3150
+ let x = y * r.startPoint.x;
3151
+ x += 3 * a * l * r.control1.x, x += 3 * f * i * r.control2.x, x += s * r.endPoint.x;
3152
+ let b = y * r.startPoint.y;
3153
+ b += 3 * a * l * r.control1.y, b += 3 * f * i * r.control2.y, b += s * r.endPoint.y;
3154
+ const A = Math.min(r.startWidth + s * u, n.maxWidth);
3155
+ this._drawCurveSegment(x, b, A);
3156
+ }
3157
+ g.closePath(), g.fill();
3158
+ }
3159
+ _drawDot(r, n) {
3160
+ const g = this._ctx, u = n.dotSize > 0 ? n.dotSize : (n.minWidth + n.maxWidth) / 2;
3161
+ g.beginPath(), this._drawCurveSegment(r.x, r.y, u), g.closePath(), g.fillStyle = n.penColor, g.fill();
3162
+ }
3163
+ _fromData(r, n, g) {
3164
+ for (const u of r) {
3165
+ const { points: h } = u, d = this._getPointGroupOptions(u);
3166
+ if (h.length > 1)
3167
+ for (let l = 0; l < h.length; l += 1) {
3168
+ const i = h[l], s = new pt(i.x, i.y, i.pressure, i.time);
3169
+ l === 0 && this._reset(d);
3170
+ const f = this._addPoint(s, d);
3171
+ f && n(f, d);
3302
3172
  }
3303
- return (C ? -1 : 1) * a * Math.pow(2, f - i);
3304
- }, u.write = function(h, d, c, i, s, f) {
3305
- var a, w, x, b = f * 8 - s - 1, A = (1 << b) - 1, F = A >> 1, M = s === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, C = i ? 0 : f - 1, B = i ? 1 : -1, I = d < 0 || d === 0 && 1 / d < 0 ? 1 : 0;
3306
- for (d = Math.abs(d), isNaN(d) || d === 1 / 0 ? (w = isNaN(d) ? 1 : 0, a = A) : (a = Math.floor(Math.log(d) / Math.LN2), d * (x = Math.pow(2, -a)) < 1 && (a--, x *= 2), a + F >= 1 ? d += M / x : d += M * Math.pow(2, 1 - F), d * x >= 2 && (a++, x /= 2), a + F >= A ? (w = 0, a = A) : a + F >= 1 ? (w = (d * x - 1) * Math.pow(2, s), a = a + F) : (w = d * Math.pow(2, F - 1) * Math.pow(2, s), a = 0)); s >= 8; h[c + C] = w & 255, C += B, w /= 256, s -= 8)
3307
- ;
3308
- for (a = a << s | w, b += s; b > 0; h[c + C] = a & 255, C += B, a /= 256, b -= 8)
3309
- ;
3310
- h[c + C - B] |= I * 128;
3311
- };
3312
- }, {}], 33: [function(n, g, u) {
3313
- var h = {}.toString;
3314
- g.exports = Array.isArray || function(d) {
3315
- return h.call(d) == "[object Array]";
3316
- };
3317
- }, {}] }, {}, [24])(24);
3318
- });
3319
- }), ce = {
3320
- name: "qrcode",
3173
+ else
3174
+ this._reset(d), g(h[0], d);
3175
+ }
3176
+ }
3177
+ _toSVG() {
3178
+ const r = this._data, n = Math.max(window.devicePixelRatio || 1, 1), g = 0, u = 0, h = this.canvas.width / n, d = this.canvas.height / n, l = document.createElementNS("http://www.w3.org/2000/svg", "svg");
3179
+ l.setAttribute("width", this.canvas.width.toString()), l.setAttribute("height", this.canvas.height.toString()), this._fromData(r, (x, { penColor: b }) => {
3180
+ const A = document.createElement("path");
3181
+ if (!isNaN(x.control1.x) && !isNaN(x.control1.y) && !isNaN(x.control2.x) && !isNaN(x.control2.y)) {
3182
+ const F = `M ${x.startPoint.x.toFixed(3)},${x.startPoint.y.toFixed(3)} C ${x.control1.x.toFixed(3)},${x.control1.y.toFixed(3)} ${x.control2.x.toFixed(3)},${x.control2.y.toFixed(3)} ${x.endPoint.x.toFixed(3)},${x.endPoint.y.toFixed(3)}`;
3183
+ A.setAttribute("d", F), A.setAttribute("stroke-width", (x.endWidth * 2.25).toFixed(3)), A.setAttribute("stroke", b), A.setAttribute("fill", "none"), A.setAttribute("stroke-linecap", "round"), l.appendChild(A);
3184
+ }
3185
+ }, (x, { penColor: b, dotSize: A, minWidth: F, maxWidth: M }) => {
3186
+ const E = document.createElement("circle"), B = A > 0 ? A : (F + M) / 2;
3187
+ E.setAttribute("r", B.toString()), E.setAttribute("cx", x.x.toString()), E.setAttribute("cy", x.y.toString()), E.setAttribute("fill", b), l.appendChild(E);
3188
+ });
3189
+ const i = "data:image/svg+xml;base64,", s = `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="${g} ${u} ${h} ${d}" width="${h}" height="${d}">`;
3190
+ let f = l.innerHTML;
3191
+ if (f === void 0) {
3192
+ const x = document.createElement("dummy"), b = l.childNodes;
3193
+ x.innerHTML = "";
3194
+ for (let A = 0; A < b.length; A += 1)
3195
+ x.appendChild(b[A].cloneNode(!0));
3196
+ f = x.innerHTML;
3197
+ }
3198
+ const y = s + f + "</svg>";
3199
+ return i + btoa(y);
3200
+ }
3201
+ }, re = class extends ee {
3202
+ fromText(r, n = {}) {
3203
+ if (this.clear(), !r)
3204
+ return;
3205
+ const { font: g, x: u = 10, y: h = 50 } = n;
3206
+ let { maxWidth: d } = n;
3207
+ if (!d) {
3208
+ const { clientWidth: l = 300 } = this.canvas;
3209
+ d = Math.floor(l - 2 * u);
3210
+ }
3211
+ this._ctx.font = g, this._ctx.fillText(r, u, h, d), this._isEmpty = !1;
3212
+ }
3213
+ };
3214
+ const ne = {
3215
+ name: "SignaturePad",
3321
3216
  props: {
3217
+ type: {
3218
+ type: String,
3219
+ default: "text",
3220
+ validator: (v) => ["text", "draw"].includes(v)
3221
+ },
3222
+ text: {
3223
+ type: String,
3224
+ default: ""
3225
+ },
3226
+ width: {
3227
+ type: String,
3228
+ default: "100%"
3229
+ },
3230
+ height: {
3231
+ type: String,
3232
+ default: "100%"
3233
+ },
3234
+ customStyle: {
3235
+ type: Object,
3236
+ default: () => ({})
3237
+ },
3238
+ options: {
3239
+ type: Object,
3240
+ default: () => ({})
3241
+ },
3322
3242
  /**
3323
- * The value of the QR code.
3324
- */
3325
- value: null,
3326
- /**
3327
- * The options for the QR code generator.
3328
- * {@link https://github.com/soldair/node-qrcode#qr-code-options}
3329
- */
3330
- options: Object,
3331
- /**
3332
- * The tag name of the component's root element.
3243
+ * Obj on format like {
3244
+ beginStroke: () => {},
3245
+ endStroke: () => {},
3246
+ },
3333
3247
  */
3334
- tag: {
3335
- type: String,
3336
- default: "canvas"
3248
+ signEvents: {
3249
+ type: Object,
3250
+ default: () => ({})
3251
+ },
3252
+ images: {
3253
+ type: Array,
3254
+ default: () => []
3337
3255
  }
3338
3256
  },
3339
- render: function(r) {
3340
- return r(this.tag, this.$slots.default);
3257
+ data() {
3258
+ return {
3259
+ signaturePad: {},
3260
+ onResizeHandler: null,
3261
+ signatureData: "",
3262
+ defaultOptions: {
3263
+ dotSize: 1.5,
3264
+ minWidth: 0.5,
3265
+ maxWidth: 2.5,
3266
+ throttle: 16,
3267
+ minDistance: 3,
3268
+ backgroundColor: "rgba(0,0,0,0)",
3269
+ penColor: "black",
3270
+ velocityFilterWeight: 0.5
3271
+ },
3272
+ validTypes: ["image/png", "image/jpeg", "image/svg+xml"]
3273
+ };
3341
3274
  },
3342
3275
  watch: {
3343
- $props: {
3344
- deep: !0,
3345
- immediate: !0,
3346
- /**
3347
- * Update the QR code when props changed.
3348
- */
3349
- handler: function() {
3350
- this.$el && this.generate();
3351
- }
3276
+ type() {
3277
+ this.initType();
3278
+ },
3279
+ text(v) {
3280
+ this.drawText(v);
3352
3281
  }
3353
3282
  },
3283
+ mounted() {
3284
+ const { options: v, defaultOptions: r } = this, n = this.$refs.signaturePadCanvas;
3285
+ this.signaturePad = new re(n, {
3286
+ ...r,
3287
+ ...v
3288
+ }), this.onResizeHandler = this.resizeCanvas.bind(this), window.addEventListener("resize", this.onResizeHandler, !1), Object.keys(this.signEvents).forEach((g) => {
3289
+ this.signaturePad.addEventListener(g, () => {
3290
+ this.signEvents[g]();
3291
+ });
3292
+ }), this.initType(), this.resizeCanvas();
3293
+ },
3294
+ beforeDestroy() {
3295
+ this.onResizeHandler && window.removeEventListener("resize", this.onResizeHandler, !1);
3296
+ },
3354
3297
  methods: {
3355
- /**
3356
- * Generate QR code.
3357
- */
3358
- generate: function() {
3359
- var r = this, n = this.options, g = this.tag, u = String(this.value);
3360
- g === "canvas" ? xt.toCanvas(this.$el, u, n, function(h) {
3361
- if (h)
3362
- throw h;
3363
- }) : g === "img" ? xt.toDataURL(u, n, function(h, d) {
3364
- if (h)
3365
- throw h;
3366
- r.$el.src = d;
3367
- }) : xt.toString(u, n, function(h, d) {
3368
- if (h)
3369
- throw h;
3370
- r.$el.innerHTML = d;
3298
+ initType() {
3299
+ this.type === "draw" ? this.openSignaturePad() : this.lockSignaturePad();
3300
+ },
3301
+ resizeCanvas() {
3302
+ const v = this.$refs.signaturePadCanvas, r = Math.max(window.devicePixelRatio || 1, 1);
3303
+ if (v.width = v.offsetWidth * r, v.height = v.offsetHeight * r, v.getContext("2d").scale(r, r), this.signaturePad.clear(), this.signatureData = "", this.type === "draw") {
3304
+ const n = this.signaturePad.toData();
3305
+ n != null && n.length && this.signaturePad.fromData(n);
3306
+ } else
3307
+ this.type === "text" && this.drawText(this.text);
3308
+ },
3309
+ saveSignature(v = {}) {
3310
+ const { type: r = "image/png", trim: n = !0, encoderOptions: g } = v || {}, u = { isEmpty: !1, data: void 0 };
3311
+ if (!this.validTypes.includes(r)) {
3312
+ const h = this.validTypes.join(", ");
3313
+ throw new Error(
3314
+ `The Image type is incorrect! We only support ${h} types.`
3315
+ );
3316
+ }
3317
+ if (this.signaturePad.isEmpty())
3318
+ return { ...u, isEmpty: !0 };
3319
+ if (n) {
3320
+ const h = this.$refs.signaturePadCanvas, d = h ? this.trimCanvas(h) : null;
3321
+ this.signatureData = d ? d.toDataURL(r, g) : "";
3322
+ } else
3323
+ this.signatureData = this.signaturePad.toDataURL(r, g);
3324
+ return {
3325
+ ...u,
3326
+ data: this.signatureData
3327
+ };
3328
+ },
3329
+ undoSignature() {
3330
+ const { signaturePad: v } = this, r = v.toData();
3331
+ r && v.fromData(r.slice(0, -1));
3332
+ },
3333
+ drawText(v) {
3334
+ this.signaturePad.fromText(v, {
3335
+ font: '40px "Nothing You Could Do"',
3336
+ x: 10,
3337
+ y: 100
3371
3338
  });
3339
+ },
3340
+ // Extend of module methods
3341
+ fromText(...v) {
3342
+ return this.signaturePad.fromText(...v);
3343
+ },
3344
+ fromDataURL(...v) {
3345
+ return this.signaturePad.fromDataURL(...v);
3346
+ },
3347
+ fromData(...v) {
3348
+ return this.signaturePad.fromData(...v);
3349
+ },
3350
+ toData(...v) {
3351
+ return this.signaturePad.toData(...v);
3352
+ },
3353
+ lockSignaturePad() {
3354
+ return this.signaturePad.off();
3355
+ },
3356
+ openSignaturePad() {
3357
+ return this.signaturePad.on();
3358
+ },
3359
+ isEmpty() {
3360
+ return this.signaturePad.isEmpty();
3361
+ },
3362
+ clearSignature() {
3363
+ return this.signaturePad.clear();
3364
+ },
3365
+ trimCanvas(v) {
3366
+ const r = document.createElement("canvas"), n = r.getContext("2d");
3367
+ r.width = v.width, r.height = v.height, n.drawImage(v, 0, 0);
3368
+ let g = r.width, u = r.height;
3369
+ const h = { x: [], y: [] }, d = n.getImageData(
3370
+ 0,
3371
+ 0,
3372
+ r.width,
3373
+ r.height
3374
+ );
3375
+ let l = 0;
3376
+ for (let f = 0; f < u; f++)
3377
+ for (let a = 0; a < g; a++)
3378
+ l = (f * g + a) * 4, d.data[l + 3] > 0 && (h.x.push(a), h.y.push(f));
3379
+ h.x.sort((f, a) => f - a), h.y.sort((f, a) => f - a);
3380
+ const i = h.x.length - 1;
3381
+ g = h.x[i] - h.x[0], u = h.y[i] - h.y[0];
3382
+ const s = n.getImageData(h.x[0], h.y[0], g, u);
3383
+ return r.height = u, n.putImageData(s, 0, 0), r;
3372
3384
  }
3373
3385
  },
3374
- mounted: function() {
3375
- this.generate();
3376
- }
3377
- };
3378
- class he {
3379
- constructor() {
3380
- this._activePolls = {}, this._pollingInterval = 1e3;
3381
- }
3382
- _startPolling(r) {
3383
- const { handler: n, interval: g } = this._activePolls[r], u = async () => {
3384
- var h;
3385
- await n(), (h = this._activePolls[r]) != null && h.pollActive && setTimeout(u, g || this._pollingInterval);
3386
- };
3387
- u();
3388
- }
3389
- /**
3390
- * Add a new poll to the active polls list.
3391
- * @param {string} options.id - Unique identifier for the poll.
3392
- * @param {function} options.handler - Function to be executed when the poll is activated.
3393
- * @param {number} options.interval - Time interval in milliseconds at which the poll should run.
3394
- * @param {number} [options.removeAfterMs=0] - Optional. Time in milliseconds after which the poll should be automatically removed.
3395
- * @param {boolean} [options.startImmediately=true] - Optional. If true, the poll will start immediately after being added.
3396
- * @param {*} [options.data] - Optional. Additional data associated with the poll.
3397
- * @returns {function} - A function that can be used to manually remove the poll from the active polls list.
3398
- */
3399
- addPoll({
3400
- id: r,
3401
- handler: n,
3402
- interval: g,
3403
- removeAfterMs: u = 0,
3404
- startImmediately: h = !0,
3405
- data: d
3406
- }) {
3407
- if (!r || typeof n != "function")
3408
- throw new Error("Invalid poll definition");
3409
- if (this._activePolls[r])
3410
- throw new Error("Poll with the same ID already exists");
3411
- return this._activePolls[r] = { handler: n, interval: g, pollActive: !1, data: d }, h && setTimeout(() => {
3412
- this.activatePoll(r);
3413
- }, 0), u && setTimeout(() => {
3414
- this._activePolls[r] && this.removePoll(r);
3415
- }, u), () => this.removePoll(r);
3416
- }
3417
- activatePoll(r) {
3418
- if (!this._activePolls[r])
3419
- throw new Error("Poll not found");
3420
- this._activePolls[r].pollActive || (this._activePolls[r].pollActive = !0, this._startPolling(r));
3421
- }
3422
- deactivatePoll(r) {
3423
- if (!this._activePolls[r]) {
3424
- console.warn("[deactivatePoll] Poll not found");
3425
- return;
3426
- }
3427
- this._activePolls[r].pollActive = !1;
3428
- }
3429
- removePoll(r) {
3430
- if (!this._activePolls[r]) {
3431
- console.warn("[removePoll] Poll not found");
3432
- return;
3433
- }
3434
- delete this._activePolls[r];
3386
+ render(v) {
3387
+ const { width: r, height: n, customStyle: g } = this;
3388
+ return v(
3389
+ "div",
3390
+ {
3391
+ style: {
3392
+ width: r,
3393
+ height: n,
3394
+ ...g
3395
+ }
3396
+ },
3397
+ [
3398
+ v("canvas", {
3399
+ style: {
3400
+ width: "100%",
3401
+ height: "100%"
3402
+ },
3403
+ ref: "signaturePadCanvas"
3404
+ })
3405
+ ]
3406
+ );
3435
3407
  }
3408
+ }, ie = null, ae = null;
3409
+ var oe = /* @__PURE__ */ ot(
3410
+ ne,
3411
+ ie,
3412
+ ae,
3413
+ !1,
3414
+ null,
3415
+ null
3416
+ );
3417
+ const se = oe.exports;
3418
+ function ue({ rel: v, href: r, crossorigin: n = !1 }) {
3419
+ const g = document.createElement("link");
3420
+ g.rel = v, g.href = r, g.crossorigin = n, document.head.appendChild(g);
3436
3421
  }
3437
- let _t = null;
3438
- function Ft() {
3439
- return _t || (_t = new he()), _t;
3440
- }
3441
- function fe(v) {
3442
- window.history.replaceState({}, "", window.location.href);
3443
- let r = "";
3444
- const n = (navigator == null ? void 0 : navigator.userAgent) || "";
3445
- return n.match("CriOS") ? r = "googlechromes://" : n.match("FxiOS") ? r = "firefox://" : n.match("GSA") && (r = "googleapp://open-url?url="), r + encodeURIComponent(`${window.location.href}#${v}`);
3446
- }
3447
- const de = {
3448
- name: "BankIdAnswer",
3422
+ const ce = [
3423
+ { rel: "preconnect", href: "https://fonts.googleapis.com" },
3424
+ { rel: "preconnect", href: "https://fonts.gstatic.com", crossorigin: !0 },
3425
+ {
3426
+ rel: "stylesheet",
3427
+ href: "https://fonts.googleapis.com/css2?family=Nothing+You+Could+Do&display=swap"
3428
+ }
3429
+ ], le = {
3430
+ name: "SignatureAnswer",
3449
3431
  components: {
3450
- QrCode: ce
3432
+ CField: Lt,
3433
+ SignaturePad: se
3451
3434
  },
3452
3435
  mixins: [ft([])],
3453
3436
  props: {
@@ -3458,247 +3441,249 @@ const de = {
3458
3441
  },
3459
3442
  data() {
3460
3443
  return {
3461
- signAnswerId: null,
3462
- view: "form",
3463
- errorMessage: "",
3464
- isLoading: !1,
3465
- qrCode: null,
3466
- autoStartToken: null,
3467
- isMobile: !1
3468
- };
3469
- },
3470
- computed: {
3471
- viewText() {
3472
- const v = (r) => this._document.$t(`answerModal.bankId.component.viewText.${r}`);
3473
- return {
3474
- new: {
3475
- title: v("new.title"),
3476
- text: v("new.text"),
3477
- spinnerText: v("new.spinnerText")
3478
- },
3479
- waiting: {
3480
- title: v("waiting.title"),
3481
- text: v("waiting.text"),
3482
- spinnerText: v("waiting.spinnerText")
3483
- },
3484
- started: {
3485
- title: v("waiting.title"),
3486
- text: v("waiting.text"),
3487
- spinnerText: v("waiting.spinnerText")
3488
- },
3489
- signing: {
3490
- title: v("signing.title"),
3491
- text: v("signing.text"),
3492
- spinnerText: v("signing.spinnerText")
3493
- },
3494
- error: {
3495
- title: v("error.title"),
3496
- text: v("error.text")
3497
- },
3498
- canceled: {
3499
- title: v("canceled.title"),
3500
- text: v("canceled.text")
3501
- }
3502
- };
3503
- }
3504
- },
3505
- watch: {
3506
- isLoading(v) {
3507
- this.$emit("loading", v);
3508
- }
3509
- },
3510
- created() {
3511
- this.isMobile = Mt(), this.tryResumeSigningSession();
3512
- },
3513
- methods: {
3514
- tryResumeSigningSession() {
3515
- var n, g;
3516
- const v = Ft(), r = Object.keys(v._activePolls).find(
3517
- (u) => u.includes("bankId-")
3518
- );
3519
- try {
3520
- if (r) {
3521
- const { signAnswerId: u, autoStartToken: h, qrCode: d } = (n = v._activePolls[r]) == null ? void 0 : n.data;
3522
- this.signAnswerId = u, this.autoStartToken = h, this.qrCode = d, v.removePoll(r), (g = window.location) != null && g.hash && window.history.replaceState(
3523
- {},
3524
- "",
3525
- window.location.pathname
3526
- // clears search + hash
3527
- ), this.isLoading = !0, this.startPolling();
3528
- }
3529
- } catch (u) {
3530
- const h = this._document.$t(
3531
- "answerModal.bankId.component.viewText.error.text"
3532
- );
3533
- Tt("error", h), console.error(u);
3534
- }
3535
- },
3536
- async submit({ answer: v }) {
3537
- try {
3538
- this.isLoading = !0;
3539
- const { id: r, autoStartToken: n, qrCodeData: g } = await v({
3540
- body: { isAccepted: !0 }
3541
- });
3542
- n && (this.autoStartToken = n), g && (this.qrCode = g), this.signAnswerId = r, this.startPolling(), this.isMobile && this.triggerAutoStart();
3543
- return;
3544
- } catch (r) {
3545
- this.onError(r);
3546
- }
3547
- },
3548
- async startPolling() {
3549
- if (!this.signAnswerId)
3550
- throw Error("Missing signAnswerId");
3551
- const v = Ft(), r = `bankId-${this.signAnswerId}`, n = async () => {
3552
- if (!this.signAnswerId)
3553
- throw Error("Missing signAnswerId");
3554
- const g = () => {
3555
- this.clearSignState(), v.removePoll(r);
3556
- };
3557
- try {
3558
- const { data: u } = await $t.get(this.signAnswerId);
3559
- u.qrCodeData && (this.qrCode = u.qrCodeData), ["completed", "canceled"].includes(u.status) && g(), u.status === "completed" ? this.onComplete() : u.status === "canceled" ? this.onCanceled() : this.view = u.status;
3560
- } catch (u) {
3561
- this.onError(u), g();
3562
- }
3563
- };
3564
- try {
3565
- v.addPoll({
3566
- id: r,
3567
- handler: n,
3568
- interval: 1e3,
3569
- data: {
3570
- signAnswerId: this.signAnswerId,
3571
- autoStartToken: this.autoStartToken,
3572
- qrCode: this.qrCode
3573
- }
3574
- });
3575
- } catch (g) {
3576
- this.clearSignState();
3577
- const u = this._document.$t(
3578
- "answerModal.bankId.component.viewText.error.text"
3579
- );
3580
- Tt("error", u), console.error(g);
3581
- }
3444
+ mode: "text",
3445
+ text: "",
3446
+ isEmpty: !0,
3447
+ penColor: "hsl(220, 100%, 50%)"
3448
+ };
3449
+ },
3450
+ watch: {
3451
+ mode(v) {
3452
+ this.reset(), this.$refs.signaturePad && v === "text" && this.focusName();
3582
3453
  },
3583
- clearSignState() {
3584
- this.autoStartToken = null, this.qrCode = null, this.isLoading = !1;
3454
+ text() {
3455
+ this.$refs.signaturePad && this.$nextTick(() => {
3456
+ this.isEmpty = this.$refs.signaturePad.isEmpty();
3457
+ });
3585
3458
  },
3586
- onComplete() {
3587
- typeof this.onCompleteFunc == "function" && this.onCompleteFunc();
3459
+ isEmpty: {
3460
+ immediate: !0,
3461
+ handler(v) {
3462
+ this.$emit("invalid", v);
3463
+ }
3464
+ }
3465
+ },
3466
+ created() {
3467
+ ce.forEach(ue);
3468
+ },
3469
+ mounted() {
3470
+ this.focusName();
3471
+ },
3472
+ methods: {
3473
+ reset() {
3474
+ this.$refs.signaturePad && (this.$refs.signaturePad.clearSignature(), this.text && (this.text = ""), this.isEmpty = this.$refs.signaturePad.isEmpty());
3588
3475
  },
3589
- onCanceled() {
3590
- this.view = "canceled", this.errorMessage = this._document.$t(
3591
- "answerModal.bankId.component.signingInterrupted"
3592
- );
3476
+ undo() {
3477
+ this.$refs.signaturePad && (this.mode === "text" && this.text ? this.text = this.text.slice(0, this.text.length - 1) : this.$refs.signaturePad.undoSignature(), this.isEmpty = this.$refs.signaturePad.isEmpty());
3593
3478
  },
3594
- onError(v) {
3595
- var n, g;
3596
- if (v.httpStatusCode === 409)
3597
- throw v;
3598
- this.$emit("error"), this.view = "error";
3599
- const r = (g = (n = v.response) == null ? void 0 : n.data) == null ? void 0 : g.errorCode;
3600
- switch (r) {
3601
- case 9001:
3602
- case 9002:
3603
- case 9003:
3604
- case 9004:
3605
- case 9005:
3606
- case 9006:
3607
- case 9007:
3608
- Rt.warn(v);
3609
- break;
3610
- case 9009:
3611
- this.$emit("complete");
3612
- break;
3613
- default:
3614
- Ct(v, { showMessage: !1 });
3615
- }
3616
- this.errorMessage = this.$i18n.te(`errors:${r}`) && this._document.$t(`answerModal.bankId.component.errors.${r}`) || this._document.$t("answerModal.bankId.component.defaultError");
3479
+ getSignatureData() {
3480
+ let v = { type: "image/png", trim: !0 };
3481
+ this.mode === "draw" && (v = { type: "image/svg+xml", trim: !1 });
3482
+ const { isEmpty: r, data: n } = this.$refs.signaturePad ? this.$refs.signaturePad.saveSignature(v) : {};
3483
+ if (r || !n)
3484
+ throw Error("Missing signatureData");
3485
+ return n;
3617
3486
  },
3618
- triggerAutoStart() {
3619
- if (!this.autoStartToken)
3620
- return;
3621
- let v = "bankid://", r = "null";
3622
- if (this.isMobile) {
3623
- const g = Dt(), u = (navigator == null ? void 0 : navigator.userAgent) || (navigator == null ? void 0 : navigator.vendor) || (window == null ? void 0 : window.opera), h = g === "iOS" && (/Version\/[\d\.]+.*Safari/.test(u) || /GSA/.test(u)), d = g === "Android" && /Version\/[\d\.]+.*Chrome/.test(u);
3624
- (h || d) && (v = "https://app.bankid.com"), g === "iOS" && this.$view !== "widget" && (r = fe(this.signAnswerId));
3625
- }
3626
- const n = `${v}/?autostarttoken=${this.autoStartToken}&redirect=${r}`;
3627
- this.isMobile ? document.location = n : this.$refs.autoStartFrame.src = n;
3487
+ async submit({ answer: v }) {
3488
+ const r = this.getSignatureData();
3489
+ await v({ body: { isAccepted: !0, signatureDataURL: r } }), typeof this.onCompleteFunc == "function" && this.onCompleteFunc();
3490
+ },
3491
+ focusName() {
3492
+ this.$nextTick(
3493
+ () => this.$refs.nameInput ? this.$refs.nameInput.focus() : null
3494
+ );
3628
3495
  }
3629
3496
  }
3630
3497
  };
3631
- var ge = function() {
3632
- var g;
3498
+ var he = function() {
3633
3499
  var r = this, n = r._self._c;
3634
- return n("div", { staticClass: "-my-4 flex flex-col items-center" }, [n("iframe", { ref: "autoStartFrame", staticClass: "hidden", attrs: { height: "0", width: "0" } }), ["form", "signing", "error", "canceled"].includes(r.view) ? n("div", { staticClass: "flex h-[250px] w-[250px] items-center justify-center rounded-xl bg-gray-100" }, [n("BaseIcon", { staticClass: "text-gray-500", attrs: { type: "bankId", size: "50" } })], 1) : r._e(), ["new", "waiting", "started"].includes(r.view) ? [r.qrCode ? n("QrCode", { attrs: { value: r.qrCode, options: {
3635
- width: 250,
3636
- errorCorrectionLevel: "L",
3637
- color: { dark: "#000000" }
3638
- } } }) : r._e()] : r._e(), n("Animation", { staticClass: "w-full" }, [n("div", { key: "a", staticClass: "min-h-[20px] pt-4 text-sm text-gray-500", domProps: { textContent: r._s((g = r.viewText[r.view]) == null ? void 0 : g.spinnerText) } }), !r.isMobile && ["new", "waiting", "started"].includes(r.view) ? n("CButton", { key: "b", staticClass: "mt-4", attrs: { type: "none", pattern: "secondary", size: "small" }, on: { click: r.triggerAutoStart } }, [r._v(" " + r._s(r._document.$t("answerModal.bankId.component.startOnThisDevice")) + " ")]) : r._e()], 1), ["form", "new", "waiting", "started"].includes(r.view) ? r._e() : n("div", [n("transition", { attrs: { name: "pop-in" } }, [n("div", { staticClass: "bankid-popup", on: { click: () => {
3639
- r.view = "form", r.isLoading = !1;
3640
- } } }, [n("div", { staticClass: "flex flex-col items-center justify-center", staticStyle: { "background-color": "#183e4f", padding: "calc(2.5 * var(--rem)) calc(3 * var(--rem))" } }, [n("BaseIcon", { staticClass: "text-white", attrs: { type: "bankId", size: "34" } }), n("div", { staticClass: "pt-4 text-sm font-medium text-white opacity-75", domProps: { textContent: r._s(r.viewText[r.view].text) } })], 1), n("div", { staticClass: "flex w-full flex-col items-center justify-center text-center", staticStyle: { padding: "calc(3 * var(--rem)) calc(2 * var(--rem))" } }, [r.view === "signing" ? [n("div", { staticClass: "spinner" }), n("div", { staticClass: "pt-8 text-gray-500", domProps: { textContent: r._s(r.viewText[r.view].spinnerText) } })] : ["error", "canceled"].includes(r.view) ? [n("BaseIcon", { staticClass: "mb-2.5 text-gray-400", attrs: { type: "error", size: "22" } }), n("div", { staticStyle: { "font-size": "14px" }, domProps: { textContent: r._s(r.errorMessage) } }), n("CButton", { staticStyle: { "margin-top": "calc(2.5 * var(--rem))", padding: "1em", height: "initial" }, attrs: { loading: r.isLoading, type: "none", pattern: "secondary", size: "small" }, on: { click: function(u) {
3641
- r.view = "form";
3642
- } } }, [r._v(" " + r._s(r._document.$t("tryAgain")) + " ")])] : r._e()], 2)])])], 1)], 2);
3643
- }, pe = [], me = /* @__PURE__ */ ot(
3644
- de,
3645
- ge,
3646
- pe,
3500
+ return n("div", { staticStyle: { "text-align": "left" } }, [n("div", { staticClass: "flex w-full items-center justify-between", staticStyle: { "font-size": "16px", "padding-bottom": "1em", "font-weight": "500", color: "hsl(0, 0%, 11%)" } }, [n("div", [r._v(r._s(r._document.$t("answerModal.signature.component.subTitle")))]), n("div", { staticClass: "sign-toggle" }, [n("div", { staticClass: "sign-toggle-button", class: { active: r.mode === "text" }, on: { click: function(g) {
3501
+ r.mode = "text";
3502
+ } } }, [r._v(" " + r._s(r._document.$t("answerModal.signature.component.text.tab")) + " ")]), n("div", { staticClass: "sign-toggle-button", class: { active: r.mode === "draw" }, on: { click: function(g) {
3503
+ r.mode = "draw";
3504
+ } } }, [r._v(" " + r._s(r._document.$t("answerModal.signature.component.draw.tab")) + " ")])])]), r.mode === "text" ? n("CField", { attrs: { label: r._document.$t("answerModal.signature.component.text.nameLabel") } }, [n("CInput", { ref: "nameInput", attrs: { placeholder: r._document.$t("answerModal.signature.component.text.namePlaceholder") }, model: { value: r.text, callback: function(g) {
3505
+ r.text = g;
3506
+ }, expression: "text" } })], 1) : r._e(), n("div", { staticClass: "wrapper", staticStyle: { "padding-bottom": "5px" } }, [n("div", { staticClass: "background-image" }, [n("svg", { attrs: { xmlns: "http://www.w3.org/2000/svg", width: "100%", height: "100%" } }, [n("line", { attrs: { x1: "0", y1: "75%", x2: "100%", y2: "75%", stroke: "hsl(0,0%, 70%)", "stroke-width": "1", "stroke-linecap": "round", "stroke-dasharray": "3", "shape-rendering": "crispEdges", "pointer-events": "none" } })])]), n("div", { staticStyle: { position: "absolute", left: "1em", top: "0.75em", "font-size": "12px", color: "hsl(0, 0%, 50%)" } }, [r._v(" " + r._s(r._document.$t(`answerModal.signature.component.${r.mode}.canvasLabel`)) + " ")]), n("span", { staticStyle: { "font-family": "'Nothing You Could Do', cursive" } }), n("SignaturePad", { ref: "signaturePad", staticClass: "signature-pad", attrs: { type: r.mode, text: r.text, options: {
3507
+ penColor: r.penColor
3508
+ }, "sign-events": {
3509
+ endStroke: () => {
3510
+ r.isEmpty = r.$refs.signaturePad ? r.$refs.signaturePad.isEmpty() : !0;
3511
+ }
3512
+ } } })], 1), n("div", { directives: [{ name: "show", rawName: "v-show", value: r.mode === "draw", expression: "mode === 'draw'" }], staticClass: "flex w-full justify-end" }, [n("CButton", { attrs: { disabled: r.isEmpty, type: "text", size: "small", pattern: "tertiary", circle: "", icon: "trash" }, on: { click: r.reset } }), n("CButton", { attrs: { disabled: r.isEmpty, type: "text", size: "small", pattern: "tertiary", circle: "", icon: "rotate-left" }, on: { click: r.undo } })], 1), n("div", { staticClass: "text-center", staticStyle: { "font-size": "12px", color: "hsl(0, 0%, 45%)", "padding-top": "10px" } }, [r._v(" " + r._s(r._document.$t("answerModal.signature.component.terms")) + " ")])], 1);
3513
+ }, fe = [], de = /* @__PURE__ */ ot(
3514
+ le,
3515
+ he,
3516
+ fe,
3647
3517
  !1,
3648
3518
  null,
3649
- "14eecff1",
3650
- null,
3651
- null
3519
+ "ca5fe40e"
3652
3520
  );
3653
- const ve = me.exports;
3654
- const ye = {
3655
- name: "DenyAnswer",
3521
+ const ge = de.exports, pe = () => {
3522
+ const v = window.location.host.split(".");
3523
+ return v && v[0];
3524
+ }, me = pe() === "fortnox", ve = [
3525
+ "enjoyedExperience",
3526
+ // boolean value
3527
+ "whatToImprove"
3528
+ // string value
3529
+ ], we = {
3656
3530
  mixins: [ft([])],
3657
3531
  props: {
3658
- onCompleteFunc: {
3659
- type: Function,
3660
- default: null
3532
+ publicId: {
3533
+ type: String,
3534
+ default: ""
3661
3535
  }
3662
3536
  },
3663
3537
  data() {
3664
3538
  return {
3665
- rejectReason: ""
3539
+ page: "start",
3540
+ whatToImprove: ""
3666
3541
  };
3667
3542
  },
3543
+ created() {
3544
+ this.$nextTick(() => {
3545
+ this.startAnimation();
3546
+ });
3547
+ },
3668
3548
  methods: {
3669
- async submit({ update: v, answer: r }) {
3670
- const n = [];
3671
- this.rejectReason && n.push({
3672
- key: "unclear-other",
3673
- category: "misc",
3674
- description: this.rejectReason,
3675
- sentAt: this._document.lastSentAt
3676
- }), await v({ body: { "data.rejectReasons": n } }), await r({ body: { isAccepted: !1 } }), typeof this.onCompleteFunc == "function" && this.onCompleteFunc();
3549
+ async submitFeedback({ type: v, data: r }) {
3550
+ if (!this.publicId)
3551
+ throw Error("Missing param publicId");
3552
+ if (!v)
3553
+ throw Error("Missing param type");
3554
+ if (!ve.includes(v))
3555
+ throw Error("Invalid feedback type");
3556
+ if (!r)
3557
+ throw Error("Missing param data");
3558
+ let n = "positive";
3559
+ try {
3560
+ Dt.feedback(this.publicId, { type: v, data: r }), v === "enjoyedExperience" && !r.value && (n = "negative"), v === "whatToImprove" && (n = "negative.success"), me && n !== "negative" && (n = "custom");
3561
+ } catch (g) {
3562
+ Et(g, { showMessage: !1 });
3563
+ } finally {
3564
+ this.goTo(n);
3565
+ }
3566
+ },
3567
+ async goTo(v) {
3568
+ if (this.$emit("page", v), v === "positive" || v === "negative") {
3569
+ this.$refs.start.style.opacity = 0, this.page = "intermediate", setTimeout(() => {
3570
+ this.page = v;
3571
+ }, 2e3);
3572
+ return;
3573
+ }
3574
+ this.page = v;
3575
+ },
3576
+ startAnimation() {
3577
+ const v = this.$refs.feedbackBg;
3578
+ v.gradOneXPos = 0, v.gradOneYPos = 0, v.gradTwoXPos = 80, v.gradTwoYPos = 20, v.gradThreeXPos = 20, v.gradThreeYPos = 80, v.gradFourXPos = 80, v.gradFourYPos = 80, nt({
3579
+ targets: v,
3580
+ duration: 12e3,
3581
+ direction: "alternate",
3582
+ easing: "linear",
3583
+ loop: !0,
3584
+ gradOneXPos: [10, 5, 0, -10],
3585
+ gradOneYPos: [10, 20, 25, 30],
3586
+ gradTwoXPos: [25, 20, 15, 10, 25],
3587
+ gradTwoYPos: [65, 55, 40, 65, 80],
3588
+ gradThreeXPos: [25, 20, 10, 15, 25],
3589
+ gradThreeYPos: [65, 50, 45, 60, 80],
3590
+ gradFourXPos: [85, 80, 75, 70, 95],
3591
+ gradFourYPos: [90, 100, 120, 100, 85],
3592
+ update() {
3593
+ v.style.setProperty(
3594
+ "--gradOneXPos",
3595
+ `${v.gradOneXPos}%`
3596
+ ), v.style.setProperty(
3597
+ "--gradOneYPos",
3598
+ `${v.gradOneYPos}%`
3599
+ ), v.style.setProperty(
3600
+ "--gradTwoXPos",
3601
+ `${v.gradTwoXPos}%`
3602
+ ), v.style.setProperty(
3603
+ "--gradTwoYPos",
3604
+ `${v.gradTwoYPos}%`
3605
+ ), v.style.setProperty(
3606
+ "--gradThreeXPos",
3607
+ `${v.gradThreeXPos}%`
3608
+ ), v.style.setProperty(
3609
+ "--gradThreeYPos",
3610
+ `${v.gradThreeYPos}%`
3611
+ ), v.style.setProperty(
3612
+ "--gradFourXPos",
3613
+ `${v.gradFourXPos}%`
3614
+ ), v.style.setProperty(
3615
+ "--gradFourYPos",
3616
+ `${v.gradFourYPos}%`
3617
+ );
3618
+ }
3619
+ });
3620
+ },
3621
+ // animations
3622
+ leave(v, r) {
3623
+ nt({
3624
+ targets: v,
3625
+ // height: 0,
3626
+ // opacity: [1, 0],
3627
+ opacity: 0,
3628
+ duration: 500,
3629
+ easing: "easeInOutCubic",
3630
+ complete: r
3631
+ });
3632
+ },
3633
+ enter(v, r) {
3634
+ nt({
3635
+ targets: v,
3636
+ delay: this.page === "intermediate" ? 250 : 0,
3637
+ duration: 500,
3638
+ opacity: [0, 1],
3639
+ easing: "easeInOutCubic",
3640
+ complete: r
3641
+ });
3677
3642
  }
3678
3643
  }
3679
3644
  };
3680
- var we = function() {
3645
+ var ye = function() {
3681
3646
  var r = this, n = r._self._c;
3682
- return n("div", { staticClass: "text-left" }, [n("label", [r._v(r._s(r._document.$t("answerModal.decline.component.label")))]), n("CInput", { staticStyle: { "margin-bottom": "calc(1.5 * var(--rem))" }, attrs: { type: "textarea", filled: "", "custom-class": "decline-input" }, model: { value: r.rejectReason, callback: function(g) {
3683
- r.rejectReason = g;
3684
- }, expression: "rejectReason" } })], 1);
3647
+ return n("div", { staticClass: "f-feedback" }, [n("div", { ref: "feedbackBg", staticClass: "f-bg" }), n("div", { staticClass: "f-container" }, [n("transition", { attrs: { css: !1, mode: "out-in" }, on: { enter: r.enter, leave: r.leave } }, [r.page === "start" ? n("div", { key: "start", ref: "start", staticClass: "flex w-full flex-col items-center justify-center", staticStyle: { transition: "opacity 250ms" } }, [n("div", { staticStyle: { "padding-bottom": "calc(1.5 * var(--rem))", "font-size": "14px", "font-weight": "500" }, domProps: { textContent: r._s(r._document.$t("answerFeedback.start.title")) } }), n("div", [n("CButton", { staticClass: "feedback-btn", attrs: { "icon-left": "thumbsdown", size: "small", pattern: "secondary" }, on: { click: function(g) {
3648
+ return r.submitFeedback({
3649
+ type: "enjoyedExperience",
3650
+ data: { value: !1 }
3651
+ });
3652
+ } } }, [r._v(r._s(r._document.$t("answerFeedback.start.no")))]), n("CButton", { staticClass: "feedback-btn", staticStyle: { "margin-left": "calc(0.75 * var(--rem))" }, attrs: { "icon-left": "thumbsup", size: "small", pattern: "secondary" }, on: { click: function(g) {
3653
+ return r.submitFeedback({
3654
+ type: "enjoyedExperience",
3655
+ data: { value: !0 }
3656
+ });
3657
+ } } }, [r._v(r._s(r._document.$t("answerFeedback.start.yes")))])], 1)]) : r.page === "intermediate" ? n("div", { key: "intermediate", staticStyle: { height: "100%", display: "flex", "flex-direction": "column" } }, [n("div", { staticStyle: { flex: "1 1 auto", display: "flex", "flex-direction": "column", "justify-content": "center", "align-items": "center" } }, [n("div", { staticClass: "f-title", domProps: { textContent: r._s(r._document.$t("answerFeedback.intermediate.title")) } })])]) : r.page === "positive" ? n("div", { key: "positive", staticStyle: { height: "100%", display: "flex", "flex-direction": "column" } }, [n("div", { staticStyle: { flex: "1 1 auto", display: "flex", "flex-direction": "column", "justify-content": "center", "align-items": "center" } }, [n("div", { staticClass: "f-title", domProps: { textContent: r._s(r._document.$t("answerFeedback.yes.title")) } }), n("div", { domProps: { textContent: r._s(r._document.$t("answerFeedback.yes.text")) } })]), n("CButton", { staticClass: "a-btn", staticStyle: { "margin-bottom": "0.5em" }, attrs: { type: "secondary", wide: "", tag: "a", href: "/register?utm_source=document&utm_medium=feedback-modal&utm_campaign=signup&utm_content=positive-exp", target: "_blank" }, domProps: { textContent: r._s(r._document.$t("answerFeedback.yes.action")) } }), n("CButton", { staticClass: "a-btn", attrs: { wide: "", tag: "a", href: `https://${r.$t(
3658
+ "_common:brand.domain"
3659
+ )}?utm_source=document&utm_medium=feedback-modal&utm_campaign=learn-more&utm_content=positive-exp`, target: "_blank" }, domProps: { textContent: r._s(r._document.$t("answerFeedback.yes.secondary")) } })], 1) : r.page === "negative" ? n("div", { key: "negative", staticStyle: { height: "100%", display: "flex", "flex-direction": "column" } }, [n("div", { staticStyle: { flex: "1 1 auto", display: "flex", "flex-direction": "column", "justify-content": "center", "align-items": "center" } }, [n("div", { staticClass: "f-title", domProps: { textContent: r._s(r._document.$t("answerFeedback.no.start.title")) } }), n("div", { domProps: { textContent: r._s(r._document.$t("answerFeedback.no.start.text")) } }), n("CInput", { staticClass: "input-style", staticStyle: { margin: "2em 0" }, attrs: { placeholder: r._document.$t("answerFeedback.no.start.placeholder"), type: "textarea" }, model: { value: r.whatToImprove, callback: function(g) {
3660
+ r.whatToImprove = g;
3661
+ }, expression: "whatToImprove" } })], 1), n("CButton", { staticClass: "a-btn", attrs: { wide: "" }, domProps: { textContent: r._s(r._document.$t("answerFeedback.no.start.action")) }, on: { click: function(g) {
3662
+ return r.submitFeedback({
3663
+ type: "whatToImprove",
3664
+ data: { value: r.whatToImprove }
3665
+ });
3666
+ } } })], 1) : r.page === "negative.success" ? n("div", { key: "success", staticStyle: { height: "100%", display: "flex", "flex-direction": "column" } }, [n("div", { staticStyle: { flex: "1 1 auto", display: "flex", "flex-direction": "column", "justify-content": "center", "align-items": "center" } }, [n("div", { staticClass: "f-title", domProps: { textContent: r._s(r._document.$t("answerFeedback.no.success.title")) } }), n("div", { domProps: { textContent: r._s(r._document.$t("answerFeedback.no.success.text")) } })]), n("CButton", { staticClass: "a-btn", staticStyle: { "margin-bottom": "0.5em" }, attrs: { tag: "a", href: `https://${r.$t(
3667
+ "_common:brand.domain"
3668
+ )}?utm_source=document&utm_medium=feedback-modal&utm_campaign=learn-more&utm_content=negative-exp`, target: "_blank", wide: "", type: "secondary" }, domProps: { textContent: r._s(r._document.$t("answerFeedback.no.success.action")) } }), n("CButton", { staticClass: "a-btn", attrs: { wide: "" }, domProps: { textContent: r._s(r._document.$t("answerFeedback.no.success.secondary")) }, on: { click: function(g) {
3669
+ return r.$emit("close");
3670
+ } } })], 1) : r.page === "custom" ? n("div", { key: "success", staticStyle: { height: "100%", display: "flex", "flex-direction": "column" } }, [n("div", { staticStyle: { flex: "1 1 auto", display: "flex", "flex-direction": "column", "justify-content": "center", "align-items": "center" } }, [n("div", { staticClass: "f-title", domProps: { textContent: r._s(r._document.$t("answerFeedback.custom.title")) } }), n("div", { domProps: { textContent: r._s(r._document.$t("answerFeedback.custom.text")) } })]), n("CButton", { staticClass: "a-btn", attrs: { type: "secondary", wide: "" }, domProps: { textContent: r._s(r._document.$t("answerFeedback.custom.action")) }, on: { click: function(g) {
3671
+ return r.$emit("close");
3672
+ } } })], 1) : r._e()])], 1)]);
3685
3673
  }, xe = [], _e = /* @__PURE__ */ ot(
3686
- ye,
3687
3674
  we,
3675
+ ye,
3688
3676
  xe,
3689
3677
  !1,
3690
3678
  null,
3691
- null,
3692
- null,
3693
- null
3679
+ "a63fb6db"
3694
3680
  );
3695
- const Ee = _e.exports;
3696
- const Ce = {
3681
+ const Ce = _e.exports, Ee = {
3697
3682
  components: {
3698
- Feedback: Gt,
3699
- Signature: ue,
3700
- BankId: ve,
3701
- Deny: Ee
3683
+ Feedback: Ce,
3684
+ Signature: ge,
3685
+ BankId: Kt,
3686
+ Deny: qt
3702
3687
  },
3703
3688
  mixins: [ft([])],
3704
3689
  i18nOptions: {
@@ -3764,9 +3749,9 @@ const Ce = {
3764
3749
  },
3765
3750
  methods: {
3766
3751
  ...Ut({
3767
- answerCurrentDoc: wt.ANSWER_CURRENT_PUBLIC_DOCUMENT,
3768
- putCurrentDoc: wt.PUT_CURRENT_PUBLIC_DOCUMENT,
3769
- reloadCurrentDocument: wt.RELOAD_CURRENT_DOCUMENT
3752
+ answerCurrentDoc: yt.ANSWER_CURRENT_PUBLIC_DOCUMENT,
3753
+ putCurrentDoc: yt.PUT_CURRENT_PUBLIC_DOCUMENT,
3754
+ reloadCurrentDocument: yt.RELOAD_CURRENT_DOCUMENT
3770
3755
  }),
3771
3756
  async onSubmit() {
3772
3757
  this.setFixedHeight(), await this.submit();
@@ -3784,7 +3769,7 @@ const Ce = {
3784
3769
  ...this.isSender ? this.senderActions : null
3785
3770
  });
3786
3771
  } catch (v) {
3787
- this.isPosting = !1, v.httpStatusCode === 409 ? this.page = "versionError" : Ct(v);
3772
+ this.isPosting = !1, v.httpStatusCode === 409 ? this.page = "versionError" : Et(v);
3788
3773
  }
3789
3774
  }
3790
3775
  },
@@ -3869,18 +3854,16 @@ var be = function() {
3869
3854
  r.isPosting = u;
3870
3855
  } } }), n("div", { staticClass: "stagger-anim", staticStyle: { "padding-top": "3em" } }, [n("CButton", { staticClass: "a-btn", attrs: { loading: r.isPosting, disabled: r.actionInvalid, type: r.mode === "decline" ? "text" : "secondary", icon: r.answerType === "bankId" ? "bankId" : "" }, on: { click: r.onSubmit } }, [r._v(" " + r._s(r._document.$t(`answerModal.${r.answerType}.start.action`)) + " ")])], 1)], 1) : r.page === "intermediate" ? n("div", { key: "intermediate", staticClass: "flex w-full flex-grow flex-col items-center justify-center text-center", staticStyle: { height: "100%" } }, [n("div", { staticClass: "a-title stagger-anim", domProps: { textContent: r._s(r._document.$t("answerModal.answerSuccess")) } })]) : r.page === "success" ? n("div", { key: "success", staticClass: "flex w-full flex-grow flex-col", staticStyle: { height: "100%" } }, [n("transition", { attrs: { css: !1 }, on: { leave: r.minimizeHeight } }, [r.isFeedbackInitiated ? r._e() : n("div", { staticClass: "flex w-full flex-grow flex-col items-center justify-center", staticStyle: { overflow: "hidden" } }, [n("div", { staticClass: "root-padding flex w-full flex-col items-center justify-center", staticStyle: { height: "100%" } }, [n("div", { staticClass: "a-title stagger-anim", staticStyle: { padding: "calc(2.5 * var(--rem)) 0 calc(2 * var(--rem))" } }, [n("div", { domProps: { textContent: r._s(r.successStrings.title) } })]), n("div", { staticClass: "stagger-anim", domProps: { textContent: r._s(r.successStrings.text) } })])])]), n("Feedback", { ref: "feedback", staticClass: "stagger-anim", staticStyle: { flex: "0 0", overflow: "hidden", "min-height": "200px" }, attrs: { "public-id": (g = r._document.viewer) == null ? void 0 : g.publicDocumentId, _document: r._document }, on: { page: () => r.isFeedbackInitiated = !0, close: function(u) {
3871
3856
  return r.$emit("close");
3872
- } } })], 1) : r.page === "versionError" ? n("div", { key: "versionError", staticClass: "root-padding flex flex-grow flex-col items-center justify-center text-center" }, [n("div", { staticClass: "stagger-anim" }, [n("div", { staticClass: "flex items-center justify-center", staticStyle: { padding: "20px 0" } }, [n("div", { staticClass: "flex items-center justify-center", staticStyle: { width: "52px", height: "52px", "border-radius": "50%" } }, [n("BaseIcon", { attrs: { size: 30, type: "error" } })], 1)]), n("div", { staticClass: "a-title", domProps: { textContent: r._s(r._document.$t(`answerModal.versionError.${r.mode}.title`)) } }), n("div", { domProps: { textContent: r._s(r._document.$t("answerModal.versionError.text")) } })]), n("div", { staticClass: "stagger-anim", staticStyle: { "padding-top": "3em" } }, [n("CButton", { staticClass: "a-btn", attrs: { loading: r.isPosting, type: "none" }, on: { click: r.reload } }, [r._v(" " + r._s(r._document.$t("answerModal.versionError.btn")) + " ")])], 1)]) : r._e()], 1);
3857
+ } } })], 1) : r.page === "versionError" ? n("div", { key: "versionError", staticClass: "root-padding flex flex-grow flex-col items-center justify-center text-center" }, [n("div", { staticClass: "stagger-anim" }, [n("div", { staticClass: "flex items-center justify-center", staticStyle: { padding: "20px 0" } }, [n("div", { staticClass: "flex items-center justify-center", staticStyle: { width: "52px", height: "52px", "border-radius": "50%" } }, [n("CIcon", { attrs: { size: 30, type: "error" } })], 1)]), n("div", { staticClass: "a-title", domProps: { textContent: r._s(r._document.$t(`answerModal.versionError.${r.mode}.title`)) } }), n("div", { domProps: { textContent: r._s(r._document.$t("answerModal.versionError.text")) } })]), n("div", { staticClass: "stagger-anim", staticStyle: { "padding-top": "3em" } }, [n("CButton", { staticClass: "a-btn", attrs: { loading: r.isPosting, type: "none" }, on: { click: r.reload } }, [r._v(" " + r._s(r._document.$t("answerModal.versionError.btn")) + " ")])], 1)]) : r._e()], 1);
3873
3858
  }, Pe = [], Se = /* @__PURE__ */ ot(
3874
- Ce,
3859
+ Ee,
3875
3860
  be,
3876
3861
  Pe,
3877
3862
  !1,
3878
3863
  null,
3879
- "9406fef1",
3880
- null,
3881
- null
3864
+ "e9b32dd5"
3882
3865
  );
3883
- const Re = Se.exports;
3866
+ const Me = Se.exports;
3884
3867
  export {
3885
- Re as default
3868
+ Me as default
3886
3869
  };