@cling-se/widget 0.22.3 → 0.23.0
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.
- package/CHANGELOG.md +22 -0
- package/dist/{AddClientCallout-Bk_RMqww.js → AddClientCallout-Bv6IKK40.js} +6 -6
- package/dist/AnswerModal-BH7HUCFy.js +4511 -0
- package/dist/{AttachmentItem-DnlOo6Ar.js → AttachmentItem-DVVxOm2E.js} +6 -6
- package/dist/{BaseUpload-DCPt9YUo.js → BaseUpload-B8k82P27.js} +2 -2
- package/dist/{BlockMedia-najJzMYF.js → BlockMedia-BcvfBi4G.js} +4 -4
- package/dist/{CCallout-DCvCm65V.js → CCallout-BbBdzwkb.js} +3 -3
- package/dist/{CCurrencyDropdown-DuJxa77L.js → CCurrencyDropdown-2PRaeJHp.js} +5 -5
- package/dist/{CDropdownItem-DyWrpOb-.js → CDropdownItem-CFTdvAJc.js} +13 -13
- package/dist/{CFormField.vue_vue_type_script_setup_true_lang-CSMB_HdZ.js → CFormField.vue_vue_type_script_setup_true_lang-B0HHxy2B.js} +7 -7
- package/dist/{CPhoneFormat-BmGCMx5K.js → CPhoneFormat-D__bIItZ.js} +1 -1
- package/dist/{regions-BdZt9Srn.js → CPhoneInput-DPqzQOjR.js} +205 -3
- package/dist/{CPriceInput-BwBsHKnn.js → CPriceInput-BJ1hmANq.js} +4 -4
- package/dist/{CSelect-BlPNOr_g.js → CSelect-GhGdyQzt.js} +4 -4
- package/dist/{CSkeleton-DRbFIBZS.js → CSkeleton-Ro7hmy5_.js} +5 -5
- package/dist/{ClientAutocomplete-DS08QQ5C.js → ClientAutocomplete-Ci08U3Eg.js} +10 -10
- package/dist/{ClientModal-DXtdxLj9.js → ClientModal-CZjzCgw_.js} +251 -221
- package/dist/{ColorPicker-CeJ8YHt-.js → ColorPicker-Bdev0Tci.js} +27 -27
- package/dist/{CompanyModal-DzE3OIG0.js → CompanyModal-vZnMCWG-.js} +8 -8
- package/dist/{ContentWrapper-CBd8srOJ.js → ContentWrapper-CAlHzSsP.js} +18 -18
- package/dist/{CoverBlockSettings-D9K1BnJk.js → CoverBlockSettings-CRG8Q2mD.js} +42 -42
- package/dist/{DocAnswer-By6hA4eC.js → DocAnswer-DHVVPZff.js} +2 -2
- package/dist/{DocDetails-C-ZRzvrA.js → DocDetails-W4sRFsQP.js} +8 -8
- package/dist/{DocForm-DvT2fhEM.js → DocForm-B0HWL32c.js} +853 -757
- package/dist/{DocFormSend-CKeZn--O.js → DocFormSend-BHjoq88x.js} +2 -2
- package/dist/{DocLinks-w8pfegGu.js → DocLinks-BKJ_usNd.js} +2 -2
- package/dist/{DocModalBase-B2IgIy_9.js → DocModalBase-Z1ZEPL_z.js} +1 -1
- package/dist/{DocPrint-eUTCgg8g.js → DocPrint-W53zklGf.js} +3 -3
- package/dist/{DocReceipt-BD0WVtId.js → DocReceipt-CG954L85.js} +10 -10
- package/dist/{DocSendReminder-EjkK-9rh.js → DocSendReminder-rE0hlFaZ.js} +3 -3
- package/dist/{DocTextEditor-U8ZdSDAr.js → DocTextEditor-DwYMXhZv.js} +9 -9
- package/dist/{DocTimeline-D30HTE_o.js → DocTimeline-BsvUw4lW.js} +17 -17
- package/dist/{DocumentClient-BBEmQHMi.js → DocumentClient-DeDGrmbP.js} +5 -5
- package/dist/{DocumentLayout-BLeVh3wu.js → DocumentLayout-DdXflWEb.js} +28 -28
- package/dist/{DocumentLogotype-BauCUJ8j.js → DocumentLogotype-eSStO83t.js} +3 -3
- package/dist/{DocumentVoided-CfQdzPJa.js → DocumentVoided-CF_snlgf.js} +1 -1
- package/dist/{EmbedInput-D4QrX2Gm.js → EmbedInput-C6zvXcOu.js} +5 -5
- package/dist/{EmbedSettings-DVZLouo9.js → EmbedSettings-BO0wk_Mz.js} +3 -3
- package/dist/{ErrorCallout-BiLLFJek.js → ErrorCallout-BX44gJMR.js} +1 -1
- package/dist/{FilePreviewModal-BusalEt3.js → FilePreviewModal-Dl9kL1D4.js} +2 -2
- package/dist/{Flag-BxkDKlP4.js → Flag-CUjMh16L.js} +1 -1
- package/dist/{HeaderSettings-DIWro6fR.js → HeaderSettings-CGAKOOf2.js} +18 -18
- package/dist/{ImageSelectModal-CL52MP8Z.js → ImageSelectModal-CBJLdDWY.js} +3 -3
- package/dist/{ImageUploadWrapper-2gjzeenp.js → ImageUploadWrapper-3iw_ifJm.js} +2 -2
- package/dist/{Index-qcFSIYDB.js → Index--LhQAU0e.js} +4 -4
- package/dist/{Index-m_q4QkfZ.js → Index-B9IVTM-6.js} +4 -4
- package/dist/{Index-bKQSbdxw.js → Index-BHc8-EVf.js} +2 -2
- package/dist/{Index-qzpjRFUp.js → Index-BKdt7W1p.js} +11 -11
- package/dist/{Index-DMEoYhVr.js → Index-BQjcDZPz.js} +8 -8
- package/dist/{Index-CcZ48rLC.js → Index-BXgbccOo.js} +2 -2
- package/dist/{Index-CQzTAmTM.js → Index-Bc75-4Ee.js} +41 -41
- package/dist/{Index-Bge6Bknk.js → Index-Bf6twTPv.js} +1 -1
- package/dist/{Index-jXUY8fSe.js → Index-BwyxrAfq.js} +2 -2
- package/dist/{Index-DYkWCXz0.js → Index-CFk1oikV.js} +5 -5
- package/dist/{Index-4FHzyecP.js → Index-CRPvQg7m.js} +4 -4
- package/dist/{Index-CZljdL3w.js → Index-CZLo46BA.js} +2 -2
- package/dist/{Index-CtRE9_p3.js → Index-Cay1MsI0.js} +4 -4
- package/dist/{Index-CSNH8muS.js → Index-CbJAROk-.js} +6 -6
- package/dist/{Index-DjMRBozk.js → Index-Ck3YMDt4.js} +14 -14
- package/dist/{Index-Cq90eS9E.js → Index-CmtHodVa.js} +7 -7
- package/dist/{Index-CuaK6bnN.js → Index-Cv-ZmqIf.js} +19 -19
- package/dist/Index-D3GyeaZ3.js +4 -0
- package/dist/{Index-CsLEoK-y.js → Index-D3YAyImu.js} +3 -3
- package/dist/{Index-Cen56jNO.js → Index-D48EyoXi.js} +4 -4
- package/dist/{Index-DO0vFJCv.js → Index-DDTMR3LI.js} +6 -6
- package/dist/{Index--EACh-v2.js → Index-DExnFebC.js} +30 -30
- package/dist/{Index-FSjvo5ex.js → Index-DRNXEsk-.js} +5 -5
- package/dist/{Index-u00PSjX2.js → Index-DUvA8MIy.js} +3 -3
- package/dist/{Index-CcKgWOG7.js → Index-DaOOJQM2.js} +3 -3
- package/dist/{Index-DQMuQ2js.js → Index-DlWc7i0k.js} +4 -4
- package/dist/{Index-BkMzG22-.js → Index-Dttziehp.js} +11 -11
- package/dist/{Index-N-TCcUiZ.js → Index-T6kXb5Sf.js} +5 -5
- package/dist/{Index-DxWtScO2.js → Index-_Xoo1bdc.js} +3 -3
- package/dist/{Index-CJZBOrgw.js → Index-foC5v_3Y.js} +3 -3
- package/dist/{Index-Bn8_-gUC.js → Index-gLA2kURi.js} +4 -4
- package/dist/{Index-DdfunbXo.js → Index-gOnXhVx4.js} +7 -7
- package/dist/{Index-BPuHAiJR.js → Index-j78ap3EU.js} +3 -3
- package/dist/{Index-BcIg-95c.js → Index-qAnbtxTE.js} +7 -7
- package/dist/{Index.vue_vue_type_script_lang-MIgEx7dJ.js → Index.vue_vue_type_script_lang-DkStHbk0.js} +2 -2
- package/dist/{InputToggleRow-Dv5l7HsH.js → InputToggleRow-COQQQaJS.js} +1 -1
- package/dist/{ManualPopover-B-VE0HPu.js → ManualPopover-2myYukDY.js} +3 -3
- package/dist/{MediaWrapper-m5wr6sG8.js → MediaWrapper-CzLU8HWj.js} +3 -3
- package/dist/{NotBindingText-JKkfTNyO.js → NotBindingText-Ds156Rs5.js} +2 -2
- package/dist/{PackageGroup-CXZ0Lsz9.js → PackageGroup-wT1ri3ij.js} +9 -9
- package/dist/{PdfTerms-Cb_px74_.js → PdfTerms-CcFpPx19.js} +2 -2
- package/dist/{PdfViewer-1OOdNeVT.js → PdfViewer-B7qdDox0.js} +24 -24
- package/dist/{PlainHtml.vue_vue_type_script_setup_true_lang-C12eZIH1.js → PlainHtml.vue_vue_type_script_setup_true_lang-pAIAnHdh.js} +1 -1
- package/dist/{PriceHeader-BzPZtNYJ.js → PriceHeader-CdJspOjM.js} +12 -12
- package/dist/{SearchApi-CBg1KY-O.js → SearchApi-zTefPc4C.js} +3 -3
- package/dist/{SendForm-C-VTNpve.js → SendForm-DWiNVIs2.js} +8 -8
- package/dist/{Setup-BmlGbBrM.js → Setup-D90T_HW3.js} +1 -1
- package/dist/{SmartList-B2ZpLA8V.js → SmartList-mO6hykju.js} +1 -1
- package/dist/{Sortable.vue_vue_type_script_setup_true_lang-CcTjzIyK.js → Sortable.vue_vue_type_script_setup_true_lang-D22AqpXY.js} +35 -35
- package/dist/{TermsSettings-0V_cVRPI.js → TermsSettings-CW4GvPBa.js} +14 -14
- package/dist/{ThemeColorRow-BwSFCUGN.js → ThemeColorRow-C9XPet4I.js} +5 -5
- package/dist/{ToggleBinding-sJX5jVgf.js → ToggleBinding-5Ewi_NNo.js} +5 -5
- package/dist/{UploadModal-CvFB_11W.js → UploadModal-ChOeO-8_.js} +4 -4
- package/dist/{VideoPlayerInput-CmjzzRDj.js → VideoPlayerInput-CtZi6yF_.js} +6 -6
- package/dist/{VideoPlayerSettings-TD3__Ui0.js → VideoPlayerSettings-Bg8IvjwK.js} +2 -2
- package/dist/{VideoSelectModal-DWohaFSL.js → VideoSelectModal-E01NsD3K.js} +5 -5
- package/dist/{dom-DOcGU3-g.js → dom-B_lSczxY.js} +5 -6
- package/dist/{focusDrawerMixin-CReYj2SY.js → focusDrawerMixin-DfuFLIV0.js} +1 -1
- package/dist/{formDrawerState-Cf5itKVM.js → formDrawerState-DlaQS_ZT.js} +1 -1
- package/dist/{fortnoxTheme-IeycOfWB.js → fortnoxTheme-CyUIkVuu.js} +1 -1
- package/dist/{helpers-CUo71XPG.js → helpers-B1vYJYc-.js} +1 -1
- package/dist/{index-DzyXygjd.js → index-BPR1VsLM.js} +1 -1
- package/dist/{index-MMzIZOFI.js → index-CBkI7Hc7.js} +28 -28
- package/dist/index-CXYvBw0i.js +107 -0
- package/dist/index-DK3w2fdd.js +896 -0
- package/dist/{index-BEKHEkFO.js → index-DOK_hQri.js} +28 -28
- package/dist/{index-FsgsKPqg.js → index-DnMhYLAz.js} +1 -1
- package/dist/{index-CrQzVsCT.js → index-hj2QoJyP.js} +8 -8
- package/dist/index.es.js +2 -2
- package/dist/index.umd.js +191 -235
- package/dist/{main-D4afcIIy.js → main-BnJTDeKH.js} +12149 -14255
- package/dist/{mapFormMixin-DcTZ2NvY.js → mapFormMixin-sXjgYtfb.js} +2 -2
- package/dist/{omit-Bq20xrhI.js → omit-DQlOTuQS.js} +1 -1
- package/dist/{splitpanes-EHoHU6iQ.js → splitpanes-4FF5o_FM.js} +1 -1
- package/dist/{template-CDxtqtv6.js → template-dbF0t2om.js} +1 -1
- package/dist/{tippy.esm-D8I3Noyw.js → tippy.esm-Bu14Lq2S.js} +50 -50
- package/dist/{useTermsModal-DEiH4ghd.js → useTermsModal-DKiiU8a4.js} +4 -4
- package/dist/{utils-DvezupAT.js → utils-Dn9pHgbx.js} +1 -1
- package/dist/{validation-ERFxig5z.js → validation-D_KP2hMr.js} +3 -3
- package/dist/widget.css +1 -1
- package/package.json +1 -1
- package/dist/AnswerModal-BQ9VR89q.js +0 -3653
- package/dist/CPhoneInput-Cx3OiUWQ.js +0 -207
- package/dist/Index-DdSDsjP8.js +0 -4
- package/dist/anime.es-4wvNItHq.js +0 -862
- package/dist/index-CFm8CNEc.js +0 -149
- package/dist/index-DCq6gjGI.js +0 -3590
- package/dist/validations-ohsJ5nBz.js +0 -34
|
@@ -0,0 +1,4511 @@
|
|
|
1
|
+
import { m as dt } from "./mapFormMixin-sXjgYtfb.js";
|
|
2
|
+
import { $ as Mn, aj as re, _ as ht, P as sn, l as bt, cV as ie, aC as wt, d8 as on, b as U, d as R, o as B, j as P, e as N, f as F, F as lt, c as ut, w as j, t as D, s as Z, al as Pt, d9 as In, da as an, v as An, y as Ce, x as Dn, db as Bn, m as Fn, g as Mt, ap as Ln, cm as Rn, h as _e, ay as xe } from "./main-BnJTDeKH.js";
|
|
3
|
+
import { _ as $n } from "./CFormField.vue_vue_type_script_setup_true_lang-B0HHxy2B.js";
|
|
4
|
+
import { i as Nn } from "./fortnoxTheme-CyUIkVuu.js";
|
|
5
|
+
var cn = {
|
|
6
|
+
update: null,
|
|
7
|
+
begin: null,
|
|
8
|
+
loopBegin: null,
|
|
9
|
+
changeBegin: null,
|
|
10
|
+
change: null,
|
|
11
|
+
changeComplete: null,
|
|
12
|
+
loopComplete: null,
|
|
13
|
+
complete: null,
|
|
14
|
+
loop: 1,
|
|
15
|
+
direction: "normal",
|
|
16
|
+
autoplay: !0,
|
|
17
|
+
timelineOffset: 0
|
|
18
|
+
}, ce = {
|
|
19
|
+
duration: 1e3,
|
|
20
|
+
delay: 0,
|
|
21
|
+
endDelay: 0,
|
|
22
|
+
easing: "easeOutElastic(1, .5)",
|
|
23
|
+
round: 0
|
|
24
|
+
}, Un = ["translateX", "translateY", "translateZ", "rotate", "rotateX", "rotateY", "rotateZ", "scale", "scaleX", "scaleY", "scaleZ", "skew", "skewX", "skewY", "perspective", "matrix", "matrix3d"], Ct = {
|
|
25
|
+
CSS: {},
|
|
26
|
+
springs: {}
|
|
27
|
+
};
|
|
28
|
+
function V(t, e, i) {
|
|
29
|
+
return Math.min(Math.max(t, e), i);
|
|
30
|
+
}
|
|
31
|
+
function mt(t, e) {
|
|
32
|
+
return t.indexOf(e) > -1;
|
|
33
|
+
}
|
|
34
|
+
function It(t, e) {
|
|
35
|
+
return t.apply(null, e);
|
|
36
|
+
}
|
|
37
|
+
var k = {
|
|
38
|
+
arr: function(t) {
|
|
39
|
+
return Array.isArray(t);
|
|
40
|
+
},
|
|
41
|
+
obj: function(t) {
|
|
42
|
+
return mt(Object.prototype.toString.call(t), "Object");
|
|
43
|
+
},
|
|
44
|
+
pth: function(t) {
|
|
45
|
+
return k.obj(t) && t.hasOwnProperty("totalLength");
|
|
46
|
+
},
|
|
47
|
+
svg: function(t) {
|
|
48
|
+
return t instanceof SVGElement;
|
|
49
|
+
},
|
|
50
|
+
inp: function(t) {
|
|
51
|
+
return t instanceof HTMLInputElement;
|
|
52
|
+
},
|
|
53
|
+
dom: function(t) {
|
|
54
|
+
return t.nodeType || k.svg(t);
|
|
55
|
+
},
|
|
56
|
+
str: function(t) {
|
|
57
|
+
return typeof t == "string";
|
|
58
|
+
},
|
|
59
|
+
fnc: function(t) {
|
|
60
|
+
return typeof t == "function";
|
|
61
|
+
},
|
|
62
|
+
und: function(t) {
|
|
63
|
+
return typeof t > "u";
|
|
64
|
+
},
|
|
65
|
+
nil: function(t) {
|
|
66
|
+
return k.und(t) || t === null;
|
|
67
|
+
},
|
|
68
|
+
hex: function(t) {
|
|
69
|
+
return /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(t);
|
|
70
|
+
},
|
|
71
|
+
rgb: function(t) {
|
|
72
|
+
return /^rgb/.test(t);
|
|
73
|
+
},
|
|
74
|
+
hsl: function(t) {
|
|
75
|
+
return /^hsl/.test(t);
|
|
76
|
+
},
|
|
77
|
+
col: function(t) {
|
|
78
|
+
return k.hex(t) || k.rgb(t) || k.hsl(t);
|
|
79
|
+
},
|
|
80
|
+
key: function(t) {
|
|
81
|
+
return !cn.hasOwnProperty(t) && !ce.hasOwnProperty(t) && t !== "targets" && t !== "keyframes";
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
function ln(t) {
|
|
85
|
+
var e = /\(([^)]+)\)/.exec(t);
|
|
86
|
+
return e ? e[1].split(",").map(function(i) {
|
|
87
|
+
return parseFloat(i);
|
|
88
|
+
}) : [];
|
|
89
|
+
}
|
|
90
|
+
function un(t, e) {
|
|
91
|
+
var i = ln(t), r = V(k.und(i[0]) ? 1 : i[0], 0.1, 100), n = V(k.und(i[1]) ? 100 : i[1], 0.1, 100), s = V(k.und(i[2]) ? 10 : i[2], 0.1, 100), a = V(k.und(i[3]) ? 0 : i[3], 0.1, 100), c = Math.sqrt(n / r), o = s / (2 * Math.sqrt(n * r)), u = o < 1 ? c * Math.sqrt(1 - o * o) : 0, l = 1, d = o < 1 ? (o * c + -a) / u : -a + c;
|
|
92
|
+
function g(m) {
|
|
93
|
+
var f = e ? e * m / 1e3 : m;
|
|
94
|
+
return o < 1 ? f = Math.exp(-f * o * c) * (l * Math.cos(u * f) + d * Math.sin(u * f)) : f = (l + d * f) * Math.exp(-f * c), m === 0 || m === 1 ? m : 1 - f;
|
|
95
|
+
}
|
|
96
|
+
function h() {
|
|
97
|
+
var m = Ct.springs[t];
|
|
98
|
+
if (m)
|
|
99
|
+
return m;
|
|
100
|
+
for (var f = 1 / 6, I = 0, w = 0; ; )
|
|
101
|
+
if (I += f, g(I) === 1) {
|
|
102
|
+
if (w++, w >= 16)
|
|
103
|
+
break;
|
|
104
|
+
} else
|
|
105
|
+
w = 0;
|
|
106
|
+
var v = I * f * 1e3;
|
|
107
|
+
return Ct.springs[t] = v, v;
|
|
108
|
+
}
|
|
109
|
+
return e ? g : h;
|
|
110
|
+
}
|
|
111
|
+
function jn(t) {
|
|
112
|
+
return t === void 0 && (t = 10), function(e) {
|
|
113
|
+
return Math.ceil(V(e, 1e-6, 1) * t) * (1 / t);
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
var On = function() {
|
|
117
|
+
var t = 11, e = 1 / (t - 1);
|
|
118
|
+
function i(l, d) {
|
|
119
|
+
return 1 - 3 * d + 3 * l;
|
|
120
|
+
}
|
|
121
|
+
function r(l, d) {
|
|
122
|
+
return 3 * d - 6 * l;
|
|
123
|
+
}
|
|
124
|
+
function n(l) {
|
|
125
|
+
return 3 * l;
|
|
126
|
+
}
|
|
127
|
+
function s(l, d, g) {
|
|
128
|
+
return ((i(d, g) * l + r(d, g)) * l + n(d)) * l;
|
|
129
|
+
}
|
|
130
|
+
function a(l, d, g) {
|
|
131
|
+
return 3 * i(d, g) * l * l + 2 * r(d, g) * l + n(d);
|
|
132
|
+
}
|
|
133
|
+
function c(l, d, g, h, m) {
|
|
134
|
+
var f, I, w = 0;
|
|
135
|
+
do
|
|
136
|
+
I = d + (g - d) / 2, f = s(I, h, m) - l, f > 0 ? g = I : d = I;
|
|
137
|
+
while (Math.abs(f) > 1e-7 && ++w < 10);
|
|
138
|
+
return I;
|
|
139
|
+
}
|
|
140
|
+
function o(l, d, g, h) {
|
|
141
|
+
for (var m = 0; m < 4; ++m) {
|
|
142
|
+
var f = a(d, g, h);
|
|
143
|
+
if (f === 0)
|
|
144
|
+
return d;
|
|
145
|
+
var I = s(d, g, h) - l;
|
|
146
|
+
d -= I / f;
|
|
147
|
+
}
|
|
148
|
+
return d;
|
|
149
|
+
}
|
|
150
|
+
function u(l, d, g, h) {
|
|
151
|
+
if (!(0 <= l && l <= 1 && 0 <= g && g <= 1))
|
|
152
|
+
return;
|
|
153
|
+
var m = new Float32Array(t);
|
|
154
|
+
if (l !== d || g !== h)
|
|
155
|
+
for (var f = 0; f < t; ++f)
|
|
156
|
+
m[f] = s(f * e, l, g);
|
|
157
|
+
function I(w) {
|
|
158
|
+
for (var v = 0, p = 1, _ = t - 1; p !== _ && m[p] <= w; ++p)
|
|
159
|
+
v += e;
|
|
160
|
+
--p;
|
|
161
|
+
var $ = (w - m[p]) / (m[p + 1] - m[p]), y = v + $ * e, T = a(y, l, g);
|
|
162
|
+
return T >= 1e-3 ? o(w, y, l, g) : T === 0 ? y : c(w, v, v + e, l, g);
|
|
163
|
+
}
|
|
164
|
+
return function(w) {
|
|
165
|
+
return l === d && g === h || w === 0 || w === 1 ? w : s(I(w), d, h);
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
return u;
|
|
169
|
+
}(), dn = function() {
|
|
170
|
+
var t = { linear: function() {
|
|
171
|
+
return function(r) {
|
|
172
|
+
return r;
|
|
173
|
+
};
|
|
174
|
+
} }, e = {
|
|
175
|
+
Sine: function() {
|
|
176
|
+
return function(r) {
|
|
177
|
+
return 1 - Math.cos(r * Math.PI / 2);
|
|
178
|
+
};
|
|
179
|
+
},
|
|
180
|
+
Expo: function() {
|
|
181
|
+
return function(r) {
|
|
182
|
+
return r ? Math.pow(2, 10 * r - 10) : 0;
|
|
183
|
+
};
|
|
184
|
+
},
|
|
185
|
+
Circ: function() {
|
|
186
|
+
return function(r) {
|
|
187
|
+
return 1 - Math.sqrt(1 - r * r);
|
|
188
|
+
};
|
|
189
|
+
},
|
|
190
|
+
Back: function() {
|
|
191
|
+
return function(r) {
|
|
192
|
+
return r * r * (3 * r - 2);
|
|
193
|
+
};
|
|
194
|
+
},
|
|
195
|
+
Bounce: function() {
|
|
196
|
+
return function(r) {
|
|
197
|
+
for (var n, s = 4; r < ((n = Math.pow(2, --s)) - 1) / 11; )
|
|
198
|
+
;
|
|
199
|
+
return 1 / Math.pow(4, 3 - s) - 7.5625 * Math.pow((n * 3 - 2) / 22 - r, 2);
|
|
200
|
+
};
|
|
201
|
+
},
|
|
202
|
+
Elastic: function(r, n) {
|
|
203
|
+
r === void 0 && (r = 1), n === void 0 && (n = 0.5);
|
|
204
|
+
var s = V(r, 1, 10), a = V(n, 0.1, 2);
|
|
205
|
+
return function(c) {
|
|
206
|
+
return c === 0 || c === 1 ? c : -s * Math.pow(2, 10 * (c - 1)) * Math.sin((c - 1 - a / (Math.PI * 2) * Math.asin(1 / s)) * (Math.PI * 2) / a);
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
}, i = ["Quad", "Cubic", "Quart", "Quint"];
|
|
210
|
+
return i.forEach(function(r, n) {
|
|
211
|
+
e[r] = function() {
|
|
212
|
+
return function(s) {
|
|
213
|
+
return Math.pow(s, n + 2);
|
|
214
|
+
};
|
|
215
|
+
};
|
|
216
|
+
}), Object.keys(e).forEach(function(r) {
|
|
217
|
+
var n = e[r];
|
|
218
|
+
t["easeIn" + r] = n, t["easeOut" + r] = function(s, a) {
|
|
219
|
+
return function(c) {
|
|
220
|
+
return 1 - n(s, a)(1 - c);
|
|
221
|
+
};
|
|
222
|
+
}, t["easeInOut" + r] = function(s, a) {
|
|
223
|
+
return function(c) {
|
|
224
|
+
return c < 0.5 ? n(s, a)(c * 2) / 2 : 1 - n(s, a)(c * -2 + 2) / 2;
|
|
225
|
+
};
|
|
226
|
+
}, t["easeOutIn" + r] = function(s, a) {
|
|
227
|
+
return function(c) {
|
|
228
|
+
return c < 0.5 ? (1 - n(s, a)(1 - c * 2)) / 2 : (n(s, a)(c * 2 - 1) + 1) / 2;
|
|
229
|
+
};
|
|
230
|
+
};
|
|
231
|
+
}), t;
|
|
232
|
+
}();
|
|
233
|
+
function le(t, e) {
|
|
234
|
+
if (k.fnc(t))
|
|
235
|
+
return t;
|
|
236
|
+
var i = t.split("(")[0], r = dn[i], n = ln(t);
|
|
237
|
+
switch (i) {
|
|
238
|
+
case "spring":
|
|
239
|
+
return un(t, e);
|
|
240
|
+
case "cubicBezier":
|
|
241
|
+
return It(On, n);
|
|
242
|
+
case "steps":
|
|
243
|
+
return It(jn, n);
|
|
244
|
+
default:
|
|
245
|
+
return It(r, n);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
function hn(t) {
|
|
249
|
+
try {
|
|
250
|
+
var e = document.querySelectorAll(t);
|
|
251
|
+
return e;
|
|
252
|
+
} catch {
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
function Et(t, e) {
|
|
257
|
+
for (var i = t.length, r = arguments.length >= 2 ? arguments[1] : void 0, n = [], s = 0; s < i; s++)
|
|
258
|
+
if (s in t) {
|
|
259
|
+
var a = t[s];
|
|
260
|
+
e.call(r, a, s, t) && n.push(a);
|
|
261
|
+
}
|
|
262
|
+
return n;
|
|
263
|
+
}
|
|
264
|
+
function Tt(t) {
|
|
265
|
+
return t.reduce(function(e, i) {
|
|
266
|
+
return e.concat(k.arr(i) ? Tt(i) : i);
|
|
267
|
+
}, []);
|
|
268
|
+
}
|
|
269
|
+
function be(t) {
|
|
270
|
+
return k.arr(t) ? t : (k.str(t) && (t = hn(t) || t), t instanceof NodeList || t instanceof HTMLCollection ? [].slice.call(t) : [t]);
|
|
271
|
+
}
|
|
272
|
+
function ue(t, e) {
|
|
273
|
+
return t.some(function(i) {
|
|
274
|
+
return i === e;
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
function de(t) {
|
|
278
|
+
var e = {};
|
|
279
|
+
for (var i in t)
|
|
280
|
+
e[i] = t[i];
|
|
281
|
+
return e;
|
|
282
|
+
}
|
|
283
|
+
function se(t, e) {
|
|
284
|
+
var i = de(t);
|
|
285
|
+
for (var r in t)
|
|
286
|
+
i[r] = e.hasOwnProperty(r) ? e[r] : t[r];
|
|
287
|
+
return i;
|
|
288
|
+
}
|
|
289
|
+
function kt(t, e) {
|
|
290
|
+
var i = de(t);
|
|
291
|
+
for (var r in e)
|
|
292
|
+
i[r] = k.und(t[r]) ? e[r] : t[r];
|
|
293
|
+
return i;
|
|
294
|
+
}
|
|
295
|
+
function qn(t) {
|
|
296
|
+
var e = /rgb\((\d+,\s*[\d]+,\s*[\d]+)\)/g.exec(t);
|
|
297
|
+
return e ? "rgba(" + e[1] + ",1)" : t;
|
|
298
|
+
}
|
|
299
|
+
function zn(t) {
|
|
300
|
+
var e = /^#?([a-f\d])([a-f\d])([a-f\d])$/i, i = t.replace(e, function(c, o, u, l) {
|
|
301
|
+
return o + o + u + u + l + l;
|
|
302
|
+
}), r = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(i), n = parseInt(r[1], 16), s = parseInt(r[2], 16), a = parseInt(r[3], 16);
|
|
303
|
+
return "rgba(" + n + "," + s + "," + a + ",1)";
|
|
304
|
+
}
|
|
305
|
+
function Vn(t) {
|
|
306
|
+
var e = /hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(t) || /hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)/g.exec(t), i = parseInt(e[1], 10) / 360, r = parseInt(e[2], 10) / 100, n = parseInt(e[3], 10) / 100, s = e[4] || 1;
|
|
307
|
+
function a(g, h, m) {
|
|
308
|
+
return m < 0 && (m += 1), m > 1 && (m -= 1), m < 1 / 6 ? g + (h - g) * 6 * m : m < 1 / 2 ? h : m < 2 / 3 ? g + (h - g) * (2 / 3 - m) * 6 : g;
|
|
309
|
+
}
|
|
310
|
+
var c, o, u;
|
|
311
|
+
if (r == 0)
|
|
312
|
+
c = o = u = n;
|
|
313
|
+
else {
|
|
314
|
+
var l = n < 0.5 ? n * (1 + r) : n + r - n * r, d = 2 * n - l;
|
|
315
|
+
c = a(d, l, i + 1 / 3), o = a(d, l, i), u = a(d, l, i - 1 / 3);
|
|
316
|
+
}
|
|
317
|
+
return "rgba(" + c * 255 + "," + o * 255 + "," + u * 255 + "," + s + ")";
|
|
318
|
+
}
|
|
319
|
+
function Wn(t) {
|
|
320
|
+
if (k.rgb(t))
|
|
321
|
+
return qn(t);
|
|
322
|
+
if (k.hex(t))
|
|
323
|
+
return zn(t);
|
|
324
|
+
if (k.hsl(t))
|
|
325
|
+
return Vn(t);
|
|
326
|
+
}
|
|
327
|
+
function G(t) {
|
|
328
|
+
var e = /[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(t);
|
|
329
|
+
if (e)
|
|
330
|
+
return e[1];
|
|
331
|
+
}
|
|
332
|
+
function Hn(t) {
|
|
333
|
+
if (mt(t, "translate") || t === "perspective")
|
|
334
|
+
return "px";
|
|
335
|
+
if (mt(t, "rotate") || mt(t, "skew"))
|
|
336
|
+
return "deg";
|
|
337
|
+
}
|
|
338
|
+
function oe(t, e) {
|
|
339
|
+
return k.fnc(t) ? t(e.target, e.id, e.total) : t;
|
|
340
|
+
}
|
|
341
|
+
function W(t, e) {
|
|
342
|
+
return t.getAttribute(e);
|
|
343
|
+
}
|
|
344
|
+
function he(t, e, i) {
|
|
345
|
+
var r = G(e);
|
|
346
|
+
if (ue([i, "deg", "rad", "turn"], r))
|
|
347
|
+
return e;
|
|
348
|
+
var n = Ct.CSS[e + i];
|
|
349
|
+
if (!k.und(n))
|
|
350
|
+
return n;
|
|
351
|
+
var s = 100, a = document.createElement(t.tagName), c = t.parentNode && t.parentNode !== document ? t.parentNode : document.body;
|
|
352
|
+
c.appendChild(a), a.style.position = "absolute", a.style.width = s + i;
|
|
353
|
+
var o = s / a.offsetWidth;
|
|
354
|
+
c.removeChild(a);
|
|
355
|
+
var u = o * parseFloat(e);
|
|
356
|
+
return Ct.CSS[e + i] = u, u;
|
|
357
|
+
}
|
|
358
|
+
function fn(t, e, i) {
|
|
359
|
+
if (e in t.style) {
|
|
360
|
+
var r = e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase(), n = t.style[e] || getComputedStyle(t).getPropertyValue(r) || "0";
|
|
361
|
+
return i ? he(t, n, i) : n;
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
function fe(t, e) {
|
|
365
|
+
if (k.dom(t) && !k.inp(t) && (!k.nil(W(t, e)) || k.svg(t) && t[e]))
|
|
366
|
+
return "attribute";
|
|
367
|
+
if (k.dom(t) && ue(Un, e))
|
|
368
|
+
return "transform";
|
|
369
|
+
if (k.dom(t) && e !== "transform" && fn(t, e))
|
|
370
|
+
return "css";
|
|
371
|
+
if (t[e] != null)
|
|
372
|
+
return "object";
|
|
373
|
+
}
|
|
374
|
+
function gn(t) {
|
|
375
|
+
if (k.dom(t)) {
|
|
376
|
+
for (var e = t.style.transform || "", i = /(\w+)\(([^)]*)\)/g, r = /* @__PURE__ */ new Map(), n; n = i.exec(e); )
|
|
377
|
+
r.set(n[1], n[2]);
|
|
378
|
+
return r;
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
function Yn(t, e, i, r) {
|
|
382
|
+
var n = mt(e, "scale") ? 1 : 0 + Hn(e), s = gn(t).get(e) || n;
|
|
383
|
+
return i && (i.transforms.list.set(e, s), i.transforms.last = e), r ? he(t, s, r) : s;
|
|
384
|
+
}
|
|
385
|
+
function ge(t, e, i, r) {
|
|
386
|
+
switch (fe(t, e)) {
|
|
387
|
+
case "transform":
|
|
388
|
+
return Yn(t, e, r, i);
|
|
389
|
+
case "css":
|
|
390
|
+
return fn(t, e, i);
|
|
391
|
+
case "attribute":
|
|
392
|
+
return W(t, e);
|
|
393
|
+
default:
|
|
394
|
+
return t[e] || 0;
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
function me(t, e) {
|
|
398
|
+
var i = /^(\*=|\+=|-=)/.exec(t);
|
|
399
|
+
if (!i)
|
|
400
|
+
return t;
|
|
401
|
+
var r = G(t) || 0, n = parseFloat(e), s = parseFloat(t.replace(i[0], ""));
|
|
402
|
+
switch (i[0][0]) {
|
|
403
|
+
case "+":
|
|
404
|
+
return n + s + r;
|
|
405
|
+
case "-":
|
|
406
|
+
return n - s + r;
|
|
407
|
+
case "*":
|
|
408
|
+
return n * s + r;
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
function mn(t, e) {
|
|
412
|
+
if (k.col(t))
|
|
413
|
+
return Wn(t);
|
|
414
|
+
if (/\s/g.test(t))
|
|
415
|
+
return t;
|
|
416
|
+
var i = G(t), r = i ? t.substr(0, t.length - i.length) : t;
|
|
417
|
+
return e ? r + e : r;
|
|
418
|
+
}
|
|
419
|
+
function pe(t, e) {
|
|
420
|
+
return Math.sqrt(Math.pow(e.x - t.x, 2) + Math.pow(e.y - t.y, 2));
|
|
421
|
+
}
|
|
422
|
+
function Kn(t) {
|
|
423
|
+
return Math.PI * 2 * W(t, "r");
|
|
424
|
+
}
|
|
425
|
+
function Gn(t) {
|
|
426
|
+
return W(t, "width") * 2 + W(t, "height") * 2;
|
|
427
|
+
}
|
|
428
|
+
function Jn(t) {
|
|
429
|
+
return pe(
|
|
430
|
+
{ x: W(t, "x1"), y: W(t, "y1") },
|
|
431
|
+
{ x: W(t, "x2"), y: W(t, "y2") }
|
|
432
|
+
);
|
|
433
|
+
}
|
|
434
|
+
function pn(t) {
|
|
435
|
+
for (var e = t.points, i = 0, r, n = 0; n < e.numberOfItems; n++) {
|
|
436
|
+
var s = e.getItem(n);
|
|
437
|
+
n > 0 && (i += pe(r, s)), r = s;
|
|
438
|
+
}
|
|
439
|
+
return i;
|
|
440
|
+
}
|
|
441
|
+
function Qn(t) {
|
|
442
|
+
var e = t.points;
|
|
443
|
+
return pn(t) + pe(e.getItem(e.numberOfItems - 1), e.getItem(0));
|
|
444
|
+
}
|
|
445
|
+
function vn(t) {
|
|
446
|
+
if (t.getTotalLength)
|
|
447
|
+
return t.getTotalLength();
|
|
448
|
+
switch (t.tagName.toLowerCase()) {
|
|
449
|
+
case "circle":
|
|
450
|
+
return Kn(t);
|
|
451
|
+
case "rect":
|
|
452
|
+
return Gn(t);
|
|
453
|
+
case "line":
|
|
454
|
+
return Jn(t);
|
|
455
|
+
case "polyline":
|
|
456
|
+
return pn(t);
|
|
457
|
+
case "polygon":
|
|
458
|
+
return Qn(t);
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
function Xn(t) {
|
|
462
|
+
var e = vn(t);
|
|
463
|
+
return t.setAttribute("stroke-dasharray", e), e;
|
|
464
|
+
}
|
|
465
|
+
function Zn(t) {
|
|
466
|
+
for (var e = t.parentNode; k.svg(e) && k.svg(e.parentNode); )
|
|
467
|
+
e = e.parentNode;
|
|
468
|
+
return e;
|
|
469
|
+
}
|
|
470
|
+
function yn(t, e) {
|
|
471
|
+
var i = e || {}, r = i.el || Zn(t), n = r.getBoundingClientRect(), s = W(r, "viewBox"), a = n.width, c = n.height, o = i.viewBox || (s ? s.split(" ") : [0, 0, a, c]);
|
|
472
|
+
return {
|
|
473
|
+
el: r,
|
|
474
|
+
viewBox: o,
|
|
475
|
+
x: o[0] / 1,
|
|
476
|
+
y: o[1] / 1,
|
|
477
|
+
w: a,
|
|
478
|
+
h: c,
|
|
479
|
+
vW: o[2],
|
|
480
|
+
vH: o[3]
|
|
481
|
+
};
|
|
482
|
+
}
|
|
483
|
+
function tr(t, e) {
|
|
484
|
+
var i = k.str(t) ? hn(t)[0] : t, r = e || 100;
|
|
485
|
+
return function(n) {
|
|
486
|
+
return {
|
|
487
|
+
property: n,
|
|
488
|
+
el: i,
|
|
489
|
+
svg: yn(i),
|
|
490
|
+
totalLength: vn(i) * (r / 100)
|
|
491
|
+
};
|
|
492
|
+
};
|
|
493
|
+
}
|
|
494
|
+
function er(t, e, i) {
|
|
495
|
+
function r(l) {
|
|
496
|
+
l === void 0 && (l = 0);
|
|
497
|
+
var d = e + l >= 1 ? e + l : 0;
|
|
498
|
+
return t.el.getPointAtLength(d);
|
|
499
|
+
}
|
|
500
|
+
var n = yn(t.el, t.svg), s = r(), a = r(-1), c = r(1), o = i ? 1 : n.w / n.vW, u = i ? 1 : n.h / n.vH;
|
|
501
|
+
switch (t.property) {
|
|
502
|
+
case "x":
|
|
503
|
+
return (s.x - n.x) * o;
|
|
504
|
+
case "y":
|
|
505
|
+
return (s.y - n.y) * u;
|
|
506
|
+
case "angle":
|
|
507
|
+
return Math.atan2(c.y - a.y, c.x - a.x) * 180 / Math.PI;
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
function Pe(t, e) {
|
|
511
|
+
var i = /[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g, r = mn(k.pth(t) ? t.totalLength : t, e) + "";
|
|
512
|
+
return {
|
|
513
|
+
original: r,
|
|
514
|
+
numbers: r.match(i) ? r.match(i).map(Number) : [0],
|
|
515
|
+
strings: k.str(t) || e ? r.split(i) : []
|
|
516
|
+
};
|
|
517
|
+
}
|
|
518
|
+
function ve(t) {
|
|
519
|
+
var e = t ? Tt(k.arr(t) ? t.map(be) : be(t)) : [];
|
|
520
|
+
return Et(e, function(i, r, n) {
|
|
521
|
+
return n.indexOf(i) === r;
|
|
522
|
+
});
|
|
523
|
+
}
|
|
524
|
+
function wn(t) {
|
|
525
|
+
var e = ve(t);
|
|
526
|
+
return e.map(function(i, r) {
|
|
527
|
+
return { target: i, id: r, total: e.length, transforms: { list: gn(i) } };
|
|
528
|
+
});
|
|
529
|
+
}
|
|
530
|
+
function nr(t, e) {
|
|
531
|
+
var i = de(e);
|
|
532
|
+
if (/^spring/.test(i.easing) && (i.duration = un(i.easing)), k.arr(t)) {
|
|
533
|
+
var r = t.length, n = r === 2 && !k.obj(t[0]);
|
|
534
|
+
n ? t = { value: t } : k.fnc(e.duration) || (i.duration = e.duration / r);
|
|
535
|
+
}
|
|
536
|
+
var s = k.arr(t) ? t : [t];
|
|
537
|
+
return s.map(function(a, c) {
|
|
538
|
+
var o = k.obj(a) && !k.pth(a) ? a : { value: a };
|
|
539
|
+
return k.und(o.delay) && (o.delay = c ? 0 : e.delay), k.und(o.endDelay) && (o.endDelay = c === s.length - 1 ? e.endDelay : 0), o;
|
|
540
|
+
}).map(function(a) {
|
|
541
|
+
return kt(a, i);
|
|
542
|
+
});
|
|
543
|
+
}
|
|
544
|
+
function rr(t) {
|
|
545
|
+
for (var e = Et(Tt(t.map(function(s) {
|
|
546
|
+
return Object.keys(s);
|
|
547
|
+
})), function(s) {
|
|
548
|
+
return k.key(s);
|
|
549
|
+
}).reduce(function(s, a) {
|
|
550
|
+
return s.indexOf(a) < 0 && s.push(a), s;
|
|
551
|
+
}, []), i = {}, r = function(s) {
|
|
552
|
+
var a = e[s];
|
|
553
|
+
i[a] = t.map(function(c) {
|
|
554
|
+
var o = {};
|
|
555
|
+
for (var u in c)
|
|
556
|
+
k.key(u) ? u == a && (o.value = c[u]) : o[u] = c[u];
|
|
557
|
+
return o;
|
|
558
|
+
});
|
|
559
|
+
}, n = 0; n < e.length; n++) r(n);
|
|
560
|
+
return i;
|
|
561
|
+
}
|
|
562
|
+
function ir(t, e) {
|
|
563
|
+
var i = [], r = e.keyframes;
|
|
564
|
+
r && (e = kt(rr(r), e));
|
|
565
|
+
for (var n in e)
|
|
566
|
+
k.key(n) && i.push({
|
|
567
|
+
name: n,
|
|
568
|
+
tweens: nr(e[n], t)
|
|
569
|
+
});
|
|
570
|
+
return i;
|
|
571
|
+
}
|
|
572
|
+
function sr(t, e) {
|
|
573
|
+
var i = {};
|
|
574
|
+
for (var r in t) {
|
|
575
|
+
var n = oe(t[r], e);
|
|
576
|
+
k.arr(n) && (n = n.map(function(s) {
|
|
577
|
+
return oe(s, e);
|
|
578
|
+
}), n.length === 1 && (n = n[0])), i[r] = n;
|
|
579
|
+
}
|
|
580
|
+
return i.duration = parseFloat(i.duration), i.delay = parseFloat(i.delay), i;
|
|
581
|
+
}
|
|
582
|
+
function or(t, e) {
|
|
583
|
+
var i;
|
|
584
|
+
return t.tweens.map(function(r) {
|
|
585
|
+
var n = sr(r, e), s = n.value, a = k.arr(s) ? s[1] : s, c = G(a), o = ge(e.target, t.name, c, e), u = i ? i.to.original : o, l = k.arr(s) ? s[0] : u, d = G(l) || G(o), g = c || d;
|
|
586
|
+
return k.und(a) && (a = u), n.from = Pe(l, g), n.to = Pe(me(a, l), g), n.start = i ? i.end : 0, n.end = n.start + n.delay + n.duration + n.endDelay, n.easing = le(n.easing, n.duration), n.isPath = k.pth(s), n.isPathTargetInsideSVG = n.isPath && k.svg(e.target), n.isColor = k.col(n.from.original), n.isColor && (n.round = 1), i = n, n;
|
|
587
|
+
});
|
|
588
|
+
}
|
|
589
|
+
var Cn = {
|
|
590
|
+
css: function(t, e, i) {
|
|
591
|
+
return t.style[e] = i;
|
|
592
|
+
},
|
|
593
|
+
attribute: function(t, e, i) {
|
|
594
|
+
return t.setAttribute(e, i);
|
|
595
|
+
},
|
|
596
|
+
object: function(t, e, i) {
|
|
597
|
+
return t[e] = i;
|
|
598
|
+
},
|
|
599
|
+
transform: function(t, e, i, r, n) {
|
|
600
|
+
if (r.list.set(e, i), e === r.last || n) {
|
|
601
|
+
var s = "";
|
|
602
|
+
r.list.forEach(function(a, c) {
|
|
603
|
+
s += c + "(" + a + ") ";
|
|
604
|
+
}), t.style.transform = s;
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
};
|
|
608
|
+
function _n(t, e) {
|
|
609
|
+
var i = wn(t);
|
|
610
|
+
i.forEach(function(r) {
|
|
611
|
+
for (var n in e) {
|
|
612
|
+
var s = oe(e[n], r), a = r.target, c = G(s), o = ge(a, n, c, r), u = c || G(o), l = me(mn(s, u), o), d = fe(a, n);
|
|
613
|
+
Cn[d](a, n, l, r.transforms, !0);
|
|
614
|
+
}
|
|
615
|
+
});
|
|
616
|
+
}
|
|
617
|
+
function ar(t, e) {
|
|
618
|
+
var i = fe(t.target, e.name);
|
|
619
|
+
if (i) {
|
|
620
|
+
var r = or(e, t), n = r[r.length - 1];
|
|
621
|
+
return {
|
|
622
|
+
type: i,
|
|
623
|
+
property: e.name,
|
|
624
|
+
animatable: t,
|
|
625
|
+
tweens: r,
|
|
626
|
+
duration: n.end,
|
|
627
|
+
delay: r[0].delay,
|
|
628
|
+
endDelay: n.endDelay
|
|
629
|
+
};
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
function cr(t, e) {
|
|
633
|
+
return Et(Tt(t.map(function(i) {
|
|
634
|
+
return e.map(function(r) {
|
|
635
|
+
return ar(i, r);
|
|
636
|
+
});
|
|
637
|
+
})), function(i) {
|
|
638
|
+
return !k.und(i);
|
|
639
|
+
});
|
|
640
|
+
}
|
|
641
|
+
function xn(t, e) {
|
|
642
|
+
var i = t.length, r = function(s) {
|
|
643
|
+
return s.timelineOffset ? s.timelineOffset : 0;
|
|
644
|
+
}, n = {};
|
|
645
|
+
return n.duration = i ? Math.max.apply(Math, t.map(function(s) {
|
|
646
|
+
return r(s) + s.duration;
|
|
647
|
+
})) : e.duration, n.delay = i ? Math.min.apply(Math, t.map(function(s) {
|
|
648
|
+
return r(s) + s.delay;
|
|
649
|
+
})) : e.delay, n.endDelay = i ? n.duration - Math.max.apply(Math, t.map(function(s) {
|
|
650
|
+
return r(s) + s.duration - s.endDelay;
|
|
651
|
+
})) : e.endDelay, n;
|
|
652
|
+
}
|
|
653
|
+
var Ee = 0;
|
|
654
|
+
function lr(t) {
|
|
655
|
+
var e = se(cn, t), i = se(ce, t), r = ir(i, t), n = wn(t.targets), s = cr(n, r), a = xn(s, i), c = Ee;
|
|
656
|
+
return Ee++, kt(e, {
|
|
657
|
+
id: c,
|
|
658
|
+
children: [],
|
|
659
|
+
animatables: n,
|
|
660
|
+
animations: s,
|
|
661
|
+
duration: a.duration,
|
|
662
|
+
delay: a.delay,
|
|
663
|
+
endDelay: a.endDelay
|
|
664
|
+
});
|
|
665
|
+
}
|
|
666
|
+
var q = [], bn = function() {
|
|
667
|
+
var t;
|
|
668
|
+
function e() {
|
|
669
|
+
!t && (!Te() || !L.suspendWhenDocumentHidden) && q.length > 0 && (t = requestAnimationFrame(i));
|
|
670
|
+
}
|
|
671
|
+
function i(n) {
|
|
672
|
+
for (var s = q.length, a = 0; a < s; ) {
|
|
673
|
+
var c = q[a];
|
|
674
|
+
c.paused ? (q.splice(a, 1), s--) : (c.tick(n), a++);
|
|
675
|
+
}
|
|
676
|
+
t = a > 0 ? requestAnimationFrame(i) : void 0;
|
|
677
|
+
}
|
|
678
|
+
function r() {
|
|
679
|
+
L.suspendWhenDocumentHidden && (Te() ? t = cancelAnimationFrame(t) : (q.forEach(
|
|
680
|
+
function(n) {
|
|
681
|
+
return n._onDocumentVisibility();
|
|
682
|
+
}
|
|
683
|
+
), bn()));
|
|
684
|
+
}
|
|
685
|
+
return typeof document < "u" && document.addEventListener("visibilitychange", r), e;
|
|
686
|
+
}();
|
|
687
|
+
function Te() {
|
|
688
|
+
return !!document && document.hidden;
|
|
689
|
+
}
|
|
690
|
+
function L(t) {
|
|
691
|
+
t === void 0 && (t = {});
|
|
692
|
+
var e = 0, i = 0, r = 0, n, s = 0, a = null;
|
|
693
|
+
function c(v) {
|
|
694
|
+
var p = window.Promise && new Promise(function(_) {
|
|
695
|
+
return a = _;
|
|
696
|
+
});
|
|
697
|
+
return v.finished = p, p;
|
|
698
|
+
}
|
|
699
|
+
var o = lr(t);
|
|
700
|
+
c(o);
|
|
701
|
+
function u() {
|
|
702
|
+
var v = o.direction;
|
|
703
|
+
v !== "alternate" && (o.direction = v !== "normal" ? "normal" : "reverse"), o.reversed = !o.reversed, n.forEach(function(p) {
|
|
704
|
+
return p.reversed = o.reversed;
|
|
705
|
+
});
|
|
706
|
+
}
|
|
707
|
+
function l(v) {
|
|
708
|
+
return o.reversed ? o.duration - v : v;
|
|
709
|
+
}
|
|
710
|
+
function d() {
|
|
711
|
+
e = 0, i = l(o.currentTime) * (1 / L.speed);
|
|
712
|
+
}
|
|
713
|
+
function g(v, p) {
|
|
714
|
+
p && p.seek(v - p.timelineOffset);
|
|
715
|
+
}
|
|
716
|
+
function h(v) {
|
|
717
|
+
if (o.reversePlayback)
|
|
718
|
+
for (var _ = s; _--; )
|
|
719
|
+
g(v, n[_]);
|
|
720
|
+
else
|
|
721
|
+
for (var p = 0; p < s; p++)
|
|
722
|
+
g(v, n[p]);
|
|
723
|
+
}
|
|
724
|
+
function m(v) {
|
|
725
|
+
for (var p = 0, _ = o.animations, $ = _.length; p < $; ) {
|
|
726
|
+
var y = _[p], T = y.animatable, S = y.tweens, x = S.length - 1, C = S[x];
|
|
727
|
+
x && (C = Et(S, function(vt) {
|
|
728
|
+
return v < vt.end;
|
|
729
|
+
})[0] || C);
|
|
730
|
+
for (var E = V(v - C.start - C.delay, 0, C.duration) / C.duration, M = isNaN(E) ? 1 : C.easing(E), b = C.to.strings, A = C.round, O = [], tt = C.to.numbers.length, J = void 0, Q = 0; Q < tt; Q++) {
|
|
731
|
+
var et = void 0, ot = C.to.numbers[Q], nt = C.from.numbers[Q] || 0;
|
|
732
|
+
C.isPath ? et = er(C.value, M * ot, C.isPathTargetInsideSVG) : et = nt + M * (ot - nt), A && (C.isColor && Q > 2 || (et = Math.round(et * A) / A)), O.push(et);
|
|
733
|
+
}
|
|
734
|
+
var ft = b.length;
|
|
735
|
+
if (!ft)
|
|
736
|
+
J = O[0];
|
|
737
|
+
else {
|
|
738
|
+
J = b[0];
|
|
739
|
+
for (var H = 0; H < ft; H++) {
|
|
740
|
+
b[H];
|
|
741
|
+
var pt = b[H + 1], rt = O[H];
|
|
742
|
+
isNaN(rt) || (pt ? J += rt + pt : J += rt + " ");
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
Cn[y.type](T.target, y.property, J, T.transforms), y.currentValue = J, p++;
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
function f(v) {
|
|
749
|
+
o[v] && !o.passThrough && o[v](o);
|
|
750
|
+
}
|
|
751
|
+
function I() {
|
|
752
|
+
o.remaining && o.remaining !== !0 && o.remaining--;
|
|
753
|
+
}
|
|
754
|
+
function w(v) {
|
|
755
|
+
var p = o.duration, _ = o.delay, $ = p - o.endDelay, y = l(v);
|
|
756
|
+
o.progress = V(y / p * 100, 0, 100), o.reversePlayback = y < o.currentTime, n && h(y), !o.began && o.currentTime > 0 && (o.began = !0, f("begin")), !o.loopBegan && o.currentTime > 0 && (o.loopBegan = !0, f("loopBegin")), y <= _ && o.currentTime !== 0 && m(0), (y >= $ && o.currentTime !== p || !p) && m(p), y > _ && y < $ ? (o.changeBegan || (o.changeBegan = !0, o.changeCompleted = !1, f("changeBegin")), f("change"), m(y)) : o.changeBegan && (o.changeCompleted = !0, o.changeBegan = !1, f("changeComplete")), o.currentTime = V(y, 0, p), o.began && f("update"), v >= p && (i = 0, I(), o.remaining ? (e = r, f("loopComplete"), o.loopBegan = !1, o.direction === "alternate" && u()) : (o.paused = !0, o.completed || (o.completed = !0, f("loopComplete"), f("complete"), !o.passThrough && "Promise" in window && (a(), c(o)))));
|
|
757
|
+
}
|
|
758
|
+
return o.reset = function() {
|
|
759
|
+
var v = o.direction;
|
|
760
|
+
o.passThrough = !1, o.currentTime = 0, o.progress = 0, o.paused = !0, o.began = !1, o.loopBegan = !1, o.changeBegan = !1, o.completed = !1, o.changeCompleted = !1, o.reversePlayback = !1, o.reversed = v === "reverse", o.remaining = o.loop, n = o.children, s = n.length;
|
|
761
|
+
for (var p = s; p--; )
|
|
762
|
+
o.children[p].reset();
|
|
763
|
+
(o.reversed && o.loop !== !0 || v === "alternate" && o.loop === 1) && o.remaining++, m(o.reversed ? o.duration : 0);
|
|
764
|
+
}, o._onDocumentVisibility = d, o.set = function(v, p) {
|
|
765
|
+
return _n(v, p), o;
|
|
766
|
+
}, o.tick = function(v) {
|
|
767
|
+
r = v, e || (e = r), w((r + (i - e)) * L.speed);
|
|
768
|
+
}, o.seek = function(v) {
|
|
769
|
+
w(l(v));
|
|
770
|
+
}, o.pause = function() {
|
|
771
|
+
o.paused = !0, d();
|
|
772
|
+
}, o.play = function() {
|
|
773
|
+
o.paused && (o.completed && o.reset(), o.paused = !1, q.push(o), d(), bn());
|
|
774
|
+
}, o.reverse = function() {
|
|
775
|
+
u(), o.completed = !o.reversed, d();
|
|
776
|
+
}, o.restart = function() {
|
|
777
|
+
o.reset(), o.play();
|
|
778
|
+
}, o.remove = function(v) {
|
|
779
|
+
var p = ve(v);
|
|
780
|
+
Pn(p, o);
|
|
781
|
+
}, o.reset(), o.autoplay && o.play(), o;
|
|
782
|
+
}
|
|
783
|
+
function ke(t, e) {
|
|
784
|
+
for (var i = e.length; i--; )
|
|
785
|
+
ue(t, e[i].animatable.target) && e.splice(i, 1);
|
|
786
|
+
}
|
|
787
|
+
function Pn(t, e) {
|
|
788
|
+
var i = e.animations, r = e.children;
|
|
789
|
+
ke(t, i);
|
|
790
|
+
for (var n = r.length; n--; ) {
|
|
791
|
+
var s = r[n], a = s.animations;
|
|
792
|
+
ke(t, a), !a.length && !s.children.length && r.splice(n, 1);
|
|
793
|
+
}
|
|
794
|
+
!i.length && !r.length && e.pause();
|
|
795
|
+
}
|
|
796
|
+
function ur(t) {
|
|
797
|
+
for (var e = ve(t), i = q.length; i--; ) {
|
|
798
|
+
var r = q[i];
|
|
799
|
+
Pn(e, r);
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
function dr(t, e) {
|
|
803
|
+
e === void 0 && (e = {});
|
|
804
|
+
var i = e.direction || "normal", r = e.easing ? le(e.easing) : null, n = e.grid, s = e.axis, a = e.from || 0, c = a === "first", o = a === "center", u = a === "last", l = k.arr(t), d = parseFloat(l ? t[0] : t), g = l ? parseFloat(t[1]) : 0, h = G(l ? t[1] : t) || 0, m = e.start || 0 + (l ? d : 0), f = [], I = 0;
|
|
805
|
+
return function(w, v, p) {
|
|
806
|
+
if (c && (a = 0), o && (a = (p - 1) / 2), u && (a = p - 1), !f.length) {
|
|
807
|
+
for (var _ = 0; _ < p; _++) {
|
|
808
|
+
if (!n)
|
|
809
|
+
f.push(Math.abs(a - _));
|
|
810
|
+
else {
|
|
811
|
+
var $ = o ? (n[0] - 1) / 2 : a % n[0], y = o ? (n[1] - 1) / 2 : Math.floor(a / n[0]), T = _ % n[0], S = Math.floor(_ / n[0]), x = $ - T, C = y - S, E = Math.sqrt(x * x + C * C);
|
|
812
|
+
s === "x" && (E = -x), s === "y" && (E = -C), f.push(E);
|
|
813
|
+
}
|
|
814
|
+
I = Math.max.apply(Math, f);
|
|
815
|
+
}
|
|
816
|
+
r && (f = f.map(function(b) {
|
|
817
|
+
return r(b / I) * I;
|
|
818
|
+
})), i === "reverse" && (f = f.map(function(b) {
|
|
819
|
+
return s ? b < 0 ? b * -1 : -b : Math.abs(I - b);
|
|
820
|
+
}));
|
|
821
|
+
}
|
|
822
|
+
var M = l ? (g - d) / I : d;
|
|
823
|
+
return m + M * (Math.round(f[v] * 100) / 100) + h;
|
|
824
|
+
};
|
|
825
|
+
}
|
|
826
|
+
function hr(t) {
|
|
827
|
+
t === void 0 && (t = {});
|
|
828
|
+
var e = L(t);
|
|
829
|
+
return e.duration = 0, e.add = function(i, r) {
|
|
830
|
+
var n = q.indexOf(e), s = e.children;
|
|
831
|
+
n > -1 && q.splice(n, 1);
|
|
832
|
+
function a(g) {
|
|
833
|
+
g.passThrough = !0;
|
|
834
|
+
}
|
|
835
|
+
for (var c = 0; c < s.length; c++)
|
|
836
|
+
a(s[c]);
|
|
837
|
+
var o = kt(i, se(ce, t));
|
|
838
|
+
o.targets = o.targets || t.targets;
|
|
839
|
+
var u = e.duration;
|
|
840
|
+
o.autoplay = !1, o.direction = e.direction, o.timelineOffset = k.und(r) ? u : me(r, u), a(e), e.seek(o.timelineOffset);
|
|
841
|
+
var l = L(o);
|
|
842
|
+
a(l), s.push(l);
|
|
843
|
+
var d = xn(s, t);
|
|
844
|
+
return e.delay = d.delay, e.endDelay = d.endDelay, e.duration = d.duration, e.seek(0), e.reset(), e.autoplay && e.play(), e;
|
|
845
|
+
}, e;
|
|
846
|
+
}
|
|
847
|
+
L.version = "3.2.1";
|
|
848
|
+
L.speed = 1;
|
|
849
|
+
L.suspendWhenDocumentHidden = !0;
|
|
850
|
+
L.running = q;
|
|
851
|
+
L.remove = ur;
|
|
852
|
+
L.get = ge;
|
|
853
|
+
L.set = _n;
|
|
854
|
+
L.convertPx = he;
|
|
855
|
+
L.path = tr;
|
|
856
|
+
L.setDashoffset = Xn;
|
|
857
|
+
L.stagger = dr;
|
|
858
|
+
L.timeline = hr;
|
|
859
|
+
L.easing = le;
|
|
860
|
+
L.penner = dn;
|
|
861
|
+
L.random = function(t, e) {
|
|
862
|
+
return Math.floor(Math.random() * (e - t + 1)) + t;
|
|
863
|
+
};
|
|
864
|
+
var ct = {}, At, Se;
|
|
865
|
+
function fr() {
|
|
866
|
+
return Se || (Se = 1, At = function() {
|
|
867
|
+
return typeof Promise == "function" && Promise.prototype && Promise.prototype.then;
|
|
868
|
+
}), At;
|
|
869
|
+
}
|
|
870
|
+
var Dt = {}, X = {}, Me;
|
|
871
|
+
function it() {
|
|
872
|
+
if (Me) return X;
|
|
873
|
+
Me = 1;
|
|
874
|
+
let t;
|
|
875
|
+
const e = [
|
|
876
|
+
0,
|
|
877
|
+
// Not used
|
|
878
|
+
26,
|
|
879
|
+
44,
|
|
880
|
+
70,
|
|
881
|
+
100,
|
|
882
|
+
134,
|
|
883
|
+
172,
|
|
884
|
+
196,
|
|
885
|
+
242,
|
|
886
|
+
292,
|
|
887
|
+
346,
|
|
888
|
+
404,
|
|
889
|
+
466,
|
|
890
|
+
532,
|
|
891
|
+
581,
|
|
892
|
+
655,
|
|
893
|
+
733,
|
|
894
|
+
815,
|
|
895
|
+
901,
|
|
896
|
+
991,
|
|
897
|
+
1085,
|
|
898
|
+
1156,
|
|
899
|
+
1258,
|
|
900
|
+
1364,
|
|
901
|
+
1474,
|
|
902
|
+
1588,
|
|
903
|
+
1706,
|
|
904
|
+
1828,
|
|
905
|
+
1921,
|
|
906
|
+
2051,
|
|
907
|
+
2185,
|
|
908
|
+
2323,
|
|
909
|
+
2465,
|
|
910
|
+
2611,
|
|
911
|
+
2761,
|
|
912
|
+
2876,
|
|
913
|
+
3034,
|
|
914
|
+
3196,
|
|
915
|
+
3362,
|
|
916
|
+
3532,
|
|
917
|
+
3706
|
|
918
|
+
];
|
|
919
|
+
return X.getSymbolSize = function(r) {
|
|
920
|
+
if (!r) throw new Error('"version" cannot be null or undefined');
|
|
921
|
+
if (r < 1 || r > 40) throw new Error('"version" should be in range from 1 to 40');
|
|
922
|
+
return r * 4 + 17;
|
|
923
|
+
}, X.getSymbolTotalCodewords = function(r) {
|
|
924
|
+
return e[r];
|
|
925
|
+
}, X.getBCHDigit = function(i) {
|
|
926
|
+
let r = 0;
|
|
927
|
+
for (; i !== 0; )
|
|
928
|
+
r++, i >>>= 1;
|
|
929
|
+
return r;
|
|
930
|
+
}, X.setToSJISFunction = function(r) {
|
|
931
|
+
if (typeof r != "function")
|
|
932
|
+
throw new Error('"toSJISFunc" is not a valid function.');
|
|
933
|
+
t = r;
|
|
934
|
+
}, X.isKanjiModeEnabled = function() {
|
|
935
|
+
return typeof t < "u";
|
|
936
|
+
}, X.toSJIS = function(r) {
|
|
937
|
+
return t(r);
|
|
938
|
+
}, X;
|
|
939
|
+
}
|
|
940
|
+
var Bt = {}, Ie;
|
|
941
|
+
function ye() {
|
|
942
|
+
return Ie || (Ie = 1, function(t) {
|
|
943
|
+
t.L = { bit: 1 }, t.M = { bit: 0 }, t.Q = { bit: 3 }, t.H = { bit: 2 };
|
|
944
|
+
function e(i) {
|
|
945
|
+
if (typeof i != "string")
|
|
946
|
+
throw new Error("Param is not a string");
|
|
947
|
+
switch (i.toLowerCase()) {
|
|
948
|
+
case "l":
|
|
949
|
+
case "low":
|
|
950
|
+
return t.L;
|
|
951
|
+
case "m":
|
|
952
|
+
case "medium":
|
|
953
|
+
return t.M;
|
|
954
|
+
case "q":
|
|
955
|
+
case "quartile":
|
|
956
|
+
return t.Q;
|
|
957
|
+
case "h":
|
|
958
|
+
case "high":
|
|
959
|
+
return t.H;
|
|
960
|
+
default:
|
|
961
|
+
throw new Error("Unknown EC Level: " + i);
|
|
962
|
+
}
|
|
963
|
+
}
|
|
964
|
+
t.isValid = function(r) {
|
|
965
|
+
return r && typeof r.bit < "u" && r.bit >= 0 && r.bit < 4;
|
|
966
|
+
}, t.from = function(r, n) {
|
|
967
|
+
if (t.isValid(r))
|
|
968
|
+
return r;
|
|
969
|
+
try {
|
|
970
|
+
return e(r);
|
|
971
|
+
} catch {
|
|
972
|
+
return n;
|
|
973
|
+
}
|
|
974
|
+
};
|
|
975
|
+
}(Bt)), Bt;
|
|
976
|
+
}
|
|
977
|
+
var Ft, Ae;
|
|
978
|
+
function gr() {
|
|
979
|
+
if (Ae) return Ft;
|
|
980
|
+
Ae = 1;
|
|
981
|
+
function t() {
|
|
982
|
+
this.buffer = [], this.length = 0;
|
|
983
|
+
}
|
|
984
|
+
return t.prototype = {
|
|
985
|
+
get: function(e) {
|
|
986
|
+
const i = Math.floor(e / 8);
|
|
987
|
+
return (this.buffer[i] >>> 7 - e % 8 & 1) === 1;
|
|
988
|
+
},
|
|
989
|
+
put: function(e, i) {
|
|
990
|
+
for (let r = 0; r < i; r++)
|
|
991
|
+
this.putBit((e >>> i - r - 1 & 1) === 1);
|
|
992
|
+
},
|
|
993
|
+
getLengthInBits: function() {
|
|
994
|
+
return this.length;
|
|
995
|
+
},
|
|
996
|
+
putBit: function(e) {
|
|
997
|
+
const i = Math.floor(this.length / 8);
|
|
998
|
+
this.buffer.length <= i && this.buffer.push(0), e && (this.buffer[i] |= 128 >>> this.length % 8), this.length++;
|
|
999
|
+
}
|
|
1000
|
+
}, Ft = t, Ft;
|
|
1001
|
+
}
|
|
1002
|
+
var Lt, De;
|
|
1003
|
+
function mr() {
|
|
1004
|
+
if (De) return Lt;
|
|
1005
|
+
De = 1;
|
|
1006
|
+
function t(e) {
|
|
1007
|
+
if (!e || e < 1)
|
|
1008
|
+
throw new Error("BitMatrix size must be defined and greater than 0");
|
|
1009
|
+
this.size = e, this.data = new Uint8Array(e * e), this.reservedBit = new Uint8Array(e * e);
|
|
1010
|
+
}
|
|
1011
|
+
return t.prototype.set = function(e, i, r, n) {
|
|
1012
|
+
const s = e * this.size + i;
|
|
1013
|
+
this.data[s] = r, n && (this.reservedBit[s] = !0);
|
|
1014
|
+
}, t.prototype.get = function(e, i) {
|
|
1015
|
+
return this.data[e * this.size + i];
|
|
1016
|
+
}, t.prototype.xor = function(e, i, r) {
|
|
1017
|
+
this.data[e * this.size + i] ^= r;
|
|
1018
|
+
}, t.prototype.isReserved = function(e, i) {
|
|
1019
|
+
return this.reservedBit[e * this.size + i];
|
|
1020
|
+
}, Lt = t, Lt;
|
|
1021
|
+
}
|
|
1022
|
+
var Rt = {}, Be;
|
|
1023
|
+
function pr() {
|
|
1024
|
+
return Be || (Be = 1, function(t) {
|
|
1025
|
+
const e = it().getSymbolSize;
|
|
1026
|
+
t.getRowColCoords = function(r) {
|
|
1027
|
+
if (r === 1) return [];
|
|
1028
|
+
const n = Math.floor(r / 7) + 2, s = e(r), a = s === 145 ? 26 : Math.ceil((s - 13) / (2 * n - 2)) * 2, c = [s - 7];
|
|
1029
|
+
for (let o = 1; o < n - 1; o++)
|
|
1030
|
+
c[o] = c[o - 1] - a;
|
|
1031
|
+
return c.push(6), c.reverse();
|
|
1032
|
+
}, t.getPositions = function(r) {
|
|
1033
|
+
const n = [], s = t.getRowColCoords(r), a = s.length;
|
|
1034
|
+
for (let c = 0; c < a; c++)
|
|
1035
|
+
for (let o = 0; o < a; o++)
|
|
1036
|
+
c === 0 && o === 0 || // top-left
|
|
1037
|
+
c === 0 && o === a - 1 || // bottom-left
|
|
1038
|
+
c === a - 1 && o === 0 || n.push([s[c], s[o]]);
|
|
1039
|
+
return n;
|
|
1040
|
+
};
|
|
1041
|
+
}(Rt)), Rt;
|
|
1042
|
+
}
|
|
1043
|
+
var $t = {}, Fe;
|
|
1044
|
+
function vr() {
|
|
1045
|
+
if (Fe) return $t;
|
|
1046
|
+
Fe = 1;
|
|
1047
|
+
const t = it().getSymbolSize, e = 7;
|
|
1048
|
+
return $t.getPositions = function(r) {
|
|
1049
|
+
const n = t(r);
|
|
1050
|
+
return [
|
|
1051
|
+
// top-left
|
|
1052
|
+
[0, 0],
|
|
1053
|
+
// top-right
|
|
1054
|
+
[n - e, 0],
|
|
1055
|
+
// bottom-left
|
|
1056
|
+
[0, n - e]
|
|
1057
|
+
];
|
|
1058
|
+
}, $t;
|
|
1059
|
+
}
|
|
1060
|
+
var Nt = {}, Le;
|
|
1061
|
+
function yr() {
|
|
1062
|
+
return Le || (Le = 1, function(t) {
|
|
1063
|
+
t.Patterns = {
|
|
1064
|
+
PATTERN000: 0,
|
|
1065
|
+
PATTERN001: 1,
|
|
1066
|
+
PATTERN010: 2,
|
|
1067
|
+
PATTERN011: 3,
|
|
1068
|
+
PATTERN100: 4,
|
|
1069
|
+
PATTERN101: 5,
|
|
1070
|
+
PATTERN110: 6,
|
|
1071
|
+
PATTERN111: 7
|
|
1072
|
+
};
|
|
1073
|
+
const e = {
|
|
1074
|
+
N1: 3,
|
|
1075
|
+
N2: 3,
|
|
1076
|
+
N3: 40,
|
|
1077
|
+
N4: 10
|
|
1078
|
+
};
|
|
1079
|
+
t.isValid = function(n) {
|
|
1080
|
+
return n != null && n !== "" && !isNaN(n) && n >= 0 && n <= 7;
|
|
1081
|
+
}, t.from = function(n) {
|
|
1082
|
+
return t.isValid(n) ? parseInt(n, 10) : void 0;
|
|
1083
|
+
}, t.getPenaltyN1 = function(n) {
|
|
1084
|
+
const s = n.size;
|
|
1085
|
+
let a = 0, c = 0, o = 0, u = null, l = null;
|
|
1086
|
+
for (let d = 0; d < s; d++) {
|
|
1087
|
+
c = o = 0, u = l = null;
|
|
1088
|
+
for (let g = 0; g < s; g++) {
|
|
1089
|
+
let h = n.get(d, g);
|
|
1090
|
+
h === u ? c++ : (c >= 5 && (a += e.N1 + (c - 5)), u = h, c = 1), h = n.get(g, d), h === l ? o++ : (o >= 5 && (a += e.N1 + (o - 5)), l = h, o = 1);
|
|
1091
|
+
}
|
|
1092
|
+
c >= 5 && (a += e.N1 + (c - 5)), o >= 5 && (a += e.N1 + (o - 5));
|
|
1093
|
+
}
|
|
1094
|
+
return a;
|
|
1095
|
+
}, t.getPenaltyN2 = function(n) {
|
|
1096
|
+
const s = n.size;
|
|
1097
|
+
let a = 0;
|
|
1098
|
+
for (let c = 0; c < s - 1; c++)
|
|
1099
|
+
for (let o = 0; o < s - 1; o++) {
|
|
1100
|
+
const u = n.get(c, o) + n.get(c, o + 1) + n.get(c + 1, o) + n.get(c + 1, o + 1);
|
|
1101
|
+
(u === 4 || u === 0) && a++;
|
|
1102
|
+
}
|
|
1103
|
+
return a * e.N2;
|
|
1104
|
+
}, t.getPenaltyN3 = function(n) {
|
|
1105
|
+
const s = n.size;
|
|
1106
|
+
let a = 0, c = 0, o = 0;
|
|
1107
|
+
for (let u = 0; u < s; u++) {
|
|
1108
|
+
c = o = 0;
|
|
1109
|
+
for (let l = 0; l < s; l++)
|
|
1110
|
+
c = c << 1 & 2047 | n.get(u, l), l >= 10 && (c === 1488 || c === 93) && a++, o = o << 1 & 2047 | n.get(l, u), l >= 10 && (o === 1488 || o === 93) && a++;
|
|
1111
|
+
}
|
|
1112
|
+
return a * e.N3;
|
|
1113
|
+
}, t.getPenaltyN4 = function(n) {
|
|
1114
|
+
let s = 0;
|
|
1115
|
+
const a = n.data.length;
|
|
1116
|
+
for (let o = 0; o < a; o++) s += n.data[o];
|
|
1117
|
+
return Math.abs(Math.ceil(s * 100 / a / 5) - 10) * e.N4;
|
|
1118
|
+
};
|
|
1119
|
+
function i(r, n, s) {
|
|
1120
|
+
switch (r) {
|
|
1121
|
+
case t.Patterns.PATTERN000:
|
|
1122
|
+
return (n + s) % 2 === 0;
|
|
1123
|
+
case t.Patterns.PATTERN001:
|
|
1124
|
+
return n % 2 === 0;
|
|
1125
|
+
case t.Patterns.PATTERN010:
|
|
1126
|
+
return s % 3 === 0;
|
|
1127
|
+
case t.Patterns.PATTERN011:
|
|
1128
|
+
return (n + s) % 3 === 0;
|
|
1129
|
+
case t.Patterns.PATTERN100:
|
|
1130
|
+
return (Math.floor(n / 2) + Math.floor(s / 3)) % 2 === 0;
|
|
1131
|
+
case t.Patterns.PATTERN101:
|
|
1132
|
+
return n * s % 2 + n * s % 3 === 0;
|
|
1133
|
+
case t.Patterns.PATTERN110:
|
|
1134
|
+
return (n * s % 2 + n * s % 3) % 2 === 0;
|
|
1135
|
+
case t.Patterns.PATTERN111:
|
|
1136
|
+
return (n * s % 3 + (n + s) % 2) % 2 === 0;
|
|
1137
|
+
default:
|
|
1138
|
+
throw new Error("bad maskPattern:" + r);
|
|
1139
|
+
}
|
|
1140
|
+
}
|
|
1141
|
+
t.applyMask = function(n, s) {
|
|
1142
|
+
const a = s.size;
|
|
1143
|
+
for (let c = 0; c < a; c++)
|
|
1144
|
+
for (let o = 0; o < a; o++)
|
|
1145
|
+
s.isReserved(o, c) || s.xor(o, c, i(n, o, c));
|
|
1146
|
+
}, t.getBestMask = function(n, s) {
|
|
1147
|
+
const a = Object.keys(t.Patterns).length;
|
|
1148
|
+
let c = 0, o = 1 / 0;
|
|
1149
|
+
for (let u = 0; u < a; u++) {
|
|
1150
|
+
s(u), t.applyMask(u, n);
|
|
1151
|
+
const l = t.getPenaltyN1(n) + t.getPenaltyN2(n) + t.getPenaltyN3(n) + t.getPenaltyN4(n);
|
|
1152
|
+
t.applyMask(u, n), l < o && (o = l, c = u);
|
|
1153
|
+
}
|
|
1154
|
+
return c;
|
|
1155
|
+
};
|
|
1156
|
+
}(Nt)), Nt;
|
|
1157
|
+
}
|
|
1158
|
+
var yt = {}, Re;
|
|
1159
|
+
function En() {
|
|
1160
|
+
if (Re) return yt;
|
|
1161
|
+
Re = 1;
|
|
1162
|
+
const t = ye(), e = [
|
|
1163
|
+
// L M Q H
|
|
1164
|
+
1,
|
|
1165
|
+
1,
|
|
1166
|
+
1,
|
|
1167
|
+
1,
|
|
1168
|
+
1,
|
|
1169
|
+
1,
|
|
1170
|
+
1,
|
|
1171
|
+
1,
|
|
1172
|
+
1,
|
|
1173
|
+
1,
|
|
1174
|
+
2,
|
|
1175
|
+
2,
|
|
1176
|
+
1,
|
|
1177
|
+
2,
|
|
1178
|
+
2,
|
|
1179
|
+
4,
|
|
1180
|
+
1,
|
|
1181
|
+
2,
|
|
1182
|
+
4,
|
|
1183
|
+
4,
|
|
1184
|
+
2,
|
|
1185
|
+
4,
|
|
1186
|
+
4,
|
|
1187
|
+
4,
|
|
1188
|
+
2,
|
|
1189
|
+
4,
|
|
1190
|
+
6,
|
|
1191
|
+
5,
|
|
1192
|
+
2,
|
|
1193
|
+
4,
|
|
1194
|
+
6,
|
|
1195
|
+
6,
|
|
1196
|
+
2,
|
|
1197
|
+
5,
|
|
1198
|
+
8,
|
|
1199
|
+
8,
|
|
1200
|
+
4,
|
|
1201
|
+
5,
|
|
1202
|
+
8,
|
|
1203
|
+
8,
|
|
1204
|
+
4,
|
|
1205
|
+
5,
|
|
1206
|
+
8,
|
|
1207
|
+
11,
|
|
1208
|
+
4,
|
|
1209
|
+
8,
|
|
1210
|
+
10,
|
|
1211
|
+
11,
|
|
1212
|
+
4,
|
|
1213
|
+
9,
|
|
1214
|
+
12,
|
|
1215
|
+
16,
|
|
1216
|
+
4,
|
|
1217
|
+
9,
|
|
1218
|
+
16,
|
|
1219
|
+
16,
|
|
1220
|
+
6,
|
|
1221
|
+
10,
|
|
1222
|
+
12,
|
|
1223
|
+
18,
|
|
1224
|
+
6,
|
|
1225
|
+
10,
|
|
1226
|
+
17,
|
|
1227
|
+
16,
|
|
1228
|
+
6,
|
|
1229
|
+
11,
|
|
1230
|
+
16,
|
|
1231
|
+
19,
|
|
1232
|
+
6,
|
|
1233
|
+
13,
|
|
1234
|
+
18,
|
|
1235
|
+
21,
|
|
1236
|
+
7,
|
|
1237
|
+
14,
|
|
1238
|
+
21,
|
|
1239
|
+
25,
|
|
1240
|
+
8,
|
|
1241
|
+
16,
|
|
1242
|
+
20,
|
|
1243
|
+
25,
|
|
1244
|
+
8,
|
|
1245
|
+
17,
|
|
1246
|
+
23,
|
|
1247
|
+
25,
|
|
1248
|
+
9,
|
|
1249
|
+
17,
|
|
1250
|
+
23,
|
|
1251
|
+
34,
|
|
1252
|
+
9,
|
|
1253
|
+
18,
|
|
1254
|
+
25,
|
|
1255
|
+
30,
|
|
1256
|
+
10,
|
|
1257
|
+
20,
|
|
1258
|
+
27,
|
|
1259
|
+
32,
|
|
1260
|
+
12,
|
|
1261
|
+
21,
|
|
1262
|
+
29,
|
|
1263
|
+
35,
|
|
1264
|
+
12,
|
|
1265
|
+
23,
|
|
1266
|
+
34,
|
|
1267
|
+
37,
|
|
1268
|
+
12,
|
|
1269
|
+
25,
|
|
1270
|
+
34,
|
|
1271
|
+
40,
|
|
1272
|
+
13,
|
|
1273
|
+
26,
|
|
1274
|
+
35,
|
|
1275
|
+
42,
|
|
1276
|
+
14,
|
|
1277
|
+
28,
|
|
1278
|
+
38,
|
|
1279
|
+
45,
|
|
1280
|
+
15,
|
|
1281
|
+
29,
|
|
1282
|
+
40,
|
|
1283
|
+
48,
|
|
1284
|
+
16,
|
|
1285
|
+
31,
|
|
1286
|
+
43,
|
|
1287
|
+
51,
|
|
1288
|
+
17,
|
|
1289
|
+
33,
|
|
1290
|
+
45,
|
|
1291
|
+
54,
|
|
1292
|
+
18,
|
|
1293
|
+
35,
|
|
1294
|
+
48,
|
|
1295
|
+
57,
|
|
1296
|
+
19,
|
|
1297
|
+
37,
|
|
1298
|
+
51,
|
|
1299
|
+
60,
|
|
1300
|
+
19,
|
|
1301
|
+
38,
|
|
1302
|
+
53,
|
|
1303
|
+
63,
|
|
1304
|
+
20,
|
|
1305
|
+
40,
|
|
1306
|
+
56,
|
|
1307
|
+
66,
|
|
1308
|
+
21,
|
|
1309
|
+
43,
|
|
1310
|
+
59,
|
|
1311
|
+
70,
|
|
1312
|
+
22,
|
|
1313
|
+
45,
|
|
1314
|
+
62,
|
|
1315
|
+
74,
|
|
1316
|
+
24,
|
|
1317
|
+
47,
|
|
1318
|
+
65,
|
|
1319
|
+
77,
|
|
1320
|
+
25,
|
|
1321
|
+
49,
|
|
1322
|
+
68,
|
|
1323
|
+
81
|
|
1324
|
+
], i = [
|
|
1325
|
+
// L M Q H
|
|
1326
|
+
7,
|
|
1327
|
+
10,
|
|
1328
|
+
13,
|
|
1329
|
+
17,
|
|
1330
|
+
10,
|
|
1331
|
+
16,
|
|
1332
|
+
22,
|
|
1333
|
+
28,
|
|
1334
|
+
15,
|
|
1335
|
+
26,
|
|
1336
|
+
36,
|
|
1337
|
+
44,
|
|
1338
|
+
20,
|
|
1339
|
+
36,
|
|
1340
|
+
52,
|
|
1341
|
+
64,
|
|
1342
|
+
26,
|
|
1343
|
+
48,
|
|
1344
|
+
72,
|
|
1345
|
+
88,
|
|
1346
|
+
36,
|
|
1347
|
+
64,
|
|
1348
|
+
96,
|
|
1349
|
+
112,
|
|
1350
|
+
40,
|
|
1351
|
+
72,
|
|
1352
|
+
108,
|
|
1353
|
+
130,
|
|
1354
|
+
48,
|
|
1355
|
+
88,
|
|
1356
|
+
132,
|
|
1357
|
+
156,
|
|
1358
|
+
60,
|
|
1359
|
+
110,
|
|
1360
|
+
160,
|
|
1361
|
+
192,
|
|
1362
|
+
72,
|
|
1363
|
+
130,
|
|
1364
|
+
192,
|
|
1365
|
+
224,
|
|
1366
|
+
80,
|
|
1367
|
+
150,
|
|
1368
|
+
224,
|
|
1369
|
+
264,
|
|
1370
|
+
96,
|
|
1371
|
+
176,
|
|
1372
|
+
260,
|
|
1373
|
+
308,
|
|
1374
|
+
104,
|
|
1375
|
+
198,
|
|
1376
|
+
288,
|
|
1377
|
+
352,
|
|
1378
|
+
120,
|
|
1379
|
+
216,
|
|
1380
|
+
320,
|
|
1381
|
+
384,
|
|
1382
|
+
132,
|
|
1383
|
+
240,
|
|
1384
|
+
360,
|
|
1385
|
+
432,
|
|
1386
|
+
144,
|
|
1387
|
+
280,
|
|
1388
|
+
408,
|
|
1389
|
+
480,
|
|
1390
|
+
168,
|
|
1391
|
+
308,
|
|
1392
|
+
448,
|
|
1393
|
+
532,
|
|
1394
|
+
180,
|
|
1395
|
+
338,
|
|
1396
|
+
504,
|
|
1397
|
+
588,
|
|
1398
|
+
196,
|
|
1399
|
+
364,
|
|
1400
|
+
546,
|
|
1401
|
+
650,
|
|
1402
|
+
224,
|
|
1403
|
+
416,
|
|
1404
|
+
600,
|
|
1405
|
+
700,
|
|
1406
|
+
224,
|
|
1407
|
+
442,
|
|
1408
|
+
644,
|
|
1409
|
+
750,
|
|
1410
|
+
252,
|
|
1411
|
+
476,
|
|
1412
|
+
690,
|
|
1413
|
+
816,
|
|
1414
|
+
270,
|
|
1415
|
+
504,
|
|
1416
|
+
750,
|
|
1417
|
+
900,
|
|
1418
|
+
300,
|
|
1419
|
+
560,
|
|
1420
|
+
810,
|
|
1421
|
+
960,
|
|
1422
|
+
312,
|
|
1423
|
+
588,
|
|
1424
|
+
870,
|
|
1425
|
+
1050,
|
|
1426
|
+
336,
|
|
1427
|
+
644,
|
|
1428
|
+
952,
|
|
1429
|
+
1110,
|
|
1430
|
+
360,
|
|
1431
|
+
700,
|
|
1432
|
+
1020,
|
|
1433
|
+
1200,
|
|
1434
|
+
390,
|
|
1435
|
+
728,
|
|
1436
|
+
1050,
|
|
1437
|
+
1260,
|
|
1438
|
+
420,
|
|
1439
|
+
784,
|
|
1440
|
+
1140,
|
|
1441
|
+
1350,
|
|
1442
|
+
450,
|
|
1443
|
+
812,
|
|
1444
|
+
1200,
|
|
1445
|
+
1440,
|
|
1446
|
+
480,
|
|
1447
|
+
868,
|
|
1448
|
+
1290,
|
|
1449
|
+
1530,
|
|
1450
|
+
510,
|
|
1451
|
+
924,
|
|
1452
|
+
1350,
|
|
1453
|
+
1620,
|
|
1454
|
+
540,
|
|
1455
|
+
980,
|
|
1456
|
+
1440,
|
|
1457
|
+
1710,
|
|
1458
|
+
570,
|
|
1459
|
+
1036,
|
|
1460
|
+
1530,
|
|
1461
|
+
1800,
|
|
1462
|
+
570,
|
|
1463
|
+
1064,
|
|
1464
|
+
1590,
|
|
1465
|
+
1890,
|
|
1466
|
+
600,
|
|
1467
|
+
1120,
|
|
1468
|
+
1680,
|
|
1469
|
+
1980,
|
|
1470
|
+
630,
|
|
1471
|
+
1204,
|
|
1472
|
+
1770,
|
|
1473
|
+
2100,
|
|
1474
|
+
660,
|
|
1475
|
+
1260,
|
|
1476
|
+
1860,
|
|
1477
|
+
2220,
|
|
1478
|
+
720,
|
|
1479
|
+
1316,
|
|
1480
|
+
1950,
|
|
1481
|
+
2310,
|
|
1482
|
+
750,
|
|
1483
|
+
1372,
|
|
1484
|
+
2040,
|
|
1485
|
+
2430
|
|
1486
|
+
];
|
|
1487
|
+
return yt.getBlocksCount = function(n, s) {
|
|
1488
|
+
switch (s) {
|
|
1489
|
+
case t.L:
|
|
1490
|
+
return e[(n - 1) * 4 + 0];
|
|
1491
|
+
case t.M:
|
|
1492
|
+
return e[(n - 1) * 4 + 1];
|
|
1493
|
+
case t.Q:
|
|
1494
|
+
return e[(n - 1) * 4 + 2];
|
|
1495
|
+
case t.H:
|
|
1496
|
+
return e[(n - 1) * 4 + 3];
|
|
1497
|
+
default:
|
|
1498
|
+
return;
|
|
1499
|
+
}
|
|
1500
|
+
}, yt.getTotalCodewordsCount = function(n, s) {
|
|
1501
|
+
switch (s) {
|
|
1502
|
+
case t.L:
|
|
1503
|
+
return i[(n - 1) * 4 + 0];
|
|
1504
|
+
case t.M:
|
|
1505
|
+
return i[(n - 1) * 4 + 1];
|
|
1506
|
+
case t.Q:
|
|
1507
|
+
return i[(n - 1) * 4 + 2];
|
|
1508
|
+
case t.H:
|
|
1509
|
+
return i[(n - 1) * 4 + 3];
|
|
1510
|
+
default:
|
|
1511
|
+
return;
|
|
1512
|
+
}
|
|
1513
|
+
}, yt;
|
|
1514
|
+
}
|
|
1515
|
+
var Ut = {}, gt = {}, $e;
|
|
1516
|
+
function wr() {
|
|
1517
|
+
if ($e) return gt;
|
|
1518
|
+
$e = 1;
|
|
1519
|
+
const t = new Uint8Array(512), e = new Uint8Array(256);
|
|
1520
|
+
return function() {
|
|
1521
|
+
let r = 1;
|
|
1522
|
+
for (let n = 0; n < 255; n++)
|
|
1523
|
+
t[n] = r, e[r] = n, r <<= 1, r & 256 && (r ^= 285);
|
|
1524
|
+
for (let n = 255; n < 512; n++)
|
|
1525
|
+
t[n] = t[n - 255];
|
|
1526
|
+
}(), gt.log = function(r) {
|
|
1527
|
+
if (r < 1) throw new Error("log(" + r + ")");
|
|
1528
|
+
return e[r];
|
|
1529
|
+
}, gt.exp = function(r) {
|
|
1530
|
+
return t[r];
|
|
1531
|
+
}, gt.mul = function(r, n) {
|
|
1532
|
+
return r === 0 || n === 0 ? 0 : t[e[r] + e[n]];
|
|
1533
|
+
}, gt;
|
|
1534
|
+
}
|
|
1535
|
+
var Ne;
|
|
1536
|
+
function Cr() {
|
|
1537
|
+
return Ne || (Ne = 1, function(t) {
|
|
1538
|
+
const e = wr();
|
|
1539
|
+
t.mul = function(r, n) {
|
|
1540
|
+
const s = new Uint8Array(r.length + n.length - 1);
|
|
1541
|
+
for (let a = 0; a < r.length; a++)
|
|
1542
|
+
for (let c = 0; c < n.length; c++)
|
|
1543
|
+
s[a + c] ^= e.mul(r[a], n[c]);
|
|
1544
|
+
return s;
|
|
1545
|
+
}, t.mod = function(r, n) {
|
|
1546
|
+
let s = new Uint8Array(r);
|
|
1547
|
+
for (; s.length - n.length >= 0; ) {
|
|
1548
|
+
const a = s[0];
|
|
1549
|
+
for (let o = 0; o < n.length; o++)
|
|
1550
|
+
s[o] ^= e.mul(n[o], a);
|
|
1551
|
+
let c = 0;
|
|
1552
|
+
for (; c < s.length && s[c] === 0; ) c++;
|
|
1553
|
+
s = s.slice(c);
|
|
1554
|
+
}
|
|
1555
|
+
return s;
|
|
1556
|
+
}, t.generateECPolynomial = function(r) {
|
|
1557
|
+
let n = new Uint8Array([1]);
|
|
1558
|
+
for (let s = 0; s < r; s++)
|
|
1559
|
+
n = t.mul(n, new Uint8Array([1, e.exp(s)]));
|
|
1560
|
+
return n;
|
|
1561
|
+
};
|
|
1562
|
+
}(Ut)), Ut;
|
|
1563
|
+
}
|
|
1564
|
+
var jt, Ue;
|
|
1565
|
+
function _r() {
|
|
1566
|
+
if (Ue) return jt;
|
|
1567
|
+
Ue = 1;
|
|
1568
|
+
const t = Cr();
|
|
1569
|
+
function e(i) {
|
|
1570
|
+
this.genPoly = void 0, this.degree = i, this.degree && this.initialize(this.degree);
|
|
1571
|
+
}
|
|
1572
|
+
return e.prototype.initialize = function(r) {
|
|
1573
|
+
this.degree = r, this.genPoly = t.generateECPolynomial(this.degree);
|
|
1574
|
+
}, e.prototype.encode = function(r) {
|
|
1575
|
+
if (!this.genPoly)
|
|
1576
|
+
throw new Error("Encoder not initialized");
|
|
1577
|
+
const n = new Uint8Array(r.length + this.degree);
|
|
1578
|
+
n.set(r);
|
|
1579
|
+
const s = t.mod(n, this.genPoly), a = this.degree - s.length;
|
|
1580
|
+
if (a > 0) {
|
|
1581
|
+
const c = new Uint8Array(this.degree);
|
|
1582
|
+
return c.set(s, a), c;
|
|
1583
|
+
}
|
|
1584
|
+
return s;
|
|
1585
|
+
}, jt = e, jt;
|
|
1586
|
+
}
|
|
1587
|
+
var Ot = {}, qt = {}, zt = {}, je;
|
|
1588
|
+
function Tn() {
|
|
1589
|
+
return je || (je = 1, zt.isValid = function(e) {
|
|
1590
|
+
return !isNaN(e) && e >= 1 && e <= 40;
|
|
1591
|
+
}), zt;
|
|
1592
|
+
}
|
|
1593
|
+
var z = {}, Oe;
|
|
1594
|
+
function kn() {
|
|
1595
|
+
if (Oe) return z;
|
|
1596
|
+
Oe = 1;
|
|
1597
|
+
const t = "[0-9]+", e = "[A-Z $%*+\\-./:]+";
|
|
1598
|
+
let i = "(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";
|
|
1599
|
+
i = i.replace(/u/g, "\\u");
|
|
1600
|
+
const r = "(?:(?![A-Z0-9 $%*+\\-./:]|" + i + `)(?:.|[\r
|
|
1601
|
+
]))+`;
|
|
1602
|
+
z.KANJI = new RegExp(i, "g"), z.BYTE_KANJI = new RegExp("[^A-Z0-9 $%*+\\-./:]+", "g"), z.BYTE = new RegExp(r, "g"), z.NUMERIC = new RegExp(t, "g"), z.ALPHANUMERIC = new RegExp(e, "g");
|
|
1603
|
+
const n = new RegExp("^" + i + "$"), s = new RegExp("^" + t + "$"), a = new RegExp("^[A-Z0-9 $%*+\\-./:]+$");
|
|
1604
|
+
return z.testKanji = function(o) {
|
|
1605
|
+
return n.test(o);
|
|
1606
|
+
}, z.testNumeric = function(o) {
|
|
1607
|
+
return s.test(o);
|
|
1608
|
+
}, z.testAlphanumeric = function(o) {
|
|
1609
|
+
return a.test(o);
|
|
1610
|
+
}, z;
|
|
1611
|
+
}
|
|
1612
|
+
var qe;
|
|
1613
|
+
function st() {
|
|
1614
|
+
return qe || (qe = 1, function(t) {
|
|
1615
|
+
const e = Tn(), i = kn();
|
|
1616
|
+
t.NUMERIC = {
|
|
1617
|
+
id: "Numeric",
|
|
1618
|
+
bit: 1,
|
|
1619
|
+
ccBits: [10, 12, 14]
|
|
1620
|
+
}, t.ALPHANUMERIC = {
|
|
1621
|
+
id: "Alphanumeric",
|
|
1622
|
+
bit: 2,
|
|
1623
|
+
ccBits: [9, 11, 13]
|
|
1624
|
+
}, t.BYTE = {
|
|
1625
|
+
id: "Byte",
|
|
1626
|
+
bit: 4,
|
|
1627
|
+
ccBits: [8, 16, 16]
|
|
1628
|
+
}, t.KANJI = {
|
|
1629
|
+
id: "Kanji",
|
|
1630
|
+
bit: 8,
|
|
1631
|
+
ccBits: [8, 10, 12]
|
|
1632
|
+
}, t.MIXED = {
|
|
1633
|
+
bit: -1
|
|
1634
|
+
}, t.getCharCountIndicator = function(s, a) {
|
|
1635
|
+
if (!s.ccBits) throw new Error("Invalid mode: " + s);
|
|
1636
|
+
if (!e.isValid(a))
|
|
1637
|
+
throw new Error("Invalid version: " + a);
|
|
1638
|
+
return a >= 1 && a < 10 ? s.ccBits[0] : a < 27 ? s.ccBits[1] : s.ccBits[2];
|
|
1639
|
+
}, t.getBestModeForData = function(s) {
|
|
1640
|
+
return i.testNumeric(s) ? t.NUMERIC : i.testAlphanumeric(s) ? t.ALPHANUMERIC : i.testKanji(s) ? t.KANJI : t.BYTE;
|
|
1641
|
+
}, t.toString = function(s) {
|
|
1642
|
+
if (s && s.id) return s.id;
|
|
1643
|
+
throw new Error("Invalid mode");
|
|
1644
|
+
}, t.isValid = function(s) {
|
|
1645
|
+
return s && s.bit && s.ccBits;
|
|
1646
|
+
};
|
|
1647
|
+
function r(n) {
|
|
1648
|
+
if (typeof n != "string")
|
|
1649
|
+
throw new Error("Param is not a string");
|
|
1650
|
+
switch (n.toLowerCase()) {
|
|
1651
|
+
case "numeric":
|
|
1652
|
+
return t.NUMERIC;
|
|
1653
|
+
case "alphanumeric":
|
|
1654
|
+
return t.ALPHANUMERIC;
|
|
1655
|
+
case "kanji":
|
|
1656
|
+
return t.KANJI;
|
|
1657
|
+
case "byte":
|
|
1658
|
+
return t.BYTE;
|
|
1659
|
+
default:
|
|
1660
|
+
throw new Error("Unknown mode: " + n);
|
|
1661
|
+
}
|
|
1662
|
+
}
|
|
1663
|
+
t.from = function(s, a) {
|
|
1664
|
+
if (t.isValid(s))
|
|
1665
|
+
return s;
|
|
1666
|
+
try {
|
|
1667
|
+
return r(s);
|
|
1668
|
+
} catch {
|
|
1669
|
+
return a;
|
|
1670
|
+
}
|
|
1671
|
+
};
|
|
1672
|
+
}(qt)), qt;
|
|
1673
|
+
}
|
|
1674
|
+
var ze;
|
|
1675
|
+
function xr() {
|
|
1676
|
+
return ze || (ze = 1, function(t) {
|
|
1677
|
+
const e = it(), i = En(), r = ye(), n = st(), s = Tn(), a = 7973, c = e.getBCHDigit(a);
|
|
1678
|
+
function o(g, h, m) {
|
|
1679
|
+
for (let f = 1; f <= 40; f++)
|
|
1680
|
+
if (h <= t.getCapacity(f, m, g))
|
|
1681
|
+
return f;
|
|
1682
|
+
}
|
|
1683
|
+
function u(g, h) {
|
|
1684
|
+
return n.getCharCountIndicator(g, h) + 4;
|
|
1685
|
+
}
|
|
1686
|
+
function l(g, h) {
|
|
1687
|
+
let m = 0;
|
|
1688
|
+
return g.forEach(function(f) {
|
|
1689
|
+
const I = u(f.mode, h);
|
|
1690
|
+
m += I + f.getBitsLength();
|
|
1691
|
+
}), m;
|
|
1692
|
+
}
|
|
1693
|
+
function d(g, h) {
|
|
1694
|
+
for (let m = 1; m <= 40; m++)
|
|
1695
|
+
if (l(g, m) <= t.getCapacity(m, h, n.MIXED))
|
|
1696
|
+
return m;
|
|
1697
|
+
}
|
|
1698
|
+
t.from = function(h, m) {
|
|
1699
|
+
return s.isValid(h) ? parseInt(h, 10) : m;
|
|
1700
|
+
}, t.getCapacity = function(h, m, f) {
|
|
1701
|
+
if (!s.isValid(h))
|
|
1702
|
+
throw new Error("Invalid QR Code version");
|
|
1703
|
+
typeof f > "u" && (f = n.BYTE);
|
|
1704
|
+
const I = e.getSymbolTotalCodewords(h), w = i.getTotalCodewordsCount(h, m), v = (I - w) * 8;
|
|
1705
|
+
if (f === n.MIXED) return v;
|
|
1706
|
+
const p = v - u(f, h);
|
|
1707
|
+
switch (f) {
|
|
1708
|
+
case n.NUMERIC:
|
|
1709
|
+
return Math.floor(p / 10 * 3);
|
|
1710
|
+
case n.ALPHANUMERIC:
|
|
1711
|
+
return Math.floor(p / 11 * 2);
|
|
1712
|
+
case n.KANJI:
|
|
1713
|
+
return Math.floor(p / 13);
|
|
1714
|
+
case n.BYTE:
|
|
1715
|
+
default:
|
|
1716
|
+
return Math.floor(p / 8);
|
|
1717
|
+
}
|
|
1718
|
+
}, t.getBestVersionForData = function(h, m) {
|
|
1719
|
+
let f;
|
|
1720
|
+
const I = r.from(m, r.M);
|
|
1721
|
+
if (Array.isArray(h)) {
|
|
1722
|
+
if (h.length > 1)
|
|
1723
|
+
return d(h, I);
|
|
1724
|
+
if (h.length === 0)
|
|
1725
|
+
return 1;
|
|
1726
|
+
f = h[0];
|
|
1727
|
+
} else
|
|
1728
|
+
f = h;
|
|
1729
|
+
return o(f.mode, f.getLength(), I);
|
|
1730
|
+
}, t.getEncodedBits = function(h) {
|
|
1731
|
+
if (!s.isValid(h) || h < 7)
|
|
1732
|
+
throw new Error("Invalid QR Code version");
|
|
1733
|
+
let m = h << 12;
|
|
1734
|
+
for (; e.getBCHDigit(m) - c >= 0; )
|
|
1735
|
+
m ^= a << e.getBCHDigit(m) - c;
|
|
1736
|
+
return h << 12 | m;
|
|
1737
|
+
};
|
|
1738
|
+
}(Ot)), Ot;
|
|
1739
|
+
}
|
|
1740
|
+
var Vt = {}, Ve;
|
|
1741
|
+
function br() {
|
|
1742
|
+
if (Ve) return Vt;
|
|
1743
|
+
Ve = 1;
|
|
1744
|
+
const t = it(), e = 1335, i = 21522, r = t.getBCHDigit(e);
|
|
1745
|
+
return Vt.getEncodedBits = function(s, a) {
|
|
1746
|
+
const c = s.bit << 3 | a;
|
|
1747
|
+
let o = c << 10;
|
|
1748
|
+
for (; t.getBCHDigit(o) - r >= 0; )
|
|
1749
|
+
o ^= e << t.getBCHDigit(o) - r;
|
|
1750
|
+
return (c << 10 | o) ^ i;
|
|
1751
|
+
}, Vt;
|
|
1752
|
+
}
|
|
1753
|
+
var Wt = {}, Ht, We;
|
|
1754
|
+
function Pr() {
|
|
1755
|
+
if (We) return Ht;
|
|
1756
|
+
We = 1;
|
|
1757
|
+
const t = st();
|
|
1758
|
+
function e(i) {
|
|
1759
|
+
this.mode = t.NUMERIC, this.data = i.toString();
|
|
1760
|
+
}
|
|
1761
|
+
return e.getBitsLength = function(r) {
|
|
1762
|
+
return 10 * Math.floor(r / 3) + (r % 3 ? r % 3 * 3 + 1 : 0);
|
|
1763
|
+
}, e.prototype.getLength = function() {
|
|
1764
|
+
return this.data.length;
|
|
1765
|
+
}, e.prototype.getBitsLength = function() {
|
|
1766
|
+
return e.getBitsLength(this.data.length);
|
|
1767
|
+
}, e.prototype.write = function(r) {
|
|
1768
|
+
let n, s, a;
|
|
1769
|
+
for (n = 0; n + 3 <= this.data.length; n += 3)
|
|
1770
|
+
s = this.data.substr(n, 3), a = parseInt(s, 10), r.put(a, 10);
|
|
1771
|
+
const c = this.data.length - n;
|
|
1772
|
+
c > 0 && (s = this.data.substr(n), a = parseInt(s, 10), r.put(a, c * 3 + 1));
|
|
1773
|
+
}, Ht = e, Ht;
|
|
1774
|
+
}
|
|
1775
|
+
var Yt, He;
|
|
1776
|
+
function Er() {
|
|
1777
|
+
if (He) return Yt;
|
|
1778
|
+
He = 1;
|
|
1779
|
+
const t = st(), e = [
|
|
1780
|
+
"0",
|
|
1781
|
+
"1",
|
|
1782
|
+
"2",
|
|
1783
|
+
"3",
|
|
1784
|
+
"4",
|
|
1785
|
+
"5",
|
|
1786
|
+
"6",
|
|
1787
|
+
"7",
|
|
1788
|
+
"8",
|
|
1789
|
+
"9",
|
|
1790
|
+
"A",
|
|
1791
|
+
"B",
|
|
1792
|
+
"C",
|
|
1793
|
+
"D",
|
|
1794
|
+
"E",
|
|
1795
|
+
"F",
|
|
1796
|
+
"G",
|
|
1797
|
+
"H",
|
|
1798
|
+
"I",
|
|
1799
|
+
"J",
|
|
1800
|
+
"K",
|
|
1801
|
+
"L",
|
|
1802
|
+
"M",
|
|
1803
|
+
"N",
|
|
1804
|
+
"O",
|
|
1805
|
+
"P",
|
|
1806
|
+
"Q",
|
|
1807
|
+
"R",
|
|
1808
|
+
"S",
|
|
1809
|
+
"T",
|
|
1810
|
+
"U",
|
|
1811
|
+
"V",
|
|
1812
|
+
"W",
|
|
1813
|
+
"X",
|
|
1814
|
+
"Y",
|
|
1815
|
+
"Z",
|
|
1816
|
+
" ",
|
|
1817
|
+
"$",
|
|
1818
|
+
"%",
|
|
1819
|
+
"*",
|
|
1820
|
+
"+",
|
|
1821
|
+
"-",
|
|
1822
|
+
".",
|
|
1823
|
+
"/",
|
|
1824
|
+
":"
|
|
1825
|
+
];
|
|
1826
|
+
function i(r) {
|
|
1827
|
+
this.mode = t.ALPHANUMERIC, this.data = r;
|
|
1828
|
+
}
|
|
1829
|
+
return i.getBitsLength = function(n) {
|
|
1830
|
+
return 11 * Math.floor(n / 2) + 6 * (n % 2);
|
|
1831
|
+
}, i.prototype.getLength = function() {
|
|
1832
|
+
return this.data.length;
|
|
1833
|
+
}, i.prototype.getBitsLength = function() {
|
|
1834
|
+
return i.getBitsLength(this.data.length);
|
|
1835
|
+
}, i.prototype.write = function(n) {
|
|
1836
|
+
let s;
|
|
1837
|
+
for (s = 0; s + 2 <= this.data.length; s += 2) {
|
|
1838
|
+
let a = e.indexOf(this.data[s]) * 45;
|
|
1839
|
+
a += e.indexOf(this.data[s + 1]), n.put(a, 11);
|
|
1840
|
+
}
|
|
1841
|
+
this.data.length % 2 && n.put(e.indexOf(this.data[s]), 6);
|
|
1842
|
+
}, Yt = i, Yt;
|
|
1843
|
+
}
|
|
1844
|
+
var Kt, Ye;
|
|
1845
|
+
function Tr() {
|
|
1846
|
+
return Ye || (Ye = 1, Kt = function(e) {
|
|
1847
|
+
for (var i = [], r = e.length, n = 0; n < r; n++) {
|
|
1848
|
+
var s = e.charCodeAt(n);
|
|
1849
|
+
if (s >= 55296 && s <= 56319 && r > n + 1) {
|
|
1850
|
+
var a = e.charCodeAt(n + 1);
|
|
1851
|
+
a >= 56320 && a <= 57343 && (s = (s - 55296) * 1024 + a - 56320 + 65536, n += 1);
|
|
1852
|
+
}
|
|
1853
|
+
if (s < 128) {
|
|
1854
|
+
i.push(s);
|
|
1855
|
+
continue;
|
|
1856
|
+
}
|
|
1857
|
+
if (s < 2048) {
|
|
1858
|
+
i.push(s >> 6 | 192), i.push(s & 63 | 128);
|
|
1859
|
+
continue;
|
|
1860
|
+
}
|
|
1861
|
+
if (s < 55296 || s >= 57344 && s < 65536) {
|
|
1862
|
+
i.push(s >> 12 | 224), i.push(s >> 6 & 63 | 128), i.push(s & 63 | 128);
|
|
1863
|
+
continue;
|
|
1864
|
+
}
|
|
1865
|
+
if (s >= 65536 && s <= 1114111) {
|
|
1866
|
+
i.push(s >> 18 | 240), i.push(s >> 12 & 63 | 128), i.push(s >> 6 & 63 | 128), i.push(s & 63 | 128);
|
|
1867
|
+
continue;
|
|
1868
|
+
}
|
|
1869
|
+
i.push(239, 191, 189);
|
|
1870
|
+
}
|
|
1871
|
+
return new Uint8Array(i).buffer;
|
|
1872
|
+
}), Kt;
|
|
1873
|
+
}
|
|
1874
|
+
var Gt, Ke;
|
|
1875
|
+
function kr() {
|
|
1876
|
+
if (Ke) return Gt;
|
|
1877
|
+
Ke = 1;
|
|
1878
|
+
const t = Tr(), e = st();
|
|
1879
|
+
function i(r) {
|
|
1880
|
+
this.mode = e.BYTE, typeof r == "string" && (r = t(r)), this.data = new Uint8Array(r);
|
|
1881
|
+
}
|
|
1882
|
+
return i.getBitsLength = function(n) {
|
|
1883
|
+
return n * 8;
|
|
1884
|
+
}, i.prototype.getLength = function() {
|
|
1885
|
+
return this.data.length;
|
|
1886
|
+
}, i.prototype.getBitsLength = function() {
|
|
1887
|
+
return i.getBitsLength(this.data.length);
|
|
1888
|
+
}, i.prototype.write = function(r) {
|
|
1889
|
+
for (let n = 0, s = this.data.length; n < s; n++)
|
|
1890
|
+
r.put(this.data[n], 8);
|
|
1891
|
+
}, Gt = i, Gt;
|
|
1892
|
+
}
|
|
1893
|
+
var Jt, Ge;
|
|
1894
|
+
function Sr() {
|
|
1895
|
+
if (Ge) return Jt;
|
|
1896
|
+
Ge = 1;
|
|
1897
|
+
const t = st(), e = it();
|
|
1898
|
+
function i(r) {
|
|
1899
|
+
this.mode = t.KANJI, this.data = r;
|
|
1900
|
+
}
|
|
1901
|
+
return i.getBitsLength = function(n) {
|
|
1902
|
+
return n * 13;
|
|
1903
|
+
}, i.prototype.getLength = function() {
|
|
1904
|
+
return this.data.length;
|
|
1905
|
+
}, i.prototype.getBitsLength = function() {
|
|
1906
|
+
return i.getBitsLength(this.data.length);
|
|
1907
|
+
}, i.prototype.write = function(r) {
|
|
1908
|
+
let n;
|
|
1909
|
+
for (n = 0; n < this.data.length; n++) {
|
|
1910
|
+
let s = e.toSJIS(this.data[n]);
|
|
1911
|
+
if (s >= 33088 && s <= 40956)
|
|
1912
|
+
s -= 33088;
|
|
1913
|
+
else if (s >= 57408 && s <= 60351)
|
|
1914
|
+
s -= 49472;
|
|
1915
|
+
else
|
|
1916
|
+
throw new Error(
|
|
1917
|
+
"Invalid SJIS character: " + this.data[n] + `
|
|
1918
|
+
Make sure your charset is UTF-8`
|
|
1919
|
+
);
|
|
1920
|
+
s = (s >>> 8 & 255) * 192 + (s & 255), r.put(s, 13);
|
|
1921
|
+
}
|
|
1922
|
+
}, Jt = i, Jt;
|
|
1923
|
+
}
|
|
1924
|
+
var Qt = { exports: {} }, Je;
|
|
1925
|
+
function Mr() {
|
|
1926
|
+
return Je || (Je = 1, function(t) {
|
|
1927
|
+
var e = {
|
|
1928
|
+
single_source_shortest_paths: function(i, r, n) {
|
|
1929
|
+
var s = {}, a = {};
|
|
1930
|
+
a[r] = 0;
|
|
1931
|
+
var c = e.PriorityQueue.make();
|
|
1932
|
+
c.push(r, 0);
|
|
1933
|
+
for (var o, u, l, d, g, h, m, f, I; !c.empty(); ) {
|
|
1934
|
+
o = c.pop(), u = o.value, d = o.cost, g = i[u] || {};
|
|
1935
|
+
for (l in g)
|
|
1936
|
+
g.hasOwnProperty(l) && (h = g[l], m = d + h, f = a[l], I = typeof a[l] > "u", (I || f > m) && (a[l] = m, c.push(l, m), s[l] = u));
|
|
1937
|
+
}
|
|
1938
|
+
if (typeof n < "u" && typeof a[n] > "u") {
|
|
1939
|
+
var w = ["Could not find a path from ", r, " to ", n, "."].join("");
|
|
1940
|
+
throw new Error(w);
|
|
1941
|
+
}
|
|
1942
|
+
return s;
|
|
1943
|
+
},
|
|
1944
|
+
extract_shortest_path_from_predecessor_list: function(i, r) {
|
|
1945
|
+
for (var n = [], s = r; s; )
|
|
1946
|
+
n.push(s), i[s], s = i[s];
|
|
1947
|
+
return n.reverse(), n;
|
|
1948
|
+
},
|
|
1949
|
+
find_path: function(i, r, n) {
|
|
1950
|
+
var s = e.single_source_shortest_paths(i, r, n);
|
|
1951
|
+
return e.extract_shortest_path_from_predecessor_list(
|
|
1952
|
+
s,
|
|
1953
|
+
n
|
|
1954
|
+
);
|
|
1955
|
+
},
|
|
1956
|
+
/**
|
|
1957
|
+
* A very naive priority queue implementation.
|
|
1958
|
+
*/
|
|
1959
|
+
PriorityQueue: {
|
|
1960
|
+
make: function(i) {
|
|
1961
|
+
var r = e.PriorityQueue, n = {}, s;
|
|
1962
|
+
i = i || {};
|
|
1963
|
+
for (s in r)
|
|
1964
|
+
r.hasOwnProperty(s) && (n[s] = r[s]);
|
|
1965
|
+
return n.queue = [], n.sorter = i.sorter || r.default_sorter, n;
|
|
1966
|
+
},
|
|
1967
|
+
default_sorter: function(i, r) {
|
|
1968
|
+
return i.cost - r.cost;
|
|
1969
|
+
},
|
|
1970
|
+
/**
|
|
1971
|
+
* Add a new item to the queue and ensure the highest priority element
|
|
1972
|
+
* is at the front of the queue.
|
|
1973
|
+
*/
|
|
1974
|
+
push: function(i, r) {
|
|
1975
|
+
var n = { value: i, cost: r };
|
|
1976
|
+
this.queue.push(n), this.queue.sort(this.sorter);
|
|
1977
|
+
},
|
|
1978
|
+
/**
|
|
1979
|
+
* Return the highest priority element in the queue.
|
|
1980
|
+
*/
|
|
1981
|
+
pop: function() {
|
|
1982
|
+
return this.queue.shift();
|
|
1983
|
+
},
|
|
1984
|
+
empty: function() {
|
|
1985
|
+
return this.queue.length === 0;
|
|
1986
|
+
}
|
|
1987
|
+
}
|
|
1988
|
+
};
|
|
1989
|
+
t.exports = e;
|
|
1990
|
+
}(Qt)), Qt.exports;
|
|
1991
|
+
}
|
|
1992
|
+
var Qe;
|
|
1993
|
+
function Ir() {
|
|
1994
|
+
return Qe || (Qe = 1, function(t) {
|
|
1995
|
+
const e = st(), i = Pr(), r = Er(), n = kr(), s = Sr(), a = kn(), c = it(), o = Mr();
|
|
1996
|
+
function u(w) {
|
|
1997
|
+
return unescape(encodeURIComponent(w)).length;
|
|
1998
|
+
}
|
|
1999
|
+
function l(w, v, p) {
|
|
2000
|
+
const _ = [];
|
|
2001
|
+
let $;
|
|
2002
|
+
for (; ($ = w.exec(p)) !== null; )
|
|
2003
|
+
_.push({
|
|
2004
|
+
data: $[0],
|
|
2005
|
+
index: $.index,
|
|
2006
|
+
mode: v,
|
|
2007
|
+
length: $[0].length
|
|
2008
|
+
});
|
|
2009
|
+
return _;
|
|
2010
|
+
}
|
|
2011
|
+
function d(w) {
|
|
2012
|
+
const v = l(a.NUMERIC, e.NUMERIC, w), p = l(a.ALPHANUMERIC, e.ALPHANUMERIC, w);
|
|
2013
|
+
let _, $;
|
|
2014
|
+
return c.isKanjiModeEnabled() ? (_ = l(a.BYTE, e.BYTE, w), $ = l(a.KANJI, e.KANJI, w)) : (_ = l(a.BYTE_KANJI, e.BYTE, w), $ = []), v.concat(p, _, $).sort(function(T, S) {
|
|
2015
|
+
return T.index - S.index;
|
|
2016
|
+
}).map(function(T) {
|
|
2017
|
+
return {
|
|
2018
|
+
data: T.data,
|
|
2019
|
+
mode: T.mode,
|
|
2020
|
+
length: T.length
|
|
2021
|
+
};
|
|
2022
|
+
});
|
|
2023
|
+
}
|
|
2024
|
+
function g(w, v) {
|
|
2025
|
+
switch (v) {
|
|
2026
|
+
case e.NUMERIC:
|
|
2027
|
+
return i.getBitsLength(w);
|
|
2028
|
+
case e.ALPHANUMERIC:
|
|
2029
|
+
return r.getBitsLength(w);
|
|
2030
|
+
case e.KANJI:
|
|
2031
|
+
return s.getBitsLength(w);
|
|
2032
|
+
case e.BYTE:
|
|
2033
|
+
return n.getBitsLength(w);
|
|
2034
|
+
}
|
|
2035
|
+
}
|
|
2036
|
+
function h(w) {
|
|
2037
|
+
return w.reduce(function(v, p) {
|
|
2038
|
+
const _ = v.length - 1 >= 0 ? v[v.length - 1] : null;
|
|
2039
|
+
return _ && _.mode === p.mode ? (v[v.length - 1].data += p.data, v) : (v.push(p), v);
|
|
2040
|
+
}, []);
|
|
2041
|
+
}
|
|
2042
|
+
function m(w) {
|
|
2043
|
+
const v = [];
|
|
2044
|
+
for (let p = 0; p < w.length; p++) {
|
|
2045
|
+
const _ = w[p];
|
|
2046
|
+
switch (_.mode) {
|
|
2047
|
+
case e.NUMERIC:
|
|
2048
|
+
v.push([
|
|
2049
|
+
_,
|
|
2050
|
+
{ data: _.data, mode: e.ALPHANUMERIC, length: _.length },
|
|
2051
|
+
{ data: _.data, mode: e.BYTE, length: _.length }
|
|
2052
|
+
]);
|
|
2053
|
+
break;
|
|
2054
|
+
case e.ALPHANUMERIC:
|
|
2055
|
+
v.push([
|
|
2056
|
+
_,
|
|
2057
|
+
{ data: _.data, mode: e.BYTE, length: _.length }
|
|
2058
|
+
]);
|
|
2059
|
+
break;
|
|
2060
|
+
case e.KANJI:
|
|
2061
|
+
v.push([
|
|
2062
|
+
_,
|
|
2063
|
+
{ data: _.data, mode: e.BYTE, length: u(_.data) }
|
|
2064
|
+
]);
|
|
2065
|
+
break;
|
|
2066
|
+
case e.BYTE:
|
|
2067
|
+
v.push([
|
|
2068
|
+
{ data: _.data, mode: e.BYTE, length: u(_.data) }
|
|
2069
|
+
]);
|
|
2070
|
+
}
|
|
2071
|
+
}
|
|
2072
|
+
return v;
|
|
2073
|
+
}
|
|
2074
|
+
function f(w, v) {
|
|
2075
|
+
const p = {}, _ = { start: {} };
|
|
2076
|
+
let $ = ["start"];
|
|
2077
|
+
for (let y = 0; y < w.length; y++) {
|
|
2078
|
+
const T = w[y], S = [];
|
|
2079
|
+
for (let x = 0; x < T.length; x++) {
|
|
2080
|
+
const C = T[x], E = "" + y + x;
|
|
2081
|
+
S.push(E), p[E] = { node: C, lastCount: 0 }, _[E] = {};
|
|
2082
|
+
for (let M = 0; M < $.length; M++) {
|
|
2083
|
+
const b = $[M];
|
|
2084
|
+
p[b] && p[b].node.mode === C.mode ? (_[b][E] = g(p[b].lastCount + C.length, C.mode) - g(p[b].lastCount, C.mode), p[b].lastCount += C.length) : (p[b] && (p[b].lastCount = C.length), _[b][E] = g(C.length, C.mode) + 4 + e.getCharCountIndicator(C.mode, v));
|
|
2085
|
+
}
|
|
2086
|
+
}
|
|
2087
|
+
$ = S;
|
|
2088
|
+
}
|
|
2089
|
+
for (let y = 0; y < $.length; y++)
|
|
2090
|
+
_[$[y]].end = 0;
|
|
2091
|
+
return { map: _, table: p };
|
|
2092
|
+
}
|
|
2093
|
+
function I(w, v) {
|
|
2094
|
+
let p;
|
|
2095
|
+
const _ = e.getBestModeForData(w);
|
|
2096
|
+
if (p = e.from(v, _), p !== e.BYTE && p.bit < _.bit)
|
|
2097
|
+
throw new Error('"' + w + '" cannot be encoded with mode ' + e.toString(p) + `.
|
|
2098
|
+
Suggested mode is: ` + e.toString(_));
|
|
2099
|
+
switch (p === e.KANJI && !c.isKanjiModeEnabled() && (p = e.BYTE), p) {
|
|
2100
|
+
case e.NUMERIC:
|
|
2101
|
+
return new i(w);
|
|
2102
|
+
case e.ALPHANUMERIC:
|
|
2103
|
+
return new r(w);
|
|
2104
|
+
case e.KANJI:
|
|
2105
|
+
return new s(w);
|
|
2106
|
+
case e.BYTE:
|
|
2107
|
+
return new n(w);
|
|
2108
|
+
}
|
|
2109
|
+
}
|
|
2110
|
+
t.fromArray = function(v) {
|
|
2111
|
+
return v.reduce(function(p, _) {
|
|
2112
|
+
return typeof _ == "string" ? p.push(I(_, null)) : _.data && p.push(I(_.data, _.mode)), p;
|
|
2113
|
+
}, []);
|
|
2114
|
+
}, t.fromString = function(v, p) {
|
|
2115
|
+
const _ = d(v, c.isKanjiModeEnabled()), $ = m(_), y = f($, p), T = o.find_path(y.map, "start", "end"), S = [];
|
|
2116
|
+
for (let x = 1; x < T.length - 1; x++)
|
|
2117
|
+
S.push(y.table[T[x]].node);
|
|
2118
|
+
return t.fromArray(h(S));
|
|
2119
|
+
}, t.rawSplit = function(v) {
|
|
2120
|
+
return t.fromArray(
|
|
2121
|
+
d(v, c.isKanjiModeEnabled())
|
|
2122
|
+
);
|
|
2123
|
+
};
|
|
2124
|
+
}(Wt)), Wt;
|
|
2125
|
+
}
|
|
2126
|
+
var Xe;
|
|
2127
|
+
function Ar() {
|
|
2128
|
+
if (Xe) return Dt;
|
|
2129
|
+
Xe = 1;
|
|
2130
|
+
const t = it(), e = ye(), i = gr(), r = mr(), n = pr(), s = vr(), a = yr(), c = En(), o = _r(), u = xr(), l = br(), d = st(), g = Ir();
|
|
2131
|
+
function h(y, T) {
|
|
2132
|
+
const S = y.size, x = s.getPositions(T);
|
|
2133
|
+
for (let C = 0; C < x.length; C++) {
|
|
2134
|
+
const E = x[C][0], M = x[C][1];
|
|
2135
|
+
for (let b = -1; b <= 7; b++)
|
|
2136
|
+
if (!(E + b <= -1 || S <= E + b))
|
|
2137
|
+
for (let A = -1; A <= 7; A++)
|
|
2138
|
+
M + A <= -1 || S <= M + A || (b >= 0 && b <= 6 && (A === 0 || A === 6) || A >= 0 && A <= 6 && (b === 0 || b === 6) || b >= 2 && b <= 4 && A >= 2 && A <= 4 ? y.set(E + b, M + A, !0, !0) : y.set(E + b, M + A, !1, !0));
|
|
2139
|
+
}
|
|
2140
|
+
}
|
|
2141
|
+
function m(y) {
|
|
2142
|
+
const T = y.size;
|
|
2143
|
+
for (let S = 8; S < T - 8; S++) {
|
|
2144
|
+
const x = S % 2 === 0;
|
|
2145
|
+
y.set(S, 6, x, !0), y.set(6, S, x, !0);
|
|
2146
|
+
}
|
|
2147
|
+
}
|
|
2148
|
+
function f(y, T) {
|
|
2149
|
+
const S = n.getPositions(T);
|
|
2150
|
+
for (let x = 0; x < S.length; x++) {
|
|
2151
|
+
const C = S[x][0], E = S[x][1];
|
|
2152
|
+
for (let M = -2; M <= 2; M++)
|
|
2153
|
+
for (let b = -2; b <= 2; b++)
|
|
2154
|
+
M === -2 || M === 2 || b === -2 || b === 2 || M === 0 && b === 0 ? y.set(C + M, E + b, !0, !0) : y.set(C + M, E + b, !1, !0);
|
|
2155
|
+
}
|
|
2156
|
+
}
|
|
2157
|
+
function I(y, T) {
|
|
2158
|
+
const S = y.size, x = u.getEncodedBits(T);
|
|
2159
|
+
let C, E, M;
|
|
2160
|
+
for (let b = 0; b < 18; b++)
|
|
2161
|
+
C = Math.floor(b / 3), E = b % 3 + S - 8 - 3, M = (x >> b & 1) === 1, y.set(C, E, M, !0), y.set(E, C, M, !0);
|
|
2162
|
+
}
|
|
2163
|
+
function w(y, T, S) {
|
|
2164
|
+
const x = y.size, C = l.getEncodedBits(T, S);
|
|
2165
|
+
let E, M;
|
|
2166
|
+
for (E = 0; E < 15; E++)
|
|
2167
|
+
M = (C >> E & 1) === 1, E < 6 ? y.set(E, 8, M, !0) : E < 8 ? y.set(E + 1, 8, M, !0) : y.set(x - 15 + E, 8, M, !0), E < 8 ? y.set(8, x - E - 1, M, !0) : E < 9 ? y.set(8, 15 - E - 1 + 1, M, !0) : y.set(8, 15 - E - 1, M, !0);
|
|
2168
|
+
y.set(x - 8, 8, 1, !0);
|
|
2169
|
+
}
|
|
2170
|
+
function v(y, T) {
|
|
2171
|
+
const S = y.size;
|
|
2172
|
+
let x = -1, C = S - 1, E = 7, M = 0;
|
|
2173
|
+
for (let b = S - 1; b > 0; b -= 2)
|
|
2174
|
+
for (b === 6 && b--; ; ) {
|
|
2175
|
+
for (let A = 0; A < 2; A++)
|
|
2176
|
+
if (!y.isReserved(C, b - A)) {
|
|
2177
|
+
let O = !1;
|
|
2178
|
+
M < T.length && (O = (T[M] >>> E & 1) === 1), y.set(C, b - A, O), E--, E === -1 && (M++, E = 7);
|
|
2179
|
+
}
|
|
2180
|
+
if (C += x, C < 0 || S <= C) {
|
|
2181
|
+
C -= x, x = -x;
|
|
2182
|
+
break;
|
|
2183
|
+
}
|
|
2184
|
+
}
|
|
2185
|
+
}
|
|
2186
|
+
function p(y, T, S) {
|
|
2187
|
+
const x = new i();
|
|
2188
|
+
S.forEach(function(A) {
|
|
2189
|
+
x.put(A.mode.bit, 4), x.put(A.getLength(), d.getCharCountIndicator(A.mode, y)), A.write(x);
|
|
2190
|
+
});
|
|
2191
|
+
const C = t.getSymbolTotalCodewords(y), E = c.getTotalCodewordsCount(y, T), M = (C - E) * 8;
|
|
2192
|
+
for (x.getLengthInBits() + 4 <= M && x.put(0, 4); x.getLengthInBits() % 8 !== 0; )
|
|
2193
|
+
x.putBit(0);
|
|
2194
|
+
const b = (M - x.getLengthInBits()) / 8;
|
|
2195
|
+
for (let A = 0; A < b; A++)
|
|
2196
|
+
x.put(A % 2 ? 17 : 236, 8);
|
|
2197
|
+
return _(x, y, T);
|
|
2198
|
+
}
|
|
2199
|
+
function _(y, T, S) {
|
|
2200
|
+
const x = t.getSymbolTotalCodewords(T), C = c.getTotalCodewordsCount(T, S), E = x - C, M = c.getBlocksCount(T, S), b = x % M, A = M - b, O = Math.floor(x / M), tt = Math.floor(E / M), J = tt + 1, Q = O - tt, et = new o(Q);
|
|
2201
|
+
let ot = 0;
|
|
2202
|
+
const nt = new Array(M), ft = new Array(M);
|
|
2203
|
+
let H = 0;
|
|
2204
|
+
const pt = new Uint8Array(y.buffer);
|
|
2205
|
+
for (let at = 0; at < M; at++) {
|
|
2206
|
+
const St = at < A ? tt : J;
|
|
2207
|
+
nt[at] = pt.slice(ot, ot + St), ft[at] = et.encode(nt[at]), ot += St, H = Math.max(H, St);
|
|
2208
|
+
}
|
|
2209
|
+
const rt = new Uint8Array(x);
|
|
2210
|
+
let vt = 0, Y, K;
|
|
2211
|
+
for (Y = 0; Y < H; Y++)
|
|
2212
|
+
for (K = 0; K < M; K++)
|
|
2213
|
+
Y < nt[K].length && (rt[vt++] = nt[K][Y]);
|
|
2214
|
+
for (Y = 0; Y < Q; Y++)
|
|
2215
|
+
for (K = 0; K < M; K++)
|
|
2216
|
+
rt[vt++] = ft[K][Y];
|
|
2217
|
+
return rt;
|
|
2218
|
+
}
|
|
2219
|
+
function $(y, T, S, x) {
|
|
2220
|
+
let C;
|
|
2221
|
+
if (Array.isArray(y))
|
|
2222
|
+
C = g.fromArray(y);
|
|
2223
|
+
else if (typeof y == "string") {
|
|
2224
|
+
let O = T;
|
|
2225
|
+
if (!O) {
|
|
2226
|
+
const tt = g.rawSplit(y);
|
|
2227
|
+
O = u.getBestVersionForData(tt, S);
|
|
2228
|
+
}
|
|
2229
|
+
C = g.fromString(y, O || 40);
|
|
2230
|
+
} else
|
|
2231
|
+
throw new Error("Invalid data");
|
|
2232
|
+
const E = u.getBestVersionForData(C, S);
|
|
2233
|
+
if (!E)
|
|
2234
|
+
throw new Error("The amount of data is too big to be stored in a QR Code");
|
|
2235
|
+
if (!T)
|
|
2236
|
+
T = E;
|
|
2237
|
+
else if (T < E)
|
|
2238
|
+
throw new Error(
|
|
2239
|
+
`
|
|
2240
|
+
The chosen QR Code version cannot contain this amount of data.
|
|
2241
|
+
Minimum version required to store current data is: ` + E + `.
|
|
2242
|
+
`
|
|
2243
|
+
);
|
|
2244
|
+
const M = p(T, S, C), b = t.getSymbolSize(T), A = new r(b);
|
|
2245
|
+
return h(A, T), m(A), f(A, T), w(A, S, 0), T >= 7 && I(A, T), v(A, M), isNaN(x) && (x = a.getBestMask(
|
|
2246
|
+
A,
|
|
2247
|
+
w.bind(null, A, S)
|
|
2248
|
+
)), a.applyMask(x, A), w(A, S, x), {
|
|
2249
|
+
modules: A,
|
|
2250
|
+
version: T,
|
|
2251
|
+
errorCorrectionLevel: S,
|
|
2252
|
+
maskPattern: x,
|
|
2253
|
+
segments: C
|
|
2254
|
+
};
|
|
2255
|
+
}
|
|
2256
|
+
return Dt.create = function(T, S) {
|
|
2257
|
+
if (typeof T > "u" || T === "")
|
|
2258
|
+
throw new Error("No input text");
|
|
2259
|
+
let x = e.M, C, E;
|
|
2260
|
+
return typeof S < "u" && (x = e.from(S.errorCorrectionLevel, e.M), C = u.from(S.version), E = a.from(S.maskPattern), S.toSJISFunc && t.setToSJISFunction(S.toSJISFunc)), $(T, C, x, E);
|
|
2261
|
+
}, Dt;
|
|
2262
|
+
}
|
|
2263
|
+
var Xt = {}, Zt = {}, Ze;
|
|
2264
|
+
function Sn() {
|
|
2265
|
+
return Ze || (Ze = 1, function(t) {
|
|
2266
|
+
function e(i) {
|
|
2267
|
+
if (typeof i == "number" && (i = i.toString()), typeof i != "string")
|
|
2268
|
+
throw new Error("Color should be defined as hex string");
|
|
2269
|
+
let r = i.slice().replace("#", "").split("");
|
|
2270
|
+
if (r.length < 3 || r.length === 5 || r.length > 8)
|
|
2271
|
+
throw new Error("Invalid hex color: " + i);
|
|
2272
|
+
(r.length === 3 || r.length === 4) && (r = Array.prototype.concat.apply([], r.map(function(s) {
|
|
2273
|
+
return [s, s];
|
|
2274
|
+
}))), r.length === 6 && r.push("F", "F");
|
|
2275
|
+
const n = parseInt(r.join(""), 16);
|
|
2276
|
+
return {
|
|
2277
|
+
r: n >> 24 & 255,
|
|
2278
|
+
g: n >> 16 & 255,
|
|
2279
|
+
b: n >> 8 & 255,
|
|
2280
|
+
a: n & 255,
|
|
2281
|
+
hex: "#" + r.slice(0, 6).join("")
|
|
2282
|
+
};
|
|
2283
|
+
}
|
|
2284
|
+
t.getOptions = function(r) {
|
|
2285
|
+
r || (r = {}), r.color || (r.color = {});
|
|
2286
|
+
const n = typeof r.margin > "u" || r.margin === null || r.margin < 0 ? 4 : r.margin, s = r.width && r.width >= 21 ? r.width : void 0, a = r.scale || 4;
|
|
2287
|
+
return {
|
|
2288
|
+
width: s,
|
|
2289
|
+
scale: s ? 4 : a,
|
|
2290
|
+
margin: n,
|
|
2291
|
+
color: {
|
|
2292
|
+
dark: e(r.color.dark || "#000000ff"),
|
|
2293
|
+
light: e(r.color.light || "#ffffffff")
|
|
2294
|
+
},
|
|
2295
|
+
type: r.type,
|
|
2296
|
+
rendererOpts: r.rendererOpts || {}
|
|
2297
|
+
};
|
|
2298
|
+
}, t.getScale = function(r, n) {
|
|
2299
|
+
return n.width && n.width >= r + n.margin * 2 ? n.width / (r + n.margin * 2) : n.scale;
|
|
2300
|
+
}, t.getImageWidth = function(r, n) {
|
|
2301
|
+
const s = t.getScale(r, n);
|
|
2302
|
+
return Math.floor((r + n.margin * 2) * s);
|
|
2303
|
+
}, t.qrToImageData = function(r, n, s) {
|
|
2304
|
+
const a = n.modules.size, c = n.modules.data, o = t.getScale(a, s), u = Math.floor((a + s.margin * 2) * o), l = s.margin * o, d = [s.color.light, s.color.dark];
|
|
2305
|
+
for (let g = 0; g < u; g++)
|
|
2306
|
+
for (let h = 0; h < u; h++) {
|
|
2307
|
+
let m = (g * u + h) * 4, f = s.color.light;
|
|
2308
|
+
if (g >= l && h >= l && g < u - l && h < u - l) {
|
|
2309
|
+
const I = Math.floor((g - l) / o), w = Math.floor((h - l) / o);
|
|
2310
|
+
f = d[c[I * a + w] ? 1 : 0];
|
|
2311
|
+
}
|
|
2312
|
+
r[m++] = f.r, r[m++] = f.g, r[m++] = f.b, r[m] = f.a;
|
|
2313
|
+
}
|
|
2314
|
+
};
|
|
2315
|
+
}(Zt)), Zt;
|
|
2316
|
+
}
|
|
2317
|
+
var tn;
|
|
2318
|
+
function Dr() {
|
|
2319
|
+
return tn || (tn = 1, function(t) {
|
|
2320
|
+
const e = Sn();
|
|
2321
|
+
function i(n, s, a) {
|
|
2322
|
+
n.clearRect(0, 0, s.width, s.height), s.style || (s.style = {}), s.height = a, s.width = a, s.style.height = a + "px", s.style.width = a + "px";
|
|
2323
|
+
}
|
|
2324
|
+
function r() {
|
|
2325
|
+
try {
|
|
2326
|
+
return document.createElement("canvas");
|
|
2327
|
+
} catch {
|
|
2328
|
+
throw new Error("You need to specify a canvas element");
|
|
2329
|
+
}
|
|
2330
|
+
}
|
|
2331
|
+
t.render = function(s, a, c) {
|
|
2332
|
+
let o = c, u = a;
|
|
2333
|
+
typeof o > "u" && (!a || !a.getContext) && (o = a, a = void 0), a || (u = r()), o = e.getOptions(o);
|
|
2334
|
+
const l = e.getImageWidth(s.modules.size, o), d = u.getContext("2d"), g = d.createImageData(l, l);
|
|
2335
|
+
return e.qrToImageData(g.data, s, o), i(d, u, l), d.putImageData(g, 0, 0), u;
|
|
2336
|
+
}, t.renderToDataURL = function(s, a, c) {
|
|
2337
|
+
let o = c;
|
|
2338
|
+
typeof o > "u" && (!a || !a.getContext) && (o = a, a = void 0), o || (o = {});
|
|
2339
|
+
const u = t.render(s, a, o), l = o.type || "image/png", d = o.rendererOpts || {};
|
|
2340
|
+
return u.toDataURL(l, d.quality);
|
|
2341
|
+
};
|
|
2342
|
+
}(Xt)), Xt;
|
|
2343
|
+
}
|
|
2344
|
+
var te = {}, en;
|
|
2345
|
+
function Br() {
|
|
2346
|
+
if (en) return te;
|
|
2347
|
+
en = 1;
|
|
2348
|
+
const t = Sn();
|
|
2349
|
+
function e(n, s) {
|
|
2350
|
+
const a = n.a / 255, c = s + '="' + n.hex + '"';
|
|
2351
|
+
return a < 1 ? c + " " + s + '-opacity="' + a.toFixed(2).slice(1) + '"' : c;
|
|
2352
|
+
}
|
|
2353
|
+
function i(n, s, a) {
|
|
2354
|
+
let c = n + s;
|
|
2355
|
+
return typeof a < "u" && (c += " " + a), c;
|
|
2356
|
+
}
|
|
2357
|
+
function r(n, s, a) {
|
|
2358
|
+
let c = "", o = 0, u = !1, l = 0;
|
|
2359
|
+
for (let d = 0; d < n.length; d++) {
|
|
2360
|
+
const g = Math.floor(d % s), h = Math.floor(d / s);
|
|
2361
|
+
!g && !u && (u = !0), n[d] ? (l++, d > 0 && g > 0 && n[d - 1] || (c += u ? i("M", g + a, 0.5 + h + a) : i("m", o, 0), o = 0, u = !1), g + 1 < s && n[d + 1] || (c += i("h", l), l = 0)) : o++;
|
|
2362
|
+
}
|
|
2363
|
+
return c;
|
|
2364
|
+
}
|
|
2365
|
+
return te.render = function(s, a, c) {
|
|
2366
|
+
const o = t.getOptions(a), u = s.modules.size, l = s.modules.data, d = u + o.margin * 2, g = o.color.light.a ? "<path " + e(o.color.light, "fill") + ' d="M0 0h' + d + "v" + d + 'H0z"/>' : "", h = "<path " + e(o.color.dark, "stroke") + ' d="' + r(l, u, o.margin) + '"/>', m = 'viewBox="0 0 ' + d + " " + d + '"', I = '<svg xmlns="http://www.w3.org/2000/svg" ' + (o.width ? 'width="' + o.width + '" height="' + o.width + '" ' : "") + m + ' shape-rendering="crispEdges">' + g + h + `</svg>
|
|
2367
|
+
`;
|
|
2368
|
+
return typeof c == "function" && c(null, I), I;
|
|
2369
|
+
}, te;
|
|
2370
|
+
}
|
|
2371
|
+
var nn;
|
|
2372
|
+
function Fr() {
|
|
2373
|
+
if (nn) return ct;
|
|
2374
|
+
nn = 1;
|
|
2375
|
+
const t = fr(), e = Ar(), i = Dr(), r = Br();
|
|
2376
|
+
function n(s, a, c, o, u) {
|
|
2377
|
+
const l = [].slice.call(arguments, 1), d = l.length, g = typeof l[d - 1] == "function";
|
|
2378
|
+
if (!g && !t())
|
|
2379
|
+
throw new Error("Callback required as last argument");
|
|
2380
|
+
if (g) {
|
|
2381
|
+
if (d < 2)
|
|
2382
|
+
throw new Error("Too few arguments provided");
|
|
2383
|
+
d === 2 ? (u = c, c = a, a = o = void 0) : d === 3 && (a.getContext && typeof u > "u" ? (u = o, o = void 0) : (u = o, o = c, c = a, a = void 0));
|
|
2384
|
+
} else {
|
|
2385
|
+
if (d < 1)
|
|
2386
|
+
throw new Error("Too few arguments provided");
|
|
2387
|
+
return d === 1 ? (c = a, a = o = void 0) : d === 2 && !a.getContext && (o = c, c = a, a = void 0), new Promise(function(h, m) {
|
|
2388
|
+
try {
|
|
2389
|
+
const f = e.create(c, o);
|
|
2390
|
+
h(s(f, a, o));
|
|
2391
|
+
} catch (f) {
|
|
2392
|
+
m(f);
|
|
2393
|
+
}
|
|
2394
|
+
});
|
|
2395
|
+
}
|
|
2396
|
+
try {
|
|
2397
|
+
const h = e.create(c, o);
|
|
2398
|
+
u(null, s(h, a, o));
|
|
2399
|
+
} catch (h) {
|
|
2400
|
+
u(h);
|
|
2401
|
+
}
|
|
2402
|
+
}
|
|
2403
|
+
return ct.create = e.create, ct.toCanvas = n.bind(null, i.render), ct.toDataURL = n.bind(null, i.renderToDataURL), ct.toString = n.bind(null, function(s, a, c) {
|
|
2404
|
+
return r.render(s, c);
|
|
2405
|
+
}), ct;
|
|
2406
|
+
}
|
|
2407
|
+
var ee = Fr();
|
|
2408
|
+
/*! vue-qrcode v2.0.0 | (c) 2018-present Chen Fengyuan | MIT */
|
|
2409
|
+
const rn = "ready";
|
|
2410
|
+
var Lr = Mn({
|
|
2411
|
+
name: "VueQrcode",
|
|
2412
|
+
props: {
|
|
2413
|
+
/**
|
|
2414
|
+
* The value of the QR code.
|
|
2415
|
+
*/
|
|
2416
|
+
value: {
|
|
2417
|
+
type: String,
|
|
2418
|
+
default: void 0
|
|
2419
|
+
},
|
|
2420
|
+
/**
|
|
2421
|
+
* The options for the QR code generator.
|
|
2422
|
+
* {@link https://github.com/soldair/node-qrcode#qr-code-options}
|
|
2423
|
+
*/
|
|
2424
|
+
options: {
|
|
2425
|
+
type: Object,
|
|
2426
|
+
default: void 0
|
|
2427
|
+
},
|
|
2428
|
+
/**
|
|
2429
|
+
* The tag name of the component's root element.
|
|
2430
|
+
*/
|
|
2431
|
+
tag: {
|
|
2432
|
+
type: String,
|
|
2433
|
+
default: "canvas"
|
|
2434
|
+
}
|
|
2435
|
+
},
|
|
2436
|
+
emits: [rn],
|
|
2437
|
+
watch: {
|
|
2438
|
+
$props: {
|
|
2439
|
+
deep: !0,
|
|
2440
|
+
immediate: !0,
|
|
2441
|
+
/**
|
|
2442
|
+
* Update the QR code when props changed.
|
|
2443
|
+
*/
|
|
2444
|
+
handler() {
|
|
2445
|
+
this.$el && this.generate();
|
|
2446
|
+
}
|
|
2447
|
+
}
|
|
2448
|
+
},
|
|
2449
|
+
mounted() {
|
|
2450
|
+
this.generate();
|
|
2451
|
+
},
|
|
2452
|
+
methods: {
|
|
2453
|
+
/**
|
|
2454
|
+
* Generate QR code.
|
|
2455
|
+
*/
|
|
2456
|
+
generate() {
|
|
2457
|
+
const t = this.options || {}, e = String(this.value), i = () => {
|
|
2458
|
+
this.$emit(rn, this.$el);
|
|
2459
|
+
};
|
|
2460
|
+
switch (this.tag) {
|
|
2461
|
+
case "canvas":
|
|
2462
|
+
ee.toCanvas(this.$el, e, t, (r) => {
|
|
2463
|
+
if (r)
|
|
2464
|
+
throw r;
|
|
2465
|
+
i();
|
|
2466
|
+
});
|
|
2467
|
+
break;
|
|
2468
|
+
case "img":
|
|
2469
|
+
ee.toDataURL(e, t, (r, n) => {
|
|
2470
|
+
if (r)
|
|
2471
|
+
throw r;
|
|
2472
|
+
this.$el.src = n, this.$el.onload = i;
|
|
2473
|
+
});
|
|
2474
|
+
break;
|
|
2475
|
+
case "svg":
|
|
2476
|
+
ee.toString(e, t, (r, n) => {
|
|
2477
|
+
if (r)
|
|
2478
|
+
throw r;
|
|
2479
|
+
const s = document.createElement("div");
|
|
2480
|
+
s.innerHTML = n;
|
|
2481
|
+
const a = s.querySelector("svg");
|
|
2482
|
+
if (a) {
|
|
2483
|
+
const { attributes: c, childNodes: o } = a;
|
|
2484
|
+
Object.keys(c).forEach((u) => {
|
|
2485
|
+
const l = c[Number(u)];
|
|
2486
|
+
this.$el.setAttribute(l.name, l.value);
|
|
2487
|
+
}), Object.keys(o).forEach((u) => {
|
|
2488
|
+
const l = o[Number(u)];
|
|
2489
|
+
this.$el.appendChild(l.cloneNode(!0));
|
|
2490
|
+
}), i();
|
|
2491
|
+
}
|
|
2492
|
+
});
|
|
2493
|
+
break;
|
|
2494
|
+
}
|
|
2495
|
+
}
|
|
2496
|
+
},
|
|
2497
|
+
render() {
|
|
2498
|
+
return re(this.tag, this.$slots.default);
|
|
2499
|
+
}
|
|
2500
|
+
});
|
|
2501
|
+
class Rr {
|
|
2502
|
+
constructor() {
|
|
2503
|
+
this._activePolls = {}, this._pollingInterval = 1e3;
|
|
2504
|
+
}
|
|
2505
|
+
_startPolling(e) {
|
|
2506
|
+
const { handler: i, interval: r } = this._activePolls[e], n = async () => {
|
|
2507
|
+
var s;
|
|
2508
|
+
await i(), (s = this._activePolls[e]) != null && s.pollActive && setTimeout(n, r || this._pollingInterval);
|
|
2509
|
+
};
|
|
2510
|
+
n();
|
|
2511
|
+
}
|
|
2512
|
+
/**
|
|
2513
|
+
* Add a new poll to the active polls list.
|
|
2514
|
+
* @param {string} options.id - Unique identifier for the poll.
|
|
2515
|
+
* @param {function} options.handler - Function to be executed when the poll is activated.
|
|
2516
|
+
* @param {number} options.interval - Time interval in milliseconds at which the poll should run.
|
|
2517
|
+
* @param {number} [options.removeAfterMs=0] - Optional. Time in milliseconds after which the poll should be automatically removed.
|
|
2518
|
+
* @param {boolean} [options.startImmediately=true] - Optional. If true, the poll will start immediately after being added.
|
|
2519
|
+
* @param {*} [options.data] - Optional. Additional data associated with the poll.
|
|
2520
|
+
* @returns {function} - A function that can be used to manually remove the poll from the active polls list.
|
|
2521
|
+
*/
|
|
2522
|
+
addPoll({
|
|
2523
|
+
id: e,
|
|
2524
|
+
handler: i,
|
|
2525
|
+
interval: r,
|
|
2526
|
+
removeAfterMs: n = 0,
|
|
2527
|
+
startImmediately: s = !0,
|
|
2528
|
+
data: a
|
|
2529
|
+
}) {
|
|
2530
|
+
if (!e || typeof i != "function")
|
|
2531
|
+
throw new Error("Invalid poll definition");
|
|
2532
|
+
if (this._activePolls[e])
|
|
2533
|
+
throw new Error("Poll with the same ID already exists");
|
|
2534
|
+
return this._activePolls[e] = { handler: i, interval: r, pollActive: !1, data: a }, s && setTimeout(() => {
|
|
2535
|
+
this.activatePoll(e);
|
|
2536
|
+
}, 0), n && setTimeout(() => {
|
|
2537
|
+
this._activePolls[e] && this.removePoll(e);
|
|
2538
|
+
}, n), () => this.removePoll(e);
|
|
2539
|
+
}
|
|
2540
|
+
activatePoll(e) {
|
|
2541
|
+
if (!this._activePolls[e])
|
|
2542
|
+
throw new Error("Poll not found");
|
|
2543
|
+
this._activePolls[e].pollActive || (this._activePolls[e].pollActive = !0, this._startPolling(e));
|
|
2544
|
+
}
|
|
2545
|
+
deactivatePoll(e) {
|
|
2546
|
+
if (!this._activePolls[e]) {
|
|
2547
|
+
console.warn("[deactivatePoll] Poll not found");
|
|
2548
|
+
return;
|
|
2549
|
+
}
|
|
2550
|
+
this._activePolls[e].pollActive = !1;
|
|
2551
|
+
}
|
|
2552
|
+
removePoll(e) {
|
|
2553
|
+
if (!this._activePolls[e]) {
|
|
2554
|
+
console.warn("[removePoll] Poll not found");
|
|
2555
|
+
return;
|
|
2556
|
+
}
|
|
2557
|
+
delete this._activePolls[e];
|
|
2558
|
+
}
|
|
2559
|
+
}
|
|
2560
|
+
let ne = null;
|
|
2561
|
+
function _t() {
|
|
2562
|
+
return ne || (ne = new Rr()), ne;
|
|
2563
|
+
}
|
|
2564
|
+
function $r(t) {
|
|
2565
|
+
window.history.replaceState(window.history.state, "", window.location.href);
|
|
2566
|
+
let e = "";
|
|
2567
|
+
const i = (navigator == null ? void 0 : navigator.userAgent) || "";
|
|
2568
|
+
return i.match("CriOS") ? e = "googlechromes://" : i.match("FxiOS") ? e = "firefox://" : i.match("EdgiOS") ? e = "microsoft-edge-https://" : i.match("GSA") && (e = "googleapp://open-url?url="), e + encodeURIComponent(`${window.location.href}#${t}`);
|
|
2569
|
+
}
|
|
2570
|
+
const Nr = {
|
|
2571
|
+
name: "BankIdAnswer",
|
|
2572
|
+
components: {
|
|
2573
|
+
QrCode: Lr
|
|
2574
|
+
},
|
|
2575
|
+
emits: ["loading", "error", "complete"],
|
|
2576
|
+
mixins: [dt([])],
|
|
2577
|
+
props: {
|
|
2578
|
+
onCompleteFunc: {
|
|
2579
|
+
type: Function,
|
|
2580
|
+
default: null
|
|
2581
|
+
}
|
|
2582
|
+
},
|
|
2583
|
+
data() {
|
|
2584
|
+
return {
|
|
2585
|
+
signAnswerId: null,
|
|
2586
|
+
view: "form",
|
|
2587
|
+
errorMessage: "",
|
|
2588
|
+
isLoading: !1,
|
|
2589
|
+
qrCode: null,
|
|
2590
|
+
autoStartToken: null,
|
|
2591
|
+
isMobile: !1
|
|
2592
|
+
};
|
|
2593
|
+
},
|
|
2594
|
+
computed: {
|
|
2595
|
+
viewText() {
|
|
2596
|
+
const t = (e) => this._document.$t(`answerModal.bankId.component.viewText.${e}`);
|
|
2597
|
+
return {
|
|
2598
|
+
new: {
|
|
2599
|
+
title: t("new.title"),
|
|
2600
|
+
text: t("new.text"),
|
|
2601
|
+
spinnerText: t("new.spinnerText")
|
|
2602
|
+
},
|
|
2603
|
+
waiting: {
|
|
2604
|
+
title: t("waiting.title"),
|
|
2605
|
+
text: t("waiting.text"),
|
|
2606
|
+
spinnerText: t("waiting.spinnerText")
|
|
2607
|
+
},
|
|
2608
|
+
started: {
|
|
2609
|
+
title: t("waiting.title"),
|
|
2610
|
+
text: t("waiting.text"),
|
|
2611
|
+
spinnerText: t("waiting.spinnerText")
|
|
2612
|
+
},
|
|
2613
|
+
signing: {
|
|
2614
|
+
title: t("signing.title"),
|
|
2615
|
+
text: t("signing.text"),
|
|
2616
|
+
spinnerText: t("signing.spinnerText")
|
|
2617
|
+
},
|
|
2618
|
+
error: {
|
|
2619
|
+
title: t("error.title"),
|
|
2620
|
+
text: t("error.text")
|
|
2621
|
+
},
|
|
2622
|
+
canceled: {
|
|
2623
|
+
title: t("canceled.title"),
|
|
2624
|
+
text: t("canceled.text")
|
|
2625
|
+
}
|
|
2626
|
+
};
|
|
2627
|
+
}
|
|
2628
|
+
},
|
|
2629
|
+
watch: {
|
|
2630
|
+
isLoading(t) {
|
|
2631
|
+
this.$emit("loading", t);
|
|
2632
|
+
}
|
|
2633
|
+
},
|
|
2634
|
+
created() {
|
|
2635
|
+
this.isMobile = on(), this.tryResumeSigningSession();
|
|
2636
|
+
},
|
|
2637
|
+
methods: {
|
|
2638
|
+
tryResumeSigningSession() {
|
|
2639
|
+
var i, r;
|
|
2640
|
+
const t = _t(), e = Object.keys(t._activePolls).find(
|
|
2641
|
+
(n) => n.includes("bankId-")
|
|
2642
|
+
);
|
|
2643
|
+
try {
|
|
2644
|
+
if (e) {
|
|
2645
|
+
const { signAnswerId: n, autoStartToken: s, qrCode: a } = ((i = t._activePolls[e]) == null ? void 0 : i.data) || {};
|
|
2646
|
+
this.signAnswerId = n, this.autoStartToken = s, this.qrCode = a, t.removePoll(e), (r = window.location) != null && r.hash && window.history.replaceState(
|
|
2647
|
+
window.history.state,
|
|
2648
|
+
"",
|
|
2649
|
+
window.location.pathname
|
|
2650
|
+
// clears search + hash
|
|
2651
|
+
), this.isLoading = !0, this.startPolling();
|
|
2652
|
+
}
|
|
2653
|
+
} catch {
|
|
2654
|
+
const s = this._document.$t(
|
|
2655
|
+
"answerModal.bankId.component.viewText.error.text"
|
|
2656
|
+
);
|
|
2657
|
+
wt("error", s);
|
|
2658
|
+
}
|
|
2659
|
+
},
|
|
2660
|
+
async submit({ answer: t }) {
|
|
2661
|
+
try {
|
|
2662
|
+
this.isLoading = !0;
|
|
2663
|
+
const { id: e, autoStartToken: i, qrCodeData: r } = await t({
|
|
2664
|
+
body: { isAccepted: !0 }
|
|
2665
|
+
});
|
|
2666
|
+
i && (this.autoStartToken = i), r && (this.qrCode = r), this.signAnswerId = e, this.startPolling(), this.isMobile && this.triggerAutoStart();
|
|
2667
|
+
return;
|
|
2668
|
+
} catch (e) {
|
|
2669
|
+
this.onError(e);
|
|
2670
|
+
}
|
|
2671
|
+
},
|
|
2672
|
+
async startPolling() {
|
|
2673
|
+
if (!this.signAnswerId) throw Error("Missing signAnswerId");
|
|
2674
|
+
const t = _t(), e = `bankId-${this.signAnswerId}`, i = async () => {
|
|
2675
|
+
if (!this.signAnswerId) throw Error("Missing signAnswerId");
|
|
2676
|
+
const r = () => {
|
|
2677
|
+
this.clearSignState(), t.removePoll(e);
|
|
2678
|
+
};
|
|
2679
|
+
try {
|
|
2680
|
+
const { data: n } = await an.get(this.signAnswerId);
|
|
2681
|
+
n.qrCodeData && (this.qrCode = n.qrCodeData), ["completed", "canceled"].includes(n.status) && r(), n.status === "completed" ? this.onComplete() : n.status === "canceled" ? this.onCanceled() : this.view = n.status;
|
|
2682
|
+
} catch (n) {
|
|
2683
|
+
this.onError(n), r();
|
|
2684
|
+
}
|
|
2685
|
+
};
|
|
2686
|
+
try {
|
|
2687
|
+
t.addPoll({
|
|
2688
|
+
id: e,
|
|
2689
|
+
handler: i,
|
|
2690
|
+
interval: 1e3,
|
|
2691
|
+
data: {
|
|
2692
|
+
signAnswerId: this.signAnswerId,
|
|
2693
|
+
autoStartToken: this.autoStartToken,
|
|
2694
|
+
qrCode: this.qrCode
|
|
2695
|
+
}
|
|
2696
|
+
});
|
|
2697
|
+
} catch {
|
|
2698
|
+
this.clearSignState();
|
|
2699
|
+
const n = this._document.$t(
|
|
2700
|
+
"answerModal.bankId.component.viewText.error.text"
|
|
2701
|
+
);
|
|
2702
|
+
wt("error", n);
|
|
2703
|
+
}
|
|
2704
|
+
},
|
|
2705
|
+
clearSignState() {
|
|
2706
|
+
this.autoStartToken = null, this.qrCode = null, this.isLoading = !1;
|
|
2707
|
+
},
|
|
2708
|
+
onComplete() {
|
|
2709
|
+
typeof this.onCompleteFunc == "function" && this.onCompleteFunc();
|
|
2710
|
+
},
|
|
2711
|
+
onCanceled() {
|
|
2712
|
+
this.view = "canceled", this.errorMessage = this._document.$t(
|
|
2713
|
+
"answerModal.bankId.component.signingInterrupted"
|
|
2714
|
+
);
|
|
2715
|
+
},
|
|
2716
|
+
onError(t) {
|
|
2717
|
+
var i, r;
|
|
2718
|
+
if (t.httpStatusCode === 409) throw t;
|
|
2719
|
+
this.$emit("error"), this.view = "error";
|
|
2720
|
+
const e = (r = (i = t.response) == null ? void 0 : i.data) == null ? void 0 : r.errorCode;
|
|
2721
|
+
switch (e) {
|
|
2722
|
+
case 9001:
|
|
2723
|
+
// Signing already in progress
|
|
2724
|
+
case 9002:
|
|
2725
|
+
// Signing expired, show user the message
|
|
2726
|
+
case 9003:
|
|
2727
|
+
// Signing cancelled by user
|
|
2728
|
+
case 9004:
|
|
2729
|
+
// Signing cancelled
|
|
2730
|
+
case 9005:
|
|
2731
|
+
// User certificate error
|
|
2732
|
+
case 9006:
|
|
2733
|
+
// Signing start fail
|
|
2734
|
+
case 9007:
|
|
2735
|
+
ie.warn(t);
|
|
2736
|
+
break;
|
|
2737
|
+
case 9009:
|
|
2738
|
+
this.$emit("complete");
|
|
2739
|
+
break;
|
|
2740
|
+
default:
|
|
2741
|
+
bt(t, { showMessage: !1 });
|
|
2742
|
+
}
|
|
2743
|
+
this.errorMessage = this.$i18n.te(`errors:${e}`) && this._document.$t(`answerModal.bankId.component.errors.${e}`) || this._document.$t("answerModal.bankId.component.defaultError");
|
|
2744
|
+
},
|
|
2745
|
+
triggerAutoStart() {
|
|
2746
|
+
if (!this.autoStartToken) return;
|
|
2747
|
+
let t = "bankid://", e = "null";
|
|
2748
|
+
if (this.isMobile) {
|
|
2749
|
+
const r = In(), n = (navigator == null ? void 0 : navigator.userAgent) || (navigator == null ? void 0 : navigator.vendor) || (window == null ? void 0 : window.opera), s = r === "iOS" && (/Version\/[\d.]+.*Safari/.test(n) || /GSA/.test(n)), a = r === "Android" && /Version\/[\d.]+.*Chrome/.test(n);
|
|
2750
|
+
(s || a) && (t = "https://app.bankid.com"), r === "iOS" && sn.value !== "widget" && (e = $r(this.signAnswerId));
|
|
2751
|
+
}
|
|
2752
|
+
const i = `${t}/?autostarttoken=${this.autoStartToken}&redirect=${e}`;
|
|
2753
|
+
this.isMobile ? document.location = i : this.$refs.autoStartFrame.src = i;
|
|
2754
|
+
}
|
|
2755
|
+
}
|
|
2756
|
+
}, Ur = { class: "-my-4 flex flex-col items-center" }, jr = {
|
|
2757
|
+
ref: "autoStartFrame",
|
|
2758
|
+
height: "0",
|
|
2759
|
+
width: "0",
|
|
2760
|
+
class: "hidden"
|
|
2761
|
+
}, Or = {
|
|
2762
|
+
key: 0,
|
|
2763
|
+
class: "flex h-[250px] w-[250px] items-center justify-center rounded-xl bg-gray-100"
|
|
2764
|
+
}, qr = ["textContent"], zr = { key: 2 }, Vr = {
|
|
2765
|
+
class: "flex flex-col items-center justify-center",
|
|
2766
|
+
style: { "background-color": "#183e4f", padding: `calc(2.5 * var(--rem)) calc(3 * var(--rem))
|
|
2767
|
+
calc(2 * var(--rem))` }
|
|
2768
|
+
}, Wr = ["textContent"], Hr = {
|
|
2769
|
+
class: "flex w-full flex-col items-center justify-center text-center",
|
|
2770
|
+
style: { padding: `calc(3 * var(--rem)) calc(2 * var(--rem))
|
|
2771
|
+
calc(2 * var(--rem))` }
|
|
2772
|
+
}, Yr = ["textContent"], Kr = ["textContent"];
|
|
2773
|
+
function Gr(t, e, i, r, n, s) {
|
|
2774
|
+
const a = U("CIcon"), c = U("QrCode"), o = U("CButton"), u = U("Animation");
|
|
2775
|
+
return B(), R("div", Ur, [
|
|
2776
|
+
P("iframe", jr, null, 512),
|
|
2777
|
+
["form", "signing", "error", "canceled"].includes(n.view) ? (B(), R("div", Or, [
|
|
2778
|
+
F(a, {
|
|
2779
|
+
type: "bankId",
|
|
2780
|
+
size: "50",
|
|
2781
|
+
class: "text-gray-500"
|
|
2782
|
+
})
|
|
2783
|
+
])) : N("", !0),
|
|
2784
|
+
["new", "waiting", "started"].includes(n.view) ? (B(), R(lt, { key: 1 }, [
|
|
2785
|
+
n.qrCode ? (B(), ut(c, {
|
|
2786
|
+
key: 0,
|
|
2787
|
+
value: n.qrCode,
|
|
2788
|
+
options: {
|
|
2789
|
+
width: 250,
|
|
2790
|
+
errorCorrectionLevel: "L",
|
|
2791
|
+
color: { dark: "#000000" }
|
|
2792
|
+
}
|
|
2793
|
+
}, null, 8, ["value"])) : N("", !0)
|
|
2794
|
+
], 64)) : N("", !0),
|
|
2795
|
+
F(u, { class: "w-full" }, {
|
|
2796
|
+
default: j(() => {
|
|
2797
|
+
var l;
|
|
2798
|
+
return [
|
|
2799
|
+
P("div", {
|
|
2800
|
+
key: "a",
|
|
2801
|
+
class: "min-h-[20px] pt-4 text-sm text-gray-500",
|
|
2802
|
+
textContent: D((l = s.viewText[n.view]) == null ? void 0 : l.spinnerText)
|
|
2803
|
+
}, null, 8, qr),
|
|
2804
|
+
!n.isMobile && ["new", "waiting", "started"].includes(n.view) ? (B(), ut(o, {
|
|
2805
|
+
key: "b",
|
|
2806
|
+
type: "none",
|
|
2807
|
+
pattern: "secondary",
|
|
2808
|
+
size: "small",
|
|
2809
|
+
class: "mt-4",
|
|
2810
|
+
onClick: s.triggerAutoStart
|
|
2811
|
+
}, {
|
|
2812
|
+
default: j(() => [
|
|
2813
|
+
Z(D(t._document.$t("answerModal.bankId.component.startOnThisDevice")), 1)
|
|
2814
|
+
]),
|
|
2815
|
+
_: 1
|
|
2816
|
+
}, 8, ["onClick"])) : N("", !0)
|
|
2817
|
+
];
|
|
2818
|
+
}),
|
|
2819
|
+
_: 1
|
|
2820
|
+
}),
|
|
2821
|
+
["form", "new", "waiting", "started"].includes(n.view) ? N("", !0) : (B(), R("div", zr, [
|
|
2822
|
+
F(Pt, { name: "pop-in" }, {
|
|
2823
|
+
default: j(() => [
|
|
2824
|
+
["signing", "error", "canceled"].includes(n.view) ? (B(), R("div", {
|
|
2825
|
+
key: 0,
|
|
2826
|
+
class: "bankid-popup",
|
|
2827
|
+
onClick: e[1] || (e[1] = () => {
|
|
2828
|
+
n.view = "form", n.isLoading = !1;
|
|
2829
|
+
})
|
|
2830
|
+
}, [
|
|
2831
|
+
P("div", Vr, [
|
|
2832
|
+
F(a, {
|
|
2833
|
+
type: "bankId",
|
|
2834
|
+
size: "34",
|
|
2835
|
+
class: "text-white"
|
|
2836
|
+
}),
|
|
2837
|
+
P("div", {
|
|
2838
|
+
class: "pt-4 text-sm font-medium text-white opacity-75",
|
|
2839
|
+
textContent: D(s.viewText[n.view].text)
|
|
2840
|
+
}, null, 8, Wr)
|
|
2841
|
+
]),
|
|
2842
|
+
P("div", Hr, [
|
|
2843
|
+
n.view === "signing" ? (B(), R(lt, { key: 0 }, [
|
|
2844
|
+
e[2] || (e[2] = P("div", { class: "spinner" }, null, -1)),
|
|
2845
|
+
P("div", {
|
|
2846
|
+
class: "pt-8 text-gray-500",
|
|
2847
|
+
textContent: D(s.viewText[n.view].spinnerText)
|
|
2848
|
+
}, null, 8, Yr)
|
|
2849
|
+
], 64)) : ["error", "canceled"].includes(n.view) ? (B(), R(lt, { key: 1 }, [
|
|
2850
|
+
F(a, {
|
|
2851
|
+
type: "error",
|
|
2852
|
+
size: "22",
|
|
2853
|
+
class: "mb-2.5 text-gray-400"
|
|
2854
|
+
}),
|
|
2855
|
+
P("div", {
|
|
2856
|
+
style: { "font-size": "14px" },
|
|
2857
|
+
textContent: D(n.errorMessage)
|
|
2858
|
+
}, null, 8, Kr),
|
|
2859
|
+
F(o, {
|
|
2860
|
+
loading: n.isLoading,
|
|
2861
|
+
type: "none",
|
|
2862
|
+
pattern: "secondary",
|
|
2863
|
+
size: "small",
|
|
2864
|
+
style: { "margin-top": "calc(2.5 * var(--rem))", padding: "1em", height: "initial" },
|
|
2865
|
+
onClick: e[0] || (e[0] = (l) => n.view = "form")
|
|
2866
|
+
}, {
|
|
2867
|
+
default: j(() => [
|
|
2868
|
+
Z(D(t._document.$t("tryAgain")), 1)
|
|
2869
|
+
]),
|
|
2870
|
+
_: 1
|
|
2871
|
+
}, 8, ["loading"])
|
|
2872
|
+
], 64)) : N("", !0)
|
|
2873
|
+
])
|
|
2874
|
+
])) : N("", !0)
|
|
2875
|
+
]),
|
|
2876
|
+
_: 1
|
|
2877
|
+
})
|
|
2878
|
+
]))
|
|
2879
|
+
]);
|
|
2880
|
+
}
|
|
2881
|
+
const Jr = /* @__PURE__ */ ht(Nr, [["render", Gr], ["__scopeId", "data-v-ee068373"]]), Qr = {
|
|
2882
|
+
name: "DenyAnswer",
|
|
2883
|
+
mixins: [dt([])],
|
|
2884
|
+
props: {
|
|
2885
|
+
onCompleteFunc: {
|
|
2886
|
+
type: Function,
|
|
2887
|
+
default: null
|
|
2888
|
+
}
|
|
2889
|
+
},
|
|
2890
|
+
data() {
|
|
2891
|
+
return {
|
|
2892
|
+
rejectReason: ""
|
|
2893
|
+
};
|
|
2894
|
+
},
|
|
2895
|
+
methods: {
|
|
2896
|
+
async submit({ update: t, answer: e }) {
|
|
2897
|
+
const i = [];
|
|
2898
|
+
this.rejectReason && i.push({
|
|
2899
|
+
key: "unclear-other",
|
|
2900
|
+
category: "misc",
|
|
2901
|
+
description: this.rejectReason,
|
|
2902
|
+
sentAt: this._document.lastSentAt
|
|
2903
|
+
}), await t({ body: { "data.rejectReasons": i } }), await e({ body: { isAccepted: !1 } }), typeof this.onCompleteFunc == "function" && this.onCompleteFunc();
|
|
2904
|
+
}
|
|
2905
|
+
}
|
|
2906
|
+
}, Xr = { class: "text-left" };
|
|
2907
|
+
function Zr(t, e, i, r, n, s) {
|
|
2908
|
+
const a = U("CInput");
|
|
2909
|
+
return B(), R("div", Xr, [
|
|
2910
|
+
P("label", null, D(t._document.$t("answerModal.decline.component.label")), 1),
|
|
2911
|
+
F(a, {
|
|
2912
|
+
modelValue: n.rejectReason,
|
|
2913
|
+
"onUpdate:modelValue": e[0] || (e[0] = (c) => n.rejectReason = c),
|
|
2914
|
+
type: "textarea",
|
|
2915
|
+
filled: "",
|
|
2916
|
+
"custom-class": "decline-input",
|
|
2917
|
+
style: { "margin-bottom": "calc(1.5 * var(--rem))" }
|
|
2918
|
+
}, null, 8, ["modelValue"])
|
|
2919
|
+
]);
|
|
2920
|
+
}
|
|
2921
|
+
const ti = /* @__PURE__ */ ht(Qr, [["render", Zr]]), ei = {
|
|
2922
|
+
name: "FrejaAnswer",
|
|
2923
|
+
emits: ["loading", "error", "complete"],
|
|
2924
|
+
mixins: [dt([])],
|
|
2925
|
+
props: {
|
|
2926
|
+
onCompleteFunc: {
|
|
2927
|
+
type: Function,
|
|
2928
|
+
default: null
|
|
2929
|
+
}
|
|
2930
|
+
},
|
|
2931
|
+
data() {
|
|
2932
|
+
return {
|
|
2933
|
+
signAnswerId: null,
|
|
2934
|
+
view: "form",
|
|
2935
|
+
errorMessage: "",
|
|
2936
|
+
isLoading: !1,
|
|
2937
|
+
qrCode: null,
|
|
2938
|
+
appUrl: null,
|
|
2939
|
+
isMobile: !1
|
|
2940
|
+
};
|
|
2941
|
+
},
|
|
2942
|
+
computed: {
|
|
2943
|
+
viewText() {
|
|
2944
|
+
const t = (e) => this._document.$t(`answerModal.freja.component.viewText.${e}`);
|
|
2945
|
+
return {
|
|
2946
|
+
new: {
|
|
2947
|
+
spinnerText: t("new.spinnerText")
|
|
2948
|
+
},
|
|
2949
|
+
waiting: {
|
|
2950
|
+
spinnerText: t("waiting.spinnerText")
|
|
2951
|
+
},
|
|
2952
|
+
started: {
|
|
2953
|
+
spinnerText: t("waiting.spinnerText")
|
|
2954
|
+
},
|
|
2955
|
+
signing: {
|
|
2956
|
+
text: t("signing.text"),
|
|
2957
|
+
spinnerText: t("signing.spinnerText")
|
|
2958
|
+
},
|
|
2959
|
+
error: {
|
|
2960
|
+
text: t("error.text")
|
|
2961
|
+
},
|
|
2962
|
+
canceled: {
|
|
2963
|
+
text: t("canceled.text")
|
|
2964
|
+
}
|
|
2965
|
+
};
|
|
2966
|
+
}
|
|
2967
|
+
},
|
|
2968
|
+
watch: {
|
|
2969
|
+
isLoading(t) {
|
|
2970
|
+
this.$emit("loading", t);
|
|
2971
|
+
}
|
|
2972
|
+
},
|
|
2973
|
+
created() {
|
|
2974
|
+
this.isMobile = on(), this.tryResumeSigningSession();
|
|
2975
|
+
},
|
|
2976
|
+
methods: {
|
|
2977
|
+
tryResumeSigningSession() {
|
|
2978
|
+
var i;
|
|
2979
|
+
const t = _t(), e = Object.keys(t._activePolls).find(
|
|
2980
|
+
(r) => r.includes("freja-")
|
|
2981
|
+
);
|
|
2982
|
+
try {
|
|
2983
|
+
if (e) {
|
|
2984
|
+
const { signAnswerId: r, qrCode: n, appUrl: s } = ((i = t._activePolls[e]) == null ? void 0 : i.data) || {};
|
|
2985
|
+
this.signAnswerId = r, this.qrCode = n, this.appUrl = s, t.removePoll(e), this.isLoading = !0, this.startPolling();
|
|
2986
|
+
}
|
|
2987
|
+
} catch {
|
|
2988
|
+
const n = this._document.$t(
|
|
2989
|
+
"answerModal.freja.component.viewText.error.text"
|
|
2990
|
+
);
|
|
2991
|
+
wt("error", n);
|
|
2992
|
+
}
|
|
2993
|
+
},
|
|
2994
|
+
async submit({ answer: t }) {
|
|
2995
|
+
try {
|
|
2996
|
+
this.isLoading = !0;
|
|
2997
|
+
const { id: e, qrCodeData: i, appUrl: r } = await t({
|
|
2998
|
+
body: { isAccepted: !0 }
|
|
2999
|
+
});
|
|
3000
|
+
i && (this.qrCode = i), r && (this.appUrl = r), this.signAnswerId = e, this.startPolling(), this.isMobile && this.openFrejaApp();
|
|
3001
|
+
return;
|
|
3002
|
+
} catch (e) {
|
|
3003
|
+
this.onError(e);
|
|
3004
|
+
}
|
|
3005
|
+
},
|
|
3006
|
+
async startPolling() {
|
|
3007
|
+
if (!this.signAnswerId) throw Error("Missing signAnswerId");
|
|
3008
|
+
const t = _t(), e = `freja-${this.signAnswerId}`, i = async () => {
|
|
3009
|
+
if (!this.signAnswerId) throw Error("Missing signAnswerId");
|
|
3010
|
+
const r = () => {
|
|
3011
|
+
this.clearSignState(), t.removePoll(e);
|
|
3012
|
+
};
|
|
3013
|
+
try {
|
|
3014
|
+
const { data: n } = await an.get(this.signAnswerId);
|
|
3015
|
+
n.qrCodeData && (this.qrCode = n.qrCodeData), ["completed", "canceled"].includes(n.status) && r(), n.status === "completed" ? this.onComplete() : n.status === "canceled" ? n.errorCode != null ? this.onError({
|
|
3016
|
+
response: { data: { errorCode: n.errorCode } }
|
|
3017
|
+
}) : this.onCanceled() : this.view = n.status;
|
|
3018
|
+
} catch (n) {
|
|
3019
|
+
this.onError(n), r();
|
|
3020
|
+
}
|
|
3021
|
+
};
|
|
3022
|
+
try {
|
|
3023
|
+
t.addPoll({
|
|
3024
|
+
id: e,
|
|
3025
|
+
handler: i,
|
|
3026
|
+
interval: 1e3,
|
|
3027
|
+
data: {
|
|
3028
|
+
signAnswerId: this.signAnswerId,
|
|
3029
|
+
qrCode: this.qrCode,
|
|
3030
|
+
appUrl: this.appUrl
|
|
3031
|
+
}
|
|
3032
|
+
});
|
|
3033
|
+
} catch {
|
|
3034
|
+
this.clearSignState();
|
|
3035
|
+
const n = this._document.$t(
|
|
3036
|
+
"answerModal.freja.component.viewText.error.text"
|
|
3037
|
+
);
|
|
3038
|
+
wt("error", n);
|
|
3039
|
+
}
|
|
3040
|
+
},
|
|
3041
|
+
clearSignState() {
|
|
3042
|
+
this.qrCode = null, this.appUrl = null, this.isLoading = !1;
|
|
3043
|
+
},
|
|
3044
|
+
onComplete() {
|
|
3045
|
+
typeof this.onCompleteFunc == "function" && this.onCompleteFunc();
|
|
3046
|
+
},
|
|
3047
|
+
onCanceled() {
|
|
3048
|
+
this.view = "canceled", this.errorMessage = this._document.$t(
|
|
3049
|
+
"answerModal.freja.component.signingInterrupted"
|
|
3050
|
+
);
|
|
3051
|
+
},
|
|
3052
|
+
onError(t) {
|
|
3053
|
+
var i, r;
|
|
3054
|
+
if (t.httpStatusCode === 409) throw t;
|
|
3055
|
+
switch (this.$emit("error"), this.view = "error", (r = (i = t.response) == null ? void 0 : i.data) == null ? void 0 : r.errorCode) {
|
|
3056
|
+
case 9001:
|
|
3057
|
+
case 9002:
|
|
3058
|
+
case 9003:
|
|
3059
|
+
case 9004:
|
|
3060
|
+
case 9005:
|
|
3061
|
+
case 9006:
|
|
3062
|
+
case 9007:
|
|
3063
|
+
ie.warn(t);
|
|
3064
|
+
break;
|
|
3065
|
+
case 9009:
|
|
3066
|
+
this.$emit("complete");
|
|
3067
|
+
break;
|
|
3068
|
+
case 9011:
|
|
3069
|
+
ie.warn("Freja sign canceled: SSN mismatch (errorCode 9011)"), this.errorMessage = this._document.$t(
|
|
3070
|
+
"answerModal.freja.component.ssnMismatchError"
|
|
3071
|
+
);
|
|
3072
|
+
return;
|
|
3073
|
+
default:
|
|
3074
|
+
bt(t, { showMessage: !1 });
|
|
3075
|
+
}
|
|
3076
|
+
this.errorMessage = this._document.$t(
|
|
3077
|
+
"answerModal.freja.component.defaultError"
|
|
3078
|
+
);
|
|
3079
|
+
},
|
|
3080
|
+
openFrejaApp() {
|
|
3081
|
+
this.appUrl && (window.location.href = this.appUrl);
|
|
3082
|
+
}
|
|
3083
|
+
}
|
|
3084
|
+
}, ni = { class: "-my-4 flex flex-col items-center" }, ri = {
|
|
3085
|
+
key: 0,
|
|
3086
|
+
class: "flex h-[250px] w-[250px] items-center justify-center rounded-xl bg-gray-100"
|
|
3087
|
+
}, ii = ["src"], si = ["textContent"], oi = { key: 2 }, ai = {
|
|
3088
|
+
class: "flex flex-col items-center justify-center",
|
|
3089
|
+
style: { "background-color": "#1e5799", padding: `calc(2.5 * var(--rem)) calc(3 * var(--rem))
|
|
3090
|
+
calc(2 * var(--rem))` }
|
|
3091
|
+
}, ci = ["textContent"], li = {
|
|
3092
|
+
class: "flex w-full flex-col items-center justify-center text-center",
|
|
3093
|
+
style: { padding: `calc(3 * var(--rem)) calc(2 * var(--rem))
|
|
3094
|
+
calc(2 * var(--rem))` }
|
|
3095
|
+
}, ui = ["textContent"], di = ["textContent"];
|
|
3096
|
+
function hi(t, e, i, r, n, s) {
|
|
3097
|
+
const a = U("CIcon"), c = U("CButton"), o = U("Animation");
|
|
3098
|
+
return B(), R("div", ni, [
|
|
3099
|
+
["form", "signing", "error", "canceled"].includes(n.view) ? (B(), R("div", ri, [
|
|
3100
|
+
F(a, {
|
|
3101
|
+
type: "frejaPlusText",
|
|
3102
|
+
size: "80"
|
|
3103
|
+
})
|
|
3104
|
+
])) : N("", !0),
|
|
3105
|
+
["new", "waiting", "started"].includes(n.view) ? (B(), R(lt, { key: 1 }, [
|
|
3106
|
+
n.qrCode ? (B(), R("img", {
|
|
3107
|
+
key: 0,
|
|
3108
|
+
src: `data:image/png;base64,${n.qrCode}`,
|
|
3109
|
+
alt: "Freja eID QR",
|
|
3110
|
+
width: "250",
|
|
3111
|
+
height: "250",
|
|
3112
|
+
class: "rounded-xl"
|
|
3113
|
+
}, null, 8, ii)) : N("", !0)
|
|
3114
|
+
], 64)) : N("", !0),
|
|
3115
|
+
F(o, { class: "w-full" }, {
|
|
3116
|
+
default: j(() => {
|
|
3117
|
+
var u;
|
|
3118
|
+
return [
|
|
3119
|
+
P("div", {
|
|
3120
|
+
key: "a",
|
|
3121
|
+
class: "min-h-[20px] pt-4 text-sm text-gray-500",
|
|
3122
|
+
textContent: D((u = s.viewText[n.view]) == null ? void 0 : u.spinnerText)
|
|
3123
|
+
}, null, 8, si),
|
|
3124
|
+
n.appUrl && ["new", "waiting", "started"].includes(n.view) ? (B(), ut(c, {
|
|
3125
|
+
key: "b",
|
|
3126
|
+
type: "none",
|
|
3127
|
+
pattern: "secondary",
|
|
3128
|
+
size: "small",
|
|
3129
|
+
class: "mt-4",
|
|
3130
|
+
onClick: s.openFrejaApp
|
|
3131
|
+
}, {
|
|
3132
|
+
default: j(() => [
|
|
3133
|
+
Z(D(t._document.$t("answerModal.freja.component.openApp")), 1)
|
|
3134
|
+
]),
|
|
3135
|
+
_: 1
|
|
3136
|
+
}, 8, ["onClick"])) : N("", !0)
|
|
3137
|
+
];
|
|
3138
|
+
}),
|
|
3139
|
+
_: 1
|
|
3140
|
+
}),
|
|
3141
|
+
["form", "new", "waiting", "started"].includes(n.view) ? N("", !0) : (B(), R("div", oi, [
|
|
3142
|
+
F(Pt, { name: "pop-in" }, {
|
|
3143
|
+
default: j(() => {
|
|
3144
|
+
var u, l;
|
|
3145
|
+
return [
|
|
3146
|
+
["signing", "error", "canceled"].includes(n.view) ? (B(), R("div", {
|
|
3147
|
+
key: 0,
|
|
3148
|
+
class: "freja-popup",
|
|
3149
|
+
onClick: e[1] || (e[1] = () => {
|
|
3150
|
+
n.view = "form", n.isLoading = !1;
|
|
3151
|
+
})
|
|
3152
|
+
}, [
|
|
3153
|
+
P("div", ai, [
|
|
3154
|
+
F(a, {
|
|
3155
|
+
type: "freja",
|
|
3156
|
+
size: "34",
|
|
3157
|
+
class: "text-white"
|
|
3158
|
+
}),
|
|
3159
|
+
P("div", {
|
|
3160
|
+
class: "pt-4 text-sm font-medium text-white opacity-75",
|
|
3161
|
+
textContent: D((u = s.viewText[n.view]) == null ? void 0 : u.text)
|
|
3162
|
+
}, null, 8, ci)
|
|
3163
|
+
]),
|
|
3164
|
+
P("div", li, [
|
|
3165
|
+
n.view === "signing" ? (B(), R(lt, { key: 0 }, [
|
|
3166
|
+
e[2] || (e[2] = P("div", { class: "spinner" }, null, -1)),
|
|
3167
|
+
P("div", {
|
|
3168
|
+
class: "pt-8 text-gray-500",
|
|
3169
|
+
textContent: D((l = s.viewText[n.view]) == null ? void 0 : l.spinnerText)
|
|
3170
|
+
}, null, 8, ui)
|
|
3171
|
+
], 64)) : ["error", "canceled"].includes(n.view) ? (B(), R(lt, { key: 1 }, [
|
|
3172
|
+
F(a, {
|
|
3173
|
+
type: "error",
|
|
3174
|
+
size: "22",
|
|
3175
|
+
class: "mb-2.5 text-gray-400"
|
|
3176
|
+
}),
|
|
3177
|
+
P("div", {
|
|
3178
|
+
style: { "font-size": "14px" },
|
|
3179
|
+
textContent: D(n.errorMessage)
|
|
3180
|
+
}, null, 8, di),
|
|
3181
|
+
F(c, {
|
|
3182
|
+
loading: n.isLoading,
|
|
3183
|
+
type: "none",
|
|
3184
|
+
pattern: "secondary",
|
|
3185
|
+
size: "small",
|
|
3186
|
+
style: { "margin-top": "calc(2.5 * var(--rem))", padding: "1em", height: "initial" },
|
|
3187
|
+
onClick: e[0] || (e[0] = (d) => n.view = "form")
|
|
3188
|
+
}, {
|
|
3189
|
+
default: j(() => [
|
|
3190
|
+
Z(D(t._document.$t("tryAgain")), 1)
|
|
3191
|
+
]),
|
|
3192
|
+
_: 1
|
|
3193
|
+
}, 8, ["loading"])
|
|
3194
|
+
], 64)) : N("", !0)
|
|
3195
|
+
])
|
|
3196
|
+
])) : N("", !0)
|
|
3197
|
+
];
|
|
3198
|
+
}),
|
|
3199
|
+
_: 1
|
|
3200
|
+
})
|
|
3201
|
+
]))
|
|
3202
|
+
]);
|
|
3203
|
+
}
|
|
3204
|
+
const fi = /* @__PURE__ */ ht(ei, [["render", hi], ["__scopeId", "data-v-dadf1501"]]);
|
|
3205
|
+
/*!
|
|
3206
|
+
* Signature Pad v4.0.10 | https://github.com/szimek/signature_pad
|
|
3207
|
+
* (c) 2022 Szymon Nowak | Released under the MIT license
|
|
3208
|
+
*/
|
|
3209
|
+
class xt {
|
|
3210
|
+
constructor(e, i, r, n) {
|
|
3211
|
+
if (isNaN(e) || isNaN(i))
|
|
3212
|
+
throw new Error(`Point is invalid: (${e}, ${i})`);
|
|
3213
|
+
this.x = +e, this.y = +i, this.pressure = r || 0, this.time = n || Date.now();
|
|
3214
|
+
}
|
|
3215
|
+
distanceTo(e) {
|
|
3216
|
+
return Math.sqrt(Math.pow(this.x - e.x, 2) + Math.pow(this.y - e.y, 2));
|
|
3217
|
+
}
|
|
3218
|
+
equals(e) {
|
|
3219
|
+
return this.x === e.x && this.y === e.y && this.pressure === e.pressure && this.time === e.time;
|
|
3220
|
+
}
|
|
3221
|
+
velocityFrom(e) {
|
|
3222
|
+
return this.time !== e.time ? this.distanceTo(e) / (this.time - e.time) : 0;
|
|
3223
|
+
}
|
|
3224
|
+
}
|
|
3225
|
+
class we {
|
|
3226
|
+
constructor(e, i, r, n, s, a) {
|
|
3227
|
+
this.startPoint = e, this.control2 = i, this.control1 = r, this.endPoint = n, this.startWidth = s, this.endWidth = a;
|
|
3228
|
+
}
|
|
3229
|
+
static fromPoints(e, i) {
|
|
3230
|
+
const r = this.calculateControlPoints(e[0], e[1], e[2]).c2, n = this.calculateControlPoints(e[1], e[2], e[3]).c1;
|
|
3231
|
+
return new we(e[1], r, n, e[2], i.start, i.end);
|
|
3232
|
+
}
|
|
3233
|
+
static calculateControlPoints(e, i, r) {
|
|
3234
|
+
const n = e.x - i.x, s = e.y - i.y, a = i.x - r.x, c = i.y - r.y, o = { x: (e.x + i.x) / 2, y: (e.y + i.y) / 2 }, u = { x: (i.x + r.x) / 2, y: (i.y + r.y) / 2 }, l = Math.sqrt(n * n + s * s), d = Math.sqrt(a * a + c * c), g = o.x - u.x, h = o.y - u.y, m = d / (l + d), f = { x: u.x + g * m, y: u.y + h * m }, I = i.x - f.x, w = i.y - f.y;
|
|
3235
|
+
return {
|
|
3236
|
+
c1: new xt(o.x + I, o.y + w),
|
|
3237
|
+
c2: new xt(u.x + I, u.y + w)
|
|
3238
|
+
};
|
|
3239
|
+
}
|
|
3240
|
+
length() {
|
|
3241
|
+
let i = 0, r, n;
|
|
3242
|
+
for (let s = 0; s <= 10; s += 1) {
|
|
3243
|
+
const a = s / 10, c = this.point(a, this.startPoint.x, this.control1.x, this.control2.x, this.endPoint.x), o = this.point(a, this.startPoint.y, this.control1.y, this.control2.y, this.endPoint.y);
|
|
3244
|
+
if (s > 0) {
|
|
3245
|
+
const u = c - r, l = o - n;
|
|
3246
|
+
i += Math.sqrt(u * u + l * l);
|
|
3247
|
+
}
|
|
3248
|
+
r = c, n = o;
|
|
3249
|
+
}
|
|
3250
|
+
return i;
|
|
3251
|
+
}
|
|
3252
|
+
point(e, i, r, n, s) {
|
|
3253
|
+
return i * (1 - e) * (1 - e) * (1 - e) + 3 * r * (1 - e) * (1 - e) * e + 3 * n * (1 - e) * e * e + s * e * e * e;
|
|
3254
|
+
}
|
|
3255
|
+
}
|
|
3256
|
+
class gi {
|
|
3257
|
+
constructor() {
|
|
3258
|
+
try {
|
|
3259
|
+
this._et = new EventTarget();
|
|
3260
|
+
} catch {
|
|
3261
|
+
this._et = document;
|
|
3262
|
+
}
|
|
3263
|
+
}
|
|
3264
|
+
addEventListener(e, i, r) {
|
|
3265
|
+
this._et.addEventListener(e, i, r);
|
|
3266
|
+
}
|
|
3267
|
+
dispatchEvent(e) {
|
|
3268
|
+
return this._et.dispatchEvent(e);
|
|
3269
|
+
}
|
|
3270
|
+
removeEventListener(e, i, r) {
|
|
3271
|
+
this._et.removeEventListener(e, i, r);
|
|
3272
|
+
}
|
|
3273
|
+
}
|
|
3274
|
+
function mi(t, e = 250) {
|
|
3275
|
+
let i = 0, r = null, n, s, a;
|
|
3276
|
+
const c = () => {
|
|
3277
|
+
i = Date.now(), r = null, n = t.apply(s, a), r || (s = null, a = []);
|
|
3278
|
+
};
|
|
3279
|
+
return function(...u) {
|
|
3280
|
+
const l = Date.now(), d = e - (l - i);
|
|
3281
|
+
return s = this, a = u, d <= 0 || d > e ? (r && (clearTimeout(r), r = null), i = l, n = t.apply(s, a), r || (s = null, a = [])) : r || (r = window.setTimeout(c, d)), n;
|
|
3282
|
+
};
|
|
3283
|
+
}
|
|
3284
|
+
let pi = class ae extends gi {
|
|
3285
|
+
constructor(e, i = {}) {
|
|
3286
|
+
super(), this.canvas = e, this._handleMouseDown = (r) => {
|
|
3287
|
+
r.buttons === 1 && (this._drawningStroke = !0, this._strokeBegin(r));
|
|
3288
|
+
}, this._handleMouseMove = (r) => {
|
|
3289
|
+
this._drawningStroke && this._strokeMoveUpdate(r);
|
|
3290
|
+
}, this._handleMouseUp = (r) => {
|
|
3291
|
+
r.buttons === 1 && this._drawningStroke && (this._drawningStroke = !1, this._strokeEnd(r));
|
|
3292
|
+
}, this._handleTouchStart = (r) => {
|
|
3293
|
+
if (r.cancelable && r.preventDefault(), r.targetTouches.length === 1) {
|
|
3294
|
+
const n = r.changedTouches[0];
|
|
3295
|
+
this._strokeBegin(n);
|
|
3296
|
+
}
|
|
3297
|
+
}, this._handleTouchMove = (r) => {
|
|
3298
|
+
r.cancelable && r.preventDefault();
|
|
3299
|
+
const n = r.targetTouches[0];
|
|
3300
|
+
this._strokeMoveUpdate(n);
|
|
3301
|
+
}, this._handleTouchEnd = (r) => {
|
|
3302
|
+
if (r.target === this.canvas) {
|
|
3303
|
+
r.cancelable && r.preventDefault();
|
|
3304
|
+
const s = r.changedTouches[0];
|
|
3305
|
+
this._strokeEnd(s);
|
|
3306
|
+
}
|
|
3307
|
+
}, this._handlePointerStart = (r) => {
|
|
3308
|
+
this._drawningStroke = !0, r.preventDefault(), this._strokeBegin(r);
|
|
3309
|
+
}, this._handlePointerMove = (r) => {
|
|
3310
|
+
this._drawningStroke && (r.preventDefault(), this._strokeMoveUpdate(r));
|
|
3311
|
+
}, this._handlePointerEnd = (r) => {
|
|
3312
|
+
this._drawningStroke && (r.preventDefault(), this._drawningStroke = !1, this._strokeEnd(r));
|
|
3313
|
+
}, this.velocityFilterWeight = i.velocityFilterWeight || 0.7, this.minWidth = i.minWidth || 0.5, this.maxWidth = i.maxWidth || 2.5, this.throttle = "throttle" in i ? i.throttle : 16, this.minDistance = "minDistance" in i ? i.minDistance : 5, this.dotSize = i.dotSize || 0, this.penColor = i.penColor || "black", this.backgroundColor = i.backgroundColor || "rgba(0,0,0,0)", this._strokeMoveUpdate = this.throttle ? mi(ae.prototype._strokeUpdate, this.throttle) : ae.prototype._strokeUpdate, this._ctx = e.getContext("2d"), this.clear(), this.on();
|
|
3314
|
+
}
|
|
3315
|
+
clear() {
|
|
3316
|
+
const { _ctx: e, canvas: i } = this;
|
|
3317
|
+
e.fillStyle = this.backgroundColor, e.clearRect(0, 0, i.width, i.height), e.fillRect(0, 0, i.width, i.height), this._data = [], this._reset(this._getPointGroupOptions()), this._isEmpty = !0;
|
|
3318
|
+
}
|
|
3319
|
+
fromDataURL(e, i = {}) {
|
|
3320
|
+
return new Promise((r, n) => {
|
|
3321
|
+
const s = new Image(), a = i.ratio || window.devicePixelRatio || 1, c = i.width || this.canvas.width / a, o = i.height || this.canvas.height / a, u = i.xOffset || 0, l = i.yOffset || 0;
|
|
3322
|
+
this._reset(this._getPointGroupOptions()), s.onload = () => {
|
|
3323
|
+
this._ctx.drawImage(s, u, l, c, o), r();
|
|
3324
|
+
}, s.onerror = (d) => {
|
|
3325
|
+
n(d);
|
|
3326
|
+
}, s.crossOrigin = "anonymous", s.src = e, this._isEmpty = !1;
|
|
3327
|
+
});
|
|
3328
|
+
}
|
|
3329
|
+
toDataURL(e = "image/png", i) {
|
|
3330
|
+
switch (e) {
|
|
3331
|
+
case "image/svg+xml":
|
|
3332
|
+
return this._toSVG();
|
|
3333
|
+
default:
|
|
3334
|
+
return this.canvas.toDataURL(e, i);
|
|
3335
|
+
}
|
|
3336
|
+
}
|
|
3337
|
+
on() {
|
|
3338
|
+
this.canvas.style.touchAction = "none", this.canvas.style.msTouchAction = "none", this.canvas.style.userSelect = "none";
|
|
3339
|
+
const e = /Macintosh/.test(navigator.userAgent) && "ontouchstart" in document;
|
|
3340
|
+
window.PointerEvent && !e ? this._handlePointerEvents() : (this._handleMouseEvents(), "ontouchstart" in window && this._handleTouchEvents());
|
|
3341
|
+
}
|
|
3342
|
+
off() {
|
|
3343
|
+
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);
|
|
3344
|
+
}
|
|
3345
|
+
isEmpty() {
|
|
3346
|
+
return this._isEmpty;
|
|
3347
|
+
}
|
|
3348
|
+
fromData(e, { clear: i = !0 } = {}) {
|
|
3349
|
+
i && this.clear(), this._fromData(e, this._drawCurve.bind(this), this._drawDot.bind(this)), this._data = this._data.concat(e);
|
|
3350
|
+
}
|
|
3351
|
+
toData() {
|
|
3352
|
+
return this._data;
|
|
3353
|
+
}
|
|
3354
|
+
_getPointGroupOptions(e) {
|
|
3355
|
+
return {
|
|
3356
|
+
penColor: e && "penColor" in e ? e.penColor : this.penColor,
|
|
3357
|
+
dotSize: e && "dotSize" in e ? e.dotSize : this.dotSize,
|
|
3358
|
+
minWidth: e && "minWidth" in e ? e.minWidth : this.minWidth,
|
|
3359
|
+
maxWidth: e && "maxWidth" in e ? e.maxWidth : this.maxWidth,
|
|
3360
|
+
velocityFilterWeight: e && "velocityFilterWeight" in e ? e.velocityFilterWeight : this.velocityFilterWeight
|
|
3361
|
+
};
|
|
3362
|
+
}
|
|
3363
|
+
_strokeBegin(e) {
|
|
3364
|
+
this.dispatchEvent(new CustomEvent("beginStroke", { detail: e }));
|
|
3365
|
+
const i = this._getPointGroupOptions(), r = Object.assign(Object.assign({}, i), { points: [] });
|
|
3366
|
+
this._data.push(r), this._reset(i), this._strokeUpdate(e);
|
|
3367
|
+
}
|
|
3368
|
+
_strokeUpdate(e) {
|
|
3369
|
+
if (this._data.length === 0) {
|
|
3370
|
+
this._strokeBegin(e);
|
|
3371
|
+
return;
|
|
3372
|
+
}
|
|
3373
|
+
this.dispatchEvent(new CustomEvent("beforeUpdateStroke", { detail: e }));
|
|
3374
|
+
const i = e.clientX, r = e.clientY, n = e.pressure !== void 0 ? e.pressure : e.force !== void 0 ? e.force : 0, s = this._createPoint(i, r, n), a = this._data[this._data.length - 1], c = a.points, o = c.length > 0 && c[c.length - 1], u = o ? s.distanceTo(o) <= this.minDistance : !1, l = this._getPointGroupOptions(a);
|
|
3375
|
+
if (!o || !(o && u)) {
|
|
3376
|
+
const d = this._addPoint(s, l);
|
|
3377
|
+
o ? d && this._drawCurve(d, l) : this._drawDot(s, l), c.push({
|
|
3378
|
+
time: s.time,
|
|
3379
|
+
x: s.x,
|
|
3380
|
+
y: s.y,
|
|
3381
|
+
pressure: s.pressure
|
|
3382
|
+
});
|
|
3383
|
+
}
|
|
3384
|
+
this.dispatchEvent(new CustomEvent("afterUpdateStroke", { detail: e }));
|
|
3385
|
+
}
|
|
3386
|
+
_strokeEnd(e) {
|
|
3387
|
+
this._strokeUpdate(e), this.dispatchEvent(new CustomEvent("endStroke", { detail: e }));
|
|
3388
|
+
}
|
|
3389
|
+
_handlePointerEvents() {
|
|
3390
|
+
this._drawningStroke = !1, this.canvas.addEventListener("pointerdown", this._handlePointerStart), this.canvas.addEventListener("pointermove", this._handlePointerMove), this.canvas.ownerDocument.addEventListener("pointerup", this._handlePointerEnd);
|
|
3391
|
+
}
|
|
3392
|
+
_handleMouseEvents() {
|
|
3393
|
+
this._drawningStroke = !1, this.canvas.addEventListener("mousedown", this._handleMouseDown), this.canvas.addEventListener("mousemove", this._handleMouseMove), this.canvas.ownerDocument.addEventListener("mouseup", this._handleMouseUp);
|
|
3394
|
+
}
|
|
3395
|
+
_handleTouchEvents() {
|
|
3396
|
+
this.canvas.addEventListener("touchstart", this._handleTouchStart), this.canvas.addEventListener("touchmove", this._handleTouchMove), this.canvas.addEventListener("touchend", this._handleTouchEnd);
|
|
3397
|
+
}
|
|
3398
|
+
_reset(e) {
|
|
3399
|
+
this._lastPoints = [], this._lastVelocity = 0, this._lastWidth = (e.minWidth + e.maxWidth) / 2, this._ctx.fillStyle = e.penColor;
|
|
3400
|
+
}
|
|
3401
|
+
_createPoint(e, i, r) {
|
|
3402
|
+
const n = this.canvas.getBoundingClientRect();
|
|
3403
|
+
return new xt(e - n.left, i - n.top, r, (/* @__PURE__ */ new Date()).getTime());
|
|
3404
|
+
}
|
|
3405
|
+
_addPoint(e, i) {
|
|
3406
|
+
const { _lastPoints: r } = this;
|
|
3407
|
+
if (r.push(e), r.length > 2) {
|
|
3408
|
+
r.length === 3 && r.unshift(r[0]);
|
|
3409
|
+
const n = this._calculateCurveWidths(r[1], r[2], i), s = we.fromPoints(r, n);
|
|
3410
|
+
return r.shift(), s;
|
|
3411
|
+
}
|
|
3412
|
+
return null;
|
|
3413
|
+
}
|
|
3414
|
+
_calculateCurveWidths(e, i, r) {
|
|
3415
|
+
const n = r.velocityFilterWeight * i.velocityFrom(e) + (1 - r.velocityFilterWeight) * this._lastVelocity, s = this._strokeWidth(n, r), a = {
|
|
3416
|
+
end: s,
|
|
3417
|
+
start: this._lastWidth
|
|
3418
|
+
};
|
|
3419
|
+
return this._lastVelocity = n, this._lastWidth = s, a;
|
|
3420
|
+
}
|
|
3421
|
+
_strokeWidth(e, i) {
|
|
3422
|
+
return Math.max(i.maxWidth / (e + 1), i.minWidth);
|
|
3423
|
+
}
|
|
3424
|
+
_drawCurveSegment(e, i, r) {
|
|
3425
|
+
const n = this._ctx;
|
|
3426
|
+
n.moveTo(e, i), n.arc(e, i, r, 0, 2 * Math.PI, !1), this._isEmpty = !1;
|
|
3427
|
+
}
|
|
3428
|
+
_drawCurve(e, i) {
|
|
3429
|
+
const r = this._ctx, n = e.endWidth - e.startWidth, s = Math.ceil(e.length()) * 2;
|
|
3430
|
+
r.beginPath(), r.fillStyle = i.penColor;
|
|
3431
|
+
for (let a = 0; a < s; a += 1) {
|
|
3432
|
+
const c = a / s, o = c * c, u = o * c, l = 1 - c, d = l * l, g = d * l;
|
|
3433
|
+
let h = g * e.startPoint.x;
|
|
3434
|
+
h += 3 * d * c * e.control1.x, h += 3 * l * o * e.control2.x, h += u * e.endPoint.x;
|
|
3435
|
+
let m = g * e.startPoint.y;
|
|
3436
|
+
m += 3 * d * c * e.control1.y, m += 3 * l * o * e.control2.y, m += u * e.endPoint.y;
|
|
3437
|
+
const f = Math.min(e.startWidth + u * n, i.maxWidth);
|
|
3438
|
+
this._drawCurveSegment(h, m, f);
|
|
3439
|
+
}
|
|
3440
|
+
r.closePath(), r.fill();
|
|
3441
|
+
}
|
|
3442
|
+
_drawDot(e, i) {
|
|
3443
|
+
const r = this._ctx, n = i.dotSize > 0 ? i.dotSize : (i.minWidth + i.maxWidth) / 2;
|
|
3444
|
+
r.beginPath(), this._drawCurveSegment(e.x, e.y, n), r.closePath(), r.fillStyle = i.penColor, r.fill();
|
|
3445
|
+
}
|
|
3446
|
+
_fromData(e, i, r) {
|
|
3447
|
+
for (const n of e) {
|
|
3448
|
+
const { points: s } = n, a = this._getPointGroupOptions(n);
|
|
3449
|
+
if (s.length > 1)
|
|
3450
|
+
for (let c = 0; c < s.length; c += 1) {
|
|
3451
|
+
const o = s[c], u = new xt(o.x, o.y, o.pressure, o.time);
|
|
3452
|
+
c === 0 && this._reset(a);
|
|
3453
|
+
const l = this._addPoint(u, a);
|
|
3454
|
+
l && i(l, a);
|
|
3455
|
+
}
|
|
3456
|
+
else
|
|
3457
|
+
this._reset(a), r(s[0], a);
|
|
3458
|
+
}
|
|
3459
|
+
}
|
|
3460
|
+
_toSVG() {
|
|
3461
|
+
const e = this._data, i = Math.max(window.devicePixelRatio || 1, 1), r = 0, n = 0, s = this.canvas.width / i, a = this.canvas.height / i, c = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
3462
|
+
c.setAttribute("width", this.canvas.width.toString()), c.setAttribute("height", this.canvas.height.toString()), this._fromData(e, (h, { penColor: m }) => {
|
|
3463
|
+
const f = document.createElement("path");
|
|
3464
|
+
if (!isNaN(h.control1.x) && !isNaN(h.control1.y) && !isNaN(h.control2.x) && !isNaN(h.control2.y)) {
|
|
3465
|
+
const I = `M ${h.startPoint.x.toFixed(3)},${h.startPoint.y.toFixed(3)} C ${h.control1.x.toFixed(3)},${h.control1.y.toFixed(3)} ${h.control2.x.toFixed(3)},${h.control2.y.toFixed(3)} ${h.endPoint.x.toFixed(3)},${h.endPoint.y.toFixed(3)}`;
|
|
3466
|
+
f.setAttribute("d", I), f.setAttribute("stroke-width", (h.endWidth * 2.25).toFixed(3)), f.setAttribute("stroke", m), f.setAttribute("fill", "none"), f.setAttribute("stroke-linecap", "round"), c.appendChild(f);
|
|
3467
|
+
}
|
|
3468
|
+
}, (h, { penColor: m, dotSize: f, minWidth: I, maxWidth: w }) => {
|
|
3469
|
+
const v = document.createElement("circle"), p = f > 0 ? f : (I + w) / 2;
|
|
3470
|
+
v.setAttribute("r", p.toString()), v.setAttribute("cx", h.x.toString()), v.setAttribute("cy", h.y.toString()), v.setAttribute("fill", m), c.appendChild(v);
|
|
3471
|
+
});
|
|
3472
|
+
const o = "data:image/svg+xml;base64,", u = `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="${r} ${n} ${s} ${a}" width="${s}" height="${a}">`;
|
|
3473
|
+
let l = c.innerHTML;
|
|
3474
|
+
if (l === void 0) {
|
|
3475
|
+
const h = document.createElement("dummy"), m = c.childNodes;
|
|
3476
|
+
h.innerHTML = "";
|
|
3477
|
+
for (let f = 0; f < m.length; f += 1)
|
|
3478
|
+
h.appendChild(m[f].cloneNode(!0));
|
|
3479
|
+
l = h.innerHTML;
|
|
3480
|
+
}
|
|
3481
|
+
const g = u + l + "</svg>";
|
|
3482
|
+
return o + btoa(g);
|
|
3483
|
+
}
|
|
3484
|
+
};
|
|
3485
|
+
class vi extends pi {
|
|
3486
|
+
fromText(e, i = {}) {
|
|
3487
|
+
if (this.clear(), !e) return;
|
|
3488
|
+
const { font: r, x: n = 10, y: s = 50 } = i;
|
|
3489
|
+
let { maxWidth: a } = i;
|
|
3490
|
+
if (!a) {
|
|
3491
|
+
const { clientWidth: c = 300 } = this.canvas;
|
|
3492
|
+
a = Math.floor(c - 2 * n);
|
|
3493
|
+
}
|
|
3494
|
+
this._ctx.font = r, this._ctx.fillText(e, n, s, a), this._isEmpty = !1;
|
|
3495
|
+
}
|
|
3496
|
+
}
|
|
3497
|
+
const yi = {
|
|
3498
|
+
name: "SignaturePad",
|
|
3499
|
+
props: {
|
|
3500
|
+
type: {
|
|
3501
|
+
type: String,
|
|
3502
|
+
default: "text",
|
|
3503
|
+
validator: (t) => ["text", "draw"].includes(t)
|
|
3504
|
+
},
|
|
3505
|
+
text: {
|
|
3506
|
+
type: String,
|
|
3507
|
+
default: ""
|
|
3508
|
+
},
|
|
3509
|
+
width: {
|
|
3510
|
+
type: String,
|
|
3511
|
+
default: "100%"
|
|
3512
|
+
},
|
|
3513
|
+
height: {
|
|
3514
|
+
type: String,
|
|
3515
|
+
default: "100%"
|
|
3516
|
+
},
|
|
3517
|
+
customStyle: {
|
|
3518
|
+
type: Object,
|
|
3519
|
+
default: () => ({})
|
|
3520
|
+
},
|
|
3521
|
+
options: {
|
|
3522
|
+
type: Object,
|
|
3523
|
+
default: () => ({})
|
|
3524
|
+
},
|
|
3525
|
+
/**
|
|
3526
|
+
* Obj on format like {
|
|
3527
|
+
beginStroke: () => {},
|
|
3528
|
+
endStroke: () => {},
|
|
3529
|
+
},
|
|
3530
|
+
*/
|
|
3531
|
+
signEvents: {
|
|
3532
|
+
type: Object,
|
|
3533
|
+
default: () => ({})
|
|
3534
|
+
},
|
|
3535
|
+
images: {
|
|
3536
|
+
type: Array,
|
|
3537
|
+
default: () => []
|
|
3538
|
+
}
|
|
3539
|
+
},
|
|
3540
|
+
data() {
|
|
3541
|
+
return {
|
|
3542
|
+
signaturePad: {},
|
|
3543
|
+
onResizeHandler: null,
|
|
3544
|
+
signatureData: "",
|
|
3545
|
+
defaultOptions: {
|
|
3546
|
+
dotSize: 1.5,
|
|
3547
|
+
minWidth: 0.5,
|
|
3548
|
+
maxWidth: 2.5,
|
|
3549
|
+
throttle: 16,
|
|
3550
|
+
minDistance: 3,
|
|
3551
|
+
backgroundColor: "rgba(0,0,0,0)",
|
|
3552
|
+
penColor: "black",
|
|
3553
|
+
velocityFilterWeight: 0.5
|
|
3554
|
+
},
|
|
3555
|
+
validTypes: ["image/png", "image/jpeg", "image/svg+xml"]
|
|
3556
|
+
};
|
|
3557
|
+
},
|
|
3558
|
+
watch: {
|
|
3559
|
+
type() {
|
|
3560
|
+
this.initType();
|
|
3561
|
+
},
|
|
3562
|
+
text(t) {
|
|
3563
|
+
this.drawText(t);
|
|
3564
|
+
}
|
|
3565
|
+
},
|
|
3566
|
+
mounted() {
|
|
3567
|
+
const { options: t, defaultOptions: e } = this, i = this.$refs.signaturePadCanvas;
|
|
3568
|
+
this.signaturePad = new vi(i, {
|
|
3569
|
+
...e,
|
|
3570
|
+
...t
|
|
3571
|
+
}), this.onResizeHandler = this.resizeCanvas.bind(this), window.addEventListener("resize", this.onResizeHandler, !1), Object.keys(this.signEvents).forEach((r) => {
|
|
3572
|
+
this.signaturePad.addEventListener(r, () => {
|
|
3573
|
+
this.signEvents[r]();
|
|
3574
|
+
});
|
|
3575
|
+
}), this.initType(), this.resizeCanvas();
|
|
3576
|
+
},
|
|
3577
|
+
beforeUnmount() {
|
|
3578
|
+
this.onResizeHandler && window.removeEventListener("resize", this.onResizeHandler, !1);
|
|
3579
|
+
},
|
|
3580
|
+
methods: {
|
|
3581
|
+
initType() {
|
|
3582
|
+
this.type === "draw" ? this.openSignaturePad() : this.lockSignaturePad();
|
|
3583
|
+
},
|
|
3584
|
+
resizeCanvas() {
|
|
3585
|
+
const t = this.$refs.signaturePadCanvas, e = Math.max(window.devicePixelRatio || 1, 1);
|
|
3586
|
+
if (t.width = t.offsetWidth * e, t.height = t.offsetHeight * e, t.getContext("2d").scale(e, e), this.signaturePad.clear(), this.signatureData = "", this.type === "draw") {
|
|
3587
|
+
const i = this.signaturePad.toData();
|
|
3588
|
+
i != null && i.length && this.signaturePad.fromData(i);
|
|
3589
|
+
} else this.type === "text" && this.drawText(this.text);
|
|
3590
|
+
},
|
|
3591
|
+
saveSignature(t = {}) {
|
|
3592
|
+
const { type: e = "image/png", trim: i = !0, encoderOptions: r } = t || {}, n = { isEmpty: !1, data: void 0 };
|
|
3593
|
+
if (!this.validTypes.includes(e)) {
|
|
3594
|
+
const s = this.validTypes.join(", ");
|
|
3595
|
+
throw new Error(
|
|
3596
|
+
`The Image type is incorrect! We only support ${s} types.`
|
|
3597
|
+
);
|
|
3598
|
+
}
|
|
3599
|
+
if (this.signaturePad.isEmpty()) return { ...n, isEmpty: !0 };
|
|
3600
|
+
if (i) {
|
|
3601
|
+
const s = this.$refs.signaturePadCanvas, a = s ? this.trimCanvas(s) : null;
|
|
3602
|
+
this.signatureData = a ? a.toDataURL(e, r) : "";
|
|
3603
|
+
} else
|
|
3604
|
+
this.signatureData = this.signaturePad.toDataURL(e, r);
|
|
3605
|
+
return {
|
|
3606
|
+
...n,
|
|
3607
|
+
data: this.signatureData
|
|
3608
|
+
};
|
|
3609
|
+
},
|
|
3610
|
+
undoSignature() {
|
|
3611
|
+
const { signaturePad: t } = this, e = t.toData();
|
|
3612
|
+
e && t.fromData(e.slice(0, -1));
|
|
3613
|
+
},
|
|
3614
|
+
drawText(t) {
|
|
3615
|
+
this.signaturePad.fromText(t, {
|
|
3616
|
+
font: '40px "Nothing You Could Do"',
|
|
3617
|
+
x: 10,
|
|
3618
|
+
y: 100
|
|
3619
|
+
});
|
|
3620
|
+
},
|
|
3621
|
+
// Extend of module methods
|
|
3622
|
+
fromText(...t) {
|
|
3623
|
+
return this.signaturePad.fromText(...t);
|
|
3624
|
+
},
|
|
3625
|
+
fromDataURL(...t) {
|
|
3626
|
+
return this.signaturePad.fromDataURL(...t);
|
|
3627
|
+
},
|
|
3628
|
+
fromData(...t) {
|
|
3629
|
+
return this.signaturePad.fromData(...t);
|
|
3630
|
+
},
|
|
3631
|
+
toData(...t) {
|
|
3632
|
+
return this.signaturePad.toData(...t);
|
|
3633
|
+
},
|
|
3634
|
+
lockSignaturePad() {
|
|
3635
|
+
return this.signaturePad.off();
|
|
3636
|
+
},
|
|
3637
|
+
openSignaturePad() {
|
|
3638
|
+
return this.signaturePad.on();
|
|
3639
|
+
},
|
|
3640
|
+
isEmpty() {
|
|
3641
|
+
return this.signaturePad.isEmpty();
|
|
3642
|
+
},
|
|
3643
|
+
clearSignature() {
|
|
3644
|
+
return this.signaturePad.clear();
|
|
3645
|
+
},
|
|
3646
|
+
trimCanvas(t) {
|
|
3647
|
+
const e = document.createElement("canvas"), i = e.getContext("2d");
|
|
3648
|
+
e.width = t.width, e.height = t.height, i.drawImage(t, 0, 0);
|
|
3649
|
+
let r = e.width, n = e.height;
|
|
3650
|
+
const s = { x: [], y: [] }, a = i.getImageData(
|
|
3651
|
+
0,
|
|
3652
|
+
0,
|
|
3653
|
+
e.width,
|
|
3654
|
+
e.height
|
|
3655
|
+
);
|
|
3656
|
+
let c = 0;
|
|
3657
|
+
for (let l = 0; l < n; l++)
|
|
3658
|
+
for (let d = 0; d < r; d++)
|
|
3659
|
+
c = (l * r + d) * 4, a.data[c + 3] > 0 && (s.x.push(d), s.y.push(l));
|
|
3660
|
+
s.x.sort((l, d) => l - d), s.y.sort((l, d) => l - d);
|
|
3661
|
+
const o = s.x.length - 1;
|
|
3662
|
+
r = s.x[o] - s.x[0], n = s.y[o] - s.y[0];
|
|
3663
|
+
const u = i.getImageData(s.x[0], s.y[0], r, n);
|
|
3664
|
+
return e.height = n, i.putImageData(u, 0, 0), e;
|
|
3665
|
+
}
|
|
3666
|
+
},
|
|
3667
|
+
render() {
|
|
3668
|
+
const { width: t, height: e, customStyle: i } = this;
|
|
3669
|
+
return re(
|
|
3670
|
+
"div",
|
|
3671
|
+
{
|
|
3672
|
+
style: {
|
|
3673
|
+
width: t,
|
|
3674
|
+
height: e,
|
|
3675
|
+
...i
|
|
3676
|
+
}
|
|
3677
|
+
},
|
|
3678
|
+
[
|
|
3679
|
+
re("canvas", {
|
|
3680
|
+
style: {
|
|
3681
|
+
width: "100%",
|
|
3682
|
+
height: "100%"
|
|
3683
|
+
},
|
|
3684
|
+
ref: "signaturePadCanvas"
|
|
3685
|
+
})
|
|
3686
|
+
]
|
|
3687
|
+
);
|
|
3688
|
+
}
|
|
3689
|
+
};
|
|
3690
|
+
function wi({ rel: t, href: e, crossorigin: i = !1 }) {
|
|
3691
|
+
const r = document.createElement("link");
|
|
3692
|
+
r.rel = t, r.href = e, r.crossorigin = i, document.head.appendChild(r);
|
|
3693
|
+
}
|
|
3694
|
+
const Ci = [
|
|
3695
|
+
{ rel: "preconnect", href: "https://fonts.googleapis.com" },
|
|
3696
|
+
{ rel: "preconnect", href: "https://fonts.gstatic.com", crossorigin: !0 },
|
|
3697
|
+
{
|
|
3698
|
+
rel: "stylesheet",
|
|
3699
|
+
href: "https://fonts.googleapis.com/css2?family=Nothing+You+Could+Do&display=swap"
|
|
3700
|
+
}
|
|
3701
|
+
], _i = {
|
|
3702
|
+
name: "SignatureAnswer",
|
|
3703
|
+
components: {
|
|
3704
|
+
CField: $n,
|
|
3705
|
+
SignaturePad: yi
|
|
3706
|
+
},
|
|
3707
|
+
emits: ["invalid"],
|
|
3708
|
+
mixins: [dt([])],
|
|
3709
|
+
props: {
|
|
3710
|
+
onCompleteFunc: {
|
|
3711
|
+
type: Function,
|
|
3712
|
+
default: null
|
|
3713
|
+
}
|
|
3714
|
+
},
|
|
3715
|
+
data() {
|
|
3716
|
+
return {
|
|
3717
|
+
mode: "text",
|
|
3718
|
+
text: "",
|
|
3719
|
+
isEmpty: !0,
|
|
3720
|
+
penColor: "hsl(220, 100%, 50%)"
|
|
3721
|
+
};
|
|
3722
|
+
},
|
|
3723
|
+
watch: {
|
|
3724
|
+
mode(t) {
|
|
3725
|
+
this.reset(), this.$refs.signaturePad && t === "text" && this.focusName();
|
|
3726
|
+
},
|
|
3727
|
+
text() {
|
|
3728
|
+
this.$refs.signaturePad && this.$nextTick(() => {
|
|
3729
|
+
this.isEmpty = this.$refs.signaturePad.isEmpty();
|
|
3730
|
+
});
|
|
3731
|
+
},
|
|
3732
|
+
isEmpty: {
|
|
3733
|
+
immediate: !0,
|
|
3734
|
+
handler(t) {
|
|
3735
|
+
this.$emit("invalid", t);
|
|
3736
|
+
}
|
|
3737
|
+
}
|
|
3738
|
+
},
|
|
3739
|
+
created() {
|
|
3740
|
+
Ci.forEach(wi);
|
|
3741
|
+
},
|
|
3742
|
+
mounted() {
|
|
3743
|
+
this.focusName();
|
|
3744
|
+
},
|
|
3745
|
+
methods: {
|
|
3746
|
+
reset() {
|
|
3747
|
+
this.$refs.signaturePad && (this.$refs.signaturePad.clearSignature(), this.text && (this.text = ""), this.isEmpty = this.$refs.signaturePad.isEmpty());
|
|
3748
|
+
},
|
|
3749
|
+
undo() {
|
|
3750
|
+
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());
|
|
3751
|
+
},
|
|
3752
|
+
getSignatureData() {
|
|
3753
|
+
let t = { type: "image/png", trim: !0 };
|
|
3754
|
+
this.mode === "draw" && (t = { type: "image/svg+xml", trim: !1 });
|
|
3755
|
+
const { isEmpty: e, data: i } = this.$refs.signaturePad ? this.$refs.signaturePad.saveSignature(t) : {};
|
|
3756
|
+
if (e || !i) throw Error("Missing signatureData");
|
|
3757
|
+
return i;
|
|
3758
|
+
},
|
|
3759
|
+
async submit({ answer: t }) {
|
|
3760
|
+
const e = this.getSignatureData();
|
|
3761
|
+
await t({ body: { isAccepted: !0, signatureDataURL: e } }), typeof this.onCompleteFunc == "function" && this.onCompleteFunc();
|
|
3762
|
+
},
|
|
3763
|
+
focusName() {
|
|
3764
|
+
this.$nextTick(
|
|
3765
|
+
() => this.$refs.nameInput ? this.$refs.nameInput.focus() : null
|
|
3766
|
+
);
|
|
3767
|
+
}
|
|
3768
|
+
}
|
|
3769
|
+
}, xi = { style: { "text-align": "left" } }, bi = {
|
|
3770
|
+
class: "flex w-full items-center justify-between",
|
|
3771
|
+
style: { "font-size": "16px", "padding-bottom": "1em", "font-weight": "500", color: "hsl(0, 0%, 11%)" }
|
|
3772
|
+
}, Pi = { class: "sign-toggle" }, Ei = {
|
|
3773
|
+
class: "wrapper",
|
|
3774
|
+
style: { "padding-bottom": "5px" }
|
|
3775
|
+
}, Ti = { style: { position: "absolute", left: "1em", top: "0.75em", "font-size": "12px", color: "hsl(0, 0%, 50%)" } }, ki = { class: "flex w-full justify-end" }, Si = {
|
|
3776
|
+
class: "text-center",
|
|
3777
|
+
style: { "font-size": "12px", color: "hsl(0, 0%, 45%)", "padding-top": "10px" }
|
|
3778
|
+
};
|
|
3779
|
+
function Mi(t, e, i, r, n, s) {
|
|
3780
|
+
const a = U("CInput"), c = U("CField"), o = U("SignaturePad"), u = U("CButton");
|
|
3781
|
+
return B(), R("div", xi, [
|
|
3782
|
+
P("div", bi, [
|
|
3783
|
+
P("div", null, D(t._document.$t("answerModal.signature.component.subTitle")), 1),
|
|
3784
|
+
P("div", Pi, [
|
|
3785
|
+
P("div", {
|
|
3786
|
+
class: Ce([{ active: n.mode === "text" }, "sign-toggle-button"]),
|
|
3787
|
+
onClick: e[0] || (e[0] = (l) => n.mode = "text")
|
|
3788
|
+
}, D(t._document.$t("answerModal.signature.component.text.tab")), 3),
|
|
3789
|
+
P("div", {
|
|
3790
|
+
class: Ce([{ active: n.mode === "draw" }, "sign-toggle-button"]),
|
|
3791
|
+
onClick: e[1] || (e[1] = (l) => n.mode = "draw")
|
|
3792
|
+
}, D(t._document.$t("answerModal.signature.component.draw.tab")), 3)
|
|
3793
|
+
])
|
|
3794
|
+
]),
|
|
3795
|
+
n.mode === "text" ? (B(), ut(c, {
|
|
3796
|
+
key: 0,
|
|
3797
|
+
label: t._document.$t("answerModal.signature.component.text.nameLabel")
|
|
3798
|
+
}, {
|
|
3799
|
+
default: j(() => [
|
|
3800
|
+
F(a, {
|
|
3801
|
+
ref: "nameInput",
|
|
3802
|
+
modelValue: n.text,
|
|
3803
|
+
"onUpdate:modelValue": e[2] || (e[2] = (l) => n.text = l),
|
|
3804
|
+
placeholder: t._document.$t("answerModal.signature.component.text.namePlaceholder")
|
|
3805
|
+
}, null, 8, ["modelValue", "placeholder"])
|
|
3806
|
+
]),
|
|
3807
|
+
_: 1
|
|
3808
|
+
}, 8, ["label"])) : N("", !0),
|
|
3809
|
+
P("div", Ei, [
|
|
3810
|
+
e[3] || (e[3] = P("div", { class: "background-image" }, [
|
|
3811
|
+
P("svg", {
|
|
3812
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3813
|
+
width: "100%",
|
|
3814
|
+
height: "100%"
|
|
3815
|
+
}, [
|
|
3816
|
+
P("line", {
|
|
3817
|
+
x1: "0",
|
|
3818
|
+
y1: "75%",
|
|
3819
|
+
x2: "100%",
|
|
3820
|
+
y2: "75%",
|
|
3821
|
+
stroke: "hsl(0,0%, 70%)",
|
|
3822
|
+
"stroke-width": "1",
|
|
3823
|
+
"stroke-linecap": "round",
|
|
3824
|
+
"stroke-dasharray": "3",
|
|
3825
|
+
"shape-rendering": "crispEdges",
|
|
3826
|
+
"pointer-events": "none"
|
|
3827
|
+
})
|
|
3828
|
+
])
|
|
3829
|
+
], -1)),
|
|
3830
|
+
P("div", Ti, D(t._document.$t(`answerModal.signature.component.${n.mode}.canvasLabel`)), 1),
|
|
3831
|
+
e[4] || (e[4] = P("span", { style: { "font-family": "'Nothing You Could Do', cursive" } }, null, -1)),
|
|
3832
|
+
F(o, {
|
|
3833
|
+
ref: "signaturePad",
|
|
3834
|
+
type: n.mode,
|
|
3835
|
+
text: n.text,
|
|
3836
|
+
options: {
|
|
3837
|
+
penColor: n.penColor
|
|
3838
|
+
},
|
|
3839
|
+
"sign-events": {
|
|
3840
|
+
endStroke: () => {
|
|
3841
|
+
n.isEmpty = t.$refs.signaturePad ? t.$refs.signaturePad.isEmpty() : !0;
|
|
3842
|
+
}
|
|
3843
|
+
},
|
|
3844
|
+
class: "signature-pad"
|
|
3845
|
+
}, null, 8, ["type", "text", "options", "sign-events"])
|
|
3846
|
+
]),
|
|
3847
|
+
An(P("div", ki, [
|
|
3848
|
+
F(u, {
|
|
3849
|
+
disabled: n.isEmpty,
|
|
3850
|
+
type: "text",
|
|
3851
|
+
size: "small",
|
|
3852
|
+
pattern: "tertiary",
|
|
3853
|
+
circle: "",
|
|
3854
|
+
icon: "trash",
|
|
3855
|
+
onClick: s.reset
|
|
3856
|
+
}, null, 8, ["disabled", "onClick"]),
|
|
3857
|
+
F(u, {
|
|
3858
|
+
disabled: n.isEmpty,
|
|
3859
|
+
type: "text",
|
|
3860
|
+
size: "small",
|
|
3861
|
+
pattern: "tertiary",
|
|
3862
|
+
circle: "",
|
|
3863
|
+
icon: "rotate-left",
|
|
3864
|
+
onClick: s.undo
|
|
3865
|
+
}, null, 8, ["disabled", "onClick"])
|
|
3866
|
+
], 512), [
|
|
3867
|
+
[Dn, n.mode === "draw"]
|
|
3868
|
+
]),
|
|
3869
|
+
P("div", Si, D(t._document.$t("answerModal.signature.component.terms")), 1)
|
|
3870
|
+
]);
|
|
3871
|
+
}
|
|
3872
|
+
const Ii = /* @__PURE__ */ ht(_i, [["render", Mi], ["__scopeId", "data-v-f66bc68a"]]), Ai = [
|
|
3873
|
+
"enjoyedExperience",
|
|
3874
|
+
// boolean value
|
|
3875
|
+
"whatToImprove"
|
|
3876
|
+
// string value
|
|
3877
|
+
], Di = {
|
|
3878
|
+
emits: ["page", "close"],
|
|
3879
|
+
mixins: [dt([])],
|
|
3880
|
+
props: {
|
|
3881
|
+
publicId: {
|
|
3882
|
+
type: String,
|
|
3883
|
+
default: ""
|
|
3884
|
+
}
|
|
3885
|
+
},
|
|
3886
|
+
data() {
|
|
3887
|
+
return {
|
|
3888
|
+
page: "start",
|
|
3889
|
+
whatToImprove: ""
|
|
3890
|
+
};
|
|
3891
|
+
},
|
|
3892
|
+
computed: {
|
|
3893
|
+
showPostFeedbackActions() {
|
|
3894
|
+
return sn.value !== "widget" && !Nn;
|
|
3895
|
+
}
|
|
3896
|
+
},
|
|
3897
|
+
created() {
|
|
3898
|
+
this.$nextTick(() => {
|
|
3899
|
+
this.startAnimation();
|
|
3900
|
+
});
|
|
3901
|
+
},
|
|
3902
|
+
methods: {
|
|
3903
|
+
async submitFeedback({ type: t, data: e }) {
|
|
3904
|
+
if (!this.publicId) throw Error("Missing param publicId");
|
|
3905
|
+
if (!t) throw Error("Missing param type");
|
|
3906
|
+
if (!Ai.includes(t)) throw Error("Invalid feedback type");
|
|
3907
|
+
if (!e) throw Error("Missing param data");
|
|
3908
|
+
let i = "positive";
|
|
3909
|
+
if (t === "whatToImprove" && !e.value) {
|
|
3910
|
+
this.goTo("negative.success");
|
|
3911
|
+
return;
|
|
3912
|
+
}
|
|
3913
|
+
try {
|
|
3914
|
+
Bn.feedback(this.publicId, { type: t, data: e }), t === "enjoyedExperience" && !e.value && (i = "negative"), t === "whatToImprove" && (i = "negative.success");
|
|
3915
|
+
} catch (r) {
|
|
3916
|
+
bt(r, { showMessage: !1 });
|
|
3917
|
+
} finally {
|
|
3918
|
+
this.goTo(i);
|
|
3919
|
+
}
|
|
3920
|
+
},
|
|
3921
|
+
async goTo(t) {
|
|
3922
|
+
if (t === "positive" && !this.showPostFeedbackActions && setTimeout(() => {
|
|
3923
|
+
this.close();
|
|
3924
|
+
}, 2e3), this.$emit("page", t), t === "positive" || t === "negative") {
|
|
3925
|
+
this.$refs.start.style.opacity = 0, this.page = "intermediate", setTimeout(() => {
|
|
3926
|
+
this.page = t;
|
|
3927
|
+
}, 2e3);
|
|
3928
|
+
return;
|
|
3929
|
+
}
|
|
3930
|
+
this.page = t;
|
|
3931
|
+
},
|
|
3932
|
+
startAnimation() {
|
|
3933
|
+
const t = this.$refs.feedbackBg;
|
|
3934
|
+
t.gradOneXPos = 0, t.gradOneYPos = 0, t.gradTwoXPos = 80, t.gradTwoYPos = 20, t.gradThreeXPos = 20, t.gradThreeYPos = 80, t.gradFourXPos = 80, t.gradFourYPos = 80, L({
|
|
3935
|
+
targets: t,
|
|
3936
|
+
duration: 12e3,
|
|
3937
|
+
direction: "alternate",
|
|
3938
|
+
easing: "linear",
|
|
3939
|
+
loop: !0,
|
|
3940
|
+
gradOneXPos: [10, 5, 0, -10],
|
|
3941
|
+
gradOneYPos: [10, 20, 25, 30],
|
|
3942
|
+
gradTwoXPos: [25, 20, 15, 10, 25],
|
|
3943
|
+
gradTwoYPos: [65, 55, 40, 65, 80],
|
|
3944
|
+
gradThreeXPos: [25, 20, 10, 15, 25],
|
|
3945
|
+
gradThreeYPos: [65, 50, 45, 60, 80],
|
|
3946
|
+
gradFourXPos: [85, 80, 75, 70, 95],
|
|
3947
|
+
gradFourYPos: [90, 100, 120, 100, 85],
|
|
3948
|
+
update() {
|
|
3949
|
+
t.style.setProperty(
|
|
3950
|
+
"--gradOneXPos",
|
|
3951
|
+
`${t.gradOneXPos}%`
|
|
3952
|
+
), t.style.setProperty(
|
|
3953
|
+
"--gradOneYPos",
|
|
3954
|
+
`${t.gradOneYPos}%`
|
|
3955
|
+
), t.style.setProperty(
|
|
3956
|
+
"--gradTwoXPos",
|
|
3957
|
+
`${t.gradTwoXPos}%`
|
|
3958
|
+
), t.style.setProperty(
|
|
3959
|
+
"--gradTwoYPos",
|
|
3960
|
+
`${t.gradTwoYPos}%`
|
|
3961
|
+
), t.style.setProperty(
|
|
3962
|
+
"--gradThreeXPos",
|
|
3963
|
+
`${t.gradThreeXPos}%`
|
|
3964
|
+
), t.style.setProperty(
|
|
3965
|
+
"--gradThreeYPos",
|
|
3966
|
+
`${t.gradThreeYPos}%`
|
|
3967
|
+
), t.style.setProperty(
|
|
3968
|
+
"--gradFourXPos",
|
|
3969
|
+
`${t.gradFourXPos}%`
|
|
3970
|
+
), t.style.setProperty(
|
|
3971
|
+
"--gradFourYPos",
|
|
3972
|
+
`${t.gradFourYPos}%`
|
|
3973
|
+
);
|
|
3974
|
+
}
|
|
3975
|
+
});
|
|
3976
|
+
},
|
|
3977
|
+
// animations
|
|
3978
|
+
leave(t, e) {
|
|
3979
|
+
L({
|
|
3980
|
+
targets: t,
|
|
3981
|
+
// height: 0,
|
|
3982
|
+
// opacity: [1, 0],
|
|
3983
|
+
opacity: 0,
|
|
3984
|
+
duration: 500,
|
|
3985
|
+
easing: "easeInOutCubic",
|
|
3986
|
+
complete: e
|
|
3987
|
+
});
|
|
3988
|
+
},
|
|
3989
|
+
enter(t, e) {
|
|
3990
|
+
L({
|
|
3991
|
+
targets: t,
|
|
3992
|
+
delay: this.page === "intermediate" ? 250 : 0,
|
|
3993
|
+
duration: 500,
|
|
3994
|
+
opacity: [0, 1],
|
|
3995
|
+
easing: "easeInOutCubic",
|
|
3996
|
+
complete: e
|
|
3997
|
+
});
|
|
3998
|
+
},
|
|
3999
|
+
close() {
|
|
4000
|
+
this.$emit("close");
|
|
4001
|
+
}
|
|
4002
|
+
}
|
|
4003
|
+
}, Bi = { class: "f-feedback" }, Fi = {
|
|
4004
|
+
ref: "feedbackBg",
|
|
4005
|
+
class: "f-bg"
|
|
4006
|
+
}, Li = { class: "f-container" }, Ri = {
|
|
4007
|
+
ref: "start",
|
|
4008
|
+
key: "start",
|
|
4009
|
+
class: "flex w-full flex-col items-center justify-center",
|
|
4010
|
+
style: { transition: "opacity 250ms" }
|
|
4011
|
+
}, $i = ["textContent"], Ni = {
|
|
4012
|
+
key: "intermediate",
|
|
4013
|
+
style: { height: "100%", display: "flex", "flex-direction": "column" }
|
|
4014
|
+
}, Ui = { style: { flex: "1 1 auto", display: "flex", "flex-direction": "column", "justify-content": "center", "align-items": "center" } }, ji = ["textContent"], Oi = {
|
|
4015
|
+
key: "positive",
|
|
4016
|
+
style: { height: "100%", display: "flex", "flex-direction": "column" }
|
|
4017
|
+
}, qi = { style: { flex: "1 1 auto", display: "flex", "flex-direction": "column", "justify-content": "center", "align-items": "center" } }, zi = ["textContent"], Vi = ["textContent"], Wi = {
|
|
4018
|
+
key: "negative",
|
|
4019
|
+
style: { height: "100%", display: "flex", "flex-direction": "column" }
|
|
4020
|
+
}, Hi = { style: { flex: "1 1 auto", display: "flex", "flex-direction": "column", "justify-content": "center", "align-items": "center" } }, Yi = ["textContent"], Ki = ["textContent"], Gi = {
|
|
4021
|
+
key: "success",
|
|
4022
|
+
style: { height: "100%", display: "flex", "flex-direction": "column" }
|
|
4023
|
+
}, Ji = { style: { flex: "1 1 auto", display: "flex", "flex-direction": "column", "justify-content": "center", "align-items": "center" } }, Qi = ["textContent"], Xi = ["textContent"];
|
|
4024
|
+
function Zi(t, e, i, r, n, s) {
|
|
4025
|
+
const a = U("CButton"), c = U("CInput");
|
|
4026
|
+
return B(), R("div", Bi, [
|
|
4027
|
+
P("div", Fi, null, 512),
|
|
4028
|
+
P("div", Li, [
|
|
4029
|
+
F(Pt, {
|
|
4030
|
+
css: !1,
|
|
4031
|
+
mode: "out-in",
|
|
4032
|
+
onEnter: s.enter,
|
|
4033
|
+
onLeave: s.leave
|
|
4034
|
+
}, {
|
|
4035
|
+
default: j(() => [
|
|
4036
|
+
n.page === "start" ? (B(), R("div", Ri, [
|
|
4037
|
+
P("div", {
|
|
4038
|
+
style: { "padding-bottom": "calc(1.5 * var(--rem))", "font-size": "14px", "font-weight": "500" },
|
|
4039
|
+
textContent: D(t._document.$t("answerFeedback.start.title"))
|
|
4040
|
+
}, null, 8, $i),
|
|
4041
|
+
P("div", null, [
|
|
4042
|
+
F(a, {
|
|
4043
|
+
"icon-left": "thumbsdown",
|
|
4044
|
+
size: "small",
|
|
4045
|
+
pattern: "secondary",
|
|
4046
|
+
class: "feedback-btn",
|
|
4047
|
+
onClick: e[0] || (e[0] = (o) => s.submitFeedback({
|
|
4048
|
+
type: "enjoyedExperience",
|
|
4049
|
+
data: { value: !1 }
|
|
4050
|
+
}))
|
|
4051
|
+
}, {
|
|
4052
|
+
default: j(() => [
|
|
4053
|
+
Z(D(t._document.$t("answerFeedback.start.no")), 1)
|
|
4054
|
+
]),
|
|
4055
|
+
_: 1
|
|
4056
|
+
}),
|
|
4057
|
+
F(a, {
|
|
4058
|
+
"icon-left": "thumbsup",
|
|
4059
|
+
size: "small",
|
|
4060
|
+
pattern: "secondary",
|
|
4061
|
+
class: "feedback-btn",
|
|
4062
|
+
style: { "margin-left": "calc(0.75 * var(--rem))" },
|
|
4063
|
+
onClick: e[1] || (e[1] = (o) => s.submitFeedback({
|
|
4064
|
+
type: "enjoyedExperience",
|
|
4065
|
+
data: { value: !0 }
|
|
4066
|
+
}))
|
|
4067
|
+
}, {
|
|
4068
|
+
default: j(() => [
|
|
4069
|
+
Z(D(t._document.$t("answerFeedback.start.yes")), 1)
|
|
4070
|
+
]),
|
|
4071
|
+
_: 1
|
|
4072
|
+
})
|
|
4073
|
+
])
|
|
4074
|
+
], 512)) : n.page === "intermediate" ? (B(), R("div", Ni, [
|
|
4075
|
+
P("div", Ui, [
|
|
4076
|
+
P("div", {
|
|
4077
|
+
class: "f-title",
|
|
4078
|
+
textContent: D(t._document.$t("answerFeedback.intermediate.title"))
|
|
4079
|
+
}, null, 8, ji)
|
|
4080
|
+
])
|
|
4081
|
+
])) : n.page === "positive" ? (B(), R("div", Oi, [
|
|
4082
|
+
P("div", qi, [
|
|
4083
|
+
P("div", {
|
|
4084
|
+
class: "f-title",
|
|
4085
|
+
textContent: D(t._document.$t("answerFeedback.yes.title"))
|
|
4086
|
+
}, null, 8, zi),
|
|
4087
|
+
P("div", {
|
|
4088
|
+
textContent: D(t._document.$t("answerFeedback.yes.text"))
|
|
4089
|
+
}, null, 8, Vi)
|
|
4090
|
+
]),
|
|
4091
|
+
F(a, {
|
|
4092
|
+
class: "a-btn",
|
|
4093
|
+
type: "secondary",
|
|
4094
|
+
wide: "",
|
|
4095
|
+
tag: "a",
|
|
4096
|
+
href: "/register?utm_source=document&utm_medium=feedback-modal&utm_campaign=signup&utm_content=positive-exp",
|
|
4097
|
+
target: "_blank",
|
|
4098
|
+
style: { "margin-bottom": "0.5em" },
|
|
4099
|
+
textContent: D(t._document.$t("answerFeedback.yes.action"))
|
|
4100
|
+
}, null, 8, ["textContent"]),
|
|
4101
|
+
F(a, {
|
|
4102
|
+
class: "a-btn",
|
|
4103
|
+
wide: "",
|
|
4104
|
+
tag: "a",
|
|
4105
|
+
href: `https://${t.$t(
|
|
4106
|
+
"_common:brand.domain"
|
|
4107
|
+
)}?utm_source=document&utm_medium=feedback-modal&utm_campaign=learn-more&utm_content=positive-exp`,
|
|
4108
|
+
target: "_blank",
|
|
4109
|
+
textContent: D(t._document.$t("answerFeedback.yes.secondary"))
|
|
4110
|
+
}, null, 8, ["href", "textContent"])
|
|
4111
|
+
])) : n.page === "negative" ? (B(), R("div", Wi, [
|
|
4112
|
+
P("div", Hi, [
|
|
4113
|
+
P("div", {
|
|
4114
|
+
class: "f-title",
|
|
4115
|
+
textContent: D(t._document.$t("answerFeedback.no.start.title"))
|
|
4116
|
+
}, null, 8, Yi),
|
|
4117
|
+
P("div", {
|
|
4118
|
+
textContent: D(t._document.$t("answerFeedback.no.start.text"))
|
|
4119
|
+
}, null, 8, Ki),
|
|
4120
|
+
F(c, {
|
|
4121
|
+
modelValue: n.whatToImprove,
|
|
4122
|
+
"onUpdate:modelValue": e[2] || (e[2] = (o) => n.whatToImprove = o),
|
|
4123
|
+
placeholder: t._document.$t("answerFeedback.no.start.placeholder"),
|
|
4124
|
+
type: "textarea",
|
|
4125
|
+
class: "input-style",
|
|
4126
|
+
style: { margin: "2em 0" }
|
|
4127
|
+
}, null, 8, ["modelValue", "placeholder"])
|
|
4128
|
+
]),
|
|
4129
|
+
F(a, {
|
|
4130
|
+
wide: "",
|
|
4131
|
+
class: "a-btn",
|
|
4132
|
+
onClick: e[3] || (e[3] = (o) => s.submitFeedback({
|
|
4133
|
+
type: "whatToImprove",
|
|
4134
|
+
data: { value: n.whatToImprove }
|
|
4135
|
+
})),
|
|
4136
|
+
textContent: D(t._document.$t("answerFeedback.no.start.action"))
|
|
4137
|
+
}, null, 8, ["textContent"])
|
|
4138
|
+
])) : n.page === "negative.success" ? (B(), R("div", Gi, [
|
|
4139
|
+
P("div", Ji, [
|
|
4140
|
+
P("div", {
|
|
4141
|
+
class: "f-title",
|
|
4142
|
+
textContent: D(t._document.$t("answerFeedback.no.success.title"))
|
|
4143
|
+
}, null, 8, Qi),
|
|
4144
|
+
P("div", {
|
|
4145
|
+
textContent: D(t._document.$t("answerFeedback.no.success.text"))
|
|
4146
|
+
}, null, 8, Xi)
|
|
4147
|
+
]),
|
|
4148
|
+
F(a, {
|
|
4149
|
+
class: "a-btn",
|
|
4150
|
+
tag: "a",
|
|
4151
|
+
href: `https://${t.$t(
|
|
4152
|
+
"_common:brand.domain"
|
|
4153
|
+
)}?utm_source=document&utm_medium=feedback-modal&utm_campaign=learn-more&utm_content=negative-exp`,
|
|
4154
|
+
target: "_blank",
|
|
4155
|
+
wide: "",
|
|
4156
|
+
type: "secondary",
|
|
4157
|
+
style: { "margin-bottom": "0.5em" },
|
|
4158
|
+
textContent: D(t._document.$t("answerFeedback.no.success.action"))
|
|
4159
|
+
}, null, 8, ["href", "textContent"]),
|
|
4160
|
+
F(a, {
|
|
4161
|
+
class: "a-btn",
|
|
4162
|
+
wide: "",
|
|
4163
|
+
onClick: s.close,
|
|
4164
|
+
textContent: D(t._document.$t("answerFeedback.no.success.secondary"))
|
|
4165
|
+
}, null, 8, ["onClick", "textContent"])
|
|
4166
|
+
])) : N("", !0)
|
|
4167
|
+
]),
|
|
4168
|
+
_: 1
|
|
4169
|
+
}, 8, ["onEnter", "onLeave"])
|
|
4170
|
+
])
|
|
4171
|
+
]);
|
|
4172
|
+
}
|
|
4173
|
+
const ts = /* @__PURE__ */ ht(Di, [["render", Zi], ["__scopeId", "data-v-cba2fe5c"]]), es = {
|
|
4174
|
+
components: {
|
|
4175
|
+
Feedback: ts,
|
|
4176
|
+
Signature: Ii,
|
|
4177
|
+
BankId: Jr,
|
|
4178
|
+
Freja: fi,
|
|
4179
|
+
Deny: ti
|
|
4180
|
+
},
|
|
4181
|
+
mixins: [dt([])],
|
|
4182
|
+
i18nOptions: {
|
|
4183
|
+
namespaces: "temporary",
|
|
4184
|
+
messages: {
|
|
4185
|
+
en: {
|
|
4186
|
+
previewMode: "Preview answer mode"
|
|
4187
|
+
},
|
|
4188
|
+
sv: {
|
|
4189
|
+
previewMode: "Demo - Förhandsgranska"
|
|
4190
|
+
}
|
|
4191
|
+
}
|
|
4192
|
+
},
|
|
4193
|
+
emits: ["cancel", "close"],
|
|
4194
|
+
props: {
|
|
4195
|
+
mode: { type: String, default: "accept" },
|
|
4196
|
+
// 'accept', 'decline'
|
|
4197
|
+
isSender: { type: Boolean, default: !1 },
|
|
4198
|
+
senderActions: { type: Object, default: () => ({}) },
|
|
4199
|
+
calcHeight: { type: Boolean, default: !1 }
|
|
4200
|
+
},
|
|
4201
|
+
data() {
|
|
4202
|
+
return {
|
|
4203
|
+
page: "start",
|
|
4204
|
+
// start | intermediate | success | versionError
|
|
4205
|
+
isFeedbackInitiated: !1,
|
|
4206
|
+
isPosting: !1,
|
|
4207
|
+
actionInvalid: !1
|
|
4208
|
+
};
|
|
4209
|
+
},
|
|
4210
|
+
computed: {
|
|
4211
|
+
answerComponentName() {
|
|
4212
|
+
return this.mode === "decline" ? "Deny" : this.answerMethod === "bankId" ? "BankId" : this.answerMethod === "freja" ? "Freja" : "Signature";
|
|
4213
|
+
},
|
|
4214
|
+
answerType() {
|
|
4215
|
+
return this.mode === "decline" ? "decline" : this.answerMethod === "bankId" ? "bankId" : this.answerMethod === "freja" ? "freja" : "signature";
|
|
4216
|
+
},
|
|
4217
|
+
signee() {
|
|
4218
|
+
return this.isSender ? this._document.senderClient : this._document.viewer;
|
|
4219
|
+
},
|
|
4220
|
+
answerMethod() {
|
|
4221
|
+
var t;
|
|
4222
|
+
return (t = this.signee.answerMethod) == null ? void 0 : t.accept;
|
|
4223
|
+
},
|
|
4224
|
+
successStrings() {
|
|
4225
|
+
const t = this.signee.email ? this._document.$t(`answerModal.${this.answerType}.success.text`, {
|
|
4226
|
+
email: this.signee.email
|
|
4227
|
+
}) : this._document.$t(
|
|
4228
|
+
`answerModal.${this.answerType}.success.textFallback`
|
|
4229
|
+
), e = this.signee.email ? this._document.$t("answerModal.successTextSingle", {
|
|
4230
|
+
email: this.signee.email
|
|
4231
|
+
}) : this._document.$t("answerModal.successTextFallbackSingle"), i = this._document.remainingSignatures === 0 ? e : t;
|
|
4232
|
+
return {
|
|
4233
|
+
title: this._document.$t(
|
|
4234
|
+
`answerModal.${this.answerType}.success.title`
|
|
4235
|
+
),
|
|
4236
|
+
text: i
|
|
4237
|
+
};
|
|
4238
|
+
}
|
|
4239
|
+
},
|
|
4240
|
+
created() {
|
|
4241
|
+
this.calcHeight && this.$nextTick(() => this.setFixedHeight());
|
|
4242
|
+
},
|
|
4243
|
+
methods: {
|
|
4244
|
+
...Fn({
|
|
4245
|
+
answerCurrentDoc: Mt.ANSWER_CURRENT_PUBLIC_DOCUMENT,
|
|
4246
|
+
putCurrentDoc: Mt.PUT_CURRENT_PUBLIC_DOCUMENT,
|
|
4247
|
+
reloadCurrentDocument: Mt.RELOAD_CURRENT_DOCUMENT
|
|
4248
|
+
}),
|
|
4249
|
+
async onSubmit() {
|
|
4250
|
+
this.setFixedHeight(), await this.submit();
|
|
4251
|
+
},
|
|
4252
|
+
async submit() {
|
|
4253
|
+
if (!this.isPosting) {
|
|
4254
|
+
this.isPosting = !0;
|
|
4255
|
+
try {
|
|
4256
|
+
const { submit: t } = this.$refs.answerComponent || {};
|
|
4257
|
+
if (typeof t != "function")
|
|
4258
|
+
throw Error("Missing answer type submit method");
|
|
4259
|
+
await t({
|
|
4260
|
+
update: (e) => this.putCurrentDoc({ includeChanges: !0, ...e }),
|
|
4261
|
+
answer: this.answerCurrentDoc,
|
|
4262
|
+
...this.isSender ? this.senderActions : null
|
|
4263
|
+
});
|
|
4264
|
+
} catch (t) {
|
|
4265
|
+
this.isPosting = !1, t.httpStatusCode === 409 ? this.page = "versionError" : bt(t);
|
|
4266
|
+
}
|
|
4267
|
+
}
|
|
4268
|
+
},
|
|
4269
|
+
onComplete() {
|
|
4270
|
+
return (async () => {
|
|
4271
|
+
var i;
|
|
4272
|
+
if (this.isSender && this.senderActions.send) {
|
|
4273
|
+
this.$emit("close"), await this.senderActions.send();
|
|
4274
|
+
return;
|
|
4275
|
+
}
|
|
4276
|
+
const e = this.mode === "accept";
|
|
4277
|
+
this.mode === "accept" && (this.answerMethod === "bankId" || this.answerMethod === "freja") ? setTimeout(
|
|
4278
|
+
() => this.reloadCurrentDocument().then(
|
|
4279
|
+
() => {
|
|
4280
|
+
var r;
|
|
4281
|
+
return _e.trigger("document:answer", {
|
|
4282
|
+
id: (r = this._document) == null ? void 0 : r.id,
|
|
4283
|
+
didAccept: e
|
|
4284
|
+
});
|
|
4285
|
+
}
|
|
4286
|
+
),
|
|
4287
|
+
1e3
|
|
4288
|
+
) : _e.trigger("document:answer", {
|
|
4289
|
+
id: (i = this._document) == null ? void 0 : i.id,
|
|
4290
|
+
didAccept: e
|
|
4291
|
+
}), await xe(800), this.page = "intermediate", await xe(2e3), this.page = "success", this.isPosting = !1;
|
|
4292
|
+
})();
|
|
4293
|
+
},
|
|
4294
|
+
reload() {
|
|
4295
|
+
window.location.reload();
|
|
4296
|
+
},
|
|
4297
|
+
setFixedHeight() {
|
|
4298
|
+
this.$el.style.minHeight = `${this.$el.offsetHeight}px`;
|
|
4299
|
+
},
|
|
4300
|
+
minimizeHeight(t, e) {
|
|
4301
|
+
L({
|
|
4302
|
+
targets: t,
|
|
4303
|
+
height: 0,
|
|
4304
|
+
flexGrow: [1, 0],
|
|
4305
|
+
opacity: [1, 0],
|
|
4306
|
+
duration: 900,
|
|
4307
|
+
easing: "easeOutQuint",
|
|
4308
|
+
complete: e
|
|
4309
|
+
}), L({
|
|
4310
|
+
targets: this.$refs.feedback.$el,
|
|
4311
|
+
height: 0,
|
|
4312
|
+
flexGrow: 1,
|
|
4313
|
+
duration: 900,
|
|
4314
|
+
easing: "easeOutQuint"
|
|
4315
|
+
});
|
|
4316
|
+
},
|
|
4317
|
+
enterAnim(t, e) {
|
|
4318
|
+
L({
|
|
4319
|
+
targets: t.querySelectorAll(".stagger-anim"),
|
|
4320
|
+
opacity: [0, 1],
|
|
4321
|
+
delay: L.stagger(180, { start: 800 }),
|
|
4322
|
+
duration: 340,
|
|
4323
|
+
easing: "linear",
|
|
4324
|
+
complete: e
|
|
4325
|
+
});
|
|
4326
|
+
},
|
|
4327
|
+
leaveAnim(t, e) {
|
|
4328
|
+
t.style.position = "absolute", L({
|
|
4329
|
+
targets: t.querySelectorAll(".stagger-anim"),
|
|
4330
|
+
opacity: 0,
|
|
4331
|
+
delay: L.stagger(200),
|
|
4332
|
+
duration: 200,
|
|
4333
|
+
easing: "linear",
|
|
4334
|
+
complete: e
|
|
4335
|
+
});
|
|
4336
|
+
}
|
|
4337
|
+
}
|
|
4338
|
+
}, ns = {
|
|
4339
|
+
key: "start",
|
|
4340
|
+
class: "root-padding flex-grow"
|
|
4341
|
+
}, rs = {
|
|
4342
|
+
class: "stagger-anim",
|
|
4343
|
+
style: { "padding-bottom": "40px" }
|
|
4344
|
+
}, is = ["textContent"], ss = ["textContent"], os = {
|
|
4345
|
+
class: "stagger-anim",
|
|
4346
|
+
style: { "padding-top": "3em" }
|
|
4347
|
+
}, as = {
|
|
4348
|
+
key: "intermediate",
|
|
4349
|
+
class: "flex w-full flex-grow flex-col items-center justify-center text-center",
|
|
4350
|
+
style: { height: "100%" }
|
|
4351
|
+
}, cs = ["textContent"], ls = {
|
|
4352
|
+
key: "success",
|
|
4353
|
+
class: "flex w-full flex-grow flex-col",
|
|
4354
|
+
style: { height: "100%" }
|
|
4355
|
+
}, us = {
|
|
4356
|
+
key: 0,
|
|
4357
|
+
class: "flex w-full flex-grow flex-col items-center justify-center",
|
|
4358
|
+
style: { overflow: "hidden" }
|
|
4359
|
+
}, ds = {
|
|
4360
|
+
style: { height: "100%" },
|
|
4361
|
+
class: "root-padding flex w-full flex-col items-center justify-center"
|
|
4362
|
+
}, hs = {
|
|
4363
|
+
class: "a-title stagger-anim",
|
|
4364
|
+
style: { padding: "calc(2.5 * var(--rem)) 0 calc(2 * var(--rem))" }
|
|
4365
|
+
}, fs = ["textContent"], gs = ["textContent"], ms = {
|
|
4366
|
+
key: "versionError",
|
|
4367
|
+
class: "root-padding flex flex-grow flex-col items-center justify-center text-center"
|
|
4368
|
+
}, ps = { class: "stagger-anim" }, vs = {
|
|
4369
|
+
class: "flex items-center justify-center",
|
|
4370
|
+
style: { padding: "20px 0" }
|
|
4371
|
+
}, ys = {
|
|
4372
|
+
class: "flex items-center justify-center",
|
|
4373
|
+
style: { width: "52px", height: "52px", "border-radius": "50%" }
|
|
4374
|
+
}, ws = ["textContent"], Cs = ["textContent"], _s = {
|
|
4375
|
+
class: "stagger-anim",
|
|
4376
|
+
style: { "padding-top": "3em" }
|
|
4377
|
+
};
|
|
4378
|
+
function xs(t, e, i, r, n, s) {
|
|
4379
|
+
const a = U("CButton"), c = U("Feedback"), o = U("CIcon");
|
|
4380
|
+
return B(), ut(Rn, {
|
|
4381
|
+
class: "a-root font-inter",
|
|
4382
|
+
tag: "div",
|
|
4383
|
+
css: !1,
|
|
4384
|
+
mode: "out-in",
|
|
4385
|
+
onEnter: s.enterAnim,
|
|
4386
|
+
onLeave: s.leaveAnim
|
|
4387
|
+
}, {
|
|
4388
|
+
default: j(() => {
|
|
4389
|
+
var u;
|
|
4390
|
+
return [
|
|
4391
|
+
F(a, {
|
|
4392
|
+
key: "btn",
|
|
4393
|
+
icon: "x",
|
|
4394
|
+
circle: "",
|
|
4395
|
+
class: "text-[hsl(0, 0%, 45%)] absolute right-5 top-5 z-[9]",
|
|
4396
|
+
onClick: e[0] || (e[0] = () => {
|
|
4397
|
+
t.$emit("cancel"), t.$emit("close");
|
|
4398
|
+
})
|
|
4399
|
+
}),
|
|
4400
|
+
n.page === "start" ? (B(), R("div", ns, [
|
|
4401
|
+
P("div", rs, [
|
|
4402
|
+
P("div", {
|
|
4403
|
+
class: "a-title",
|
|
4404
|
+
textContent: D(t._document.$t(`answerModal.${s.answerType}.start.title`))
|
|
4405
|
+
}, null, 8, is),
|
|
4406
|
+
P("div", {
|
|
4407
|
+
style: { color: "hsl(0, 0%, 40%)" },
|
|
4408
|
+
textContent: D(t._document.$t(`answerModal.${s.answerType}.start.text`))
|
|
4409
|
+
}, null, 8, ss)
|
|
4410
|
+
]),
|
|
4411
|
+
(B(), ut(Ln(s.answerComponentName), {
|
|
4412
|
+
ref: "answerComponent",
|
|
4413
|
+
_document: t._document,
|
|
4414
|
+
signee: s.signee,
|
|
4415
|
+
"on-complete-func": s.onComplete,
|
|
4416
|
+
class: "stagger-anim",
|
|
4417
|
+
onInvalid: e[1] || (e[1] = (l) => n.actionInvalid = l),
|
|
4418
|
+
onLoading: e[2] || (e[2] = (l) => n.isPosting = l)
|
|
4419
|
+
}, null, 40, ["_document", "signee", "on-complete-func"])),
|
|
4420
|
+
P("div", os, [
|
|
4421
|
+
F(a, {
|
|
4422
|
+
loading: n.isPosting,
|
|
4423
|
+
disabled: n.actionInvalid,
|
|
4424
|
+
type: i.mode === "decline" ? "text" : "secondary",
|
|
4425
|
+
class: "a-btn",
|
|
4426
|
+
icon: s.answerType === "bankId" ? "bankId" : s.answerType === "freja" ? "freja" : "",
|
|
4427
|
+
onClick: s.onSubmit
|
|
4428
|
+
}, {
|
|
4429
|
+
default: j(() => [
|
|
4430
|
+
Z(D(t._document.$t(`answerModal.${s.answerType}.start.action`)), 1)
|
|
4431
|
+
]),
|
|
4432
|
+
_: 1
|
|
4433
|
+
}, 8, ["loading", "disabled", "type", "icon", "onClick"])
|
|
4434
|
+
])
|
|
4435
|
+
])) : n.page === "intermediate" ? (B(), R("div", as, [
|
|
4436
|
+
P("div", {
|
|
4437
|
+
class: "a-title stagger-anim",
|
|
4438
|
+
textContent: D(t._document.$t("answerModal.answerSuccess"))
|
|
4439
|
+
}, null, 8, cs)
|
|
4440
|
+
])) : n.page === "success" ? (B(), R("div", ls, [
|
|
4441
|
+
F(Pt, {
|
|
4442
|
+
css: !1,
|
|
4443
|
+
onLeave: s.minimizeHeight
|
|
4444
|
+
}, {
|
|
4445
|
+
default: j(() => [
|
|
4446
|
+
n.isFeedbackInitiated ? N("", !0) : (B(), R("div", us, [
|
|
4447
|
+
P("div", ds, [
|
|
4448
|
+
P("div", hs, [
|
|
4449
|
+
P("div", {
|
|
4450
|
+
textContent: D(s.successStrings.title)
|
|
4451
|
+
}, null, 8, fs)
|
|
4452
|
+
]),
|
|
4453
|
+
P("div", {
|
|
4454
|
+
class: "stagger-anim",
|
|
4455
|
+
textContent: D(s.successStrings.text)
|
|
4456
|
+
}, null, 8, gs)
|
|
4457
|
+
])
|
|
4458
|
+
]))
|
|
4459
|
+
]),
|
|
4460
|
+
_: 1
|
|
4461
|
+
}, 8, ["onLeave"]),
|
|
4462
|
+
F(c, {
|
|
4463
|
+
ref: "feedback",
|
|
4464
|
+
"public-id": (u = t._document.viewer) == null ? void 0 : u.publicDocumentId,
|
|
4465
|
+
_document: t._document,
|
|
4466
|
+
style: { flex: "0 0", overflow: "hidden", "min-height": "200px" },
|
|
4467
|
+
class: "stagger-anim",
|
|
4468
|
+
onPage: e[3] || (e[3] = () => n.isFeedbackInitiated = !0),
|
|
4469
|
+
onClose: e[4] || (e[4] = (l) => t.$emit("close"))
|
|
4470
|
+
}, null, 8, ["public-id", "_document"])
|
|
4471
|
+
])) : n.page === "versionError" ? (B(), R("div", ms, [
|
|
4472
|
+
P("div", ps, [
|
|
4473
|
+
P("div", vs, [
|
|
4474
|
+
P("div", ys, [
|
|
4475
|
+
F(o, {
|
|
4476
|
+
size: 30,
|
|
4477
|
+
type: "error"
|
|
4478
|
+
})
|
|
4479
|
+
])
|
|
4480
|
+
]),
|
|
4481
|
+
P("div", {
|
|
4482
|
+
class: "a-title",
|
|
4483
|
+
textContent: D(t._document.$t(`answerModal.versionError.${i.mode}.title`))
|
|
4484
|
+
}, null, 8, ws),
|
|
4485
|
+
P("div", {
|
|
4486
|
+
textContent: D(t._document.$t("answerModal.versionError.text"))
|
|
4487
|
+
}, null, 8, Cs)
|
|
4488
|
+
]),
|
|
4489
|
+
P("div", _s, [
|
|
4490
|
+
F(a, {
|
|
4491
|
+
loading: n.isPosting,
|
|
4492
|
+
type: "none",
|
|
4493
|
+
class: "a-btn",
|
|
4494
|
+
onClick: s.reload
|
|
4495
|
+
}, {
|
|
4496
|
+
default: j(() => [
|
|
4497
|
+
Z(D(t._document.$t("answerModal.versionError.btn")), 1)
|
|
4498
|
+
]),
|
|
4499
|
+
_: 1
|
|
4500
|
+
}, 8, ["loading", "onClick"])
|
|
4501
|
+
])
|
|
4502
|
+
])) : N("", !0)
|
|
4503
|
+
];
|
|
4504
|
+
}),
|
|
4505
|
+
_: 1
|
|
4506
|
+
}, 8, ["onEnter", "onLeave"]);
|
|
4507
|
+
}
|
|
4508
|
+
const ks = /* @__PURE__ */ ht(es, [["render", xs], ["__scopeId", "data-v-0eef52e4"]]);
|
|
4509
|
+
export {
|
|
4510
|
+
ks as default
|
|
4511
|
+
};
|