inertia-bootstrap-forms 1.0.107 → 1.2.1

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.
@@ -0,0 +1,4734 @@
1
+ var Bn = Object.defineProperty;
2
+ var Mt = (t) => {
3
+ throw TypeError(t);
4
+ };
5
+ var jn = (t, e, n) => e in t ? Bn(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
6
+ var B = (t, e, n) => jn(t, typeof e != "symbol" ? e + "" : e, n), Ye = (t, e, n) => e.has(t) || Mt("Cannot " + n);
7
+ var w = (t, e, n) => (Ye(t, e, "read from private field"), n ? n.call(t) : e.get(t)), x = (t, e, n) => e.has(t) ? Mt("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), Me = (t, e, n, r) => (Ye(t, e, "write to private field"), r ? r.call(t, n) : e.set(t, n), n), F = (t, e, n) => (Ye(t, e, "access private method"), n);
8
+ import { createElementBlock as g, openBlock as m, renderSlot as D, normalizeClass as R, ref as G, onMounted as ve, onBeforeUnmount as ht, createElementVNode as b, defineComponent as E, inject as k, resolveComponent as L, resolveDirective as en, createBlock as ee, withCtx as ie, withDirectives as re, createVNode as Q, createTextVNode as mt, toDisplayString as q, computed as W, vModelText as gt, vModelDynamic as yt, defineAsyncComponent as Ln, Fragment as pe, createCommentVNode as j, createStaticVNode as xn, renderList as _e, normalizeStyle as vt, toRef as qn, reactive as tn, withModifiers as nn, mergeProps as Hn, vModelSelect as Gn, markRaw as Wn, provide as Zn, watch as Fe, h as rn, shallowRef as Yn, unref as Xe } from "vue";
9
+ import Xn from "@tinymce/tinymce-vue";
10
+ import { useForm as Kn } from "@inertiajs/vue3";
11
+ import { LMarker as Jn, LTileLayer as Qn, LMap as er } from "@vue-leaflet/vue-leaflet";
12
+ import { VueTelInput as tr } from "vue-tel-input";
13
+ import nr from "dropzone";
14
+ function rr(t, e, n = {}) {
15
+ let r = null;
16
+ ve(async () => {
17
+ r = (typeof e == "function" ? await e() : e).getOrCreateInstance(t.value, n), typeof document < "u" && document.addEventListener("inertia:start", o);
18
+ }), ht(() => {
19
+ typeof document < "u" && document.removeEventListener("inertia:start", o), s();
20
+ });
21
+ const s = function() {
22
+ r && (r.dispose(), r = null);
23
+ }, o = async function(i) {
24
+ var a, l, u;
25
+ const d = ((l = (a = i == null ? void 0 : i.detail) == null ? void 0 : a.visit) == null ? void 0 : l.method) ?? null;
26
+ (!d || d === "get") && r && typeof r.hide == "function" && (await r.hide(), (u = document == null ? void 0 : document.querySelectorAll(".modal-backdrop")) == null || u.forEach((p) => p.remove()));
27
+ };
28
+ return {
29
+ getInstance: () => r
30
+ };
31
+ }
32
+ const be = (t, e) => {
33
+ const n = t.__vccOpts || t;
34
+ for (const [r, s] of e)
35
+ n[r] = s;
36
+ return n;
37
+ }, sr = {}, ir = { class: "dropdown" };
38
+ function or(t, e, n, r, s, o) {
39
+ return m(), g("div", ir, [
40
+ D(t.$slots, "default")
41
+ ]);
42
+ }
43
+ const ar = /* @__PURE__ */ be(sr, [["render", or]]), lr = {}, ur = { class: "dropdown-menu" };
44
+ function dr(t, e, n, r, s, o) {
45
+ return m(), g("div", ur, [
46
+ D(t.$slots, "default")
47
+ ]);
48
+ }
49
+ const pr = /* @__PURE__ */ be(lr, [["render", dr]]), cr = {
50
+ __name: "DropdownToggle",
51
+ props: {},
52
+ setup(t, { expose: e }) {
53
+ const n = G(null), { getInstance: r } = rr(n, () => import("./dropdown-yh2aQrbw-XuCU1v1F.js").then((s) => s.default));
54
+ return e({ show: () => {
55
+ var s;
56
+ return (s = r()) == null ? void 0 : s.show();
57
+ }, hide: () => {
58
+ var s;
59
+ return (s = r()) == null ? void 0 : s.hide();
60
+ } }), (s, o) => (m(), g("button", {
61
+ class: "dropdown-toggle",
62
+ type: "button",
63
+ ref_key: "el",
64
+ ref: n,
65
+ "data-bs-toggle": "dropdown",
66
+ "aria-expanded": "false"
67
+ }, [
68
+ D(s.$slots, "default")
69
+ ], 512));
70
+ }
71
+ }, fr = {}, hr = { class: "input-group" };
72
+ function mr(t, e, n, r, s, o) {
73
+ return m(), g("div", hr, [
74
+ D(t.$slots, "default")
75
+ ]);
76
+ }
77
+ const _t = /* @__PURE__ */ be(fr, [["render", mr]]), gr = {}, yr = { class: "input-group-text" };
78
+ function vr(t, e, n, r, s, o) {
79
+ return m(), g("div", yr, [
80
+ D(t.$slots, "default")
81
+ ]);
82
+ }
83
+ const bt = /* @__PURE__ */ be(gr, [["render", vr]]), _r = {
84
+ props: {
85
+ type: {
86
+ type: String,
87
+ default: "border",
88
+ required: !1
89
+ },
90
+ size: {
91
+ type: String,
92
+ default: "sm",
93
+ required: !1
94
+ }
95
+ }
96
+ };
97
+ function br(t, e, n, r, s, o) {
98
+ return m(), g("i", {
99
+ class: R(["align-middle", "spinner-" + this.type + " spinner-" + this.type + "-" + this.size]),
100
+ role: "status"
101
+ }, e[0] || (e[0] = [
102
+ b("span", { class: "visually-hidden" }, "Loading...", -1)
103
+ ]), 2);
104
+ }
105
+ const wr = /* @__PURE__ */ be(_r, [["render", br]]), $r = {
106
+ props: {
107
+ type: {
108
+ type: String,
109
+ default: "warning"
110
+ }
111
+ }
112
+ };
113
+ function Sr(t, e, n, r, s, o) {
114
+ return m(), g("div", {
115
+ class: R(["alert", "alert-" + n.type])
116
+ }, [
117
+ D(t.$slots, "default")
118
+ ], 2);
119
+ }
120
+ const Fr = /* @__PURE__ */ be($r, [["render", Sr]]), M = (t, e) => {
121
+ const n = t.__vccOpts || t;
122
+ for (const [r, s] of e)
123
+ n[r] = s;
124
+ return n;
125
+ }, Cr = E({
126
+ components: { InputGroup: _t, InputGroupText: bt },
127
+ props: {
128
+ name: {
129
+ type: String,
130
+ required: !0
131
+ },
132
+ required: Boolean,
133
+ disabled: Boolean,
134
+ readonly: Boolean,
135
+ placeholder: {
136
+ type: String,
137
+ default: "عدد را وارد کنید"
138
+ },
139
+ unit: {
140
+ type: String,
141
+ default: "عدد"
142
+ }
143
+ },
144
+ setup(t) {
145
+ let e = k("form");
146
+ return e === void 0 && (e = {
147
+ errors: {},
148
+ getID(n) {
149
+ }
150
+ }), { form: e };
151
+ },
152
+ methods: {
153
+ onChange(t) {
154
+ var e, n;
155
+ this.form[this.name] = parseFloat(this.$number.toEnglish((e = t.detail) == null ? void 0 : e.unmasked)), this.$emit("update:modelValue", parseFloat(this.$number.toEnglish((n = t.detail) == null ? void 0 : n.unmasked)));
156
+ }
157
+ }
158
+ }), kr = ["name", "value", "disabled", "readonly", "placeholder"];
159
+ function Tr(t, e, n, r, s, o) {
160
+ const i = L("InputGroupText"), a = L("InputGroup"), l = en("maska");
161
+ return m(), ee(a, null, {
162
+ default: ie(() => [
163
+ re(b("input", {
164
+ name: t.name,
165
+ value: t.form[t.name],
166
+ "data-maska": "###,###,###,###,###,###,###",
167
+ "data-maska-reversed": "",
168
+ onMaska: e[0] || (e[0] = (...u) => t.onChange && t.onChange(...u)),
169
+ class: R([{ "is-invalid": t.form.errors[t.name] }, "form-control fanum text-start"]),
170
+ disabled: t.disabled || t.form.processing,
171
+ readonly: t.readonly,
172
+ placeholder: t.placeholder,
173
+ type: "tel"
174
+ }, null, 42, kr), [
175
+ [l]
176
+ ]),
177
+ Q(i, { class: "fanum" }, {
178
+ default: ie(() => [
179
+ mt(q(t.unit), 1)
180
+ ]),
181
+ _: 1
182
+ }),
183
+ D(t.$slots, "suffix")
184
+ ]),
185
+ _: 3
186
+ });
187
+ }
188
+ const Aa = /* @__PURE__ */ M(Cr, [["render", Tr]]), Er = E({
189
+ props: {
190
+ name: {
191
+ type: String,
192
+ required: !0
193
+ }
194
+ },
195
+ computed: {
196
+ inputID() {
197
+ return this.form.getID(this);
198
+ }
199
+ },
200
+ setup(t) {
201
+ let e = k("form", {
202
+ errors: {},
203
+ getID(s) {
204
+ return s;
205
+ }
206
+ }), n = k("group", {});
207
+ return { modelValue: W({
208
+ get() {
209
+ var s;
210
+ return n.value && e.value[n.value.name] ? (s = n.value) == null ? void 0 : s.getData(t.name) : e.value[t.name];
211
+ },
212
+ set(s) {
213
+ var o;
214
+ (o = n == null ? void 0 : n.value) != null && o.name ? n.value.setData(t.name, s) : e.value[t.name] = s;
215
+ }
216
+ }), form: e, group: n };
217
+ }
218
+ }), Ir = ["name", "id", "disabled"];
219
+ function Vr(t, e, n, r, s, o) {
220
+ var i, a;
221
+ return re((m(), g("input", {
222
+ name: t.name,
223
+ id: t.inputID,
224
+ "onUpdate:modelValue": e[0] || (e[0] = (l) => t.modelValue = l),
225
+ class: R([{ "is-invalid": ((i = t.form) == null ? void 0 : i.errors[t.name]) !== void 0 }, "form-control"]),
226
+ disabled: (a = t.form) == null ? void 0 : a.processing,
227
+ type: "text"
228
+ }, null, 10, Ir)), [
229
+ [gt, t.modelValue]
230
+ ]);
231
+ }
232
+ const He = /* @__PURE__ */ M(Er, [["render", Vr]]), Mr = E({
233
+ components: { TextInput: He },
234
+ props: {
235
+ name: {
236
+ type: String,
237
+ default: "captcha",
238
+ required: !1
239
+ },
240
+ url: {
241
+ type: String,
242
+ default: "/captcha/default",
243
+ required: !1
244
+ },
245
+ modelValue: "",
246
+ required: Boolean,
247
+ placeholder: {
248
+ default: "کد امنیتی روبرو را وارد کنید"
249
+ }
250
+ },
251
+ emits: ["update:modelValue"],
252
+ inject: ["form"],
253
+ watch: {
254
+ "form.processing": {
255
+ handler: function(t, e) {
256
+ t !== e && !t && (this.getSrc(), this.emptyField());
257
+ },
258
+ deep: !1,
259
+ immediate: !1
260
+ }
261
+ },
262
+ methods: {
263
+ emptyField() {
264
+ this.form && (this.form[this.name] = null);
265
+ },
266
+ async getSrc() {
267
+ this.loading = !0, this.src = this.url + "?t=" + Math.random();
268
+ let t = this;
269
+ setTimeout(function() {
270
+ t.loading = !1;
271
+ }, 500);
272
+ }
273
+ },
274
+ data() {
275
+ return {
276
+ loading: !1,
277
+ src: this.url + Math.random()
278
+ };
279
+ }
280
+ }), Ur = { class: "input-group captcha" }, zr = ["src"], Pr = {
281
+ key: 1,
282
+ class: "placeholder-wave captcha-holder"
283
+ }, Ar = ["disabled"];
284
+ function Nr(t, e, n, r, s, o) {
285
+ const i = L("TextInput");
286
+ return m(), g("div", Ur, [
287
+ Q(i, {
288
+ name: t.name,
289
+ class: "text-start",
290
+ type: "tel"
291
+ }, null, 8, ["name"]),
292
+ t.loading ? (m(), g("div", Pr, e[2] || (e[2] = [
293
+ b("div", { class: "placeholder w-100 h-100" }, null, -1)
294
+ ]))) : (m(), g("img", {
295
+ key: 0,
296
+ src: t.src,
297
+ alt: "captcha",
298
+ onClick: e[0] || (e[0] = (...a) => t.getSrc && t.getSrc(...a)),
299
+ class: "captcha-holder"
300
+ }, null, 8, zr)),
301
+ b("button", {
302
+ type: "button",
303
+ disabled: t.form.processing || t.loading,
304
+ onClick: e[1] || (e[1] = (...a) => t.getSrc && t.getSrc(...a)),
305
+ class: "btn btn-secondary border-0"
306
+ }, e[3] || (e[3] = [
307
+ b("i", { class: "fal fa-sync-alt align-middle" }, null, -1)
308
+ ]), 8, Ar)
309
+ ]);
310
+ }
311
+ const Na = /* @__PURE__ */ M(Mr, [["render", Nr]]), Or = E({
312
+ emits: ["change"],
313
+ props: {
314
+ name: {
315
+ type: String,
316
+ required: !0
317
+ },
318
+ id: {
319
+ type: String,
320
+ default: "",
321
+ required: !1
322
+ },
323
+ value: {
324
+ type: String,
325
+ default: "yes",
326
+ required: !1
327
+ },
328
+ type: {
329
+ type: String,
330
+ default: "radio",
331
+ required: !1
332
+ }
333
+ },
334
+ methods: {
335
+ change(t) {
336
+ this.$emit("change", t);
337
+ }
338
+ },
339
+ setup(t) {
340
+ let e = k("form");
341
+ return e === void 0 && (e = {
342
+ errors: {},
343
+ getID(n) {
344
+ return n;
345
+ }
346
+ }), { form: e };
347
+ }
348
+ }), Dr = ["for"], Rr = ["name", "id", "disabled", "type", "value"];
349
+ function Br(t, e, n, r, s, o) {
350
+ var i, a;
351
+ return m(), g("label", {
352
+ class: R(["btn-label", { active: t.form[t.name] === t.value || t.form[t.name] === !0 }]),
353
+ for: t.form.getID(t.name) + (t.id || t.value)
354
+ }, [
355
+ re(b("input", {
356
+ name: t.name,
357
+ id: t.form.getID(t.name) + (t.id || t.value),
358
+ "onUpdate:modelValue": e[0] || (e[0] = (l) => t.form[t.name] = l),
359
+ class: R([{ "is-invalid": (i = t.form) == null ? void 0 : i.errors[t.name] }, "btn-check"]),
360
+ disabled: (a = t.form) == null ? void 0 : a.processing,
361
+ type: t.type,
362
+ value: t.value,
363
+ onChange: e[1] || (e[1] = (...l) => t.change && t.change(...l)),
364
+ autocomplete: "off"
365
+ }, null, 42, Rr), [
366
+ [yt, t.form[t.name]]
367
+ ]),
368
+ D(t.$slots, "default")
369
+ ], 10, Dr);
370
+ }
371
+ const Oa = /* @__PURE__ */ M(Or, [["render", Br]]), jr = E({
372
+ props: {
373
+ name: {
374
+ type: String,
375
+ required: !0
376
+ },
377
+ id: {
378
+ type: String,
379
+ default: "",
380
+ required: !1
381
+ },
382
+ value: {
383
+ type: [String, Number],
384
+ default: "yes",
385
+ required: !1
386
+ },
387
+ type: {
388
+ type: String,
389
+ default: "checkbox",
390
+ required: !1
391
+ }
392
+ },
393
+ computed: {
394
+ inputID() {
395
+ return this.form.getID(this);
396
+ }
397
+ },
398
+ setup(t) {
399
+ let e = k("form", {
400
+ errors: {},
401
+ getID(s) {
402
+ return s;
403
+ }
404
+ }), n = k("group", {});
405
+ return { modelValue: W({
406
+ get() {
407
+ var s;
408
+ return n.value && e.value[n.value.name] ? (s = n.value) == null ? void 0 : s.getData(t.name) : e.value[t.name];
409
+ },
410
+ set(s) {
411
+ var o;
412
+ (o = n == null ? void 0 : n.value) != null && o.name ? n.value.setData(t.name, s) : e.value[t.name] = s;
413
+ }
414
+ }), form: e, group: n };
415
+ }
416
+ }), Lr = { class: "form-check" }, xr = ["name", "id", "disabled", "type", "value"], qr = ["for"];
417
+ function Hr(t, e, n, r, s, o) {
418
+ var i, a;
419
+ return m(), g("div", Lr, [
420
+ re(b("input", {
421
+ name: t.name,
422
+ id: t.inputID,
423
+ "onUpdate:modelValue": e[0] || (e[0] = (l) => t.modelValue = l),
424
+ class: R([{ "is-invalid": (i = t.form) == null ? void 0 : i.errors[t.name] }, "form-check-input"]),
425
+ disabled: (a = t.form) == null ? void 0 : a.processing,
426
+ type: t.type,
427
+ value: t.value,
428
+ onChange: e[1] || (e[1] = (l) => t.$emit("change", l))
429
+ }, null, 42, xr), [
430
+ [yt, t.modelValue]
431
+ ]),
432
+ b("label", {
433
+ class: "form-check-label",
434
+ for: t.inputID
435
+ }, [
436
+ D(t.$slots, "default")
437
+ ], 8, qr)
438
+ ]);
439
+ }
440
+ const Da = /* @__PURE__ */ M(jr, [["render", Hr]]), Gr = E({
441
+ props: {
442
+ name: {
443
+ type: String,
444
+ required: !0
445
+ },
446
+ id: {
447
+ type: String,
448
+ default: "",
449
+ required: !1
450
+ },
451
+ value: {
452
+ type: [String, Number],
453
+ default: "yes",
454
+ required: !1
455
+ },
456
+ type: {
457
+ type: String,
458
+ default: "checkbox",
459
+ required: !1
460
+ },
461
+ hideInput: {
462
+ type: Boolean,
463
+ default: !1
464
+ }
465
+ },
466
+ computed: {
467
+ inputID() {
468
+ return this.form.getID(this) + (this.value || "");
469
+ },
470
+ selectedValue() {
471
+ return typeof this.modelValue == "object" ? Object.values(this.modelValue) : this.modelValue ? [this.modelValue] : null;
472
+ }
473
+ },
474
+ setup(t) {
475
+ let e = k("form", {
476
+ errors: {},
477
+ getID(s) {
478
+ return s;
479
+ }
480
+ }), n = k("group", {});
481
+ return { modelValue: W({
482
+ get() {
483
+ var s;
484
+ return n.value && e.value[n.value.name] ? (s = n.value) == null ? void 0 : s.getData(t.name) : e.value[t.name];
485
+ },
486
+ set(s) {
487
+ var o;
488
+ (o = n == null ? void 0 : n.value) != null && o.name ? n.value.setData(t.name, s) : e.value[t.name] = s;
489
+ }
490
+ }), form: e, group: n };
491
+ }
492
+ }), Wr = ["for"], Zr = ["name", "id", "disabled", "type", "value"];
493
+ function Yr(t, e, n, r, s, o) {
494
+ var i, a, l, u;
495
+ return m(), g("label", {
496
+ class: R(["form-check-toggle", { "form-check-toggle--active": (t.selectedValue || []).includes(t.value) }]),
497
+ for: t.inputID
498
+ }, [
499
+ re(b("input", {
500
+ name: t.name + (t.group ? "_" + ((i = t.group) == null ? void 0 : i.name) + "-" + ((a = t.group) == null ? void 0 : a.groupID) : ""),
501
+ id: t.inputID,
502
+ "onUpdate:modelValue": e[0] || (e[0] = (d) => t.modelValue = d),
503
+ class: R([{ "is-invalid": (l = t.form) == null ? void 0 : l.errors[t.name], "form-check-toggle--input-hide": t.hideInput }, "form-check-toggle--input form-check-input"]),
504
+ disabled: (u = t.form) == null ? void 0 : u.processing,
505
+ type: t.type,
506
+ value: t.value,
507
+ onChange: e[1] || (e[1] = (d) => t.$emit("change", d))
508
+ }, null, 42, Zr), [
509
+ [yt, t.modelValue]
510
+ ]),
511
+ D(t.$slots, "default")
512
+ ], 10, Wr);
513
+ }
514
+ const Ra = /* @__PURE__ */ M(Gr, [["render", Yr]]), Xr = Ln(
515
+ () => import("vue3-persian-datetime-picker")
516
+ );
517
+ let Ue;
518
+ const Kr = E({
519
+ components: { Vue3PersianDatetimePicker: Xr },
520
+ emits: ["update:modelValue", "change"],
521
+ props: {
522
+ name: {
523
+ type: String,
524
+ required: !0
525
+ },
526
+ calendar: {
527
+ type: String,
528
+ default: "date"
529
+ },
530
+ view: {
531
+ type: String,
532
+ default: "date"
533
+ },
534
+ min: String,
535
+ max: String,
536
+ range: Boolean,
537
+ locale: {
538
+ default: "fa"
539
+ },
540
+ format: {
541
+ type: String,
542
+ default: "jYYYY-jMM-jDD"
543
+ },
544
+ inputFormat: {
545
+ type: String,
546
+ default: null
547
+ },
548
+ placeholder: String
549
+ },
550
+ setup(t) {
551
+ let e = k("form", {
552
+ errors: {},
553
+ getID(s) {
554
+ return s;
555
+ }
556
+ }), n = k("group", {});
557
+ return { modelValue: W({
558
+ get() {
559
+ var s;
560
+ return n.value && e.value[n.value.name] ? (s = n.value) == null ? void 0 : s.getData(t.name) : e.value[t.name];
561
+ },
562
+ set(s) {
563
+ var o;
564
+ (o = n == null ? void 0 : n.value) != null && o.name ? n.value.setData(t.name, s) : e.value[t.name] = s;
565
+ }
566
+ }), form: e, group: n };
567
+ },
568
+ watch: {
569
+ modelValue: (t, e) => {
570
+ Ue == null || Ue.$emit("change", t, e);
571
+ }
572
+ },
573
+ methods: {
574
+ clear() {
575
+ this.modelValue = null;
576
+ }
577
+ },
578
+ mounted() {
579
+ Ue = this;
580
+ },
581
+ computed: {
582
+ isSsr() {
583
+ return typeof window > "u";
584
+ },
585
+ inputID() {
586
+ return this.form.getID(this);
587
+ }
588
+ },
589
+ data() {
590
+ return {};
591
+ }
592
+ }), Jr = { class: "input-group" }, Qr = ["name", "id", "value", "placeholder", "disabled"];
593
+ function es(t, e, n, r, s, o) {
594
+ var a;
595
+ const i = L("Vue3PersianDatetimePicker");
596
+ return m(), g(pe, null, [
597
+ b("div", Jr, [
598
+ b("input", {
599
+ name: t.name,
600
+ id: t.inputID,
601
+ value: t.modelValue,
602
+ placeholder: t.placeholder || "انتخاب تاریخ",
603
+ class: R([{ "is-invalid": t.form.errors[t.name] }, "form-control form-control--datepicker text-start fanum"]),
604
+ disabled: (a = t.form) == null ? void 0 : a.processing,
605
+ type: "text"
606
+ }, null, 10, Qr),
607
+ b("button", {
608
+ type: "button",
609
+ onClick: e[0] || (e[0] = (...l) => t.clear && t.clear(...l)),
610
+ class: R(["input-group-text input-group-datepicker-delete", { "input-group-datepicker-delete-show": t.modelValue }])
611
+ }, e[2] || (e[2] = [
612
+ xn('<svg width="25px" height="25px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M14 22H10C6.22876 22 4.34315 22 3.17157 20.8284C2 19.6569 2 17.7712 2 14V12C2 8.22876 2 6.34315 3.17157 5.17157C4.34315 4 6.22876 4 10 4H14C17.7712 4 19.6569 4 20.8284 5.17157C22 6.34315 22 8.22876 22 12V14C22 17.7712 22 19.6569 20.8284 20.8284C20.1752 21.4816 19.3001 21.7706 18 21.8985" stroke="#1C274C" stroke-width="1.5" stroke-linecap="round"></path><path d="M7 4V2.5" stroke="#1C274C" stroke-width="1.5" stroke-linecap="round"></path><path d="M17 4V2.5" stroke="#1C274C" stroke-width="1.5" stroke-linecap="round"></path><path d="M21.5 9H16.625H10.75M2 9H5.875" stroke="#1C274C" stroke-width="1.5" stroke-linecap="round"></path><path d="M18 17C18 17.5523 17.5523 18 17 18C16.4477 18 16 17.5523 16 17C16 16.4477 16.4477 16 17 16C17.5523 16 18 16.4477 18 17Z" fill="#1C274C"></path><path d="M18 13C18 13.5523 17.5523 14 17 14C16.4477 14 16 13.5523 16 13C16 12.4477 16.4477 12 17 12C17.5523 12 18 12.4477 18 13Z" fill="#1C274C"></path><path d="M13 17C13 17.5523 12.5523 18 12 18C11.4477 18 11 17.5523 11 17C11 16.4477 11.4477 16 12 16C12.5523 16 13 16.4477 13 17Z" fill="#1C274C"></path><path d="M13 13C13 13.5523 12.5523 14 12 14C11.4477 14 11 13.5523 11 13C11 12.4477 11.4477 12 12 12C12.5523 12 13 12.4477 13 13Z" fill="#1C274C"></path><path d="M8 17C8 17.5523 7.55228 18 7 18C6.44772 18 6 17.5523 6 17C6 16.4477 6.44772 16 7 16C7.55228 16 8 16.4477 8 17Z" fill="#1C274C"></path><path d="M8 13C8 13.5523 7.55228 14 7 14C6.44772 14 6 13.5523 6 13C6 12.4477 6.44772 12 7 12C7.55228 12 8 12.4477 8 13Z" fill="#1C274C"></path></svg>', 1)
613
+ ]), 2)
614
+ ]),
615
+ t.isSsr ? j("", !0) : (m(), ee(i, {
616
+ key: 0,
617
+ type: t.calendar,
618
+ view: t.view,
619
+ min: t.min,
620
+ max: t.max,
621
+ jumpminute: "15",
622
+ range: t.range,
623
+ locale: t.locale,
624
+ simple: !1,
625
+ roundminute: !0,
626
+ showNowBtn: !0,
627
+ autoSubmit: !0,
628
+ format: t.format,
629
+ inputFormat: t.inputFormat ? t.inputFormat : t.format,
630
+ displayFormat: t.format,
631
+ modelValue: t.modelValue,
632
+ "onUpdate:modelValue": e[1] || (e[1] = (l) => t.modelValue = l),
633
+ "custom-input": "#" + t.inputID
634
+ }, null, 8, ["type", "view", "min", "max", "range", "locale", "format", "inputFormat", "displayFormat", "modelValue", "custom-input"]))
635
+ ], 64);
636
+ }
637
+ const Ba = /* @__PURE__ */ M(Kr, [["render", es]]), ts = E({
638
+ emits: ["update:modelValue", "setContent"],
639
+ components: { Editor: Xn },
640
+ props: {
641
+ name: {
642
+ type: String,
643
+ required: !0
644
+ },
645
+ placeholder: {
646
+ type: String,
647
+ default: ""
648
+ },
649
+ disabled: {
650
+ type: Boolean,
651
+ default: !1
652
+ },
653
+ modelValue: String,
654
+ options: {
655
+ type: Object,
656
+ default: {},
657
+ required: !1
658
+ }
659
+ },
660
+ setup(t, { expose: e, emit: n }) {
661
+ const r = G(null), s = G(null), o = (u, d) => {
662
+ s.value = d;
663
+ };
664
+ e({
665
+ editor: () => s.value
666
+ });
667
+ let i = k("form", {
668
+ errors: {},
669
+ getID(u) {
670
+ return u;
671
+ }
672
+ }), a = k("group", {});
673
+ return { modelValue: W({
674
+ get() {
675
+ var u;
676
+ return a.value && i.value[a.value.name] ? (u = a.value) == null ? void 0 : u.getData(t.name) : i.value[t.name];
677
+ },
678
+ set(u) {
679
+ var d;
680
+ (d = a == null ? void 0 : a.value) != null && d.name ? a.value.setData(t.name, u) : i.value[t.name] = u;
681
+ }
682
+ }), form: i, group: a, editorRef: r, handleInit: o };
683
+ }
684
+ });
685
+ function ns(t, e, n, r, s, o) {
686
+ const i = L("Editor");
687
+ return m(), ee(i, {
688
+ ref: "editorRef",
689
+ onInit: t.handleInit,
690
+ modelValue: t.modelValue,
691
+ "onUpdate:modelValue": e[0] || (e[0] = (a) => t.modelValue = a),
692
+ class: "tiny-editor-input-el",
693
+ init: {
694
+ disabled: this.disabled,
695
+ placeholder: this.placeholder,
696
+ ...t.options
697
+ }
698
+ }, null, 8, ["onInit", "modelValue", "init"]);
699
+ }
700
+ const ja = /* @__PURE__ */ M(ts, [["render", ns]]), rs = E({
701
+ props: {
702
+ modelValue: "",
703
+ name: {
704
+ type: String,
705
+ required: !0
706
+ },
707
+ multiple: {
708
+ type: Boolean,
709
+ default: !1
710
+ },
711
+ endpoint: {
712
+ type: String,
713
+ default: "/upload"
714
+ }
715
+ },
716
+ setup(t) {
717
+ let e = k("form");
718
+ return e === void 0 && (e = {
719
+ errors: {},
720
+ getID(n) {
721
+ }
722
+ }), { form: e };
723
+ },
724
+ computed: {
725
+ allFiles() {
726
+ return this.files;
727
+ }
728
+ },
729
+ methods: {
730
+ addFile(t) {
731
+ let e = {
732
+ id: crypto.randomUUID(),
733
+ percent: 0,
734
+ error: 0,
735
+ file: t
736
+ };
737
+ this.multiple ? this.files.push(e) : this.files = [e], this.uploadFile(e), this.$refs.input.value = "";
738
+ },
739
+ calculatePercent(t, e) {
740
+ t.lengthComputable && (this.files.find((n) => n.id === e.id).percent = Math.round(t.loaded / t.total * 100));
741
+ },
742
+ addFileToInputValue(t, e) {
743
+ this.files.find((n) => n.id === t.id).path = e.data.path, this.form[this.name] = this.multiple ? this.files.map((n) => n.path) : this.files[0].path, this.$emit("update:modelValue", this.form[this.name]);
744
+ },
745
+ async uploadFile(t) {
746
+ let e = this, n = new FormData();
747
+ n.append("file", t.file), e.files.find((r) => r.id === t.id).error = "", await axios.post(
748
+ this.endpoint,
749
+ n,
750
+ {
751
+ headers: {
752
+ "Content-Type": "multipart/form-data"
753
+ },
754
+ onUploadProgress: (r) => e.calculatePercent(r, t)
755
+ }
756
+ ).then(function(r) {
757
+ e.addFileToInputValue(t, r);
758
+ }).catch(function(r) {
759
+ var s, o;
760
+ e.files.find((i) => i.id === t.id).error = ((o = (s = r.response) == null ? void 0 : s.data) == null ? void 0 : o.message) || r.message;
761
+ });
762
+ },
763
+ async deleteFile(t) {
764
+ this.files = this.files.filter((e) => e.id !== t.id), await axios.delete(this.endpoint, {
765
+ data: t.path
766
+ });
767
+ },
768
+ fileSelected(t) {
769
+ Array.from(t.target.files).forEach((e) => this.addFile(e));
770
+ }
771
+ },
772
+ data() {
773
+ return {
774
+ files: []
775
+ };
776
+ }
777
+ }), ss = { class: "file-input-uploader" }, is = ["name", "disabled", "multiple"], os = { class: "file-input-uploader--list" }, as = ["id"], ls = {
778
+ key: 0,
779
+ class: "file-input-uploader--progress"
780
+ }, us = {
781
+ key: 1,
782
+ class: "file-input-uploader--list-error"
783
+ }, ds = {
784
+ class: "file-input-uploader--list-item--size",
785
+ dir: "ltr"
786
+ }, ps = { class: "file-input-uploader--list-item--actions" }, cs = ["onClick"], fs = ["onClick"];
787
+ function hs(t, e, n, r, s, o) {
788
+ var i, a;
789
+ return m(), g("div", ss, [
790
+ b("input", {
791
+ ref: "input",
792
+ name: t.name,
793
+ class: R([{ "is-invalid": ((i = t.form) == null ? void 0 : i.errors[t.name]) !== void 0 }, "form-control"]),
794
+ disabled: (a = t.form) == null ? void 0 : a.processing,
795
+ type: "file",
796
+ multiple: t.multiple,
797
+ onChange: e[0] || (e[0] = (...l) => t.fileSelected && t.fileSelected(...l))
798
+ }, null, 42, is),
799
+ b("div", os, [
800
+ (m(!0), g(pe, null, _e(t.allFiles, (l) => (m(), g("div", {
801
+ id: "file-" + l.id,
802
+ class: "file-input-uploader--list-item"
803
+ }, [
804
+ l.percent && l.percent < 100 ? (m(), g("div", ls, [
805
+ b("div", {
806
+ style: vt({ width: l.percent + "%" })
807
+ }, null, 4)
808
+ ])) : j("", !0),
809
+ b("div", null, q(l.file.name), 1),
810
+ l.error ? (m(), g("div", us, q(l.error), 1)) : j("", !0),
811
+ b("div", ds, q(Math.round(l.file.size / 1024)) + "Kb", 1),
812
+ b("div", ps, [
813
+ l.error ? (m(), g("button", {
814
+ key: 0,
815
+ onClick: (u) => t.uploadFile(l),
816
+ type: "button",
817
+ class: "file-input-uploader--list-item--btn"
818
+ }, e[1] || (e[1] = [
819
+ b("svg", {
820
+ fill: "#000000",
821
+ width: "800px",
822
+ height: "800px",
823
+ viewBox: "0 0 24 24",
824
+ xmlns: "http://www.w3.org/2000/svg"
825
+ }, [
826
+ b("path", { d: "M1,12A11,11,0,0,1,17.882,2.7l1.411-1.41A1,1,0,0,1,21,2V6a1,1,0,0,1-1,1H16a1,1,0,0,1-.707-1.707l1.128-1.128A8.994,8.994,0,0,0,3,12a1,1,0,0,1-2,0Zm21-1a1,1,0,0,0-1,1,9.01,9.01,0,0,1-9,9,8.9,8.9,0,0,1-4.42-1.166l1.127-1.127A1,1,0,0,0,8,17H4a1,1,0,0,0-1,1v4a1,1,0,0,0,.617.924A.987.987,0,0,0,4,23a1,1,0,0,0,.707-.293L6.118,21.3A10.891,10.891,0,0,0,12,23,11.013,11.013,0,0,0,23,12,1,1,0,0,0,22,11Z" })
827
+ ], -1)
828
+ ]), 8, cs)) : j("", !0),
829
+ l.path || l.error ? (m(), g("button", {
830
+ key: 1,
831
+ onClick: (u) => t.deleteFile(l),
832
+ type: "button",
833
+ class: "file-input-uploader--list-item--btn"
834
+ }, e[2] || (e[2] = [
835
+ b("svg", {
836
+ fill: "#000000",
837
+ width: "800px",
838
+ height: "800px",
839
+ viewBox: "0 0 24 24",
840
+ xmlns: "http://www.w3.org/2000/svg"
841
+ }, [
842
+ b("path", { d: "M12,23A11,11,0,1,0,1,12,11.013,11.013,0,0,0,12,23ZM12,3a9,9,0,1,1-9,9A9.01,9.01,0,0,1,12,3ZM8.293,14.293,10.586,12,8.293,9.707A1,1,0,0,1,9.707,8.293L12,10.586l2.293-2.293a1,1,0,0,1,1.414,1.414L13.414,12l2.293,2.293a1,1,0,1,1-1.414,1.414L12,13.414,9.707,15.707a1,1,0,0,1-1.414-1.414Z" })
843
+ ], -1)
844
+ ]), 8, fs)) : j("", !0)
845
+ ])
846
+ ], 8, as))), 256))
847
+ ])
848
+ ]);
849
+ }
850
+ const La = /* @__PURE__ */ M(rs, [["render", hs]]), ms = E({
851
+ components: {
852
+ TextInput: He
853
+ },
854
+ props: {
855
+ FileInput: {
856
+ type: String,
857
+ default: "email",
858
+ required: !0
859
+ }
860
+ }
861
+ });
862
+ function gs(t, e, n, r, s, o) {
863
+ const i = L("TextInput");
864
+ return m(), ee(i, {
865
+ name: t.name,
866
+ placeholder: "ایمیل خود را وارد کنید",
867
+ type: "email"
868
+ }, null, 8, ["name"]);
869
+ }
870
+ const xa = /* @__PURE__ */ M(ms, [["render", gs]]), ys = E({
871
+ props: {
872
+ name: {
873
+ type: String,
874
+ required: !0
875
+ }
876
+ },
877
+ setup(t, e) {
878
+ return { form: k("form", {
879
+ errors: {},
880
+ getID(r) {
881
+ return r;
882
+ }
883
+ }) };
884
+ },
885
+ provide() {
886
+ return {
887
+ group: W(() => this)
888
+ };
889
+ },
890
+ mounted() {
891
+ var t, e;
892
+ (e = (t = this.$refs.groupEl) == null ? void 0 : t.parentNode) == null || e.parentNode.querySelectorAll(".form-control-group").forEach((n, r) => {
893
+ n === this.$refs.groupEl && (this.groupID = r.toString());
894
+ });
895
+ },
896
+ methods: {
897
+ setData(t, e) {
898
+ var n;
899
+ this.form[this.name] || (this.form[this.name] = {}), this.groupID && ((n = this.form[this.name]) == null ? void 0 : n.length) >= 0 ? (this.form[this.name][this.groupID] || (this.form[this.name][this.groupID] = {}), this.form[this.name][this.groupID][t] = e) : this.form[this.name][t] = e;
900
+ },
901
+ getData(t) {
902
+ var e, n;
903
+ return this.groupID && ((e = this.form[this.name]) == null ? void 0 : e.length) >= 0 ? ((n = this.form[this.name][this.groupID]) == null ? void 0 : n[t]) || null : this.form[this.name][t];
904
+ }
905
+ },
906
+ data() {
907
+ return {
908
+ groupID: "0"
909
+ };
910
+ }
911
+ }), vs = ["data-group-id"];
912
+ function _s(t, e, n, r, s, o) {
913
+ return m(), g("div", {
914
+ class: "form-control-group",
915
+ "data-group-id": t.groupID,
916
+ ref: "groupEl"
917
+ }, [
918
+ D(t.$slots, "default")
919
+ ], 8, vs);
920
+ }
921
+ const bs = /* @__PURE__ */ M(ys, [["render", _s]]), ws = E({
922
+ components: { Alert: Fr },
923
+ emits: ["submit", "reset", "onStart", "onFinish", "onSuccess", "onError", "change"],
924
+ props: {
925
+ url: {
926
+ type: String,
927
+ default: "",
928
+ required: !1
929
+ },
930
+ method: {
931
+ default: "post"
932
+ },
933
+ only: {
934
+ type: Array,
935
+ default: [],
936
+ required: !1
937
+ },
938
+ modelValue: {
939
+ type: Object,
940
+ default: {},
941
+ required: !1
942
+ },
943
+ options: {
944
+ type: Object,
945
+ default: {},
946
+ required: !1
947
+ },
948
+ resetOnSuccess: {
949
+ type: Boolean,
950
+ default: !1
951
+ },
952
+ submitHandler: {
953
+ type: Function,
954
+ default: null,
955
+ required: !1
956
+ }
957
+ },
958
+ setup(t) {
959
+ const e = qn("formEl"), n = tn(t.modelValue), r = Kn({
960
+ hasMessage: !1,
961
+ successMessage: null,
962
+ ...t.options,
963
+ ...n
964
+ });
965
+ return r.getID = function(s) {
966
+ var o, i, a, l, u, d;
967
+ return typeof s === String ? ((o = e.value) != null && o.id ? ((i = e.value) == null ? void 0 : i.id) + "-" : "") + "-" + s : ((a = e.value) != null && a.id ? ((l = e.value) == null ? void 0 : l.id) + "-" : "") + (s.group ? ((u = s.group) == null ? void 0 : u.name) + "-" + ((d = s.group) == null ? void 0 : d.groupID) + "-" : "") + s.name + (s.value ? "-" + s.value : "");
968
+ }, { form: r, formData: n, formEl: e };
969
+ },
970
+ provide() {
971
+ return {
972
+ form: W(() => this.form)
973
+ };
974
+ },
975
+ watch: {
976
+ form: {
977
+ handler: function(t) {
978
+ const {
979
+ isDirty: e,
980
+ errors: n,
981
+ hasErrors: r,
982
+ hasMessage: s,
983
+ successMessage: o,
984
+ processing: i,
985
+ progress: a,
986
+ wasSuccessful: l,
987
+ uploading: u,
988
+ recentlySuccessful: d,
989
+ __rememberable: p,
990
+ ...c
991
+ } = t;
992
+ this.$emit("change", c), this.$emit("update:modelValue", c);
993
+ },
994
+ deep: !0
995
+ }
996
+ },
997
+ methods: {
998
+ reset() {
999
+ this.form.reset();
1000
+ },
1001
+ async submit(t) {
1002
+ const e = this.modelValue;
1003
+ this.submitHandler ? await this.submitHandler(t) : (this.$emit("submit", t), await this.form.transform(function(n) {
1004
+ delete n.hasMessage, delete n.successMessage;
1005
+ let r = JSON.stringify({
1006
+ ...e,
1007
+ ...n
1008
+ });
1009
+ const s = [/۰/g, /۱/g, /۲/g, /۳/g, /۴/g, /۵/g, /۶/g, /۷/g, /۸/g, /۹/g], o = [/٠/g, /١/g, /٢/g, /٣/g, /٤/g, /٥/g, /٦/g, /٧/g, /٨/g, /٩/g];
1010
+ for (let i = 0; i < 10; i++)
1011
+ r = r.replace(s[i], i).replace(o[i], i);
1012
+ return JSON.parse(r.toLocaleString("en-US"));
1013
+ }).submit(this.method.toString(), this.url, {
1014
+ only: this.only,
1015
+ onStart: () => {
1016
+ this.form.hasMessage && (this.form.hasMessage = !1), this.form.successMessage && (this.form.hasMessage = null), this.$emit("onStart"), this.form.clearErrors();
1017
+ },
1018
+ onFinish: (n) => {
1019
+ this.$emit("onFinish", n);
1020
+ },
1021
+ onError: (n) => {
1022
+ this.$emit("onError", n);
1023
+ },
1024
+ onSuccess: (n) => {
1025
+ var r, s, o;
1026
+ this.resetOnSuccess && ((r = this.form) == null || r.reset()), (s = n == null ? void 0 : n.props) != null && s.message && (this.form.hasMessage = !0, this.form.successMessage = (o = n == null ? void 0 : n.props) == null ? void 0 : o.message), this.$emit("onSuccess", n);
1027
+ }
1028
+ }));
1029
+ }
1030
+ },
1031
+ expose: ["submit", "reset"]
1032
+ }), $s = ["action", "method", "novalidate"], Ss = { class: "list-unstyled p-0 m-0 fanum" };
1033
+ function Fs(t, e, n, r, s, o) {
1034
+ const i = L("Alert");
1035
+ return m(), g("form", {
1036
+ ref: "formEl",
1037
+ action: t.url,
1038
+ method: t.method,
1039
+ onSubmit: e[0] || (e[0] = nn((...a) => t.submit && t.submit(...a), ["prevent"])),
1040
+ onReset: e[1] || (e[1] = (a) => t.$emit("reset")),
1041
+ class: R({ "form-processing": t.form.processing }),
1042
+ novalidate: !!Object.values(t.form.errors).length
1043
+ }, [
1044
+ D(t.$slots, "errors", {}, () => [
1045
+ t.form.hasErrors ? (m(), ee(i, {
1046
+ key: 0,
1047
+ type: "danger"
1048
+ }, {
1049
+ default: ie(() => [
1050
+ b("ul", Ss, [
1051
+ (m(!0), g(pe, null, _e(t.form.errors, (a) => (m(), g("li", null, q(a), 1))), 256))
1052
+ ])
1053
+ ]),
1054
+ _: 1
1055
+ })) : j("", !0)
1056
+ ]),
1057
+ D(t.$slots, "message", {}, () => [
1058
+ t.form.hasMessage && t.form.successMessage ? (m(), ee(i, {
1059
+ key: 0,
1060
+ type: "success",
1061
+ innerHTML: t.form.successMessage
1062
+ }, null, 8, ["innerHTML"])) : j("", !0)
1063
+ ]),
1064
+ D(t.$slots, "default", {
1065
+ form: t.form,
1066
+ submit: t.submit
1067
+ })
1068
+ ], 42, $s);
1069
+ }
1070
+ const qa = /* @__PURE__ */ M(ws, [["render", Fs]]), Cs = E({
1071
+ props: {
1072
+ default: !1,
1073
+ required: !1
1074
+ },
1075
+ emits: ["update:modelValue"]
1076
+ }), ks = { class: "mb-2 d-block" }, Ts = {
1077
+ key: 0,
1078
+ class: "text-danger"
1079
+ };
1080
+ function Es(t, e, n, r, s, o) {
1081
+ return m(), g("label", ks, [
1082
+ D(t.$slots, "default", {}, void 0, !0),
1083
+ t.required ? (m(), g("span", Ts, "*")) : j("", !0)
1084
+ ]);
1085
+ }
1086
+ const Ha = /* @__PURE__ */ M(Cs, [["render", Es], ["__scopeId", "data-v-bfeb9beb"]]), Is = E({
1087
+ name: "LocationInput",
1088
+ components: {
1089
+ LMap: er,
1090
+ LTileLayer: Qn,
1091
+ LMarker: Jn
1092
+ },
1093
+ props: {
1094
+ name: {
1095
+ type: String,
1096
+ default: "location",
1097
+ required: !1
1098
+ },
1099
+ disabled: {
1100
+ type: [Boolean, String],
1101
+ default: !1
1102
+ },
1103
+ readonly: {
1104
+ type: [Boolean, String],
1105
+ default: !1
1106
+ },
1107
+ modelValue: Object
1108
+ },
1109
+ setup(t) {
1110
+ let e = k("form");
1111
+ return e === void 0 && (e = {
1112
+ errors: {},
1113
+ zoom: 8,
1114
+ center: [47.41322, -1.219482],
1115
+ getID(n) {
1116
+ }
1117
+ }), { form: e };
1118
+ },
1119
+ methods: {
1120
+ setMarker(t) {
1121
+ var e, n, r, s, o, i;
1122
+ this.readonly || (this.marker = {
1123
+ lat: ((e = t == null ? void 0 : t.latlng) == null ? void 0 : e.lat) || ((r = (n = t == null ? void 0 : t.target) == null ? void 0 : n._latlng) == null ? void 0 : r.lat),
1124
+ lng: ((s = t == null ? void 0 : t.latlng) == null ? void 0 : s.lng) || ((i = (o = t == null ? void 0 : t.target) == null ? void 0 : o._latlng) == null ? void 0 : i.lng)
1125
+ }, this.$emit("update:modelValue", this.marker), this.form[this.name] = this.marker);
1126
+ }
1127
+ },
1128
+ data() {
1129
+ var t, e, n, r, s, o, i, a;
1130
+ return {
1131
+ zoom: 13,
1132
+ marker: {
1133
+ lat: ((t = this.modelValue) == null ? void 0 : t.lat) || ((e = this.form[this.name]) == null ? void 0 : e.lat) || null,
1134
+ lng: ((n = this.modelValue) == null ? void 0 : n.lng) || ((r = this.form[this.name]) == null ? void 0 : r.lng) || null
1135
+ },
1136
+ center: {
1137
+ lat: ((s = this.modelValue) == null ? void 0 : s.lat) || ((o = this.form[this.name]) == null ? void 0 : o.lat) || 35.69293,
1138
+ lng: ((i = this.modelValue) == null ? void 0 : i.lng) || ((a = this.form[this.name]) == null ? void 0 : a.lng) || 51.36372
1139
+ }
1140
+ };
1141
+ }
1142
+ });
1143
+ function Vs(t, e, n, r, s, o) {
1144
+ var u;
1145
+ const i = L("l-tile-layer"), a = L("LMarker"), l = L("l-map");
1146
+ return m(), g("div", {
1147
+ class: R(["location-map-container", { disabled: t.disabled || t.form.processing, "is-invalid": ((u = t.form) == null ? void 0 : u.errors[t.name]) !== void 0 }])
1148
+ }, [
1149
+ Q(l, {
1150
+ ref: "map",
1151
+ zoom: t.zoom,
1152
+ "onUpdate:zoom": e[0] || (e[0] = (d) => t.zoom = d),
1153
+ useGlobalLeaflet: !1,
1154
+ center: this.center,
1155
+ onClick: t.setMarker
1156
+ }, {
1157
+ default: ie(() => [
1158
+ Q(i, {
1159
+ url: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
1160
+ "layer-type": "base",
1161
+ name: "OpenStreetMap"
1162
+ }),
1163
+ t.marker ? (m(), ee(a, {
1164
+ key: 0,
1165
+ "lat-lng": t.marker,
1166
+ draggable: !t.readonly && !t.disabled,
1167
+ onDragend: t.setMarker
1168
+ }, null, 8, ["lat-lng", "draggable", "onDragend"])) : j("", !0)
1169
+ ]),
1170
+ _: 1
1171
+ }, 8, ["zoom", "center", "onClick"])
1172
+ ], 2);
1173
+ }
1174
+ const Ga = /* @__PURE__ */ M(Is, [["render", Vs]]), Ms = E({
1175
+ components: {
1176
+ TextInput: He
1177
+ },
1178
+ props: {
1179
+ name: {
1180
+ type: String,
1181
+ default: "mobile",
1182
+ required: !0
1183
+ }
1184
+ }
1185
+ });
1186
+ function Us(t, e, n, r, s, o) {
1187
+ const i = L("TextInput");
1188
+ return m(), ee(i, {
1189
+ name: t.name,
1190
+ placeholder: "موبایل خود را وارد کنید",
1191
+ type: "tel"
1192
+ }, null, 8, ["name"]);
1193
+ }
1194
+ const Wa = /* @__PURE__ */ M(Ms, [["render", Us]]), zs = E({
1195
+ components: {
1196
+ TextInput: He
1197
+ },
1198
+ props: {
1199
+ name: {
1200
+ type: String,
1201
+ default: "password",
1202
+ required: !0
1203
+ }
1204
+ }
1205
+ });
1206
+ function Ps(t, e, n, r, s, o) {
1207
+ const i = L("TextInput");
1208
+ return m(), ee(i, {
1209
+ name: t.name,
1210
+ placeholder: "گذرواژه خود را وارد کنید",
1211
+ type: "password"
1212
+ }, null, 8, ["name"]);
1213
+ }
1214
+ const Za = /* @__PURE__ */ M(zs, [["render", Ps]]), As = E({
1215
+ components: { InputGroup: _t, InputGroupText: bt },
1216
+ props: {
1217
+ name: {
1218
+ type: String,
1219
+ required: !0
1220
+ },
1221
+ required: Boolean,
1222
+ disabled: Boolean,
1223
+ readonly: Boolean,
1224
+ unit: {
1225
+ type: String,
1226
+ default: "عدد"
1227
+ },
1228
+ min: {
1229
+ type: Number,
1230
+ default: 0
1231
+ },
1232
+ max: {
1233
+ type: Number,
1234
+ default: null
1235
+ }
1236
+ },
1237
+ setup(t) {
1238
+ let e = k("form"), n = k("group", {});
1239
+ e === void 0 && (e = {
1240
+ errors: {},
1241
+ getID(s) {
1242
+ }
1243
+ }), e[t.name] || (e[t.name] = t.min);
1244
+ const r = W({
1245
+ get() {
1246
+ var s;
1247
+ return n.value && e.value[n.value.name] ? (s = n.value) == null ? void 0 : s.getData(t.name) : e.value[t.name];
1248
+ },
1249
+ set(s) {
1250
+ var o;
1251
+ (o = n == null ? void 0 : n.value) != null && o.name ? n.value.setData(t.name, s) : e.value[t.name] = s;
1252
+ }
1253
+ });
1254
+ return r.value || (r.value = t.min), { modelValue: r, group: n, form: e };
1255
+ },
1256
+ methods: {
1257
+ onChange(t) {
1258
+ var n;
1259
+ let e = parseFloat(this.$number.toEnglish((n = t.detail) == null ? void 0 : n.unmasked)) || 1;
1260
+ this.$emit("update:modelValue", e), this.modelValue = e;
1261
+ },
1262
+ increment() {
1263
+ (!this.max || this.max < this.modelValue) && (this.modelValue = this.modelValue + 1);
1264
+ },
1265
+ decrement() {
1266
+ (!this.min || this.min < this.modelValue) && this.modelValue > 1 && (this.modelValue = this.modelValue - 1);
1267
+ }
1268
+ },
1269
+ data() {
1270
+ return {};
1271
+ }
1272
+ }), Ns = ["name", "value", "disabled", "readonly"];
1273
+ function Os(t, e, n, r, s, o) {
1274
+ const i = L("InputGroupText"), a = L("InputGroup"), l = en("maska");
1275
+ return m(), ee(a, { class: "input-group-quantity" }, {
1276
+ default: ie(() => [
1277
+ b("button", {
1278
+ onClick: e[0] || (e[0] = (...u) => t.increment && t.increment(...u)),
1279
+ type: "button",
1280
+ class: "btn"
1281
+ }, e[3] || (e[3] = [
1282
+ b("svg", {
1283
+ width: "800px",
1284
+ height: "800px",
1285
+ viewBox: "0 0 24 24",
1286
+ fill: "none",
1287
+ xmlns: "http://www.w3.org/2000/svg"
1288
+ }, [
1289
+ b("path", {
1290
+ d: "M13 3C13 2.44772 12.5523 2 12 2C11.4477 2 11 2.44772 11 3V11H3C2.44772 11 2 11.4477 2 12C2 12.5523 2.44772 13 3 13H11V21C11 21.5523 11.4477 22 12 22C12.5523 22 13 21.5523 13 21V13H21C21.5523 13 22 12.5523 22 12C22 11.4477 21.5523 11 21 11H13V3Z",
1291
+ fill: "#0F0F0F"
1292
+ })
1293
+ ], -1)
1294
+ ])),
1295
+ re(b("input", {
1296
+ name: t.name,
1297
+ value: this.modelValue,
1298
+ "data-maska": "###,###,###,###,###,###,###",
1299
+ "data-maska-reversed": "",
1300
+ onMaska: e[1] || (e[1] = (...u) => t.onChange && t.onChange(...u)),
1301
+ class: R([{ "is-invalid": t.form.errors[t.name] }, "form-control fanum text-center"]),
1302
+ disabled: t.disabled || t.form.processing,
1303
+ readonly: t.readonly,
1304
+ type: "tel"
1305
+ }, null, 42, Ns), [
1306
+ [l]
1307
+ ]),
1308
+ b("button", {
1309
+ onClick: e[2] || (e[2] = (...u) => t.decrement && t.decrement(...u)),
1310
+ type: "button",
1311
+ class: "btn"
1312
+ }, e[4] || (e[4] = [
1313
+ b("svg", {
1314
+ width: "800px",
1315
+ height: "800px",
1316
+ viewBox: "0 0 20 20",
1317
+ xmlns: "http://www.w3.org/2000/svg",
1318
+ fill: "none"
1319
+ }, [
1320
+ b("path", {
1321
+ fill: "#000000",
1322
+ "fill-rule": "evenodd",
1323
+ d: "M18 10a1 1 0 01-1 1H3a1 1 0 110-2h14a1 1 0 011 1z"
1324
+ })
1325
+ ], -1)
1326
+ ])),
1327
+ Q(i, { class: "fanum" }, {
1328
+ default: ie(() => [
1329
+ mt(q(t.unit), 1)
1330
+ ]),
1331
+ _: 1
1332
+ }),
1333
+ D(t.$slots, "suffix")
1334
+ ]),
1335
+ _: 3
1336
+ });
1337
+ }
1338
+ const Ds = /* @__PURE__ */ M(As, [["render", Os]]), Rs = E({
1339
+ components: { GroupControl: bs, QuantityInput: Ds, InputGroup: _t, InputGroupText: bt, Dropdown: ar, DropdownToggle: cr, DropdownMenu: pr },
1340
+ props: {
1341
+ name: {
1342
+ type: String,
1343
+ required: !0
1344
+ },
1345
+ required: Boolean,
1346
+ disabled: Boolean,
1347
+ readonly: Boolean,
1348
+ options: {
1349
+ type: Array,
1350
+ default: [],
1351
+ required: !0
1352
+ },
1353
+ max: {
1354
+ type: Number,
1355
+ default: null
1356
+ },
1357
+ totalMax: {
1358
+ type: Number,
1359
+ default: null
1360
+ },
1361
+ min: {
1362
+ type: Number,
1363
+ default: 0
1364
+ },
1365
+ totalMin: {
1366
+ type: Number,
1367
+ default: null
1368
+ },
1369
+ unit: {
1370
+ type: String,
1371
+ default: "Number"
1372
+ }
1373
+ },
1374
+ setup(t) {
1375
+ let e = k("form"), n = k("group", {});
1376
+ return e === void 0 && (e = {
1377
+ errors: {},
1378
+ getID(s) {
1379
+ }
1380
+ }), e[t.name] || (e[t.name] = t.min), { modelValue: W({
1381
+ get() {
1382
+ var s;
1383
+ return n.value && e.value[n.value.name] ? (s = n.value) == null ? void 0 : s.getData(t.name) : e.value[t.name];
1384
+ },
1385
+ set(s) {
1386
+ var o;
1387
+ (o = n == null ? void 0 : n.value) != null && o.name ? n.value.setData(t.name, s) : e.value[t.name] = s;
1388
+ }
1389
+ }), form: e };
1390
+ },
1391
+ computed: {
1392
+ totalQuantity() {
1393
+ return this.modelValue ? Object.values(this.modelValue).reduce((t, e) => t + e, 0) : this.options.length;
1394
+ }
1395
+ },
1396
+ methods: {
1397
+ show() {
1398
+ this.showDropdown = !this.showDropdown;
1399
+ },
1400
+ clickOnOutside(t) {
1401
+ this.$refs.input.contains(t.target) || (this.showDropdown = !1);
1402
+ }
1403
+ },
1404
+ mounted() {
1405
+ typeof window < "u" && window.addEventListener("click", this.clickOnOutside);
1406
+ },
1407
+ beforeUnmount() {
1408
+ typeof window < "u" && window.removeEventListener("click", this.clickOnOutside);
1409
+ },
1410
+ data() {
1411
+ return {
1412
+ showDropdown: !1
1413
+ };
1414
+ }
1415
+ }), Bs = {
1416
+ ref: "input",
1417
+ class: "multi-quantity-input fanum"
1418
+ }, js = { class: "row align-items-center justify-content-between g-0" }, Ls = ["innerHTML"], xs = { class: "col-auto" };
1419
+ function qs(t, e, n, r, s, o) {
1420
+ const i = L("QuantityInput"), a = L("GroupControl");
1421
+ return m(), g("div", Bs, [
1422
+ b("button", {
1423
+ type: "button",
1424
+ class: "form-control fanum dropdown-toggle",
1425
+ onClick: e[0] || (e[0] = nn((...l) => t.show && t.show(...l), ["prevent"]))
1426
+ }, q(t.totalQuantity) + " " + q(t.unit), 1),
1427
+ b("div", {
1428
+ class: R(["multi-quantity-input--dropdown", { show: t.showDropdown }])
1429
+ }, [
1430
+ Q(a, { name: t.name }, {
1431
+ default: ie(() => [
1432
+ (m(!0), g(pe, null, _e(t.options, (l, u) => (m(), g("div", js, [
1433
+ b("div", {
1434
+ class: "col-auto",
1435
+ innerHTML: (l == null ? void 0 : l.name) || l
1436
+ }, null, 8, Ls),
1437
+ b("div", xs, [
1438
+ Q(i, {
1439
+ name: u,
1440
+ min: l.min || t.min,
1441
+ max: l.max || t.max
1442
+ }, null, 8, ["name", "min", "max"])
1443
+ ])
1444
+ ]))), 256))
1445
+ ]),
1446
+ _: 1
1447
+ }, 8, ["name"])
1448
+ ], 2)
1449
+ ], 512);
1450
+ }
1451
+ const Ya = /* @__PURE__ */ M(Rs, [["render", qs]]), Hs = E({
1452
+ emits: ["update:modelValue", "search", "searching", "change", "selected"],
1453
+ props: {
1454
+ name: {
1455
+ type: String,
1456
+ required: !0
1457
+ },
1458
+ modelValue: "",
1459
+ label: {
1460
+ type: String,
1461
+ default: null
1462
+ },
1463
+ key: {
1464
+ type: String,
1465
+ default: null
1466
+ },
1467
+ placeholder: {
1468
+ type: String,
1469
+ default: "Click to choice"
1470
+ },
1471
+ searchPlaceholder: {
1472
+ type: String,
1473
+ default: "Type for search..."
1474
+ },
1475
+ multiple: {
1476
+ type: Boolean,
1477
+ default: !1
1478
+ },
1479
+ required: {
1480
+ type: Boolean,
1481
+ default: !1
1482
+ },
1483
+ config: {
1484
+ type: Object,
1485
+ default: {}
1486
+ },
1487
+ locale: {
1488
+ type: String,
1489
+ default: "en"
1490
+ },
1491
+ options: Array,
1492
+ searchEnabled: {
1493
+ type: Boolean,
1494
+ default: !1
1495
+ },
1496
+ hideDropdown: {
1497
+ type: Boolean,
1498
+ default: !1
1499
+ },
1500
+ search: {
1501
+ type: Object,
1502
+ default: {
1503
+ url: null
1504
+ }
1505
+ }
1506
+ },
1507
+ setup(t) {
1508
+ let e = k("form", {
1509
+ errors: {},
1510
+ getID(s) {
1511
+ return s;
1512
+ }
1513
+ }), n = k("group", {});
1514
+ return { modelValue: W({
1515
+ get() {
1516
+ var s;
1517
+ return n.value && e.value[n.value.name] ? (s = n.value) == null ? void 0 : s.getData(t.name) : e.value[t.name];
1518
+ },
1519
+ set(s) {
1520
+ var o;
1521
+ (o = n == null ? void 0 : n.value) != null && o.name ? n.value.setData(t.name, s) : e.value[t.name] = s;
1522
+ }
1523
+ }), form: e, group: n };
1524
+ },
1525
+ computed: {
1526
+ selectedValue() {
1527
+ return this.multiple ? typeof this.modelValue == "object" ? Object.values(this.modelValue) : this.modelValue ? [this.modelValue] : null : this.modelValue;
1528
+ }
1529
+ },
1530
+ watch: {
1531
+ options: {
1532
+ handler: function(t, e) {
1533
+ setTimeout(() => this.init(), 300);
1534
+ },
1535
+ deep: !0
1536
+ }
1537
+ },
1538
+ methods: {
1539
+ getKeyFromItem(t) {
1540
+ var e;
1541
+ return (e = (this.key ? t[this.key] : (t == null ? void 0 : t.id) ?? (t == null ? void 0 : t.name) ?? (t == null ? void 0 : t.label) ?? (t == null ? void 0 : t.value)) ?? t) == null ? void 0 : e.toString();
1542
+ },
1543
+ getLabelFromItem(t) {
1544
+ return (this.label ? t[this.label] : (t == null ? void 0 : t.name) ?? (t == null ? void 0 : t.label) ?? (t == null ? void 0 : t.value)) ?? t;
1545
+ },
1546
+ selected(t) {
1547
+ var e;
1548
+ return this.multiple ? (this.selectedValue || []).includes(this.getKeyFromItem(t)) : this.getKeyFromItem(t) === ((e = this.modelValue) == null ? void 0 : e.toString());
1549
+ },
1550
+ init() {
1551
+ var t, e;
1552
+ this.ChoicesClass && (this.choices && this.destroy(), typeof window < "u" && this.locale === "en" && document.dir === "rtl" && (this.currentLocale = "fa"), this.choices = new this.ChoicesClass(this.$refs.input, {
1553
+ searchEnabled: this.searchEnabled || !!((t = this.search) != null && t.url),
1554
+ searchChoices: this.searchEnabled && !((e = this.search) != null && e.url),
1555
+ removeItemButton: !0,
1556
+ placeholderValue: this.placeholder,
1557
+ searchPlaceholderValue: this.placeholder,
1558
+ shouldSort: !1,
1559
+ itemSelectText: null,
1560
+ ...this.localeTranslates[this.currentLocale],
1561
+ ...this.config
1562
+ }), this.$refs.input.addEventListener("search", this.searchHandle));
1563
+ },
1564
+ destroy() {
1565
+ var t;
1566
+ this.$refs.input.removeEventListener("search", this.searchHandle), (t = this.choices) == null || t.destroy();
1567
+ },
1568
+ searchHandle(t) {
1569
+ this.$emit("search", t), clearTimeout(this.searchDebounceTimer), this.showLoading(), this.searchDebounceTimer = setTimeout(() => {
1570
+ this.doSearch(t.detail.value);
1571
+ }, 400);
1572
+ },
1573
+ async showLoading() {
1574
+ this.loading = !0, await this.choices.setChoices(
1575
+ [{ value: "", label: this.localeTranslates[this.currentLocale].searchingPlaceholder || "Searching...", disabled: !0 }],
1576
+ "value",
1577
+ "label",
1578
+ !0
1579
+ // replaceChoices
1580
+ );
1581
+ },
1582
+ async doSearch(t) {
1583
+ var e;
1584
+ if (this.$emit("searching", t), !!((e = this.search) != null && e.url)) {
1585
+ this.searchController && this.searchController.abort(), this.searchController = new AbortController();
1586
+ try {
1587
+ const r = await (await fetch(this.search.url + "?query=" + encodeURIComponent(t), {
1588
+ method: "POST",
1589
+ signal: this.searchController.signal
1590
+ })).json();
1591
+ await this.choices.setChoices(
1592
+ r.map((s) => ({
1593
+ value: this.getKeyFromItem(s),
1594
+ label: this.getLabelFromItem(s)
1595
+ })),
1596
+ "value",
1597
+ "label",
1598
+ !0
1599
+ ), this.loading = !1;
1600
+ } catch (n) {
1601
+ n.name !== "AbortError" && (this.loading = !1, console.error(n), await this.choices.setChoices([], "value", "label", !0));
1602
+ }
1603
+ }
1604
+ }
1605
+ },
1606
+ mounted() {
1607
+ import("./choices-KiM-I_0P.js").then(({ default: t }) => {
1608
+ this.ChoicesClass = t, this.init();
1609
+ });
1610
+ },
1611
+ beforeUnmount() {
1612
+ this.destroy();
1613
+ },
1614
+ data() {
1615
+ return {
1616
+ ChoicesClass: null,
1617
+ choices: null,
1618
+ loading: !1,
1619
+ searchDebounceTimer: null,
1620
+ searchController: null,
1621
+ currentLocale: this.locale,
1622
+ localeTranslates: {
1623
+ fa: {
1624
+ placeholderValue: "انتخاب کنید...",
1625
+ searchPlaceholderValue: "برای جستجو تایپ کنید...",
1626
+ searchingPlaceholder: "در حال جستجو...",
1627
+ loadingText: "در حال جستجو...",
1628
+ noResultsText: "نتیجه ای یافت نشد",
1629
+ noChoicesText: "گزینه ای وجود ندارد"
1630
+ }
1631
+ }
1632
+ };
1633
+ }
1634
+ }), Gs = ["name"], Ws = ["value", "selected"];
1635
+ function Zs(t, e, n, r, s, o) {
1636
+ return m(), g("div", {
1637
+ class: R(["select2-controller", {
1638
+ "is-invalid": t.form.errors[t.name],
1639
+ "select2-dropdown-hidden": t.hideDropdown === !0
1640
+ }])
1641
+ }, [
1642
+ re(b("select", Hn(t.$props, {
1643
+ name: t.name,
1644
+ "onUpdate:modelValue": e[0] || (e[0] = (i) => t.modelValue = i),
1645
+ class: ["form-control-select", {
1646
+ "form-control-select--loading": t.loading,
1647
+ "is-invalid": t.form.errors[t.name]
1648
+ }],
1649
+ ref: "input"
1650
+ }), [
1651
+ (m(!0), g(pe, null, _e(t.options, (i, a) => (m(), g("option", {
1652
+ value: t.getKeyFromItem(i),
1653
+ selected: t.selected(i)
1654
+ }, q(t.getLabelFromItem(i)), 9, Ws))), 256))
1655
+ ], 16, Gs), [
1656
+ [Gn, t.modelValue]
1657
+ ])
1658
+ ], 2);
1659
+ }
1660
+ const Xa = /* @__PURE__ */ M(Hs, [["render", Zs]]), Ys = E({
1661
+ emits: ["update:modelValue"],
1662
+ props: {
1663
+ name: {
1664
+ type: String,
1665
+ default: null
1666
+ },
1667
+ modelValue: {
1668
+ type: Number,
1669
+ default: 0
1670
+ },
1671
+ value: {
1672
+ type: Number,
1673
+ default: 0
1674
+ },
1675
+ maxStars: {
1676
+ type: Number,
1677
+ default: 5
1678
+ },
1679
+ precision: {
1680
+ type: Number,
1681
+ default: 2
1682
+ },
1683
+ showValue: {
1684
+ type: Boolean,
1685
+ default: !0
1686
+ },
1687
+ readonly: {
1688
+ type: Boolean,
1689
+ default: !1
1690
+ }
1691
+ },
1692
+ setup(t) {
1693
+ let e = k("form");
1694
+ return e === void 0 && (e = {
1695
+ errors: {},
1696
+ getID(n) {
1697
+ }
1698
+ }), { form: e };
1699
+ },
1700
+ computed: {
1701
+ displayRating() {
1702
+ return (this.hoveredRating ?? this.modelValue ?? (this.name ? this.form[this.name] : null) ?? this.value).toFixed(1);
1703
+ }
1704
+ },
1705
+ methods: {
1706
+ getStarFill(t) {
1707
+ const e = this.hoveredRating ?? (this.modelValue || this.form[this.name]), n = Math.floor(e), r = e - n;
1708
+ return t <= n ? 100 : t === n + 1 ? r * 100 : 0;
1709
+ },
1710
+ setHover(t) {
1711
+ if (this.readonly) return;
1712
+ const e = this.$refs.ratingContainer.getBoundingClientRect();
1713
+ let n = t.clientX - e.left;
1714
+ this.isRTL && (n = e.width - (t.clientX - e.left));
1715
+ const r = e.width / this.maxStars;
1716
+ let s = Math.round(n / r * this.precision) / this.precision;
1717
+ s = Math.min(s, this.maxStars), this.hoveredRating = s;
1718
+ },
1719
+ updateRating() {
1720
+ this.readonly || (this.name && (this.form[this.name] = this.hoveredRating.toFixed(1)), this.$emit("update:modelValue", this.hoveredRating.toFixed(1)));
1721
+ },
1722
+ resetHover() {
1723
+ this.readonly || (this.hoveredRating = null);
1724
+ }
1725
+ },
1726
+ mounted() {
1727
+ typeof window < "u" && this.$refs.ratingContainer && (this.isRTL = getComputedStyle(this.$refs.ratingContainer).direction === "rtl");
1728
+ },
1729
+ data() {
1730
+ return {
1731
+ hoveredRating: parseFloat(this.modelValue || ((this.name ? this.form[this.name] : null) ?? this.value)),
1732
+ isRTL: !1
1733
+ };
1734
+ }
1735
+ }), Xs = { class: "star-rating" }, Ks = {
1736
+ key: 0,
1737
+ class: "rating-value fanum"
1738
+ };
1739
+ function Js(t, e, n, r, s, o) {
1740
+ return m(), g("div", Xs, [
1741
+ b("div", {
1742
+ class: "star-rating-container",
1743
+ ref: "ratingContainer",
1744
+ onMouseleave: e[0] || (e[0] = (...i) => t.resetHover && t.resetHover(...i)),
1745
+ onMousemove: e[1] || (e[1] = (...i) => t.setHover && t.setHover(...i)),
1746
+ onClick: e[2] || (e[2] = (...i) => t.updateRating && t.updateRating(...i))
1747
+ }, [
1748
+ (m(!0), g(pe, null, _e(t.maxStars, (i) => (m(), g("div", {
1749
+ key: i,
1750
+ class: "star-wrapper"
1751
+ }, [
1752
+ e[3] || (e[3] = b("div", { class: "star-bg" }, "★", -1)),
1753
+ b("span", {
1754
+ class: "star-overlay",
1755
+ style: vt({ width: t.getStarFill(i) + "%" })
1756
+ }, "★", 4)
1757
+ ]))), 128))
1758
+ ], 544),
1759
+ t.showValue && t.displayRating > 0 ? (m(), g("div", Ks, q(t.displayRating), 1)) : j("", !0)
1760
+ ]);
1761
+ }
1762
+ const Ka = /* @__PURE__ */ M(Ys, [["render", Js]]), Qs = E({
1763
+ components: {
1764
+ Spinner: wr
1765
+ },
1766
+ inject: ["form"],
1767
+ props: {
1768
+ disabled: {
1769
+ type: Boolean,
1770
+ default: !1
1771
+ }
1772
+ }
1773
+ }), ei = ["disabled"], ti = {
1774
+ key: 0,
1775
+ class: "submit-upload-percent"
1776
+ };
1777
+ function ni(t, e, n, r, s, o) {
1778
+ var a, l, u, d;
1779
+ const i = L("Spinner");
1780
+ return m(), g("button", {
1781
+ type: "submit",
1782
+ disabled: t.disabled || ((a = t.form) == null ? void 0 : a.processing) || ((l = t.form) == null ? void 0 : l.uploading)
1783
+ }, [
1784
+ (u = t.form) != null && u.processing || (d = t.form) != null && d.uploading ? (m(), ee(i, { key: 0 })) : j("", !0),
1785
+ D(t.$slots, "default", { form: t.form }, () => [
1786
+ e[0] || (e[0] = mt(" تایید و ثبت اطلاعات "))
1787
+ ]),
1788
+ D(t.$slots, "progress", {}, () => {
1789
+ var p, c;
1790
+ return [
1791
+ (p = t.form) != null && p.uploading ? (m(), g("span", ti, q((c = t.form) == null ? void 0 : c.uploading) + "%", 1)) : j("", !0)
1792
+ ];
1793
+ })
1794
+ ], 8, ei);
1795
+ }
1796
+ const Ja = /* @__PURE__ */ M(Qs, [["render", ni]]), ri = E({
1797
+ components: {
1798
+ VueTelInput: tr
1799
+ },
1800
+ props: {
1801
+ name: {
1802
+ type: String,
1803
+ default: "email",
1804
+ required: !0
1805
+ },
1806
+ placeHolder: {
1807
+ type: String,
1808
+ default: "000 000 0000"
1809
+ }
1810
+ },
1811
+ setup(t) {
1812
+ let e = k("form");
1813
+ return e === void 0 && (e = {
1814
+ errors: {},
1815
+ getID(n) {
1816
+ }
1817
+ }), { form: e };
1818
+ },
1819
+ methods: {
1820
+ inputEvent(t, e) {
1821
+ this.form[this.name] = e.number, this.valid = e.valid, console.log("input", t, e);
1822
+ }
1823
+ },
1824
+ data() {
1825
+ return {
1826
+ defaultValue: this.form[this.name],
1827
+ valid: null
1828
+ };
1829
+ }
1830
+ }), si = {
1831
+ class: "telephone-input input-group fanum",
1832
+ dir: "ltr"
1833
+ };
1834
+ function ii(t, e, n, r, s, o) {
1835
+ var a;
1836
+ const i = L("vue-tel-input");
1837
+ return m(), g("div", si, [
1838
+ Q(i, {
1839
+ mode: "national",
1840
+ validCharactersOnly: !0,
1841
+ defaultCountry: "ir",
1842
+ preferredCountries: ["ir", "us", "tr", "ca"],
1843
+ dropdownOptions: {
1844
+ showDialCodeInList: !0,
1845
+ showDialCodeInSelection: !0,
1846
+ showSearchBox: !0,
1847
+ searchBoxPlaceholder: "Search...",
1848
+ showFlags: !1
1849
+ },
1850
+ onOnInput: t.inputEvent,
1851
+ inputOptions: {
1852
+ placeholder: t.placeHolder
1853
+ },
1854
+ modelValue: t.defaultValue,
1855
+ "onUpdate:modelValue": e[0] || (e[0] = (l) => t.defaultValue = l),
1856
+ styleClasses: "form-control" + (t.valid === !1 || ((a = t.form) == null ? void 0 : a.errors[t.name]) !== void 0 ? " is-invalid" : "")
1857
+ }, null, 8, ["onOnInput", "inputOptions", "modelValue", "styleClasses"])
1858
+ ]);
1859
+ }
1860
+ const Qa = /* @__PURE__ */ M(ri, [["render", ii]]), oi = E({
1861
+ props: {
1862
+ name: {
1863
+ type: String,
1864
+ required: !0
1865
+ }
1866
+ },
1867
+ setup(t) {
1868
+ let e = k("form", {
1869
+ errors: {},
1870
+ getID(s) {
1871
+ return s;
1872
+ }
1873
+ }), n = k("group", {});
1874
+ return { modelValue: W({
1875
+ get() {
1876
+ var s;
1877
+ return n.value && e.value[n.value.name] ? (s = n.value) == null ? void 0 : s.getData(t.name) : e.value[t.name];
1878
+ },
1879
+ set(s) {
1880
+ var o;
1881
+ (o = n == null ? void 0 : n.value) != null && o.name ? n.value.setData(t.name, s) : e.value[t.name] = s;
1882
+ }
1883
+ }), form: e, group: n };
1884
+ }
1885
+ }), ai = ["name", "disabled"];
1886
+ function li(t, e, n, r, s, o) {
1887
+ var i, a;
1888
+ return re((m(), g("textarea", {
1889
+ name: t.name,
1890
+ "onUpdate:modelValue": e[0] || (e[0] = (l) => t.modelValue = l),
1891
+ class: R([{ "is-invalid": ((i = t.form) == null ? void 0 : i.errors[t.name]) !== void 0 }, "form-control"]),
1892
+ disabled: (a = t.form) == null ? void 0 : a.processing
1893
+ }, null, 10, ai)), [
1894
+ [gt, t.modelValue]
1895
+ ]);
1896
+ }
1897
+ const el = /* @__PURE__ */ M(oi, [["render", li]]), tl = {
1898
+ __name: "DropzoneInput",
1899
+ props: {
1900
+ name: {
1901
+ type: String,
1902
+ required: !0
1903
+ },
1904
+ multiple: {
1905
+ type: Boolean,
1906
+ default: !1
1907
+ },
1908
+ modelValue: String,
1909
+ url: { type: String, default: "/upload" },
1910
+ options: { type: Object, default: () => ({}) }
1911
+ },
1912
+ emits: ["update:modelValue"],
1913
+ setup(t, { emit: e }) {
1914
+ const n = t, r = e, s = k("form", {
1915
+ value: {},
1916
+ errors: {},
1917
+ getID: (u) => u
1918
+ }), o = k("group", null), i = G(null), a = G(null), l = W({
1919
+ get() {
1920
+ var u;
1921
+ return (u = o == null ? void 0 : o.value) != null && u.name ? o.value.getData(n.name) : s.value[n.name];
1922
+ },
1923
+ set(u) {
1924
+ var d;
1925
+ (d = o == null ? void 0 : o.value) != null && d.name ? o.value.setData(n.name, u) : s.value[n.name] = u, r("update:modelValue", u);
1926
+ }
1927
+ });
1928
+ return ve(() => {
1929
+ a.value = new nr(i.value, {
1930
+ url: n.url,
1931
+ addRemoveLinks: !0,
1932
+ maxFiles: n.multiple ? null : 1,
1933
+ ...n.options
1934
+ }), a.value.on("error", (u, d) => {
1935
+ let p = "خطا در آپلود";
1936
+ typeof d == "string" && (p = d), d != null && d.message && (p = d.message), u.previewElement.classList.add("dz-error");
1937
+ const c = u.previewElement.querySelector("[data-dz-errormessage]");
1938
+ c && (c.textContent = p);
1939
+ }), a.value.on("success", (u, d) => {
1940
+ const p = d.data ?? d;
1941
+ n.multiple ? l.value = [...l.value || [], p] : l.value = p;
1942
+ }), a.value.on("removedfile", async (u) => {
1943
+ let d = u.xhr.response;
1944
+ if (d)
1945
+ try {
1946
+ d = JSON.parse(d), l.value = (l.value || []).filter((p) => p.path !== d.path), await fetch(n.url, {
1947
+ method: "DELETE",
1948
+ headers: {
1949
+ "Content-Type": "application/json",
1950
+ Accept: "application/json"
1951
+ },
1952
+ body: d.path
1953
+ });
1954
+ } catch (p) {
1955
+ console.error("حذف فایل در سرور با خطا مواجه شد", p);
1956
+ }
1957
+ });
1958
+ }), (u, d) => (m(), g("div", {
1959
+ class: "inertia-dropzone-input dropzone",
1960
+ ref_key: "dz",
1961
+ ref: i
1962
+ }, null, 512));
1963
+ }
1964
+ }, ui = E({
1965
+ props: {
1966
+ modelValue: "",
1967
+ name: {
1968
+ type: String,
1969
+ required: !0
1970
+ },
1971
+ multiple: {
1972
+ type: Boolean,
1973
+ default: !1
1974
+ },
1975
+ endpoint: {
1976
+ type: String,
1977
+ default: "/upload"
1978
+ }
1979
+ },
1980
+ setup(t) {
1981
+ let e = k("form");
1982
+ return e === void 0 && (e = {
1983
+ errors: {},
1984
+ getID(n) {
1985
+ }
1986
+ }), { form: e };
1987
+ },
1988
+ computed: {
1989
+ allFiles() {
1990
+ return this.files;
1991
+ }
1992
+ },
1993
+ methods: {
1994
+ addFile(t) {
1995
+ let e = {
1996
+ id: crypto.randomUUID(),
1997
+ percent: 0,
1998
+ error: 0,
1999
+ file: t
2000
+ };
2001
+ this.multiple ? this.files.push(e) : this.files = [e], this.uploadFile(e), this.$refs.input.value = "";
2002
+ },
2003
+ calculatePercent(t, e) {
2004
+ t.lengthComputable && (this.files.find((n) => n.id === e.id).percent = Math.round(t.loaded / t.total * 100));
2005
+ },
2006
+ addFileToInputValue(t, e) {
2007
+ this.files.find((n) => n.id === t.id).path = e.data.path, this.form[this.name] = this.multiple ? this.files.map((n) => n.path) : this.files[0].path, this.$emit("update:modelValue", this.form[this.name]);
2008
+ },
2009
+ async uploadFile(t) {
2010
+ let e = this, n = new FormData();
2011
+ n.append("file", t.file), e.files.find((r) => r.id === t.id).error = "", await fetch(
2012
+ this.endpoint,
2013
+ {
2014
+ method: "POST",
2015
+ headers: {
2016
+ Accept: "application/json"
2017
+ },
2018
+ body: n
2019
+ }
2020
+ ).then((r) => r.json()).then(function(r) {
2021
+ e.addFileToInputValue(t, r);
2022
+ }).catch(function(r) {
2023
+ var s, o;
2024
+ console.error("error on uploader", r), e.files.find((i) => i.id === t.id).error = ((o = (s = r.response) == null ? void 0 : s.data) == null ? void 0 : o.message) || r.message;
2025
+ });
2026
+ },
2027
+ async deleteFile(t) {
2028
+ this.files = this.files.filter((e) => e.id !== t.id), await fetch(this.endpoint, {
2029
+ method: "DELETE",
2030
+ body: t.path
2031
+ });
2032
+ },
2033
+ fileSelected(t) {
2034
+ Array.from(t.target.files).forEach((e) => this.addFile(e));
2035
+ }
2036
+ },
2037
+ data() {
2038
+ return {
2039
+ files: []
2040
+ };
2041
+ }
2042
+ }), di = { class: "file-input-uploader" }, pi = ["name", "disabled", "multiple"], ci = { class: "file-input-uploader--list" }, fi = ["id"], hi = {
2043
+ key: 0,
2044
+ class: "file-input-uploader--progress"
2045
+ }, mi = {
2046
+ key: 1,
2047
+ class: "file-input-uploader--list-error"
2048
+ }, gi = {
2049
+ class: "file-input-uploader--list-item--size",
2050
+ dir: "ltr"
2051
+ }, yi = { class: "file-input-uploader--list-item--actions" }, vi = ["onClick"], _i = ["onClick"];
2052
+ function bi(t, e, n, r, s, o) {
2053
+ var i, a;
2054
+ return m(), g("div", di, [
2055
+ b("input", {
2056
+ ref: "input",
2057
+ name: t.name,
2058
+ class: R([{ "is-invalid": ((i = t.form) == null ? void 0 : i.errors[t.name]) !== void 0 }, "form-control"]),
2059
+ disabled: (a = t.form) == null ? void 0 : a.processing,
2060
+ type: "file",
2061
+ multiple: t.multiple,
2062
+ onChange: e[0] || (e[0] = (...l) => t.fileSelected && t.fileSelected(...l))
2063
+ }, null, 42, pi),
2064
+ b("div", ci, [
2065
+ (m(!0), g(pe, null, _e(t.allFiles, (l) => (m(), g("div", {
2066
+ id: "file-" + l.id,
2067
+ class: "file-input-uploader--list-item"
2068
+ }, [
2069
+ l.percent && l.percent < 100 ? (m(), g("div", hi, [
2070
+ b("div", {
2071
+ style: vt({ width: l.percent + "%" })
2072
+ }, null, 4)
2073
+ ])) : j("", !0),
2074
+ b("div", null, q(l.file.name), 1),
2075
+ l.error ? (m(), g("div", mi, q(l.error), 1)) : j("", !0),
2076
+ b("div", gi, q(Math.round(l.file.size / 1024)) + "Kb", 1),
2077
+ b("div", yi, [
2078
+ l.error ? (m(), g("button", {
2079
+ key: 0,
2080
+ onClick: (u) => t.uploadFile(l),
2081
+ type: "button",
2082
+ class: "file-input-uploader--list-item--btn"
2083
+ }, e[1] || (e[1] = [
2084
+ b("svg", {
2085
+ fill: "#000000",
2086
+ width: "800px",
2087
+ height: "800px",
2088
+ viewBox: "0 0 24 24",
2089
+ xmlns: "http://www.w3.org/2000/svg"
2090
+ }, [
2091
+ b("path", { d: "M1,12A11,11,0,0,1,17.882,2.7l1.411-1.41A1,1,0,0,1,21,2V6a1,1,0,0,1-1,1H16a1,1,0,0,1-.707-1.707l1.128-1.128A8.994,8.994,0,0,0,3,12a1,1,0,0,1-2,0Zm21-1a1,1,0,0,0-1,1,9.01,9.01,0,0,1-9,9,8.9,8.9,0,0,1-4.42-1.166l1.127-1.127A1,1,0,0,0,8,17H4a1,1,0,0,0-1,1v4a1,1,0,0,0,.617.924A.987.987,0,0,0,4,23a1,1,0,0,0,.707-.293L6.118,21.3A10.891,10.891,0,0,0,12,23,11.013,11.013,0,0,0,23,12,1,1,0,0,0,22,11Z" })
2092
+ ], -1)
2093
+ ]), 8, vi)) : j("", !0),
2094
+ l.path || l.error ? (m(), g("button", {
2095
+ key: 1,
2096
+ onClick: (u) => t.deleteFile(l),
2097
+ type: "button",
2098
+ class: "file-input-uploader--list-item--btn"
2099
+ }, e[2] || (e[2] = [
2100
+ b("svg", {
2101
+ fill: "#000000",
2102
+ width: "800px",
2103
+ height: "800px",
2104
+ viewBox: "0 0 24 24",
2105
+ xmlns: "http://www.w3.org/2000/svg"
2106
+ }, [
2107
+ b("path", { d: "M12,23A11,11,0,1,0,1,12,11.013,11.013,0,0,0,12,23ZM12,3a9,9,0,1,1-9,9A9.01,9.01,0,0,1,12,3ZM8.293,14.293,10.586,12,8.293,9.707A1,1,0,0,1,9.707,8.293L12,10.586l2.293-2.293a1,1,0,0,1,1.414,1.414L13.414,12l2.293,2.293a1,1,0,1,1-1.414,1.414L12,13.414,9.707,15.707a1,1,0,0,1-1.414-1.414Z" })
2108
+ ], -1)
2109
+ ]), 8, _i)) : j("", !0)
2110
+ ])
2111
+ ], 8, fi))), 256))
2112
+ ])
2113
+ ]);
2114
+ }
2115
+ const nl = /* @__PURE__ */ M(ui, [["render", bi]]), wi = E({
2116
+ emits: ["update:modelValue", "change"],
2117
+ props: {
2118
+ name: {
2119
+ type: String,
2120
+ default: null
2121
+ },
2122
+ modelValue: {
2123
+ type: Number,
2124
+ default: 0
2125
+ },
2126
+ value: {
2127
+ type: Number,
2128
+ default: 0
2129
+ },
2130
+ min: {
2131
+ type: Number,
2132
+ default: 1
2133
+ },
2134
+ max: {
2135
+ type: Number,
2136
+ default: 100
2137
+ },
2138
+ step: {
2139
+ type: Number,
2140
+ default: 1
2141
+ },
2142
+ readonly: {
2143
+ type: Boolean,
2144
+ default: !1
2145
+ },
2146
+ range: {
2147
+ type: Boolean,
2148
+ default: !1
2149
+ },
2150
+ options: {
2151
+ type: Object,
2152
+ default: {}
2153
+ }
2154
+ },
2155
+ setup(t) {
2156
+ let e = k("form", {
2157
+ errors: {},
2158
+ getID(s) {
2159
+ return s;
2160
+ }
2161
+ }), n = k("group", {});
2162
+ return { modelValue: W({
2163
+ get() {
2164
+ var s;
2165
+ return n.value && e.value[n.value.name] ? (s = n.value) == null ? void 0 : s.getData(t.name) : e.value[t.name];
2166
+ },
2167
+ set(s) {
2168
+ var o;
2169
+ (o = n == null ? void 0 : n.value) != null && o.name ? n.value.setData(t.name, s) : e.value[t.name] = s;
2170
+ }
2171
+ }), form: e, group: n };
2172
+ },
2173
+ methods: {},
2174
+ mounted() {
2175
+ import("./range-slider-pips-DTDOg3Q9.js").then(({ default: t }) => {
2176
+ let e = this;
2177
+ this.rangeSliderEn = new t({
2178
+ target: this.$refs.rangeSliderEl,
2179
+ props: {
2180
+ values: this.modelValue,
2181
+ pips: !0,
2182
+ // ... بقیه props
2183
+ min: this.min || null,
2184
+ max: this.max || null,
2185
+ ...this.options
2186
+ }
2187
+ }).$on("change", function(n) {
2188
+ var s, o;
2189
+ e.$emit("change", n);
2190
+ const r = e.range ? (s = n.detail) == null ? void 0 : s.values : (o = n.detail) == null ? void 0 : o.value;
2191
+ e.modelValue = r, e.$emit("update:modelValue", r);
2192
+ });
2193
+ });
2194
+ },
2195
+ beforeUnmount() {
2196
+ },
2197
+ data() {
2198
+ return {
2199
+ rangeSliderEn: null
2200
+ };
2201
+ }
2202
+ }), $i = {
2203
+ class: "range-input",
2204
+ ref: "rangeSliderEl",
2205
+ dir: "ltr"
2206
+ };
2207
+ function Si(t, e, n, r, s, o) {
2208
+ return m(), g("div", $i, [
2209
+ re(b("input", {
2210
+ "onUpdate:modelValue": e[0] || (e[0] = (i) => t.modelValue = i),
2211
+ type: "hidden"
2212
+ }, null, 512), [
2213
+ [gt, t.modelValue]
2214
+ ])
2215
+ ], 512);
2216
+ }
2217
+ const rl = /* @__PURE__ */ M(wi, [["render", Si]]);
2218
+ var Ge, I, sn, ae, Ut, on, an, ln, wt, et, tt, Ce = {}, un = [], Fi = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, We = Array.isArray;
2219
+ function ne(t, e) {
2220
+ for (var n in e) t[n] = e[n];
2221
+ return t;
2222
+ }
2223
+ function $t(t) {
2224
+ t && t.parentNode && t.parentNode.removeChild(t);
2225
+ }
2226
+ function St(t, e, n) {
2227
+ var r, s, o, i = {};
2228
+ for (o in e) o == "key" ? r = e[o] : o == "ref" ? s = e[o] : i[o] = e[o];
2229
+ if (arguments.length > 2 && (i.children = arguments.length > 3 ? Ge.call(arguments, 2) : n), typeof t == "function" && t.defaultProps != null) for (o in t.defaultProps) i[o] === void 0 && (i[o] = t.defaultProps[o]);
2230
+ return Oe(t, i, r, s, null);
2231
+ }
2232
+ function Oe(t, e, n, r, s) {
2233
+ var o = { type: t, props: e, key: n, ref: r, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: s ?? ++sn, __i: -1, __u: 0 };
2234
+ return s == null && I.vnode != null && I.vnode(o), o;
2235
+ }
2236
+ function ge(t) {
2237
+ return t.children;
2238
+ }
2239
+ function De(t, e) {
2240
+ this.props = t, this.context = e;
2241
+ }
2242
+ function ye(t, e) {
2243
+ if (e == null) return t.__ ? ye(t.__, t.__i + 1) : null;
2244
+ for (var n; e < t.__k.length; e++) if ((n = t.__k[e]) != null && n.__e != null) return n.__e;
2245
+ return typeof t.type == "function" ? ye(t) : null;
2246
+ }
2247
+ function dn(t) {
2248
+ var e, n;
2249
+ if ((t = t.__) != null && t.__c != null) {
2250
+ for (t.__e = t.__c.base = null, e = 0; e < t.__k.length; e++) if ((n = t.__k[e]) != null && n.__e != null) {
2251
+ t.__e = t.__c.base = n.__e;
2252
+ break;
2253
+ }
2254
+ return dn(t);
2255
+ }
2256
+ }
2257
+ function zt(t) {
2258
+ (!t.__d && (t.__d = !0) && ae.push(t) && !je.__r++ || Ut != I.debounceRendering) && ((Ut = I.debounceRendering) || on)(je);
2259
+ }
2260
+ function je() {
2261
+ for (var t, e, n, r, s, o, i, a = 1; ae.length; ) ae.length > a && ae.sort(an), t = ae.shift(), a = ae.length, t.__d && (n = void 0, r = void 0, s = (r = (e = t).__v).__e, o = [], i = [], e.__P && ((n = ne({}, r)).__v = r.__v + 1, I.vnode && I.vnode(n), Ft(e.__P, n, r, e.__n, e.__P.namespaceURI, 32 & r.__u ? [s] : null, o, s ?? ye(r), !!(32 & r.__u), i), n.__v = r.__v, n.__.__k[n.__i] = n, fn(o, n, i), r.__e = r.__ = null, n.__e != s && dn(n)));
2262
+ je.__r = 0;
2263
+ }
2264
+ function pn(t, e, n, r, s, o, i, a, l, u, d) {
2265
+ var p, c, h, v, V, z, C, T = r && r.__k || un, Z = e.length;
2266
+ for (l = Ci(n, e, T, l, Z), p = 0; p < Z; p++) (h = n.__k[p]) != null && (c = h.__i == -1 ? Ce : T[h.__i] || Ce, h.__i = p, z = Ft(t, h, c, s, o, i, a, l, u, d), v = h.__e, h.ref && c.ref != h.ref && (c.ref && Ct(c.ref, null, h), d.push(h.ref, h.__c || v, h)), V == null && v != null && (V = v), (C = !!(4 & h.__u)) || c.__k === h.__k ? l = cn(h, l, t, C) : typeof h.type == "function" && z !== void 0 ? l = z : v && (l = v.nextSibling), h.__u &= -7);
2267
+ return n.__e = V, l;
2268
+ }
2269
+ function Ci(t, e, n, r, s) {
2270
+ var o, i, a, l, u, d = n.length, p = d, c = 0;
2271
+ for (t.__k = new Array(s), o = 0; o < s; o++) (i = e[o]) != null && typeof i != "boolean" && typeof i != "function" ? (typeof i == "string" || typeof i == "number" || typeof i == "bigint" || i.constructor == String ? i = t.__k[o] = Oe(null, i, null, null, null) : We(i) ? i = t.__k[o] = Oe(ge, { children: i }, null, null, null) : i.constructor === void 0 && i.__b > 0 ? i = t.__k[o] = Oe(i.type, i.props, i.key, i.ref ? i.ref : null, i.__v) : t.__k[o] = i, l = o + c, i.__ = t, i.__b = t.__b + 1, a = null, (u = i.__i = ki(i, n, l, p)) != -1 && (p--, (a = n[u]) && (a.__u |= 2)), a == null || a.__v == null ? (u == -1 && (s > d ? c-- : s < d && c++), typeof i.type != "function" && (i.__u |= 4)) : u != l && (u == l - 1 ? c-- : u == l + 1 ? c++ : (u > l ? c-- : c++, i.__u |= 4))) : t.__k[o] = null;
2272
+ if (p) for (o = 0; o < d; o++) (a = n[o]) != null && !(2 & a.__u) && (a.__e == r && (r = ye(a)), mn(a, a));
2273
+ return r;
2274
+ }
2275
+ function cn(t, e, n, r) {
2276
+ var s, o;
2277
+ if (typeof t.type == "function") {
2278
+ for (s = t.__k, o = 0; s && o < s.length; o++) s[o] && (s[o].__ = t, e = cn(s[o], e, n, r));
2279
+ return e;
2280
+ }
2281
+ t.__e != e && (r && (e && t.type && !e.parentNode && (e = ye(t)), n.insertBefore(t.__e, e || null)), e = t.__e);
2282
+ do
2283
+ e = e && e.nextSibling;
2284
+ while (e != null && e.nodeType == 8);
2285
+ return e;
2286
+ }
2287
+ function ki(t, e, n, r) {
2288
+ var s, o, i, a = t.key, l = t.type, u = e[n], d = u != null && (2 & u.__u) == 0;
2289
+ if (u === null && a == null || d && a == u.key && l == u.type) return n;
2290
+ if (r > (d ? 1 : 0)) {
2291
+ for (s = n - 1, o = n + 1; s >= 0 || o < e.length; ) if ((u = e[i = s >= 0 ? s-- : o++]) != null && !(2 & u.__u) && a == u.key && l == u.type) return i;
2292
+ }
2293
+ return -1;
2294
+ }
2295
+ function Pt(t, e, n) {
2296
+ e[0] == "-" ? t.setProperty(e, n ?? "") : t[e] = n == null ? "" : typeof n != "number" || Fi.test(e) ? n : n + "px";
2297
+ }
2298
+ function ze(t, e, n, r, s) {
2299
+ var o, i;
2300
+ e: if (e == "style") if (typeof n == "string") t.style.cssText = n;
2301
+ else {
2302
+ if (typeof r == "string" && (t.style.cssText = r = ""), r) for (e in r) n && e in n || Pt(t.style, e, "");
2303
+ if (n) for (e in n) r && n[e] == r[e] || Pt(t.style, e, n[e]);
2304
+ }
2305
+ else if (e[0] == "o" && e[1] == "n") o = e != (e = e.replace(ln, "$1")), i = e.toLowerCase(), e = i in t || e == "onFocusOut" || e == "onFocusIn" ? i.slice(2) : e.slice(2), t.l || (t.l = {}), t.l[e + o] = n, n ? r ? n.u = r.u : (n.u = wt, t.addEventListener(e, o ? tt : et, o)) : t.removeEventListener(e, o ? tt : et, o);
2306
+ else {
2307
+ if (s == "http://www.w3.org/2000/svg") e = e.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
2308
+ else if (e != "width" && e != "height" && e != "href" && e != "list" && e != "form" && e != "tabIndex" && e != "download" && e != "rowSpan" && e != "colSpan" && e != "role" && e != "popover" && e in t) try {
2309
+ t[e] = n ?? "";
2310
+ break e;
2311
+ } catch {
2312
+ }
2313
+ typeof n == "function" || (n == null || n === !1 && e[4] != "-" ? t.removeAttribute(e) : t.setAttribute(e, e == "popover" && n == 1 ? "" : n));
2314
+ }
2315
+ }
2316
+ function At(t) {
2317
+ return function(e) {
2318
+ if (this.l) {
2319
+ var n = this.l[e.type + t];
2320
+ if (e.t == null) e.t = wt++;
2321
+ else if (e.t < n.u) return;
2322
+ return n(I.event ? I.event(e) : e);
2323
+ }
2324
+ };
2325
+ }
2326
+ function Ft(t, e, n, r, s, o, i, a, l, u) {
2327
+ var d, p, c, h, v, V, z, C, T, Z, f, _, $, U, N, H, te, P = e.type;
2328
+ if (e.constructor !== void 0) return null;
2329
+ 128 & n.__u && (l = !!(32 & n.__u), o = [a = e.__e = n.__e]), (d = I.__b) && d(e);
2330
+ e: if (typeof P == "function") try {
2331
+ if (C = e.props, T = "prototype" in P && P.prototype.render, Z = (d = P.contextType) && r[d.__c], f = d ? Z ? Z.props.value : d.__ : r, n.__c ? z = (p = e.__c = n.__c).__ = p.__E : (T ? e.__c = p = new P(C, f) : (e.__c = p = new De(C, f), p.constructor = P, p.render = Ei), Z && Z.sub(p), p.state || (p.state = {}), p.__n = r, c = p.__d = !0, p.__h = [], p._sb = []), T && p.__s == null && (p.__s = p.state), T && P.getDerivedStateFromProps != null && (p.__s == p.state && (p.__s = ne({}, p.__s)), ne(p.__s, P.getDerivedStateFromProps(C, p.__s))), h = p.props, v = p.state, p.__v = e, c) T && P.getDerivedStateFromProps == null && p.componentWillMount != null && p.componentWillMount(), T && p.componentDidMount != null && p.__h.push(p.componentDidMount);
2332
+ else {
2333
+ if (T && P.getDerivedStateFromProps == null && C !== h && p.componentWillReceiveProps != null && p.componentWillReceiveProps(C, f), e.__v == n.__v || !p.__e && p.shouldComponentUpdate != null && p.shouldComponentUpdate(C, p.__s, f) === !1) {
2334
+ for (e.__v != n.__v && (p.props = C, p.state = p.__s, p.__d = !1), e.__e = n.__e, e.__k = n.__k, e.__k.some(function(Y) {
2335
+ Y && (Y.__ = e);
2336
+ }), _ = 0; _ < p._sb.length; _++) p.__h.push(p._sb[_]);
2337
+ p._sb = [], p.__h.length && i.push(p);
2338
+ break e;
2339
+ }
2340
+ p.componentWillUpdate != null && p.componentWillUpdate(C, p.__s, f), T && p.componentDidUpdate != null && p.__h.push(function() {
2341
+ p.componentDidUpdate(h, v, V);
2342
+ });
2343
+ }
2344
+ if (p.context = f, p.props = C, p.__P = t, p.__e = !1, $ = I.__r, U = 0, T) {
2345
+ for (p.state = p.__s, p.__d = !1, $ && $(e), d = p.render(p.props, p.state, p.context), N = 0; N < p._sb.length; N++) p.__h.push(p._sb[N]);
2346
+ p._sb = [];
2347
+ } else do
2348
+ p.__d = !1, $ && $(e), d = p.render(p.props, p.state, p.context), p.state = p.__s;
2349
+ while (p.__d && ++U < 25);
2350
+ p.state = p.__s, p.getChildContext != null && (r = ne(ne({}, r), p.getChildContext())), T && !c && p.getSnapshotBeforeUpdate != null && (V = p.getSnapshotBeforeUpdate(h, v)), H = d, d != null && d.type === ge && d.key == null && (H = hn(d.props.children)), a = pn(t, We(H) ? H : [H], e, n, r, s, o, i, a, l, u), p.base = e.__e, e.__u &= -161, p.__h.length && i.push(p), z && (p.__E = p.__ = null);
2351
+ } catch (Y) {
2352
+ if (e.__v = null, l || o != null) if (Y.then) {
2353
+ for (e.__u |= l ? 160 : 128; a && a.nodeType == 8 && a.nextSibling; ) a = a.nextSibling;
2354
+ o[o.indexOf(a)] = null, e.__e = a;
2355
+ } else {
2356
+ for (te = o.length; te--; ) $t(o[te]);
2357
+ nt(e);
2358
+ }
2359
+ else e.__e = n.__e, e.__k = n.__k, Y.then || nt(e);
2360
+ I.__e(Y, e, n);
2361
+ }
2362
+ else o == null && e.__v == n.__v ? (e.__k = n.__k, e.__e = n.__e) : a = e.__e = Ti(n.__e, e, n, r, s, o, i, l, u);
2363
+ return (d = I.diffed) && d(e), 128 & e.__u ? void 0 : a;
2364
+ }
2365
+ function nt(t) {
2366
+ t && t.__c && (t.__c.__e = !0), t && t.__k && t.__k.forEach(nt);
2367
+ }
2368
+ function fn(t, e, n) {
2369
+ for (var r = 0; r < n.length; r++) Ct(n[r], n[++r], n[++r]);
2370
+ I.__c && I.__c(e, t), t.some(function(s) {
2371
+ try {
2372
+ t = s.__h, s.__h = [], t.some(function(o) {
2373
+ o.call(s);
2374
+ });
2375
+ } catch (o) {
2376
+ I.__e(o, s.__v);
2377
+ }
2378
+ });
2379
+ }
2380
+ function hn(t) {
2381
+ return typeof t != "object" || t == null || t.__b && t.__b > 0 ? t : We(t) ? t.map(hn) : ne({}, t);
2382
+ }
2383
+ function Ti(t, e, n, r, s, o, i, a, l) {
2384
+ var u, d, p, c, h, v, V, z = n.props || Ce, C = e.props, T = e.type;
2385
+ if (T == "svg" ? s = "http://www.w3.org/2000/svg" : T == "math" ? s = "http://www.w3.org/1998/Math/MathML" : s || (s = "http://www.w3.org/1999/xhtml"), o != null) {
2386
+ for (u = 0; u < o.length; u++) if ((h = o[u]) && "setAttribute" in h == !!T && (T ? h.localName == T : h.nodeType == 3)) {
2387
+ t = h, o[u] = null;
2388
+ break;
2389
+ }
2390
+ }
2391
+ if (t == null) {
2392
+ if (T == null) return document.createTextNode(C);
2393
+ t = document.createElementNS(s, T, C.is && C), a && (I.__m && I.__m(e, o), a = !1), o = null;
2394
+ }
2395
+ if (T == null) z === C || a && t.data == C || (t.data = C);
2396
+ else {
2397
+ if (o = o && Ge.call(t.childNodes), !a && o != null) for (z = {}, u = 0; u < t.attributes.length; u++) z[(h = t.attributes[u]).name] = h.value;
2398
+ for (u in z) if (h = z[u], u != "children") {
2399
+ if (u == "dangerouslySetInnerHTML") p = h;
2400
+ else if (!(u in C)) {
2401
+ if (u == "value" && "defaultValue" in C || u == "checked" && "defaultChecked" in C) continue;
2402
+ ze(t, u, null, h, s);
2403
+ }
2404
+ }
2405
+ for (u in C) h = C[u], u == "children" ? c = h : u == "dangerouslySetInnerHTML" ? d = h : u == "value" ? v = h : u == "checked" ? V = h : a && typeof h != "function" || z[u] === h || ze(t, u, h, z[u], s);
2406
+ if (d) a || p && (d.__html == p.__html || d.__html == t.innerHTML) || (t.innerHTML = d.__html), e.__k = [];
2407
+ else if (p && (t.innerHTML = ""), pn(e.type == "template" ? t.content : t, We(c) ? c : [c], e, n, r, T == "foreignObject" ? "http://www.w3.org/1999/xhtml" : s, o, i, o ? o[0] : n.__k && ye(n, 0), a, l), o != null) for (u = o.length; u--; ) $t(o[u]);
2408
+ a || (u = "value", T == "progress" && v == null ? t.removeAttribute("value") : v != null && (v !== t[u] || T == "progress" && !v || T == "option" && v != z[u]) && ze(t, u, v, z[u], s), u = "checked", V != null && V != t[u] && ze(t, u, V, z[u], s));
2409
+ }
2410
+ return t;
2411
+ }
2412
+ function Ct(t, e, n) {
2413
+ try {
2414
+ if (typeof t == "function") {
2415
+ var r = typeof t.__u == "function";
2416
+ r && t.__u(), r && e == null || (t.__u = t(e));
2417
+ } else t.current = e;
2418
+ } catch (s) {
2419
+ I.__e(s, n);
2420
+ }
2421
+ }
2422
+ function mn(t, e, n) {
2423
+ var r, s;
2424
+ if (I.unmount && I.unmount(t), (r = t.ref) && (r.current && r.current != t.__e || Ct(r, null, e)), (r = t.__c) != null) {
2425
+ if (r.componentWillUnmount) try {
2426
+ r.componentWillUnmount();
2427
+ } catch (o) {
2428
+ I.__e(o, e);
2429
+ }
2430
+ r.base = r.__P = null;
2431
+ }
2432
+ if (r = t.__k) for (s = 0; s < r.length; s++) r[s] && mn(r[s], e, n || typeof t.type != "function");
2433
+ n || $t(t.__e), t.__c = t.__ = t.__e = void 0;
2434
+ }
2435
+ function Ei(t, e, n) {
2436
+ return this.constructor(t, n);
2437
+ }
2438
+ function gn(t, e, n) {
2439
+ var r, s, o, i;
2440
+ e == document && (e = document.documentElement), I.__ && I.__(t, e), s = (r = !1) ? null : e.__k, o = [], i = [], Ft(e, t = e.__k = St(ge, null, [t]), s || Ce, Ce, e.namespaceURI, s ? null : e.firstChild ? Ge.call(e.childNodes) : null, o, s ? s.__e : e.firstChild, r, i), fn(o, t, i);
2441
+ }
2442
+ Ge = un.slice, I = { __e: function(t, e, n, r) {
2443
+ for (var s, o, i; e = e.__; ) if ((s = e.__c) && !s.__) try {
2444
+ if ((o = s.constructor) && o.getDerivedStateFromError != null && (s.setState(o.getDerivedStateFromError(t)), i = s.__d), s.componentDidCatch != null && (s.componentDidCatch(t, r || {}), i = s.__d), i) return s.__E = s;
2445
+ } catch (a) {
2446
+ t = a;
2447
+ }
2448
+ throw t;
2449
+ } }, sn = 0, De.prototype.setState = function(t, e) {
2450
+ var n;
2451
+ n = this.__s != null && this.__s != this.state ? this.__s : this.__s = ne({}, this.state), typeof t == "function" && (t = t(ne({}, n), this.props)), t && ne(n, t), t != null && this.__v && (e && this._sb.push(e), zt(this));
2452
+ }, De.prototype.forceUpdate = function(t) {
2453
+ this.__v && (this.__e = !0, t && this.__h.push(t), zt(this));
2454
+ }, De.prototype.render = ge, ae = [], on = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, an = function(t, e) {
2455
+ return t.__v.__b - e.__v.__b;
2456
+ }, je.__r = 0, ln = /(PointerCapture)$|Capture$/i, wt = 0, et = At(!1), tt = At(!0);
2457
+ var Ii = 0;
2458
+ function S(t, e, n, r, s, o) {
2459
+ e || (e = {});
2460
+ var i, a, l = e;
2461
+ if ("ref" in l) for (a in l = {}, e) a == "ref" ? i = e[a] : l[a] = e[a];
2462
+ var u = { type: t, props: l, key: n, ref: i, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --Ii, __i: -1, __u: 0, __source: s, __self: o };
2463
+ if (typeof t == "function" && (i = t.defaultProps)) for (a in i) l[a] === void 0 && (l[a] = i[a]);
2464
+ return I.vnode && I.vnode(u), u;
2465
+ }
2466
+ function yn(t) {
2467
+ var e, n, r = "";
2468
+ if (typeof t == "string" || typeof t == "number") r += t;
2469
+ else if (typeof t == "object") if (Array.isArray(t)) {
2470
+ var s = t.length;
2471
+ for (e = 0; e < s; e++) t[e] && (n = yn(t[e])) && (r && (r += " "), r += n);
2472
+ } else for (n in t) t[n] && (r && (r += " "), r += n);
2473
+ return r;
2474
+ }
2475
+ function vn() {
2476
+ for (var t, e, n = 0, r = "", s = arguments.length; n < s; n++) (t = arguments[n]) && (e = yn(t)) && (r && (r += " "), r += e);
2477
+ return r;
2478
+ }
2479
+ var ke, A, Ke, Nt, rt = 0, _n = [], O = I, Ot = O.__b, Dt = O.__r, Rt = O.diffed, Bt = O.__c, jt = O.unmount, Lt = O.__;
2480
+ function kt(t, e) {
2481
+ O.__h && O.__h(A, t, rt || e), rt = 0;
2482
+ var n = A.__H || (A.__H = { __: [], __h: [] });
2483
+ return t >= n.__.length && n.__.push({}), n.__[t];
2484
+ }
2485
+ function Vi(t) {
2486
+ return rt = 1, Mi(Sn, t);
2487
+ }
2488
+ function Mi(t, e, n) {
2489
+ var r = kt(ke++, 2);
2490
+ if (r.t = t, !r.__c && (r.__ = [Sn(void 0, e), function(a) {
2491
+ var l = r.__N ? r.__N[0] : r.__[0], u = r.t(l, a);
2492
+ l !== u && (r.__N = [u, r.__[1]], r.__c.setState({}));
2493
+ }], r.__c = A, !A.__f)) {
2494
+ var s = function(a, l, u) {
2495
+ if (!r.__c.__H) return !0;
2496
+ var d = r.__c.__H.__.filter(function(c) {
2497
+ return !!c.__c;
2498
+ });
2499
+ if (d.every(function(c) {
2500
+ return !c.__N;
2501
+ })) return !o || o.call(this, a, l, u);
2502
+ var p = r.__c.props !== a;
2503
+ return d.forEach(function(c) {
2504
+ if (c.__N) {
2505
+ var h = c.__[0];
2506
+ c.__ = c.__N, c.__N = void 0, h !== c.__[0] && (p = !0);
2507
+ }
2508
+ }), o && o.call(this, a, l, u) || p;
2509
+ };
2510
+ A.__f = !0;
2511
+ var o = A.shouldComponentUpdate, i = A.componentWillUpdate;
2512
+ A.componentWillUpdate = function(a, l, u) {
2513
+ if (this.__e) {
2514
+ var d = o;
2515
+ o = void 0, s(a, l, u), o = d;
2516
+ }
2517
+ i && i.call(this, a, l, u);
2518
+ }, A.shouldComponentUpdate = s;
2519
+ }
2520
+ return r.__N || r.__;
2521
+ }
2522
+ function bn(t, e) {
2523
+ var n = kt(ke++, 3);
2524
+ !O.__s && $n(n.__H, e) && (n.__ = t, n.u = e, A.__H.__h.push(n));
2525
+ }
2526
+ function wn(t, e) {
2527
+ var n = kt(ke++, 7);
2528
+ return $n(n.__H, e) && (n.__ = t(), n.__H = e, n.__h = t), n.__;
2529
+ }
2530
+ function Ui() {
2531
+ for (var t; t = _n.shift(); ) if (t.__P && t.__H) try {
2532
+ t.__H.__h.forEach(Re), t.__H.__h.forEach(st), t.__H.__h = [];
2533
+ } catch (e) {
2534
+ t.__H.__h = [], O.__e(e, t.__v);
2535
+ }
2536
+ }
2537
+ O.__b = function(t) {
2538
+ A = null, Ot && Ot(t);
2539
+ }, O.__ = function(t, e) {
2540
+ t && e.__k && e.__k.__m && (t.__m = e.__k.__m), Lt && Lt(t, e);
2541
+ }, O.__r = function(t) {
2542
+ Dt && Dt(t), ke = 0;
2543
+ var e = (A = t.__c).__H;
2544
+ e && (Ke === A ? (e.__h = [], A.__h = [], e.__.forEach(function(n) {
2545
+ n.__N && (n.__ = n.__N), n.u = n.__N = void 0;
2546
+ })) : (e.__h.forEach(Re), e.__h.forEach(st), e.__h = [], ke = 0)), Ke = A;
2547
+ }, O.diffed = function(t) {
2548
+ Rt && Rt(t);
2549
+ var e = t.__c;
2550
+ e && e.__H && (e.__H.__h.length && (_n.push(e) !== 1 && Nt === O.requestAnimationFrame || ((Nt = O.requestAnimationFrame) || zi)(Ui)), e.__H.__.forEach(function(n) {
2551
+ n.u && (n.__H = n.u), n.u = void 0;
2552
+ })), Ke = A = null;
2553
+ }, O.__c = function(t, e) {
2554
+ e.some(function(n) {
2555
+ try {
2556
+ n.__h.forEach(Re), n.__h = n.__h.filter(function(r) {
2557
+ return !r.__ || st(r);
2558
+ });
2559
+ } catch (r) {
2560
+ e.some(function(s) {
2561
+ s.__h && (s.__h = []);
2562
+ }), e = [], O.__e(r, n.__v);
2563
+ }
2564
+ }), Bt && Bt(t, e);
2565
+ }, O.unmount = function(t) {
2566
+ jt && jt(t);
2567
+ var e, n = t.__c;
2568
+ n && n.__H && (n.__H.__.forEach(function(r) {
2569
+ try {
2570
+ Re(r);
2571
+ } catch (s) {
2572
+ e = s;
2573
+ }
2574
+ }), n.__H = void 0, e && O.__e(e, n.__v));
2575
+ };
2576
+ var xt = typeof requestAnimationFrame == "function";
2577
+ function zi(t) {
2578
+ var e, n = function() {
2579
+ clearTimeout(r), xt && cancelAnimationFrame(e), setTimeout(t);
2580
+ }, r = setTimeout(n, 35);
2581
+ xt && (e = requestAnimationFrame(n));
2582
+ }
2583
+ function Re(t) {
2584
+ var e = A, n = t.__c;
2585
+ typeof n == "function" && (t.__c = void 0, n()), A = e;
2586
+ }
2587
+ function st(t) {
2588
+ var e = A;
2589
+ t.__c = t.__(), A = e;
2590
+ }
2591
+ function $n(t, e) {
2592
+ return !t || t.length !== e.length || e.some(function(n, r) {
2593
+ return n !== t[r];
2594
+ });
2595
+ }
2596
+ function Sn(t, e) {
2597
+ return typeof e == "function" ? e(t) : e;
2598
+ }
2599
+ function Pi(t, e = {}) {
2600
+ const n = `uppy-dropzone-file-input-${t.uppy.getID()}`, r = (d) => {
2601
+ var c, h;
2602
+ d.preventDefault(), d.stopPropagation();
2603
+ const p = Array.from(((c = d.dataTransfer) == null ? void 0 : c.files) ?? []);
2604
+ p.length && ((h = e.onDrop) == null || h.call(e, p), t.uppy.addFiles(p.map((v) => ({
2605
+ name: v.name,
2606
+ type: v.type,
2607
+ data: v
2608
+ }))));
2609
+ }, s = (d) => {
2610
+ var p;
2611
+ d.preventDefault(), d.stopPropagation(), (p = e.onDragOver) == null || p.call(e, d);
2612
+ }, o = (d) => {
2613
+ var p;
2614
+ d.preventDefault(), d.stopPropagation(), (p = e.onDragEnter) == null || p.call(e, d);
2615
+ }, i = (d) => {
2616
+ var p;
2617
+ d.preventDefault(), d.stopPropagation(), (p = e.onDragLeave) == null || p.call(e, d);
2618
+ }, a = () => {
2619
+ if (e.noClick)
2620
+ return;
2621
+ const d = document.getElementById(n);
2622
+ d == null || d.click();
2623
+ }, l = (d) => {
2624
+ (d.key === " " || d.key === "Enter" || d.keyCode === 32 || d.keyCode === 13) && a();
2625
+ }, u = (d) => {
2626
+ var h;
2627
+ const p = d.target, c = Array.from(p.files ?? []);
2628
+ c.length && ((h = e.onFileInputChange) == null || h.call(e, c), t.uppy.addFiles(c.map((v) => ({
2629
+ source: "drag-drop",
2630
+ name: v.name,
2631
+ type: v.type,
2632
+ data: v
2633
+ }))), p.value = "");
2634
+ };
2635
+ return {
2636
+ getRootProps: () => ({
2637
+ onDragEnter: o,
2638
+ onDragOver: s,
2639
+ onDragLeave: i,
2640
+ onDrop: r,
2641
+ onClick: a,
2642
+ onKeyPress: l
2643
+ }),
2644
+ getInputProps: () => {
2645
+ var c;
2646
+ const { restrictions: d } = t.uppy.opts, p = (c = d.allowedFileTypes) == null ? void 0 : c.join(", ");
2647
+ return {
2648
+ id: n,
2649
+ type: "file",
2650
+ multiple: d.maxNumberOfFiles !== 1,
2651
+ accept: p,
2652
+ onChange: u
2653
+ };
2654
+ }
2655
+ };
2656
+ }
2657
+ function Ai(t) {
2658
+ const { width: e, height: n, note: r, noClick: s, ctx: o } = t;
2659
+ if (!o.uppy)
2660
+ throw new Error("Dropzone must be used within a UppyContextProvider");
2661
+ const { getRootProps: i, getInputProps: a } = wn(() => Pi(o, { noClick: s }), [o, s]);
2662
+ return S("div", { className: "uppy-reset", "data-uppy-element": "dropzone", role: "presentation", children: [S("input", { ...a(), tabIndex: -1, name: "uppy-dropzone-file-input", className: "uppy:hidden" }), S("div", {
2663
+ ...i(),
2664
+ // biome-ignore lint/a11y/noNoninteractiveTabindex: it is also a button. getRootProps returns keyboard event handlers
2665
+ tabIndex: 0,
2666
+ style: {
2667
+ width: e || "100%",
2668
+ height: n || "100%"
2669
+ },
2670
+ className: vn("uppy:border-2 uppy:border-dashed uppy:border-gray-300", "uppy:rounded-lg uppy:p-6 uppy:bg-gray-50", "uppy:transition-colors uppy:duration-200", {
2671
+ "uppy:cursor-pointer uppy:hover:bg-blue-50": !s
2672
+ }),
2673
+ children: [S("div", { className: "uppy:flex uppy:flex-col uppy:items-center uppy:justify-center uppy:h-full uppy:space-y-3", children: S("p", { className: "uppy:text-gray-600", children: "Drop files here or click to add them" }) }), r ? S("div", { className: "uppy:text-sm uppy:text-gray-500", children: r }) : null]
2674
+ })] });
2675
+ }
2676
+ const Ni = [
2677
+ "B",
2678
+ "kB",
2679
+ "MB",
2680
+ "GB",
2681
+ "TB",
2682
+ "PB",
2683
+ "EB",
2684
+ "ZB",
2685
+ "YB"
2686
+ ], Oi = [
2687
+ "B",
2688
+ "KiB",
2689
+ "MiB",
2690
+ "GiB",
2691
+ "TiB",
2692
+ "PiB",
2693
+ "EiB",
2694
+ "ZiB",
2695
+ "YiB"
2696
+ ], Di = [
2697
+ "b",
2698
+ "kbit",
2699
+ "Mbit",
2700
+ "Gbit",
2701
+ "Tbit",
2702
+ "Pbit",
2703
+ "Ebit",
2704
+ "Zbit",
2705
+ "Ybit"
2706
+ ], Ri = [
2707
+ "b",
2708
+ "kibit",
2709
+ "Mibit",
2710
+ "Gibit",
2711
+ "Tibit",
2712
+ "Pibit",
2713
+ "Eibit",
2714
+ "Zibit",
2715
+ "Yibit"
2716
+ ], qt = (t, e, n) => {
2717
+ let r = t;
2718
+ return typeof e == "string" || Array.isArray(e) ? r = t.toLocaleString(e, n) : (e === !0 || n !== void 0) && (r = t.toLocaleString(void 0, n)), r;
2719
+ };
2720
+ function Bi(t, e) {
2721
+ if (!Number.isFinite(t))
2722
+ throw new TypeError(`Expected a finite number, got ${typeof t}: ${t}`);
2723
+ e = {
2724
+ bits: !1,
2725
+ binary: !1,
2726
+ space: !0,
2727
+ ...e
2728
+ };
2729
+ const n = e.bits ? e.binary ? Ri : Di : e.binary ? Oi : Ni, r = e.space ? " " : "";
2730
+ if (e.signed && t === 0)
2731
+ return ` 0${r}${n[0]}`;
2732
+ const s = t < 0, o = s ? "-" : e.signed ? "+" : "";
2733
+ s && (t = -t);
2734
+ let i;
2735
+ if (e.minimumFractionDigits !== void 0 && (i = { minimumFractionDigits: e.minimumFractionDigits }), e.maximumFractionDigits !== void 0 && (i = { maximumFractionDigits: e.maximumFractionDigits, ...i }), t < 1) {
2736
+ const d = qt(t, e.locale, i);
2737
+ return o + d + r + n[0];
2738
+ }
2739
+ const a = Math.min(Math.floor(e.binary ? Math.log(t) / Math.log(1024) : Math.log10(t) / 3), n.length - 1);
2740
+ t /= (e.binary ? 1024 : 1e3) ** a, i || (t = t.toPrecision(3));
2741
+ const l = qt(Number(t), e.locale, i), u = n[a];
2742
+ return o + l + r + u;
2743
+ }
2744
+ function ji(t) {
2745
+ const [e, n] = Vi(() => []), { ctx: r, editFile: s, imageThumbnail: o } = t;
2746
+ return bn(() => {
2747
+ var a;
2748
+ const i = (l, u, d) => {
2749
+ d != null && d.files && n(Object.values(d.files));
2750
+ };
2751
+ return (a = r.uppy) == null || a.on("state-update", i), () => {
2752
+ var l;
2753
+ (l = r.uppy) == null || l.off("state-update", i);
2754
+ };
2755
+ }, [r.uppy]), S("ul", { "data-uppy-element": "files-list", className: "uppy-reset uppy:my-4", children: e == null ? void 0 : e.map((i) => {
2756
+ var a, l, u;
2757
+ return S("li", { children: S(ge, { children: [S("div", { className: "uppy:flex uppy:items-center uppy:gap-2", children: [S("div", { className: "uppy:w-[32px] uppy:h-[32px]", children: S(Li, { width: "32px", height: "32px", file: i, images: o }) }), S("p", { className: "uppy:truncate", children: i.name }), S("p", { className: "uppy:text-gray-500 uppy:tabular-nums uppy:min-w-18 uppy:text-right uppy:ml-auto", children: Bi(i.size || 0) }), S(ge, { children: [s && S("button", { type: "button", className: "uppy:flex uppy:rounded uppy:text-blue-500 uppy:hover:text-blue-700 uppy:bg-transparent uppy:transition-colors", onClick: () => {
2758
+ s(i);
2759
+ }, children: "edit" }), S("button", { type: "button", className: "uppy:flex uppy:rounded uppy:text-blue-500 uppy:hover:text-blue-700 uppy:bg-transparent uppy:transition-colors", onClick: () => {
2760
+ var d;
2761
+ (d = r.uppy) == null || d.removeFile(i.id);
2762
+ }, children: "remove" })] })] }), S("progress", { max: "100", className: vn("uppy:w-full uppy:h-[2px] uppy:appearance-none uppy:bg-gray-100 uppy:rounded-full uppy:overflow-hidden uppy:[&::-webkit-progress-bar]:bg-gray-100 uppy:block uppy:my-2", {
2763
+ "uppy:[&::-webkit-progress-value]:bg-green-500 uppy:[&::-moz-progress-bar]:bg-green-500": (a = i.progress) == null ? void 0 : a.uploadComplete,
2764
+ "uppy:[&::-webkit-progress-value]:bg-red-500 uppy:[&::-moz-progress-bar]:bg-red-500": i.error,
2765
+ "uppy:[&::-webkit-progress-value]:bg-blue-500 uppy:[&::-moz-progress-bar]:bg-blue-500": !((l = i.progress) != null && l.uploadComplete) && !i.error
2766
+ }), value: ((u = i.progress) == null ? void 0 : u.percentage) || 0 })] }) }, i.id);
2767
+ }) });
2768
+ }
2769
+ function Li(t) {
2770
+ var d, p;
2771
+ const e = t.width || "100%", n = t.height || "100%", r = ((d = t.file.type) == null ? void 0 : d.split("/")[0]) || "", s = ((p = t.file.type) == null ? void 0 : p.split("/")[1]) || "", o = t.file.type.startsWith("image/"), i = r === "application" && [
2772
+ "zip",
2773
+ "x-7z-compressed",
2774
+ "x-zip-compressed",
2775
+ "x-rar-compressed",
2776
+ "x-tar",
2777
+ "x-gzip",
2778
+ "x-apple-diskimage"
2779
+ ].includes(s), a = r === "application" && s === "pdf", l = wn(() => {
2780
+ if (!t.images)
2781
+ return "";
2782
+ if (t.file.isRemote)
2783
+ return t.file.preview;
2784
+ if (t.file.data == null)
2785
+ throw new Error("File data is empty");
2786
+ return URL.createObjectURL(t.file.data);
2787
+ }, [t.file.data, t.images, t.file.isRemote, t.file.preview]), u = t.images && o && l;
2788
+ return bn(() => () => {
2789
+ l && URL.revokeObjectURL(l);
2790
+ }, [l]), S("div", { "data-uppy-element": "thumbnail", className: "uppy:relative uppy:overflow-hidden uppy:bg-gray-100 uppy:rounded-lg uppy:flex uppy:items-center uppy:justify-center", style: {
2791
+ width: e,
2792
+ height: n,
2793
+ aspectRatio: "1"
2794
+ }, children: [u ? S("img", { className: "uppy:w-full uppy:h-full uppy:object-cover", src: l, alt: t.file.name }) : null, u ? null : S("div", { className: "uppy:flex uppy:flex-col uppy:items-center uppy:justify-center uppy:w-full uppy:h-full", children: S("div", { className: "uppy:flex-1 uppy:flex uppy:items-center uppy:justify-center uppy:w-full", children: [t.file.type ? null : S("svg", { "aria-hidden": "true", className: "uppy:w-3/4 uppy:h-3/4", viewBox: "0 0 25 25", children: S("g", { fill: "#A7AFB7", "fill-rule": "nonzero", children: [S("path", { d: "M5.5 22a.5.5 0 0 1-.5-.5v-18a.5.5 0 0 1 .5-.5h10.719a.5.5 0 0 1 .367.16l3.281 3.556a.5.5 0 0 1 .133.339V21.5a.5.5 0 0 1-.5.5h-14zm.5-1h13V7.25L16 4H6v17z" }), S("path", { d: "M15 4v3a1 1 0 0 0 1 1h3V7h-3V4h-1z" })] }) }), r === "text" ? S("svg", { "aria-hidden": "true", className: "uppy:w-3/4 uppy:h-3/4", viewBox: "0 0 25 25", children: S("path", { d: "M4.5 7h13a.5.5 0 1 1 0 1h-13a.5.5 0 0 1 0-1zm0 3h15a.5.5 0 1 1 0 1h-15a.5.5 0 1 1 0-1zm0 3h15a.5.5 0 1 1 0 1h-15a.5.5 0 1 1 0-1zm0 3h10a.5.5 0 1 1 0 1h-10a.5.5 0 1 1 0-1z", fill: "#5A5E69", "fill-rule": "nonzero" }) }) : null, r === "image" && !u ? S("svg", { "aria-hidden": "true", className: "uppy:w-3/4 uppy:h-3/4", viewBox: "0 0 25 25", children: S("g", { fill: "#686DE0", "fill-rule": "evenodd", children: [S("path", { d: "M5 7v10h15V7H5zm0-1h15a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1z", "fill-rule": "nonzero" }), S("path", { d: "M6.35 17.172l4.994-5.026a.5.5 0 0 1 .707 0l2.16 2.16 3.505-3.505a.5.5 0 0 1 .707 0l2.336 2.31-.707.72-1.983-1.97-3.505 3.505a.5.5 0 0 1-.707 0l-2.16-2.159-3.938 3.939-1.409.026z", "fill-rule": "nonzero" }), S("circle", { cx: "7.5", cy: "9.5", r: "1.5" })] }) }) : null, r === "audio" ? S("svg", { "aria-hidden": "true", className: "uppy:w-3/4 uppy:h-3/4", viewBox: "0 0 25 25", children: S("path", { d: "M9.5 18.64c0 1.14-1.145 2-2.5 2s-2.5-.86-2.5-2c0-1.14 1.145-2 2.5-2 .557 0 1.079.145 1.5.396V7.25a.5.5 0 0 1 .379-.485l9-2.25A.5.5 0 0 1 18.5 5v11.64c0 1.14-1.145 2-2.5 2s-2.5-.86-2.5-2c0-1.14 1.145-2 2.5-2 .557 0 1.079.145 1.5.396V8.67l-8 2v7.97zm8-11v-2l-8 2v2l8-2zM7 19.64c.855 0 1.5-.484 1.5-1s-.645-1-1.5-1-1.5.484-1.5 1 .645 1 1.5 1zm9-2c.855 0 1.5-.484 1.5-1s-.645-1-1.5-1-1.5.484-1.5 1 .645 1 1.5 1z", fill: "#049BCF", "fill-rule": "nonzero" }) }) : null, r === "video" ? S("svg", { "aria-hidden": "true", className: "uppy:w-3/4 uppy:h-3/4", viewBox: "0 0 25 25", children: S("path", { d: "M16 11.834l4.486-2.691A1 1 0 0 1 22 10v6a1 1 0 0 1-1.514.857L16 14.167V17a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v2.834zM15 9H5v8h10V9zm1 4l5 3v-6l-5 3z", fill: "#19AF67", "fill-rule": "nonzero" }) }) : null, a ? S("svg", { "aria-hidden": "true", className: "uppy:w-3/4 uppy:h-3/4", viewBox: "0 0 25 25", children: S("path", { d: "M9.766 8.295c-.691-1.843-.539-3.401.747-3.726 1.643-.414 2.505.938 2.39 3.299-.039.79-.194 1.662-.537 3.148.324.49.66.967 1.055 1.51.17.231.382.488.629.757 1.866-.128 3.653.114 4.918.655 1.487.635 2.192 1.685 1.614 2.84-.566 1.133-1.839 1.084-3.416.249-1.141-.604-2.457-1.634-3.51-2.707a13.467 13.467 0 0 0-2.238.426c-1.392 4.051-4.534 6.453-5.707 4.572-.986-1.58 1.38-4.206 4.914-5.375.097-.322.185-.656.264-1.001.08-.353.306-1.31.407-1.737-.678-1.059-1.2-2.031-1.53-2.91zm2.098 4.87c-.033.144-.068.287-.104.427l.033-.01-.012.038a14.065 14.065 0 0 1 1.02-.197l-.032-.033.052-.004a7.902 7.902 0 0 1-.208-.271c-.197-.27-.38-.526-.555-.775l-.006.028-.002-.003c-.076.323-.148.632-.186.8zm5.77 2.978c1.143.605 1.832.632 2.054.187.26-.519-.087-1.034-1.113-1.473-.911-.39-2.175-.608-3.55-.608.845.766 1.787 1.459 2.609 1.894zM6.559 18.789c.14.223.693.16 1.425-.413.827-.648 1.61-1.747 2.208-3.206-2.563 1.064-4.102 2.867-3.633 3.62zm5.345-10.97c.088-1.793-.351-2.48-1.146-2.28-.473.119-.564 1.05-.056 2.405.213.566.52 1.188.908 1.859.18-.858.268-1.453.294-1.984z", fill: "#E2514A", "fill-rule": "nonzero" }) }) : null, i ? S("svg", { "aria-hidden": "true", className: "uppy:w-3/4 uppy:h-3/4", viewBox: "0 0 25 25", children: S("path", { d: "M10.45 2.05h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5V2.55a.5.5 0 0 1 .5-.5zm2.05 1.024h1.05a.5.5 0 0 1 .5.5V3.6a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5v-.001zM10.45 0h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5V.5a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-2.05 3.074h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-2.05 1.024h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm-2.05 1.025h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm-2.05 1.025h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-1.656 3.074l-.82 5.946c.52.302 1.174.458 1.976.458.803 0 1.455-.156 1.975-.458l-.82-5.946h-2.311zm0-1.025h2.312c.512 0 .946.378 1.015.885l.82 5.946c.056.412-.142.817-.501 1.026-.686.398-1.515.597-2.49.597-.974 0-1.804-.199-2.49-.597a1.025 1.025 0 0 1-.5-1.026l.819-5.946c.07-.507.503-.885 1.015-.885zm.545 6.6a.5.5 0 0 1-.397-.561l.143-.999a.5.5 0 0 1 .495-.429h.74a.5.5 0 0 1 .495.43l.143.998a.5.5 0 0 1-.397.561c-.404.08-.819.08-1.222 0z", fill: "#00C469", "fill-rule": "nonzero" }) }) : null, t.file.type && !r && !a && !i ? S("svg", { "aria-hidden": "true", className: "uppy:w-3/4 uppy:h-3/4", viewBox: "0 0 25 25", children: S("g", { fill: "#A7AFB7", "fill-rule": "nonzero", children: [S("path", { d: "M5.5 22a.5.5 0 0 1-.5-.5v-18a.5.5 0 0 1 .5-.5h10.719a.5.5 0 0 1 .367.16l3.281 3.556a.5.5 0 0 1 .133.339V21.5a.5.5 0 0 1-.5.5h-14zm.5-1h13V7.25L16 4H6v17z" }), S("path", { d: "M15 4v3a1 1 0 0 0 1 1h3V7h-3V4h-1z" })] }) }) : null] }) })] });
2795
+ }
2796
+ function xi({ uppy: t, onStatusChange: e, onProgressChange: n }) {
2797
+ const r = () => {
2798
+ e("ready");
2799
+ }, s = () => {
2800
+ t.getFiles().length === 0 && e("init");
2801
+ }, o = () => {
2802
+ e("uploading");
2803
+ }, i = () => {
2804
+ e("uploading");
2805
+ }, a = (c) => {
2806
+ var h, v;
2807
+ ((h = c == null ? void 0 : c.failed) != null && h.length || (v = c == null ? void 0 : c.successful) != null && v.length) && (e("complete"), n(0));
2808
+ }, l = () => {
2809
+ e("error"), n(0);
2810
+ }, u = () => {
2811
+ e("init"), n(0);
2812
+ }, d = () => {
2813
+ e("paused");
2814
+ }, p = (c) => {
2815
+ n(c);
2816
+ };
2817
+ return t.on("file-added", r), t.on("file-removed", s), t.on("progress", p), t.on("upload", o), t.on("complete", a), t.on("error", l), t.on("cancel-all", u), t.on("pause-all", d), t.on("resume-all", i), {
2818
+ cleanup: () => {
2819
+ t.off("file-added", r), t.off("progress", p), t.off("upload", o), t.off("complete", a), t.off("error", l), t.off("cancel-all", u), t.off("pause-all", d), t.off("resume-all", i);
2820
+ }
2821
+ };
2822
+ }
2823
+ const Fn = Symbol("uppy"), qi = E({
2824
+ name: "UppyContextProvider",
2825
+ props: {
2826
+ uppy: {
2827
+ type: Object,
2828
+ required: !0
2829
+ }
2830
+ },
2831
+ setup(t, { slots: e }) {
2832
+ const n = G("init"), r = G(0), s = tn({
2833
+ uppy: Wn(t.uppy),
2834
+ status: "init",
2835
+ progress: 0
2836
+ });
2837
+ Zn(Fn, s);
2838
+ let o;
2839
+ return ve(() => {
2840
+ if (!t.uppy)
2841
+ throw new Error("UppyContextProvider: passing `uppy` as a prop is required");
2842
+ o = xi({
2843
+ uppy: t.uppy,
2844
+ onStatusChange: (i) => {
2845
+ n.value = i, s.status = i;
2846
+ },
2847
+ onProgressChange: (i) => {
2848
+ r.value = i, s.progress = i;
2849
+ }
2850
+ });
2851
+ }), ht(() => {
2852
+ o == null || o.cleanup();
2853
+ }), () => {
2854
+ var i;
2855
+ return (i = e.default) == null ? void 0 : i.call(e);
2856
+ };
2857
+ }
2858
+ });
2859
+ function Cn() {
2860
+ const t = k(Fn);
2861
+ return t || {
2862
+ uppy: void 0,
2863
+ status: "init",
2864
+ progress: 0
2865
+ };
2866
+ }
2867
+ const Hi = E({
2868
+ name: "Dropzone",
2869
+ props: ["width", "height", "note", "noClick"],
2870
+ setup(t) {
2871
+ const e = G(null), n = Cn();
2872
+ function r() {
2873
+ e.value && gn(St(Ai, {
2874
+ ...t,
2875
+ ctx: n
2876
+ }), e.value);
2877
+ }
2878
+ return ve(() => {
2879
+ r();
2880
+ }), Fe(n, () => {
2881
+ r();
2882
+ }), Fe(() => t, () => {
2883
+ r();
2884
+ }, { deep: !0 }), () => rn("div", { ref: e });
2885
+ }
2886
+ }), Gi = E({
2887
+ name: "FilesList",
2888
+ props: ["editFile", "imageThumbnail"],
2889
+ setup(t) {
2890
+ const e = G(null), n = Cn();
2891
+ function r() {
2892
+ e.value && gn(St(ji, {
2893
+ ...t,
2894
+ ctx: n
2895
+ }), e.value);
2896
+ }
2897
+ return ve(() => {
2898
+ r();
2899
+ }), Fe(n, () => {
2900
+ r();
2901
+ }), Fe(() => t, () => {
2902
+ r();
2903
+ }, { deep: !0 }), () => rn("div", { ref: e });
2904
+ }
2905
+ });
2906
+ function kn(t) {
2907
+ const e = t.lastIndexOf(".");
2908
+ return e === -1 || e === t.length - 1 ? {
2909
+ name: t,
2910
+ extension: void 0
2911
+ } : {
2912
+ name: t.slice(0, e),
2913
+ extension: t.slice(e + 1)
2914
+ };
2915
+ }
2916
+ const Ht = {
2917
+ __proto__: null,
2918
+ md: "text/markdown",
2919
+ markdown: "text/markdown",
2920
+ mp4: "video/mp4",
2921
+ mp3: "audio/mp3",
2922
+ svg: "image/svg+xml",
2923
+ jpg: "image/jpeg",
2924
+ png: "image/png",
2925
+ webp: "image/webp",
2926
+ gif: "image/gif",
2927
+ heic: "image/heic",
2928
+ heif: "image/heif",
2929
+ yaml: "text/yaml",
2930
+ yml: "text/yaml",
2931
+ csv: "text/csv",
2932
+ tsv: "text/tab-separated-values",
2933
+ tab: "text/tab-separated-values",
2934
+ avi: "video/x-msvideo",
2935
+ mks: "video/x-matroska",
2936
+ mkv: "video/x-matroska",
2937
+ mov: "video/quicktime",
2938
+ dicom: "application/dicom",
2939
+ doc: "application/msword",
2940
+ msg: "application/vnd.ms-outlook",
2941
+ docm: "application/vnd.ms-word.document.macroenabled.12",
2942
+ docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
2943
+ dot: "application/msword",
2944
+ dotm: "application/vnd.ms-word.template.macroenabled.12",
2945
+ dotx: "application/vnd.openxmlformats-officedocument.wordprocessingml.template",
2946
+ xla: "application/vnd.ms-excel",
2947
+ xlam: "application/vnd.ms-excel.addin.macroenabled.12",
2948
+ xlc: "application/vnd.ms-excel",
2949
+ xlf: "application/x-xliff+xml",
2950
+ xlm: "application/vnd.ms-excel",
2951
+ xls: "application/vnd.ms-excel",
2952
+ xlsb: "application/vnd.ms-excel.sheet.binary.macroenabled.12",
2953
+ xlsm: "application/vnd.ms-excel.sheet.macroenabled.12",
2954
+ xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
2955
+ xlt: "application/vnd.ms-excel",
2956
+ xltm: "application/vnd.ms-excel.template.macroenabled.12",
2957
+ xltx: "application/vnd.openxmlformats-officedocument.spreadsheetml.template",
2958
+ xlw: "application/vnd.ms-excel",
2959
+ txt: "text/plain",
2960
+ text: "text/plain",
2961
+ conf: "text/plain",
2962
+ log: "text/plain",
2963
+ pdf: "application/pdf",
2964
+ zip: "application/zip",
2965
+ "7z": "application/x-7z-compressed",
2966
+ rar: "application/x-rar-compressed",
2967
+ tar: "application/x-tar",
2968
+ gz: "application/gzip",
2969
+ dmg: "application/x-apple-diskimage"
2970
+ };
2971
+ function Tn(t) {
2972
+ var n;
2973
+ if (t.type)
2974
+ return t.type;
2975
+ const e = t.name ? (n = kn(t.name).extension) == null ? void 0 : n.toLowerCase() : null;
2976
+ return e && e in Ht ? Ht[e] : "application/octet-stream";
2977
+ }
2978
+ function Wi(t) {
2979
+ return t.charCodeAt(0).toString(32);
2980
+ }
2981
+ function Gt(t) {
2982
+ let e = "";
2983
+ return t.replace(/[^A-Z0-9]/gi, (n) => (e += `-${Wi(n)}`, "/")) + e;
2984
+ }
2985
+ function Zi(t, e) {
2986
+ var r;
2987
+ let n = e || "uppy";
2988
+ return typeof t.name == "string" && (n += `-${Gt(t.name.toLowerCase())}`), t.type !== void 0 && (n += `-${t.type}`), t.meta && typeof t.meta.relativePath == "string" && (n += `-${Gt(t.meta.relativePath.toLowerCase())}`), ((r = t.data) == null ? void 0 : r.size) !== void 0 && (n += `-${t.data.size}`), t.data.lastModified !== void 0 && (n += `-${t.data.lastModified}`), n;
2989
+ }
2990
+ function Yi(t) {
2991
+ return !t.isRemote || !t.remote ? !1 : (/* @__PURE__ */ new Set([
2992
+ "box",
2993
+ "dropbox",
2994
+ "drive",
2995
+ "facebook",
2996
+ "unsplash"
2997
+ ])).has(t.remote.provider);
2998
+ }
2999
+ function Xi(t, e) {
3000
+ if (Yi(t))
3001
+ return t.id;
3002
+ const n = Tn(t);
3003
+ return Zi({
3004
+ ...t,
3005
+ type: n
3006
+ }, e);
3007
+ }
3008
+ function Je(t) {
3009
+ return t < 10 ? `0${t}` : t.toString();
3010
+ }
3011
+ function Be() {
3012
+ const t = /* @__PURE__ */ new Date(), e = Je(t.getHours()), n = Je(t.getMinutes()), r = Je(t.getSeconds());
3013
+ return `${e}:${n}:${r}`;
3014
+ }
3015
+ function Ki(t, e, n) {
3016
+ const r = [];
3017
+ return t.forEach((s) => typeof s != "string" ? r.push(s) : e[Symbol.split](s).forEach((o, i, a) => {
3018
+ o !== "" && r.push(o), i < a.length - 1 && r.push(n);
3019
+ })), r;
3020
+ }
3021
+ /**
3022
+ * Takes a string with placeholder variables like `%{smart_count} file selected`
3023
+ * and replaces it with values from options `{smart_count: 5}`
3024
+ *
3025
+ * @license https://github.com/airbnb/polyglot.js/blob/master/LICENSE
3026
+ * taken from https://github.com/airbnb/polyglot.js/blob/master/lib/polyglot.js#L299
3027
+ *
3028
+ * @param phrase that needs interpolation, with placeholders
3029
+ * @param options with values that will be used to replace placeholders
3030
+ */
3031
+ function Wt(t, e) {
3032
+ const n = /\$/g, r = "$$$$";
3033
+ let s = [t];
3034
+ if (e == null)
3035
+ return s;
3036
+ for (const o of Object.keys(e))
3037
+ if (o !== "_") {
3038
+ let i = e[o];
3039
+ typeof i == "string" && (i = n[Symbol.replace](i, r)), s = Ki(s, new RegExp(`%\\{${o}\\}`, "g"), i);
3040
+ }
3041
+ return s;
3042
+ }
3043
+ const Ji = (t) => {
3044
+ throw new Error(`missing string: ${t}`);
3045
+ };
3046
+ var Te, Ee, it;
3047
+ class Qi {
3048
+ constructor(e, { onMissingKey: n = Ji } = {}) {
3049
+ x(this, Ee);
3050
+ B(this, "locale");
3051
+ x(this, Te);
3052
+ this.locale = {
3053
+ strings: {},
3054
+ pluralize(r) {
3055
+ return r === 1 ? 0 : 1;
3056
+ }
3057
+ }, Array.isArray(e) ? e.forEach(F(this, Ee, it), this) : F(this, Ee, it).call(this, e), Me(this, Te, n);
3058
+ }
3059
+ /**
3060
+ * Public translate method
3061
+ *
3062
+ * @param key
3063
+ * @param options with values that will be used later to replace placeholders in string
3064
+ * @returns string translated (and interpolated)
3065
+ */
3066
+ translate(e, n) {
3067
+ return this.translateArray(e, n).join("");
3068
+ }
3069
+ /**
3070
+ * Get a translation and return the translated and interpolated parts as an array.
3071
+ *
3072
+ * @returns The translated and interpolated parts, in order.
3073
+ */
3074
+ translateArray(e, n) {
3075
+ let r = this.locale.strings[e];
3076
+ if (r == null && (w(this, Te).call(this, e), r = e), typeof r == "object") {
3077
+ if (n && typeof n.smart_count < "u") {
3078
+ const o = this.locale.pluralize(n.smart_count);
3079
+ return Wt(r[o], n);
3080
+ }
3081
+ throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}");
3082
+ }
3083
+ if (typeof r != "string")
3084
+ throw new Error("string was not a string");
3085
+ return Wt(r, n);
3086
+ }
3087
+ }
3088
+ Te = new WeakMap(), Ee = new WeakSet(), it = function(e) {
3089
+ if (!(e != null && e.strings))
3090
+ return;
3091
+ const n = this.locale;
3092
+ Object.assign(this.locale, {
3093
+ strings: { ...n.strings, ...e.strings },
3094
+ pluralize: e.pluralize || n.pluralize
3095
+ });
3096
+ };
3097
+ const eo = {
3098
+ debug: () => {
3099
+ },
3100
+ warn: () => {
3101
+ },
3102
+ error: (...t) => console.error(`[Uppy] [${Be()}]`, ...t)
3103
+ }, to = {
3104
+ debug: (...t) => console.debug(`[Uppy] [${Be()}]`, ...t),
3105
+ warn: (...t) => console.warn(`[Uppy] [${Be()}]`, ...t),
3106
+ error: (...t) => console.error(`[Uppy] [${Be()}]`, ...t)
3107
+ };
3108
+ var Pe = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
3109
+ function Ze(t) {
3110
+ return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
3111
+ }
3112
+ var no = function(e) {
3113
+ if (typeof e != "number" || Number.isNaN(e))
3114
+ throw new TypeError(`Expected a number, got ${typeof e}`);
3115
+ const n = e < 0;
3116
+ let r = Math.abs(e);
3117
+ if (n && (r = -r), r === 0)
3118
+ return "0 B";
3119
+ const s = ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"], o = Math.min(Math.floor(Math.log(r) / Math.log(1024)), s.length - 1), i = Number(r / 1024 ** o), a = s[o];
3120
+ return `${i >= 10 || i % 1 === 0 ? Math.round(i) : i.toFixed(1)} ${a}`;
3121
+ };
3122
+ const Ae = /* @__PURE__ */ Ze(no);
3123
+ function En(t, e) {
3124
+ this.text = t = t || "", this.hasWild = ~t.indexOf("*"), this.separator = e, this.parts = t.split(e);
3125
+ }
3126
+ En.prototype.match = function(t) {
3127
+ var e = !0, n = this.parts, r, s = n.length, o;
3128
+ if (typeof t == "string" || t instanceof String)
3129
+ if (!this.hasWild && this.text != t)
3130
+ e = !1;
3131
+ else {
3132
+ for (o = (t || "").split(this.separator), r = 0; e && r < s; r++)
3133
+ n[r] !== "*" && (r < o.length ? e = n[r] === o[r] : e = !1);
3134
+ e = e && o;
3135
+ }
3136
+ else if (typeof t.splice == "function")
3137
+ for (e = [], r = t.length; r--; )
3138
+ this.match(t[r]) && (e[e.length] = t[r]);
3139
+ else if (typeof t == "object") {
3140
+ e = {};
3141
+ for (var i in t)
3142
+ this.match(i) && (e[i] = t[i]);
3143
+ }
3144
+ return e;
3145
+ };
3146
+ var ro = function(t, e, n) {
3147
+ var r = new En(t, n || /[\/\.]/);
3148
+ return typeof e < "u" ? r.match(e) : r;
3149
+ }, so = ro, io = /[\/\+\.]/, oo = function(t, e) {
3150
+ function n(r) {
3151
+ var s = so(r, t, io);
3152
+ return s && s.length >= 2;
3153
+ }
3154
+ return e ? n(e.split(";")[0]) : n;
3155
+ };
3156
+ const ao = /* @__PURE__ */ Ze(oo), lo = {
3157
+ maxFileSize: null,
3158
+ minFileSize: null,
3159
+ maxTotalFileSize: null,
3160
+ maxNumberOfFiles: null,
3161
+ minNumberOfFiles: null,
3162
+ allowedFileTypes: null,
3163
+ requiredMetaFields: []
3164
+ };
3165
+ class J extends Error {
3166
+ constructor(n, r) {
3167
+ super(n);
3168
+ B(this, "isUserFacing");
3169
+ B(this, "file");
3170
+ B(this, "isRestriction", !0);
3171
+ this.isUserFacing = (r == null ? void 0 : r.isUserFacing) ?? !0, r != null && r.file && (this.file = r.file);
3172
+ }
3173
+ }
3174
+ class uo {
3175
+ constructor(e, n) {
3176
+ B(this, "getI18n");
3177
+ B(this, "getOpts");
3178
+ this.getI18n = n, this.getOpts = () => {
3179
+ var s;
3180
+ const r = e();
3181
+ if (((s = r.restrictions) == null ? void 0 : s.allowedFileTypes) != null && !Array.isArray(r.restrictions.allowedFileTypes))
3182
+ throw new TypeError("`restrictions.allowedFileTypes` must be an array");
3183
+ return r;
3184
+ };
3185
+ }
3186
+ // Because these operations are slow, we cannot run them for every file (if we are adding multiple files)
3187
+ validateAggregateRestrictions(e, n) {
3188
+ const { maxTotalFileSize: r, maxNumberOfFiles: s } = this.getOpts().restrictions;
3189
+ if (s && e.filter((i) => !i.isGhost).length + n.length > s)
3190
+ throw new J(`${this.getI18n()("youCanOnlyUploadX", {
3191
+ smart_count: s
3192
+ })}`);
3193
+ if (r) {
3194
+ const o = [...e, ...n].reduce((i, a) => i + (a.size ?? 0), 0);
3195
+ if (o > r)
3196
+ throw new J(this.getI18n()("aggregateExceedsSize", {
3197
+ sizeAllowed: Ae(r),
3198
+ size: Ae(o)
3199
+ }));
3200
+ }
3201
+ }
3202
+ validateSingleFile(e) {
3203
+ const { maxFileSize: n, minFileSize: r, allowedFileTypes: s } = this.getOpts().restrictions;
3204
+ if (s && !s.some((i) => i.includes("/") ? e.type ? ao(e.type.replace(/;.*?$/, ""), i) : !1 : i[0] === "." && e.extension ? e.extension.toLowerCase() === i.slice(1).toLowerCase() : !1)) {
3205
+ const i = s.join(", ");
3206
+ throw new J(this.getI18n()("youCanOnlyUploadFileTypes", {
3207
+ types: i
3208
+ }), { file: e });
3209
+ }
3210
+ if (n && e.size != null && e.size > n)
3211
+ throw new J(this.getI18n()("exceedsSize", {
3212
+ size: Ae(n),
3213
+ file: e.name ?? this.getI18n()("unnamed")
3214
+ }), { file: e });
3215
+ if (r && e.size != null && e.size < r)
3216
+ throw new J(this.getI18n()("inferiorSize", {
3217
+ size: Ae(r)
3218
+ }), { file: e });
3219
+ }
3220
+ validate(e, n) {
3221
+ n.forEach((r) => {
3222
+ this.validateSingleFile(r);
3223
+ }), this.validateAggregateRestrictions(e, n);
3224
+ }
3225
+ validateMinNumberOfFiles(e) {
3226
+ const { minNumberOfFiles: n } = this.getOpts().restrictions;
3227
+ if (n && Object.keys(e).length < n)
3228
+ throw new J(this.getI18n()("youHaveToAtLeastSelectX", {
3229
+ smart_count: n
3230
+ }));
3231
+ }
3232
+ getMissingRequiredMetaFields(e) {
3233
+ const n = new J(this.getI18n()("missingRequiredMetaFieldOnFile", {
3234
+ fileName: e.name ?? this.getI18n()("unnamed")
3235
+ })), { requiredMetaFields: r } = this.getOpts().restrictions, s = [];
3236
+ for (const o of r)
3237
+ (!Object.hasOwn(e.meta, o) || e.meta[o] === "") && s.push(o);
3238
+ return { missingFields: s, error: n };
3239
+ }
3240
+ }
3241
+ const po = "5.0.0", co = {
3242
+ version: po
3243
+ };
3244
+ var fe, Le, Vn;
3245
+ class In {
3246
+ constructor() {
3247
+ x(this, Le);
3248
+ B(this, "state", {});
3249
+ x(this, fe, /* @__PURE__ */ new Set());
3250
+ }
3251
+ getState() {
3252
+ return this.state;
3253
+ }
3254
+ setState(e) {
3255
+ const n = { ...this.state }, r = { ...this.state, ...e };
3256
+ this.state = r, F(this, Le, Vn).call(this, n, r, e);
3257
+ }
3258
+ subscribe(e) {
3259
+ return w(this, fe).add(e), () => {
3260
+ w(this, fe).delete(e);
3261
+ };
3262
+ }
3263
+ }
3264
+ fe = new WeakMap(), Le = new WeakSet(), Vn = function(...e) {
3265
+ w(this, fe).forEach((n) => {
3266
+ n(...e);
3267
+ });
3268
+ }, B(In, "VERSION", co.version);
3269
+ function fo(t) {
3270
+ var e = typeof t;
3271
+ return t != null && (e == "object" || e == "function");
3272
+ }
3273
+ var Tt = fo, ho = typeof Pe == "object" && Pe && Pe.Object === Object && Pe, mo = ho, go = mo, yo = typeof self == "object" && self && self.Object === Object && self, vo = go || yo || Function("return this")(), Mn = vo, _o = Mn, bo = function() {
3274
+ return _o.Date.now();
3275
+ }, wo = bo, $o = /\s/;
3276
+ function So(t) {
3277
+ for (var e = t.length; e-- && $o.test(t.charAt(e)); )
3278
+ ;
3279
+ return e;
3280
+ }
3281
+ var Fo = So, Co = Fo, ko = /^\s+/;
3282
+ function To(t) {
3283
+ return t && t.slice(0, Co(t) + 1).replace(ko, "");
3284
+ }
3285
+ var Eo = To, Io = Mn, Vo = Io.Symbol, Un = Vo, Zt = Un, zn = Object.prototype, Mo = zn.hasOwnProperty, Uo = zn.toString, we = Zt ? Zt.toStringTag : void 0;
3286
+ function zo(t) {
3287
+ var e = Mo.call(t, we), n = t[we];
3288
+ try {
3289
+ t[we] = void 0;
3290
+ var r = !0;
3291
+ } catch {
3292
+ }
3293
+ var s = Uo.call(t);
3294
+ return r && (e ? t[we] = n : delete t[we]), s;
3295
+ }
3296
+ var Po = zo, Ao = Object.prototype, No = Ao.toString;
3297
+ function Oo(t) {
3298
+ return No.call(t);
3299
+ }
3300
+ var Do = Oo, Yt = Un, Ro = Po, Bo = Do, jo = "[object Null]", Lo = "[object Undefined]", Xt = Yt ? Yt.toStringTag : void 0;
3301
+ function xo(t) {
3302
+ return t == null ? t === void 0 ? Lo : jo : Xt && Xt in Object(t) ? Ro(t) : Bo(t);
3303
+ }
3304
+ var qo = xo;
3305
+ function Ho(t) {
3306
+ return t != null && typeof t == "object";
3307
+ }
3308
+ var Go = Ho, Wo = qo, Zo = Go, Yo = "[object Symbol]";
3309
+ function Xo(t) {
3310
+ return typeof t == "symbol" || Zo(t) && Wo(t) == Yo;
3311
+ }
3312
+ var Ko = Xo, Jo = Eo, Kt = Tt, Qo = Ko, Jt = NaN, ea = /^[-+]0x[0-9a-f]+$/i, ta = /^0b[01]+$/i, na = /^0o[0-7]+$/i, ra = parseInt;
3313
+ function sa(t) {
3314
+ if (typeof t == "number")
3315
+ return t;
3316
+ if (Qo(t))
3317
+ return Jt;
3318
+ if (Kt(t)) {
3319
+ var e = typeof t.valueOf == "function" ? t.valueOf() : t;
3320
+ t = Kt(e) ? e + "" : e;
3321
+ }
3322
+ if (typeof t != "string")
3323
+ return t === 0 ? t : +t;
3324
+ t = Jo(t);
3325
+ var n = ta.test(t);
3326
+ return n || na.test(t) ? ra(t.slice(2), n ? 2 : 8) : ea.test(t) ? Jt : +t;
3327
+ }
3328
+ var ia = sa, oa = Tt, Qe = wo, Qt = ia, aa = "Expected a function", la = Math.max, ua = Math.min;
3329
+ function da(t, e, n) {
3330
+ var r, s, o, i, a, l, u = 0, d = !1, p = !1, c = !0;
3331
+ if (typeof t != "function")
3332
+ throw new TypeError(aa);
3333
+ e = Qt(e) || 0, oa(n) && (d = !!n.leading, p = "maxWait" in n, o = p ? la(Qt(n.maxWait) || 0, e) : o, c = "trailing" in n ? !!n.trailing : c);
3334
+ function h($) {
3335
+ var U = r, N = s;
3336
+ return r = s = void 0, u = $, i = t.apply(N, U), i;
3337
+ }
3338
+ function v($) {
3339
+ return u = $, a = setTimeout(C, e), d ? h($) : i;
3340
+ }
3341
+ function V($) {
3342
+ var U = $ - l, N = $ - u, H = e - U;
3343
+ return p ? ua(H, o - N) : H;
3344
+ }
3345
+ function z($) {
3346
+ var U = $ - l, N = $ - u;
3347
+ return l === void 0 || U >= e || U < 0 || p && N >= o;
3348
+ }
3349
+ function C() {
3350
+ var $ = Qe();
3351
+ if (z($))
3352
+ return T($);
3353
+ a = setTimeout(C, V($));
3354
+ }
3355
+ function T($) {
3356
+ return a = void 0, c && r ? h($) : (r = s = void 0, i);
3357
+ }
3358
+ function Z() {
3359
+ a !== void 0 && clearTimeout(a), u = 0, r = l = s = a = void 0;
3360
+ }
3361
+ function f() {
3362
+ return a === void 0 ? i : T(Qe());
3363
+ }
3364
+ function _() {
3365
+ var $ = Qe(), U = z($);
3366
+ if (r = arguments, s = this, l = $, U) {
3367
+ if (a === void 0)
3368
+ return v(l);
3369
+ if (p)
3370
+ return clearTimeout(a), a = setTimeout(C, e), h(l);
3371
+ }
3372
+ return a === void 0 && (a = setTimeout(C, e)), i;
3373
+ }
3374
+ return _.cancel = Z, _.flush = f, _;
3375
+ }
3376
+ var pa = da, ca = pa, fa = Tt, ha = "Expected a function";
3377
+ function ma(t, e, n) {
3378
+ var r = !0, s = !0;
3379
+ if (typeof t != "function")
3380
+ throw new TypeError(ha);
3381
+ return fa(n) && (r = "leading" in n ? !!n.leading : r, s = "trailing" in n ? !!n.trailing : s), ca(t, e, {
3382
+ leading: r,
3383
+ maxWait: e,
3384
+ trailing: s
3385
+ });
3386
+ }
3387
+ var ga = ma;
3388
+ const ya = /* @__PURE__ */ Ze(ga);
3389
+ var va = function() {
3390
+ var e = {}, n = e._fns = {};
3391
+ e.emit = function(i, a, l, u, d, p, c) {
3392
+ var h = r(i);
3393
+ h.length && s(i, h, [a, l, u, d, p, c]);
3394
+ }, e.on = function(i, a) {
3395
+ n[i] || (n[i] = []), n[i].push(a);
3396
+ }, e.once = function(i, a) {
3397
+ function l() {
3398
+ a.apply(this, arguments), e.off(i, l);
3399
+ }
3400
+ this.on(i, l);
3401
+ }, e.off = function(i, a) {
3402
+ var l = [];
3403
+ if (i && a) {
3404
+ var u = this._fns[i], d = 0, p = u ? u.length : 0;
3405
+ for (d; d < p; d++)
3406
+ u[d] !== a && l.push(u[d]);
3407
+ }
3408
+ l.length ? this._fns[i] = l : delete this._fns[i];
3409
+ };
3410
+ function r(o) {
3411
+ var i = n[o] ? n[o] : [], a = o.indexOf(":"), l = a === -1 ? [o] : [o.substring(0, a), o.substring(a + 1)], u = Object.keys(n), d = 0, p = u.length;
3412
+ for (d; d < p; d++) {
3413
+ var c = u[d];
3414
+ if (c === "*" && (i = i.concat(n[c])), l.length === 2 && l[0] === c) {
3415
+ i = i.concat(n[c]);
3416
+ break;
3417
+ }
3418
+ }
3419
+ return i;
3420
+ }
3421
+ function s(o, i, a) {
3422
+ var l = 0, u = i.length;
3423
+ for (l; l < u && i[l]; l++)
3424
+ i[l].event = o, i[l].apply(i[l], a);
3425
+ }
3426
+ return e;
3427
+ };
3428
+ const _a = /* @__PURE__ */ Ze(va);
3429
+ let ba = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict", wa = (t = 21) => {
3430
+ let e = "", n = t | 0;
3431
+ for (; n--; )
3432
+ e += ba[Math.random() * 64 | 0];
3433
+ return e;
3434
+ };
3435
+ const $a = "5.2.0", Sa = {
3436
+ version: $a
3437
+ };
3438
+ function Fa(t, e) {
3439
+ return e.name ? e.name : t.split("/")[0] === "image" ? `${t.split("/")[0]}.${t.split("/")[1]}` : "noname";
3440
+ }
3441
+ const Ca = {
3442
+ strings: {
3443
+ addBulkFilesFailed: {
3444
+ 0: "Failed to add %{smart_count} file due to an internal error",
3445
+ 1: "Failed to add %{smart_count} files due to internal errors"
3446
+ },
3447
+ youCanOnlyUploadX: {
3448
+ 0: "You can only upload %{smart_count} file",
3449
+ 1: "You can only upload %{smart_count} files"
3450
+ },
3451
+ youHaveToAtLeastSelectX: {
3452
+ 0: "You have to select at least %{smart_count} file",
3453
+ 1: "You have to select at least %{smart_count} files"
3454
+ },
3455
+ aggregateExceedsSize: "You selected %{size} of files, but maximum allowed size is %{sizeAllowed}",
3456
+ exceedsSize: "%{file} exceeds maximum allowed size of %{size}",
3457
+ missingRequiredMetaField: "Missing required meta fields",
3458
+ missingRequiredMetaFieldOnFile: "Missing required meta fields in %{fileName}",
3459
+ inferiorSize: "This file is smaller than the allowed size of %{size}",
3460
+ youCanOnlyUploadFileTypes: "You can only upload: %{types}",
3461
+ noMoreFilesAllowed: "Cannot add more files",
3462
+ noDuplicates: "Cannot add the duplicate file '%{fileName}', it already exists",
3463
+ companionError: "Connection with Companion failed",
3464
+ authAborted: "Authentication aborted",
3465
+ companionUnauthorizeHint: "To unauthorize to your %{provider} account, please go to %{url}",
3466
+ failedToUpload: "Failed to upload %{file}",
3467
+ noInternetConnection: "No Internet connection",
3468
+ connectedToInternet: "Connected to the Internet",
3469
+ // Strings for remote providers
3470
+ noFilesFound: "You have no files or folders here",
3471
+ noSearchResults: "Unfortunately, there are no results for this search",
3472
+ selectX: {
3473
+ 0: "Select %{smart_count}",
3474
+ 1: "Select %{smart_count}"
3475
+ },
3476
+ allFilesFromFolderNamed: "All files from folder %{name}",
3477
+ openFolderNamed: "Open folder %{name}",
3478
+ cancel: "Cancel",
3479
+ logOut: "Log out",
3480
+ logIn: "Log in",
3481
+ pickFiles: "Pick files",
3482
+ pickPhotos: "Pick photos",
3483
+ filter: "Filter",
3484
+ resetFilter: "Reset filter",
3485
+ loading: "Loading...",
3486
+ loadedXFiles: "Loaded %{numFiles} files",
3487
+ authenticateWithTitle: "Please authenticate with %{pluginName} to select files",
3488
+ authenticateWith: "Connect to %{pluginName}",
3489
+ signInWithGoogle: "Sign in with Google",
3490
+ searchImages: "Search for images",
3491
+ enterTextToSearch: "Enter text to search for images",
3492
+ search: "Search",
3493
+ resetSearch: "Reset search",
3494
+ emptyFolderAdded: "No files were added from empty folder",
3495
+ addedNumFiles: "Added %{numFiles} file(s)",
3496
+ folderAlreadyAdded: 'The folder "%{folder}" was already added',
3497
+ folderAdded: {
3498
+ 0: "Added %{smart_count} file from %{folder}",
3499
+ 1: "Added %{smart_count} files from %{folder}"
3500
+ },
3501
+ additionalRestrictionsFailed: "%{count} additional restrictions were not fulfilled",
3502
+ unnamed: "Unnamed",
3503
+ pleaseWait: "Please wait"
3504
+ }
3505
+ };
3506
+ function ka(t) {
3507
+ if (t == null && typeof navigator < "u" && (t = navigator.userAgent), !t)
3508
+ return !0;
3509
+ const e = /Edge\/(\d+\.\d+)/.exec(t);
3510
+ if (!e)
3511
+ return !0;
3512
+ const r = e[1].split(".", 2), s = parseInt(r[0], 10), o = parseInt(r[1], 10);
3513
+ return s < 15 || s === 15 && o < 15063 || s > 18 || s === 18 && o >= 18218;
3514
+ }
3515
+ const Ne = {
3516
+ totalProgress: 0,
3517
+ allowNewUpload: !0,
3518
+ error: null,
3519
+ recoveredState: null
3520
+ };
3521
+ var X, K, Ie, le, he, me, ue, y, oe, at, Pn, An, Nn, lt, ut, dt, pt, xe, ct, de, On, Dn, se, Ve, $e, Rn, ft, Se;
3522
+ const qe = class qe {
3523
+ /**
3524
+ * Instantiate Uppy
3525
+ */
3526
+ constructor(e) {
3527
+ x(this, y);
3528
+ x(this, X, /* @__PURE__ */ Object.create(null));
3529
+ x(this, K);
3530
+ x(this, Ie);
3531
+ x(this, le, _a());
3532
+ x(this, he, /* @__PURE__ */ new Set());
3533
+ x(this, me, /* @__PURE__ */ new Set());
3534
+ x(this, ue, /* @__PURE__ */ new Set());
3535
+ B(this, "defaultLocale");
3536
+ B(this, "locale");
3537
+ // The user optionally passes in options, but we set defaults for missing options.
3538
+ // We consider all options present after the contructor has run.
3539
+ B(this, "opts");
3540
+ B(this, "store");
3541
+ // Warning: do not use this from a plugin, as it will cause the plugins' translations to be missing
3542
+ B(this, "i18n");
3543
+ B(this, "i18nArray");
3544
+ B(this, "scheduledAutoProceed", null);
3545
+ B(this, "wasOffline", !1);
3546
+ x(this, xe, (e, n) => {
3547
+ const r = e ? this.getFile(e.id) : void 0;
3548
+ if (e == null || !r) {
3549
+ this.log(`Not setting progress for a file that has been removed: ${e == null ? void 0 : e.id}`);
3550
+ return;
3551
+ }
3552
+ if (r.progress.percentage === 100) {
3553
+ this.log(`Not setting progress for a file that has been already uploaded: ${e.id}`);
3554
+ return;
3555
+ }
3556
+ const s = {
3557
+ bytesTotal: n.bytesTotal,
3558
+ // bytesTotal may be null or zero; in that case we can't divide by it
3559
+ percentage: n.bytesTotal != null && Number.isFinite(n.bytesTotal) && n.bytesTotal > 0 ? Math.round(n.bytesUploaded / n.bytesTotal * 100) : void 0
3560
+ };
3561
+ r.progress.uploadStarted != null ? this.setFileState(e.id, {
3562
+ progress: {
3563
+ ...r.progress,
3564
+ ...s,
3565
+ bytesUploaded: n.bytesUploaded
3566
+ }
3567
+ }) : this.setFileState(e.id, {
3568
+ progress: {
3569
+ ...r.progress,
3570
+ ...s
3571
+ }
3572
+ }), w(this, de).call(this);
3573
+ });
3574
+ // ___Why throttle at 500ms?
3575
+ // - We must throttle at >250ms for superfocus in Dashboard to work well
3576
+ // (because animation takes 0.25s, and we want to wait for all animations to be over before refocusing).
3577
+ // [Practical Check]: if thottle is at 100ms, then if you are uploading a file,
3578
+ // and click 'ADD MORE FILES', - focus won't activate in Firefox.
3579
+ // - We must throttle at around >500ms to avoid performance lags.
3580
+ // [Practical Check] Firefox, try to upload a big file for a prolonged period of time. Laptop will start to heat up.
3581
+ x(this, de, ya(() => F(this, y, ct).call(this), 500, { leading: !0, trailing: !0 }));
3582
+ x(this, se, this.updateOnlineStatus.bind(this));
3583
+ // We need to store request clients by a unique ID, so we can share RequestClient instances across files
3584
+ // this allows us to do rate limiting and synchronous operations like refreshing provider tokens
3585
+ // example: refreshing tokens: if each file has their own requestclient,
3586
+ // we don't have any way to synchronize all requests in order to
3587
+ // - block all requests
3588
+ // - refresh the token
3589
+ // - unblock all requests and allow them to run with a the new access token
3590
+ // back when we had a requestclient per file, once an access token expired,
3591
+ // all 6 files would go ahead and refresh the token at the same time
3592
+ // (calling /refresh-token up to 6 times), which will probably fail for some providers
3593
+ x(this, Ve, /* @__PURE__ */ new Map());
3594
+ this.defaultLocale = Ca;
3595
+ const n = {
3596
+ id: "uppy",
3597
+ autoProceed: !1,
3598
+ allowMultipleUploadBatches: !0,
3599
+ debug: !1,
3600
+ restrictions: lo,
3601
+ meta: {},
3602
+ onBeforeFileAdded: (s, o) => !Object.hasOwn(o, s.id),
3603
+ onBeforeUpload: (s) => s,
3604
+ store: new In(),
3605
+ logger: eo,
3606
+ infoTimeout: 5e3
3607
+ }, r = { ...n, ...e };
3608
+ this.opts = {
3609
+ ...r,
3610
+ restrictions: {
3611
+ ...n.restrictions,
3612
+ ...e == null ? void 0 : e.restrictions
3613
+ }
3614
+ }, e != null && e.logger && e.debug ? this.log("You are using a custom `logger`, but also set `debug: true`, which uses built-in logger to output logs to console. Ignoring `debug: true` and using your custom `logger`.", "warning") : e != null && e.debug && (this.opts.logger = to), this.log(`Using Core v${qe.VERSION}`), this.i18nInit(), this.store = this.opts.store, this.setState({
3615
+ ...Ne,
3616
+ plugins: {},
3617
+ files: {},
3618
+ currentUploads: {},
3619
+ capabilities: {
3620
+ uploadProgress: ka(),
3621
+ individualCancellation: !0,
3622
+ resumableUploads: !1
3623
+ },
3624
+ meta: { ...this.opts.meta },
3625
+ info: []
3626
+ }), Me(this, K, new uo(() => this.opts, () => this.i18n)), Me(this, Ie, this.store.subscribe((s, o, i) => {
3627
+ this.emit("state-update", s, o, i), this.updateAll(o);
3628
+ })), this.opts.debug && typeof window < "u" && (window[this.opts.id] = this), F(this, y, Dn).call(this);
3629
+ }
3630
+ emit(e, ...n) {
3631
+ w(this, le).emit(e, ...n);
3632
+ }
3633
+ on(e, n) {
3634
+ return w(this, le).on(e, n), this;
3635
+ }
3636
+ once(e, n) {
3637
+ return w(this, le).once(e, n), this;
3638
+ }
3639
+ off(e, n) {
3640
+ return w(this, le).off(e, n), this;
3641
+ }
3642
+ /**
3643
+ * Iterate on all plugins and run `update` on them.
3644
+ * Called each time state changes.
3645
+ *
3646
+ */
3647
+ updateAll(e) {
3648
+ this.iteratePlugins((n) => {
3649
+ n.update(e);
3650
+ });
3651
+ }
3652
+ /**
3653
+ * Updates state with a patch
3654
+ */
3655
+ setState(e) {
3656
+ this.store.setState(e);
3657
+ }
3658
+ /**
3659
+ * Returns current state.
3660
+ */
3661
+ getState() {
3662
+ return this.store.getState();
3663
+ }
3664
+ patchFilesState(e) {
3665
+ const n = this.getState().files;
3666
+ this.setState({
3667
+ files: {
3668
+ ...n,
3669
+ ...Object.fromEntries(Object.entries(e).map(([r, s]) => [
3670
+ r,
3671
+ {
3672
+ ...n[r],
3673
+ ...s
3674
+ }
3675
+ ]))
3676
+ }
3677
+ });
3678
+ }
3679
+ /**
3680
+ * Shorthand to set state for a specific file.
3681
+ */
3682
+ setFileState(e, n) {
3683
+ if (!this.getState().files[e])
3684
+ throw new Error(`Can’t set state for ${e} (the file could have been removed)`);
3685
+ this.patchFilesState({ [e]: n });
3686
+ }
3687
+ i18nInit() {
3688
+ const e = (r) => this.log(`Missing i18n string: ${r}`, "error"), n = new Qi([this.defaultLocale, this.opts.locale], {
3689
+ onMissingKey: e
3690
+ });
3691
+ this.i18n = n.translate.bind(n), this.i18nArray = n.translateArray.bind(n), this.locale = n.locale;
3692
+ }
3693
+ setOptions(e) {
3694
+ this.opts = {
3695
+ ...this.opts,
3696
+ ...e,
3697
+ restrictions: {
3698
+ ...this.opts.restrictions,
3699
+ ...e == null ? void 0 : e.restrictions
3700
+ }
3701
+ }, e.meta && this.setMeta(e.meta), this.i18nInit(), e.locale && this.iteratePlugins((n) => {
3702
+ n.setOptions(e);
3703
+ }), this.setState(void 0);
3704
+ }
3705
+ resetProgress() {
3706
+ const e = {
3707
+ percentage: 0,
3708
+ bytesUploaded: !1,
3709
+ uploadComplete: !1,
3710
+ uploadStarted: null
3711
+ }, n = { ...this.getState().files }, r = /* @__PURE__ */ Object.create(null);
3712
+ Object.keys(n).forEach((s) => {
3713
+ r[s] = {
3714
+ ...n[s],
3715
+ progress: {
3716
+ ...n[s].progress,
3717
+ ...e
3718
+ },
3719
+ // @ts-expect-error these typed are inserted
3720
+ // into the namespace in their respective packages
3721
+ // but core isn't ware of those
3722
+ tus: void 0,
3723
+ transloadit: void 0
3724
+ };
3725
+ }), this.setState({ files: r, ...Ne });
3726
+ }
3727
+ clear() {
3728
+ const { capabilities: e, currentUploads: n } = this.getState();
3729
+ if (Object.keys(n).length > 0 && !e.individualCancellation)
3730
+ throw new Error("The installed uploader plugin does not allow removing files during an upload.");
3731
+ this.setState({ ...Ne, files: {} });
3732
+ }
3733
+ addPreProcessor(e) {
3734
+ w(this, he).add(e);
3735
+ }
3736
+ removePreProcessor(e) {
3737
+ return w(this, he).delete(e);
3738
+ }
3739
+ addPostProcessor(e) {
3740
+ w(this, ue).add(e);
3741
+ }
3742
+ removePostProcessor(e) {
3743
+ return w(this, ue).delete(e);
3744
+ }
3745
+ addUploader(e) {
3746
+ w(this, me).add(e);
3747
+ }
3748
+ removeUploader(e) {
3749
+ return w(this, me).delete(e);
3750
+ }
3751
+ setMeta(e) {
3752
+ const n = { ...this.getState().meta, ...e }, r = { ...this.getState().files };
3753
+ Object.keys(r).forEach((s) => {
3754
+ r[s] = {
3755
+ ...r[s],
3756
+ meta: { ...r[s].meta, ...e }
3757
+ };
3758
+ }), this.log("Adding metadata:"), this.log(e), this.setState({
3759
+ meta: n,
3760
+ files: r
3761
+ });
3762
+ }
3763
+ setFileMeta(e, n) {
3764
+ const r = { ...this.getState().files };
3765
+ if (!r[e]) {
3766
+ this.log(`Was trying to set metadata for a file that has been removed: ${e}`);
3767
+ return;
3768
+ }
3769
+ const s = { ...r[e].meta, ...n };
3770
+ r[e] = { ...r[e], meta: s }, this.setState({ files: r });
3771
+ }
3772
+ /**
3773
+ * Get a file object.
3774
+ */
3775
+ getFile(e) {
3776
+ return this.getState().files[e];
3777
+ }
3778
+ /**
3779
+ * Get all files in an array.
3780
+ */
3781
+ getFiles() {
3782
+ const { files: e } = this.getState();
3783
+ return Object.values(e);
3784
+ }
3785
+ getFilesByIds(e) {
3786
+ return e.map((n) => this.getFile(n));
3787
+ }
3788
+ getObjectOfFilesPerState() {
3789
+ const { files: e, totalProgress: n, error: r } = this.getState(), s = Object.values(e), o = [], i = [], a = [], l = [], u = [], d = [], p = [], c = [], h = [];
3790
+ for (const v of s) {
3791
+ const { progress: V } = v;
3792
+ !V.uploadComplete && V.uploadStarted && (o.push(v), v.isPaused || c.push(v)), V.uploadStarted || i.push(v), (V.uploadStarted || V.preprocess || V.postprocess) && a.push(v), V.uploadStarted && l.push(v), v.isPaused && u.push(v), V.uploadComplete && d.push(v), v.error && p.push(v), (V.preprocess || V.postprocess) && h.push(v);
3793
+ }
3794
+ return {
3795
+ newFiles: i,
3796
+ startedFiles: a,
3797
+ uploadStartedFiles: l,
3798
+ pausedFiles: u,
3799
+ completeFiles: d,
3800
+ erroredFiles: p,
3801
+ inProgressFiles: o,
3802
+ inProgressNotPausedFiles: c,
3803
+ processingFiles: h,
3804
+ isUploadStarted: l.length > 0,
3805
+ isAllComplete: n === 100 && d.length === s.length && h.length === 0,
3806
+ isAllErrored: !!r && p.length === s.length,
3807
+ isAllPaused: o.length !== 0 && u.length === o.length,
3808
+ isUploadInProgress: o.length > 0,
3809
+ isSomeGhost: s.some((v) => v.isGhost)
3810
+ };
3811
+ }
3812
+ validateRestrictions(e, n = this.getFiles()) {
3813
+ try {
3814
+ w(this, K).validate(n, [e]);
3815
+ } catch (r) {
3816
+ return r;
3817
+ }
3818
+ return null;
3819
+ }
3820
+ validateSingleFile(e) {
3821
+ try {
3822
+ w(this, K).validateSingleFile(e);
3823
+ } catch (n) {
3824
+ return n.message;
3825
+ }
3826
+ return null;
3827
+ }
3828
+ validateAggregateRestrictions(e) {
3829
+ const n = this.getFiles();
3830
+ try {
3831
+ w(this, K).validateAggregateRestrictions(n, e);
3832
+ } catch (r) {
3833
+ return r.message;
3834
+ }
3835
+ return null;
3836
+ }
3837
+ checkIfFileAlreadyExists(e) {
3838
+ const { files: n } = this.getState();
3839
+ return !!(n[e] && !n[e].isGhost);
3840
+ }
3841
+ /**
3842
+ * Add a new file to `state.files`. This will run `onBeforeFileAdded`,
3843
+ * try to guess file type in a clever way, check file against restrictions,
3844
+ * and start an upload if `autoProceed === true`.
3845
+ */
3846
+ addFile(e) {
3847
+ const { nextFilesState: n, validFilesToAdd: r, errors: s } = F(this, y, ut).call(this, [e]), o = s.filter((a) => a.isRestriction);
3848
+ if (F(this, y, oe).call(this, o), s.length > 0)
3849
+ throw s[0];
3850
+ this.setState({ files: n });
3851
+ const [i] = r;
3852
+ return this.emit("file-added", i), this.emit("files-added", r), this.log(`Added file: ${i.name}, ${i.id}, mime type: ${i.type}`), F(this, y, lt).call(this), i.id;
3853
+ }
3854
+ /**
3855
+ * Add multiple files to `state.files`. See the `addFile()` documentation.
3856
+ *
3857
+ * If an error occurs while adding a file, it is logged and the user is notified.
3858
+ * This is good for UI plugins, but not for programmatic use.
3859
+ * Programmatic users should usually still use `addFile()` on individual files.
3860
+ */
3861
+ addFiles(e) {
3862
+ const { nextFilesState: n, validFilesToAdd: r, errors: s } = F(this, y, ut).call(this, e), o = s.filter((a) => a.isRestriction);
3863
+ F(this, y, oe).call(this, o);
3864
+ const i = s.filter((a) => !a.isRestriction);
3865
+ if (i.length > 0) {
3866
+ let a = `Multiple errors occurred while adding files:
3867
+ `;
3868
+ if (i.forEach((l) => {
3869
+ a += `
3870
+ * ${l.message}`;
3871
+ }), this.info({
3872
+ message: this.i18n("addBulkFilesFailed", {
3873
+ smart_count: i.length
3874
+ }),
3875
+ details: a
3876
+ }, "error", this.opts.infoTimeout), typeof AggregateError == "function")
3877
+ throw new AggregateError(i, a);
3878
+ {
3879
+ const l = new Error(a);
3880
+ throw l.errors = i, l;
3881
+ }
3882
+ }
3883
+ this.setState({ files: n }), r.forEach((a) => {
3884
+ this.emit("file-added", a);
3885
+ }), this.emit("files-added", r), r.length > 5 ? this.log(`Added batch of ${r.length} files`) : Object.values(r).forEach((a) => {
3886
+ this.log(`Added file: ${a.name}
3887
+ id: ${a.id}
3888
+ type: ${a.type}`);
3889
+ }), r.length > 0 && F(this, y, lt).call(this);
3890
+ }
3891
+ removeFiles(e) {
3892
+ const { files: n, currentUploads: r } = this.getState(), s = { ...n }, o = { ...r }, i = /* @__PURE__ */ Object.create(null);
3893
+ e.forEach((d) => {
3894
+ n[d] && (i[d] = n[d], delete s[d]);
3895
+ });
3896
+ function a(d) {
3897
+ return i[d] === void 0;
3898
+ }
3899
+ Object.keys(o).forEach((d) => {
3900
+ const p = r[d].fileIDs.filter(a);
3901
+ if (p.length === 0) {
3902
+ delete o[d];
3903
+ return;
3904
+ }
3905
+ const { capabilities: c } = this.getState();
3906
+ if (p.length !== r[d].fileIDs.length && !c.individualCancellation)
3907
+ throw new Error("The installed uploader plugin does not allow removing files during an upload.");
3908
+ o[d] = {
3909
+ ...r[d],
3910
+ fileIDs: p
3911
+ };
3912
+ });
3913
+ const l = {
3914
+ currentUploads: o,
3915
+ files: s
3916
+ };
3917
+ Object.keys(s).length === 0 && (l.allowNewUpload = !0, l.error = null, l.recoveredState = null), this.setState(l), w(this, de).call(this);
3918
+ const u = Object.keys(i);
3919
+ u.forEach((d) => {
3920
+ this.emit("file-removed", i[d]);
3921
+ }), u.length > 5 ? this.log(`Removed ${u.length} files`) : this.log(`Removed files: ${u.join(", ")}`);
3922
+ }
3923
+ removeFile(e) {
3924
+ this.removeFiles([e]);
3925
+ }
3926
+ pauseResume(e) {
3927
+ if (!this.getState().capabilities.resumableUploads || this.getFile(e).progress.uploadComplete)
3928
+ return;
3929
+ const n = this.getFile(e), s = !(n.isPaused || !1);
3930
+ return this.setFileState(e, {
3931
+ isPaused: s
3932
+ }), this.emit("upload-pause", n, s), s;
3933
+ }
3934
+ pauseAll() {
3935
+ const e = { ...this.getState().files };
3936
+ Object.keys(e).filter((r) => !e[r].progress.uploadComplete && e[r].progress.uploadStarted).forEach((r) => {
3937
+ const s = { ...e[r], isPaused: !0 };
3938
+ e[r] = s;
3939
+ }), this.setState({ files: e }), this.emit("pause-all");
3940
+ }
3941
+ resumeAll() {
3942
+ const e = { ...this.getState().files };
3943
+ Object.keys(e).filter((r) => !e[r].progress.uploadComplete && e[r].progress.uploadStarted).forEach((r) => {
3944
+ const s = {
3945
+ ...e[r],
3946
+ isPaused: !1,
3947
+ error: null
3948
+ };
3949
+ e[r] = s;
3950
+ }), this.setState({ files: e }), this.emit("resume-all");
3951
+ }
3952
+ async retryAll() {
3953
+ const e = await F(this, y, pt).call(this);
3954
+ return this.emit("complete", e), e;
3955
+ }
3956
+ cancelAll() {
3957
+ this.emit("cancel-all");
3958
+ const { files: e } = this.getState(), n = Object.keys(e);
3959
+ n.length && this.removeFiles(n), this.setState(Ne);
3960
+ }
3961
+ /**
3962
+ * Retry a specific file that has errored.
3963
+ */
3964
+ retryUpload(e) {
3965
+ this.setFileState(e, {
3966
+ error: null,
3967
+ isPaused: !1
3968
+ }), this.emit("upload-retry", this.getFile(e));
3969
+ const n = F(this, y, $e).call(this, [e], {
3970
+ forceAllowNewUpload: !0
3971
+ // create new upload even if allowNewUpload: false
3972
+ });
3973
+ return F(this, y, Se).call(this, n);
3974
+ }
3975
+ logout() {
3976
+ this.iteratePlugins((e) => {
3977
+ var n, r;
3978
+ (r = (n = e.provider) == null ? void 0 : n.logout) == null || r.call(n);
3979
+ });
3980
+ }
3981
+ [Symbol.for("uppy test: updateTotalProgress")]() {
3982
+ return F(this, y, ct).call(this);
3983
+ }
3984
+ updateOnlineStatus() {
3985
+ window.navigator.onLine ?? !0 ? (this.emit("is-online"), this.wasOffline && (this.emit("back-online"), this.info(this.i18n("connectedToInternet"), "success", 3e3), this.wasOffline = !1)) : (this.emit("is-offline"), this.info(this.i18n("noInternetConnection"), "error", 0), this.wasOffline = !0);
3986
+ }
3987
+ getID() {
3988
+ return this.opts.id;
3989
+ }
3990
+ /**
3991
+ * Registers a plugin with Core.
3992
+ */
3993
+ use(e, ...n) {
3994
+ if (typeof e != "function") {
3995
+ const i = `Expected a plugin class, but got ${e === null ? "null" : typeof e}. Please verify that the plugin was imported and spelled correctly.`;
3996
+ throw new TypeError(i);
3997
+ }
3998
+ const r = new e(this, ...n), s = r.id;
3999
+ if (!s)
4000
+ throw new Error("Your plugin must have an id");
4001
+ if (!r.type)
4002
+ throw new Error("Your plugin must have a type");
4003
+ const o = this.getPlugin(s);
4004
+ if (o) {
4005
+ const i = `Already found a plugin named '${o.id}'. Tried to use: '${s}'.
4006
+ Uppy plugins must have unique \`id\` options.`;
4007
+ throw new Error(i);
4008
+ }
4009
+ return e.VERSION && this.log(`Using ${s} v${e.VERSION}`), r.type in w(this, X) ? w(this, X)[r.type].push(r) : w(this, X)[r.type] = [r], r.install(), this.emit("plugin-added", r), this;
4010
+ }
4011
+ getPlugin(e) {
4012
+ for (const n of Object.values(w(this, X))) {
4013
+ const r = n.find((s) => s.id === e);
4014
+ if (r != null)
4015
+ return r;
4016
+ }
4017
+ }
4018
+ [Symbol.for("uppy test: getPlugins")](e) {
4019
+ return w(this, X)[e];
4020
+ }
4021
+ /**
4022
+ * Iterate through all `use`d plugins.
4023
+ *
4024
+ */
4025
+ iteratePlugins(e) {
4026
+ Object.values(w(this, X)).flat(1).forEach(e);
4027
+ }
4028
+ /**
4029
+ * Uninstall and remove a plugin.
4030
+ *
4031
+ * @param {object} instance The plugin instance to remove.
4032
+ */
4033
+ removePlugin(e) {
4034
+ this.log(`Removing plugin ${e.id}`), this.emit("plugin-remove", e), e.uninstall && e.uninstall();
4035
+ const n = w(this, X)[e.type], r = n.findIndex((i) => i.id === e.id);
4036
+ r !== -1 && n.splice(r, 1);
4037
+ const o = {
4038
+ plugins: {
4039
+ ...this.getState().plugins,
4040
+ [e.id]: void 0
4041
+ }
4042
+ };
4043
+ this.setState(o);
4044
+ }
4045
+ /**
4046
+ * Uninstall all plugins and close down this Uppy instance.
4047
+ */
4048
+ destroy() {
4049
+ this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`), this.cancelAll(), w(this, Ie).call(this), this.iteratePlugins((e) => {
4050
+ this.removePlugin(e);
4051
+ }), typeof window < "u" && window.removeEventListener && (window.removeEventListener("online", w(this, se)), window.removeEventListener("offline", w(this, se)));
4052
+ }
4053
+ hideInfo() {
4054
+ const { info: e } = this.getState();
4055
+ this.setState({ info: e.slice(1) }), this.emit("info-hidden");
4056
+ }
4057
+ /**
4058
+ * Set info message in `state.info`, so that UI plugins like `Informer`
4059
+ * can display the message.
4060
+ */
4061
+ info(e, n = "info", r = 3e3) {
4062
+ const s = typeof e == "object";
4063
+ this.setState({
4064
+ info: [
4065
+ ...this.getState().info,
4066
+ {
4067
+ type: n,
4068
+ message: s ? e.message : e,
4069
+ details: s ? e.details : null
4070
+ }
4071
+ ]
4072
+ }), setTimeout(() => this.hideInfo(), r), this.emit("info-visible");
4073
+ }
4074
+ /**
4075
+ * Passes messages to a function, provided in `opts.logger`.
4076
+ * If `opts.logger: Uppy.debugLogger` or `opts.debug: true`, logs to the browser console.
4077
+ */
4078
+ log(e, n) {
4079
+ const { logger: r } = this.opts;
4080
+ switch (n) {
4081
+ case "error":
4082
+ r.error(e);
4083
+ break;
4084
+ case "warning":
4085
+ r.warn(e);
4086
+ break;
4087
+ default:
4088
+ r.debug(e);
4089
+ break;
4090
+ }
4091
+ }
4092
+ registerRequestClient(e, n) {
4093
+ w(this, Ve).set(e, n);
4094
+ }
4095
+ /** @protected */
4096
+ getRequestClientForFile(e) {
4097
+ if (!("remote" in e && e.remote))
4098
+ throw new Error(`Tried to get RequestClient for a non-remote file ${e.id}`);
4099
+ const n = w(this, Ve).get(e.remote.requestClientId);
4100
+ if (n == null)
4101
+ throw new Error(`requestClientId "${e.remote.requestClientId}" not registered for file "${e.id}"`);
4102
+ return n;
4103
+ }
4104
+ /**
4105
+ * Restore an upload by its ID.
4106
+ */
4107
+ async restore(e) {
4108
+ this.log(`Core: Running restored upload "${e}"`);
4109
+ const n = await F(this, y, Se).call(this, e);
4110
+ return this.emit("complete", n), n;
4111
+ }
4112
+ [Symbol.for("uppy test: createUpload")](...e) {
4113
+ return F(this, y, $e).call(this, ...e);
4114
+ }
4115
+ /**
4116
+ * Add data to an upload's result object.
4117
+ */
4118
+ addResultData(e, n) {
4119
+ if (!F(this, y, Rn).call(this, e)) {
4120
+ this.log(`Not setting result for an upload that has been removed: ${e}`);
4121
+ return;
4122
+ }
4123
+ const { currentUploads: r } = this.getState(), s = {
4124
+ ...r[e],
4125
+ result: { ...r[e].result, ...n }
4126
+ };
4127
+ this.setState({
4128
+ currentUploads: { ...r, [e]: s }
4129
+ });
4130
+ }
4131
+ /**
4132
+ * Start an upload for all the files that are not currently being uploaded.
4133
+ */
4134
+ async upload() {
4135
+ var s;
4136
+ (s = w(this, X).uploader) != null && s.length || this.log("No uploader type plugins are used", "warning");
4137
+ let { files: e } = this.getState();
4138
+ if (F(this, y, dt).call(this).length > 0) {
4139
+ const o = await F(this, y, pt).call(this);
4140
+ if (!(this.getFiles().filter((a) => a.progress.uploadStarted == null).length > 0))
4141
+ return this.emit("complete", o), o;
4142
+ ({ files: e } = this.getState());
4143
+ }
4144
+ const r = this.opts.onBeforeUpload(e);
4145
+ if (r === !1)
4146
+ throw new Error("Not starting the upload because onBeforeUpload returned false");
4147
+ r && typeof r == "object" && (e = r, this.setState({
4148
+ files: e
4149
+ }));
4150
+ try {
4151
+ if (w(this, K).validateMinNumberOfFiles(e), !F(this, y, Pn).call(this, e))
4152
+ throw new J(this.i18n("missingRequiredMetaField"));
4153
+ const { currentUploads: o } = this.getState(), i = Object.values(o).flatMap((d) => d.fileIDs), a = Object.keys(e).filter((d) => {
4154
+ const p = this.getFile(d);
4155
+ return p && !p.progress.uploadStarted && !i.includes(d);
4156
+ }), l = F(this, y, $e).call(this, a), u = await F(this, y, Se).call(this, l);
4157
+ return this.emit("complete", u), u;
4158
+ } catch (o) {
4159
+ throw F(this, y, oe).call(this, [o]), o;
4160
+ }
4161
+ }
4162
+ };
4163
+ X = new WeakMap(), K = new WeakMap(), Ie = new WeakMap(), le = new WeakMap(), he = new WeakMap(), me = new WeakMap(), ue = new WeakMap(), y = new WeakSet(), oe = function(e) {
4164
+ for (const i of e)
4165
+ i.isRestriction ? this.emit("restriction-failed", i.file, i) : this.emit("error", i, i.file), this.log(i, "warning");
4166
+ const n = e.filter((i) => i.isUserFacing), r = 4, s = n.slice(0, r), o = n.slice(r);
4167
+ s.forEach(({ message: i, details: a = "" }) => {
4168
+ this.info({ message: i, details: a }, "error", this.opts.infoTimeout);
4169
+ }), o.length > 0 && this.info({
4170
+ message: this.i18n("additionalRestrictionsFailed", {
4171
+ count: o.length
4172
+ })
4173
+ });
4174
+ }, at = function(e) {
4175
+ const { missingFields: n, error: r } = w(this, K).getMissingRequiredMetaFields(e);
4176
+ return n.length > 0 ? (this.setFileState(e.id, {
4177
+ missingRequiredMetaFields: n,
4178
+ error: r.message
4179
+ }), this.log(r.message), this.emit("restriction-failed", e, r), !1) : (n.length === 0 && e.missingRequiredMetaFields && this.setFileState(e.id, {
4180
+ missingRequiredMetaFields: []
4181
+ }), !0);
4182
+ }, Pn = function(e) {
4183
+ let n = !0;
4184
+ for (const r of Object.values(e))
4185
+ F(this, y, at).call(this, r) || (n = !1);
4186
+ return n;
4187
+ }, An = function(e) {
4188
+ const { allowNewUpload: n } = this.getState();
4189
+ if (n === !1) {
4190
+ const r = new J(this.i18n("noMoreFilesAllowed"), {
4191
+ file: e
4192
+ });
4193
+ throw F(this, y, oe).call(this, [r]), r;
4194
+ }
4195
+ }, /**
4196
+ * Create a file state object based on user-provided `addFile()` options.
4197
+ */
4198
+ Nn = function(e) {
4199
+ const n = e instanceof File ? {
4200
+ name: e.name,
4201
+ type: e.type,
4202
+ size: e.size,
4203
+ data: e,
4204
+ meta: {},
4205
+ isRemote: !1,
4206
+ source: void 0,
4207
+ preview: void 0
4208
+ } : e, r = Tn(n), s = Fa(r, n), o = kn(s).extension, i = Xi(n, this.getID()), a = {
4209
+ ...n.meta,
4210
+ name: s,
4211
+ type: r
4212
+ }, l = Number.isFinite(n.data.size) ? n.data.size : null;
4213
+ return {
4214
+ source: n.source || "",
4215
+ id: i,
4216
+ name: s,
4217
+ extension: o || "",
4218
+ meta: {
4219
+ ...this.getState().meta,
4220
+ ...a
4221
+ },
4222
+ type: r,
4223
+ progress: {
4224
+ percentage: 0,
4225
+ bytesUploaded: !1,
4226
+ bytesTotal: l,
4227
+ uploadComplete: !1,
4228
+ uploadStarted: null
4229
+ },
4230
+ size: l,
4231
+ isGhost: !1,
4232
+ ...n.isRemote ? {
4233
+ isRemote: !0,
4234
+ remote: n.remote,
4235
+ data: n.data
4236
+ } : {
4237
+ isRemote: !1,
4238
+ data: n.data
4239
+ },
4240
+ preview: n.preview
4241
+ };
4242
+ }, // Schedule an upload if `autoProceed` is enabled.
4243
+ lt = function() {
4244
+ this.opts.autoProceed && !this.scheduledAutoProceed && (this.scheduledAutoProceed = setTimeout(() => {
4245
+ this.scheduledAutoProceed = null, this.upload().catch((e) => {
4246
+ e.isRestriction || this.log(e.stack || e.message || e);
4247
+ });
4248
+ }, 4));
4249
+ }, ut = function(e) {
4250
+ let { files: n } = this.getState(), r = { ...n };
4251
+ const s = [], o = [];
4252
+ for (const i of e)
4253
+ try {
4254
+ let a = F(this, y, Nn).call(this, i);
4255
+ F(this, y, An).call(this, a);
4256
+ const l = n[a.id], u = l == null ? void 0 : l.isGhost;
4257
+ if (u && !a.isRemote) {
4258
+ if (a.data == null)
4259
+ throw new Error("File data is missing");
4260
+ a = {
4261
+ ...l,
4262
+ isGhost: !1,
4263
+ data: a.data
4264
+ }, this.log(`Replaced the blob in the restored ghost file: ${a.name}, ${a.id}`);
4265
+ }
4266
+ const d = this.opts.onBeforeFileAdded(a, r);
4267
+ if (n = this.getState().files, r = { ...n, ...r }, !d && this.checkIfFileAlreadyExists(a.id))
4268
+ throw new J(this.i18n("noDuplicates", {
4269
+ fileName: a.name ?? this.i18n("unnamed")
4270
+ }), { file: a });
4271
+ if (d === !1 && !u)
4272
+ throw new J("Cannot add the file because onBeforeFileAdded returned false.", { isUserFacing: !1, file: a });
4273
+ typeof d == "object" && d !== null && (a = d), w(this, K).validateSingleFile(a), r[a.id] = a, s.push(a);
4274
+ } catch (a) {
4275
+ o.push(a);
4276
+ }
4277
+ try {
4278
+ w(this, K).validateAggregateRestrictions(Object.values(n), s);
4279
+ } catch (i) {
4280
+ return o.push(i), {
4281
+ nextFilesState: n,
4282
+ validFilesToAdd: [],
4283
+ errors: o
4284
+ };
4285
+ }
4286
+ return {
4287
+ nextFilesState: r,
4288
+ validFilesToAdd: s,
4289
+ errors: o
4290
+ };
4291
+ }, dt = function() {
4292
+ const { files: e } = this.getState();
4293
+ return Object.keys(e).filter((n) => {
4294
+ const r = e[n];
4295
+ return r.error && (!r.missingRequiredMetaFields || r.missingRequiredMetaFields.length === 0);
4296
+ });
4297
+ }, pt = async function() {
4298
+ const e = F(this, y, dt).call(this), n = { ...this.getState().files };
4299
+ if (e.forEach((s) => {
4300
+ n[s] = {
4301
+ ...n[s],
4302
+ isPaused: !1,
4303
+ error: null
4304
+ };
4305
+ }), this.setState({
4306
+ files: n,
4307
+ error: null
4308
+ }), this.emit("retry-all", this.getFilesByIds(e)), e.length === 0)
4309
+ return {
4310
+ successful: [],
4311
+ failed: []
4312
+ };
4313
+ const r = F(this, y, $e).call(this, e, {
4314
+ forceAllowNewUpload: !0
4315
+ // create new upload even if allowNewUpload: false
4316
+ });
4317
+ return F(this, y, Se).call(this, r);
4318
+ }, xe = new WeakMap(), ct = function() {
4319
+ const e = F(this, y, On).call(this);
4320
+ let n = null;
4321
+ e != null && (n = Math.round(e * 100), n > 100 ? n = 100 : n < 0 && (n = 0)), this.emit("progress", n ?? 0), this.setState({
4322
+ totalProgress: n ?? 0
4323
+ });
4324
+ }, de = new WeakMap(), On = function() {
4325
+ const n = this.getFiles().filter((l) => l.progress.uploadStarted || l.progress.preprocess || l.progress.postprocess);
4326
+ if (n.length === 0)
4327
+ return 0;
4328
+ if (n.every((l) => l.progress.uploadComplete))
4329
+ return 1;
4330
+ const r = (l) => l.progress.bytesTotal != null && l.progress.bytesTotal !== 0, s = n.filter(r), o = n.filter((l) => !r(l));
4331
+ if (s.every((l) => l.progress.uploadComplete) && o.length > 0 && !o.every((l) => l.progress.uploadComplete))
4332
+ return null;
4333
+ const i = s.reduce((l, u) => l + (u.progress.bytesTotal ?? 0), 0), a = s.reduce((l, u) => l + (u.progress.bytesUploaded || 0), 0);
4334
+ return i === 0 ? 0 : a / i;
4335
+ }, /**
4336
+ * Registers listeners for all global actions, like:
4337
+ * `error`, `file-removed`, `upload-progress`
4338
+ */
4339
+ Dn = function() {
4340
+ const e = (s, o, i) => {
4341
+ let a = s.message || "Unknown error";
4342
+ s.details && (a += ` ${s.details}`), this.setState({ error: a }), o != null && o.id in this.getState().files && this.setFileState(o.id, {
4343
+ error: a,
4344
+ response: i
4345
+ });
4346
+ };
4347
+ this.on("error", e), this.on("upload-error", (s, o, i) => {
4348
+ if (e(o, s, i), typeof o == "object" && o.message) {
4349
+ this.log(o.message, "error");
4350
+ const a = new Error(this.i18n("failedToUpload", { file: (s == null ? void 0 : s.name) ?? "" }));
4351
+ a.isUserFacing = !0, a.details = o.message, o.details && (a.details += ` ${o.details}`), F(this, y, oe).call(this, [a]);
4352
+ } else
4353
+ F(this, y, oe).call(this, [o]);
4354
+ });
4355
+ let n = null;
4356
+ this.on("upload-stalled", (s, o) => {
4357
+ const { message: i } = s, a = o.map((l) => l.meta.name).join(", ");
4358
+ n || (this.info({ message: i, details: a }, "warning", this.opts.infoTimeout), n = setTimeout(() => {
4359
+ n = null;
4360
+ }, this.opts.infoTimeout)), this.log(`${i} ${a}`.trim(), "warning");
4361
+ }), this.on("upload", () => {
4362
+ this.setState({ error: null });
4363
+ });
4364
+ const r = (s) => {
4365
+ const o = s.filter((a) => {
4366
+ const l = a != null && this.getFile(a.id);
4367
+ return l || this.log(`Not setting progress for a file that has been removed: ${a == null ? void 0 : a.id}`), l;
4368
+ }), i = Object.fromEntries(o.map((a) => [
4369
+ a.id,
4370
+ {
4371
+ progress: {
4372
+ uploadStarted: Date.now(),
4373
+ uploadComplete: !1,
4374
+ bytesUploaded: 0,
4375
+ bytesTotal: a.size
4376
+ }
4377
+ }
4378
+ ]));
4379
+ this.patchFilesState(i);
4380
+ };
4381
+ this.on("upload-start", r), this.on("upload-progress", w(this, xe)), this.on("upload-success", (s, o) => {
4382
+ if (s == null || !this.getFile(s.id)) {
4383
+ this.log(`Not setting progress for a file that has been removed: ${s == null ? void 0 : s.id}`);
4384
+ return;
4385
+ }
4386
+ const i = this.getFile(s.id).progress, a = w(this, ue).size > 0;
4387
+ this.setFileState(s.id, {
4388
+ progress: {
4389
+ ...i,
4390
+ postprocess: a ? {
4391
+ mode: "indeterminate"
4392
+ } : void 0,
4393
+ uploadComplete: !0,
4394
+ ...!a && { complete: !0 },
4395
+ percentage: 100,
4396
+ bytesUploaded: i.bytesTotal
4397
+ },
4398
+ response: o,
4399
+ uploadURL: o.uploadURL,
4400
+ isPaused: !1
4401
+ }), s.size == null && this.setFileState(s.id, {
4402
+ size: o.bytesUploaded || i.bytesTotal
4403
+ }), w(this, de).call(this);
4404
+ }), this.on("preprocess-progress", (s, o) => {
4405
+ if (s == null || !this.getFile(s.id)) {
4406
+ this.log(`Not setting progress for a file that has been removed: ${s == null ? void 0 : s.id}`);
4407
+ return;
4408
+ }
4409
+ this.setFileState(s.id, {
4410
+ progress: { ...this.getFile(s.id).progress, preprocess: o }
4411
+ });
4412
+ }), this.on("preprocess-complete", (s) => {
4413
+ if (s == null || !this.getFile(s.id)) {
4414
+ this.log(`Not setting progress for a file that has been removed: ${s == null ? void 0 : s.id}`);
4415
+ return;
4416
+ }
4417
+ const o = { ...this.getState().files };
4418
+ o[s.id] = {
4419
+ ...o[s.id],
4420
+ progress: { ...o[s.id].progress }
4421
+ }, delete o[s.id].progress.preprocess, this.setState({ files: o });
4422
+ }), this.on("postprocess-progress", (s, o) => {
4423
+ if (s == null || !this.getFile(s.id)) {
4424
+ this.log(`Not setting progress for a file that has been removed: ${s == null ? void 0 : s.id}`);
4425
+ return;
4426
+ }
4427
+ this.setFileState(s.id, {
4428
+ progress: {
4429
+ ...this.getState().files[s.id].progress,
4430
+ postprocess: o
4431
+ }
4432
+ });
4433
+ }), this.on("postprocess-complete", (s) => {
4434
+ const o = s && this.getFile(s.id);
4435
+ if (o == null) {
4436
+ this.log(`Not setting progress for a file that has been removed: ${s == null ? void 0 : s.id}`);
4437
+ return;
4438
+ }
4439
+ const { postprocess: i, ...a } = o.progress;
4440
+ this.patchFilesState({
4441
+ [o.id]: {
4442
+ progress: {
4443
+ ...a,
4444
+ complete: !0
4445
+ }
4446
+ }
4447
+ });
4448
+ }), this.on("restored", () => {
4449
+ w(this, de).call(this);
4450
+ }), this.on("dashboard:file-edit-complete", (s) => {
4451
+ s && F(this, y, at).call(this, s);
4452
+ }), typeof window < "u" && window.addEventListener && (window.addEventListener("online", w(this, se)), window.addEventListener("offline", w(this, se)), setTimeout(w(this, se), 3e3));
4453
+ }, se = new WeakMap(), Ve = new WeakMap(), /**
4454
+ * Create an upload for a bunch of files.
4455
+ *
4456
+ */
4457
+ $e = function(e, n = {}) {
4458
+ const { forceAllowNewUpload: r = !1 } = n, { allowNewUpload: s, currentUploads: o } = this.getState();
4459
+ if (!s && !r)
4460
+ throw new Error("Cannot create a new upload: already uploading.");
4461
+ const i = wa();
4462
+ return this.emit("upload", i, this.getFilesByIds(e)), this.setState({
4463
+ allowNewUpload: this.opts.allowMultipleUploadBatches !== !1 && this.opts.allowMultipleUploads !== !1,
4464
+ currentUploads: {
4465
+ ...o,
4466
+ [i]: {
4467
+ fileIDs: e,
4468
+ step: 0,
4469
+ result: {}
4470
+ }
4471
+ }
4472
+ }), i;
4473
+ }, Rn = function(e) {
4474
+ const { currentUploads: n } = this.getState();
4475
+ return n[e];
4476
+ }, /**
4477
+ * Remove an upload, eg. if it has been canceled or completed.
4478
+ *
4479
+ */
4480
+ ft = function(e) {
4481
+ const { [e]: n, ...r } = this.getState().currentUploads;
4482
+ this.setState({
4483
+ currentUploads: r
4484
+ });
4485
+ }, Se = async function(e) {
4486
+ const n = () => {
4487
+ const { currentUploads: i } = this.getState();
4488
+ return i[e];
4489
+ };
4490
+ let r = n();
4491
+ if (!r)
4492
+ throw new Error("Nonexistent upload");
4493
+ const s = [
4494
+ ...w(this, he),
4495
+ ...w(this, me),
4496
+ ...w(this, ue)
4497
+ ];
4498
+ try {
4499
+ for (let i = r.step || 0; i < s.length; i++) {
4500
+ const a = s[i];
4501
+ this.setState({
4502
+ currentUploads: {
4503
+ ...this.getState().currentUploads,
4504
+ [e]: {
4505
+ ...r,
4506
+ step: i
4507
+ }
4508
+ }
4509
+ });
4510
+ const { fileIDs: l } = r;
4511
+ if (await a(l, e), r = n(), !r)
4512
+ break;
4513
+ }
4514
+ } catch (i) {
4515
+ throw F(this, y, ft).call(this, e), i;
4516
+ }
4517
+ if (r) {
4518
+ r.fileIDs.forEach((u) => {
4519
+ const d = this.getFile(u);
4520
+ d != null && d.progress.postprocess && this.emit("postprocess-complete", d);
4521
+ });
4522
+ const i = r.fileIDs.map((u) => this.getFile(u)), a = i.filter((u) => !u.error), l = i.filter((u) => u.error);
4523
+ this.addResultData(e, { successful: a, failed: l, uploadID: e }), r = n();
4524
+ }
4525
+ let o;
4526
+ return r && (o = r.result, F(this, y, ft).call(this, e)), o == null && (this.log(`Not setting result for an upload that has been removed: ${e}`), o = {
4527
+ successful: [],
4528
+ failed: [],
4529
+ uploadID: e
4530
+ }), o;
4531
+ }, B(qe, "VERSION", Sa.version);
4532
+ let ot = qe;
4533
+ const Ta = {
4534
+ key: 0,
4535
+ class: "uppy-input-area--caption small text-body-secondary fst-italic"
4536
+ }, sl = {
4537
+ __name: "UppyInput",
4538
+ props: {
4539
+ name: { type: String, required: !0 },
4540
+ multiple: { type: Boolean, default: !1 },
4541
+ useXHR: { type: Boolean, default: !0 },
4542
+ XHRConfig: { type: Object, default: {} },
4543
+ url: { type: String, default: "/upload" },
4544
+ config: { type: Object, default: () => ({}) },
4545
+ errorHandler: { type: Function, default: null },
4546
+ showRestrictionCaption: { type: Boolean, default: !0 }
4547
+ },
4548
+ emits: [
4549
+ "update:modelValue",
4550
+ "file-added",
4551
+ "file-removed",
4552
+ "beforeUpload",
4553
+ "progress",
4554
+ "upload",
4555
+ "upload-progress",
4556
+ "upload-error",
4557
+ "upload-success",
4558
+ "upload-pause",
4559
+ "complete",
4560
+ "error",
4561
+ "upload-retry",
4562
+ "upload-stalled",
4563
+ "retry-all",
4564
+ "cancel-all",
4565
+ "restriction-failed"
4566
+ ],
4567
+ setup(t, { emit: e }) {
4568
+ var Z;
4569
+ const n = t, r = e, s = G(null), o = G(null), i = Yn(null), a = G(!1), l = G(!1), u = G(0), d = k("form", { value: {}, errors: {}, getID: (f) => f }), p = k("group", null), c = W({
4570
+ get() {
4571
+ var f;
4572
+ return (f = p == null ? void 0 : p.value) != null && f.name ? p.value.getData(n.name) : d.value[n.name];
4573
+ },
4574
+ set(f) {
4575
+ var _;
4576
+ (_ = p == null ? void 0 : p.value) != null && _.name ? p.value.setData(n.name, f) : d.value[n.name] = f, r("update:modelValue", f);
4577
+ }
4578
+ });
4579
+ i.value = new ot({
4580
+ id: n.name,
4581
+ autoProceed: !0,
4582
+ ...n.config,
4583
+ restrictions: {
4584
+ maxNumberOfFiles: n.multiple ? null : 1,
4585
+ ...((Z = n.config) == null ? void 0 : Z.restrictions) || {}
4586
+ }
4587
+ }), i.value.on("upload", () => {
4588
+ u.value = i.value.getFiles().filter((f) => !f.progress.uploadComplete).length, r("upload");
4589
+ }), i.value.on("before-upload", (f) => {
4590
+ r("beforeUpload", f);
4591
+ }), i.value.on("upload-success", (f, _) => {
4592
+ u.value = Math.max(0, u.value - 1);
4593
+ const $ = _.body ?? _;
4594
+ if (n.multiple) {
4595
+ const U = Array.isArray(c.value) ? c.value : [];
4596
+ c.value = [...U, $];
4597
+ } else
4598
+ c.value = $;
4599
+ r("upload-success", f, _);
4600
+ }), i.value.on("file-added", (f) => r("file-added", f)), i.value.on("file-removed", (f) => {
4601
+ var $;
4602
+ const _ = (($ = f.response) == null ? void 0 : $.body) ?? f.response;
4603
+ n.multiple && Array.isArray(c.value) ? c.value = c.value.filter((U) => JSON.stringify(U) !== JSON.stringify(_)) : c.value = null, _ && !a.value && !l.value && fetch(n.url, {
4604
+ method: "DELETE",
4605
+ headers: {
4606
+ "X-Requested-With": "XMLHttpRequest",
4607
+ "Content-Type": "application/json"
4608
+ },
4609
+ body: JSON.stringify(_)
4610
+ }), r("file-removed", f);
4611
+ }), i.value.on("progress", (f) => {
4612
+ f <= 0 ? d.value.uploading = null : f >= 100 ? d.value.uploading = u.value > 0 ? 99 : null : d.value.uploading = f, r("progress", f);
4613
+ }), i.value.on("upload-progress", (f, _) => r("upload-progress", f, _)), i.value.on("upload-pause", (f, _) => r("upload-pause", f, _)), i.value.on("cancel-all", () => r("cancel-all")), i.value.on("retry-all", () => r("retry-all")), i.value.on("upload-stalled", (f, _) => r("upload-stalled", f, _)), i.value.on("upload-retry", (f) => r("upload-retry", f)), i.value.on("complete", (f) => {
4614
+ u.value = 0, d.value.uploading = null, r("complete", f);
4615
+ }), i.value.on("error", (f) => {
4616
+ r("error", f);
4617
+ }), i.value.on("upload-error", (f, _, $) => {
4618
+ var N;
4619
+ u.value = Math.max(0, u.value - 1);
4620
+ const U = ((N = JSON.parse($.response)) == null ? void 0 : N.message) ?? _;
4621
+ v(U), r("upload-error", f, _, $, U);
4622
+ }), i.value.on("restriction-failed", (f, _) => {
4623
+ v(_.message), r("restriction-failed", f, _);
4624
+ }), Fe(() => {
4625
+ var f;
4626
+ return (f = d.value) == null ? void 0 : f.wasSuccessful;
4627
+ }, (f, _) => {
4628
+ f === !0 && _ === !1 && h();
4629
+ }), ve(() => {
4630
+ var f, _, $, U, N, H, te, P;
4631
+ n.useXHR && import("./index-CEG56KgI.js").then((Y) => {
4632
+ const ce = Y.default;
4633
+ i.value.use(ce, {
4634
+ method: "POST",
4635
+ endpoint: n.url,
4636
+ headers: {
4637
+ accept: "application/json"
4638
+ },
4639
+ ...n.XHRConfig
4640
+ });
4641
+ }), (_ = (f = i.value) == null ? void 0 : f.opts) != null && _.restrictions && (s.value = T(i.value.opts.restrictions)), o && ((H = (N = (U = ($ = i.value) == null ? void 0 : $.opts) == null ? void 0 : U.locale) == null ? void 0 : N.strings) != null && H.dropzoneText) && ((P = (te = o.value) == null ? void 0 : te.querySelectorAll('[data-uppy-element="dropzone"]>div>div>p')) == null || P.forEach((Y) => {
4642
+ var ce, Et, It, Vt;
4643
+ Y.innerHTML = (Vt = (It = (Et = (ce = i.value) == null ? void 0 : ce.opts) == null ? void 0 : Et.locale) == null ? void 0 : It.strings) == null ? void 0 : Vt.dropzoneText;
4644
+ }));
4645
+ }), ht(() => {
4646
+ l.value = !0, i.value && i.value.destroy();
4647
+ });
4648
+ function h() {
4649
+ i.value && (a.value = !0, i.value.cancelAll(), a.value = !1, c.value = n.multiple ? [] : null);
4650
+ }
4651
+ function v(f) {
4652
+ n.errorHandler ? n.errorHandler(f) : f && V(f);
4653
+ }
4654
+ function V(f) {
4655
+ if (typeof window < "u") {
4656
+ const _ = document == null ? void 0 : document.createElement("div");
4657
+ _.textContent = f, _.className = "uppy-error", o.value && (o.value.prepend(_), setTimeout(() => _.remove(), 3e3));
4658
+ }
4659
+ }
4660
+ const z = ["bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
4661
+ function C(f) {
4662
+ let _ = 0, $ = parseInt(f, 10) || 0;
4663
+ for (; $ >= 1024 && ++_; )
4664
+ $ = $ / 1024;
4665
+ return $.toFixed($ < 10 && _ > 0 ? 1 : 0) + z[_];
4666
+ }
4667
+ function T(f) {
4668
+ if (!f) return "";
4669
+ const {
4670
+ allowedFileTypes: _,
4671
+ maxFileSize: $,
4672
+ minFileSize: U,
4673
+ maxNumberOfFiles: N,
4674
+ minNumberOfFiles: H,
4675
+ maxTotalFileSize: te
4676
+ } = f, P = [];
4677
+ if (_ && _.length) {
4678
+ const Y = _.map((ce) => ce.replace(".", "")).join("، ");
4679
+ P.push(`فقط فایل‌های ${Y}`);
4680
+ }
4681
+ return N && N > 1 && P.push(`امکان انتخاب حداکثر ${N} فایل`), H && P.push(`حداقل ${H} فایل نیاز است`), $ && P.push(`با حداکثر حجم ${C($)} برای هر فایل`), U && P.push(`با حداقل حجم ${C(U)} برای هر فایل`), te && P.push(`و مجموع حجم کل حداکثر ${C(te)}`), P.length ? P.join("، ") + " مجاز است." : "";
4682
+ }
4683
+ return (f, _) => i.value ? (m(), g("div", {
4684
+ key: 0,
4685
+ class: "uppy-input-area",
4686
+ ref_key: "inputEl",
4687
+ ref: o
4688
+ }, [
4689
+ Q(Xe(qi), {
4690
+ name: "uu" + t.name,
4691
+ uppy: i.value
4692
+ }, {
4693
+ default: ie(() => [
4694
+ D(f.$slots, "default", { uppy: i.value }, () => [
4695
+ Q(Xe(Gi), { class: "uppy-file-lists" }),
4696
+ Q(Xe(Hi), { class: "uppy-drop-zone" })
4697
+ ])
4698
+ ]),
4699
+ _: 3
4700
+ }, 8, ["name", "uppy"]),
4701
+ s.value ? (m(), g("div", Ta, q(s.value), 1)) : j("", !0)
4702
+ ], 512)) : j("", !0);
4703
+ }
4704
+ };
4705
+ export {
4706
+ Aa as A,
4707
+ Na as C,
4708
+ xa as E,
4709
+ La as F,
4710
+ bs as G,
4711
+ Ga as L,
4712
+ Wa as M,
4713
+ Ba as P,
4714
+ Ds as Q,
4715
+ rl as R,
4716
+ nl as S,
4717
+ Qi as T,
4718
+ tl as _,
4719
+ Oa as a,
4720
+ Da as b,
4721
+ Ra as c,
4722
+ ja as d,
4723
+ sl as e,
4724
+ qa as f,
4725
+ Za as g,
4726
+ Ya as h,
4727
+ Ja as i,
4728
+ Ka as j,
4729
+ Xa as k,
4730
+ Ha as l,
4731
+ Qa as m,
4732
+ el as n,
4733
+ He as o
4734
+ };