v-sistec-features 1.6.2 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,710 @@
1
+ import { defineComponent as C, createElementBlock as u, openBlock as a, normalizeClass as b, normalizeStyle as X, toRaw as mt, unref as pt, createBlock as p, resolveDynamicComponent as L, mergeProps as V, withCtx as I, createTextVNode as M, toDisplayString as W, resolveComponent as y, createCommentVNode as R, createElementVNode as _, Fragment as N, toHandlers as vt, withModifiers as gt, TransitionGroup as Tt, renderSlot as Ct, renderList as F, createVNode as yt, getCurrentInstance as bt, inject as Ot, nextTick as _t, createApp as St } from "vue";
2
+ var Et = Object.defineProperty, H = Object.getOwnPropertySymbols, Bt = Object.prototype.hasOwnProperty, It = Object.prototype.propertyIsEnumerable, k = (t, e, s) => e in t ? Et(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s, x = (t, e) => {
3
+ for (var s in e || (e = {}))
4
+ Bt.call(e, s) && k(t, s, e[s]);
5
+ if (H)
6
+ for (var s of H(e))
7
+ It.call(e, s) && k(t, s, e[s]);
8
+ return t;
9
+ }, D = (t) => typeof t == "function", w = (t) => typeof t == "string", q = (t) => w(t) && t.trim().length > 0, Dt = (t) => typeof t == "number", T = (t) => typeof t > "u", O = (t) => typeof t == "object" && t !== null, wt = (t) => h(t, "tag") && q(t.tag), J = (t) => window.TouchEvent && t instanceof TouchEvent, K = (t) => h(t, "component") && Q(t.component), Rt = (t) => D(t) || O(t), Q = (t) => !T(t) && (w(t) || Rt(t) || K(t)), U = (t) => O(t) && ["height", "width", "right", "left", "top", "bottom"].every((e) => Dt(t[e])), h = (t, e) => (O(t) || D(t)) && e in t, Pt = /* @__PURE__ */ ((t) => () => t++)(0);
10
+ function P(t) {
11
+ return J(t) ? t.targetTouches[0].clientX : t.clientX;
12
+ }
13
+ function z(t) {
14
+ return J(t) ? t.targetTouches[0].clientY : t.clientY;
15
+ }
16
+ var Nt = (t) => {
17
+ T(t.remove) ? t.parentNode && t.parentNode.removeChild(t) : t.remove();
18
+ }, S = (t) => K(t) ? S(t.component) : wt(t) ? C({
19
+ render() {
20
+ return t;
21
+ }
22
+ }) : typeof t == "string" ? t : mt(pt(t)), At = (t) => {
23
+ if (typeof t == "string")
24
+ return t;
25
+ const e = h(t, "props") && O(t.props) ? t.props : {}, s = h(t, "listeners") && O(t.listeners) ? t.listeners : {};
26
+ return { component: S(t), props: e, listeners: s };
27
+ }, Lt = () => typeof window < "u", $ = class {
28
+ constructor() {
29
+ this.allHandlers = {};
30
+ }
31
+ getHandlers(t) {
32
+ return this.allHandlers[t] || [];
33
+ }
34
+ on(t, e) {
35
+ const s = this.getHandlers(t);
36
+ s.push(e), this.allHandlers[t] = s;
37
+ }
38
+ off(t, e) {
39
+ const s = this.getHandlers(t);
40
+ s.splice(s.indexOf(e) >>> 0, 1);
41
+ }
42
+ emit(t, e) {
43
+ this.getHandlers(t).forEach((o) => o(e));
44
+ }
45
+ }, Vt = (t) => ["on", "off", "emit"].every((e) => h(t, e) && D(t[e])), i;
46
+ (function(t) {
47
+ t.SUCCESS = "success", t.ERROR = "error", t.WARNING = "warning", t.INFO = "info", t.DEFAULT = "default";
48
+ })(i || (i = {}));
49
+ var B;
50
+ (function(t) {
51
+ t.TOP_LEFT = "top-left", t.TOP_CENTER = "top-center", t.TOP_RIGHT = "top-right", t.BOTTOM_LEFT = "bottom-left", t.BOTTOM_CENTER = "bottom-center", t.BOTTOM_RIGHT = "bottom-right";
52
+ })(B || (B = {}));
53
+ var l;
54
+ (function(t) {
55
+ t.ADD = "add", t.DISMISS = "dismiss", t.UPDATE = "update", t.CLEAR = "clear", t.UPDATE_DEFAULTS = "update_defaults";
56
+ })(l || (l = {}));
57
+ var d = "Vue-Toastification", c = {
58
+ type: {
59
+ type: String,
60
+ default: i.DEFAULT
61
+ },
62
+ classNames: {
63
+ type: [String, Array],
64
+ default: () => []
65
+ },
66
+ trueBoolean: {
67
+ type: Boolean,
68
+ default: !0
69
+ }
70
+ }, Y = {
71
+ type: c.type,
72
+ customIcon: {
73
+ type: [String, Boolean, Object, Function],
74
+ default: !0
75
+ }
76
+ }, E = {
77
+ component: {
78
+ type: [String, Object, Function, Boolean],
79
+ default: "button"
80
+ },
81
+ classNames: c.classNames,
82
+ showOnHover: {
83
+ type: Boolean,
84
+ default: !1
85
+ },
86
+ ariaLabel: {
87
+ type: String,
88
+ default: "close"
89
+ }
90
+ }, A = {
91
+ timeout: {
92
+ type: [Number, Boolean],
93
+ default: 5e3
94
+ },
95
+ hideProgressBar: {
96
+ type: Boolean,
97
+ default: !1
98
+ },
99
+ isRunning: {
100
+ type: Boolean,
101
+ default: !1
102
+ }
103
+ }, Z = {
104
+ transition: {
105
+ type: [Object, String],
106
+ default: `${d}__bounce`
107
+ }
108
+ }, Mt = {
109
+ position: {
110
+ type: String,
111
+ default: B.TOP_RIGHT
112
+ },
113
+ draggable: c.trueBoolean,
114
+ draggablePercent: {
115
+ type: Number,
116
+ default: 0.6
117
+ },
118
+ pauseOnFocusLoss: c.trueBoolean,
119
+ pauseOnHover: c.trueBoolean,
120
+ closeOnClick: c.trueBoolean,
121
+ timeout: A.timeout,
122
+ hideProgressBar: A.hideProgressBar,
123
+ toastClassName: c.classNames,
124
+ bodyClassName: c.classNames,
125
+ icon: Y.customIcon,
126
+ closeButton: E.component,
127
+ closeButtonClassName: E.classNames,
128
+ showCloseButtonOnHover: E.showOnHover,
129
+ accessibility: {
130
+ type: Object,
131
+ default: () => ({
132
+ toastRole: "alert",
133
+ closeButtonLabel: "close"
134
+ })
135
+ },
136
+ rtl: {
137
+ type: Boolean,
138
+ default: !1
139
+ },
140
+ eventBus: {
141
+ type: Object,
142
+ required: !1,
143
+ default: () => new $()
144
+ }
145
+ }, $t = {
146
+ id: {
147
+ type: [String, Number],
148
+ required: !0,
149
+ default: 0
150
+ },
151
+ type: c.type,
152
+ content: {
153
+ type: [String, Object, Function],
154
+ required: !0,
155
+ default: ""
156
+ },
157
+ onClick: {
158
+ type: Function,
159
+ default: void 0
160
+ },
161
+ onClose: {
162
+ type: Function,
163
+ default: void 0
164
+ }
165
+ }, Ft = {
166
+ container: {
167
+ type: [
168
+ Object,
169
+ Function
170
+ ],
171
+ default: () => document.body
172
+ },
173
+ newestOnTop: c.trueBoolean,
174
+ maxToasts: {
175
+ type: Number,
176
+ default: 20
177
+ },
178
+ transition: Z.transition,
179
+ toastDefaults: Object,
180
+ filterBeforeCreate: {
181
+ type: Function,
182
+ default: (t) => t
183
+ },
184
+ filterToasts: {
185
+ type: Function,
186
+ default: (t) => t
187
+ },
188
+ containerClassName: c.classNames,
189
+ onMounted: Function,
190
+ shareAppContext: [Boolean, Object]
191
+ }, f = {
192
+ CORE_TOAST: Mt,
193
+ TOAST: $t,
194
+ CONTAINER: Ft,
195
+ PROGRESS_BAR: A,
196
+ ICON: Y,
197
+ TRANSITION: Z,
198
+ CLOSE_BUTTON: E
199
+ }, tt = C({
200
+ name: "VtProgressBar",
201
+ props: f.PROGRESS_BAR,
202
+ data() {
203
+ return {
204
+ hasClass: !0
205
+ };
206
+ },
207
+ computed: {
208
+ style() {
209
+ return {
210
+ animationDuration: `${this.timeout}ms`,
211
+ animationPlayState: this.isRunning ? "running" : "paused",
212
+ opacity: this.hideProgressBar ? 0 : 1
213
+ };
214
+ },
215
+ cpClass() {
216
+ return this.hasClass ? `${d}__progress-bar` : "";
217
+ }
218
+ },
219
+ watch: {
220
+ timeout() {
221
+ this.hasClass = !1, this.$nextTick(() => this.hasClass = !0);
222
+ }
223
+ },
224
+ mounted() {
225
+ this.$el.addEventListener("animationend", this.animationEnded);
226
+ },
227
+ beforeUnmount() {
228
+ this.$el.removeEventListener("animationend", this.animationEnded);
229
+ },
230
+ methods: {
231
+ animationEnded() {
232
+ this.$emit("close-toast");
233
+ }
234
+ }
235
+ });
236
+ function Ht(t, e) {
237
+ return a(), u("div", {
238
+ style: X(t.style),
239
+ class: b(t.cpClass)
240
+ }, null, 6);
241
+ }
242
+ tt.render = Ht;
243
+ var kt = tt, et = C({
244
+ name: "VtCloseButton",
245
+ props: f.CLOSE_BUTTON,
246
+ computed: {
247
+ buttonComponent() {
248
+ return this.component !== !1 ? S(this.component) : "button";
249
+ },
250
+ classes() {
251
+ const t = [`${d}__close-button`];
252
+ return this.showOnHover && t.push("show-on-hover"), t.concat(this.classNames);
253
+ }
254
+ }
255
+ }), Ut = /* @__PURE__ */ M(" × ");
256
+ function zt(t, e) {
257
+ return a(), p(L(t.buttonComponent), V({
258
+ "aria-label": t.ariaLabel,
259
+ class: t.classes
260
+ }, t.$attrs), {
261
+ default: I(() => [
262
+ Ut
263
+ ]),
264
+ _: 1
265
+ }, 16, ["aria-label", "class"]);
266
+ }
267
+ et.render = zt;
268
+ var jt = et, st = {}, Gt = {
269
+ "aria-hidden": "true",
270
+ focusable: "false",
271
+ "data-prefix": "fas",
272
+ "data-icon": "check-circle",
273
+ class: "svg-inline--fa fa-check-circle fa-w-16",
274
+ role: "img",
275
+ xmlns: "http://www.w3.org/2000/svg",
276
+ viewBox: "0 0 512 512"
277
+ }, Xt = /* @__PURE__ */ _("path", {
278
+ fill: "currentColor",
279
+ d: "M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zM227.314 387.314l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.249-16.379-6.249-22.628 0L216 308.118l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.249 16.379 6.249 22.628.001z"
280
+ }, null, -1), Wt = [
281
+ Xt
282
+ ];
283
+ function xt(t, e) {
284
+ return a(), u("svg", Gt, Wt);
285
+ }
286
+ st.render = xt;
287
+ var qt = st, nt = {}, Jt = {
288
+ "aria-hidden": "true",
289
+ focusable: "false",
290
+ "data-prefix": "fas",
291
+ "data-icon": "info-circle",
292
+ class: "svg-inline--fa fa-info-circle fa-w-16",
293
+ role: "img",
294
+ xmlns: "http://www.w3.org/2000/svg",
295
+ viewBox: "0 0 512 512"
296
+ }, Kt = /* @__PURE__ */ _("path", {
297
+ fill: "currentColor",
298
+ d: "M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z"
299
+ }, null, -1), Qt = [
300
+ Kt
301
+ ];
302
+ function Yt(t, e) {
303
+ return a(), u("svg", Jt, Qt);
304
+ }
305
+ nt.render = Yt;
306
+ var j = nt, ot = {}, Zt = {
307
+ "aria-hidden": "true",
308
+ focusable: "false",
309
+ "data-prefix": "fas",
310
+ "data-icon": "exclamation-circle",
311
+ class: "svg-inline--fa fa-exclamation-circle fa-w-16",
312
+ role: "img",
313
+ xmlns: "http://www.w3.org/2000/svg",
314
+ viewBox: "0 0 512 512"
315
+ }, te = /* @__PURE__ */ _("path", {
316
+ fill: "currentColor",
317
+ d: "M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zm-248 50c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"
318
+ }, null, -1), ee = [
319
+ te
320
+ ];
321
+ function se(t, e) {
322
+ return a(), u("svg", Zt, ee);
323
+ }
324
+ ot.render = se;
325
+ var ne = ot, at = {}, oe = {
326
+ "aria-hidden": "true",
327
+ focusable: "false",
328
+ "data-prefix": "fas",
329
+ "data-icon": "exclamation-triangle",
330
+ class: "svg-inline--fa fa-exclamation-triangle fa-w-18",
331
+ role: "img",
332
+ xmlns: "http://www.w3.org/2000/svg",
333
+ viewBox: "0 0 576 512"
334
+ }, ae = /* @__PURE__ */ _("path", {
335
+ fill: "currentColor",
336
+ d: "M569.517 440.013C587.975 472.007 564.806 512 527.94 512H48.054c-36.937 0-59.999-40.055-41.577-71.987L246.423 23.985c18.467-32.009 64.72-31.951 83.154 0l239.94 416.028zM288 354c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"
337
+ }, null, -1), re = [
338
+ ae
339
+ ];
340
+ function ie(t, e) {
341
+ return a(), u("svg", oe, re);
342
+ }
343
+ at.render = ie;
344
+ var le = at, rt = C({
345
+ name: "VtIcon",
346
+ props: f.ICON,
347
+ computed: {
348
+ customIconChildren() {
349
+ return h(this.customIcon, "iconChildren") ? this.trimValue(this.customIcon.iconChildren) : "";
350
+ },
351
+ customIconClass() {
352
+ return w(this.customIcon) ? this.trimValue(this.customIcon) : h(this.customIcon, "iconClass") ? this.trimValue(this.customIcon.iconClass) : "";
353
+ },
354
+ customIconTag() {
355
+ return h(this.customIcon, "iconTag") ? this.trimValue(this.customIcon.iconTag, "i") : "i";
356
+ },
357
+ hasCustomIcon() {
358
+ return this.customIconClass.length > 0;
359
+ },
360
+ component() {
361
+ return this.hasCustomIcon ? this.customIconTag : Q(this.customIcon) ? S(this.customIcon) : this.iconTypeComponent;
362
+ },
363
+ iconTypeComponent() {
364
+ return {
365
+ [i.DEFAULT]: j,
366
+ [i.INFO]: j,
367
+ [i.SUCCESS]: qt,
368
+ [i.ERROR]: le,
369
+ [i.WARNING]: ne
370
+ }[this.type];
371
+ },
372
+ iconClasses() {
373
+ const t = [`${d}__icon`];
374
+ return this.hasCustomIcon ? t.concat(this.customIconClass) : t;
375
+ }
376
+ },
377
+ methods: {
378
+ trimValue(t, e = "") {
379
+ return q(t) ? t.trim() : e;
380
+ }
381
+ }
382
+ });
383
+ function ce(t, e) {
384
+ return a(), p(L(t.component), {
385
+ class: b(t.iconClasses)
386
+ }, {
387
+ default: I(() => [
388
+ M(W(t.customIconChildren), 1)
389
+ ]),
390
+ _: 1
391
+ }, 8, ["class"]);
392
+ }
393
+ rt.render = ce;
394
+ var ue = rt, it = C({
395
+ name: "VtToast",
396
+ components: { ProgressBar: kt, CloseButton: jt, Icon: ue },
397
+ inheritAttrs: !1,
398
+ props: Object.assign({}, f.CORE_TOAST, f.TOAST),
399
+ data() {
400
+ return {
401
+ isRunning: !0,
402
+ disableTransitions: !1,
403
+ beingDragged: !1,
404
+ dragStart: 0,
405
+ dragPos: { x: 0, y: 0 },
406
+ dragRect: {}
407
+ };
408
+ },
409
+ computed: {
410
+ classes() {
411
+ const t = [
412
+ `${d}__toast`,
413
+ `${d}__toast--${this.type}`,
414
+ `${this.position}`
415
+ ].concat(this.toastClassName);
416
+ return this.disableTransitions && t.push("disable-transition"), this.rtl && t.push(`${d}__toast--rtl`), t;
417
+ },
418
+ bodyClasses() {
419
+ return [
420
+ `${d}__toast-${w(this.content) ? "body" : "component-body"}`
421
+ ].concat(this.bodyClassName);
422
+ },
423
+ draggableStyle() {
424
+ return this.dragStart === this.dragPos.x ? {} : this.beingDragged ? {
425
+ transform: `translateX(${this.dragDelta}px)`,
426
+ opacity: 1 - Math.abs(this.dragDelta / this.removalDistance)
427
+ } : {
428
+ transition: "transform 0.2s, opacity 0.2s",
429
+ transform: "translateX(0)",
430
+ opacity: 1
431
+ };
432
+ },
433
+ dragDelta() {
434
+ return this.beingDragged ? this.dragPos.x - this.dragStart : 0;
435
+ },
436
+ removalDistance() {
437
+ return U(this.dragRect) ? (this.dragRect.right - this.dragRect.left) * this.draggablePercent : 0;
438
+ }
439
+ },
440
+ mounted() {
441
+ this.draggable && this.draggableSetup(), this.pauseOnFocusLoss && this.focusSetup();
442
+ },
443
+ beforeUnmount() {
444
+ this.draggable && this.draggableCleanup(), this.pauseOnFocusLoss && this.focusCleanup();
445
+ },
446
+ methods: {
447
+ hasProp: h,
448
+ getVueComponentFromObj: S,
449
+ closeToast() {
450
+ this.eventBus.emit(l.DISMISS, this.id);
451
+ },
452
+ clickHandler() {
453
+ this.onClick && this.onClick(this.closeToast), this.closeOnClick && (!this.beingDragged || this.dragStart === this.dragPos.x) && this.closeToast();
454
+ },
455
+ timeoutHandler() {
456
+ this.closeToast();
457
+ },
458
+ hoverPause() {
459
+ this.pauseOnHover && (this.isRunning = !1);
460
+ },
461
+ hoverPlay() {
462
+ this.pauseOnHover && (this.isRunning = !0);
463
+ },
464
+ focusPause() {
465
+ this.isRunning = !1;
466
+ },
467
+ focusPlay() {
468
+ this.isRunning = !0;
469
+ },
470
+ focusSetup() {
471
+ addEventListener("blur", this.focusPause), addEventListener("focus", this.focusPlay);
472
+ },
473
+ focusCleanup() {
474
+ removeEventListener("blur", this.focusPause), removeEventListener("focus", this.focusPlay);
475
+ },
476
+ draggableSetup() {
477
+ const t = this.$el;
478
+ t.addEventListener("touchstart", this.onDragStart, {
479
+ passive: !0
480
+ }), t.addEventListener("mousedown", this.onDragStart), addEventListener("touchmove", this.onDragMove, { passive: !1 }), addEventListener("mousemove", this.onDragMove), addEventListener("touchend", this.onDragEnd), addEventListener("mouseup", this.onDragEnd);
481
+ },
482
+ draggableCleanup() {
483
+ const t = this.$el;
484
+ t.removeEventListener("touchstart", this.onDragStart), t.removeEventListener("mousedown", this.onDragStart), removeEventListener("touchmove", this.onDragMove), removeEventListener("mousemove", this.onDragMove), removeEventListener("touchend", this.onDragEnd), removeEventListener("mouseup", this.onDragEnd);
485
+ },
486
+ onDragStart(t) {
487
+ this.beingDragged = !0, this.dragPos = { x: P(t), y: z(t) }, this.dragStart = P(t), this.dragRect = this.$el.getBoundingClientRect();
488
+ },
489
+ onDragMove(t) {
490
+ this.beingDragged && (t.preventDefault(), this.isRunning && (this.isRunning = !1), this.dragPos = { x: P(t), y: z(t) });
491
+ },
492
+ onDragEnd() {
493
+ this.beingDragged && (Math.abs(this.dragDelta) >= this.removalDistance ? (this.disableTransitions = !0, this.$nextTick(() => this.closeToast())) : setTimeout(() => {
494
+ this.beingDragged = !1, U(this.dragRect) && this.pauseOnHover && this.dragRect.bottom >= this.dragPos.y && this.dragPos.y >= this.dragRect.top && this.dragRect.left <= this.dragPos.x && this.dragPos.x <= this.dragRect.right ? this.isRunning = !1 : this.isRunning = !0;
495
+ }));
496
+ }
497
+ }
498
+ }), de = ["role"];
499
+ function he(t, e) {
500
+ const s = y("Icon"), o = y("CloseButton"), v = y("ProgressBar");
501
+ return a(), u("div", {
502
+ class: b(t.classes),
503
+ style: X(t.draggableStyle),
504
+ onClick: e[0] || (e[0] = (...n) => t.clickHandler && t.clickHandler(...n)),
505
+ onMouseenter: e[1] || (e[1] = (...n) => t.hoverPause && t.hoverPause(...n)),
506
+ onMouseleave: e[2] || (e[2] = (...n) => t.hoverPlay && t.hoverPlay(...n))
507
+ }, [
508
+ t.icon ? (a(), p(s, {
509
+ key: 0,
510
+ "custom-icon": t.icon,
511
+ type: t.type
512
+ }, null, 8, ["custom-icon", "type"])) : R("v-if", !0),
513
+ _("div", {
514
+ role: t.accessibility.toastRole || "alert",
515
+ class: b(t.bodyClasses)
516
+ }, [
517
+ typeof t.content == "string" ? (a(), u(N, { key: 0 }, [
518
+ M(W(t.content), 1)
519
+ ], 2112)) : (a(), p(L(t.getVueComponentFromObj(t.content)), V({
520
+ key: 1,
521
+ "toast-id": t.id
522
+ }, t.hasProp(t.content, "props") ? t.content.props : {}, vt(t.hasProp(t.content, "listeners") ? t.content.listeners : {}), { onCloseToast: t.closeToast }), null, 16, ["toast-id", "onCloseToast"]))
523
+ ], 10, de),
524
+ t.closeButton ? (a(), p(o, {
525
+ key: 1,
526
+ component: t.closeButton,
527
+ "class-names": t.closeButtonClassName,
528
+ "show-on-hover": t.showCloseButtonOnHover,
529
+ "aria-label": t.accessibility.closeButtonLabel,
530
+ onClick: gt(t.closeToast, ["stop"])
531
+ }, null, 8, ["component", "class-names", "show-on-hover", "aria-label", "onClick"])) : R("v-if", !0),
532
+ t.timeout ? (a(), p(v, {
533
+ key: 2,
534
+ "is-running": t.isRunning,
535
+ "hide-progress-bar": t.hideProgressBar,
536
+ timeout: t.timeout,
537
+ onCloseToast: t.timeoutHandler
538
+ }, null, 8, ["is-running", "hide-progress-bar", "timeout", "onCloseToast"])) : R("v-if", !0)
539
+ ], 38);
540
+ }
541
+ it.render = he;
542
+ var fe = it, lt = C({
543
+ name: "VtTransition",
544
+ props: f.TRANSITION,
545
+ emits: ["leave"],
546
+ methods: {
547
+ hasProp: h,
548
+ leave(t) {
549
+ t instanceof HTMLElement && (t.style.left = t.offsetLeft + "px", t.style.top = t.offsetTop + "px", t.style.width = getComputedStyle(t).width, t.style.position = "absolute");
550
+ }
551
+ }
552
+ });
553
+ function me(t, e) {
554
+ return a(), p(Tt, {
555
+ tag: "div",
556
+ "enter-active-class": t.transition.enter ? t.transition.enter : `${t.transition}-enter-active`,
557
+ "move-class": t.transition.move ? t.transition.move : `${t.transition}-move`,
558
+ "leave-active-class": t.transition.leave ? t.transition.leave : `${t.transition}-leave-active`,
559
+ onLeave: t.leave
560
+ }, {
561
+ default: I(() => [
562
+ Ct(t.$slots, "default")
563
+ ]),
564
+ _: 3
565
+ }, 8, ["enter-active-class", "move-class", "leave-active-class", "onLeave"]);
566
+ }
567
+ lt.render = me;
568
+ var pe = lt, ct = C({
569
+ name: "VueToastification",
570
+ devtools: {
571
+ hide: !0
572
+ },
573
+ components: { Toast: fe, VtTransition: pe },
574
+ props: Object.assign({}, f.CORE_TOAST, f.CONTAINER, f.TRANSITION),
575
+ data() {
576
+ return {
577
+ count: 0,
578
+ positions: Object.values(B),
579
+ toasts: {},
580
+ defaults: {}
581
+ };
582
+ },
583
+ computed: {
584
+ toastArray() {
585
+ return Object.values(this.toasts);
586
+ },
587
+ filteredToasts() {
588
+ return this.defaults.filterToasts(this.toastArray);
589
+ }
590
+ },
591
+ beforeMount() {
592
+ const t = this.eventBus;
593
+ t.on(l.ADD, this.addToast), t.on(l.CLEAR, this.clearToasts), t.on(l.DISMISS, this.dismissToast), t.on(l.UPDATE, this.updateToast), t.on(l.UPDATE_DEFAULTS, this.updateDefaults), this.defaults = this.$props;
594
+ },
595
+ mounted() {
596
+ this.setup(this.container);
597
+ },
598
+ methods: {
599
+ async setup(t) {
600
+ D(t) && (t = await t()), Nt(this.$el), t.appendChild(this.$el);
601
+ },
602
+ setToast(t) {
603
+ T(t.id) || (this.toasts[t.id] = t);
604
+ },
605
+ addToast(t) {
606
+ t.content = At(t.content);
607
+ const e = Object.assign({}, this.defaults, t.type && this.defaults.toastDefaults && this.defaults.toastDefaults[t.type], t), s = this.defaults.filterBeforeCreate(e, this.toastArray);
608
+ s && this.setToast(s);
609
+ },
610
+ dismissToast(t) {
611
+ const e = this.toasts[t];
612
+ !T(e) && !T(e.onClose) && e.onClose(), delete this.toasts[t];
613
+ },
614
+ clearToasts() {
615
+ Object.keys(this.toasts).forEach((t) => {
616
+ this.dismissToast(t);
617
+ });
618
+ },
619
+ getPositionToasts(t) {
620
+ const e = this.filteredToasts.filter((s) => s.position === t).slice(0, this.defaults.maxToasts);
621
+ return this.defaults.newestOnTop ? e.reverse() : e;
622
+ },
623
+ updateDefaults(t) {
624
+ T(t.container) || this.setup(t.container), this.defaults = Object.assign({}, this.defaults, t);
625
+ },
626
+ updateToast({
627
+ id: t,
628
+ options: e,
629
+ create: s
630
+ }) {
631
+ this.toasts[t] ? (e.timeout && e.timeout === this.toasts[t].timeout && e.timeout++, this.setToast(Object.assign({}, this.toasts[t], e))) : s && this.addToast(Object.assign({}, { id: t }, e));
632
+ },
633
+ getClasses(t) {
634
+ return [`${d}__container`, t].concat(this.defaults.containerClassName);
635
+ }
636
+ }
637
+ });
638
+ function ve(t, e) {
639
+ const s = y("Toast"), o = y("VtTransition");
640
+ return a(), u("div", null, [
641
+ (a(!0), u(N, null, F(t.positions, (v) => (a(), u("div", { key: v }, [
642
+ yt(o, {
643
+ transition: t.defaults.transition,
644
+ class: b(t.getClasses(v))
645
+ }, {
646
+ default: I(() => [
647
+ (a(!0), u(N, null, F(t.getPositionToasts(v), (n) => (a(), p(s, V({
648
+ key: n.id
649
+ }, n), null, 16))), 128))
650
+ ]),
651
+ _: 2
652
+ }, 1032, ["transition", "class"])
653
+ ]))), 128))
654
+ ]);
655
+ }
656
+ ct.render = ve;
657
+ var ge = ct, G = (t = {}, e = !0) => {
658
+ const s = t.eventBus = t.eventBus || new $();
659
+ e && _t(() => {
660
+ const n = St(ge, x({}, t)), r = n.mount(document.createElement("div")), g = t.onMounted;
661
+ if (T(g) || g(r, n), t.shareAppContext) {
662
+ const m = t.shareAppContext;
663
+ m === !0 ? console.warn(`[${d}] App to share context with was not provided.`) : (n._context.components = m._context.components, n._context.directives = m._context.directives, n._context.mixins = m._context.mixins, n._context.provides = m._context.provides, n.config.globalProperties = m.config.globalProperties);
664
+ }
665
+ });
666
+ const o = (n, r) => {
667
+ const g = Object.assign({}, { id: Pt(), type: i.DEFAULT }, r, {
668
+ content: n
669
+ });
670
+ return s.emit(l.ADD, g), g.id;
671
+ };
672
+ o.clear = () => s.emit(l.CLEAR, void 0), o.updateDefaults = (n) => {
673
+ s.emit(l.UPDATE_DEFAULTS, n);
674
+ }, o.dismiss = (n) => {
675
+ s.emit(l.DISMISS, n);
676
+ };
677
+ function v(n, { content: r, options: g }, m = !1) {
678
+ const ft = Object.assign({}, g, { content: r });
679
+ s.emit(l.UPDATE, {
680
+ id: n,
681
+ options: ft,
682
+ create: m
683
+ });
684
+ }
685
+ return o.update = v, o.success = (n, r) => o(n, Object.assign({}, r, { type: i.SUCCESS })), o.info = (n, r) => o(n, Object.assign({}, r, { type: i.INFO })), o.error = (n, r) => o(n, Object.assign({}, r, { type: i.ERROR })), o.warning = (n, r) => o(n, Object.assign({}, r, { type: i.WARNING })), o;
686
+ }, Te = () => {
687
+ const t = () => console.warn(`[${d}] This plugin does not support SSR!`);
688
+ return new Proxy(t, {
689
+ get() {
690
+ return t;
691
+ }
692
+ });
693
+ };
694
+ function ut(t) {
695
+ return Lt() ? Vt(t) ? G({ eventBus: t }, !1) : G(t, !0) : Te();
696
+ }
697
+ var dt = Symbol("VueToastification"), ht = new $(), Ce = (t, e) => {
698
+ e?.shareAppContext === !0 && (e.shareAppContext = t);
699
+ const s = ut(x({
700
+ eventBus: ht
701
+ }, e));
702
+ t.provide(dt, s);
703
+ }, be = (t) => {
704
+ const e = bt() ? Ot(dt, void 0) : void 0;
705
+ return e || ut(ht);
706
+ }, Oe = Ce;
707
+ export {
708
+ Oe as s,
709
+ be as u
710
+ };