@xlui/xux-ui 0.1.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/dist/index.mjs ADDED
@@ -0,0 +1,4819 @@
1
+ import { defineComponent as V, h as Ce, ref as $, computed as X, createElementBlock as v, openBlock as u, normalizeClass as B, createCommentVNode as A, createElementVNode as y, Fragment as z, renderList as D, normalizeStyle as G, createVNode as R, unref as W, renderSlot as Q, onMounted as se, toDisplayString as T, withModifiers as H, withCtx as Z, createBlock as re, nextTick as _, onUnmounted as Ve, readonly as Se, withKeys as O, createTextVNode as ze, Transition as pe, withDirectives as Qe, vModelText as Ze, watch as J, Teleport as Je } from "vue";
2
+ const Fe = /^[a-z0-9]+(-[a-z0-9]+)*$/, ce = (e, o, a, n = "") => {
3
+ const t = e.split(":");
4
+ if (e.slice(0, 1) === "@") {
5
+ if (t.length < 2 || t.length > 3)
6
+ return null;
7
+ n = t.shift().slice(1);
8
+ }
9
+ if (t.length > 3 || !t.length)
10
+ return null;
11
+ if (t.length > 1) {
12
+ const g = t.pop(), h = t.pop(), c = {
13
+ // Allow provider without '@': "provider:prefix:name"
14
+ provider: t.length > 0 ? t[0] : n,
15
+ prefix: h,
16
+ name: g
17
+ };
18
+ return o && !te(c) ? null : c;
19
+ }
20
+ const l = t[0], s = l.split("-");
21
+ if (s.length > 1) {
22
+ const g = {
23
+ provider: n,
24
+ prefix: s.shift(),
25
+ name: s.join("-")
26
+ };
27
+ return o && !te(g) ? null : g;
28
+ }
29
+ if (a && n === "") {
30
+ const g = {
31
+ provider: n,
32
+ prefix: "",
33
+ name: l
34
+ };
35
+ return o && !te(g, a) ? null : g;
36
+ }
37
+ return null;
38
+ }, te = (e, o) => e ? !!// Check prefix: cannot be empty, unless allowSimpleName is enabled
39
+ // Check name: cannot be empty
40
+ ((o && e.prefix === "" || e.prefix) && e.name) : !1, Oe = Object.freeze(
41
+ {
42
+ left: 0,
43
+ top: 0,
44
+ width: 16,
45
+ height: 16
46
+ }
47
+ ), le = Object.freeze({
48
+ rotate: 0,
49
+ vFlip: !1,
50
+ hFlip: !1
51
+ }), ge = Object.freeze({
52
+ ...Oe,
53
+ ...le
54
+ }), he = Object.freeze({
55
+ ...ge,
56
+ body: "",
57
+ hidden: !1
58
+ });
59
+ function en(e, o) {
60
+ const a = {};
61
+ !e.hFlip != !o.hFlip && (a.hFlip = !0), !e.vFlip != !o.vFlip && (a.vFlip = !0);
62
+ const n = ((e.rotate || 0) + (o.rotate || 0)) % 4;
63
+ return n && (a.rotate = n), a;
64
+ }
65
+ function xe(e, o) {
66
+ const a = en(e, o);
67
+ for (const n in he)
68
+ n in le ? n in e && !(n in a) && (a[n] = le[n]) : n in o ? a[n] = o[n] : n in e && (a[n] = e[n]);
69
+ return a;
70
+ }
71
+ function nn(e, o) {
72
+ const a = e.icons, n = e.aliases || /* @__PURE__ */ Object.create(null), t = /* @__PURE__ */ Object.create(null);
73
+ function l(s) {
74
+ if (a[s])
75
+ return t[s] = [];
76
+ if (!(s in t)) {
77
+ t[s] = null;
78
+ const g = n[s] && n[s].parent, h = g && l(g);
79
+ h && (t[s] = [g].concat(h));
80
+ }
81
+ return t[s];
82
+ }
83
+ return Object.keys(a).concat(Object.keys(n)).forEach(l), t;
84
+ }
85
+ function tn(e, o, a) {
86
+ const n = e.icons, t = e.aliases || /* @__PURE__ */ Object.create(null);
87
+ let l = {};
88
+ function s(g) {
89
+ l = xe(
90
+ n[g] || t[g],
91
+ l
92
+ );
93
+ }
94
+ return s(o), a.forEach(s), xe(e, l);
95
+ }
96
+ function Re(e, o) {
97
+ const a = [];
98
+ if (typeof e != "object" || typeof e.icons != "object")
99
+ return a;
100
+ e.not_found instanceof Array && e.not_found.forEach((t) => {
101
+ o(t, null), a.push(t);
102
+ });
103
+ const n = nn(e);
104
+ for (const t in n) {
105
+ const l = n[t];
106
+ l && (o(t, tn(e, t, l)), a.push(t));
107
+ }
108
+ return a;
109
+ }
110
+ const on = {
111
+ provider: "",
112
+ aliases: {},
113
+ not_found: {},
114
+ ...Oe
115
+ };
116
+ function de(e, o) {
117
+ for (const a in o)
118
+ if (a in e && typeof e[a] != typeof o[a])
119
+ return !1;
120
+ return !0;
121
+ }
122
+ function De(e) {
123
+ if (typeof e != "object" || e === null)
124
+ return null;
125
+ const o = e;
126
+ if (typeof o.prefix != "string" || !e.icons || typeof e.icons != "object" || !de(e, on))
127
+ return null;
128
+ const a = o.icons;
129
+ for (const t in a) {
130
+ const l = a[t];
131
+ if (
132
+ // Name cannot be empty
133
+ !t || // Must have body
134
+ typeof l.body != "string" || // Check other props
135
+ !de(
136
+ l,
137
+ he
138
+ )
139
+ )
140
+ return null;
141
+ }
142
+ const n = o.aliases || /* @__PURE__ */ Object.create(null);
143
+ for (const t in n) {
144
+ const l = n[t], s = l.parent;
145
+ if (
146
+ // Name cannot be empty
147
+ !t || // Parent must be set and point to existing icon
148
+ typeof s != "string" || !a[s] && !n[s] || // Check other props
149
+ !de(
150
+ l,
151
+ he
152
+ )
153
+ )
154
+ return null;
155
+ }
156
+ return o;
157
+ }
158
+ const Ee = /* @__PURE__ */ Object.create(null);
159
+ function an(e, o) {
160
+ return {
161
+ provider: e,
162
+ prefix: o,
163
+ icons: /* @__PURE__ */ Object.create(null),
164
+ missing: /* @__PURE__ */ new Set()
165
+ };
166
+ }
167
+ function q(e, o) {
168
+ const a = Ee[e] || (Ee[e] = /* @__PURE__ */ Object.create(null));
169
+ return a[o] || (a[o] = an(e, o));
170
+ }
171
+ function _e(e, o) {
172
+ return De(o) ? Re(o, (a, n) => {
173
+ n ? e.icons[a] = n : e.missing.add(a);
174
+ }) : [];
175
+ }
176
+ function ln(e, o, a) {
177
+ try {
178
+ if (typeof a.body == "string")
179
+ return e.icons[o] = { ...a }, !0;
180
+ } catch {
181
+ }
182
+ return !1;
183
+ }
184
+ let ee = !1;
185
+ function Ne(e) {
186
+ return typeof e == "boolean" && (ee = e), ee;
187
+ }
188
+ function sn(e) {
189
+ const o = typeof e == "string" ? ce(e, !0, ee) : e;
190
+ if (o) {
191
+ const a = q(o.provider, o.prefix), n = o.name;
192
+ return a.icons[n] || (a.missing.has(n) ? null : void 0);
193
+ }
194
+ }
195
+ function cn(e, o) {
196
+ const a = ce(e, !0, ee);
197
+ if (!a)
198
+ return !1;
199
+ const n = q(a.provider, a.prefix);
200
+ return o ? ln(n, a.name, o) : (n.missing.add(a.name), !0);
201
+ }
202
+ function gn(e, o) {
203
+ if (typeof e != "object")
204
+ return !1;
205
+ if (typeof o != "string" && (o = e.provider || ""), ee && !o && !e.prefix) {
206
+ let t = !1;
207
+ return De(e) && (e.prefix = "", Re(e, (l, s) => {
208
+ cn(l, s) && (t = !0);
209
+ })), t;
210
+ }
211
+ const a = e.prefix;
212
+ if (!te({
213
+ prefix: a,
214
+ name: "a"
215
+ }))
216
+ return !1;
217
+ const n = q(o, a);
218
+ return !!_e(n, e);
219
+ }
220
+ const Ge = Object.freeze({
221
+ width: null,
222
+ height: null
223
+ }), We = Object.freeze({
224
+ // Dimensions
225
+ ...Ge,
226
+ // Transformations
227
+ ...le
228
+ }), dn = /(-?[0-9.]*[0-9]+[0-9.]*)/g, fn = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
229
+ function Pe(e, o, a) {
230
+ if (o === 1)
231
+ return e;
232
+ if (a = a || 100, typeof e == "number")
233
+ return Math.ceil(e * o * a) / a;
234
+ if (typeof e != "string")
235
+ return e;
236
+ const n = e.split(dn);
237
+ if (n === null || !n.length)
238
+ return e;
239
+ const t = [];
240
+ let l = n.shift(), s = fn.test(l);
241
+ for (; ; ) {
242
+ if (s) {
243
+ const g = parseFloat(l);
244
+ isNaN(g) ? t.push(l) : t.push(Math.ceil(g * o * a) / a);
245
+ } else
246
+ t.push(l);
247
+ if (l = n.shift(), l === void 0)
248
+ return t.join("");
249
+ s = !s;
250
+ }
251
+ }
252
+ function rn(e, o = "defs") {
253
+ let a = "";
254
+ const n = e.indexOf("<" + o);
255
+ for (; n >= 0; ) {
256
+ const t = e.indexOf(">", n), l = e.indexOf("</" + o);
257
+ if (t === -1 || l === -1)
258
+ break;
259
+ const s = e.indexOf(">", l);
260
+ if (s === -1)
261
+ break;
262
+ a += e.slice(t + 1, l).trim(), e = e.slice(0, n).trim() + e.slice(s + 1);
263
+ }
264
+ return {
265
+ defs: a,
266
+ content: e
267
+ };
268
+ }
269
+ function pn(e, o) {
270
+ return e ? "<defs>" + e + "</defs>" + o : o;
271
+ }
272
+ function hn(e, o, a) {
273
+ const n = rn(e);
274
+ return pn(n.defs, o + n.content + a);
275
+ }
276
+ const mn = (e) => e === "unset" || e === "undefined" || e === "none";
277
+ function un(e, o) {
278
+ const a = {
279
+ ...ge,
280
+ ...e
281
+ }, n = {
282
+ ...We,
283
+ ...o
284
+ }, t = {
285
+ left: a.left,
286
+ top: a.top,
287
+ width: a.width,
288
+ height: a.height
289
+ };
290
+ let l = a.body;
291
+ [a, n].forEach((r) => {
292
+ const f = [], S = r.hFlip, P = r.vFlip;
293
+ let C = r.rotate;
294
+ S ? P ? C += 2 : (f.push(
295
+ "translate(" + (t.width + t.left).toString() + " " + (0 - t.top).toString() + ")"
296
+ ), f.push("scale(-1 1)"), t.top = t.left = 0) : P && (f.push(
297
+ "translate(" + (0 - t.left).toString() + " " + (t.height + t.top).toString() + ")"
298
+ ), f.push("scale(1 -1)"), t.top = t.left = 0);
299
+ let w;
300
+ switch (C < 0 && (C -= Math.floor(C / 4) * 4), C = C % 4, C) {
301
+ case 1:
302
+ w = t.height / 2 + t.top, f.unshift(
303
+ "rotate(90 " + w.toString() + " " + w.toString() + ")"
304
+ );
305
+ break;
306
+ case 2:
307
+ f.unshift(
308
+ "rotate(180 " + (t.width / 2 + t.left).toString() + " " + (t.height / 2 + t.top).toString() + ")"
309
+ );
310
+ break;
311
+ case 3:
312
+ w = t.width / 2 + t.left, f.unshift(
313
+ "rotate(-90 " + w.toString() + " " + w.toString() + ")"
314
+ );
315
+ break;
316
+ }
317
+ C % 2 === 1 && (t.left !== t.top && (w = t.left, t.left = t.top, t.top = w), t.width !== t.height && (w = t.width, t.width = t.height, t.height = w)), f.length && (l = hn(
318
+ l,
319
+ '<g transform="' + f.join(" ") + '">',
320
+ "</g>"
321
+ ));
322
+ });
323
+ const s = n.width, g = n.height, h = t.width, c = t.height;
324
+ let i, p;
325
+ s === null ? (p = g === null ? "1em" : g === "auto" ? c : g, i = Pe(p, h / c)) : (i = s === "auto" ? h : s, p = g === null ? Pe(i, c / h) : g === "auto" ? c : g);
326
+ const b = {}, d = (r, f) => {
327
+ mn(f) || (b[r] = f.toString());
328
+ };
329
+ d("width", i), d("height", p);
330
+ const j = [t.left, t.top, h, c];
331
+ return b.viewBox = j.join(" "), {
332
+ attributes: b,
333
+ viewBox: j,
334
+ body: l
335
+ };
336
+ }
337
+ const vn = /\sid="(\S+)"/g, bn = "IconifyId" + Date.now().toString(16) + (Math.random() * 16777216 | 0).toString(16);
338
+ let wn = 0;
339
+ function yn(e, o = bn) {
340
+ const a = [];
341
+ let n;
342
+ for (; n = vn.exec(e); )
343
+ a.push(n[1]);
344
+ if (!a.length)
345
+ return e;
346
+ const t = "suffix" + (Math.random() * 16777216 | Date.now()).toString(16);
347
+ return a.forEach((l) => {
348
+ const s = typeof o == "function" ? o(l) : o + (wn++).toString(), g = l.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
349
+ e = e.replace(
350
+ // Allowed characters before id: [#;"]
351
+ // Allowed characters after id: [)"], .[a-z]
352
+ new RegExp('([#;"])(' + g + ')([")]|\\.[a-z])', "g"),
353
+ "$1" + s + t + "$3"
354
+ );
355
+ }), e = e.replace(new RegExp(t, "g"), ""), e;
356
+ }
357
+ const me = /* @__PURE__ */ Object.create(null);
358
+ function Cn(e, o) {
359
+ me[e] = o;
360
+ }
361
+ function ue(e) {
362
+ return me[e] || me[""];
363
+ }
364
+ function be(e) {
365
+ let o;
366
+ if (typeof e.resources == "string")
367
+ o = [e.resources];
368
+ else if (o = e.resources, !(o instanceof Array) || !o.length)
369
+ return null;
370
+ return {
371
+ // API hosts
372
+ resources: o,
373
+ // Root path
374
+ path: e.path || "/",
375
+ // URL length limit
376
+ maxURL: e.maxURL || 500,
377
+ // Timeout before next host is used.
378
+ rotate: e.rotate || 750,
379
+ // Timeout before failing query.
380
+ timeout: e.timeout || 5e3,
381
+ // Randomise default API end point.
382
+ random: e.random === !0,
383
+ // Start index
384
+ index: e.index || 0,
385
+ // Receive data after time out (used if time out kicks in first, then API module sends data anyway).
386
+ dataAfterTimeout: e.dataAfterTimeout !== !1
387
+ };
388
+ }
389
+ const we = /* @__PURE__ */ Object.create(null), U = [
390
+ "https://api.simplesvg.com",
391
+ "https://api.unisvg.com"
392
+ ], oe = [];
393
+ for (; U.length > 0; )
394
+ U.length === 1 || Math.random() > 0.5 ? oe.push(U.shift()) : oe.push(U.pop());
395
+ we[""] = be({
396
+ resources: ["https://api.iconify.design"].concat(oe)
397
+ });
398
+ function Sn(e, o) {
399
+ const a = be(o);
400
+ return a === null ? !1 : (we[e] = a, !0);
401
+ }
402
+ function ye(e) {
403
+ return we[e];
404
+ }
405
+ const xn = () => {
406
+ let e;
407
+ try {
408
+ if (e = fetch, typeof e == "function")
409
+ return e;
410
+ } catch {
411
+ }
412
+ };
413
+ let je = xn();
414
+ function En(e, o) {
415
+ const a = ye(e);
416
+ if (!a)
417
+ return 0;
418
+ let n;
419
+ if (!a.maxURL)
420
+ n = 0;
421
+ else {
422
+ let t = 0;
423
+ a.resources.forEach((s) => {
424
+ t = Math.max(t, s.length);
425
+ });
426
+ const l = o + ".json?icons=";
427
+ n = a.maxURL - t - a.path.length - l.length;
428
+ }
429
+ return n;
430
+ }
431
+ function Pn(e) {
432
+ return e === 404;
433
+ }
434
+ const jn = (e, o, a) => {
435
+ const n = [], t = En(e, o), l = "icons";
436
+ let s = {
437
+ type: l,
438
+ provider: e,
439
+ prefix: o,
440
+ icons: []
441
+ }, g = 0;
442
+ return a.forEach((h, c) => {
443
+ g += h.length + 1, g >= t && c > 0 && (n.push(s), s = {
444
+ type: l,
445
+ provider: e,
446
+ prefix: o,
447
+ icons: []
448
+ }, g = h.length), s.icons.push(h);
449
+ }), n.push(s), n;
450
+ };
451
+ function kn(e) {
452
+ if (typeof e == "string") {
453
+ const o = ye(e);
454
+ if (o)
455
+ return o.path;
456
+ }
457
+ return "/";
458
+ }
459
+ const Mn = (e, o, a) => {
460
+ if (!je) {
461
+ a("abort", 424);
462
+ return;
463
+ }
464
+ let n = kn(o.provider);
465
+ switch (o.type) {
466
+ case "icons": {
467
+ const l = o.prefix, g = o.icons.join(","), h = new URLSearchParams({
468
+ icons: g
469
+ });
470
+ n += l + ".json?" + h.toString();
471
+ break;
472
+ }
473
+ case "custom": {
474
+ const l = o.uri;
475
+ n += l.slice(0, 1) === "/" ? l.slice(1) : l;
476
+ break;
477
+ }
478
+ default:
479
+ a("abort", 400);
480
+ return;
481
+ }
482
+ let t = 503;
483
+ je(e + n).then((l) => {
484
+ const s = l.status;
485
+ if (s !== 200) {
486
+ setTimeout(() => {
487
+ a(Pn(s) ? "abort" : "next", s);
488
+ });
489
+ return;
490
+ }
491
+ return t = 501, l.json();
492
+ }).then((l) => {
493
+ if (typeof l != "object" || l === null) {
494
+ setTimeout(() => {
495
+ l === 404 ? a("abort", l) : a("next", t);
496
+ });
497
+ return;
498
+ }
499
+ setTimeout(() => {
500
+ a("success", l);
501
+ });
502
+ }).catch(() => {
503
+ a("next", t);
504
+ });
505
+ }, An = {
506
+ prepare: jn,
507
+ send: Mn
508
+ };
509
+ function In(e) {
510
+ const o = {
511
+ loaded: [],
512
+ missing: [],
513
+ pending: []
514
+ }, a = /* @__PURE__ */ Object.create(null);
515
+ e.sort((t, l) => t.provider !== l.provider ? t.provider.localeCompare(l.provider) : t.prefix !== l.prefix ? t.prefix.localeCompare(l.prefix) : t.name.localeCompare(l.name));
516
+ let n = {
517
+ provider: "",
518
+ prefix: "",
519
+ name: ""
520
+ };
521
+ return e.forEach((t) => {
522
+ if (n.name === t.name && n.prefix === t.prefix && n.provider === t.provider)
523
+ return;
524
+ n = t;
525
+ const l = t.provider, s = t.prefix, g = t.name, h = a[l] || (a[l] = /* @__PURE__ */ Object.create(null)), c = h[s] || (h[s] = q(l, s));
526
+ let i;
527
+ g in c.icons ? i = o.loaded : s === "" || c.missing.has(g) ? i = o.missing : i = o.pending;
528
+ const p = {
529
+ provider: l,
530
+ prefix: s,
531
+ name: g
532
+ };
533
+ i.push(p);
534
+ }), o;
535
+ }
536
+ function Ke(e, o) {
537
+ e.forEach((a) => {
538
+ const n = a.loaderCallbacks;
539
+ n && (a.loaderCallbacks = n.filter((t) => t.id !== o));
540
+ });
541
+ }
542
+ function $n(e) {
543
+ e.pendingCallbacksFlag || (e.pendingCallbacksFlag = !0, setTimeout(() => {
544
+ e.pendingCallbacksFlag = !1;
545
+ const o = e.loaderCallbacks ? e.loaderCallbacks.slice(0) : [];
546
+ if (!o.length)
547
+ return;
548
+ let a = !1;
549
+ const n = e.provider, t = e.prefix;
550
+ o.forEach((l) => {
551
+ const s = l.icons, g = s.pending.length;
552
+ s.pending = s.pending.filter((h) => {
553
+ if (h.prefix !== t)
554
+ return !0;
555
+ const c = h.name;
556
+ if (e.icons[c])
557
+ s.loaded.push({
558
+ provider: n,
559
+ prefix: t,
560
+ name: c
561
+ });
562
+ else if (e.missing.has(c))
563
+ s.missing.push({
564
+ provider: n,
565
+ prefix: t,
566
+ name: c
567
+ });
568
+ else
569
+ return a = !0, !0;
570
+ return !1;
571
+ }), s.pending.length !== g && (a || Ke([e], l.id), l.callback(
572
+ s.loaded.slice(0),
573
+ s.missing.slice(0),
574
+ s.pending.slice(0),
575
+ l.abort
576
+ ));
577
+ });
578
+ }));
579
+ }
580
+ let Tn = 0;
581
+ function Bn(e, o, a) {
582
+ const n = Tn++, t = Ke.bind(null, a, n);
583
+ if (!o.pending.length)
584
+ return t;
585
+ const l = {
586
+ id: n,
587
+ icons: o,
588
+ callback: e,
589
+ abort: t
590
+ };
591
+ return a.forEach((s) => {
592
+ (s.loaderCallbacks || (s.loaderCallbacks = [])).push(l);
593
+ }), t;
594
+ }
595
+ function Xn(e, o = !0, a = !1) {
596
+ const n = [];
597
+ return e.forEach((t) => {
598
+ const l = typeof t == "string" ? ce(t, o, a) : t;
599
+ l && n.push(l);
600
+ }), n;
601
+ }
602
+ var Ln = {
603
+ resources: [],
604
+ index: 0,
605
+ timeout: 2e3,
606
+ rotate: 750,
607
+ random: !1,
608
+ dataAfterTimeout: !1
609
+ };
610
+ function Vn(e, o, a, n) {
611
+ const t = e.resources.length, l = e.random ? Math.floor(Math.random() * t) : e.index;
612
+ let s;
613
+ if (e.random) {
614
+ let k = e.resources.slice(0);
615
+ for (s = []; k.length > 1; ) {
616
+ const L = Math.floor(Math.random() * k.length);
617
+ s.push(k[L]), k = k.slice(0, L).concat(k.slice(L + 1));
618
+ }
619
+ s = s.concat(k);
620
+ } else
621
+ s = e.resources.slice(l).concat(e.resources.slice(0, l));
622
+ const g = Date.now();
623
+ let h = "pending", c = 0, i, p = null, b = [], d = [];
624
+ typeof n == "function" && d.push(n);
625
+ function j() {
626
+ p && (clearTimeout(p), p = null);
627
+ }
628
+ function r() {
629
+ h === "pending" && (h = "aborted"), j(), b.forEach((k) => {
630
+ k.status === "pending" && (k.status = "aborted");
631
+ }), b = [];
632
+ }
633
+ function f(k, L) {
634
+ L && (d = []), typeof k == "function" && d.push(k);
635
+ }
636
+ function S() {
637
+ return {
638
+ startTime: g,
639
+ payload: o,
640
+ status: h,
641
+ queriesSent: c,
642
+ queriesPending: b.length,
643
+ subscribe: f,
644
+ abort: r
645
+ };
646
+ }
647
+ function P() {
648
+ h = "failed", d.forEach((k) => {
649
+ k(void 0, i);
650
+ });
651
+ }
652
+ function C() {
653
+ b.forEach((k) => {
654
+ k.status === "pending" && (k.status = "aborted");
655
+ }), b = [];
656
+ }
657
+ function w(k, L, m) {
658
+ const E = L !== "success";
659
+ switch (b = b.filter((x) => x !== k), h) {
660
+ case "pending":
661
+ break;
662
+ case "failed":
663
+ if (E || !e.dataAfterTimeout)
664
+ return;
665
+ break;
666
+ default:
667
+ return;
668
+ }
669
+ if (L === "abort") {
670
+ i = m, P();
671
+ return;
672
+ }
673
+ if (E) {
674
+ i = m, b.length || (s.length ? I() : P());
675
+ return;
676
+ }
677
+ if (j(), C(), !e.random) {
678
+ const x = e.resources.indexOf(k.resource);
679
+ x !== -1 && x !== e.index && (e.index = x);
680
+ }
681
+ h = "completed", d.forEach((x) => {
682
+ x(m);
683
+ });
684
+ }
685
+ function I() {
686
+ if (h !== "pending")
687
+ return;
688
+ j();
689
+ const k = s.shift();
690
+ if (k === void 0) {
691
+ if (b.length) {
692
+ p = setTimeout(() => {
693
+ j(), h === "pending" && (C(), P());
694
+ }, e.timeout);
695
+ return;
696
+ }
697
+ P();
698
+ return;
699
+ }
700
+ const L = {
701
+ status: "pending",
702
+ resource: k,
703
+ callback: (m, E) => {
704
+ w(L, m, E);
705
+ }
706
+ };
707
+ b.push(L), c++, p = setTimeout(I, e.rotate), a(k, o, L.callback);
708
+ }
709
+ return setTimeout(I), S;
710
+ }
711
+ function He(e) {
712
+ const o = {
713
+ ...Ln,
714
+ ...e
715
+ };
716
+ let a = [];
717
+ function n() {
718
+ a = a.filter((g) => g().status === "pending");
719
+ }
720
+ function t(g, h, c) {
721
+ const i = Vn(
722
+ o,
723
+ g,
724
+ h,
725
+ (p, b) => {
726
+ n(), c && c(p, b);
727
+ }
728
+ );
729
+ return a.push(i), i;
730
+ }
731
+ function l(g) {
732
+ return a.find((h) => g(h)) || null;
733
+ }
734
+ return {
735
+ query: t,
736
+ find: l,
737
+ setIndex: (g) => {
738
+ o.index = g;
739
+ },
740
+ getIndex: () => o.index,
741
+ cleanup: n
742
+ };
743
+ }
744
+ function ke() {
745
+ }
746
+ const fe = /* @__PURE__ */ Object.create(null);
747
+ function zn(e) {
748
+ if (!fe[e]) {
749
+ const o = ye(e);
750
+ if (!o)
751
+ return;
752
+ const a = He(o), n = {
753
+ config: o,
754
+ redundancy: a
755
+ };
756
+ fe[e] = n;
757
+ }
758
+ return fe[e];
759
+ }
760
+ function Fn(e, o, a) {
761
+ let n, t;
762
+ if (typeof e == "string") {
763
+ const l = ue(e);
764
+ if (!l)
765
+ return a(void 0, 424), ke;
766
+ t = l.send;
767
+ const s = zn(e);
768
+ s && (n = s.redundancy);
769
+ } else {
770
+ const l = be(e);
771
+ if (l) {
772
+ n = He(l);
773
+ const s = e.resources ? e.resources[0] : "", g = ue(s);
774
+ g && (t = g.send);
775
+ }
776
+ }
777
+ return !n || !t ? (a(void 0, 424), ke) : n.query(o, t, a)().abort;
778
+ }
779
+ function Me() {
780
+ }
781
+ function On(e) {
782
+ e.iconsLoaderFlag || (e.iconsLoaderFlag = !0, setTimeout(() => {
783
+ e.iconsLoaderFlag = !1, $n(e);
784
+ }));
785
+ }
786
+ function Rn(e) {
787
+ const o = [], a = [];
788
+ return e.forEach((n) => {
789
+ (n.match(Fe) ? o : a).push(n);
790
+ }), {
791
+ valid: o,
792
+ invalid: a
793
+ };
794
+ }
795
+ function Y(e, o, a) {
796
+ function n() {
797
+ const t = e.pendingIcons;
798
+ o.forEach((l) => {
799
+ t && t.delete(l), e.icons[l] || e.missing.add(l);
800
+ });
801
+ }
802
+ if (a && typeof a == "object")
803
+ try {
804
+ if (!_e(e, a).length) {
805
+ n();
806
+ return;
807
+ }
808
+ } catch (t) {
809
+ console.error(t);
810
+ }
811
+ n(), On(e);
812
+ }
813
+ function Ae(e, o) {
814
+ e instanceof Promise ? e.then((a) => {
815
+ o(a);
816
+ }).catch(() => {
817
+ o(null);
818
+ }) : o(e);
819
+ }
820
+ function Dn(e, o) {
821
+ e.iconsToLoad ? e.iconsToLoad = e.iconsToLoad.concat(o).sort() : e.iconsToLoad = o, e.iconsQueueFlag || (e.iconsQueueFlag = !0, setTimeout(() => {
822
+ e.iconsQueueFlag = !1;
823
+ const { provider: a, prefix: n } = e, t = e.iconsToLoad;
824
+ if (delete e.iconsToLoad, !t || !t.length)
825
+ return;
826
+ const l = e.loadIcon;
827
+ if (e.loadIcons && (t.length > 1 || !l)) {
828
+ Ae(
829
+ e.loadIcons(t, n, a),
830
+ (i) => {
831
+ Y(e, t, i);
832
+ }
833
+ );
834
+ return;
835
+ }
836
+ if (l) {
837
+ t.forEach((i) => {
838
+ const p = l(i, n, a);
839
+ Ae(p, (b) => {
840
+ const d = b ? {
841
+ prefix: n,
842
+ icons: {
843
+ [i]: b
844
+ }
845
+ } : null;
846
+ Y(e, [i], d);
847
+ });
848
+ });
849
+ return;
850
+ }
851
+ const { valid: s, invalid: g } = Rn(t);
852
+ if (g.length && Y(e, g, null), !s.length)
853
+ return;
854
+ const h = n.match(Fe) ? ue(a) : null;
855
+ if (!h) {
856
+ Y(e, s, null);
857
+ return;
858
+ }
859
+ h.prepare(a, n, s).forEach((i) => {
860
+ Fn(a, i, (p) => {
861
+ Y(e, i.icons, p);
862
+ });
863
+ });
864
+ }));
865
+ }
866
+ const _n = (e, o) => {
867
+ const a = Xn(e, !0, Ne()), n = In(a);
868
+ if (!n.pending.length) {
869
+ let h = !0;
870
+ return o && setTimeout(() => {
871
+ h && o(
872
+ n.loaded,
873
+ n.missing,
874
+ n.pending,
875
+ Me
876
+ );
877
+ }), () => {
878
+ h = !1;
879
+ };
880
+ }
881
+ const t = /* @__PURE__ */ Object.create(null), l = [];
882
+ let s, g;
883
+ return n.pending.forEach((h) => {
884
+ const { provider: c, prefix: i } = h;
885
+ if (i === g && c === s)
886
+ return;
887
+ s = c, g = i, l.push(q(c, i));
888
+ const p = t[c] || (t[c] = /* @__PURE__ */ Object.create(null));
889
+ p[i] || (p[i] = []);
890
+ }), n.pending.forEach((h) => {
891
+ const { provider: c, prefix: i, name: p } = h, b = q(c, i), d = b.pendingIcons || (b.pendingIcons = /* @__PURE__ */ new Set());
892
+ d.has(p) || (d.add(p), t[c][i].push(p));
893
+ }), l.forEach((h) => {
894
+ const c = t[h.provider][h.prefix];
895
+ c.length && Dn(h, c);
896
+ }), o ? Bn(o, n, l) : Me;
897
+ };
898
+ function Nn(e, o) {
899
+ const a = {
900
+ ...e
901
+ };
902
+ for (const n in o) {
903
+ const t = o[n], l = typeof t;
904
+ n in Ge ? (t === null || t && (l === "string" || l === "number")) && (a[n] = t) : l === typeof a[n] && (a[n] = n === "rotate" ? t % 4 : t);
905
+ }
906
+ return a;
907
+ }
908
+ const Gn = /[\s,]+/;
909
+ function Wn(e, o) {
910
+ o.split(Gn).forEach((a) => {
911
+ switch (a.trim()) {
912
+ case "horizontal":
913
+ e.hFlip = !0;
914
+ break;
915
+ case "vertical":
916
+ e.vFlip = !0;
917
+ break;
918
+ }
919
+ });
920
+ }
921
+ function Kn(e, o = 0) {
922
+ const a = e.replace(/^-?[0-9.]*/, "");
923
+ function n(t) {
924
+ for (; t < 0; )
925
+ t += 4;
926
+ return t % 4;
927
+ }
928
+ if (a === "") {
929
+ const t = parseInt(e);
930
+ return isNaN(t) ? 0 : n(t);
931
+ } else if (a !== e) {
932
+ let t = 0;
933
+ switch (a) {
934
+ case "%":
935
+ t = 25;
936
+ break;
937
+ case "deg":
938
+ t = 90;
939
+ }
940
+ if (t) {
941
+ let l = parseFloat(e.slice(0, e.length - a.length));
942
+ return isNaN(l) ? 0 : (l = l / t, l % 1 === 0 ? n(l) : 0);
943
+ }
944
+ }
945
+ return o;
946
+ }
947
+ function Hn(e, o) {
948
+ let a = e.indexOf("xlink:") === -1 ? "" : ' xmlns:xlink="http://www.w3.org/1999/xlink"';
949
+ for (const n in o)
950
+ a += " " + n + '="' + o[n] + '"';
951
+ return '<svg xmlns="http://www.w3.org/2000/svg"' + a + ">" + e + "</svg>";
952
+ }
953
+ function qn(e) {
954
+ return e.replace(/"/g, "'").replace(/%/g, "%25").replace(/#/g, "%23").replace(/</g, "%3C").replace(/>/g, "%3E").replace(/\s+/g, " ");
955
+ }
956
+ function Un(e) {
957
+ return "data:image/svg+xml," + qn(e);
958
+ }
959
+ function Yn(e) {
960
+ return 'url("' + Un(e) + '")';
961
+ }
962
+ const Ie = {
963
+ ...We,
964
+ inline: !1
965
+ }, Qn = {
966
+ xmlns: "http://www.w3.org/2000/svg",
967
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
968
+ "aria-hidden": !0,
969
+ role: "img"
970
+ }, Zn = {
971
+ display: "inline-block"
972
+ }, ve = {
973
+ backgroundColor: "currentColor"
974
+ }, qe = {
975
+ backgroundColor: "transparent"
976
+ }, $e = {
977
+ Image: "var(--svg)",
978
+ Repeat: "no-repeat",
979
+ Size: "100% 100%"
980
+ }, Te = {
981
+ webkitMask: ve,
982
+ mask: ve,
983
+ background: qe
984
+ };
985
+ for (const e in Te) {
986
+ const o = Te[e];
987
+ for (const a in $e)
988
+ o[e + a] = $e[a];
989
+ }
990
+ const ae = {};
991
+ ["horizontal", "vertical"].forEach((e) => {
992
+ const o = e.slice(0, 1) + "Flip";
993
+ ae[e + "-flip"] = o, ae[e.slice(0, 1) + "-flip"] = o, ae[e + "Flip"] = o;
994
+ });
995
+ function Be(e) {
996
+ return e + (e.match(/^[-0-9.]+$/) ? "px" : "");
997
+ }
998
+ const Xe = (e, o) => {
999
+ const a = Nn(Ie, o), n = { ...Qn }, t = o.mode || "svg", l = {}, s = o.style, g = typeof s == "object" && !(s instanceof Array) ? s : {};
1000
+ for (let r in o) {
1001
+ const f = o[r];
1002
+ if (f !== void 0)
1003
+ switch (r) {
1004
+ case "icon":
1005
+ case "style":
1006
+ case "onLoad":
1007
+ case "mode":
1008
+ case "ssr":
1009
+ break;
1010
+ case "inline":
1011
+ case "hFlip":
1012
+ case "vFlip":
1013
+ a[r] = f === !0 || f === "true" || f === 1;
1014
+ break;
1015
+ case "flip":
1016
+ typeof f == "string" && Wn(a, f);
1017
+ break;
1018
+ case "color":
1019
+ l.color = f;
1020
+ break;
1021
+ case "rotate":
1022
+ typeof f == "string" ? a[r] = Kn(f) : typeof f == "number" && (a[r] = f);
1023
+ break;
1024
+ case "ariaHidden":
1025
+ case "aria-hidden":
1026
+ f !== !0 && f !== "true" && delete n["aria-hidden"];
1027
+ break;
1028
+ default: {
1029
+ const S = ae[r];
1030
+ S ? (f === !0 || f === "true" || f === 1) && (a[S] = !0) : Ie[r] === void 0 && (n[r] = f);
1031
+ }
1032
+ }
1033
+ }
1034
+ const h = un(e, a), c = h.attributes;
1035
+ if (a.inline && (l.verticalAlign = "-0.125em"), t === "svg") {
1036
+ n.style = {
1037
+ ...l,
1038
+ ...g
1039
+ }, Object.assign(n, c);
1040
+ let r = 0, f = o.id;
1041
+ return typeof f == "string" && (f = f.replace(/-/g, "_")), n.innerHTML = yn(h.body, f ? () => f + "ID" + r++ : "iconifyVue"), Ce("svg", n);
1042
+ }
1043
+ const { body: i, width: p, height: b } = e, d = t === "mask" || (t === "bg" ? !1 : i.indexOf("currentColor") !== -1), j = Hn(i, {
1044
+ ...c,
1045
+ width: p + "",
1046
+ height: b + ""
1047
+ });
1048
+ return n.style = {
1049
+ ...l,
1050
+ "--svg": Yn(j),
1051
+ width: Be(c.width),
1052
+ height: Be(c.height),
1053
+ ...Zn,
1054
+ ...d ? ve : qe,
1055
+ ...g
1056
+ }, Ce("span", n);
1057
+ };
1058
+ Ne(!0);
1059
+ Cn("", An);
1060
+ if (typeof document < "u" && typeof window < "u") {
1061
+ const e = window;
1062
+ if (e.IconifyPreload !== void 0) {
1063
+ const o = e.IconifyPreload, a = "Invalid IconifyPreload syntax.";
1064
+ typeof o == "object" && o !== null && (o instanceof Array ? o : [o]).forEach((n) => {
1065
+ try {
1066
+ // Check if item is an object and not null/array
1067
+ (typeof n != "object" || n === null || n instanceof Array || // Check for 'icons' and 'prefix'
1068
+ typeof n.icons != "object" || typeof n.prefix != "string" || // Add icon set
1069
+ !gn(n)) && console.error(a);
1070
+ } catch {
1071
+ console.error(a);
1072
+ }
1073
+ });
1074
+ }
1075
+ if (e.IconifyProviders !== void 0) {
1076
+ const o = e.IconifyProviders;
1077
+ if (typeof o == "object" && o !== null)
1078
+ for (let a in o) {
1079
+ const n = "IconifyProviders[" + a + "] is invalid.";
1080
+ try {
1081
+ const t = o[a];
1082
+ if (typeof t != "object" || !t || t.resources === void 0)
1083
+ continue;
1084
+ Sn(a, t) || console.error(n);
1085
+ } catch {
1086
+ console.error(n);
1087
+ }
1088
+ }
1089
+ }
1090
+ }
1091
+ const Jn = {
1092
+ ...ge,
1093
+ body: ""
1094
+ }, K = V({
1095
+ // Do not inherit other attributes: it is handled by render()
1096
+ inheritAttrs: !1,
1097
+ // Set initial data
1098
+ data() {
1099
+ return {
1100
+ // Current icon name
1101
+ _name: "",
1102
+ // Loading
1103
+ _loadingIcon: null,
1104
+ // Mounted status
1105
+ iconMounted: !1,
1106
+ // Callback counter to trigger re-render
1107
+ counter: 0
1108
+ };
1109
+ },
1110
+ mounted() {
1111
+ this.iconMounted = !0;
1112
+ },
1113
+ unmounted() {
1114
+ this.abortLoading();
1115
+ },
1116
+ methods: {
1117
+ abortLoading() {
1118
+ this._loadingIcon && (this._loadingIcon.abort(), this._loadingIcon = null);
1119
+ },
1120
+ // Get data for icon to render or null
1121
+ getIcon(e, o, a) {
1122
+ if (typeof e == "object" && e !== null && typeof e.body == "string")
1123
+ return this._name = "", this.abortLoading(), {
1124
+ data: e
1125
+ };
1126
+ let n;
1127
+ if (typeof e != "string" || (n = ce(e, !1, !0)) === null)
1128
+ return this.abortLoading(), null;
1129
+ let t = sn(n);
1130
+ if (!t)
1131
+ return (!this._loadingIcon || this._loadingIcon.name !== e) && (this.abortLoading(), this._name = "", t !== null && (this._loadingIcon = {
1132
+ name: e,
1133
+ abort: _n([n], () => {
1134
+ this.counter++;
1135
+ })
1136
+ })), null;
1137
+ if (this.abortLoading(), this._name !== e && (this._name = e, o && o(e)), a) {
1138
+ t = Object.assign({}, t);
1139
+ const s = a(t.body, n.name, n.prefix, n.provider);
1140
+ typeof s == "string" && (t.body = s);
1141
+ }
1142
+ const l = ["iconify"];
1143
+ return n.prefix !== "" && l.push("iconify--" + n.prefix), n.provider !== "" && l.push("iconify--" + n.provider), { data: t, classes: l };
1144
+ }
1145
+ },
1146
+ // Render icon
1147
+ render() {
1148
+ this.counter;
1149
+ const e = this.$attrs, o = this.iconMounted || e.ssr ? this.getIcon(e.icon, e.onLoad, e.customise) : null;
1150
+ if (!o)
1151
+ return Xe(Jn, e);
1152
+ let a = e;
1153
+ return o.classes && (a = {
1154
+ ...e,
1155
+ class: (typeof e.class == "string" ? e.class + " " : "") + o.classes.join(" ")
1156
+ }), Xe({
1157
+ ...ge,
1158
+ ...o.data
1159
+ }, a);
1160
+ }
1161
+ }), et = ["disabled"], nt = {
1162
+ key: 0,
1163
+ class: "x-btn-icon"
1164
+ }, tt = {
1165
+ key: 1,
1166
+ class: "x-btn-loading"
1167
+ }, ot = { class: "x-btn-content" }, at = {
1168
+ key: 2,
1169
+ class: "x-btn-icon"
1170
+ }, lt = /* @__PURE__ */ V({
1171
+ __name: "index",
1172
+ props: {
1173
+ type: { default: "default" },
1174
+ size: { default: "medium" },
1175
+ icon: {},
1176
+ iconRight: {},
1177
+ disabled: { type: Boolean, default: !1 },
1178
+ loading: { type: Boolean, default: !1 },
1179
+ block: { type: Boolean, default: !1 },
1180
+ round: { type: Boolean, default: !1 },
1181
+ plain: { type: Boolean, default: !1 }
1182
+ },
1183
+ emits: ["click"],
1184
+ setup(e, { emit: o }) {
1185
+ const a = e, n = o, t = $(), l = $([]);
1186
+ let s = 0;
1187
+ const g = X(() => [
1188
+ "x-btn",
1189
+ `x-btn-${a.type}`,
1190
+ `x-btn-${a.size}`,
1191
+ {
1192
+ "x-btn-disabled": a.disabled,
1193
+ "x-btn-loading": a.loading,
1194
+ "x-btn-block": a.block,
1195
+ "x-btn-round": a.round,
1196
+ "x-btn-plain": a.plain
1197
+ }
1198
+ ]);
1199
+ function h(i) {
1200
+ !a.disabled && !a.loading && n("click", i);
1201
+ }
1202
+ function c(i) {
1203
+ if (a.disabled || a.loading) return;
1204
+ const p = t.value;
1205
+ if (!p) return;
1206
+ const b = p.getBoundingClientRect(), d = {
1207
+ id: s++,
1208
+ style: {
1209
+ left: `${i.clientX - b.left}px`,
1210
+ top: `${i.clientY - b.top}px`
1211
+ }
1212
+ };
1213
+ l.value.push(d), setTimeout(() => {
1214
+ const j = l.value.findIndex((r) => r.id === d.id);
1215
+ j > -1 && l.value.splice(j, 1);
1216
+ }, 600);
1217
+ }
1218
+ return (i, p) => (u(), v("button", {
1219
+ class: B(g.value),
1220
+ disabled: e.disabled || e.loading,
1221
+ onClick: h,
1222
+ onMousedown: c,
1223
+ ref_key: "buttonRef",
1224
+ ref: t
1225
+ }, [
1226
+ (u(!0), v(z, null, D(l.value, (b) => (u(), v("span", {
1227
+ key: b.id,
1228
+ class: "x-btn-ripple",
1229
+ style: G(b.style)
1230
+ }, null, 4))), 128)),
1231
+ e.icon && !e.loading ? (u(), v("span", nt, [
1232
+ R(W(K), { icon: e.icon }, null, 8, ["icon"])
1233
+ ])) : A("", !0),
1234
+ e.loading ? (u(), v("span", tt, [
1235
+ R(W(K), { icon: "eos-icons:loading" })
1236
+ ])) : A("", !0),
1237
+ y("span", ot, [
1238
+ Q(i.$slots, "default", {}, void 0, !0)
1239
+ ]),
1240
+ e.iconRight && !e.loading ? (u(), v("span", at, [
1241
+ R(W(K), { icon: e.iconRight }, null, 8, ["icon"])
1242
+ ])) : A("", !0)
1243
+ ], 42, et));
1244
+ }
1245
+ }), F = (e, o) => {
1246
+ const a = e.__vccOpts || e;
1247
+ for (const [n, t] of o)
1248
+ a[n] = t;
1249
+ return a;
1250
+ }, Le = /* @__PURE__ */ F(lt, [["__scopeId", "data-v-e1b43d39"]]), st = { class: "x-card-container" }, ct = ["onClick"], gt = { class: "relative p-2" }, it = ["src", "alt"], dt = {
1251
+ key: 0,
1252
+ class: "absolute top-3 left-3"
1253
+ }, ft = { class: "label-badge" }, rt = { class: "product-info p-5 ml-5" }, pt = { class: "text-sm lg:text-base text-gray-700 leading-relaxed line-clamp-2 mb-3" }, ht = { class: "flex items-center justify-between gap-2" }, mt = { class: "text-base lg:text-lg font-bold text-[var(--x-color-primary)]" }, ut = {
1254
+ key: 0,
1255
+ class: "bi bi-heart text-gray-500"
1256
+ }, vt = {
1257
+ key: 1,
1258
+ class: "bi bi-heart-fill text-[#FE374F]"
1259
+ }, bt = ["onClick"], wt = { class: "relative flex-shrink-0 p-2" }, yt = { class: "aspect-square bg-gray-100 rounded-lg overflow-hidden" }, Ct = ["src", "alt"], St = {
1260
+ key: 0,
1261
+ class: "absolute top-3 left-3"
1262
+ }, xt = { class: "label-badge" }, Et = { class: "flex-1 flex flex-col justify-between product-info p-5 ml-5" }, Pt = { class: "text-sm lg:text-base text-gray-700 font-medium line-clamp-2 leading-relaxed mb-3" }, jt = { class: "flex items-center justify-between gap-2 mt-auto" }, kt = { class: "text-base lg:text-lg font-bold text-[var(--x-color-primary)]" }, Mt = /* @__PURE__ */ V({
1263
+ __name: "index",
1264
+ props: {
1265
+ layout: { default: "grid" },
1266
+ products: { default: () => [] },
1267
+ useMockData: { type: Boolean, default: !0 },
1268
+ columns: { default: 4 }
1269
+ },
1270
+ emits: ["productClick", "like"],
1271
+ setup(e, { emit: o }) {
1272
+ const a = e, n = o, t = [
1273
+ {
1274
+ id: "1",
1275
+ name: "北欧风简约陶瓷花瓶",
1276
+ image: "https://images.unsplash.com/photo-1578500494198-246f612d3b3d?w=400",
1277
+ price: "¥299",
1278
+ label: "热卖",
1279
+ isWish: !1
1280
+ },
1281
+ {
1282
+ id: "2",
1283
+ name: "手工编织棉麻抱枕套",
1284
+ image: "https://images.unsplash.com/photo-1584100936595-c0654b55a2e2?w=400",
1285
+ price: "¥89",
1286
+ label: "新品",
1287
+ isWish: !0
1288
+ },
1289
+ {
1290
+ id: "3",
1291
+ name: "实木原木置物架收纳架",
1292
+ image: "https://images.unsplash.com/photo-1595428774223-ef52624120d2?w=400",
1293
+ price: "¥459",
1294
+ label: "",
1295
+ isWish: !1
1296
+ },
1297
+ {
1298
+ id: "4",
1299
+ name: "ins风格桌面装饰摆件",
1300
+ image: "https://images.unsplash.com/photo-1513506003901-1e6a229e2d15?w=400",
1301
+ price: "¥129",
1302
+ label: "特价",
1303
+ isWish: !1
1304
+ },
1305
+ {
1306
+ id: "5",
1307
+ name: "现代简约台灯护眼学习灯",
1308
+ image: "https://images.unsplash.com/photo-1507473885765-e6ed057f782c?w=400",
1309
+ price: "¥399",
1310
+ label: "",
1311
+ isWish: !0
1312
+ },
1313
+ {
1314
+ id: "6",
1315
+ name: "北欧风格装饰画挂画",
1316
+ image: "https://images.unsplash.com/photo-1561214115-f2f134cc4912?w=400",
1317
+ price: "¥199",
1318
+ label: "热卖",
1319
+ isWish: !1
1320
+ },
1321
+ {
1322
+ id: "7",
1323
+ name: "多功能收纳盒桌面整理",
1324
+ image: "https://images.unsplash.com/photo-1586023492125-27b2c045efd7?w=400",
1325
+ price: "¥68",
1326
+ label: "",
1327
+ isWish: !1
1328
+ },
1329
+ {
1330
+ id: "8",
1331
+ name: "创意陶瓷马克杯咖啡杯",
1332
+ image: "https://images.unsplash.com/photo-1514228742587-6b1558fcca3d?w=400",
1333
+ price: "¥59",
1334
+ label: "新品",
1335
+ isWish: !1
1336
+ },
1337
+ {
1338
+ id: "9",
1339
+ name: "手工玻璃花瓶透明花器",
1340
+ image: "https://images.unsplash.com/photo-1523293182086-7651a899d37f?w=400",
1341
+ price: "¥179",
1342
+ label: "",
1343
+ isWish: !0
1344
+ },
1345
+ {
1346
+ id: "10",
1347
+ name: "日式和风招财猫摆件",
1348
+ image: "https://images.unsplash.com/photo-1615529182904-14819c35db37?w=400",
1349
+ price: "¥149",
1350
+ label: "热卖",
1351
+ isWish: !1
1352
+ },
1353
+ {
1354
+ id: "11",
1355
+ name: "北欧风木质挂钟客厅",
1356
+ image: "https://images.unsplash.com/photo-1563861826100-9cb868fdbe1c?w=400",
1357
+ price: "¥259",
1358
+ label: "",
1359
+ isWish: !1
1360
+ },
1361
+ {
1362
+ id: "12",
1363
+ name: "现代简约落地花架",
1364
+ image: "https://images.unsplash.com/photo-1545127398-14699f92334b?w=400",
1365
+ price: "¥329",
1366
+ label: "特价",
1367
+ isWish: !1
1368
+ }
1369
+ ], l = $([]), s = X(() => a.products && a.products.length > 0 ? a.products : l.value), g = X(() => {
1370
+ const p = Math.min(Math.max(a.columns || 4, 1), 4), b = {
1371
+ 1: "grid-cols-1",
1372
+ 2: "grid-cols-1 md:grid-cols-2",
1373
+ 3: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3",
1374
+ 4: "grid-cols-2 md:grid-cols-3 lg:grid-cols-4"
1375
+ };
1376
+ return b[p] || b[4];
1377
+ }), h = X(() => {
1378
+ const p = Math.min(Math.max(a.columns || 4, 1), 4), b = {
1379
+ 1: "columns-1",
1380
+ 2: "columns-1 md:columns-2",
1381
+ 3: "columns-2 md:columns-2 lg:columns-3",
1382
+ 4: "columns-2 sm:columns-2 md:columns-3 lg:columns-4"
1383
+ };
1384
+ return b[p] || b[4];
1385
+ });
1386
+ se(() => {
1387
+ a.useMockData && (!a.products || a.products.length === 0) && (l.value = t);
1388
+ });
1389
+ const c = (p) => {
1390
+ n("productClick", p);
1391
+ }, i = (p) => {
1392
+ p.isWish = !p.isWish, n("like", p);
1393
+ };
1394
+ return (p, b) => (u(), v("div", st, [
1395
+ e.layout === "masonry" ? (u(), v("div", {
1396
+ key: 0,
1397
+ class: B(["masonry-layout", h.value, "gap-4 sm:gap-6"])
1398
+ }, [
1399
+ (u(!0), v(z, null, D(s.value, (d) => (u(), v("div", {
1400
+ key: d.id + "-masonry",
1401
+ class: "mb-4 sm:mb-6 break-inside-avoid group cursor-pointer product-card",
1402
+ onClick: (j) => c(d.id)
1403
+ }, [
1404
+ y("div", gt, [
1405
+ y("img", {
1406
+ src: d.image,
1407
+ alt: d.name,
1408
+ loading: "lazy",
1409
+ class: "w-full h-auto rounded-lg bg-gray-100 object-cover transition-transform duration-300 group-hover:scale-[1.01]"
1410
+ }, null, 8, it),
1411
+ d.label ? (u(), v("div", dt, [
1412
+ y("span", ft, T(d.label), 1)
1413
+ ])) : A("", !0)
1414
+ ]),
1415
+ y("div", rt, [
1416
+ y("h3", pt, T(d.name), 1),
1417
+ y("div", ht, [
1418
+ y("span", mt, T(d.price), 1),
1419
+ R(Le, {
1420
+ onClick: H((j) => i(d), ["stop"]),
1421
+ type: "text",
1422
+ size: "small",
1423
+ class: "like-button !min-w-0 !p-1"
1424
+ }, {
1425
+ default: Z(() => [
1426
+ d.isWish ? (u(), v("i", vt)) : (u(), v("i", ut))
1427
+ ]),
1428
+ _: 2
1429
+ }, 1032, ["onClick"])
1430
+ ])
1431
+ ])
1432
+ ], 8, ct))), 128))
1433
+ ], 2)) : (u(), v("div", {
1434
+ key: 1,
1435
+ class: B(["grid", g.value, "gap-4 lg:gap-6"])
1436
+ }, [
1437
+ (u(!0), v(z, null, D(s.value, (d) => (u(), v("div", {
1438
+ key: d.id + "-grid",
1439
+ class: "h-full"
1440
+ }, [
1441
+ y("div", {
1442
+ class: "group cursor-pointer product-card h-full flex flex-col",
1443
+ onClick: (j) => c(d.id)
1444
+ }, [
1445
+ y("div", wt, [
1446
+ y("div", yt, [
1447
+ y("img", {
1448
+ src: d.image,
1449
+ alt: d.name,
1450
+ class: "w-full h-full object-cover group-hover:scale-105 transition-transform duration-300",
1451
+ loading: "lazy"
1452
+ }, null, 8, Ct)
1453
+ ]),
1454
+ d.label ? (u(), v("div", St, [
1455
+ y("span", xt, T(d.label), 1)
1456
+ ])) : A("", !0)
1457
+ ]),
1458
+ y("div", Et, [
1459
+ y("h3", Pt, T(d.name), 1),
1460
+ y("div", jt, [
1461
+ y("span", kt, T(d.price), 1),
1462
+ R(Le, {
1463
+ onClick: H((j) => i(d), ["stop"]),
1464
+ type: "text",
1465
+ size: "small",
1466
+ class: "like-button !min-w-0 !p-1"
1467
+ }, {
1468
+ default: Z(() => [
1469
+ d.isWish ? (u(), re(W(K), {
1470
+ key: 1,
1471
+ icon: "bi:heart-fill",
1472
+ class: "bi bi-heart-fill text-[#FE374F]"
1473
+ })) : (u(), re(W(K), {
1474
+ key: 0,
1475
+ icon: "bi:heart",
1476
+ class: "bi bi-heart text-gray-500"
1477
+ }))
1478
+ ]),
1479
+ _: 2
1480
+ }, 1032, ["onClick"])
1481
+ ])
1482
+ ])
1483
+ ], 8, bt)
1484
+ ]))), 128))
1485
+ ], 2))
1486
+ ]));
1487
+ }
1488
+ }), Bo = /* @__PURE__ */ F(Mt, [["__scopeId", "data-v-aec5fd31"]]), At = [
1489
+ {
1490
+ name: "Afghanistan",
1491
+ code: "AF",
1492
+ flagEmoji: "🇦🇫",
1493
+ flagSvg: "https://flagcdn.com/af.svg",
1494
+ flagPng: "https://flagcdn.com/w40/af.png",
1495
+ phoneCode: "+93",
1496
+ phonelengthMAX: 10
1497
+ },
1498
+ {
1499
+ name: "Åland Islands",
1500
+ code: "AX",
1501
+ flagEmoji: "🇦🇽",
1502
+ flagSvg: "https://flagcdn.com/ax.svg",
1503
+ flagPng: "https://flagcdn.com/w40/ax.png",
1504
+ phoneCode: "+358",
1505
+ phonelengthMAX: 10
1506
+ },
1507
+ {
1508
+ name: "Albania",
1509
+ code: "AL",
1510
+ flagEmoji: "🇦🇱",
1511
+ flagSvg: "https://flagcdn.com/al.svg",
1512
+ flagPng: "https://flagcdn.com/w40/al.png",
1513
+ phoneCode: "+355",
1514
+ phonelengthMAX: 10
1515
+ },
1516
+ {
1517
+ name: "Algeria",
1518
+ code: "DZ",
1519
+ flagEmoji: "🇩🇿",
1520
+ flagSvg: "https://flagcdn.com/dz.svg",
1521
+ flagPng: "https://flagcdn.com/w40/dz.png",
1522
+ phoneCode: "+213",
1523
+ phonelengthMAX: 10
1524
+ },
1525
+ {
1526
+ name: "American Samoa",
1527
+ code: "AS",
1528
+ flagEmoji: "🇦🇸",
1529
+ flagSvg: "https://flagcdn.com/as.svg",
1530
+ flagPng: "https://flagcdn.com/w40/as.png",
1531
+ phoneCode: "+1684",
1532
+ phonelengthMAX: 10
1533
+ },
1534
+ {
1535
+ name: "Andorra",
1536
+ code: "AD",
1537
+ flagEmoji: "🇦🇩",
1538
+ flagSvg: "https://flagcdn.com/ad.svg",
1539
+ flagPng: "https://flagcdn.com/w40/ad.png",
1540
+ phoneCode: "+376",
1541
+ phonelengthMAX: 10
1542
+ },
1543
+ {
1544
+ name: "Angola",
1545
+ code: "AO",
1546
+ flagEmoji: "🇦🇴",
1547
+ flagSvg: "https://flagcdn.com/ao.svg",
1548
+ flagPng: "https://flagcdn.com/w40/ao.png",
1549
+ phoneCode: "+244",
1550
+ phonelengthMAX: 10
1551
+ },
1552
+ {
1553
+ name: "Anguilla",
1554
+ code: "AI",
1555
+ flagEmoji: "🇦🇮",
1556
+ flagSvg: "https://flagcdn.com/ai.svg",
1557
+ flagPng: "https://flagcdn.com/w40/ai.png",
1558
+ phoneCode: "+1264",
1559
+ phonelengthMAX: 10
1560
+ },
1561
+ {
1562
+ name: "Antarctica",
1563
+ code: "AQ",
1564
+ flagEmoji: "🇦🇶",
1565
+ flagSvg: "https://flagcdn.com/aq.svg",
1566
+ flagPng: "https://flagcdn.com/w40/aq.png",
1567
+ phoneCode: "+672",
1568
+ phonelengthMAX: 10
1569
+ },
1570
+ {
1571
+ name: "Antigua and Barbuda",
1572
+ code: "AG",
1573
+ flagEmoji: "🇦🇬",
1574
+ flagSvg: "https://flagcdn.com/ag.svg",
1575
+ flagPng: "https://flagcdn.com/w40/ag.png",
1576
+ phoneCode: "+1268",
1577
+ phonelengthMAX: 10
1578
+ },
1579
+ {
1580
+ name: "Argentina",
1581
+ code: "AR",
1582
+ flagEmoji: "🇦🇷",
1583
+ flagSvg: "https://flagcdn.com/ar.svg",
1584
+ flagPng: "https://flagcdn.com/w40/ar.png",
1585
+ phoneCode: "+54",
1586
+ phonelengthMAX: 10
1587
+ },
1588
+ {
1589
+ name: "Armenia",
1590
+ code: "AM",
1591
+ flagEmoji: "🇦🇲",
1592
+ flagSvg: "https://flagcdn.com/am.svg",
1593
+ flagPng: "https://flagcdn.com/w40/am.png",
1594
+ phoneCode: "+374",
1595
+ phonelengthMAX: 10
1596
+ },
1597
+ {
1598
+ name: "Aruba",
1599
+ code: "AW",
1600
+ flagEmoji: "🇦🇼",
1601
+ flagSvg: "https://flagcdn.com/aw.svg",
1602
+ flagPng: "https://flagcdn.com/w40/aw.png",
1603
+ phoneCode: "+297",
1604
+ phonelengthMAX: 10
1605
+ },
1606
+ {
1607
+ name: "Australia",
1608
+ code: "AU",
1609
+ flagEmoji: "🇦🇺",
1610
+ flagSvg: "https://flagcdn.com/au.svg",
1611
+ flagPng: "https://flagcdn.com/w40/au.png",
1612
+ phoneCode: "+61",
1613
+ phonelengthMAX: 10
1614
+ },
1615
+ {
1616
+ name: "Austria",
1617
+ code: "AT",
1618
+ flagEmoji: "🇦🇹",
1619
+ flagSvg: "https://flagcdn.com/at.svg",
1620
+ flagPng: "https://flagcdn.com/w40/at.png",
1621
+ phoneCode: "+43",
1622
+ phonelengthMAX: 10
1623
+ },
1624
+ {
1625
+ name: "Azerbaijan",
1626
+ code: "AZ",
1627
+ flagEmoji: "🇦🇿",
1628
+ flagSvg: "https://flagcdn.com/az.svg",
1629
+ flagPng: "https://flagcdn.com/w40/az.png",
1630
+ phoneCode: "+994",
1631
+ phonelengthMAX: 10
1632
+ },
1633
+ {
1634
+ name: "Bahamas",
1635
+ code: "BS",
1636
+ flagEmoji: "🇧🇸",
1637
+ flagSvg: "https://flagcdn.com/bs.svg",
1638
+ flagPng: "https://flagcdn.com/w40/bs.png",
1639
+ phoneCode: "+1242",
1640
+ phonelengthMAX: 10
1641
+ },
1642
+ {
1643
+ name: "Bahrain",
1644
+ code: "BH",
1645
+ flagEmoji: "🇧🇭",
1646
+ flagSvg: "https://flagcdn.com/bh.svg",
1647
+ flagPng: "https://flagcdn.com/w40/bh.png",
1648
+ phoneCode: "+973",
1649
+ phonelengthMAX: 10
1650
+ },
1651
+ {
1652
+ name: "Bangladesh",
1653
+ code: "BD",
1654
+ flagEmoji: "🇧🇩",
1655
+ flagSvg: "https://flagcdn.com/bd.svg",
1656
+ flagPng: "https://flagcdn.com/w40/bd.png",
1657
+ phoneCode: "+880",
1658
+ phonelengthMAX: 10
1659
+ },
1660
+ {
1661
+ name: "Barbados",
1662
+ code: "BB",
1663
+ flagEmoji: "🇧🇧",
1664
+ flagSvg: "https://flagcdn.com/bb.svg",
1665
+ flagPng: "https://flagcdn.com/w40/bb.png",
1666
+ phoneCode: "+1246",
1667
+ phonelengthMAX: 10
1668
+ },
1669
+ {
1670
+ name: "Belarus",
1671
+ code: "BY",
1672
+ flagEmoji: "🇧🇾",
1673
+ flagSvg: "https://flagcdn.com/by.svg",
1674
+ flagPng: "https://flagcdn.com/w40/by.png",
1675
+ phoneCode: "+375",
1676
+ phonelengthMAX: 10
1677
+ },
1678
+ {
1679
+ name: "Belgium",
1680
+ code: "BE",
1681
+ flagEmoji: "🇧🇪",
1682
+ flagSvg: "https://flagcdn.com/be.svg",
1683
+ flagPng: "https://flagcdn.com/w40/be.png",
1684
+ phoneCode: "+32",
1685
+ phonelengthMAX: 10
1686
+ },
1687
+ {
1688
+ name: "Belize",
1689
+ code: "BZ",
1690
+ flagEmoji: "🇧🇿",
1691
+ flagSvg: "https://flagcdn.com/bz.svg",
1692
+ flagPng: "https://flagcdn.com/w40/bz.png",
1693
+ phoneCode: "+501",
1694
+ phonelengthMAX: 10
1695
+ },
1696
+ {
1697
+ name: "Benin",
1698
+ code: "BJ",
1699
+ flagEmoji: "🇧🇯",
1700
+ flagSvg: "https://flagcdn.com/bj.svg",
1701
+ flagPng: "https://flagcdn.com/w40/bj.png",
1702
+ phoneCode: "+229",
1703
+ phonelengthMAX: 10
1704
+ },
1705
+ {
1706
+ name: "Bermuda",
1707
+ code: "BM",
1708
+ flagEmoji: "🇧🇲",
1709
+ flagSvg: "https://flagcdn.com/bm.svg",
1710
+ flagPng: "https://flagcdn.com/w40/bm.png",
1711
+ phoneCode: "+1441",
1712
+ phonelengthMAX: 10
1713
+ },
1714
+ {
1715
+ name: "Bhutan",
1716
+ code: "BT",
1717
+ flagEmoji: "🇧🇹",
1718
+ flagSvg: "https://flagcdn.com/bt.svg",
1719
+ flagPng: "https://flagcdn.com/w40/bt.png",
1720
+ phoneCode: "+975",
1721
+ phonelengthMAX: 10
1722
+ },
1723
+ {
1724
+ name: "Bolivia (Plurinational State of)",
1725
+ code: "BO",
1726
+ flagEmoji: "🇧🇴",
1727
+ flagSvg: "https://flagcdn.com/bo.svg",
1728
+ flagPng: "https://flagcdn.com/w40/bo.png",
1729
+ phoneCode: "+591",
1730
+ phonelengthMAX: 10
1731
+ },
1732
+ {
1733
+ name: "Bonaire, Sint Eustatius and Saba",
1734
+ code: "BQ",
1735
+ flagEmoji: "🇧🇶",
1736
+ flagSvg: "https://flagcdn.com/bq.svg",
1737
+ flagPng: "https://flagcdn.com/w40/bq.png",
1738
+ phoneCode: "+5997",
1739
+ phonelengthMAX: 10
1740
+ },
1741
+ {
1742
+ name: "Bosnia and Herzegovina",
1743
+ code: "BA",
1744
+ flagEmoji: "🇧🇦",
1745
+ flagSvg: "https://flagcdn.com/ba.svg",
1746
+ flagPng: "https://flagcdn.com/w40/ba.png",
1747
+ phoneCode: "+387",
1748
+ phonelengthMAX: 10
1749
+ },
1750
+ {
1751
+ name: "Botswana",
1752
+ code: "BW",
1753
+ flagEmoji: "🇧🇼",
1754
+ flagSvg: "https://flagcdn.com/bw.svg",
1755
+ flagPng: "https://flagcdn.com/w40/bw.png",
1756
+ phoneCode: "+267",
1757
+ phonelengthMAX: 10
1758
+ },
1759
+ {
1760
+ name: "Bouvet Island",
1761
+ code: "BV",
1762
+ flagEmoji: "🇧🇻",
1763
+ flagSvg: "https://flagcdn.com/bv.svg",
1764
+ flagPng: "https://flagcdn.com/w40/bv.png",
1765
+ phoneCode: "+55",
1766
+ phonelengthMAX: 10
1767
+ },
1768
+ {
1769
+ name: "Brazil",
1770
+ code: "BR",
1771
+ flagEmoji: "🇧🇷",
1772
+ flagSvg: "https://flagcdn.com/br.svg",
1773
+ flagPng: "https://flagcdn.com/w40/br.png",
1774
+ phoneCode: "+55",
1775
+ phonelengthMAX: 10
1776
+ },
1777
+ {
1778
+ name: "British Indian Ocean Territory",
1779
+ code: "IO",
1780
+ flagEmoji: "🇮🇴",
1781
+ flagSvg: "https://flagcdn.com/io.svg",
1782
+ flagPng: "https://flagcdn.com/w40/io.png",
1783
+ phoneCode: "+246",
1784
+ phonelengthMAX: 10
1785
+ },
1786
+ {
1787
+ name: "Brunei Darussalam",
1788
+ code: "BN",
1789
+ flagEmoji: "🇧🇳",
1790
+ flagSvg: "https://flagcdn.com/bn.svg",
1791
+ flagPng: "https://flagcdn.com/w40/bn.png",
1792
+ phoneCode: "+673",
1793
+ phonelengthMAX: 10
1794
+ },
1795
+ {
1796
+ name: "Bulgaria",
1797
+ code: "BG",
1798
+ flagEmoji: "🇧🇬",
1799
+ flagSvg: "https://flagcdn.com/bg.svg",
1800
+ flagPng: "https://flagcdn.com/w40/bg.png",
1801
+ phoneCode: "+359",
1802
+ phonelengthMAX: 10
1803
+ },
1804
+ {
1805
+ name: "Burkina Faso",
1806
+ code: "BF",
1807
+ flagEmoji: "🇧🇫",
1808
+ flagSvg: "https://flagcdn.com/bf.svg",
1809
+ flagPng: "https://flagcdn.com/w40/bf.png",
1810
+ phoneCode: "+226",
1811
+ phonelengthMAX: 10
1812
+ },
1813
+ {
1814
+ name: "Burundi",
1815
+ code: "BI",
1816
+ flagEmoji: "🇧🇮",
1817
+ flagSvg: "https://flagcdn.com/bi.svg",
1818
+ flagPng: "https://flagcdn.com/w40/bi.png",
1819
+ phoneCode: "+257",
1820
+ phonelengthMAX: 10
1821
+ },
1822
+ {
1823
+ name: "Cabo Verde",
1824
+ code: "CV",
1825
+ flagEmoji: "🇨🇻",
1826
+ flagSvg: "https://flagcdn.com/cv.svg",
1827
+ flagPng: "https://flagcdn.com/w40/cv.png",
1828
+ phoneCode: "+238",
1829
+ phonelengthMAX: 10
1830
+ },
1831
+ {
1832
+ name: "Cambodia",
1833
+ code: "KH",
1834
+ flagEmoji: "🇰🇭",
1835
+ flagSvg: "https://flagcdn.com/kh.svg",
1836
+ flagPng: "https://flagcdn.com/w40/kh.png",
1837
+ phoneCode: "+855",
1838
+ phonelengthMAX: 10
1839
+ },
1840
+ {
1841
+ name: "Cameroon",
1842
+ code: "CM",
1843
+ flagEmoji: "🇨🇲",
1844
+ flagSvg: "https://flagcdn.com/cm.svg",
1845
+ flagPng: "https://flagcdn.com/w40/cm.png",
1846
+ phoneCode: "+237",
1847
+ phonelengthMAX: 10
1848
+ },
1849
+ {
1850
+ name: "Canada",
1851
+ code: "CA",
1852
+ flagEmoji: "🇨🇦",
1853
+ flagSvg: "https://flagcdn.com/ca.svg",
1854
+ flagPng: "https://flagcdn.com/w40/ca.png",
1855
+ phoneCode: "+1",
1856
+ phonelengthMAX: 10
1857
+ },
1858
+ {
1859
+ name: "Cayman Islands",
1860
+ code: "KY",
1861
+ flagEmoji: "🇰🇾",
1862
+ flagSvg: "https://flagcdn.com/ky.svg",
1863
+ flagPng: "https://flagcdn.com/w40/ky.png",
1864
+ phoneCode: "+1345",
1865
+ phonelengthMAX: 10
1866
+ },
1867
+ {
1868
+ name: "Central African Republic",
1869
+ code: "CF",
1870
+ flagEmoji: "🇨🇫",
1871
+ flagSvg: "https://flagcdn.com/cf.svg",
1872
+ flagPng: "https://flagcdn.com/w40/cf.png",
1873
+ phoneCode: "+236",
1874
+ phonelengthMAX: 10
1875
+ },
1876
+ {
1877
+ name: "Chad",
1878
+ code: "TD",
1879
+ flagEmoji: "🇹🇩",
1880
+ flagSvg: "https://flagcdn.com/td.svg",
1881
+ flagPng: "https://flagcdn.com/w40/td.png",
1882
+ phoneCode: "+235",
1883
+ phonelengthMAX: 10
1884
+ },
1885
+ {
1886
+ name: "Chile",
1887
+ code: "CL",
1888
+ flagEmoji: "🇨🇱",
1889
+ flagSvg: "https://flagcdn.com/cl.svg",
1890
+ flagPng: "https://flagcdn.com/w40/cl.png",
1891
+ phoneCode: "+56",
1892
+ phonelengthMAX: 10
1893
+ },
1894
+ {
1895
+ name: "China",
1896
+ code: "CN",
1897
+ flagEmoji: "🇨🇳",
1898
+ flagSvg: "https://flagcdn.com/cn.svg",
1899
+ flagPng: "https://flagcdn.com/w40/cn.png",
1900
+ phoneCode: "+86",
1901
+ phonelengthMAX: 11
1902
+ },
1903
+ {
1904
+ name: "Christmas Island",
1905
+ code: "CX",
1906
+ flagEmoji: "🇨🇽",
1907
+ flagSvg: "https://flagcdn.com/cx.svg",
1908
+ flagPng: "https://flagcdn.com/w40/cx.png",
1909
+ phoneCode: "+61",
1910
+ phonelengthMAX: 10
1911
+ },
1912
+ {
1913
+ name: "Cocos (Keeling) Islands",
1914
+ code: "CC",
1915
+ flagEmoji: "🇨🇨",
1916
+ flagSvg: "https://flagcdn.com/cc.svg",
1917
+ flagPng: "https://flagcdn.com/w40/cc.png",
1918
+ phoneCode: "+61",
1919
+ phonelengthMAX: 10
1920
+ },
1921
+ {
1922
+ name: "Colombia",
1923
+ code: "CO",
1924
+ flagEmoji: "🇨🇴",
1925
+ flagSvg: "https://flagcdn.com/co.svg",
1926
+ flagPng: "https://flagcdn.com/w40/co.png",
1927
+ phoneCode: "+57",
1928
+ phonelengthMAX: 10
1929
+ },
1930
+ {
1931
+ name: "Comoros",
1932
+ code: "KM",
1933
+ flagEmoji: "🇰🇲",
1934
+ flagSvg: "https://flagcdn.com/km.svg",
1935
+ flagPng: "https://flagcdn.com/w40/km.png",
1936
+ phoneCode: "+269",
1937
+ phonelengthMAX: 10
1938
+ },
1939
+ {
1940
+ name: "Congo",
1941
+ code: "CG",
1942
+ flagEmoji: "🇨🇬",
1943
+ flagSvg: "https://flagcdn.com/cg.svg",
1944
+ flagPng: "https://flagcdn.com/w40/cg.png",
1945
+ phoneCode: "+242",
1946
+ phonelengthMAX: 10
1947
+ },
1948
+ {
1949
+ name: "Congo, Democratic Republic of the",
1950
+ code: "CD",
1951
+ flagEmoji: "🇨🇩",
1952
+ flagSvg: "https://flagcdn.com/cd.svg",
1953
+ flagPng: "https://flagcdn.com/w40/cd.png",
1954
+ phoneCode: "+243",
1955
+ phonelengthMAX: 10
1956
+ },
1957
+ {
1958
+ name: "Cook Islands",
1959
+ code: "CK",
1960
+ flagEmoji: "🇨🇰",
1961
+ flagSvg: "https://flagcdn.com/ck.svg",
1962
+ flagPng: "https://flagcdn.com/w40/ck.png",
1963
+ phoneCode: "+682",
1964
+ phonelengthMAX: 10
1965
+ },
1966
+ {
1967
+ name: "Costa Rica",
1968
+ code: "CR",
1969
+ flagEmoji: "🇨🇷",
1970
+ flagSvg: "https://flagcdn.com/cr.svg",
1971
+ flagPng: "https://flagcdn.com/w40/cr.png",
1972
+ phoneCode: "+506",
1973
+ phonelengthMAX: 10
1974
+ },
1975
+ {
1976
+ name: "Croatia",
1977
+ code: "HR",
1978
+ flagEmoji: "🇭🇷",
1979
+ flagSvg: "https://flagcdn.com/hr.svg",
1980
+ flagPng: "https://flagcdn.com/w40/hr.png",
1981
+ phoneCode: "+385",
1982
+ phonelengthMAX: 10
1983
+ },
1984
+ {
1985
+ name: "Cuba",
1986
+ code: "CU",
1987
+ flagEmoji: "🇨🇺",
1988
+ flagSvg: "https://flagcdn.com/cu.svg",
1989
+ flagPng: "https://flagcdn.com/w40/cu.png",
1990
+ phoneCode: "+53",
1991
+ phonelengthMAX: 10
1992
+ },
1993
+ {
1994
+ name: "Curaçao",
1995
+ code: "CW",
1996
+ flagEmoji: "🇨🇼",
1997
+ flagSvg: "https://flagcdn.com/cw.svg",
1998
+ flagPng: "https://flagcdn.com/w40/cw.png",
1999
+ phoneCode: "+5999",
2000
+ phonelengthMAX: 10
2001
+ },
2002
+ {
2003
+ name: "Cyprus",
2004
+ code: "CY",
2005
+ flagEmoji: "🇨🇾",
2006
+ flagSvg: "https://flagcdn.com/cy.svg",
2007
+ flagPng: "https://flagcdn.com/w40/cy.png",
2008
+ phoneCode: "+357",
2009
+ phonelengthMAX: 10
2010
+ },
2011
+ {
2012
+ name: "Czechia",
2013
+ code: "CZ",
2014
+ flagEmoji: "🇨🇿",
2015
+ flagSvg: "https://flagcdn.com/cz.svg",
2016
+ flagPng: "https://flagcdn.com/w40/cz.png",
2017
+ phoneCode: "+420",
2018
+ phonelengthMAX: 10
2019
+ },
2020
+ {
2021
+ name: "Denmark",
2022
+ code: "DK",
2023
+ flagEmoji: "🇩🇰",
2024
+ flagSvg: "https://flagcdn.com/dk.svg",
2025
+ flagPng: "https://flagcdn.com/w40/dk.png",
2026
+ phoneCode: "+45",
2027
+ phonelengthMAX: 10
2028
+ },
2029
+ {
2030
+ name: "Djibouti",
2031
+ code: "DJ",
2032
+ flagEmoji: "🇩🇯",
2033
+ flagSvg: "https://flagcdn.com/dj.svg",
2034
+ flagPng: "https://flagcdn.com/w40/dj.png",
2035
+ phoneCode: "+253",
2036
+ phonelengthMAX: 10
2037
+ },
2038
+ {
2039
+ name: "Dominica",
2040
+ code: "DM",
2041
+ flagEmoji: "🇩🇲",
2042
+ flagSvg: "https://flagcdn.com/dm.svg",
2043
+ flagPng: "https://flagcdn.com/w40/dm.png",
2044
+ phoneCode: "+1767",
2045
+ phonelengthMAX: 10
2046
+ },
2047
+ {
2048
+ name: "Dominican Republic",
2049
+ code: "DO",
2050
+ flagEmoji: "🇩🇴",
2051
+ flagSvg: "https://flagcdn.com/do.svg",
2052
+ flagPng: "https://flagcdn.com/w40/do.png",
2053
+ phoneCode: "+1809",
2054
+ phonelengthMAX: 10
2055
+ },
2056
+ {
2057
+ name: "Ecuador",
2058
+ code: "EC",
2059
+ flagEmoji: "🇪🇨",
2060
+ flagSvg: "https://flagcdn.com/ec.svg",
2061
+ flagPng: "https://flagcdn.com/w40/ec.png",
2062
+ phoneCode: "+593",
2063
+ phonelengthMAX: 10
2064
+ },
2065
+ {
2066
+ name: "Egypt",
2067
+ code: "EG",
2068
+ flagEmoji: "🇪🇬",
2069
+ flagSvg: "https://flagcdn.com/eg.svg",
2070
+ flagPng: "https://flagcdn.com/w40/eg.png",
2071
+ phoneCode: "+20",
2072
+ phonelengthMAX: 10
2073
+ },
2074
+ {
2075
+ name: "El Salvador",
2076
+ code: "SV",
2077
+ flagEmoji: "🇸🇻",
2078
+ flagSvg: "https://flagcdn.com/sv.svg",
2079
+ flagPng: "https://flagcdn.com/w40/sv.png",
2080
+ phoneCode: "+503",
2081
+ phonelengthMAX: 10
2082
+ },
2083
+ {
2084
+ name: "Equatorial Guinea",
2085
+ code: "GQ",
2086
+ flagEmoji: "🇬🇶",
2087
+ flagSvg: "https://flagcdn.com/gq.svg",
2088
+ flagPng: "https://flagcdn.com/w40/gq.png",
2089
+ phoneCode: "+240",
2090
+ phonelengthMAX: 10
2091
+ },
2092
+ {
2093
+ name: "Eritrea",
2094
+ code: "ER",
2095
+ flagEmoji: "🇪🇷",
2096
+ flagSvg: "https://flagcdn.com/er.svg",
2097
+ flagPng: "https://flagcdn.com/w40/er.png",
2098
+ phoneCode: "+291",
2099
+ phonelengthMAX: 10
2100
+ },
2101
+ {
2102
+ name: "Estonia",
2103
+ code: "EE",
2104
+ flagEmoji: "🇪🇪",
2105
+ flagSvg: "https://flagcdn.com/ee.svg",
2106
+ flagPng: "https://flagcdn.com/w40/ee.png",
2107
+ phoneCode: "+372",
2108
+ phonelengthMAX: 10
2109
+ },
2110
+ {
2111
+ name: "Eswatini",
2112
+ code: "SZ",
2113
+ flagEmoji: "🇸🇿",
2114
+ flagSvg: "https://flagcdn.com/sz.svg",
2115
+ flagPng: "https://flagcdn.com/w40/sz.png",
2116
+ phoneCode: "+268",
2117
+ phonelengthMAX: 10
2118
+ },
2119
+ {
2120
+ name: "Ethiopia",
2121
+ code: "ET",
2122
+ flagEmoji: "🇪🇹",
2123
+ flagSvg: "https://flagcdn.com/et.svg",
2124
+ flagPng: "https://flagcdn.com/w40/et.png",
2125
+ phoneCode: "+251",
2126
+ phonelengthMAX: 10
2127
+ },
2128
+ {
2129
+ name: "Falkland Islands (Malvinas)",
2130
+ code: "FK",
2131
+ flagEmoji: "🇫🇰",
2132
+ flagSvg: "https://flagcdn.com/fk.svg",
2133
+ flagPng: "https://flagcdn.com/w40/fk.png",
2134
+ phoneCode: "+500",
2135
+ phonelengthMAX: 10
2136
+ },
2137
+ {
2138
+ name: "Faroe Islands",
2139
+ code: "FO",
2140
+ flagEmoji: "🇫🇴",
2141
+ flagSvg: "https://flagcdn.com/fo.svg",
2142
+ flagPng: "https://flagcdn.com/w40/fo.png",
2143
+ phoneCode: "+298",
2144
+ phonelengthMAX: 10
2145
+ },
2146
+ {
2147
+ name: "Fiji",
2148
+ code: "FJ",
2149
+ flagEmoji: "🇫🇯",
2150
+ flagSvg: "https://flagcdn.com/fj.svg",
2151
+ flagPng: "https://flagcdn.com/w40/fj.png",
2152
+ phoneCode: "+679",
2153
+ phonelengthMAX: 10
2154
+ },
2155
+ {
2156
+ name: "Finland",
2157
+ code: "FI",
2158
+ flagEmoji: "🇫🇮",
2159
+ flagSvg: "https://flagcdn.com/fi.svg",
2160
+ flagPng: "https://flagcdn.com/w40/fi.png",
2161
+ phoneCode: "+358",
2162
+ phonelengthMAX: 10
2163
+ },
2164
+ {
2165
+ name: "France",
2166
+ code: "FR",
2167
+ flagEmoji: "🇫🇷",
2168
+ flagSvg: "https://flagcdn.com/fr.svg",
2169
+ flagPng: "https://flagcdn.com/w40/fr.png",
2170
+ phoneCode: "+33",
2171
+ phonelengthMAX: 10
2172
+ },
2173
+ {
2174
+ name: "French Guiana",
2175
+ code: "GF",
2176
+ flagEmoji: "🇬🇫",
2177
+ flagSvg: "https://flagcdn.com/gf.svg",
2178
+ flagPng: "https://flagcdn.com/w40/gf.png",
2179
+ phoneCode: "+594",
2180
+ phonelengthMAX: 10
2181
+ },
2182
+ {
2183
+ name: "French Polynesia",
2184
+ code: "PF",
2185
+ flagEmoji: "🇵🇫",
2186
+ flagSvg: "https://flagcdn.com/pf.svg",
2187
+ flagPng: "https://flagcdn.com/w40/pf.png",
2188
+ phoneCode: "+689",
2189
+ phonelengthMAX: 10
2190
+ },
2191
+ {
2192
+ name: "French Southern Territories",
2193
+ code: "TF",
2194
+ flagEmoji: "🇹🇫",
2195
+ flagSvg: "https://flagcdn.com/tf.svg",
2196
+ flagPng: "https://flagcdn.com/w40/tf.png",
2197
+ phoneCode: "+262",
2198
+ phonelengthMAX: 10
2199
+ },
2200
+ {
2201
+ name: "Gabon",
2202
+ code: "GA",
2203
+ flagEmoji: "🇬🇦",
2204
+ flagSvg: "https://flagcdn.com/ga.svg",
2205
+ flagPng: "https://flagcdn.com/w40/ga.png",
2206
+ phoneCode: "+241",
2207
+ phonelengthMAX: 10
2208
+ },
2209
+ {
2210
+ name: "Gambia",
2211
+ code: "GM",
2212
+ flagEmoji: "🇬🇲",
2213
+ flagSvg: "https://flagcdn.com/gm.svg",
2214
+ flagPng: "https://flagcdn.com/w40/gm.png",
2215
+ phoneCode: "+220",
2216
+ phonelengthMAX: 10
2217
+ },
2218
+ {
2219
+ name: "Georgia",
2220
+ code: "GE",
2221
+ flagEmoji: "🇬🇪",
2222
+ flagSvg: "https://flagcdn.com/ge.svg",
2223
+ flagPng: "https://flagcdn.com/w40/ge.png",
2224
+ phoneCode: "+995",
2225
+ phonelengthMAX: 10
2226
+ },
2227
+ {
2228
+ name: "Germany",
2229
+ code: "DE",
2230
+ flagEmoji: "🇩🇪",
2231
+ flagSvg: "https://flagcdn.com/de.svg",
2232
+ flagPng: "https://flagcdn.com/w40/de.png",
2233
+ phoneCode: "+49",
2234
+ phonelengthMAX: 10
2235
+ },
2236
+ {
2237
+ name: "Ghana",
2238
+ code: "GH",
2239
+ flagEmoji: "🇬🇭",
2240
+ flagSvg: "https://flagcdn.com/gh.svg",
2241
+ flagPng: "https://flagcdn.com/w40/gh.png",
2242
+ phoneCode: "+233",
2243
+ phonelengthMAX: 10
2244
+ },
2245
+ {
2246
+ name: "Gibraltar",
2247
+ code: "GI",
2248
+ flagEmoji: "🇬🇮",
2249
+ flagSvg: "https://flagcdn.com/gi.svg",
2250
+ flagPng: "https://flagcdn.com/w40/gi.png",
2251
+ phoneCode: "+350",
2252
+ phonelengthMAX: 10
2253
+ },
2254
+ {
2255
+ name: "Greece",
2256
+ code: "GR",
2257
+ flagEmoji: "🇬🇷",
2258
+ flagSvg: "https://flagcdn.com/gr.svg",
2259
+ flagPng: "https://flagcdn.com/w40/gr.png",
2260
+ phoneCode: "+30",
2261
+ phonelengthMAX: 10
2262
+ },
2263
+ {
2264
+ name: "Greenland",
2265
+ code: "GL",
2266
+ flagEmoji: "🇬🇱",
2267
+ flagSvg: "https://flagcdn.com/gl.svg",
2268
+ flagPng: "https://flagcdn.com/w40/gl.png",
2269
+ phoneCode: "+299",
2270
+ phonelengthMAX: 10
2271
+ },
2272
+ {
2273
+ name: "Grenada",
2274
+ code: "GD",
2275
+ flagEmoji: "🇬🇩",
2276
+ flagSvg: "https://flagcdn.com/gd.svg",
2277
+ flagPng: "https://flagcdn.com/w40/gd.png",
2278
+ phoneCode: "+1473",
2279
+ phonelengthMAX: 10
2280
+ },
2281
+ {
2282
+ name: "Guadeloupe",
2283
+ code: "GP",
2284
+ flagEmoji: "🇬🇵",
2285
+ flagSvg: "https://flagcdn.com/gp.svg",
2286
+ flagPng: "https://flagcdn.com/w40/gp.png",
2287
+ phoneCode: "+590",
2288
+ phonelengthMAX: 10
2289
+ },
2290
+ {
2291
+ name: "Guam",
2292
+ code: "GU",
2293
+ flagEmoji: "🇬🇺",
2294
+ flagSvg: "https://flagcdn.com/gu.svg",
2295
+ flagPng: "https://flagcdn.com/w40/gu.png",
2296
+ phoneCode: "+1671",
2297
+ phonelengthMAX: 10
2298
+ },
2299
+ {
2300
+ name: "Guatemala",
2301
+ code: "GT",
2302
+ flagEmoji: "🇬🇹",
2303
+ flagSvg: "https://flagcdn.com/gt.svg",
2304
+ flagPng: "https://flagcdn.com/w40/gt.png",
2305
+ phoneCode: "+502",
2306
+ phonelengthMAX: 10
2307
+ },
2308
+ {
2309
+ name: "Guernsey",
2310
+ code: "GG",
2311
+ flagEmoji: "🇬🇬",
2312
+ flagSvg: "https://flagcdn.com/gg.svg",
2313
+ flagPng: "https://flagcdn.com/w40/gg.png",
2314
+ phoneCode: "+44",
2315
+ phonelengthMAX: 10
2316
+ },
2317
+ {
2318
+ name: "Guinea",
2319
+ code: "GN",
2320
+ flagEmoji: "🇬🇳",
2321
+ flagSvg: "https://flagcdn.com/gn.svg",
2322
+ flagPng: "https://flagcdn.com/w40/gn.png",
2323
+ phoneCode: "+224",
2324
+ phonelengthMAX: 10
2325
+ },
2326
+ {
2327
+ name: "Guinea-Bissau",
2328
+ code: "GW",
2329
+ flagEmoji: "🇬🇼",
2330
+ flagSvg: "https://flagcdn.com/gw.svg",
2331
+ flagPng: "https://flagcdn.com/w40/gw.png",
2332
+ phoneCode: "+245",
2333
+ phonelengthMAX: 10
2334
+ },
2335
+ {
2336
+ name: "Guyana",
2337
+ code: "GY",
2338
+ flagEmoji: "🇬🇾",
2339
+ flagSvg: "https://flagcdn.com/gy.svg",
2340
+ flagPng: "https://flagcdn.com/w40/gy.png",
2341
+ phoneCode: "+592",
2342
+ phonelengthMAX: 10
2343
+ },
2344
+ {
2345
+ name: "Haiti",
2346
+ code: "HT",
2347
+ flagEmoji: "🇭🇹",
2348
+ flagSvg: "https://flagcdn.com/ht.svg",
2349
+ flagPng: "https://flagcdn.com/w40/ht.png",
2350
+ phoneCode: "+509",
2351
+ phonelengthMAX: 10
2352
+ },
2353
+ {
2354
+ name: "Heard Island and McDonald Islands",
2355
+ code: "HM",
2356
+ flagEmoji: "🇭🇲",
2357
+ flagSvg: "https://flagcdn.com/hm.svg",
2358
+ flagPng: "https://flagcdn.com/w40/hm.png",
2359
+ phoneCode: "+672"
2360
+ },
2361
+ {
2362
+ name: "Holy See",
2363
+ code: "VA",
2364
+ flagEmoji: "🇻🇦",
2365
+ flagSvg: "https://flagcdn.com/va.svg",
2366
+ flagPng: "https://flagcdn.com/w40/va.png",
2367
+ phoneCode: "+39"
2368
+ },
2369
+ {
2370
+ name: "Honduras",
2371
+ code: "HN",
2372
+ flagEmoji: "🇭🇳",
2373
+ flagSvg: "https://flagcdn.com/hn.svg",
2374
+ flagPng: "https://flagcdn.com/w40/hn.png",
2375
+ phoneCode: "+504"
2376
+ },
2377
+ {
2378
+ name: "Hong Kong",
2379
+ code: "HK",
2380
+ flagEmoji: "🇭🇰",
2381
+ flagSvg: "https://flagcdn.com/hk.svg",
2382
+ flagPng: "https://flagcdn.com/w40/hk.png",
2383
+ phoneCode: "+852"
2384
+ },
2385
+ {
2386
+ name: "Hungary",
2387
+ code: "HU",
2388
+ flagEmoji: "🇭🇺",
2389
+ flagSvg: "https://flagcdn.com/hu.svg",
2390
+ flagPng: "https://flagcdn.com/w40/hu.png",
2391
+ phoneCode: "+36"
2392
+ },
2393
+ {
2394
+ name: "Iceland",
2395
+ code: "IS",
2396
+ flagEmoji: "🇮🇸",
2397
+ flagSvg: "https://flagcdn.com/is.svg",
2398
+ flagPng: "https://flagcdn.com/w40/is.png",
2399
+ phoneCode: "+354"
2400
+ },
2401
+ {
2402
+ name: "India",
2403
+ code: "IN",
2404
+ flagEmoji: "🇮🇳",
2405
+ flagSvg: "https://flagcdn.com/in.svg",
2406
+ flagPng: "https://flagcdn.com/w40/in.png",
2407
+ phoneCode: "+91"
2408
+ },
2409
+ {
2410
+ name: "Indonesia",
2411
+ code: "ID",
2412
+ flagEmoji: "🇮🇩",
2413
+ flagSvg: "https://flagcdn.com/id.svg",
2414
+ flagPng: "https://flagcdn.com/w40/id.png",
2415
+ phoneCode: "+62"
2416
+ },
2417
+ {
2418
+ name: "Iran (Islamic Republic of)",
2419
+ code: "IR",
2420
+ flagEmoji: "🇮🇷",
2421
+ flagSvg: "https://flagcdn.com/ir.svg",
2422
+ flagPng: "https://flagcdn.com/w40/ir.png",
2423
+ phoneCode: "+98"
2424
+ },
2425
+ {
2426
+ name: "Iraq",
2427
+ code: "IQ",
2428
+ flagEmoji: "🇮🇶",
2429
+ flagSvg: "https://flagcdn.com/iq.svg",
2430
+ flagPng: "https://flagcdn.com/w40/iq.png",
2431
+ phoneCode: "+964"
2432
+ },
2433
+ {
2434
+ name: "Ireland",
2435
+ code: "IE",
2436
+ flagEmoji: "🇮🇪",
2437
+ flagSvg: "https://flagcdn.com/ie.svg",
2438
+ flagPng: "https://flagcdn.com/w40/ie.png",
2439
+ phoneCode: "+353"
2440
+ },
2441
+ {
2442
+ name: "Isle of Man",
2443
+ code: "IM",
2444
+ flagEmoji: "🇮🇲",
2445
+ flagSvg: "https://flagcdn.com/im.svg",
2446
+ flagPng: "https://flagcdn.com/w40/im.png",
2447
+ phoneCode: "+44"
2448
+ },
2449
+ {
2450
+ name: "Israel",
2451
+ code: "IL",
2452
+ flagEmoji: "🇮🇱",
2453
+ flagSvg: "https://flagcdn.com/il.svg",
2454
+ flagPng: "https://flagcdn.com/w40/il.png",
2455
+ phoneCode: "+972"
2456
+ },
2457
+ {
2458
+ name: "Italy",
2459
+ code: "IT",
2460
+ flagEmoji: "🇮🇹",
2461
+ flagSvg: "https://flagcdn.com/it.svg",
2462
+ flagPng: "https://flagcdn.com/w40/it.png",
2463
+ phoneCode: "+39"
2464
+ },
2465
+ {
2466
+ name: "Jamaica",
2467
+ code: "JM",
2468
+ flagEmoji: "🇯🇲",
2469
+ flagSvg: "https://flagcdn.com/jm.svg",
2470
+ flagPng: "https://flagcdn.com/w40/jm.png",
2471
+ phoneCode: "+1876"
2472
+ },
2473
+ {
2474
+ name: "Japan",
2475
+ code: "JP",
2476
+ flagEmoji: "🇯🇵",
2477
+ flagSvg: "https://flagcdn.com/jp.svg",
2478
+ flagPng: "https://flagcdn.com/w40/jp.png",
2479
+ phoneCode: "+81"
2480
+ },
2481
+ {
2482
+ name: "Jersey",
2483
+ code: "JE",
2484
+ flagEmoji: "🇯🇪",
2485
+ flagSvg: "https://flagcdn.com/je.svg",
2486
+ flagPng: "https://flagcdn.com/w40/je.png",
2487
+ phoneCode: "+44"
2488
+ },
2489
+ {
2490
+ name: "Jordan",
2491
+ code: "JO",
2492
+ flagEmoji: "🇯🇴",
2493
+ flagSvg: "https://flagcdn.com/jo.svg",
2494
+ flagPng: "https://flagcdn.com/w40/jo.png",
2495
+ phoneCode: "+962"
2496
+ },
2497
+ {
2498
+ name: "Kazakhstan",
2499
+ code: "KZ",
2500
+ flagEmoji: "🇰🇿",
2501
+ flagSvg: "https://flagcdn.com/kz.svg",
2502
+ flagPng: "https://flagcdn.com/w40/kz.png",
2503
+ phoneCode: "+7"
2504
+ },
2505
+ {
2506
+ name: "Kenya",
2507
+ code: "KE",
2508
+ flagEmoji: "🇰🇪",
2509
+ flagSvg: "https://flagcdn.com/ke.svg",
2510
+ flagPng: "https://flagcdn.com/w40/ke.png",
2511
+ phoneCode: "+254"
2512
+ },
2513
+ {
2514
+ name: "Kiribati",
2515
+ code: "KI",
2516
+ flagEmoji: "🇰🇮",
2517
+ flagSvg: "https://flagcdn.com/ki.svg",
2518
+ flagPng: "https://flagcdn.com/w40/ki.png",
2519
+ phoneCode: "+686"
2520
+ },
2521
+ {
2522
+ name: "Korea (Democratic People's Republic of)",
2523
+ code: "KP",
2524
+ flagEmoji: "🇰🇵",
2525
+ flagSvg: "https://flagcdn.com/kp.svg",
2526
+ flagPng: "https://flagcdn.com/w40/kp.png",
2527
+ phoneCode: "+850"
2528
+ },
2529
+ {
2530
+ name: "Korea, Republic of",
2531
+ code: "KR",
2532
+ flagEmoji: "🇰🇷",
2533
+ flagSvg: "https://flagcdn.com/kr.svg",
2534
+ flagPng: "https://flagcdn.com/w40/kr.png",
2535
+ phoneCode: "+82"
2536
+ },
2537
+ {
2538
+ name: "Kuwait",
2539
+ code: "KW",
2540
+ flagEmoji: "🇰🇼",
2541
+ flagSvg: "https://flagcdn.com/kw.svg",
2542
+ flagPng: "https://flagcdn.com/w40/kw.png",
2543
+ phoneCode: "+965"
2544
+ },
2545
+ {
2546
+ name: "Kyrgyzstan",
2547
+ code: "KG",
2548
+ flagEmoji: "🇰🇬",
2549
+ flagSvg: "https://flagcdn.com/kg.svg",
2550
+ flagPng: "https://flagcdn.com/w40/kg.png",
2551
+ phoneCode: "+996"
2552
+ },
2553
+ {
2554
+ name: "Lao People's Democratic Republic",
2555
+ code: "LA",
2556
+ flagEmoji: "🇱🇦",
2557
+ flagSvg: "https://flagcdn.com/la.svg",
2558
+ flagPng: "https://flagcdn.com/w40/la.png",
2559
+ phoneCode: "+856"
2560
+ },
2561
+ {
2562
+ name: "Latvia",
2563
+ code: "LV",
2564
+ flagEmoji: "🇱🇻",
2565
+ flagSvg: "https://flagcdn.com/lv.svg",
2566
+ flagPng: "https://flagcdn.com/w40/lv.png",
2567
+ phoneCode: "+371"
2568
+ },
2569
+ {
2570
+ name: "Lebanon",
2571
+ code: "LB",
2572
+ flagEmoji: "🇱🇧",
2573
+ flagSvg: "https://flagcdn.com/lb.svg",
2574
+ flagPng: "https://flagcdn.com/w40/lb.png",
2575
+ phoneCode: "+961"
2576
+ },
2577
+ {
2578
+ name: "Lesotho",
2579
+ code: "LS",
2580
+ flagEmoji: "🇱🇸",
2581
+ flagSvg: "https://flagcdn.com/ls.svg",
2582
+ flagPng: "https://flagcdn.com/w40/ls.png",
2583
+ phoneCode: "+266"
2584
+ },
2585
+ {
2586
+ name: "Liberia",
2587
+ code: "LR",
2588
+ flagEmoji: "🇱🇷",
2589
+ flagSvg: "https://flagcdn.com/lr.svg",
2590
+ flagPng: "https://flagcdn.com/w40/lr.png",
2591
+ phoneCode: "+231"
2592
+ },
2593
+ {
2594
+ name: "Libya",
2595
+ code: "LY",
2596
+ flagEmoji: "🇱🇾",
2597
+ flagSvg: "https://flagcdn.com/ly.svg",
2598
+ flagPng: "https://flagcdn.com/w40/ly.png",
2599
+ phoneCode: "+218"
2600
+ },
2601
+ {
2602
+ name: "Liechtenstein",
2603
+ code: "LI",
2604
+ flagEmoji: "🇱🇮",
2605
+ flagSvg: "https://flagcdn.com/li.svg",
2606
+ flagPng: "https://flagcdn.com/w40/li.png",
2607
+ phoneCode: "+423"
2608
+ },
2609
+ {
2610
+ name: "Lithuania",
2611
+ code: "LT",
2612
+ flagEmoji: "🇱🇹",
2613
+ flagSvg: "https://flagcdn.com/lt.svg",
2614
+ flagPng: "https://flagcdn.com/w40/lt.png",
2615
+ phoneCode: "+370"
2616
+ },
2617
+ {
2618
+ name: "Luxembourg",
2619
+ code: "LU",
2620
+ flagEmoji: "🇱🇺",
2621
+ flagSvg: "https://flagcdn.com/lu.svg",
2622
+ flagPng: "https://flagcdn.com/w40/lu.png",
2623
+ phoneCode: "+352"
2624
+ },
2625
+ {
2626
+ name: "Macao",
2627
+ code: "MO",
2628
+ flagEmoji: "🇲🇴",
2629
+ flagSvg: "https://flagcdn.com/mo.svg",
2630
+ flagPng: "https://flagcdn.com/w40/mo.png",
2631
+ phoneCode: "+853"
2632
+ },
2633
+ {
2634
+ name: "Madagascar",
2635
+ code: "MG",
2636
+ flagEmoji: "🇲🇬",
2637
+ flagSvg: "https://flagcdn.com/mg.svg",
2638
+ flagPng: "https://flagcdn.com/w40/mg.png",
2639
+ phoneCode: "+261"
2640
+ },
2641
+ {
2642
+ name: "Malawi",
2643
+ code: "MW",
2644
+ flagEmoji: "🇲🇼",
2645
+ flagSvg: "https://flagcdn.com/mw.svg",
2646
+ flagPng: "https://flagcdn.com/w40/mw.png",
2647
+ phoneCode: "+265"
2648
+ },
2649
+ {
2650
+ name: "Malaysia",
2651
+ code: "MY",
2652
+ flagEmoji: "🇲🇾",
2653
+ flagSvg: "https://flagcdn.com/my.svg",
2654
+ flagPng: "https://flagcdn.com/w40/my.png",
2655
+ phoneCode: "+60"
2656
+ },
2657
+ {
2658
+ name: "Maldives",
2659
+ code: "MV",
2660
+ flagEmoji: "🇲🇻",
2661
+ flagSvg: "https://flagcdn.com/mv.svg",
2662
+ flagPng: "https://flagcdn.com/w40/mv.png",
2663
+ phoneCode: "+960"
2664
+ },
2665
+ {
2666
+ name: "Mali",
2667
+ code: "ML",
2668
+ flagEmoji: "🇲🇱",
2669
+ flagSvg: "https://flagcdn.com/ml.svg",
2670
+ flagPng: "https://flagcdn.com/w40/ml.png",
2671
+ phoneCode: "+223"
2672
+ },
2673
+ {
2674
+ name: "Malta",
2675
+ code: "MT",
2676
+ flagEmoji: "🇲🇹",
2677
+ flagSvg: "https://flagcdn.com/mt.svg",
2678
+ flagPng: "https://flagcdn.com/w40/mt.png",
2679
+ phoneCode: "+356"
2680
+ },
2681
+ {
2682
+ name: "Marshall Islands",
2683
+ code: "MH",
2684
+ flagEmoji: "🇲🇭",
2685
+ flagSvg: "https://flagcdn.com/mh.svg",
2686
+ flagPng: "https://flagcdn.com/w40/mh.png",
2687
+ phoneCode: "+692"
2688
+ },
2689
+ {
2690
+ name: "Martinique",
2691
+ code: "MQ",
2692
+ flagEmoji: "🇲🇶",
2693
+ flagSvg: "https://flagcdn.com/mq.svg",
2694
+ flagPng: "https://flagcdn.com/w40/mq.png",
2695
+ phoneCode: "+596"
2696
+ },
2697
+ {
2698
+ name: "Mauritania",
2699
+ code: "MR",
2700
+ flagEmoji: "🇲🇷",
2701
+ flagSvg: "https://flagcdn.com/mr.svg",
2702
+ flagPng: "https://flagcdn.com/w40/mr.png",
2703
+ phoneCode: "+222"
2704
+ },
2705
+ {
2706
+ name: "Mauritius",
2707
+ code: "MU",
2708
+ flagEmoji: "🇲🇺",
2709
+ flagSvg: "https://flagcdn.com/mu.svg",
2710
+ flagPng: "https://flagcdn.com/w40/mu.png",
2711
+ phoneCode: "+230"
2712
+ },
2713
+ {
2714
+ name: "Mayotte",
2715
+ code: "YT",
2716
+ flagEmoji: "🇾🇹",
2717
+ flagSvg: "https://flagcdn.com/yt.svg",
2718
+ flagPng: "https://flagcdn.com/w40/yt.png",
2719
+ phoneCode: "+262"
2720
+ },
2721
+ {
2722
+ name: "Mexico",
2723
+ code: "MX",
2724
+ flagEmoji: "🇲🇽",
2725
+ flagSvg: "https://flagcdn.com/mx.svg",
2726
+ flagPng: "https://flagcdn.com/w40/mx.png",
2727
+ phoneCode: "+52"
2728
+ },
2729
+ {
2730
+ name: "Micronesia (Federated States of)",
2731
+ code: "FM",
2732
+ flagEmoji: "🇫🇲",
2733
+ flagSvg: "https://flagcdn.com/fm.svg",
2734
+ flagPng: "https://flagcdn.com/w40/fm.png",
2735
+ phoneCode: "+691"
2736
+ },
2737
+ {
2738
+ name: "Moldova, Republic of",
2739
+ code: "MD",
2740
+ flagEmoji: "🇲🇩",
2741
+ flagSvg: "https://flagcdn.com/md.svg",
2742
+ flagPng: "https://flagcdn.com/w40/md.png",
2743
+ phoneCode: "+373"
2744
+ },
2745
+ {
2746
+ name: "Monaco",
2747
+ code: "MC",
2748
+ flagEmoji: "🇲🇨",
2749
+ flagSvg: "https://flagcdn.com/mc.svg",
2750
+ flagPng: "https://flagcdn.com/w40/mc.png",
2751
+ phoneCode: "+377",
2752
+ phonelengthMAX: 10
2753
+ },
2754
+ {
2755
+ name: "Mongolia",
2756
+ code: "MN",
2757
+ flagEmoji: "🇲🇳",
2758
+ flagSvg: "https://flagcdn.com/mn.svg",
2759
+ flagPng: "https://flagcdn.com/w40/mn.png",
2760
+ phoneCode: "+976"
2761
+ },
2762
+ {
2763
+ name: "Montenegro",
2764
+ code: "ME",
2765
+ flagEmoji: "🇲🇪",
2766
+ flagSvg: "https://flagcdn.com/me.svg",
2767
+ flagPng: "https://flagcdn.com/w40/me.png",
2768
+ phoneCode: "+382"
2769
+ },
2770
+ {
2771
+ name: "Montserrat",
2772
+ code: "MS",
2773
+ flagEmoji: "🇲🇸",
2774
+ flagSvg: "https://flagcdn.com/ms.svg",
2775
+ flagPng: "https://flagcdn.com/w40/ms.png",
2776
+ phoneCode: "+1664"
2777
+ },
2778
+ {
2779
+ name: "Morocco",
2780
+ code: "MA",
2781
+ flagEmoji: "🇲🇦",
2782
+ flagSvg: "https://flagcdn.com/ma.svg",
2783
+ flagPng: "https://flagcdn.com/w40/ma.png",
2784
+ phoneCode: "+212"
2785
+ },
2786
+ {
2787
+ name: "Mozambique",
2788
+ code: "MZ",
2789
+ flagEmoji: "🇲🇿",
2790
+ flagSvg: "https://flagcdn.com/mz.svg",
2791
+ flagPng: "https://flagcdn.com/w40/mz.png",
2792
+ phoneCode: "+258"
2793
+ },
2794
+ {
2795
+ name: "Myanmar",
2796
+ code: "MM",
2797
+ flagEmoji: "🇲🇲",
2798
+ flagSvg: "https://flagcdn.com/mm.svg",
2799
+ flagPng: "https://flagcdn.com/w40/mm.png",
2800
+ phoneCode: "+95"
2801
+ },
2802
+ {
2803
+ name: "Namibia",
2804
+ code: "NA",
2805
+ flagEmoji: "🇳🇦",
2806
+ flagSvg: "https://flagcdn.com/na.svg",
2807
+ flagPng: "https://flagcdn.com/w40/na.png",
2808
+ phoneCode: "+264"
2809
+ },
2810
+ {
2811
+ name: "Nauru",
2812
+ code: "NR",
2813
+ flagEmoji: "🇳🇷",
2814
+ flagSvg: "https://flagcdn.com/nr.svg",
2815
+ flagPng: "https://flagcdn.com/w40/nr.png",
2816
+ phoneCode: "+674"
2817
+ },
2818
+ {
2819
+ name: "Nepal",
2820
+ code: "NP",
2821
+ flagEmoji: "🇳🇵",
2822
+ flagSvg: "https://flagcdn.com/np.svg",
2823
+ flagPng: "https://flagcdn.com/w40/np.png",
2824
+ phoneCode: "+977"
2825
+ },
2826
+ {
2827
+ name: "Netherlands",
2828
+ code: "NL",
2829
+ flagEmoji: "🇳🇱",
2830
+ flagSvg: "https://flagcdn.com/nl.svg",
2831
+ flagPng: "https://flagcdn.com/w40/nl.png",
2832
+ phoneCode: "+31"
2833
+ },
2834
+ {
2835
+ name: "New Caledonia",
2836
+ code: "NC",
2837
+ flagEmoji: "🇳🇨",
2838
+ flagSvg: "https://flagcdn.com/nc.svg",
2839
+ flagPng: "https://flagcdn.com/w40/nc.png",
2840
+ phoneCode: "+687"
2841
+ },
2842
+ {
2843
+ name: "New Zealand",
2844
+ code: "NZ",
2845
+ flagEmoji: "🇳🇿",
2846
+ flagSvg: "https://flagcdn.com/nz.svg",
2847
+ flagPng: "https://flagcdn.com/w40/nz.png",
2848
+ phoneCode: "+64"
2849
+ },
2850
+ {
2851
+ name: "Nicaragua",
2852
+ code: "NI",
2853
+ flagEmoji: "🇳🇮",
2854
+ flagSvg: "https://flagcdn.com/ni.svg",
2855
+ flagPng: "https://flagcdn.com/w40/ni.png",
2856
+ phoneCode: "+505"
2857
+ },
2858
+ {
2859
+ name: "Niger",
2860
+ code: "NE",
2861
+ flagEmoji: "🇳🇪",
2862
+ flagSvg: "https://flagcdn.com/ne.svg",
2863
+ flagPng: "https://flagcdn.com/w40/ne.png",
2864
+ phoneCode: "+227"
2865
+ },
2866
+ {
2867
+ name: "Nigeria",
2868
+ code: "NG",
2869
+ flagEmoji: "🇳🇬",
2870
+ flagSvg: "https://flagcdn.com/ng.svg",
2871
+ flagPng: "https://flagcdn.com/w40/ng.png",
2872
+ phoneCode: "+234"
2873
+ },
2874
+ {
2875
+ name: "Niue",
2876
+ code: "NU",
2877
+ flagEmoji: "🇳🇺",
2878
+ flagSvg: "https://flagcdn.com/nu.svg",
2879
+ flagPng: "https://flagcdn.com/w40/nu.png",
2880
+ phoneCode: "+683"
2881
+ },
2882
+ {
2883
+ name: "Norfolk Island",
2884
+ code: "NF",
2885
+ flagEmoji: "🇳🇫",
2886
+ flagSvg: "https://flagcdn.com/nf.svg",
2887
+ flagPng: "https://flagcdn.com/w40/nf.png",
2888
+ phoneCode: "+672"
2889
+ },
2890
+ {
2891
+ name: "North Macedonia",
2892
+ code: "MK",
2893
+ flagEmoji: "🇲🇰",
2894
+ flagSvg: "https://flagcdn.com/mk.svg",
2895
+ flagPng: "https://flagcdn.com/w40/mk.png",
2896
+ phoneCode: "+389"
2897
+ },
2898
+ {
2899
+ name: "Northern Mariana Islands",
2900
+ code: "MP",
2901
+ flagEmoji: "🇲🇵",
2902
+ flagSvg: "https://flagcdn.com/mp.svg",
2903
+ flagPng: "https://flagcdn.com/w40/mp.png",
2904
+ phoneCode: "+1670"
2905
+ },
2906
+ {
2907
+ name: "Norway",
2908
+ code: "NO",
2909
+ flagEmoji: "🇳🇴",
2910
+ flagSvg: "https://flagcdn.com/no.svg",
2911
+ flagPng: "https://flagcdn.com/w40/no.png",
2912
+ phoneCode: "+47"
2913
+ },
2914
+ {
2915
+ name: "Oman",
2916
+ code: "OM",
2917
+ flagEmoji: "🇴🇲",
2918
+ flagSvg: "https://flagcdn.com/om.svg",
2919
+ flagPng: "https://flagcdn.com/w40/om.png",
2920
+ phoneCode: "+968"
2921
+ },
2922
+ {
2923
+ name: "Pakistan",
2924
+ code: "PK",
2925
+ flagEmoji: "🇵🇰",
2926
+ flagSvg: "https://flagcdn.com/pk.svg",
2927
+ flagPng: "https://flagcdn.com/w40/pk.png",
2928
+ phoneCode: "+92"
2929
+ },
2930
+ {
2931
+ name: "Palau",
2932
+ code: "PW",
2933
+ flagEmoji: "🇵🇼",
2934
+ flagSvg: "https://flagcdn.com/pw.svg",
2935
+ flagPng: "https://flagcdn.com/w40/pw.png",
2936
+ phoneCode: "+680"
2937
+ },
2938
+ {
2939
+ name: "Palestine, State of",
2940
+ code: "PS",
2941
+ flagEmoji: "🇵🇸",
2942
+ flagSvg: "https://flagcdn.com/ps.svg",
2943
+ flagPng: "https://flagcdn.com/w40/ps.png",
2944
+ phoneCode: "+970"
2945
+ },
2946
+ {
2947
+ name: "Panama",
2948
+ code: "PA",
2949
+ flagEmoji: "🇵🇦",
2950
+ flagSvg: "https://flagcdn.com/pa.svg",
2951
+ flagPng: "https://flagcdn.com/w40/pa.png",
2952
+ phoneCode: "+507"
2953
+ },
2954
+ {
2955
+ name: "Papua New Guinea",
2956
+ code: "PG",
2957
+ flagEmoji: "🇵🇬",
2958
+ flagSvg: "https://flagcdn.com/pg.svg",
2959
+ flagPng: "https://flagcdn.com/w40/pg.png",
2960
+ phoneCode: "+675"
2961
+ },
2962
+ {
2963
+ name: "Paraguay",
2964
+ code: "PY",
2965
+ flagEmoji: "🇵🇾",
2966
+ flagSvg: "https://flagcdn.com/py.svg",
2967
+ flagPng: "https://flagcdn.com/w40/py.png",
2968
+ phoneCode: "+595"
2969
+ },
2970
+ {
2971
+ name: "Peru",
2972
+ code: "PE",
2973
+ flagEmoji: "🇵🇪",
2974
+ flagSvg: "https://flagcdn.com/pe.svg",
2975
+ flagPng: "https://flagcdn.com/w40/pe.png",
2976
+ phoneCode: "+51"
2977
+ },
2978
+ {
2979
+ name: "Philippines",
2980
+ code: "PH",
2981
+ flagEmoji: "🇵🇭",
2982
+ flagSvg: "https://flagcdn.com/ph.svg",
2983
+ flagPng: "https://flagcdn.com/w40/ph.png",
2984
+ phoneCode: "+63"
2985
+ },
2986
+ {
2987
+ name: "Pitcairn",
2988
+ code: "PN",
2989
+ flagEmoji: "🇵🇳",
2990
+ flagSvg: "https://flagcdn.com/pn.svg",
2991
+ flagPng: "https://flagcdn.com/w40/pn.png",
2992
+ phoneCode: "+64"
2993
+ },
2994
+ {
2995
+ name: "Poland",
2996
+ code: "PL",
2997
+ flagEmoji: "🇵🇱",
2998
+ flagSvg: "https://flagcdn.com/pl.svg",
2999
+ flagPng: "https://flagcdn.com/w40/pl.png",
3000
+ phoneCode: "+48"
3001
+ },
3002
+ {
3003
+ name: "Portugal",
3004
+ code: "PT",
3005
+ flagEmoji: "🇵🇹",
3006
+ flagSvg: "https://flagcdn.com/pt.svg",
3007
+ flagPng: "https://flagcdn.com/w40/pt.png",
3008
+ phoneCode: "+351"
3009
+ },
3010
+ {
3011
+ name: "Puerto Rico",
3012
+ code: "PR",
3013
+ flagEmoji: "🇵🇷",
3014
+ flagSvg: "https://flagcdn.com/pr.svg",
3015
+ flagPng: "https://flagcdn.com/w40/pr.png",
3016
+ phoneCode: "+1787"
3017
+ },
3018
+ {
3019
+ name: "Qatar",
3020
+ code: "QA",
3021
+ flagEmoji: "🇶🇦",
3022
+ flagSvg: "https://flagcdn.com/qa.svg",
3023
+ flagPng: "https://flagcdn.com/w40/qa.png",
3024
+ phoneCode: "+974"
3025
+ },
3026
+ {
3027
+ name: "Réunion",
3028
+ code: "RE",
3029
+ flagEmoji: "🇷🇪",
3030
+ flagSvg: "https://flagcdn.com/re.svg",
3031
+ flagPng: "https://flagcdn.com/w40/re.png",
3032
+ phoneCode: "+262"
3033
+ },
3034
+ {
3035
+ name: "Romania",
3036
+ code: "RO",
3037
+ flagEmoji: "🇷🇴",
3038
+ flagSvg: "https://flagcdn.com/ro.svg",
3039
+ flagPng: "https://flagcdn.com/w40/ro.png",
3040
+ phoneCode: "+40"
3041
+ },
3042
+ {
3043
+ name: "Russian Federation",
3044
+ code: "RU",
3045
+ flagEmoji: "🇷🇺",
3046
+ flagSvg: "https://flagcdn.com/ru.svg",
3047
+ flagPng: "https://flagcdn.com/w40/ru.png",
3048
+ phoneCode: "+7"
3049
+ },
3050
+ {
3051
+ name: "Rwanda",
3052
+ code: "RW",
3053
+ flagEmoji: "🇷🇼",
3054
+ flagSvg: "https://flagcdn.com/rw.svg",
3055
+ flagPng: "https://flagcdn.com/w40/rw.png",
3056
+ phoneCode: "+250"
3057
+ },
3058
+ {
3059
+ name: "Saint Barthélemy",
3060
+ code: "BL",
3061
+ flagEmoji: "🇧🇱",
3062
+ flagSvg: "https://flagcdn.com/bl.svg",
3063
+ flagPng: "https://flagcdn.com/w40/bl.png",
3064
+ phoneCode: "+590"
3065
+ },
3066
+ {
3067
+ name: "Saint Helena, Ascension and Tristan da Cunha",
3068
+ code: "SH",
3069
+ flagEmoji: "🇸🇭",
3070
+ flagSvg: "https://flagcdn.com/sh.svg",
3071
+ flagPng: "https://flagcdn.com/w40/sh.png",
3072
+ phoneCode: "+290"
3073
+ },
3074
+ {
3075
+ name: "Saint Kitts and Nevis",
3076
+ code: "KN",
3077
+ flagEmoji: "🇰🇳",
3078
+ flagSvg: "https://flagcdn.com/kn.svg",
3079
+ flagPng: "https://flagcdn.com/w40/kn.png",
3080
+ phoneCode: "+1869"
3081
+ },
3082
+ {
3083
+ name: "Saint Lucia",
3084
+ code: "LC",
3085
+ flagEmoji: "🇱🇨",
3086
+ flagSvg: "https://flagcdn.com/lc.svg",
3087
+ flagPng: "https://flagcdn.com/w40/lc.png",
3088
+ phoneCode: "+1758"
3089
+ },
3090
+ {
3091
+ name: "Saint Martin (French part)",
3092
+ code: "MF",
3093
+ flagEmoji: "🇲🇫",
3094
+ flagSvg: "https://flagcdn.com/mf.svg",
3095
+ flagPng: "https://flagcdn.com/w40/mf.png",
3096
+ phoneCode: "+590"
3097
+ },
3098
+ {
3099
+ name: "Saint Pierre and Miquelon",
3100
+ code: "PM",
3101
+ flagEmoji: "🇵🇲",
3102
+ flagSvg: "https://flagcdn.com/pm.svg",
3103
+ flagPng: "https://flagcdn.com/w40/pm.png",
3104
+ phoneCode: "+508"
3105
+ },
3106
+ {
3107
+ name: "Saint Vincent and the Grenadines",
3108
+ code: "VC",
3109
+ flagEmoji: "🇻🇨",
3110
+ flagSvg: "https://flagcdn.com/vc.svg",
3111
+ flagPng: "https://flagcdn.com/w40/vc.png",
3112
+ phoneCode: "+1784"
3113
+ },
3114
+ {
3115
+ name: "Samoa",
3116
+ code: "WS",
3117
+ flagEmoji: "🇼🇸",
3118
+ flagSvg: "https://flagcdn.com/ws.svg",
3119
+ flagPng: "https://flagcdn.com/w40/ws.png",
3120
+ phoneCode: "+685"
3121
+ },
3122
+ {
3123
+ name: "San Marino",
3124
+ code: "SM",
3125
+ flagEmoji: "🇸🇲",
3126
+ flagSvg: "https://flagcdn.com/sm.svg",
3127
+ flagPng: "https://flagcdn.com/w40/sm.png",
3128
+ phoneCode: "+378"
3129
+ },
3130
+ {
3131
+ name: "Sao Tome and Principe",
3132
+ code: "ST",
3133
+ flagEmoji: "🇸🇹",
3134
+ flagSvg: "https://flagcdn.com/st.svg",
3135
+ flagPng: "https://flagcdn.com/w40/st.png",
3136
+ phoneCode: "+239"
3137
+ },
3138
+ {
3139
+ name: "Saudi Arabia",
3140
+ code: "SA",
3141
+ flagEmoji: "🇸🇦",
3142
+ flagSvg: "https://flagcdn.com/sa.svg",
3143
+ flagPng: "https://flagcdn.com/w40/sa.png",
3144
+ phoneCode: "+966"
3145
+ },
3146
+ {
3147
+ name: "Senegal",
3148
+ code: "SN",
3149
+ flagEmoji: "🇸🇳",
3150
+ flagSvg: "https://flagcdn.com/sn.svg",
3151
+ flagPng: "https://flagcdn.com/w40/sn.png",
3152
+ phoneCode: "+221"
3153
+ },
3154
+ {
3155
+ name: "Serbia",
3156
+ code: "RS",
3157
+ flagEmoji: "🇷🇸",
3158
+ flagSvg: "https://flagcdn.com/rs.svg",
3159
+ flagPng: "https://flagcdn.com/w40/rs.png",
3160
+ phoneCode: "+381"
3161
+ },
3162
+ {
3163
+ name: "Seychelles",
3164
+ code: "SC",
3165
+ flagEmoji: "🇸🇨",
3166
+ flagSvg: "https://flagcdn.com/sc.svg",
3167
+ flagPng: "https://flagcdn.com/w40/sc.png",
3168
+ phoneCode: "+248"
3169
+ },
3170
+ {
3171
+ name: "Sierra Leone",
3172
+ code: "SL",
3173
+ flagEmoji: "🇸🇱",
3174
+ flagSvg: "https://flagcdn.com/sl.svg",
3175
+ flagPng: "https://flagcdn.com/w40/sl.png",
3176
+ phoneCode: "+232"
3177
+ },
3178
+ {
3179
+ name: "Singapore",
3180
+ code: "SG",
3181
+ flagEmoji: "🇸🇬",
3182
+ flagSvg: "https://flagcdn.com/sg.svg",
3183
+ flagPng: "https://flagcdn.com/w40/sg.png",
3184
+ phoneCode: "+65"
3185
+ },
3186
+ {
3187
+ name: "Sint Maarten (Dutch part)",
3188
+ code: "SX",
3189
+ flagEmoji: "🇸🇽",
3190
+ flagSvg: "https://flagcdn.com/sx.svg",
3191
+ flagPng: "https://flagcdn.com/w40/sx.png",
3192
+ phoneCode: "+1721"
3193
+ },
3194
+ {
3195
+ name: "Slovakia",
3196
+ code: "SK",
3197
+ flagEmoji: "🇸🇰",
3198
+ flagSvg: "https://flagcdn.com/sk.svg",
3199
+ flagPng: "https://flagcdn.com/w40/sk.png",
3200
+ phoneCode: "+421"
3201
+ },
3202
+ {
3203
+ name: "Slovenia",
3204
+ code: "SI",
3205
+ flagEmoji: "🇸🇮",
3206
+ flagSvg: "https://flagcdn.com/si.svg",
3207
+ flagPng: "https://flagcdn.com/w40/si.png",
3208
+ phoneCode: "+386"
3209
+ },
3210
+ {
3211
+ name: "Solomon Islands",
3212
+ code: "SB",
3213
+ flagEmoji: "🇸🇧",
3214
+ flagSvg: "https://flagcdn.com/sb.svg",
3215
+ flagPng: "https://flagcdn.com/w40/sb.png",
3216
+ phoneCode: "+677"
3217
+ },
3218
+ {
3219
+ name: "Somalia",
3220
+ code: "SO",
3221
+ flagEmoji: "🇸🇴",
3222
+ flagSvg: "https://flagcdn.com/so.svg",
3223
+ flagPng: "https://flagcdn.com/w40/so.png",
3224
+ phoneCode: "+252"
3225
+ },
3226
+ {
3227
+ name: "South Africa",
3228
+ code: "ZA",
3229
+ flagEmoji: "🇿🇦",
3230
+ flagSvg: "https://flagcdn.com/za.svg",
3231
+ flagPng: "https://flagcdn.com/w40/za.png",
3232
+ phoneCode: "+27"
3233
+ },
3234
+ {
3235
+ name: "South Georgia and the South Sandwich Islands",
3236
+ code: "GS",
3237
+ flagEmoji: "🇬🇸",
3238
+ flagSvg: "https://flagcdn.com/gs.svg",
3239
+ flagPng: "https://flagcdn.com/w40/gs.png",
3240
+ phoneCode: "+500"
3241
+ },
3242
+ {
3243
+ name: "South Sudan",
3244
+ code: "SS",
3245
+ flagEmoji: "🇸🇸",
3246
+ flagSvg: "https://flagcdn.com/ss.svg",
3247
+ flagPng: "https://flagcdn.com/w40/ss.png",
3248
+ phoneCode: "+211"
3249
+ },
3250
+ {
3251
+ name: "Spain",
3252
+ code: "ES",
3253
+ flagEmoji: "🇪🇸",
3254
+ flagSvg: "https://flagcdn.com/es.svg",
3255
+ flagPng: "https://flagcdn.com/w40/es.png",
3256
+ phoneCode: "+34"
3257
+ },
3258
+ {
3259
+ name: "Sri Lanka",
3260
+ code: "LK",
3261
+ flagEmoji: "🇱🇰",
3262
+ flagSvg: "https://flagcdn.com/lk.svg",
3263
+ flagPng: "https://flagcdn.com/w40/lk.png",
3264
+ phoneCode: "+94"
3265
+ },
3266
+ {
3267
+ name: "Sudan",
3268
+ code: "SD",
3269
+ flagEmoji: "🇸🇩",
3270
+ flagSvg: "https://flagcdn.com/sd.svg",
3271
+ flagPng: "https://flagcdn.com/w40/sd.png",
3272
+ phoneCode: "+249"
3273
+ },
3274
+ {
3275
+ name: "Suriname",
3276
+ code: "SR",
3277
+ flagEmoji: "🇸🇷",
3278
+ flagSvg: "https://flagcdn.com/sr.svg",
3279
+ flagPng: "https://flagcdn.com/w40/sr.png",
3280
+ phoneCode: "+597"
3281
+ },
3282
+ {
3283
+ name: "Svalbard and Jan Mayen",
3284
+ code: "SJ",
3285
+ flagEmoji: "🇸🇯",
3286
+ flagSvg: "https://flagcdn.com/sj.svg",
3287
+ flagPng: "https://flagcdn.com/w40/sj.png",
3288
+ phoneCode: "+47"
3289
+ },
3290
+ {
3291
+ name: "Sweden",
3292
+ code: "SE",
3293
+ flagEmoji: "🇸🇪",
3294
+ flagSvg: "https://flagcdn.com/se.svg",
3295
+ flagPng: "https://flagcdn.com/w40/se.png",
3296
+ phoneCode: "+46"
3297
+ },
3298
+ {
3299
+ name: "Switzerland",
3300
+ code: "CH",
3301
+ flagEmoji: "🇨🇭",
3302
+ flagSvg: "https://flagcdn.com/ch.svg",
3303
+ flagPng: "https://flagcdn.com/w40/ch.png",
3304
+ phoneCode: "+41"
3305
+ },
3306
+ {
3307
+ name: "Syrian Arab Republic",
3308
+ code: "SY",
3309
+ flagEmoji: "🇸🇾",
3310
+ flagSvg: "https://flagcdn.com/sy.svg",
3311
+ flagPng: "https://flagcdn.com/w40/sy.png",
3312
+ phoneCode: "+963"
3313
+ },
3314
+ {
3315
+ name: "Taiwan, Province of China",
3316
+ code: "TW",
3317
+ flagEmoji: "🇹🇼",
3318
+ flagSvg: "https://flagcdn.com/tw.svg",
3319
+ flagPng: "https://flagcdn.com/w40/tw.png",
3320
+ phoneCode: "+886"
3321
+ },
3322
+ {
3323
+ name: "Tajikistan",
3324
+ code: "TJ",
3325
+ flagEmoji: "🇹🇯",
3326
+ flagSvg: "https://flagcdn.com/tj.svg",
3327
+ flagPng: "https://flagcdn.com/w40/tj.png",
3328
+ phoneCode: "+992"
3329
+ },
3330
+ {
3331
+ name: "Tanzania, United Republic of",
3332
+ code: "TZ",
3333
+ flagEmoji: "🇹🇿",
3334
+ flagSvg: "https://flagcdn.com/tz.svg",
3335
+ flagPng: "https://flagcdn.com/w40/tz.png",
3336
+ phoneCode: "+255"
3337
+ },
3338
+ {
3339
+ name: "Thailand",
3340
+ code: "TH",
3341
+ flagEmoji: "🇹🇭",
3342
+ flagSvg: "https://flagcdn.com/th.svg",
3343
+ flagPng: "https://flagcdn.com/w40/th.png",
3344
+ phoneCode: "+66"
3345
+ },
3346
+ {
3347
+ name: "Timor-Leste",
3348
+ code: "TL",
3349
+ flagEmoji: "🇹🇱",
3350
+ flagSvg: "https://flagcdn.com/tl.svg",
3351
+ flagPng: "https://flagcdn.com/w40/tl.png",
3352
+ phoneCode: "+670"
3353
+ },
3354
+ {
3355
+ name: "Togo",
3356
+ code: "TG",
3357
+ flagEmoji: "🇹🇬",
3358
+ flagSvg: "https://flagcdn.com/tg.svg",
3359
+ flagPng: "https://flagcdn.com/w40/tg.png",
3360
+ phoneCode: "+228"
3361
+ },
3362
+ {
3363
+ name: "Tokelau",
3364
+ code: "TK",
3365
+ flagEmoji: "🇹🇰",
3366
+ flagSvg: "https://flagcdn.com/tk.svg",
3367
+ flagPng: "https://flagcdn.com/w40/tk.png",
3368
+ phoneCode: "+690"
3369
+ },
3370
+ {
3371
+ name: "Tonga",
3372
+ code: "TO",
3373
+ flagEmoji: "🇹🇴",
3374
+ flagSvg: "https://flagcdn.com/to.svg",
3375
+ flagPng: "https://flagcdn.com/w40/to.png",
3376
+ phoneCode: "+676"
3377
+ },
3378
+ {
3379
+ name: "Trinidad and Tobago",
3380
+ code: "TT",
3381
+ flagEmoji: "🇹🇹",
3382
+ flagSvg: "https://flagcdn.com/tt.svg",
3383
+ flagPng: "https://flagcdn.com/w40/tt.png",
3384
+ phoneCode: "+1868"
3385
+ },
3386
+ {
3387
+ name: "Tunisia",
3388
+ code: "TN",
3389
+ flagEmoji: "🇹🇳",
3390
+ flagSvg: "https://flagcdn.com/tn.svg",
3391
+ flagPng: "https://flagcdn.com/w40/tn.png",
3392
+ phoneCode: "+216"
3393
+ },
3394
+ {
3395
+ name: "Turkey",
3396
+ code: "TR",
3397
+ flagEmoji: "🇹🇷",
3398
+ flagSvg: "https://flagcdn.com/tr.svg",
3399
+ flagPng: "https://flagcdn.com/w40/tr.png",
3400
+ phoneCode: "+90"
3401
+ },
3402
+ {
3403
+ name: "Turkmenistan",
3404
+ code: "TM",
3405
+ flagEmoji: "🇹🇲",
3406
+ flagSvg: "https://flagcdn.com/tm.svg",
3407
+ flagPng: "https://flagcdn.com/w40/tm.png",
3408
+ phoneCode: "+993"
3409
+ },
3410
+ {
3411
+ name: "Turks and Caicos Islands",
3412
+ code: "TC",
3413
+ flagEmoji: "🇹🇨",
3414
+ flagSvg: "https://flagcdn.com/tc.svg",
3415
+ flagPng: "https://flagcdn.com/w40/tc.png",
3416
+ phoneCode: "+1649"
3417
+ },
3418
+ {
3419
+ name: "Tuvalu",
3420
+ code: "TV",
3421
+ flagEmoji: "🇹🇻",
3422
+ flagSvg: "https://flagcdn.com/tv.svg",
3423
+ flagPng: "https://flagcdn.com/w40/tv.png",
3424
+ phoneCode: "+688"
3425
+ },
3426
+ {
3427
+ name: "Uganda",
3428
+ code: "UG",
3429
+ flagEmoji: "🇺🇬",
3430
+ flagSvg: "https://flagcdn.com/ug.svg",
3431
+ flagPng: "https://flagcdn.com/w40/ug.png",
3432
+ phoneCode: "+256"
3433
+ },
3434
+ {
3435
+ name: "Ukraine",
3436
+ code: "UA",
3437
+ flagEmoji: "🇺🇦",
3438
+ flagSvg: "https://flagcdn.com/ua.svg",
3439
+ flagPng: "https://flagcdn.com/w40/ua.png",
3440
+ phoneCode: "+380"
3441
+ },
3442
+ {
3443
+ name: "United Arab Emirates",
3444
+ code: "AE",
3445
+ flagEmoji: "🇦🇪",
3446
+ flagSvg: "https://flagcdn.com/ae.svg",
3447
+ flagPng: "https://flagcdn.com/w40/ae.png",
3448
+ phoneCode: "+971"
3449
+ },
3450
+ {
3451
+ name: "United Kingdom of Great Britain and Northern Ireland",
3452
+ code: "GB",
3453
+ flagEmoji: "🇬🇧",
3454
+ flagSvg: "https://flagcdn.com/gb.svg",
3455
+ flagPng: "https://flagcdn.com/w40/gb.png",
3456
+ phoneCode: "+44"
3457
+ },
3458
+ {
3459
+ name: "United States",
3460
+ code: "US",
3461
+ flagEmoji: "🇺🇸",
3462
+ flagSvg: "https://flagcdn.com/us.svg",
3463
+ flagPng: "https://flagcdn.com/w40/us.png",
3464
+ phoneCode: "+1"
3465
+ },
3466
+ {
3467
+ name: "United States Minor Outlying Islands",
3468
+ code: "UM",
3469
+ flagEmoji: "🇺🇲",
3470
+ flagSvg: "https://flagcdn.com/um.svg",
3471
+ flagPng: "https://flagcdn.com/w40/um.png",
3472
+ phoneCode: "+1"
3473
+ },
3474
+ {
3475
+ name: "Uruguay",
3476
+ code: "UY",
3477
+ flagEmoji: "🇺🇾",
3478
+ flagSvg: "https://flagcdn.com/uy.svg",
3479
+ flagPng: "https://flagcdn.com/w40/uy.png",
3480
+ phoneCode: "+598"
3481
+ },
3482
+ {
3483
+ name: "Uzbekistan",
3484
+ code: "UZ",
3485
+ flagEmoji: "🇺🇿",
3486
+ flagSvg: "https://flagcdn.com/uz.svg",
3487
+ flagPng: "https://flagcdn.com/w40/uz.png",
3488
+ phoneCode: "+998"
3489
+ },
3490
+ {
3491
+ name: "Vanuatu",
3492
+ code: "VU",
3493
+ flagEmoji: "🇻🇺",
3494
+ flagSvg: "https://flagcdn.com/vu.svg",
3495
+ flagPng: "https://flagcdn.com/w40/vu.png",
3496
+ phoneCode: "+678"
3497
+ },
3498
+ {
3499
+ name: "Venezuela (Bolivarian Republic of)",
3500
+ code: "VE",
3501
+ flagEmoji: "🇻🇪",
3502
+ flagSvg: "https://flagcdn.com/ve.svg",
3503
+ flagPng: "https://flagcdn.com/w40/ve.png",
3504
+ phoneCode: "+58"
3505
+ },
3506
+ {
3507
+ name: "Viet Nam",
3508
+ code: "VN",
3509
+ flagEmoji: "🇻🇳",
3510
+ flagSvg: "https://flagcdn.com/vn.svg",
3511
+ flagPng: "https://flagcdn.com/w40/vn.png",
3512
+ phoneCode: "+84"
3513
+ },
3514
+ {
3515
+ name: "Virgin Islands (British)",
3516
+ code: "VG",
3517
+ flagEmoji: "🇻🇬",
3518
+ flagSvg: "https://flagcdn.com/vg.svg",
3519
+ flagPng: "https://flagcdn.com/w40/vg.png",
3520
+ phoneCode: "+1284"
3521
+ },
3522
+ {
3523
+ name: "Virgin Islands (U.S.)",
3524
+ code: "VI",
3525
+ flagEmoji: "🇻🇮",
3526
+ flagSvg: "https://flagcdn.com/vi.svg",
3527
+ flagPng: "https://flagcdn.com/w40/vi.png",
3528
+ phoneCode: "+1340"
3529
+ },
3530
+ {
3531
+ name: "Wallis and Futuna",
3532
+ code: "WF",
3533
+ flagEmoji: "🇼🇫",
3534
+ flagSvg: "https://flagcdn.com/wf.svg",
3535
+ flagPng: "https://flagcdn.com/w40/wf.png",
3536
+ phoneCode: "+681"
3537
+ },
3538
+ {
3539
+ name: "Western Sahara",
3540
+ code: "EH",
3541
+ flagEmoji: "🇪🇭",
3542
+ flagSvg: "https://flagcdn.com/eh.svg",
3543
+ flagPng: "https://flagcdn.com/w40/eh.png",
3544
+ phoneCode: "+212"
3545
+ },
3546
+ {
3547
+ name: "Yemen",
3548
+ code: "YE",
3549
+ flagEmoji: "🇾🇪",
3550
+ flagSvg: "https://flagcdn.com/ye.svg",
3551
+ flagPng: "https://flagcdn.com/w40/ye.png",
3552
+ phoneCode: "+967"
3553
+ },
3554
+ {
3555
+ name: "Zambia",
3556
+ code: "ZM",
3557
+ flagEmoji: "🇿🇲",
3558
+ flagSvg: "https://flagcdn.com/zm.svg",
3559
+ flagPng: "https://flagcdn.com/w40/zm.png",
3560
+ phoneCode: "+260"
3561
+ },
3562
+ {
3563
+ name: "Zimbabwe",
3564
+ code: "ZW",
3565
+ flagEmoji: "🇿🇼",
3566
+ flagSvg: "https://flagcdn.com/zw.svg",
3567
+ flagPng: "https://flagcdn.com/w40/zw.png",
3568
+ phoneCode: "+263"
3569
+ }
3570
+ ], It = ["tabindex"], $t = { class: "flex items-center gap-2" }, Tt = ["src", "alt"], Bt = {
3571
+ key: 0,
3572
+ class: "absolute z-[9999] w-full mt-1 bg-white border border-gray-300 rounded-md shadow-lg max-h-60 overflow-y-auto",
3573
+ style: { position: "absolute" }
3574
+ }, Xt = ["onClick"], Lt = ["src", "alt", "onError"], Vt = /* @__PURE__ */ V({
3575
+ __name: "index",
3576
+ props: {
3577
+ modelValue: { default: "" },
3578
+ placeholder: { default: "" },
3579
+ disabled: { type: Boolean, default: !1 },
3580
+ required: { type: Boolean, default: !1 },
3581
+ customClass: { default: "" },
3582
+ autoDetectFromIp: { type: Boolean, default: !0 },
3583
+ returnType: { default: "name" },
3584
+ priorityCountries: { default: () => ["US", "CA", "GB", "DE", "FR", "JP", "CN", "AU"] },
3585
+ ipDetectUrl: { default: "https://ipinfo.io/json" },
3586
+ ipDetectMethod: { default: "GET" },
3587
+ ipDetectHeaders: {},
3588
+ ipDetectResponseParser: {}
3589
+ },
3590
+ emits: ["update:modelValue", "change", "ip-detect-start", "ip-detect-success", "ip-detect-error"],
3591
+ setup(e, { expose: o, emit: a }) {
3592
+ const n = e, t = a, l = $(!1), s = $(At), g = X(() => n.modelValue ? s.value.find(
3593
+ (r) => n.returnType === "code" ? r.code === n.modelValue : r.name === n.modelValue
3594
+ ) : null), h = X(() => {
3595
+ const r = s.value.filter(
3596
+ (C) => n.priorityCountries.includes(C.code)
3597
+ ), f = s.value.filter(
3598
+ (C) => !n.priorityCountries.includes(C.code)
3599
+ ), S = r.sort((C, w) => {
3600
+ const I = n.priorityCountries.indexOf(C.code), k = n.priorityCountries.indexOf(w.code);
3601
+ return I - k;
3602
+ }), P = f.sort((C, w) => C.name.localeCompare(w.name));
3603
+ return [...S, ...P];
3604
+ }), c = () => {
3605
+ n.disabled || (l.value = !l.value);
3606
+ }, i = () => {
3607
+ l.value = !1;
3608
+ }, p = (r) => {
3609
+ if (r) {
3610
+ const f = n.returnType === "code" ? r.code : r.name;
3611
+ t("update:modelValue", f), t("change", f, r);
3612
+ } else
3613
+ t("update:modelValue", "");
3614
+ i();
3615
+ }, b = (r, f) => {
3616
+ const S = r.target;
3617
+ f && S.src === f.flagSvg ? S.src = f.flagPng : g.value && S.src === g.value.flagSvg && (S.src = g.value.flagPng);
3618
+ }, d = async () => {
3619
+ if (!(!n.autoDetectFromIp || n.modelValue)) {
3620
+ t("ip-detect-start");
3621
+ try {
3622
+ const r = {
3623
+ method: n.ipDetectMethod,
3624
+ headers: {
3625
+ "Content-Type": "application/json",
3626
+ ...n.ipDetectHeaders
3627
+ }
3628
+ }, f = await fetch(n.ipDetectUrl, r);
3629
+ if (!f.ok)
3630
+ throw new Error(`HTTP error! status: ${f.status}`);
3631
+ const S = await f.json();
3632
+ let P;
3633
+ if (n.ipDetectResponseParser ? P = n.ipDetectResponseParser(S) : P = S.country || S.countryCode || S.country_code || "", P = P.toUpperCase(), !P)
3634
+ throw new Error("Country code not found in response");
3635
+ console.log("Auto-detected country from IP:", P), t("ip-detect-success", P);
3636
+ const C = s.value.find(
3637
+ (w) => w.code === P
3638
+ );
3639
+ if (C) {
3640
+ const w = n.returnType === "code" ? C.code : C.name;
3641
+ t("update:modelValue", w), t("change", w, C);
3642
+ } else
3643
+ console.warn("Detected country code not found in country list:", P);
3644
+ } catch (r) {
3645
+ const f = r instanceof Error ? r : new Error(String(r));
3646
+ console.warn("Failed to detect country from IP:", f), t("ip-detect-error", f);
3647
+ }
3648
+ }
3649
+ }, j = $();
3650
+ return se(async () => {
3651
+ await _(), n.autoDetectFromIp && !n.modelValue && await d();
3652
+ const r = (f) => {
3653
+ j.value && !j.value.contains(f.target) && i();
3654
+ };
3655
+ document.addEventListener("click", r), Ve(() => {
3656
+ document.removeEventListener("click", r);
3657
+ });
3658
+ }), o({
3659
+ detectCountryFromIp: d,
3660
+ allCountries: Se(s),
3661
+ sortedCountries: Se(h)
3662
+ }), (r, f) => (u(), v("div", {
3663
+ ref_key: "containerRef",
3664
+ ref: j,
3665
+ class: "country-select-container relative"
3666
+ }, [
3667
+ y("div", {
3668
+ onClick: c,
3669
+ class: B([
3670
+ "w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-[#1a1a1a] focus:border-[#1a1a1a] transition-colors duration-200 cursor-pointer bg-white flex items-center justify-between",
3671
+ e.customClass,
3672
+ { "opacity-60 cursor-not-allowed": e.disabled }
3673
+ ]),
3674
+ tabindex: e.disabled ? -1 : 0,
3675
+ onKeydown: [
3676
+ O(c, ["enter"]),
3677
+ O(c, ["space"]),
3678
+ O(i, ["escape"])
3679
+ ]
3680
+ }, [
3681
+ y("div", $t, [
3682
+ g.value ? (u(), v("img", {
3683
+ key: 0,
3684
+ src: g.value.flagSvg,
3685
+ alt: g.value.name,
3686
+ class: "w-5 h-4 object-cover rounded-sm",
3687
+ onError: b
3688
+ }, null, 40, Tt)) : A("", !0),
3689
+ y("span", {
3690
+ class: B({ "text-gray-500": !g.value && e.placeholder })
3691
+ }, T(g.value ? g.value.name : e.placeholder || "选择国家"), 3)
3692
+ ]),
3693
+ (u(), v("svg", {
3694
+ class: B(["w-5 h-5 text-gray-400 transition-transform duration-200", { "rotate-180": l.value }]),
3695
+ fill: "none",
3696
+ stroke: "currentColor",
3697
+ viewBox: "0 0 24 24"
3698
+ }, [...f[0] || (f[0] = [
3699
+ y("path", {
3700
+ "stroke-linecap": "round",
3701
+ "stroke-linejoin": "round",
3702
+ "stroke-width": "2",
3703
+ d: "M19 9l-7 7-7-7"
3704
+ }, null, -1)
3705
+ ])], 2))
3706
+ ], 42, It),
3707
+ l.value && !e.disabled ? (u(), v("div", Bt, [
3708
+ (u(!0), v(z, null, D(h.value, (S) => {
3709
+ var P;
3710
+ return u(), v("div", {
3711
+ key: S.code,
3712
+ onClick: (C) => p(S),
3713
+ class: B(["px-3 py-2 hover:bg-gray-50 cursor-pointer flex items-center gap-2 transition-colors", { "bg-gray-100": ((P = g.value) == null ? void 0 : P.code) === S.code }])
3714
+ }, [
3715
+ y("img", {
3716
+ src: S.flagSvg,
3717
+ alt: S.name,
3718
+ class: "w-5 h-4 object-cover rounded-sm flex-shrink-0",
3719
+ onError: (C) => b(C, S)
3720
+ }, null, 40, Lt),
3721
+ y("span", null, T(S.name), 1)
3722
+ ], 10, Xt);
3723
+ }), 128))
3724
+ ])) : A("", !0),
3725
+ l.value && !e.disabled ? (u(), v("div", {
3726
+ key: 1,
3727
+ class: "fixed inset-0 z-[9998]",
3728
+ onClick: i
3729
+ })) : A("", !0)
3730
+ ], 512));
3731
+ }
3732
+ }), Xo = /* @__PURE__ */ F(Vt, [["__scopeId", "data-v-08b31f1b"]]), zt = ["tabindex", "aria-expanded", "aria-labelledby"], Ft = { class: "flex items-center gap-2 min-h-0 flex-1" }, Ot = {
3733
+ key: 0,
3734
+ class: "text-gray-500"
3735
+ }, Rt = {
3736
+ key: 1,
3737
+ class: "flex flex-wrap gap-1"
3738
+ }, Dt = {
3739
+ key: 0,
3740
+ class: "text-gray-900"
3741
+ }, _t = ["onClick"], Nt = {
3742
+ key: 0,
3743
+ class: "absolute z-[9999] w-full mt-2 bg-white rounded-xl shadow-xl border border-gray-100/50 max-h-60 overflow-auto backdrop-blur-sm",
3744
+ role: "listbox"
3745
+ }, Gt = {
3746
+ key: 0,
3747
+ class: "p-3 border-b border-gray-50/80"
3748
+ }, Wt = { class: "py-1" }, Kt = {
3749
+ key: 0,
3750
+ class: "px-4 py-3 text-sm text-gray-400 text-center"
3751
+ }, Ht = ["onClick", "onKeydown", "aria-selected"], qt = { class: "flex items-center gap-3" }, Ut = {
3752
+ key: 0,
3753
+ class: "flex items-center"
3754
+ }, Yt = {
3755
+ key: 0,
3756
+ class: "bi bi-check text-[#1a1a1a] text-xs"
3757
+ }, Qt = {
3758
+ key: 1,
3759
+ class: "flex items-center"
3760
+ }, Zt = {
3761
+ key: 0,
3762
+ class: "w-1.5 h-1.5 bg-white rounded-full"
3763
+ }, Jt = { class: "flex-1" }, eo = /* @__PURE__ */ V({
3764
+ __name: "index",
3765
+ props: {
3766
+ modelValue: {},
3767
+ options: {},
3768
+ placeholder: { default: "请选择..." },
3769
+ multiple: { type: Boolean, default: !1 },
3770
+ searchable: { type: Boolean, default: !1 },
3771
+ disabled: { type: Boolean, default: !1 },
3772
+ labelKey: { default: "label" },
3773
+ valueKey: { default: "value" },
3774
+ noOptionsText: { default: "暂无选项" },
3775
+ clearable: { type: Boolean, default: !1 },
3776
+ borderless: { type: Boolean, default: !1 },
3777
+ width: { default: "200px" }
3778
+ },
3779
+ emits: ["update:modelValue", "change", "open", "close"],
3780
+ setup(e, { expose: o, emit: a }) {
3781
+ const n = e, t = a, l = $(!1), s = $(""), g = $(), h = $(), c = X(() => !n.searchable || !s.value ? n.options : n.options.filter(
3782
+ (m) => j(m).toLowerCase().includes(s.value.toLowerCase())
3783
+ )), i = X(() => n.multiple ? null : n.options.find((m) => r(m) === n.modelValue) || null), p = X(() => n.multiple ? Array.isArray(n.modelValue) ? n.options.filter(
3784
+ (m) => n.modelValue.includes(r(m))
3785
+ ) : [] : []), b = X(() => n.multiple ? p.value.length > 0 : i.value !== null), d = X(() => `select-label-${Math.random().toString(36).substr(2, 9)}`), j = (m) => typeof m == "object" ? m[n.labelKey] : m, r = (m) => typeof m == "object" ? m[n.valueKey] : m, f = (m) => {
3786
+ const E = r(m);
3787
+ return n.multiple ? Array.isArray(n.modelValue) && n.modelValue.includes(E) : n.modelValue === E;
3788
+ }, S = (m) => {
3789
+ if (m.disabled) return;
3790
+ const E = r(m);
3791
+ if (n.multiple) {
3792
+ const x = Array.isArray(n.modelValue) ? [...n.modelValue] : [], M = x.indexOf(E);
3793
+ M > -1 ? x.splice(M, 1) : x.push(E), t("update:modelValue", x), t("change", x);
3794
+ } else
3795
+ t("update:modelValue", E), t("change", E), I();
3796
+ }, P = (m) => {
3797
+ if (!n.multiple) return;
3798
+ const E = r(m), x = Array.isArray(n.modelValue) ? [...n.modelValue] : [], M = x.indexOf(E);
3799
+ M > -1 && (x.splice(M, 1), t("update:modelValue", x), t("change", x));
3800
+ }, C = () => {
3801
+ n.disabled || (l.value ? I() : w());
3802
+ }, w = () => {
3803
+ l.value = !0, t("open"), _(() => {
3804
+ n.searchable && h.value && h.value.focus();
3805
+ });
3806
+ }, I = () => {
3807
+ l.value = !1, s.value = "", t("close");
3808
+ }, k = (m) => {
3809
+ g.value && !g.value.contains(m.target) && I();
3810
+ }, L = (m) => {
3811
+ if (!l.value) return;
3812
+ const E = c.value, x = E.findIndex((M) => f(M));
3813
+ switch (m.key) {
3814
+ case "ArrowDown":
3815
+ m.preventDefault();
3816
+ break;
3817
+ case "ArrowUp":
3818
+ m.preventDefault();
3819
+ break;
3820
+ case "Enter":
3821
+ case " ":
3822
+ m.preventDefault(), x >= 0 && E[x] && S(E[x]);
3823
+ break;
3824
+ }
3825
+ };
3826
+ return se(() => {
3827
+ document.addEventListener("click", k), document.addEventListener("keydown", L);
3828
+ }), Ve(() => {
3829
+ document.removeEventListener("click", k), document.removeEventListener("keydown", L);
3830
+ }), o({
3831
+ open: w,
3832
+ close: I,
3833
+ toggle: C
3834
+ }), (m, E) => (u(), v("div", {
3835
+ class: "relative",
3836
+ style: G({ width: e.width }),
3837
+ ref_key: "selectContainer",
3838
+ ref: g
3839
+ }, [
3840
+ y("div", {
3841
+ onClick: C,
3842
+ onKeydown: [
3843
+ O(C, ["enter"]),
3844
+ O(C, ["space"]),
3845
+ O(I, ["escape"])
3846
+ ],
3847
+ class: B([
3848
+ "flex items-center justify-between w-full px-4 py-1.5 text-sm bg-white rounded-md cursor-pointer transition-all duration-200 border ",
3849
+ "focus:outline-none focus:ring-2 focus:ring-[#1a1a1a]/50 focus:ring-offset-1",
3850
+ {
3851
+ "shadow-sm hover:shadow-md border border-gray-200/60 hover:border-gray-300/80": !e.disabled && !e.borderless,
3852
+ "shadow-sm hover:shadow-md": !e.disabled && e.borderless,
3853
+ "bg-gray-50/50 cursor-not-allowed border border-gray-100": e.disabled,
3854
+ "ring-1 ring-[#1a1a1a]/50 border-[#1a1a1a]/50 shadow-md": l.value && !e.borderless,
3855
+ "ring-1 ring-[#1a1a1a]/50 shadow-md": l.value && e.borderless
3856
+ }
3857
+ ]),
3858
+ tabindex: e.disabled ? -1 : 0,
3859
+ role: "combobox",
3860
+ "aria-expanded": l.value,
3861
+ "aria-haspopup": !0,
3862
+ "aria-labelledby": d.value
3863
+ }, [
3864
+ y("div", Ft, [
3865
+ e.placeholder && !b.value ? (u(), v("span", Ot, T(e.placeholder), 1)) : (u(), v("div", Rt, [
3866
+ e.multiple ? (u(!0), v(z, { key: 1 }, D(p.value, (x) => (u(), v("span", {
3867
+ key: r(x),
3868
+ class: "inline-flex items-center gap-1.5 px-2.5 py-1 text-xs bg-[#FFF] text-[#1a1a1a] rounded-full border border-[#1a1a1a]/50"
3869
+ }, [
3870
+ ze(T(j(x)) + " ", 1),
3871
+ y("button", {
3872
+ onClick: H((M) => P(x), ["stop"]),
3873
+ class: "rounded-full p-0.5 transition-colors duration-150",
3874
+ type: "button"
3875
+ }, [...E[1] || (E[1] = [
3876
+ y("i", { class: "bi bi-x text-xs text-[#1a1a1a]" }, null, -1)
3877
+ ])], 8, _t)
3878
+ ]))), 128)) : (u(), v(z, { key: 0 }, [
3879
+ i.value ? (u(), v("span", Dt, T(j(i.value)), 1)) : A("", !0)
3880
+ ], 64))
3881
+ ]))
3882
+ ]),
3883
+ y("i", {
3884
+ class: B([
3885
+ "bi text-gray-400 transition-transform duration-200 text-lg",
3886
+ {
3887
+ "bi-chevron-down": !l.value,
3888
+ "bi-chevron-up": l.value
3889
+ }
3890
+ ])
3891
+ }, null, 2)
3892
+ ], 42, zt),
3893
+ R(pe, {
3894
+ "enter-active-class": "transition ease-out duration-200",
3895
+ "enter-from-class": "opacity-0 scale-95",
3896
+ "enter-to-class": "opacity-100 scale-100",
3897
+ "leave-active-class": "transition ease-in duration-150",
3898
+ "leave-from-class": "opacity-100 scale-100",
3899
+ "leave-to-class": "opacity-0 scale-95"
3900
+ }, {
3901
+ default: Z(() => [
3902
+ l.value ? (u(), v("div", Nt, [
3903
+ e.searchable ? (u(), v("div", Gt, [
3904
+ Qe(y("input", {
3905
+ ref_key: "searchInput",
3906
+ ref: h,
3907
+ "onUpdate:modelValue": E[0] || (E[0] = (x) => s.value = x),
3908
+ type: "text",
3909
+ class: "w-full px-3 py-2 text-sm bg-gray-50/50 border border-gray-200/60 rounded-lg focus:outline-none focus:ring-1 focus:ring-[#1a1a1a]/50 focus:border-[#1a1a1a]/50 transition-all duration-200",
3910
+ placeholder: "搜索...",
3911
+ onKeydown: O(I, ["escape"])
3912
+ }, null, 544), [
3913
+ [Ze, s.value]
3914
+ ])
3915
+ ])) : A("", !0),
3916
+ y("div", Wt, [
3917
+ c.value.length === 0 ? (u(), v("div", Kt, T(e.noOptionsText), 1)) : A("", !0),
3918
+ (u(!0), v(z, null, D(c.value, (x) => (u(), v("div", {
3919
+ key: r(x),
3920
+ onClick: (M) => S(x),
3921
+ onKeydown: [
3922
+ O((M) => S(x), ["enter"]),
3923
+ O((M) => S(x), ["space"])
3924
+ ],
3925
+ class: B([
3926
+ "px-4 py-3 text-sm cursor-pointer transition-all duration-150",
3927
+ {
3928
+ "bg-[#f2f2f2] text-[#1a1a1a] font-medium": f(x),
3929
+ "hover:bg-[#f2f2f2] text-gray-700": !f(x)
3930
+ }
3931
+ ]),
3932
+ role: "option",
3933
+ "aria-selected": f(x),
3934
+ tabindex: 0
3935
+ }, [
3936
+ y("div", qt, [
3937
+ e.multiple ? (u(), v("div", Ut, [
3938
+ y("div", {
3939
+ class: B([
3940
+ "w-4 h-4 rounded border flex items-center justify-center transition-all duration-150",
3941
+ {
3942
+ "border-[#1a1a1a] text-white": f(x),
3943
+ "border-gray-300 bg-white": !f(x)
3944
+ }
3945
+ ])
3946
+ }, [
3947
+ f(x) ? (u(), v("i", Yt)) : A("", !0)
3948
+ ], 2)
3949
+ ])) : (u(), v("div", Qt, [
3950
+ y("div", {
3951
+ class: B([
3952
+ "w-4 h-4 rounded-full border-2 flex items-center justify-center transition-all duration-150",
3953
+ {
3954
+ "border-[#1a1a1a] bg-[#1a1a1a]": f(x),
3955
+ "border-gray-300 bg-white": !f(x)
3956
+ }
3957
+ ])
3958
+ }, [
3959
+ f(x) ? (u(), v("div", Zt)) : A("", !0)
3960
+ ], 2)
3961
+ ])),
3962
+ y("span", Jt, T(j(x)), 1)
3963
+ ])
3964
+ ], 42, Ht))), 128))
3965
+ ])
3966
+ ])) : A("", !0)
3967
+ ]),
3968
+ _: 1
3969
+ })
3970
+ ], 4));
3971
+ }
3972
+ }), Lo = /* @__PURE__ */ F(eo, [["__scopeId", "data-v-1f7381d8"]]), no = ["type", "value", "placeholder", "disabled", "readonly", "required", "maxlength", "minlength", "autocomplete"], to = {
3973
+ key: 2,
3974
+ class: "x-input-count"
3975
+ }, oo = /* @__PURE__ */ V({
3976
+ __name: "index",
3977
+ props: {
3978
+ modelValue: {},
3979
+ type: { default: "text" },
3980
+ placeholder: { default: "" },
3981
+ label: { default: "" },
3982
+ disabled: { type: Boolean, default: !1 },
3983
+ readonly: { type: Boolean, default: !1 },
3984
+ required: { type: Boolean, default: !1 },
3985
+ clearable: { type: Boolean, default: !1 },
3986
+ showWordLimit: { type: Boolean, default: !1 },
3987
+ maxlength: {},
3988
+ minlength: {},
3989
+ autocomplete: { default: "off" },
3990
+ error: { type: Boolean, default: !1 },
3991
+ width: { default: "100%" }
3992
+ },
3993
+ emits: ["update:modelValue", "input", "change", "blur", "focus", "clear", "keydown", "keyup"],
3994
+ setup(e, { expose: o, emit: a }) {
3995
+ const n = e, t = a, l = $(), s = $(!1), g = X(() => !!n.label), h = X(() => {
3996
+ const w = n.modelValue;
3997
+ return w != null && w !== "";
3998
+ }), c = X(() => String(n.modelValue || "").length), i = (w) => {
3999
+ const k = w.target.value;
4000
+ t("update:modelValue", k), t("input", k, w);
4001
+ }, p = (w) => {
4002
+ const k = w.target.value;
4003
+ t("change", k, w);
4004
+ }, b = (w) => {
4005
+ s.value = !1, t("blur", w);
4006
+ }, d = (w) => {
4007
+ s.value = !0, t("focus", w);
4008
+ }, j = (w) => {
4009
+ t("keydown", w);
4010
+ }, r = (w) => {
4011
+ t("keyup", w);
4012
+ }, f = () => {
4013
+ var w;
4014
+ t("update:modelValue", ""), t("clear"), (w = l.value) == null || w.focus();
4015
+ };
4016
+ return o({
4017
+ focus: () => {
4018
+ var w;
4019
+ (w = l.value) == null || w.focus();
4020
+ },
4021
+ blur: () => {
4022
+ var w;
4023
+ (w = l.value) == null || w.blur();
4024
+ },
4025
+ select: () => {
4026
+ var w;
4027
+ (w = l.value) == null || w.select();
4028
+ },
4029
+ ref: l
4030
+ }), (w, I) => (u(), v("div", {
4031
+ class: "x-input-group",
4032
+ style: G({ width: e.width })
4033
+ }, [
4034
+ y("input", {
4035
+ ref_key: "inputRef",
4036
+ ref: l,
4037
+ type: e.type,
4038
+ value: e.modelValue,
4039
+ placeholder: g.value ? "" : e.placeholder,
4040
+ disabled: e.disabled,
4041
+ readonly: e.readonly,
4042
+ required: e.required,
4043
+ maxlength: e.maxlength,
4044
+ minlength: e.minlength,
4045
+ autocomplete: e.autocomplete,
4046
+ class: B([
4047
+ "x-input",
4048
+ {
4049
+ "x-input--disabled": e.disabled,
4050
+ "x-input--error": e.error,
4051
+ "x-input--clearable": e.clearable && e.modelValue,
4052
+ "x-input--with-label": g.value
4053
+ }
4054
+ ]),
4055
+ onInput: i,
4056
+ onBlur: b,
4057
+ onFocus: d,
4058
+ onKeydown: j,
4059
+ onKeyup: r,
4060
+ onChange: p
4061
+ }, null, 42, no),
4062
+ e.label ? (u(), v("label", {
4063
+ key: 0,
4064
+ class: B([
4065
+ "x-input-label",
4066
+ {
4067
+ "x-input-label--active": s.value || h.value,
4068
+ "x-input-label--error": e.error
4069
+ }
4070
+ ])
4071
+ }, T(e.label), 3)) : A("", !0),
4072
+ e.clearable && e.modelValue && !e.disabled ? (u(), v("button", {
4073
+ key: 1,
4074
+ type: "button",
4075
+ class: "x-input-clear",
4076
+ onClick: f,
4077
+ onMousedown: I[0] || (I[0] = H(() => {
4078
+ }, ["prevent"]))
4079
+ }, [
4080
+ R(W(K), { icon: "bi:x-circle" })
4081
+ ], 32)) : A("", !0),
4082
+ e.showWordLimit && e.maxlength ? (u(), v("div", to, T(c.value) + " / " + T(e.maxlength), 1)) : A("", !0)
4083
+ ], 4));
4084
+ }
4085
+ }), Vo = /* @__PURE__ */ F(oo, [["__scopeId", "data-v-d7d149e3"]]), ao = { class: "x-checkboxes" }, lo = ["onClick"], so = { class: "checkbox-wrapper" }, co = ["checked", "disabled", "onChange"], go = { class: "checkbox-custom" }, io = {
4086
+ key: 0,
4087
+ class: "check-icon",
4088
+ viewBox: "0 0 24 24"
4089
+ }, fo = { class: "option-label" }, ro = /* @__PURE__ */ V({
4090
+ __name: "index",
4091
+ props: {
4092
+ options: {},
4093
+ modelValue: { default: () => [] },
4094
+ placeholder: { default: "请选择选项" },
4095
+ maxSelections: { default: 0 },
4096
+ disabled: { type: Boolean, default: !1 },
4097
+ layout: { default: "vertical" },
4098
+ columns: { default: 3 }
4099
+ },
4100
+ emits: ["update:modelValue", "change"],
4101
+ setup(e, { expose: o, emit: a }) {
4102
+ const n = e, t = a, l = (p) => n.modelValue && n.modelValue.includes(p), s = (p) => {
4103
+ if (n.disabled) return;
4104
+ const b = n.options.find((r) => r.value === p);
4105
+ if (b != null && b.disabled) return;
4106
+ const d = [...n.modelValue], j = d.indexOf(p);
4107
+ if (j > -1)
4108
+ d.splice(j, 1);
4109
+ else {
4110
+ if (n.maxSelections > 0 && d.length >= n.maxSelections)
4111
+ return;
4112
+ d.push(p);
4113
+ }
4114
+ t("update:modelValue", d), t("change", d);
4115
+ }, g = (p) => {
4116
+ !n.disabled && !p.disabled && s(p.value);
4117
+ };
4118
+ return o({
4119
+ clearAll: () => {
4120
+ n.disabled || (t("update:modelValue", []), t("change", []));
4121
+ },
4122
+ selectAll: () => {
4123
+ if (n.disabled) return;
4124
+ const b = n.options.filter((d) => !d.disabled).map((d) => d.value);
4125
+ n.maxSelections > 0 ? (t("update:modelValue", b.slice(0, n.maxSelections)), t("change", b.slice(0, n.maxSelections))) : (t("update:modelValue", b), t("change", b));
4126
+ },
4127
+ removeOption: (p) => {
4128
+ s(p);
4129
+ }
4130
+ }), (p, b) => (u(), v("div", ao, [
4131
+ y("div", {
4132
+ class: B(["options-container", [
4133
+ `options-container--${e.layout}`,
4134
+ { "options-container--disabled": e.disabled }
4135
+ ]]),
4136
+ style: G(e.layout === "grid" ? { gridTemplateColumns: `repeat(${e.columns}, 1fr)` } : {})
4137
+ }, [
4138
+ (u(!0), v(z, null, D(e.options, (d) => (u(), v("div", {
4139
+ key: d.value,
4140
+ class: B(["option-item", {
4141
+ "option-selected": l(d.value),
4142
+ "option-disabled": e.disabled || d.disabled
4143
+ }]),
4144
+ onClick: (j) => g(d)
4145
+ }, [
4146
+ y("div", so, [
4147
+ y("input", {
4148
+ type: "checkbox",
4149
+ checked: l(d.value),
4150
+ disabled: e.disabled || d.disabled,
4151
+ onChange: H((j) => s(d.value), ["stop"]),
4152
+ class: "checkbox-input"
4153
+ }, null, 40, co),
4154
+ y("div", go, [
4155
+ l(d.value) ? (u(), v("svg", io, [...b[0] || (b[0] = [
4156
+ y("path", { d: "M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z" }, null, -1)
4157
+ ])])) : A("", !0)
4158
+ ])
4159
+ ]),
4160
+ y("span", fo, T(d.label), 1)
4161
+ ], 10, lo))), 128))
4162
+ ], 6)
4163
+ ]));
4164
+ }
4165
+ }), zo = /* @__PURE__ */ F(ro, [["__scopeId", "data-v-05984fcf"]]), po = ["onClick", "disabled", "aria-expanded", "aria-controls"], ho = { class: "accordion-title" }, mo = { class: "accordion-icon" }, uo = ["id"], vo = { class: "accordion-body" }, bo = /* @__PURE__ */ V({
4166
+ __name: "index",
4167
+ props: {
4168
+ items: {},
4169
+ allowMultiple: { type: Boolean, default: !1 },
4170
+ defaultOpen: { default: () => [] },
4171
+ bordered: { type: Boolean, default: !0 },
4172
+ disabled: { type: Boolean, default: !1 }
4173
+ },
4174
+ emits: ["change", "item-click"],
4175
+ setup(e, { expose: o, emit: a }) {
4176
+ const n = e, t = a, l = $(new Set(n.defaultOpen)), s = $({}), g = $({}), h = (r, f) => {
4177
+ r && (g.value[f] = r, _(() => {
4178
+ const S = r.querySelector(".accordion-body");
4179
+ S && (s.value[f] = S.scrollHeight);
4180
+ }));
4181
+ }, c = (r) => {
4182
+ var S;
4183
+ if (n.disabled || (S = n.items[r]) != null && S.disabled)
4184
+ return;
4185
+ const f = l.value.has(r);
4186
+ n.allowMultiple ? f ? l.value.delete(r) : l.value.add(r) : f ? l.value.clear() : (l.value.clear(), l.value.add(r)), t("item-click", r, !f), t("change", Array.from(l.value));
4187
+ }, i = (r) => l.value.has(r);
4188
+ return J(() => n.defaultOpen, (r) => {
4189
+ l.value = new Set(r);
4190
+ }, { deep: !0 }), J(() => n.items, () => {
4191
+ _(() => {
4192
+ Object.keys(g.value).forEach((r) => {
4193
+ const f = parseInt(r), S = g.value[f];
4194
+ if (S) {
4195
+ const P = S.querySelector(".accordion-body");
4196
+ P && (s.value[f] = P.scrollHeight);
4197
+ }
4198
+ });
4199
+ });
4200
+ }, { deep: !0 }), o({
4201
+ openItem: (r) => {
4202
+ var f;
4203
+ !n.disabled && !((f = n.items[r]) != null && f.disabled) && (l.value.has(r) || (n.allowMultiple || l.value.clear(), l.value.add(r), t("change", Array.from(l.value))));
4204
+ },
4205
+ closeItem: (r) => {
4206
+ l.value.has(r) && (l.value.delete(r), t("change", Array.from(l.value)));
4207
+ },
4208
+ openAll: () => {
4209
+ n.allowMultiple && !n.disabled && (n.items.forEach((r, f) => {
4210
+ r.disabled || l.value.add(f);
4211
+ }), t("change", Array.from(l.value)));
4212
+ },
4213
+ closeAll: () => {
4214
+ l.value.clear(), t("change", []);
4215
+ },
4216
+ toggle: c
4217
+ }), (r, f) => (u(), v("div", {
4218
+ class: B(["accordion-container", { "accordion-container--bordered": e.bordered }])
4219
+ }, [
4220
+ (u(!0), v(z, null, D(e.items, (S, P) => (u(), v("div", {
4221
+ key: S.id || P,
4222
+ class: B(["accordion-item", {
4223
+ "is-open": i(P),
4224
+ "is-disabled": e.disabled || S.disabled
4225
+ }])
4226
+ }, [
4227
+ y("button", {
4228
+ onClick: (C) => c(P),
4229
+ class: "accordion-header",
4230
+ disabled: e.disabled || S.disabled,
4231
+ "aria-expanded": i(P),
4232
+ "aria-controls": `accordion-content-${P}`
4233
+ }, [
4234
+ y("span", ho, T(S.title), 1),
4235
+ y("div", mo, [
4236
+ (u(), v("svg", {
4237
+ class: B(["accordion-arrow", { "accordion-arrow--rotate": i(P) }]),
4238
+ fill: "none",
4239
+ stroke: "currentColor",
4240
+ viewBox: "0 0 24 24",
4241
+ strokeWidth: "2"
4242
+ }, [...f[0] || (f[0] = [
4243
+ y("path", {
4244
+ strokeLinecap: "round",
4245
+ strokeLinejoin: "round",
4246
+ d: "M19 9l-7 7-7-7"
4247
+ }, null, -1)
4248
+ ])], 2))
4249
+ ])
4250
+ ], 8, po),
4251
+ y("div", {
4252
+ id: `accordion-content-${P}`,
4253
+ class: "accordion-content",
4254
+ style: G({ maxHeight: i(P) ? `${s.value[P]}px` : "0px" }),
4255
+ ref_for: !0,
4256
+ ref: (C) => h(C, P)
4257
+ }, [
4258
+ y("div", vo, T(S.content), 1)
4259
+ ], 12, uo)
4260
+ ], 2))), 128))
4261
+ ], 2));
4262
+ }
4263
+ }), Fo = /* @__PURE__ */ F(bo, [["__scopeId", "data-v-ff064eef"]]), wo = { class: "thumbnail-container-wrapper relative" }, yo = ["onMouseenter", "onClick"], Co = ["src", "alt"], So = { class: "thumbnail-index" }, xo = /* @__PURE__ */ V({
4264
+ __name: "index",
4265
+ props: {
4266
+ images: { default: () => [] },
4267
+ modelValue: { default: 0 },
4268
+ autoScroll: { type: Boolean, default: !0 },
4269
+ showIndex: { type: Boolean, default: !0 }
4270
+ },
4271
+ emits: ["update:modelValue", "change", "hover"],
4272
+ setup(e, { expose: o, emit: a }) {
4273
+ const n = e, t = a, l = $(n.modelValue), s = $(null), g = $([]), h = $(!1), c = $(!1), i = $(0), p = $(!1), b = $(!1), d = () => {
4274
+ I();
4275
+ }, j = (m, E) => {
4276
+ m && m instanceof HTMLElement && (g.value[E] = m);
4277
+ }, r = (m) => {
4278
+ t("hover", m);
4279
+ }, f = () => {
4280
+ }, S = (m) => {
4281
+ l.value = m, t("update:modelValue", m), t("change", m), n.autoScroll && _(() => {
4282
+ w(m), setTimeout(() => {
4283
+ I();
4284
+ }, 300);
4285
+ });
4286
+ }, P = () => {
4287
+ if (!s.value) return;
4288
+ const m = s.value, E = m.clientWidth * 0.8;
4289
+ m.scrollBy({
4290
+ left: -E,
4291
+ behavior: "smooth"
4292
+ });
4293
+ }, C = () => {
4294
+ if (!s.value) return;
4295
+ const m = s.value, E = m.clientWidth * 0.8;
4296
+ m.scrollBy({
4297
+ left: E,
4298
+ behavior: "smooth"
4299
+ });
4300
+ }, w = (m) => {
4301
+ if (!s.value || g.value.length === 0) return;
4302
+ const E = s.value, x = g.value[m];
4303
+ if (!x) return;
4304
+ const M = 2, Ue = x.offsetWidth + 8;
4305
+ let ne = 0;
4306
+ m >= M && (ne = (m - M) * Ue);
4307
+ const Ye = E.scrollWidth - E.clientWidth;
4308
+ ne = Math.max(0, Math.min(ne, Ye)), E.scrollTo({
4309
+ left: ne,
4310
+ behavior: "smooth"
4311
+ });
4312
+ }, I = () => {
4313
+ if (!s.value) return;
4314
+ const m = s.value, E = m.scrollLeft, x = m.scrollWidth - m.clientWidth;
4315
+ h.value = E > 0, c.value = E < x, x > 0 ? i.value = E / x * 100 : i.value = 0;
4316
+ const M = k();
4317
+ p.value = n.images.length > M && h.value, b.value = n.images.length > M && c.value;
4318
+ }, k = () => {
4319
+ var ie;
4320
+ if (!s.value || g.value.length === 0) return 4;
4321
+ const E = s.value.clientWidth - 32, N = (((ie = g.value[0]) == null ? void 0 : ie.offsetWidth) || 80) + 12;
4322
+ return Math.floor(E / N);
4323
+ }, L = (m) => {
4324
+ m >= 0 && m < n.images.length && S(m);
4325
+ };
4326
+ return J(() => n.modelValue, (m) => {
4327
+ m !== void 0 && m !== l.value && (l.value = m, n.autoScroll && _(() => {
4328
+ w(m);
4329
+ }));
4330
+ }), J(() => n.images, () => {
4331
+ _(() => {
4332
+ I();
4333
+ });
4334
+ }, { deep: !0 }), se(() => {
4335
+ _(() => {
4336
+ I();
4337
+ });
4338
+ }), o({
4339
+ setCurrentIndex: L,
4340
+ scrollLeft: P,
4341
+ scrollRight: C,
4342
+ updateScrollState: I
4343
+ }), (m, E) => (u(), v("div", wo, [
4344
+ p.value ? (u(), v("button", {
4345
+ key: 0,
4346
+ onClick: P,
4347
+ class: "scroll-arrow scroll-arrow-left",
4348
+ "aria-label": "向左滚动"
4349
+ }, [...E[1] || (E[1] = [
4350
+ y("svg", {
4351
+ width: "24",
4352
+ height: "24",
4353
+ viewBox: "0 0 24 24",
4354
+ fill: "none",
4355
+ stroke: "currentColor",
4356
+ "stroke-width": "2"
4357
+ }, [
4358
+ y("path", { d: "M15 18l-6-6 6-6" })
4359
+ ], -1)
4360
+ ])])) : A("", !0),
4361
+ y("div", {
4362
+ ref_key: "thumbnailContainer",
4363
+ ref: s,
4364
+ onScroll: d,
4365
+ class: "thumbnail-scroll-container"
4366
+ }, [
4367
+ (u(!0), v(z, null, D(e.images, (x, M) => (u(), v("div", {
4368
+ key: M,
4369
+ ref_for: !0,
4370
+ ref: (N) => j(N, M),
4371
+ onMouseenter: (N) => r(M),
4372
+ onMouseleave: E[0] || (E[0] = (N) => f()),
4373
+ onClick: (N) => S(M),
4374
+ class: B(["thumbnail-item", {
4375
+ "thumbnail-item--active": l.value === M,
4376
+ "thumbnail-item--inactive": l.value !== M
4377
+ }])
4378
+ }, [
4379
+ y("img", {
4380
+ src: x,
4381
+ alt: `缩略图 ${M + 1}`,
4382
+ class: B(["thumbnail-image", {
4383
+ "thumbnail-image--active": l.value === M,
4384
+ "thumbnail-image--inactive": l.value !== M
4385
+ }])
4386
+ }, null, 10, Co),
4387
+ y("div", So, T(M + 1), 1)
4388
+ ], 42, yo))), 128))
4389
+ ], 544),
4390
+ b.value ? (u(), v("button", {
4391
+ key: 1,
4392
+ onClick: C,
4393
+ class: "scroll-arrow scroll-arrow-right",
4394
+ "aria-label": "向右滚动"
4395
+ }, [...E[2] || (E[2] = [
4396
+ y("svg", {
4397
+ width: "24",
4398
+ height: "24",
4399
+ viewBox: "0 0 24 24",
4400
+ fill: "none",
4401
+ stroke: "currentColor",
4402
+ "stroke-width": "2"
4403
+ }, [
4404
+ y("path", { d: "M9 18l6-6-6-6" })
4405
+ ], -1)
4406
+ ])])) : A("", !0)
4407
+ ]));
4408
+ }
4409
+ }), Oo = /* @__PURE__ */ F(xo, [["__scopeId", "data-v-809b97a6"]]), Eo = /* @__PURE__ */ V({
4410
+ __name: "index",
4411
+ props: {
4412
+ width: { default: "100%" },
4413
+ height: { default: "1rem" },
4414
+ shape: { default: "rectangle" },
4415
+ animated: { type: Boolean, default: !0 },
4416
+ loading: { type: Boolean, default: !0 },
4417
+ class: { default: "" },
4418
+ style: { default: () => ({}) }
4419
+ },
4420
+ setup(e) {
4421
+ const o = e, a = X(() => typeof o.width == "string" ? o.width.includes("%") || o.width.includes("px") || o.width.includes("rem") ? "" : `w-${o.width}` : ""), n = X(() => typeof o.height == "string" ? o.height.includes("%") || o.height.includes("px") || o.height.includes("rem") ? "" : `h-${o.height}` : ""), t = X(() => {
4422
+ switch (o.shape) {
4423
+ case "circle":
4424
+ return "rounded-full";
4425
+ case "rounded":
4426
+ return "rounded-lg";
4427
+ default:
4428
+ return "rounded";
4429
+ }
4430
+ }), l = X(() => o.class), s = X(() => {
4431
+ const g = { ...o.style };
4432
+ return typeof o.width == "string" && (o.width.includes("%") || o.width.includes("px") || o.width.includes("rem")) ? g.width = o.width : typeof o.width == "number" && (g.width = `${o.width}px`), typeof o.height == "string" && (o.height.includes("%") || o.height.includes("px") || o.height.includes("rem")) ? g.height = o.height : typeof o.height == "number" && (g.height = `${o.height}px`), g;
4433
+ });
4434
+ return (g, h) => e.loading ? (u(), v("div", {
4435
+ key: 0,
4436
+ class: B(["bg-gray-200", [
4437
+ a.value,
4438
+ n.value,
4439
+ t.value,
4440
+ l.value,
4441
+ { "animate-pulse": e.animated }
4442
+ ]]),
4443
+ style: G(s.value)
4444
+ }, null, 6)) : Q(g.$slots, "default", { key: 1 }, void 0, !0);
4445
+ }
4446
+ }), Ro = /* @__PURE__ */ F(Eo, [["__scopeId", "data-v-db4a4465"]]), Po = {
4447
+ key: 0,
4448
+ class: "modal-header"
4449
+ }, jo = { class: "modal-title" }, ko = { class: "modal-body" }, Mo = {
4450
+ key: 1,
4451
+ class: "modal-footer"
4452
+ }, Ao = ["disabled"], Io = {
4453
+ key: 0,
4454
+ class: "loading-spinner"
4455
+ }, $o = /* @__PURE__ */ V({
4456
+ __name: "index",
4457
+ props: {
4458
+ visible: { type: Boolean, default: !1 },
4459
+ title: { default: "提示" },
4460
+ width: {},
4461
+ size: { default: "medium" },
4462
+ fullscreen: { type: Boolean, default: !1 },
4463
+ showHeader: { type: Boolean, default: !0 },
4464
+ showFooter: { type: Boolean, default: !0 },
4465
+ showClose: { type: Boolean, default: !0 },
4466
+ showCancel: { type: Boolean, default: !0 },
4467
+ showConfirm: { type: Boolean, default: !0 },
4468
+ cancelText: { default: "取消" },
4469
+ confirmText: { default: "确定" },
4470
+ confirmLoading: { type: Boolean, default: !1 },
4471
+ maskClosable: { type: Boolean, default: !0 },
4472
+ escClosable: { type: Boolean, default: !0 }
4473
+ },
4474
+ emits: ["update:visible", "close", "cancel", "confirm", "opened", "closed"],
4475
+ setup(e, { expose: o, emit: a }) {
4476
+ const n = e, t = a, l = () => {
4477
+ t("update:visible", !1), t("close");
4478
+ }, s = () => {
4479
+ t("cancel"), t("update:visible", !1);
4480
+ }, g = () => {
4481
+ t("confirm");
4482
+ }, h = () => {
4483
+ n.maskClosable && l();
4484
+ }, c = (i) => {
4485
+ i.key === "Escape" && n.escClosable && n.visible && l();
4486
+ };
4487
+ return J(() => n.visible, (i) => {
4488
+ i ? (document.addEventListener("keydown", c), document.body.style.overflow = "hidden", t("opened")) : (document.removeEventListener("keydown", c), document.body.style.overflow = "", t("closed"));
4489
+ }), o({
4490
+ close: l
4491
+ }), (i, p) => (u(), re(Je, { to: "body" }, [
4492
+ R(pe, {
4493
+ "enter-active-class": "transition-opacity duration-300",
4494
+ "enter-from-class": "opacity-0",
4495
+ "enter-to-class": "opacity-100",
4496
+ "leave-active-class": "transition-opacity duration-300",
4497
+ "leave-from-class": "opacity-100",
4498
+ "leave-to-class": "opacity-0"
4499
+ }, {
4500
+ default: Z(() => [
4501
+ e.visible ? (u(), v("div", {
4502
+ key: 0,
4503
+ class: "modal-mask",
4504
+ onClick: h
4505
+ }, [
4506
+ R(pe, {
4507
+ "enter-active-class": "transition-all duration-300",
4508
+ "enter-from-class": "opacity-0 scale-95",
4509
+ "enter-to-class": "opacity-100 scale-100",
4510
+ "leave-active-class": "transition-all duration-300",
4511
+ "leave-from-class": "opacity-100 scale-100",
4512
+ "leave-to-class": "opacity-0 scale-95"
4513
+ }, {
4514
+ default: Z(() => [
4515
+ e.visible ? (u(), v("div", {
4516
+ key: 0,
4517
+ class: B(["modal-container", [
4518
+ `modal-container--${e.size}`,
4519
+ { "modal-container--fullscreen": e.fullscreen }
4520
+ ]]),
4521
+ style: G({ width: e.width }),
4522
+ onClick: p[0] || (p[0] = H(() => {
4523
+ }, ["stop"]))
4524
+ }, [
4525
+ e.showHeader ? (u(), v("div", Po, [
4526
+ Q(i.$slots, "header", {}, () => [
4527
+ y("h3", jo, T(e.title), 1)
4528
+ ], !0),
4529
+ e.showClose ? (u(), v("button", {
4530
+ key: 0,
4531
+ class: "modal-close",
4532
+ onClick: l,
4533
+ "aria-label": "关闭"
4534
+ }, [...p[1] || (p[1] = [
4535
+ y("svg", {
4536
+ width: "24",
4537
+ height: "24",
4538
+ viewBox: "0 0 24 24",
4539
+ fill: "none",
4540
+ stroke: "currentColor",
4541
+ "stroke-width": "2"
4542
+ }, [
4543
+ y("path", { d: "M18 6L6 18M6 6l12 12" })
4544
+ ], -1)
4545
+ ])])) : A("", !0)
4546
+ ])) : A("", !0),
4547
+ y("div", ko, [
4548
+ Q(i.$slots, "default", {}, void 0, !0)
4549
+ ]),
4550
+ e.showFooter ? (u(), v("div", Mo, [
4551
+ Q(i.$slots, "footer", {}, () => [
4552
+ e.showCancel ? (u(), v("button", {
4553
+ key: 0,
4554
+ class: "modal-btn modal-btn--cancel",
4555
+ onClick: s
4556
+ }, T(e.cancelText), 1)) : A("", !0),
4557
+ e.showConfirm ? (u(), v("button", {
4558
+ key: 1,
4559
+ class: "modal-btn modal-btn--confirm",
4560
+ onClick: g,
4561
+ disabled: e.confirmLoading
4562
+ }, [
4563
+ e.confirmLoading ? (u(), v("span", Io)) : A("", !0),
4564
+ ze(" " + T(e.confirmText), 1)
4565
+ ], 8, Ao)) : A("", !0)
4566
+ ], !0)
4567
+ ])) : A("", !0)
4568
+ ], 6)) : A("", !0)
4569
+ ]),
4570
+ _: 3
4571
+ })
4572
+ ])) : A("", !0)
4573
+ ]),
4574
+ _: 3
4575
+ })
4576
+ ]));
4577
+ }
4578
+ }), Do = /* @__PURE__ */ F($o, [["__scopeId", "data-v-e43c9a70"]]), _o = () => {
4579
+ const e = () => {
4580
+ let c = document.getElementById("xl-message-container");
4581
+ return c || (c = document.createElement("div"), c.id = "xl-message-container", c.style.cssText = `
4582
+ position: fixed;
4583
+ top: 20px;
4584
+ right: 20px;
4585
+ z-index: 9999;
4586
+ display: flex;
4587
+ flex-direction: column;
4588
+ gap: 10px;
4589
+ `, document.body.appendChild(c)), c;
4590
+ }, o = (c) => {
4591
+ const i = {
4592
+ success: {
4593
+ bgColor: "#f0fdf4",
4594
+ borderColor: "#86efac",
4595
+ textColor: "#166534",
4596
+ iconColor: "#22c55e",
4597
+ iconSvg: '<svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>'
4598
+ },
4599
+ error: {
4600
+ bgColor: "#fef2f2",
4601
+ borderColor: "#fca5a5",
4602
+ textColor: "#991b1b",
4603
+ iconColor: "#ef4444",
4604
+ iconSvg: '<svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"/></svg>'
4605
+ },
4606
+ warning: {
4607
+ bgColor: "#fefce8",
4608
+ borderColor: "#fde047",
4609
+ textColor: "#854d0e",
4610
+ iconColor: "#eab308",
4611
+ iconSvg: '<svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor"><path d="M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"/></svg>'
4612
+ },
4613
+ info: {
4614
+ bgColor: "#f8fafc",
4615
+ borderColor: "#cbd5e1",
4616
+ textColor: "#1e293b",
4617
+ iconColor: "#64748b",
4618
+ iconSvg: '<svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"/></svg>'
4619
+ }
4620
+ };
4621
+ return i[c] || i.info;
4622
+ }, a = (c) => {
4623
+ const i = e(), p = c.type || "info", b = c.duration !== void 0 ? c.duration : 3e3, d = o(p), j = `xl-msg-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`, r = document.createElement("div");
4624
+ r.id = j, r.style.cssText = `
4625
+ background-color: ${d.bgColor};
4626
+ border: 1px solid ${d.borderColor};
4627
+ color: ${d.textColor};
4628
+ border-radius: 12px;
4629
+ padding: 16px;
4630
+ box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
4631
+ max-width: 384px;
4632
+ transform: translateX(100%);
4633
+ opacity: 0;
4634
+ transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
4635
+ pointer-events: auto;
4636
+ `, r.innerHTML = `
4637
+ <div style="display: flex; align-items: flex-start; gap: 12px;">
4638
+ <div style="flex-shrink: 0; color: ${d.iconColor}; margin-top: 2px;">
4639
+ ${d.iconSvg}
4640
+ </div>
4641
+ <div style="flex: 1; min-width: 0;">
4642
+ <div style="font-size: 14px; font-weight: 500; line-height: 1.5; color: ${d.textColor};">
4643
+ ${c.title}
4644
+ </div>
4645
+ ${c.content ? `<div style="margin-top: 4px; font-size: 13px; line-height: 1.5; color: ${d.textColor}; opacity: 0.8;">${c.content}</div>` : ""}
4646
+ </div>
4647
+ <button
4648
+ style="flex-shrink: 0; background: none; border: none; padding: 4px; cursor: pointer; color: ${d.textColor}; opacity: 0.5; border-radius: 4px; transition: all 0.15s; display: flex; align-items: center; justify-content: center;"
4649
+ onmouseover="this.style.opacity='1'; this.style.backgroundColor='rgba(0,0,0,0.05)';"
4650
+ onmouseout="this.style.opacity='0.5'; this.style.backgroundColor='transparent';"
4651
+ onclick="document.getElementById('${j}')?.remove()"
4652
+ >
4653
+ <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round">
4654
+ <path d="M18 6L6 18M6 6l12 12"/>
4655
+ </svg>
4656
+ </button>
4657
+ </div>
4658
+ `, i.appendChild(r), requestAnimationFrame(() => {
4659
+ requestAnimationFrame(() => {
4660
+ r.style.transform = "translateX(0)", r.style.opacity = "1";
4661
+ });
4662
+ }), b > 0 && setTimeout(() => {
4663
+ n(j);
4664
+ }, b);
4665
+ }, n = (c) => {
4666
+ const i = document.getElementById(c);
4667
+ i && (i.style.transform = "translateX(100%)", i.style.opacity = "0", setTimeout(() => {
4668
+ i.parentNode && i.parentNode.removeChild(i);
4669
+ }, 300));
4670
+ };
4671
+ return {
4672
+ show: a,
4673
+ confirm: (c) => {
4674
+ const i = c.type || "info", p = o(i), b = `xl-confirm-${Date.now()}`, d = document.createElement("div");
4675
+ d.id = b, d.style.cssText = `
4676
+ position: fixed;
4677
+ inset: 0;
4678
+ z-index: 9999;
4679
+ display: flex;
4680
+ align-items: center;
4681
+ justify-content: center;
4682
+ background-color: rgba(0, 0, 0, 0.5);
4683
+ opacity: 0;
4684
+ transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
4685
+ backdrop-filter: blur(4px);
4686
+ `;
4687
+ const j = `
4688
+ <div class="xl-confirm-dialog" style="
4689
+ background-color: white;
4690
+ border-radius: 12px;
4691
+ box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
4692
+ max-width: 448px;
4693
+ width: 100%;
4694
+ margin: 16px;
4695
+ transform: scale(0.95);
4696
+ opacity: 0;
4697
+ transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
4698
+ ">
4699
+ <div style="padding: 24px;">
4700
+ <div style="display: flex; align-items: flex-start; gap: 16px; margin-bottom: 20px;">
4701
+ <div style="flex-shrink: 0; color: ${p.iconColor}; margin-top: 2px;">
4702
+ ${p.iconSvg}
4703
+ </div>
4704
+ <div style="flex: 1;">
4705
+ <h3 style="font-size: 18px; font-weight: 600; color: #1a1a1a; line-height: 1.5; margin: 0;">
4706
+ ${c.title}
4707
+ </h3>
4708
+ </div>
4709
+ </div>
4710
+ <div style="font-size: 14px; color: #64748b; line-height: 1.6; margin-bottom: 24px; padding-left: 36px;">
4711
+ ${c.content}
4712
+ </div>
4713
+ <div style="display: flex; justify-content: flex-end; gap: 12px;">
4714
+ <button class="xl-confirm-cancel" style="
4715
+ padding: 8px 16px;
4716
+ font-size: 14px;
4717
+ font-weight: 500;
4718
+ height: 36px;
4719
+ color: #1a1a1a;
4720
+ background-color: white;
4721
+ border: 1px solid #cacaca;
4722
+ border-radius: 6px;
4723
+ cursor: pointer;
4724
+ transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
4725
+ box-shadow: 0 1px 2px rgba(26, 26, 26, 0.05);
4726
+ position: relative;
4727
+ overflow: hidden;
4728
+ transform: translateY(0);
4729
+ "
4730
+ onmouseover="this.style.borderColor='#1a1a1a'; this.style.color='#1a1a1a'; this.style.boxShadow='0 4px 12px rgba(26, 26, 26, 0.3)'; this.style.transform='translateY(-2px)';"
4731
+ onmouseout="this.style.backgroundColor='white'; this.style.borderColor='#cacaca'; this.style.color='#1a1a1a'; this.style.boxShadow='0 1px 2px rgba(26, 26, 26, 0.05)'; this.style.transform='translateY(0)';"
4732
+ onmousedown="this.style.transform='translateY(1px)'; this.style.boxShadow='0 2px 4px rgba(0, 0, 0, 0.1)';"
4733
+ onmouseup="this.style.transform='translateY(-2px)';">
4734
+ ${c.cancelText || "取消"}
4735
+ </button>
4736
+ <button class="xl-confirm-ok" style="
4737
+ padding: 8px 16px;
4738
+ font-size: 14px;
4739
+ font-weight: 500;
4740
+ height: 36px;
4741
+ color: white;
4742
+ background: linear-gradient(135deg, #1a1a1a 0%, #3a3a3a 100%);
4743
+ border: 1px solid #1a1a1a;
4744
+ border-radius: 6px;
4745
+ cursor: pointer;
4746
+ transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
4747
+ box-shadow: 0 4px 12px rgba(26, 26, 26, 0.3);
4748
+ position: relative;
4749
+ overflow: hidden;
4750
+ transform: translateY(0);
4751
+ "
4752
+ onmouseover="this.style.background='linear-gradient(135deg, #3a3a3a 0%, #4a4a4a 100%)'; this.style.boxShadow='0 8px 24px rgba(26, 26, 26, 0.4)'; this.style.transform='translateY(-2px)';"
4753
+ onmouseout="this.style.background='linear-gradient(135deg, #1a1a1a 0%, #3a3a3a 100%)'; this.style.boxShadow='0 4px 12px rgba(26, 26, 26, 0.3)'; this.style.transform='translateY(0)';"
4754
+ onmousedown="this.style.transform='translateY(1px)'; this.style.boxShadow='0 2px 4px rgba(0, 0, 0, 0.1)';"
4755
+ onmouseup="this.style.transform='translateY(-2px)';">
4756
+ ${c.confirmText || "确认"}
4757
+ </button>
4758
+ </div>
4759
+ </div>
4760
+ </div>
4761
+ `;
4762
+ d.innerHTML = j, document.body.appendChild(d), requestAnimationFrame(() => {
4763
+ d.style.opacity = "1";
4764
+ const C = d.querySelector(".xl-confirm-dialog");
4765
+ C && requestAnimationFrame(() => {
4766
+ C.style.transform = "scale(1)", C.style.opacity = "1";
4767
+ });
4768
+ });
4769
+ const r = d.querySelector(".xl-confirm-ok"), f = d.querySelector(".xl-confirm-cancel"), S = () => {
4770
+ const C = d.querySelector(".xl-confirm-dialog");
4771
+ C && (C.style.transform = "scale(0.95)", C.style.opacity = "0"), d.style.opacity = "0", setTimeout(() => {
4772
+ d.parentNode && d.parentNode.removeChild(d);
4773
+ }, 300);
4774
+ };
4775
+ r == null || r.addEventListener("click", () => {
4776
+ var C;
4777
+ (C = c.onConfirm) == null || C.call(c), S();
4778
+ }), f == null || f.addEventListener("click", () => {
4779
+ var C;
4780
+ (C = c.onCancel) == null || C.call(c), S();
4781
+ }), d.addEventListener("click", (C) => {
4782
+ var w;
4783
+ C.target === d && ((w = c.onCancel) == null || w.call(c), S());
4784
+ });
4785
+ const P = (C) => {
4786
+ var w;
4787
+ C.key === "Escape" && ((w = c.onCancel) == null || w.call(c), S(), document.removeEventListener("keydown", P));
4788
+ };
4789
+ document.addEventListener("keydown", P);
4790
+ },
4791
+ success: (c, i, p) => {
4792
+ a({ title: c, content: i, type: "success", duration: p });
4793
+ },
4794
+ error: (c, i, p) => {
4795
+ a({ title: c, content: i, type: "error", duration: p });
4796
+ },
4797
+ warning: (c, i, p) => {
4798
+ a({ title: c, content: i, type: "warning", duration: p });
4799
+ },
4800
+ info: (c, i, p) => {
4801
+ a({ title: c, content: i, type: "info", duration: p });
4802
+ },
4803
+ remove: n
4804
+ };
4805
+ };
4806
+ export {
4807
+ Fo as XAccordion,
4808
+ Le as XButton,
4809
+ Bo as XCard,
4810
+ zo as XCheckboxes,
4811
+ Xo as XCountrySelect,
4812
+ Vo as XInput,
4813
+ Do as XModal,
4814
+ Lo as XSelect,
4815
+ Ro as XSkeleton,
4816
+ Oo as XThumbnailContainer,
4817
+ _o as useMsg,
4818
+ _o as xlMsg
4819
+ };