go-captcha-vue 2.0.1 → 2.0.2

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.
@@ -1,5 +1,5 @@
1
- import { defineComponent as M, openBlock as b, createElementBlock as C, mergeProps as A, createElementVNode as c, reactive as U, toRaw as re, ref as D, watch as j, computed as z, normalizeClass as I, normalizeStyle as m, toDisplayString as V, withDirectives as H, unref as i, vShow as F, createVNode as P, Fragment as de, renderList as he, onMounted as ne, nextTick as ce, toRefs as ve, createBlock as q, createCommentVNode as ge } from "vue";
2
- const le = () => ({
1
+ import { defineComponent as X, openBlock as w, createElementBlock as C, mergeProps as I, createElementVNode as c, reactive as ne, toRaw as me, ref as z, watch as K, computed as P, normalizeClass as j, normalizeStyle as _, toDisplayString as U, withDirectives as V, unref as a, vShow as N, createVNode as D, Fragment as pe, renderList as _e, onMounted as ie, nextTick as ae, toRefs as Ee, createBlock as O, createCommentVNode as be } from "vue";
2
+ const re = () => ({
3
3
  width: 300,
4
4
  height: 220,
5
5
  thumbWidth: 150,
@@ -9,31 +9,31 @@ const le = () => ({
9
9
  showTheme: !0,
10
10
  title: "请在下图依次点击",
11
11
  buttonText: "确认"
12
- }), fe = /* @__PURE__ */ c("path", { d: `M100.1,189.9C100.1,189.9,100,189.9,100.1,189.9c-49.7,0-90-40.4-90-89.9c0-49.6,40.4-89.9,89.9-89.9
12
+ }), we = /* @__PURE__ */ c("path", { d: `M100.1,189.9C100.1,189.9,100,189.9,100.1,189.9c-49.7,0-90-40.4-90-89.9c0-49.6,40.4-89.9,89.9-89.9
13
13
  c49.6,0,89.9,40.4,89.9,89.9c0,18.2-5.4,35.7-15.6,50.7c-1.5,2.1-3.6,3.4-6.1,3.9c-2.5,0.4-5-0.1-7-1.6c-4.2-3-5.3-8.6-2.4-12.9
14
14
  c8.1-11.9,12.4-25.7,12.4-40.1c0-39.2-31.9-71.1-71.1-71.1c-39.2,0-71.1,31.9-71.1,71.1c0,39.2,31.9,71.1,71.1,71.1
15
15
  c7.7,0,15.3-1.2,22.6-3.6c2.4-0.8,4.9-0.6,7.2,0.5c2.2,1.1,3.9,3.1,4.7,5.5c1.6,4.9-1,10.2-5.9,11.9
16
16
  C119.3,188.4,109.8,189.9,100.1,189.9z M73,136.4C73,136.4,73,136.4,73,136.4c-2.5,0-4.9-1-6.7-2.8c-3.7-3.7-3.7-9.6,0-13.3
17
17
  L86.7,100L66.4,79.7c-3.7-3.7-3.7-9.6,0-13.3c3.7-3.7,9.6-3.7,13.3,0L100,86.7l20.3-20.3c1.8-1.8,4.1-2.8,6.7-2.8c0,0,0,0,0,0
18
18
  c2.5,0,4.9,1,6.7,2.8c1.8,1.8,2.8,4.1,2.8,6.7c0,2.5-1,4.9-2.8,6.7L113.3,100l20.3,20.3c3.7,3.7,3.7,9.6,0,13.3
19
- c-3.7,3.7-9.6,3.7-13.3,0L100,113.3l-20.3,20.3C77.9,135.4,75.5,136.4,73,136.4z` }, null, -1), pe = [
20
- fe
21
- ], Z = /* @__PURE__ */ M({
19
+ c-3.7,3.7-9.6,3.7-13.3,0L100,113.3l-20.3,20.3C77.9,135.4,75.5,136.4,73,136.4z` }, null, -1), xe = [
20
+ we
21
+ ], ce = /* @__PURE__ */ X({
22
22
  __name: "close-icon",
23
23
  emits: ["click"],
24
- setup(l, { emit: t }) {
25
- const n = t;
24
+ setup(l, { emit: n }) {
25
+ const t = n;
26
26
  function s(e) {
27
- n("click", e);
27
+ t("click", e);
28
28
  }
29
- return (e, a) => (b(), C("svg", A({
29
+ return (e, i) => (w(), C("svg", I({
30
30
  xmlns: "http://www.w3.org/2000/svg",
31
31
  viewBox: "0 0 200 200",
32
32
  width: "20",
33
33
  height: "20"
34
- }, e.$attrs, { onClick: s }), pe, 16));
34
+ }, e.$attrs, { onClick: s }), xe, 16));
35
35
  }
36
- }), me = /* @__PURE__ */ c("path", { d: `M135,149.9c-10.7,7.6-23.2,11.4-36,11.2c-1.7,0-3.4-0.1-5-0.3c-0.7-0.1-1.4-0.2-2-0.3c-1.3-0.2-2.6-0.4-3.9-0.6
36
+ }), Le = /* @__PURE__ */ c("path", { d: `M135,149.9c-10.7,7.6-23.2,11.4-36,11.2c-1.7,0-3.4-0.1-5-0.3c-0.7-0.1-1.4-0.2-2-0.3c-1.3-0.2-2.6-0.4-3.9-0.6
37
37
  c-0.8-0.2-1.6-0.4-2.3-0.5c-1.2-0.3-2.5-0.6-3.7-1c-0.6-0.2-1.2-0.4-1.7-0.6c-1.4-0.5-2.8-1-4.2-1.5c-0.3-0.1-0.6-0.3-0.9-0.4
38
38
  c-1.6-0.7-3.2-1.4-4.7-2.3c-0.1,0-0.1-0.1-0.2-0.1c-5.1-2.9-9.8-6.4-14-10.6c-0.1-0.1-0.1-0.1-0.2-0.2c-1.3-1.3-2.5-2.7-3.7-4.1
39
39
  c-0.2-0.3-0.5-0.6-0.7-0.9c-8.4-10.6-13.5-24.1-13.5-38.8h14.3c0.4,0,0.7-0.2,0.9-0.5c0.2-0.3,0.2-0.8,0-1.1L29.5,60.9
@@ -50,24 +50,24 @@ const le = () => ({
50
50
  c0.6,0.1,1.3,0.3,1.9,0.4c1.4,0.3,2.8,0.7,4.2,1.1c0.4,0.1,0.9,0.3,1.3,0.4c1.6,0.5,3.1,1.1,4.6,1.7c0.2,0.1,0.3,0.1,0.5,0.2
51
51
  c9,3.9,17,10,23.2,17.6c0,0,0.1,0.1,0.1,0.2c8.7,10.7,14,24.5,14,39.4H147c-0.4,0-0.7,0.2-0.9,0.5c-0.2,0.3-0.2,0.8,0,1.1l24,36.4
52
52
  c0.2,0.3,0.5,0.5,0.9,0.5c0.4,0,0.7-0.2,0.9-0.5l23.9-36.4c0.2-0.3,0.2-0.7,0-1.1c-0.2-0.3-0.5-0.5-0.9-0.5L180.6,98.9L180.6,98.9
53
- L180.6,98.9z` }, null, -1), _e = [
54
- me
55
- ], R = /* @__PURE__ */ M({
53
+ L180.6,98.9z` }, null, -1), ke = [
54
+ Le
55
+ ], se = /* @__PURE__ */ X({
56
56
  __name: "refresh-icon",
57
57
  emits: ["click"],
58
- setup(l, { emit: t }) {
59
- const n = t;
58
+ setup(l, { emit: n }) {
59
+ const t = n;
60
60
  function s(e) {
61
- n("click", e);
61
+ t("click", e);
62
62
  }
63
- return (e, a) => (b(), C("svg", A({
63
+ return (e, i) => (w(), C("svg", I({
64
64
  xmlns: "http://www.w3.org/2000/svg",
65
65
  viewBox: "0 0 200 200",
66
66
  width: "20",
67
67
  height: "20"
68
- }, e.$attrs, { onClick: s }), _e, 16));
68
+ }, e.$attrs, { onClick: s }), ke, 16));
69
69
  }
70
- }), we = /* @__PURE__ */ c("circle", {
70
+ }), ye = /* @__PURE__ */ c("circle", {
71
71
  cx: "50",
72
72
  cy: "36.8101",
73
73
  r: "10"
@@ -81,164 +81,164 @@ const le = () => ({
81
81
  keyTimes: "0;0.5;1",
82
82
  values: "23;77;23"
83
83
  })
84
- ], -1), be = [
85
- we
86
- ], ee = /* @__PURE__ */ M({
84
+ ], -1), $e = [
85
+ ye
86
+ ], le = /* @__PURE__ */ X({
87
87
  __name: "loading-icon",
88
88
  emits: ["click"],
89
- setup(l, { emit: t }) {
90
- const n = t;
89
+ setup(l, { emit: n }) {
90
+ const t = n;
91
91
  function s(e) {
92
- n("click", e);
92
+ t("click", e);
93
93
  }
94
- return (e, a) => (b(), C("svg", A({
94
+ return (e, i) => (w(), C("svg", I({
95
95
  xmlns: "http://www.w3.org/2000/svg",
96
96
  viewBox: "0 0 100 100",
97
97
  preserveAspectRatio: "xMidYMid",
98
98
  width: "84",
99
99
  height: "84"
100
- }, e.$attrs, { onClick: s }), be, 16));
100
+ }, e.$attrs, { onClick: s }), $e, 16));
101
101
  }
102
102
  });
103
- function xe(l) {
104
- let t = 0, n = 0;
103
+ function Ce(l) {
104
+ let n = 0, t = 0;
105
105
  if (l.getBoundingClientRect) {
106
106
  const s = l.getBoundingClientRect(), e = document.documentElement;
107
- t = s.left + Math.max(e.scrollLeft, document.body.scrollLeft) - e.clientLeft, n = s.top + Math.max(e.scrollTop, document.body.scrollTop) - e.clientTop;
107
+ n = s.left + Math.max(e.scrollLeft, document.body.scrollLeft) - e.clientLeft, t = s.top + Math.max(e.scrollTop, document.body.scrollTop) - e.clientTop;
108
108
  } else
109
109
  for (; l !== document.body; )
110
- t += l.offsetLeft, n += l.offsetTop, l = l.offsetParent;
110
+ n += l.offsetLeft, t += l.offsetTop, l = l.offsetParent;
111
111
  return {
112
- domX: t,
113
- domY: n
112
+ domX: n,
113
+ domY: t
114
114
  };
115
115
  }
116
- function se(l, t) {
117
- let n = t.relatedTarget;
116
+ function ue(l, n) {
117
+ let t = n.relatedTarget;
118
118
  try {
119
- for (; n && n !== l; )
120
- n = n.parentNode;
119
+ for (; t && t !== l; )
120
+ t = t.parentNode;
121
121
  } catch (s) {
122
122
  console.warn(s);
123
123
  }
124
- return n !== l;
124
+ return t !== l;
125
125
  }
126
- function Ee(l, t) {
127
- const n = U({ list: [] });
126
+ function Te(l, n) {
127
+ const t = ne({ list: [] });
128
128
  return {
129
- dots: n,
129
+ dots: t,
130
130
  clickEvent: (o) => {
131
- const E = o.currentTarget, u = xe(E), g = o.pageX || o.clientX, r = o.pageY || o.clientY, h = u.domX, _ = u.domY, w = g - h, v = r - _, f = parseInt(w.toString()), k = parseInt(v.toString()), $ = /* @__PURE__ */ new Date(), S = n.list.length, y = n.list;
132
- return y.push({ key: $.getTime(), index: S + 1, x: f, y: k }), n.list = y, t.click && t.click(f, k), o.cancelBubble = !0, o.preventDefault(), !1;
131
+ const x = o.currentTarget, u = Ce(x), m = o.pageX || o.clientX, r = o.pageY || o.clientY, v = u.domX, E = u.domY, b = m - v, g = r - E, p = parseInt(b.toString()), L = parseInt(g.toString()), $ = /* @__PURE__ */ new Date(), M = t.list.length, T = t.list;
132
+ return T.push({ key: $.getTime(), index: M + 1, x: p, y: L }), t.list = T, n.click && n.click(p, L), o.cancelBubble = !0, o.preventDefault(), !1;
133
133
  },
134
- confirmEvent: (o) => (t.confirm && t.confirm(re(n.list), () => {
135
- n.list = [];
134
+ confirmEvent: (o) => (n.confirm && n.confirm(me(t.list), () => {
135
+ t.list = [];
136
136
  }), o.cancelBubble = !0, o.preventDefault(), !1),
137
- closeEvent: (o) => (t.close && t.close(), n.list = [], o.cancelBubble = !0, o.preventDefault(), !1),
138
- refreshEvent: (o) => (t.refresh && t.refresh(), n.list = [], o.cancelBubble = !0, o.preventDefault(), !1)
137
+ closeEvent: (o) => (n.close && n.close(), t.list = [], o.cancelBubble = !0, o.preventDefault(), !1),
138
+ refreshEvent: (o) => (n.refresh && n.refresh(), t.list = [], o.cancelBubble = !0, o.preventDefault(), !1)
139
139
  };
140
140
  }
141
- const ke = { class: "gc-header" }, ye = ["src"], Le = { class: "gc-loading" }, $e = ["src"], Ce = { class: "gc-dots" }, Te = { class: "gc-footer" }, Pe = { class: "gc-icon-block gc-icon-block2" }, ze = { class: "gc-button-block" }, G = /* @__PURE__ */ M({
141
+ const De = { class: "gc-header" }, Pe = ["src"], ze = { class: "gc-loading" }, Xe = ["src"], Me = { class: "gc-dots" }, Se = { class: "gc-footer" }, Be = { class: "gc-icon-block gc-icon-block2" }, We = { class: "gc-button-block" }, Q = /* @__PURE__ */ X({
142
142
  __name: "index",
143
143
  props: {
144
- config: { default: le },
144
+ config: { default: re },
145
145
  events: { default: () => ({}) },
146
146
  data: { default: () => ({}) }
147
147
  },
148
148
  setup(l) {
149
- const t = l, { data: n, events: s } = t, e = D({
150
- ...le(),
151
- ...t.config
149
+ const n = l, { data: t, events: s } = n, e = z({
150
+ ...re(),
151
+ ...n.config
152
152
  });
153
- j(() => t.config, () => {
153
+ K(() => n.config, () => {
154
154
  e.value = {
155
155
  ...e.value,
156
- ...t.config
156
+ ...n.config
157
157
  };
158
158
  });
159
- const a = Ee(n, s), d = e.value.horizontalPadding || 0, o = e.value.verticalPadding || 0, E = (e.value.width || 0) + d * 2 + (e.value.showTheme ? 2 : 0), u = a.dots, g = z(() => ({
160
- width: E + "px",
159
+ const i = Te(t, s), d = e.value.horizontalPadding || 0, o = e.value.verticalPadding || 0, x = (e.value.width || 0) + d * 2 + (e.value.showTheme ? 2 : 0), u = i.dots, m = P(() => ({
160
+ width: x + "px",
161
161
  paddingLeft: d + "px",
162
162
  paddingRight: d + "px",
163
163
  paddingTop: o + "px",
164
164
  paddingBottom: o + "px"
165
- })), r = z(() => ({
165
+ })), r = P(() => ({
166
166
  width: e.value.thumbWidth + "px",
167
167
  height: e.value.thumbHeight + "px"
168
- })), h = z(() => ({
168
+ })), v = P(() => ({
169
169
  width: e.value.width + "px",
170
170
  height: e.value.height + "px"
171
171
  }));
172
- return (_, w) => (b(), C("div", {
173
- class: I(`go-captcha gc-wrapper ${e.value.showTheme ? "gc-theme" : ""}`),
174
- style: m(g.value)
172
+ return (E, b) => (w(), C("div", {
173
+ class: j(`go-captcha gc-wrapper ${e.value.showTheme ? "gc-theme" : ""}`),
174
+ style: _(m.value)
175
175
  }, [
176
- c("div", ke, [
177
- c("span", null, V(e.value.title), 1),
178
- H(c("img", {
179
- style: m(r.value),
180
- src: i(n).thumb,
176
+ c("div", De, [
177
+ c("span", null, U(e.value.title), 1),
178
+ V(c("img", {
179
+ style: _(r.value),
180
+ src: a(t).thumb,
181
181
  alt: "..."
182
- }, null, 12, ye), [
183
- [F, i(n).thumb !== ""]
182
+ }, null, 12, Pe), [
183
+ [N, a(t).thumb !== ""]
184
184
  ])
185
185
  ]),
186
186
  c("div", {
187
187
  class: "gc-body",
188
- style: m(h.value)
188
+ style: _(v.value)
189
189
  }, [
190
- c("div", Le, [
191
- P(ee)
190
+ c("div", ze, [
191
+ D(le)
192
192
  ]),
193
- H(c("img", {
194
- style: m(h.value),
193
+ V(c("img", {
194
+ style: _(v.value),
195
195
  class: "gc-picture",
196
- src: i(n).image,
196
+ src: a(t).image,
197
197
  alt: "...",
198
- onClick: w[0] || (w[0] = //@ts-ignore
199
- (...v) => i(a).clickEvent && i(a).clickEvent(...v))
200
- }, null, 12, $e), [
201
- [F, i(n).image !== ""]
198
+ onClick: b[0] || (b[0] = //@ts-ignore
199
+ (...g) => a(i).clickEvent && a(i).clickEvent(...g))
200
+ }, null, 12, Xe), [
201
+ [N, a(t).image !== ""]
202
202
  ]),
203
- c("div", Ce, [
204
- (b(!0), C(de, null, he(i(u).list, (v) => (b(), C("div", {
203
+ c("div", Me, [
204
+ (w(!0), C(pe, null, _e(a(u).list, (g) => (w(), C("div", {
205
205
  class: "gc-dot",
206
- key: `${v.key + "-" + v.index}`,
207
- style: m({
208
- top: v.y - 11 + "px",
209
- left: v.x - 11 + "px"
206
+ key: `${g.key + "-" + g.index}`,
207
+ style: _({
208
+ top: g.y - 11 + "px",
209
+ left: g.x - 11 + "px"
210
210
  })
211
- }, V(v.index), 5))), 128))
211
+ }, U(g.index), 5))), 128))
212
212
  ])
213
213
  ], 4),
214
- c("div", Te, [
215
- c("div", Pe, [
216
- P(Z, {
214
+ c("div", Se, [
215
+ c("div", Be, [
216
+ D(ce, {
217
217
  width: 22,
218
218
  height: 22,
219
- onClick: i(a).closeEvent
219
+ onClick: a(i).closeEvent
220
220
  }, null, 8, ["onClick"]),
221
- P(R, {
221
+ D(se, {
222
222
  width: 22,
223
223
  height: 22,
224
- onClick: i(a).refreshEvent
224
+ onClick: a(i).refreshEvent
225
225
  }, null, 8, ["onClick"])
226
226
  ]),
227
- c("div", ze, [
227
+ c("div", We, [
228
228
  c("button", {
229
- onClick: w[1] || (w[1] = //@ts-ignore
230
- (...v) => i(a).confirmEvent && i(a).confirmEvent(...v))
231
- }, V(e.value.buttonText), 1)
229
+ onClick: b[1] || (b[1] = //@ts-ignore
230
+ (...g) => a(i).confirmEvent && a(i).confirmEvent(...g))
231
+ }, U(e.value.buttonText), 1)
232
232
  ])
233
233
  ])
234
234
  ], 6));
235
235
  }
236
236
  });
237
- G.name = "gocaptcha-click";
238
- G.install = function(l) {
239
- l.component("gocaptcha-click", G);
237
+ Q.name = "gocaptcha-click";
238
+ Q.install = function(l) {
239
+ l.component("gocaptcha-click", Q);
240
240
  };
241
- const oe = () => ({
241
+ const de = () => ({
242
242
  width: 300,
243
243
  height: 220,
244
244
  thumbWidth: 150,
@@ -247,111 +247,119 @@ const oe = () => ({
247
247
  horizontalPadding: 12,
248
248
  showTheme: !0,
249
249
  title: "请拖动滑块完成拼图"
250
- }), Xe = /* @__PURE__ */ c("path", { d: `M131.6,116.3c0,0-75.6,0-109.7,0c-9.1,0-16.2-7.4-16.2-16.2c0-9.1,7.4-16.2,16.2-16.2c28.7,0,109.7,0,109.7,0
250
+ }), Ye = /* @__PURE__ */ c("path", { d: `M131.6,116.3c0,0-75.6,0-109.7,0c-9.1,0-16.2-7.4-16.2-16.2c0-9.1,7.4-16.2,16.2-16.2c28.7,0,109.7,0,109.7,0
251
251
  s-5.4-5.4-30.4-30.7c-6.4-6.4-6.4-16.7,0-23.1s16.7-6.4,23.1,0l58.4,58.4c6.4,6.4,6.4,16.7,0,23.1c0,0-32.9,32.9-57.9,57.9
252
- c-6.4,6.4-16.7,6.4-23.1,0c-6.4-6.4-6.4-16.7,0-23.1C121.8,126.2,131.6,116.3,131.6,116.3z` }, null, -1), De = [
253
- Xe
254
- ], ue = /* @__PURE__ */ M({
252
+ c-6.4,6.4-16.7,6.4-23.1,0c-6.4-6.4-6.4-16.7,0-23.1C121.8,126.2,131.6,116.3,131.6,116.3z` }, null, -1), He = [
253
+ Ye
254
+ ], fe = /* @__PURE__ */ X({
255
255
  __name: "arrows-icon",
256
256
  emits: ["click"],
257
- setup(l, { emit: t }) {
258
- const n = t;
257
+ setup(l, { emit: n }) {
258
+ const t = n;
259
259
  function s(e) {
260
- n("click", e);
260
+ t("click", e);
261
261
  }
262
- return (e, a) => (b(), C("svg", A({
262
+ return (e, i) => (w(), C("svg", I({
263
263
  xmlns: "http://www.w3.org/2000/svg",
264
264
  viewBox: "0 0 200 200",
265
265
  width: "20",
266
266
  height: "20"
267
- }, e.$attrs, { onClick: s }), De, 16));
267
+ }, e.$attrs, { onClick: s }), He, 16));
268
268
  }
269
269
  });
270
- function Me(l, t, n, s, e, a) {
271
- const d = U({ dragLeft: 0, thumbLeft: l.thumbX || 0 }), o = () => {
270
+ function Fe(l, n, t, s, e, i) {
271
+ const d = ne({ dragLeft: 0, thumbLeft: l.thumbX || 0 }), o = () => {
272
272
  d.dragLeft = 0, d.thumbLeft = 0;
273
273
  };
274
274
  return {
275
275
  state: d,
276
276
  dragEvent: (r) => {
277
- const h = r.touches && r.touches[0], _ = e.value.offsetLeft, w = n.value.offsetWidth, v = e.value.offsetWidth, f = w - v, k = l.thumbX || 0, $ = s.value.offsetWidth, S = v - $, y = (f - k + S) / f;
278
- let x = !1, B = 0, T = 0;
279
- h ? B = h.pageX - _ : B = r.clientX - _;
280
- const W = (p) => {
281
- x = !0;
282
- const N = p.touches && p.touches[0];
283
- let L = 0;
284
- if (N ? L = N.pageX - B : L = p.clientX - B, L >= f) {
285
- d.dragLeft = f;
277
+ const v = r.touches && r.touches[0], E = e.value.offsetLeft, b = t.value.offsetWidth, g = e.value.offsetWidth, p = b - g, L = l.thumbX || 0, $ = s.value.offsetWidth, M = g - $, T = (p - L + M) / p;
278
+ let k = !1, S = null, Y = 0, H = 0;
279
+ v ? Y = v.pageX - E : Y = r.clientX - E;
280
+ const B = (f) => {
281
+ k = !0;
282
+ const G = f.touches && f.touches[0];
283
+ let y = 0;
284
+ if (G ? y = G.pageX - Y : y = f.clientX - Y, y >= p) {
285
+ d.dragLeft = p;
286
286
  return;
287
287
  }
288
- if (L <= 0) {
288
+ if (y <= 0) {
289
289
  d.dragLeft = 0;
290
290
  return;
291
291
  }
292
- d.dragLeft = L, T = k + L * y, d.thumbLeft = T, t.move && t.move(T, l.thumbY || 0), p.cancelBubble = !0, p.preventDefault();
293
- }, X = (p) => {
294
- se(a.value, p) && x && (a.value.removeEventListener("mousemove", W, !1), a.value.removeEventListener("touchmove", W, { passive: !1 }), a.value.removeEventListener("mouseup", X, !1), a.value.removeEventListener("mouseout", X, !1), a.value.removeEventListener("touchend", X, !1), x = !1, t.confirm && t.confirm({ x: parseInt(T.toString()), y: l.thumbY || 0 }, () => {
292
+ d.dragLeft = y, H = L + y * T, d.thumbLeft = H, n.move && n.move(H, l.thumbY || 0), f.cancelBubble = !0, f.preventDefault();
293
+ }, h = (f) => {
294
+ ue(i.value, f) && k && (k = !1, J(), n.confirm && n.confirm({ x: parseInt(H.toString()), y: l.thumbY || 0 }, () => {
295
295
  o();
296
- }), p.cancelBubble = !0, p.preventDefault());
296
+ }), f.cancelBubble = !0, f.preventDefault());
297
+ }, A = (f) => {
298
+ S = f;
299
+ }, W = () => {
300
+ S = null;
301
+ }, q = (f) => {
302
+ S && (h(S), J());
303
+ }, J = () => {
304
+ i.value.removeEventListener("mousemove", B, !1), i.value.removeEventListener("touchmove", B, { passive: !1 }), i.value.removeEventListener("mouseup", h, !1), i.value.removeEventListener("mouseenter", W, !1), i.value.removeEventListener("mouseleave", A, !1), i.value.removeEventListener("touchend", h, !1), document.body.removeEventListener("mouseleave", h, !1), document.body.removeEventListener("mouseup", q, !1);
297
305
  };
298
- a.value.addEventListener("mousemove", W, !1), a.value.addEventListener("touchmove", W, { passive: !1 }), a.value.addEventListener("mouseup", X, !1), a.value.addEventListener("mouseout", X, !1), a.value.addEventListener("touchend", X, !1);
306
+ i.value.addEventListener("mousemove", B, !1), i.value.addEventListener("touchmove", B, { passive: !1 }), i.value.addEventListener("mouseup", h, !1), i.value.addEventListener("mouseenter", W, !1), i.value.addEventListener("mouseleave", A, !1), i.value.addEventListener("touchend", h, !1), document.body.addEventListener("mouseleave", h, !1), document.body.addEventListener("mouseup", q, !1);
299
307
  },
300
- closeEvent: (r) => (t && t.close && t.close(), o(), r.cancelBubble = !0, r.preventDefault(), !1),
301
- refreshEvent: (r) => (t && t.refresh && t.refresh(), o(), r.cancelBubble = !0, r.preventDefault(), !1)
308
+ closeEvent: (r) => (n && n.close && n.close(), o(), r.cancelBubble = !0, r.preventDefault(), !1),
309
+ refreshEvent: (r) => (n && n.refresh && n.refresh(), o(), r.cancelBubble = !0, r.preventDefault(), !1)
302
310
  };
303
311
  }
304
- const Se = { class: "gc-header" }, Be = { class: "gc-icon-block" }, We = { class: "gc-loading" }, Ye = ["src"], He = ["src"], Fe = { class: "gc-footer" }, Ae = /* @__PURE__ */ c("div", { class: "gc-drag-line" }, null, -1), J = /* @__PURE__ */ M({
312
+ const Ae = { class: "gc-header" }, Ve = { class: "gc-icon-block" }, Ne = { class: "gc-loading" }, Ie = ["src"], Ue = ["src"], Ge = { class: "gc-footer" }, je = /* @__PURE__ */ c("div", { class: "gc-drag-line" }, null, -1), Z = /* @__PURE__ */ X({
305
313
  __name: "index",
306
314
  props: {
307
- config: { default: oe },
315
+ config: { default: de },
308
316
  events: { default: () => ({}) },
309
317
  data: { default: () => ({}) }
310
318
  },
311
319
  setup(l) {
312
- const t = l, { data: n, events: s } = t, e = D({
313
- ...oe(),
314
- ...t.config
320
+ const n = l, { data: t, events: s } = n, e = z({
321
+ ...de(),
322
+ ...n.config
315
323
  });
316
- j(() => t.config, () => {
324
+ K(() => n.config, () => {
317
325
  e.value = {
318
326
  ...e.value,
319
- ...t.config
327
+ ...n.config
320
328
  };
321
329
  });
322
- const a = D(null), d = D(null), o = D(null), E = D(null), u = Me(n, s, d, E, o, a), g = e.value.horizontalPadding || 0, r = e.value.verticalPadding || 0, h = (e.value.width || 0) + g * 2 + (e.value.showTheme ? 2 : 0), _ = z(() => ({
323
- width: h + "px",
324
- paddingLeft: g + "px",
325
- paddingRight: g + "px",
330
+ const i = z(null), d = z(null), o = z(null), x = z(null), u = Fe(t, s, d, x, o, i), m = e.value.horizontalPadding || 0, r = e.value.verticalPadding || 0, v = (e.value.width || 0) + m * 2 + (e.value.showTheme ? 2 : 0), E = P(() => ({
331
+ width: v + "px",
332
+ paddingLeft: m + "px",
333
+ paddingRight: m + "px",
326
334
  paddingTop: r + "px",
327
335
  paddingBottom: r + "px"
328
- })), w = z(() => ({
329
- width: n.thumbWidth + "px",
330
- height: n.thumbHeight + "px",
331
- top: n.thumbY + "px",
336
+ })), b = P(() => ({
337
+ width: t.thumbWidth + "px",
338
+ height: t.thumbHeight + "px",
339
+ top: t.thumbY + "px",
332
340
  left: u.state.thumbLeft + "px"
333
- })), v = z(() => ({
341
+ })), g = P(() => ({
334
342
  width: e.value.width + "px",
335
343
  height: e.value.height + "px"
336
344
  }));
337
- return ne(async () => {
338
- await ce(), o.value && o.value.addEventListener("dragstart", (f) => f.preventDefault());
339
- }), (f, k) => (b(), C("div", {
340
- class: I(`go-captcha gc-wrapper ${e.value.showTheme ? "gc-theme" : ""}`),
341
- style: m(_.value)
345
+ return ie(async () => {
346
+ await ae(), o.value && o.value.addEventListener("dragstart", (p) => p.preventDefault());
347
+ }), (p, L) => (w(), C("div", {
348
+ class: j(`go-captcha gc-wrapper ${e.value.showTheme ? "gc-theme" : ""}`),
349
+ style: _(E.value)
342
350
  }, [
343
- c("div", Se, [
344
- c("span", null, V(e.value.title), 1),
345
- c("div", Be, [
346
- P(Z, {
351
+ c("div", Ae, [
352
+ c("span", null, U(e.value.title), 1),
353
+ c("div", Ve, [
354
+ D(ce, {
347
355
  width: 22,
348
356
  height: 22,
349
- onClick: i(u).closeEvent
357
+ onClick: a(u).closeEvent
350
358
  }, null, 8, ["onClick"]),
351
- P(R, {
359
+ D(se, {
352
360
  width: 22,
353
361
  height: 22,
354
- onClick: i(u).refreshEvent
362
+ onClick: a(u).refreshEvent
355
363
  }, null, 8, ["onClick"])
356
364
  ])
357
365
  ]),
@@ -359,62 +367,66 @@ const Se = { class: "gc-header" }, Be = { class: "gc-icon-block" }, We = { class
359
367
  class: "gc-body",
360
368
  ref_key: "containerRef",
361
369
  ref: d,
362
- style: m(v.value)
370
+ style: _(g.value)
363
371
  }, [
364
- c("div", We, [
365
- P(ee)
372
+ c("div", Ne, [
373
+ D(le)
366
374
  ]),
367
- H(c("img", {
375
+ V(c("img", {
368
376
  class: "gc-picture",
369
- style: m(v.value),
370
- src: i(n).image,
377
+ style: _(g.value),
378
+ src: a(t).image,
371
379
  alt: "..."
372
- }, null, 12, Ye), [
373
- [F, i(n).image !== ""]
380
+ }, null, 12, Ie), [
381
+ [N, a(t).image !== ""]
374
382
  ]),
375
383
  c("div", {
376
384
  class: "gc-tile",
377
385
  ref_key: "tileRef",
378
- ref: E,
379
- style: m(w.value)
386
+ ref: x,
387
+ style: _(b.value)
380
388
  }, [
381
- H(c("img", {
382
- src: i(n).thumb,
389
+ V(c("img", {
390
+ src: a(t).thumb,
383
391
  alt: "..."
384
- }, null, 8, He), [
385
- [F, i(n).thumb !== ""]
392
+ }, null, 8, Ue), [
393
+ [N, a(t).thumb !== ""]
386
394
  ])
387
395
  ], 4)
388
396
  ], 4),
389
- c("div", Fe, [
397
+ c("div", Ge, [
390
398
  c("div", {
391
399
  class: "gc-drag-slide-bar",
392
400
  ref_key: "dragBarRef",
393
- ref: a,
394
- onMousedown: k[1] || (k[1] = //@ts-ignore
395
- (...$) => i(u).dragEvent && i(u).dragEvent(...$))
401
+ ref: i
396
402
  }, [
397
- Ae,
403
+ je,
398
404
  c("div", {
399
405
  class: "gc-drag-block",
400
406
  ref_key: "dragBlockRef",
401
407
  ref: o,
402
- onTouchstart: k[0] || (k[0] = //@ts-ignore
403
- (...$) => i(u).dragEvent && i(u).dragEvent(...$)),
404
- style: m({ left: i(u).state.dragLeft + "px" })
408
+ onMousedown: L[1] || (L[1] = //@ts-ignore
409
+ (...$) => a(u).dragEvent && a(u).dragEvent(...$)),
410
+ style: _({ left: a(u).state.dragLeft + "px" })
405
411
  }, [
406
- P(ue)
412
+ c("div", {
413
+ class: "drag-block-inline",
414
+ onTouchstart: L[0] || (L[0] = //@ts-ignore
415
+ (...$) => a(u).dragEvent && a(u).dragEvent(...$))
416
+ }, [
417
+ D(fe)
418
+ ], 32)
407
419
  ], 36)
408
- ], 544)
420
+ ], 512)
409
421
  ])
410
422
  ], 6));
411
423
  }
412
424
  });
413
- J.name = "gocaptcha-slide";
414
- J.install = function(l) {
415
- l.component("gocaptcha-slide", J);
425
+ Z.name = "gocaptcha-slide";
426
+ Z.install = function(l) {
427
+ l.component("gocaptcha-slide", Z);
416
428
  };
417
- const ie = () => ({
429
+ const ve = () => ({
418
430
  width: 300,
419
431
  height: 220,
420
432
  verticalPadding: 16,
@@ -422,133 +434,141 @@ const ie = () => ({
422
434
  showTheme: !0,
423
435
  title: "请拖拽贴图完成拼图"
424
436
  });
425
- function Ve(l, t, n, s) {
426
- const e = U({ x: l.thumbX || 0, y: l.thumbY || 0 }), a = () => {
437
+ function qe(l, n, t, s) {
438
+ const e = ne({ x: l.thumbX || 0, y: l.thumbY || 0 }), i = () => {
427
439
  e.x = l.thumbX || 0, e.y = l.thumbY || 0;
428
440
  };
429
441
  return {
430
442
  state: e,
431
443
  dragEvent: (u) => {
432
- const g = u.touches && u.touches[0], r = s.value.offsetLeft, h = s.value.offsetTop, _ = n.value.offsetWidth, w = n.value.offsetHeight, v = s.value.offsetWidth, f = s.value.offsetHeight, k = _ - v, $ = w - f;
433
- let S = !1, y = 0, x = 0, B = 0, T = 0;
434
- g ? (y = g.pageX - r, x = g.pageY - h) : (y = u.clientX - r, x = u.clientY - h);
435
- const W = (p) => {
436
- S = !0;
437
- const N = p.touches && p.touches[0];
438
- let L = 0, Y = 0;
439
- N ? (L = N.pageX - y, Y = N.pageY - x) : (L = p.clientX - y, Y = p.clientY - x), L <= 0 && (L = 0), Y <= 0 && (Y = 0), L >= k && (L = k), Y >= $ && (Y = $), e.x = L, e.y = Y, B = L, T = Y, t.move && t.move(L, Y), p.cancelBubble = !0, p.preventDefault();
440
- }, X = (p) => {
441
- se(n.value, p) && S && (S = !1, n.value.removeEventListener("mousemove", W, !1), n.value.removeEventListener("touchmove", W, { passive: !1 }), n.value.removeEventListener("mouseup", X, !1), n.value.removeEventListener("mouseout", X, !1), n.value.removeEventListener("touchend", X, !1), t.confirm && t.confirm({ x: B, y: T }, () => {
442
- a();
443
- }), p.cancelBubble = !0, p.preventDefault());
444
+ const m = u.touches && u.touches[0], r = s.value.offsetLeft, v = s.value.offsetTop, E = t.value.offsetWidth, b = t.value.offsetHeight, g = s.value.offsetWidth, p = s.value.offsetHeight, L = E - g, $ = b - p;
445
+ let M = !1, T = null, k = 0, S = 0, Y = 0, H = 0;
446
+ m ? (k = m.pageX - r, S = m.pageY - v) : (k = u.clientX - r, S = u.clientY - v);
447
+ const B = (f) => {
448
+ M = !0;
449
+ const G = f.touches && f.touches[0];
450
+ let y = 0, F = 0;
451
+ G ? (y = G.pageX - k, F = G.pageY - S) : (y = f.clientX - k, F = f.clientY - S), y <= 0 && (y = 0), F <= 0 && (F = 0), y >= L && (y = L), F >= $ && (F = $), e.x = y, e.y = F, Y = y, H = F, n.move && n.move(y, F), f.cancelBubble = !0, f.preventDefault();
452
+ }, h = (f) => {
453
+ ue(t.value, f) && M && (M = !1, J(), n.confirm && n.confirm({ x: Y, y: H }, () => {
454
+ i();
455
+ }), f.cancelBubble = !0, f.preventDefault());
456
+ }, A = (f) => {
457
+ T = f;
458
+ }, W = () => {
459
+ T = null;
460
+ }, q = (f) => {
461
+ T && (h(T), J());
462
+ }, J = () => {
463
+ t.value.removeEventListener("mousemove", B, !1), t.value.removeEventListener("touchmove", B, { passive: !1 }), t.value.removeEventListener("mouseup", h, !1), t.value.removeEventListener("mouseenter", W, !1), t.value.removeEventListener("mouseleave", A, !1), t.value.removeEventListener("touchend", h, !1), document.body.removeEventListener("mouseleave", h, !1), document.body.removeEventListener("mouseup", q, !1);
444
464
  };
445
- n.value.addEventListener("mousemove", W, !1), n.value.addEventListener("touchmove", W, { passive: !1 }), n.value.addEventListener("mouseup", X, !1), n.value.addEventListener("mouseout", X, !1), n.value.addEventListener("touchend", X, !1);
465
+ t.value.addEventListener("mousemove", B, !1), t.value.addEventListener("touchmove", B, { passive: !1 }), t.value.addEventListener("mouseup", h, !1), t.value.addEventListener("mouseenter", W, !1), t.value.addEventListener("mouseleave", A, !1), t.value.addEventListener("touchend", h, !1), document.body.addEventListener("mouseleave", h, !1), document.body.addEventListener("mouseup", q, !1);
446
466
  },
447
- closeEvent: (u) => (t && t.close && t.close(), a(), u.cancelBubble = !0, u.preventDefault(), !1),
448
- refreshEvent: (u) => (t && t.refresh && t.refresh(), a(), u.cancelBubble = !0, u.preventDefault(), !1)
467
+ closeEvent: (u) => (n && n.close && n.close(), i(), u.cancelBubble = !0, u.preventDefault(), !1),
468
+ refreshEvent: (u) => (n && n.refresh && n.refresh(), i(), u.cancelBubble = !0, u.preventDefault(), !1)
449
469
  };
450
470
  }
451
- const Ne = { class: "gc-header gc-header2" }, Ie = { class: "gc-loading" }, je = ["src"], qe = ["src"], Ge = { class: "gc-footer" }, Je = { class: "gc-icon-block" }, K = /* @__PURE__ */ M({
471
+ const Je = { class: "gc-header gc-header2" }, Ke = { class: "gc-loading" }, Oe = ["src"], Qe = ["src"], Ze = { class: "gc-footer" }, Re = { class: "gc-icon-block" }, R = /* @__PURE__ */ X({
452
472
  __name: "index",
453
473
  props: {
454
- config: { default: ie },
474
+ config: { default: ve },
455
475
  events: { default: () => ({}) },
456
476
  data: { default: () => ({}) }
457
477
  },
458
478
  setup(l) {
459
- const t = l, { data: n, events: s } = t, e = D({
460
- ...ie(),
461
- ...t.config
479
+ const n = l, { data: t, events: s } = n, e = z({
480
+ ...ve(),
481
+ ...n.config
462
482
  });
463
- j(() => t.config, () => {
483
+ K(() => n.config, () => {
464
484
  e.value = {
465
485
  ...e.value,
466
- ...t.config
486
+ ...n.config
467
487
  };
468
488
  });
469
- const a = D(null), d = D(null), o = Ve(n, s, a, d), E = e.value.horizontalPadding || 0, u = e.value.verticalPadding || 0;
470
- let g = (e.value.width || 0) + E * 2 + (e.value.showTheme ? 2 : 0);
471
- const r = z(() => ({
472
- width: g + "px",
473
- paddingLeft: E + "px",
474
- paddingRight: E + "px",
489
+ const i = z(null), d = z(null), o = qe(t, s, i, d), x = e.value.horizontalPadding || 0, u = e.value.verticalPadding || 0;
490
+ let m = (e.value.width || 0) + x * 2 + (e.value.showTheme ? 2 : 0);
491
+ const r = P(() => ({
492
+ width: m + "px",
493
+ paddingLeft: x + "px",
494
+ paddingRight: x + "px",
475
495
  paddingTop: u + "px",
476
496
  paddingBottom: u + "px"
477
- })), h = z(() => ({
478
- width: n.thumbWidth + "px",
479
- height: n.thumbHeight + "px",
497
+ })), v = P(() => ({
498
+ width: t.thumbWidth + "px",
499
+ height: t.thumbHeight + "px",
480
500
  top: o.state.y + "px",
481
501
  left: o.state.x + "px"
482
- })), _ = z(() => ({
502
+ })), E = P(() => ({
483
503
  width: e.value.width + "px",
484
504
  height: e.value.height + "px"
485
505
  }));
486
- return ne(async () => {
487
- await ce(), d.value && d.value.addEventListener("dragstart", (w) => w.preventDefault());
488
- }), (w, v) => (b(), C("div", {
489
- class: I(`go-captcha gc-wrapper ${e.value.showTheme ? "gc-theme" : ""}`),
490
- style: m(r.value)
506
+ return ie(async () => {
507
+ await ae(), d.value && d.value.addEventListener("dragstart", (b) => b.preventDefault());
508
+ }), (b, g) => (w(), C("div", {
509
+ class: j(`go-captcha gc-wrapper ${e.value.showTheme ? "gc-theme" : ""}`),
510
+ style: _(r.value)
491
511
  }, [
492
- c("div", Ne, [
493
- c("span", null, V(e.value.title), 1)
512
+ c("div", Je, [
513
+ c("span", null, U(e.value.title), 1)
494
514
  ]),
495
515
  c("div", {
496
516
  class: "gc-body",
497
517
  ref_key: "containerRef",
498
- ref: a,
499
- style: m(_.value)
518
+ ref: i,
519
+ style: _(E.value)
500
520
  }, [
501
- c("div", Ie, [
502
- P(ee)
521
+ c("div", Ke, [
522
+ D(le)
503
523
  ]),
504
- H(c("img", {
524
+ V(c("img", {
505
525
  class: "gc-picture",
506
- style: m(_.value),
507
- src: i(n).image,
526
+ style: _(E.value),
527
+ src: a(t).image,
508
528
  alt: "..."
509
- }, null, 12, je), [
510
- [F, i(n).image !== ""]
529
+ }, null, 12, Oe), [
530
+ [N, a(t).image !== ""]
511
531
  ]),
512
532
  c("div", {
513
533
  class: "gc-tile",
514
534
  ref_key: "tileRef",
515
535
  ref: d,
516
- style: m(h.value),
517
- onMousedown: v[0] || (v[0] = //@ts-ignore
518
- (...f) => i(o).dragEvent && i(o).dragEvent(...f)),
519
- onTouchstart: v[1] || (v[1] = //@ts-ignore
520
- (...f) => i(o).dragEvent && i(o).dragEvent(...f))
536
+ style: _(v.value),
537
+ onMousedown: g[0] || (g[0] = //@ts-ignore
538
+ (...p) => a(o).dragEvent && a(o).dragEvent(...p)),
539
+ onTouchstart: g[1] || (g[1] = //@ts-ignore
540
+ (...p) => a(o).dragEvent && a(o).dragEvent(...p))
521
541
  }, [
522
- H(c("img", {
523
- src: i(n).thumb,
542
+ V(c("img", {
543
+ src: a(t).thumb,
524
544
  alt: "..."
525
- }, null, 8, qe), [
526
- [F, i(n).thumb !== ""]
545
+ }, null, 8, Qe), [
546
+ [N, a(t).thumb !== ""]
527
547
  ])
528
548
  ], 36)
529
549
  ], 4),
530
- c("div", Ge, [
531
- c("div", Je, [
532
- P(Z, {
550
+ c("div", Ze, [
551
+ c("div", Re, [
552
+ D(ce, {
533
553
  width: 22,
534
554
  height: 22,
535
- onClick: i(o).closeEvent
555
+ onClick: a(o).closeEvent
536
556
  }, null, 8, ["onClick"]),
537
- P(R, {
557
+ D(se, {
538
558
  width: 22,
539
559
  height: 22,
540
- onClick: i(o).refreshEvent
560
+ onClick: a(o).refreshEvent
541
561
  }, null, 8, ["onClick"])
542
562
  ])
543
563
  ])
544
564
  ], 6));
545
565
  }
546
566
  });
547
- K.name = "gocaptcha-slide-region";
548
- K.install = function(l) {
549
- l.component("gocaptcha-slide-region", K);
567
+ R.name = "gocaptcha-slide-region";
568
+ R.install = function(l) {
569
+ l.component("gocaptcha-slide-region", R);
550
570
  };
551
- const te = () => ({
571
+ const oe = () => ({
552
572
  width: 300,
553
573
  height: 220,
554
574
  size: 220,
@@ -557,321 +577,333 @@ const te = () => ({
557
577
  showTheme: !0,
558
578
  title: "请拖动滑块完成拼图"
559
579
  });
560
- function Ke(l, t, n, s) {
561
- const e = U({ dragLeft: 0, thumbAngle: l.angle || 0 }), a = () => {
580
+ function et(l, n, t, s) {
581
+ const e = ne({ dragLeft: 0, thumbAngle: l.angle || 0 }), i = () => {
562
582
  e.dragLeft = 0, e.thumbAngle = 0;
563
583
  };
564
584
  return {
565
585
  state: e,
566
586
  dragEvent: (u) => {
567
- const g = u.touches && u.touches[0], r = n.value.offsetLeft, h = s.value.offsetWidth, _ = n.value.offsetWidth, w = h - _, v = 360 / w;
568
- let f = 0, k = !1, $ = 0;
569
- g ? $ = g.pageX - r : $ = u.clientX - r;
570
- const S = (x) => {
571
- k = !0;
572
- const B = x.touches && x.touches[0];
573
- let T = 0;
574
- if (B ? T = B.pageX - $ : T = x.clientX - $, T >= w) {
575
- e.dragLeft = w;
587
+ const m = u.touches && u.touches[0], r = t.value.offsetLeft, v = s.value.offsetWidth, E = t.value.offsetWidth, b = v - E, g = 360 / b;
588
+ let p = 0, L = !1, $ = null, M = 0;
589
+ m ? M = m.pageX - r : M = u.clientX - r;
590
+ const T = (h) => {
591
+ L = !0;
592
+ const A = h.touches && h.touches[0];
593
+ let W = 0;
594
+ if (A ? W = A.pageX - M : W = h.clientX - M, W >= b) {
595
+ e.dragLeft = b;
576
596
  return;
577
597
  }
578
- if (T <= 0) {
598
+ if (W <= 0) {
579
599
  e.dragLeft = 0;
580
600
  return;
581
601
  }
582
- e.dragLeft = T, f = T * v, e.thumbAngle = f, t.rotate && t.rotate(f), x.cancelBubble = !0, x.preventDefault();
583
- }, y = (x) => {
584
- se(s.value, x) && k && (s.value.removeEventListener("mousemove", S, !1), s.value.removeEventListener("touchmove", S, { passive: !1 }), s.value.removeEventListener("mouseup", y, !1), s.value.removeEventListener("mouseout", y, !1), s.value.removeEventListener("touchend", y, !1), k = !1, t.confirm && t.confirm(parseInt(f.toString()), () => {
585
- a();
586
- }), x.cancelBubble = !0, x.preventDefault());
602
+ e.dragLeft = W, p = W * g, e.thumbAngle = p, n.rotate && n.rotate(p), h.cancelBubble = !0, h.preventDefault();
603
+ }, k = (h) => {
604
+ ue(s.value, h) && L && (B(), L = !1, n.confirm && n.confirm(parseInt(p.toString()), () => {
605
+ i();
606
+ }), h.cancelBubble = !0, h.preventDefault());
607
+ }, S = (h) => {
608
+ $ = h;
609
+ }, Y = () => {
610
+ $ = null;
611
+ }, H = (h) => {
612
+ $ && (k($), B());
613
+ }, B = () => {
614
+ s.value.removeEventListener("mousemove", T, !1), s.value.removeEventListener("touchmove", T, { passive: !1 }), s.value.removeEventListener("mouseup", k, !1), s.value.removeEventListener("mouseenter", Y, !1), s.value.removeEventListener("mouseleave", S, !1), s.value.removeEventListener("touchend", k, !1), document.body.removeEventListener("mouseleave", k, !1), document.body.removeEventListener("mouseup", H, !1);
587
615
  };
588
- s.value.addEventListener("mousemove", S, !1), s.value.addEventListener("touchmove", S, { passive: !1 }), s.value.addEventListener("mouseup", y, !1), s.value.addEventListener("mouseout", y, !1), s.value.addEventListener("touchend", y, !1);
616
+ s.value.addEventListener("mousemove", T, !1), s.value.addEventListener("touchmove", T, { passive: !1 }), s.value.addEventListener("mouseup", k, !1), s.value.addEventListener("mouseenter", Y, !1), s.value.addEventListener("mouseleave", S, !1), s.value.addEventListener("touchend", k, !1), document.body.addEventListener("mouseleave", k, !1), document.body.addEventListener("mouseup", H, !1);
589
617
  },
590
- closeEvent: (u) => (t && t.close && t.close(), a(), u.cancelBubble = !0, u.preventDefault(), !1),
591
- refreshEvent: (u) => (t && t.refresh && t.refresh(), a(), u.cancelBubble = !0, u.preventDefault(), !1)
618
+ closeEvent: (u) => (n && n.close && n.close(), i(), u.cancelBubble = !0, u.preventDefault(), !1),
619
+ refreshEvent: (u) => (n && n.refresh && n.refresh(), i(), u.cancelBubble = !0, u.preventDefault(), !1)
592
620
  };
593
621
  }
594
- const Oe = { class: "gc-header" }, Qe = { class: "gc-icon-block" }, Ue = { class: "gc-loading" }, Ze = ["src"], Re = /* @__PURE__ */ c("div", { class: "gc-round" }, null, -1), et = { class: "gc-thumb gc-rotate-thumb" }, tt = ["src"], nt = { class: "gc-footer" }, ct = /* @__PURE__ */ c("div", { class: "gc-drag-line" }, null, -1), O = /* @__PURE__ */ M({
622
+ const tt = { class: "gc-header" }, nt = { class: "gc-icon-block" }, ct = { class: "gc-loading" }, st = ["src"], lt = /* @__PURE__ */ c("div", { class: "gc-round" }, null, -1), ot = { class: "gc-thumb gc-rotate-thumb" }, it = ["src"], at = { class: "gc-footer" }, ut = /* @__PURE__ */ c("div", { class: "gc-drag-line" }, null, -1), ee = /* @__PURE__ */ X({
595
623
  __name: "index",
596
624
  props: {
597
- config: { default: te },
625
+ config: { default: oe },
598
626
  events: { default: () => ({}) },
599
627
  data: { default: () => ({}) }
600
628
  },
601
629
  setup(l) {
602
- const t = l, { data: n, events: s } = t, e = D({
603
- ...te(),
604
- ...t.config
630
+ const n = l, { data: t, events: s } = n, e = z({
631
+ ...oe(),
632
+ ...n.config
605
633
  });
606
- j(() => t.config, () => {
634
+ K(() => n.config, () => {
607
635
  e.value = {
608
636
  ...e.value,
609
- ...t.config
637
+ ...n.config
610
638
  };
611
639
  });
612
- const a = D(null), d = D(null), o = Ke(n, s, d, a), E = z(() => {
613
- const r = e.value.horizontalPadding || 0, h = e.value.verticalPadding || 0;
640
+ const i = z(null), d = z(null), o = et(t, s, d, i), x = P(() => {
641
+ const r = e.value.horizontalPadding || 0, v = e.value.verticalPadding || 0;
614
642
  return {
615
643
  width: (e.value.width || 0) + r * 2 + (e.value.showTheme ? 2 : 0) + "px",
616
644
  paddingLeft: r + "px",
617
645
  paddingRight: r + "px",
618
- paddingTop: h + "px",
619
- paddingBottom: h + "px"
646
+ paddingTop: v + "px",
647
+ paddingBottom: v + "px"
620
648
  };
621
- }), u = z(() => ({
649
+ }), u = P(() => ({
622
650
  transform: `rotate(${o.state.thumbAngle}deg)`
623
- })), g = z(() => {
624
- var h;
625
- const r = (((h = e.value) == null ? void 0 : h.size) || 0) > 0 ? e.value.size : te().size;
651
+ })), m = P(() => {
652
+ var v;
653
+ const r = (((v = e.value) == null ? void 0 : v.size) || 0) > 0 ? e.value.size : oe().size;
626
654
  return {
627
655
  width: r + "px",
628
656
  height: r + "px"
629
657
  };
630
658
  });
631
- return ne(async () => {
632
- await ce(), d.value && d.value.addEventListener("dragstart", (r) => r.preventDefault());
633
- }), (r, h) => (b(), C("div", {
634
- class: I(`go-captcha gc-wrapper ${e.value.showTheme ? "gc-theme" : ""}`),
635
- style: m(E.value)
659
+ return ie(async () => {
660
+ await ae(), d.value && d.value.addEventListener("dragstart", (r) => r.preventDefault());
661
+ }), (r, v) => (w(), C("div", {
662
+ class: j(`go-captcha gc-wrapper ${e.value.showTheme ? "gc-theme" : ""}`),
663
+ style: _(x.value)
636
664
  }, [
637
- c("div", Oe, [
638
- c("span", null, V(e.value.title), 1),
639
- c("div", Qe, [
640
- P(Z, {
665
+ c("div", tt, [
666
+ c("span", null, U(e.value.title), 1),
667
+ c("div", nt, [
668
+ D(ce, {
641
669
  width: 22,
642
670
  height: 22,
643
- onClick: i(o).closeEvent
671
+ onClick: a(o).closeEvent
644
672
  }, null, 8, ["onClick"]),
645
- P(R, {
673
+ D(se, {
646
674
  width: 22,
647
675
  height: 22,
648
- onClick: i(o).refreshEvent
676
+ onClick: a(o).refreshEvent
649
677
  }, null, 8, ["onClick"])
650
678
  ])
651
679
  ]),
652
680
  c("div", {
653
681
  class: "gc-body gc-rotate-body",
654
682
  ref: "containerRef",
655
- style: m(g.value)
683
+ style: _(m.value)
656
684
  }, [
657
- c("div", Ue, [
658
- P(ee)
685
+ c("div", ct, [
686
+ D(le)
659
687
  ]),
660
688
  c("div", {
661
689
  class: "gc-picture gc-rotate-picture",
662
- style: m(g.value)
690
+ style: _(m.value)
663
691
  }, [
664
- H(c("img", {
665
- src: i(n).image,
692
+ V(c("img", {
693
+ src: a(t).image,
666
694
  alt: "..."
667
- }, null, 8, Ze), [
668
- [F, i(n).image !== ""]
695
+ }, null, 8, st), [
696
+ [N, a(t).image !== ""]
669
697
  ]),
670
- Re
698
+ lt
671
699
  ], 4),
672
- c("div", et, [
700
+ c("div", ot, [
673
701
  c("div", {
674
702
  class: "gc-rotate-thumb-block",
675
- style: m(u.value)
703
+ style: _(u.value)
676
704
  }, [
677
- H(c("img", {
678
- src: i(n).thumb,
705
+ V(c("img", {
706
+ src: a(t).thumb,
679
707
  alt: "..."
680
- }, null, 8, tt), [
681
- [F, i(n).thumb !== ""]
708
+ }, null, 8, it), [
709
+ [N, a(t).thumb !== ""]
682
710
  ])
683
711
  ], 4)
684
712
  ])
685
713
  ], 4),
686
- c("div", nt, [
714
+ c("div", at, [
687
715
  c("div", {
688
716
  class: "gc-drag-slide-bar",
689
717
  ref_key: "dragBarRef",
690
- ref: a,
691
- onMousedown: h[1] || (h[1] = //@ts-ignore
692
- (..._) => i(o).dragEvent && i(o).dragEvent(..._))
718
+ ref: i
693
719
  }, [
694
- ct,
720
+ ut,
695
721
  c("div", {
696
722
  class: "gc-drag-block",
697
723
  ref_key: "dragBlockRef",
698
724
  ref: d,
699
- onTouchstart: h[0] || (h[0] = //@ts-ignore
700
- (..._) => i(o).dragEvent && i(o).dragEvent(..._)),
701
- style: m({ left: i(o).state.dragLeft + "px" })
725
+ onMousedown: v[1] || (v[1] = //@ts-ignore
726
+ (...E) => a(o).dragEvent && a(o).dragEvent(...E)),
727
+ style: _({ left: a(o).state.dragLeft + "px" })
702
728
  }, [
703
- P(ue)
729
+ c("div", {
730
+ class: "drag-block-inline",
731
+ onTouchstart: v[0] || (v[0] = //@ts-ignore
732
+ (...E) => a(o).dragEvent && a(o).dragEvent(...E))
733
+ }, [
734
+ D(fe)
735
+ ], 32)
704
736
  ], 36)
705
- ], 544)
737
+ ], 512)
706
738
  ])
707
739
  ], 6));
708
740
  }
709
741
  });
710
- O.name = "gocaptcha-rotate";
711
- O.install = function(l) {
712
- l.component("gocaptcha-rotate", O);
742
+ ee.name = "gocaptcha-rotate";
743
+ ee.install = function(l) {
744
+ l.component("gocaptcha-rotate", ee);
713
745
  };
714
- const st = /* @__PURE__ */ c("circle", {
746
+ const rt = /* @__PURE__ */ c("circle", {
715
747
  fill: "#3E7CFF",
716
748
  cx: "100",
717
749
  cy: "100",
718
750
  r: "96.3"
719
- }, null, -1), lt = /* @__PURE__ */ c("path", {
751
+ }, null, -1), dt = /* @__PURE__ */ c("path", {
720
752
  fill: "#FFFFFF",
721
753
  d: `M140.8,64.4l-39.6-11.9h-2.4L59.2,64.4c-1.6,0.8-2.8,2.4-2.8,4v24.1c0,25.3,15.8,45.9,42.3,54.6
722
754
  c0.4,0,0.8,0.4,1.2,0.4c0.4,0,0.8,0,1.2-0.4c26.5-8.7,42.3-28.9,42.3-54.6V68.3C143.5,66.8,142.3,65.2,140.8,64.4z`
723
- }, null, -1), ot = [
724
- st,
725
- lt
726
- ], it = /* @__PURE__ */ M({
755
+ }, null, -1), vt = [
756
+ rt,
757
+ dt
758
+ ], ht = /* @__PURE__ */ X({
727
759
  __name: "btn-default-icon",
728
760
  emits: ["click"],
729
- setup(l, { emit: t }) {
730
- const n = t;
761
+ setup(l, { emit: n }) {
762
+ const t = n;
731
763
  function s(e) {
732
- n("click", e);
764
+ t("click", e);
733
765
  }
734
- return (e, a) => (b(), C("svg", A({
766
+ return (e, i) => (w(), C("svg", I({
735
767
  xmlns: "http://www.w3.org/2000/svg",
736
768
  viewBox: "0 0 200 200",
737
769
  width: "20",
738
770
  height: "20"
739
- }, e.$attrs, { onClick: s }), ot, 16));
771
+ }, e.$attrs, { onClick: s }), vt, 16));
740
772
  }
741
- }), at = /* @__PURE__ */ c("path", {
773
+ }), gt = /* @__PURE__ */ c("path", {
742
774
  fill: "#FFA000",
743
775
  d: `M184,26.6L102.4,2.1h-4.9L16,26.6c-3.3,1.6-5.7,4.9-5.7,8.2v49.8c0,52.2,32.6,94.7,87.3,112.6
744
776
  c0.8,0,1.6,0.8,2.4,0.8s1.6,0,2.4-0.8c54.7-18,87.3-59.6,87.3-112.6V34.7C189.8,31.5,187.3,28.2,184,26.6z M107.3,109.1
745
777
  c-0.5,5.4-3.9,7.9-7.3,7.9c-2.5,0,0,0,0,0c-3.2-0.6-5.7-2-6.8-7.4l-4.4-50.9c0-5.1,6.2-9.7,11.5-9.7c5.3,0,11,4.7,11,9.9
746
778
  L107.3,109.1z M109.3,133.3c0,5.1-4.2,9.3-9.3,9.3c-5.1,0-9.3-4.2-9.3-9.3c0-5.1,4.2-9.3,9.3-9.3C105.1,124,109.3,128.1,109.3,133.3
747
779
  z`
748
- }, null, -1), ut = [
749
- at
750
- ], rt = /* @__PURE__ */ M({
780
+ }, null, -1), ft = [
781
+ gt
782
+ ], mt = /* @__PURE__ */ X({
751
783
  __name: "btn-warn-icon",
752
784
  emits: ["click"],
753
- setup(l, { emit: t }) {
754
- const n = t;
785
+ setup(l, { emit: n }) {
786
+ const t = n;
755
787
  function s(e) {
756
- n("click", e);
788
+ t("click", e);
757
789
  }
758
- return (e, a) => (b(), C("svg", A({
790
+ return (e, i) => (w(), C("svg", I({
759
791
  xmlns: "http://www.w3.org/2000/svg",
760
792
  viewBox: "0 0 200 200",
761
793
  width: "20",
762
794
  height: "20"
763
- }, e.$attrs, { onClick: s }), ut, 16));
795
+ }, e.$attrs, { onClick: s }), ft, 16));
764
796
  }
765
- }), dt = /* @__PURE__ */ c("path", {
797
+ }), pt = /* @__PURE__ */ c("path", {
766
798
  fill: "#ED4630",
767
799
  d: `M184,26.6L102.4,2.1h-4.9L16,26.6c-3.3,1.6-5.7,4.9-5.7,8.2v49.8c0,52.2,32.6,94.7,87.3,112.6
768
800
  c0.8,0,1.6,0.8,2.4,0.8s1.6,0,2.4-0.8c54.7-18,87.3-59.6,87.3-112.6V34.7C189.8,31.5,187.3,28.2,184,26.6z M134.5,123.1
769
801
  c3.1,3.1,3.1,8.2,0,11.3c-1.6,1.6-3.6,2.3-5.7,2.3s-4.1-0.8-5.7-2.3L100,111.3l-23.1,23.1c-1.6,1.6-3.6,2.3-5.7,2.3
770
802
  c-2,0-4.1-0.8-5.7-2.3c-3.1-3.1-3.1-8.2,0-11.3L88.7,100L65.5,76.9c-3.1-3.1-3.1-8.2,0-11.3c3.1-3.1,8.2-3.1,11.3,0L100,88.7
771
803
  l23.1-23.1c3.1-3.1,8.2-3.1,11.3,0c3.1,3.1,3.1,8.2,0,11.3L111.3,100L134.5,123.1z`
772
- }, null, -1), ht = [
773
- dt
774
- ], vt = /* @__PURE__ */ M({
804
+ }, null, -1), _t = [
805
+ pt
806
+ ], Et = /* @__PURE__ */ X({
775
807
  __name: "btn-error-icon",
776
808
  emits: ["click"],
777
- setup(l, { emit: t }) {
778
- const n = t;
809
+ setup(l, { emit: n }) {
810
+ const t = n;
779
811
  function s(e) {
780
- n("click", e);
812
+ t("click", e);
781
813
  }
782
- return (e, a) => (b(), C("svg", A({
814
+ return (e, i) => (w(), C("svg", I({
783
815
  xmlns: "http://www.w3.org/2000/svg",
784
816
  viewBox: "0 0 200 200",
785
817
  width: "20",
786
818
  height: "20"
787
- }, e.$attrs, { onClick: s }), ht, 16));
819
+ }, e.$attrs, { onClick: s }), _t, 16));
788
820
  }
789
- }), gt = /* @__PURE__ */ c("path", {
821
+ }), bt = /* @__PURE__ */ c("path", {
790
822
  fill: "#5EAA2F",
791
823
  d: `M183.3,27.2L102.4,2.9h-4.9L16.7,27.2C13.4,28.8,11,32,11,35.3v49.4c0,51.8,32.4,93.9,86.6,111.7
792
824
  c0.8,0,1.6,0.8,2.4,0.8c0.8,0,1.6,0,2.4-0.8c54.2-17.8,86.6-59.1,86.6-111.7V35.3C189,32,186.6,28.8,183.3,27.2z M146.1,81.4
793
825
  l-48.5,48.5c-1.6,1.6-3.2,2.4-5.7,2.4c-2.4,0-4-0.8-5.7-2.4L62,105.7c-3.2-3.2-3.2-8.1,0-11.3c3.2-3.2,8.1-3.2,11.3,0l18.6,18.6
794
826
  l42.9-42.9c3.2-3.2,8.1-3.2,11.3,0C149.4,73.3,149.4,78.2,146.1,81.4L146.1,81.4z`
795
- }, null, -1), ft = [
796
- gt
797
- ], pt = /* @__PURE__ */ M({
827
+ }, null, -1), wt = [
828
+ bt
829
+ ], xt = /* @__PURE__ */ X({
798
830
  __name: "btn-success-icon",
799
831
  emits: ["click"],
800
- setup(l, { emit: t }) {
801
- const n = t;
832
+ setup(l, { emit: n }) {
833
+ const t = n;
802
834
  function s(e) {
803
- n("click", e);
835
+ t("click", e);
804
836
  }
805
- return (e, a) => (b(), C("svg", A({
837
+ return (e, i) => (w(), C("svg", I({
806
838
  xmlns: "http://www.w3.org/2000/svg",
807
839
  viewBox: "0 0 200 200",
808
840
  width: "20",
809
841
  height: "20"
810
- }, e.$attrs, { onClick: s }), ft, 16));
842
+ }, e.$attrs, { onClick: s }), wt, 16));
811
843
  }
812
- }), ae = () => ({
844
+ }), he = () => ({
813
845
  width: 330,
814
846
  height: 44,
815
847
  verticalPadding: 12,
816
848
  horizontalPadding: 16
817
- }), Q = /* @__PURE__ */ M({
849
+ }), te = /* @__PURE__ */ X({
818
850
  __name: "index",
819
851
  props: {
820
- config: { default: ae },
852
+ config: { default: he },
821
853
  clickEvent: {},
822
854
  disabled: { type: Boolean, default: !1 },
823
855
  type: { default: "default" },
824
856
  title: { default: "点击按键进行验证" }
825
857
  },
826
858
  emits: ["click-event"],
827
- setup(l, { emit: t }) {
828
- const n = l, { type: s, title: e, disabled: a } = ve(n), d = D({
829
- ...ae(),
830
- ...n.config
859
+ setup(l, { emit: n }) {
860
+ const t = l, { type: s, title: e, disabled: i } = Ee(t), d = z({
861
+ ...he(),
862
+ ...t.config
831
863
  });
832
- j(() => n.config, () => {
864
+ K(() => t.config, () => {
833
865
  d.value = {
834
866
  ...d.value,
835
- ...n.config
867
+ ...t.config
836
868
  };
837
869
  });
838
- const o = z(() => ["go-captcha", "gc-btn-block", `gc-${s.value}`, a.value ? "gc-disabled" : ""]), E = z(() => ({
870
+ const o = P(() => ["go-captcha", "gc-btn-block", `gc-${s.value}`, i.value ? "gc-disabled" : ""]), x = P(() => ({
839
871
  width: d.value.width + "px",
840
872
  height: d.value.height + "px",
841
873
  paddingLeft: d.value.horizontalPadding + "px",
842
874
  paddingRight: d.value.horizontalPadding + "px",
843
875
  paddingTop: d.value.verticalPadding + "px",
844
876
  paddingBottom: d.value.verticalPadding + "px"
845
- })), u = t;
846
- function g(r) {
877
+ })), u = n;
878
+ function m(r) {
847
879
  u("click-event", r);
848
880
  }
849
- return (r, h) => (b(), C("div", {
850
- class: I(o.value),
851
- style: m(E.value),
852
- onClick: g
881
+ return (r, v) => (w(), C("div", {
882
+ class: j(o.value),
883
+ style: _(x.value),
884
+ onClick: m
853
885
  }, [
854
886
  c("div", {
855
- class: I(i(s) === "default" ? "gc-ripple" : "")
887
+ class: j(a(s) === "default" ? "gc-ripple" : "")
856
888
  }, [
857
- i(s) === "default" ? (b(), q(it, { key: 0 })) : i(s) === "warn" ? (b(), q(rt, { key: 1 })) : i(s) === "error" ? (b(), q(vt, { key: 2 })) : i(s) === "success" ? (b(), q(pt, { key: 3 })) : ge("", !0)
889
+ a(s) === "default" ? (w(), O(ht, { key: 0 })) : a(s) === "warn" ? (w(), O(mt, { key: 1 })) : a(s) === "error" ? (w(), O(Et, { key: 2 })) : a(s) === "success" ? (w(), O(xt, { key: 3 })) : be("", !0)
858
890
  ], 2),
859
- c("span", null, V(i(e)), 1)
891
+ c("span", null, U(a(e)), 1)
860
892
  ], 6));
861
893
  }
862
894
  });
863
- Q.name = "gocaptcha-button";
864
- Q.install = function(l) {
865
- l.component("gocaptcha-button", Q);
895
+ te.name = "gocaptcha-button";
896
+ te.install = function(l) {
897
+ l.component("gocaptcha-button", te);
866
898
  };
867
- const _t = (l) => {
868
- l.installed || (l.installed = !0, [G, J, K, O, Q].map((t) => l.use(t)));
899
+ const ge = "go_captcha_installed", kt = (l) => {
900
+ l[ge] || (l[ge] = !0, [Q, Z, R, ee, te].map((n) => l.use(n)));
869
901
  };
870
902
  export {
871
- Q as Button,
872
- G as Click,
873
- O as Rotate,
874
- J as Slide,
875
- K as SlideRegion,
876
- _t as default
903
+ te as Button,
904
+ Q as Click,
905
+ ee as Rotate,
906
+ Z as Slide,
907
+ R as SlideRegion,
908
+ kt as default
877
909
  };