forge-edit 0.1.0-beta.2 → 0.1.0-beta.21

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,4481 @@
1
+ //#region \0rolldown/runtime.js
2
+ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, i = Object.getPrototypeOf, a = Object.prototype.hasOwnProperty, o = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), s = (e, i, o, s) => {
3
+ if (i && typeof i == "object" || typeof i == "function") for (var c = r(i), l = 0, u = c.length, d; l < u; l++) d = c[l], !a.call(e, d) && d !== o && t(e, d, {
4
+ get: ((e) => i[e]).bind(null, d),
5
+ enumerable: !(s = n(i, d)) || s.enumerable
6
+ });
7
+ return e;
8
+ }, c = (n, r, o) => (o = n == null ? {} : e(i(n)), s(r || !n || !n.__esModule || !a.call(n, "default") ? t(o, "default", {
9
+ value: n,
10
+ enumerable: !0
11
+ }) : o, n)), l, u, d, f, p, m, h, g, _, v, y, b, x, S, C = {}, w = [], T = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, E = Array.isArray;
12
+ function D(e, t) {
13
+ for (var n in t) e[n] = t[n];
14
+ return e;
15
+ }
16
+ function ee(e) {
17
+ e && e.parentNode && e.parentNode.removeChild(e);
18
+ }
19
+ function te(e, t, n) {
20
+ var r, i, a, o = {};
21
+ for (a in t) a == "key" ? r = t[a] : a == "ref" ? i = t[a] : o[a] = t[a];
22
+ if (arguments.length > 2 && (o.children = arguments.length > 3 ? l.call(arguments, 2) : n), typeof e == "function" && e.defaultProps != null) for (a in e.defaultProps) o[a] === void 0 && (o[a] = e.defaultProps[a]);
23
+ return O(e, o, r, i, null);
24
+ }
25
+ function O(e, t, n, r, i) {
26
+ var a = {
27
+ type: e,
28
+ props: t,
29
+ key: n,
30
+ ref: r,
31
+ __k: null,
32
+ __: null,
33
+ __b: 0,
34
+ __e: null,
35
+ __c: null,
36
+ constructor: void 0,
37
+ __v: i ?? ++d,
38
+ __i: -1,
39
+ __u: 0
40
+ };
41
+ return i == null && u.vnode != null && u.vnode(a), a;
42
+ }
43
+ function ne(e) {
44
+ return e.children;
45
+ }
46
+ function re(e, t) {
47
+ this.props = e, this.context = t;
48
+ }
49
+ function k(e, t) {
50
+ if (t == null) return e.__ ? k(e.__, e.__i + 1) : null;
51
+ for (var n; t < e.__k.length; t++) if ((n = e.__k[t]) != null && n.__e != null) return n.__e;
52
+ return typeof e.type == "function" ? k(e) : null;
53
+ }
54
+ function A(e) {
55
+ if (e.__P && e.__d) {
56
+ var t = e.__v, n = t.__e, r = [], i = [], a = D({}, t);
57
+ a.__v = t.__v + 1, u.vnode && u.vnode(a), pe(e.__P, a, t, e.__n, e.__P.namespaceURI, 32 & t.__u ? [n] : null, r, n ?? k(t), !!(32 & t.__u), i), a.__v = t.__v, a.__.__k[a.__i] = a, M(r, a, i), t.__e = t.__ = null, a.__e != n && ie(a);
58
+ }
59
+ }
60
+ function ie(e) {
61
+ if ((e = e.__) != null && e.__c != null) return e.__e = e.__c.base = null, e.__k.some(function(t) {
62
+ if (t != null && t.__e != null) return e.__e = e.__c.base = t.__e;
63
+ }), ie(e);
64
+ }
65
+ function j(e) {
66
+ (!e.__d && (e.__d = !0) && f.push(e) && !ae.__r++ || p != u.debounceRendering) && ((p = u.debounceRendering) || m)(ae);
67
+ }
68
+ function ae() {
69
+ try {
70
+ for (var e, t = 1; f.length;) f.length > t && f.sort(h), e = f.shift(), t = f.length, A(e);
71
+ } finally {
72
+ f.length = ae.__r = 0;
73
+ }
74
+ }
75
+ function oe(e, t, n, r, i, a, o, s, c, l, u) {
76
+ var d, f, p, m, h, g, _ = r && r.__k || w, v = t.length;
77
+ for (c = se(n, t, _, c, v), d = 0; d < v; d++) (p = n.__k[d]) != null && (f = p.__i != -1 && _[p.__i] || C, p.__i = d, g = pe(e, p, f, i, a, o, s, c, l, u), m = p.__e, p.ref && f.ref != p.ref && (f.ref && P(f.ref, null, p), u.push(p.ref, p.__c || m, p)), h == null && m != null && (h = m), 4 & p.__u ? (c = ce(p, c, e), f.__e && (f.__e = null)) : typeof p.type == "function" && g !== void 0 ? c = g : m && (c = m.nextSibling), p.__u &= -7);
78
+ return n.__e = h, c;
79
+ }
80
+ function se(e, t, n, r, i) {
81
+ var a, o, s, c, l, u = n.length, d = u, f = 0;
82
+ for (e.__k = Array(i), a = 0; a < i; a++) (o = t[a]) != null && typeof o != "boolean" && typeof o != "function" ? (typeof o == "string" || typeof o == "number" || typeof o == "bigint" || o.constructor == String ? o = e.__k[a] = O(null, o, null, null, null) : E(o) ? o = e.__k[a] = O(ne, { children: o }, null, null, null) : o.constructor === void 0 && o.__b > 0 ? o = e.__k[a] = O(o.type, o.props, o.key, o.ref ? o.ref : null, o.__v) : e.__k[a] = o, c = a + f, o.__ = e, o.__b = e.__b + 1, s = null, (l = o.__i = le(o, n, c, d)) != -1 && (d--, (s = n[l]) && (s.__u |= 2)), s == null || s.__v == null ? (l == -1 && (i > u ? f-- : i < u && f++), typeof o.type != "function" && (o.__u |= 4)) : l != c && (l == c - 1 ? f-- : l == c + 1 ? f++ : (l > c ? f-- : f++, o.__u |= 4))) : e.__k[a] = null;
83
+ if (d) for (a = 0; a < u; a++) (s = n[a]) != null && !(2 & s.__u) && (s.__e == r && (r = k(s)), ge(s, s));
84
+ return r;
85
+ }
86
+ function ce(e, t, n) {
87
+ var r, i;
88
+ if (typeof e.type == "function") {
89
+ for (r = e.__k, i = 0; r && i < r.length; i++) r[i] && (r[i].__ = e, t = ce(r[i], t, n));
90
+ return t;
91
+ }
92
+ e.__e != t && (t && e.type && !t.parentNode && (t = k(e)), t = n.insertBefore(e.__e, t || null));
93
+ do
94
+ t &&= t.nextSibling;
95
+ while (t != null && t.nodeType == 8);
96
+ return t;
97
+ }
98
+ function le(e, t, n, r) {
99
+ var i, a, o, s = e.key, c = e.type, l = t[n], u = l != null && !(2 & l.__u);
100
+ if (l === null && s == null || u && s == l.key && c == l.type) return n;
101
+ if (r > +!!u) {
102
+ for (i = n - 1, a = n + 1; i >= 0 || a < t.length;) if ((l = t[o = i >= 0 ? i-- : a++]) != null && !(2 & l.__u) && s == l.key && c == l.type) return o;
103
+ }
104
+ return -1;
105
+ }
106
+ function ue(e, t, n) {
107
+ t[0] == "-" ? e.setProperty(t, n ?? "") : e[t] = n == null ? "" : typeof n != "number" || T.test(t) ? n : n + "px";
108
+ }
109
+ function de(e, t, n, r, i) {
110
+ var a, o;
111
+ n: if (t == "style") {
112
+ if (typeof n == "string") e.style.cssText = n;
113
+ else {
114
+ if (typeof r == "string" && (e.style.cssText = r = ""), r) for (t in r) n && t in n || ue(e.style, t, "");
115
+ if (n) for (t in n) r && n[t] == r[t] || ue(e.style, t, n[t]);
116
+ }
117
+ } else if (t[0] == "o" && t[1] == "n") a = t != (t = t.replace(y, "$1")), o = t.toLowerCase(), t = o in e || t == "onFocusOut" || t == "onFocusIn" ? o.slice(2) : t.slice(2), e.l ||= {}, e.l[t + a] = n, n ? r ? n[v] = r[v] : (n[v] = b, e.addEventListener(t, a ? S : x, a)) : e.removeEventListener(t, a ? S : x, a);
118
+ else {
119
+ if (i == "http://www.w3.org/2000/svg") t = t.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
120
+ else if (t != "width" && t != "height" && t != "href" && t != "list" && t != "form" && t != "tabIndex" && t != "download" && t != "rowSpan" && t != "colSpan" && t != "role" && t != "popover" && t in e) try {
121
+ e[t] = n ?? "";
122
+ break n;
123
+ } catch {}
124
+ typeof n == "function" || (n == null || !1 === n && t[4] != "-" ? e.removeAttribute(t) : e.setAttribute(t, t == "popover" && n == 1 ? "" : n));
125
+ }
126
+ }
127
+ function fe(e) {
128
+ return function(t) {
129
+ if (this.l) {
130
+ var n = this.l[t.type + e];
131
+ if (t[_] == null) t[_] = b++;
132
+ else if (t[_] < n[v]) return;
133
+ return n(u.event ? u.event(t) : t);
134
+ }
135
+ };
136
+ }
137
+ function pe(e, t, n, r, i, a, o, s, c, l) {
138
+ var d, f, p, m, h, g, _, v, y, b, x, S, C, T, te, O, A = t.type;
139
+ if (t.constructor !== void 0) return null;
140
+ 128 & n.__u && (c = !!(32 & n.__u), a = [s = t.__e = n.__e]), (d = u.__b) && d(t);
141
+ n: if (typeof A == "function") {
142
+ f = o.length;
143
+ try {
144
+ if (y = t.props, b = A.prototype && A.prototype.render, x = (d = A.contextType) && r[d.__c], S = d ? x ? x.props.value : d.__ : r, n.__c ? v = (p = t.__c = n.__c).__ = p.__E : (b ? t.__c = p = new A(y, S) : (t.__c = p = new re(y, S), p.constructor = A, p.render = _e), x && x.sub(p), p.state || (p.state = {}), p.__n = r, m = p.__d = !0, p.__h = [], p._sb = []), b && p.__s == null && (p.__s = p.state), b && A.getDerivedStateFromProps != null && (p.__s == p.state && (p.__s = D({}, p.__s)), D(p.__s, A.getDerivedStateFromProps(y, p.__s))), h = p.props, g = p.state, p.__v = t, m) b && A.getDerivedStateFromProps == null && p.componentWillMount != null && p.componentWillMount(), b && p.componentDidMount != null && p.__h.push(p.componentDidMount);
145
+ else {
146
+ if (b && A.getDerivedStateFromProps == null && y !== h && p.componentWillReceiveProps != null && p.componentWillReceiveProps(y, S), t.__v == n.__v || !p.__e && p.shouldComponentUpdate != null && !1 === p.shouldComponentUpdate(y, p.__s, S)) {
147
+ t.__v != n.__v && (p.props = y, p.state = p.__s, p.__d = !1), t.__e = n.__e, t.__k = n.__k, t.__k.some(function(e) {
148
+ e && (e.__ = t);
149
+ }), w.push.apply(p.__h, p._sb), p._sb = [], p.__h.length && o.push(p), s = k(n);
150
+ break n;
151
+ }
152
+ p.componentWillUpdate != null && p.componentWillUpdate(y, p.__s, S), b && p.componentDidUpdate != null && p.__h.push(function() {
153
+ p.componentDidUpdate(h, g, _);
154
+ });
155
+ }
156
+ if (p.context = S, p.props = y, p.__P = e, p.__e = !1, C = u.__r, T = 0, b) p.state = p.__s, p.__d = !1, C && C(t), d = p.render(p.props, p.state, p.context), w.push.apply(p.__h, p._sb), p._sb = [];
157
+ else do
158
+ p.__d = !1, C && C(t), d = p.render(p.props, p.state, p.context), p.state = p.__s;
159
+ while (p.__d && ++T < 25);
160
+ p.state = p.__s, p.getChildContext != null && (r = D(D({}, r), p.getChildContext())), b && !m && p.getSnapshotBeforeUpdate != null && (_ = p.getSnapshotBeforeUpdate(h, g)), te = d != null && d.type === ne && d.key == null ? N(d.props.children) : d, s = oe(e, E(te) ? te : [te], t, n, r, i, a, o, s, c, l), p.base = t.__e, t.__u &= -161, p.__h.length && o.push(p), v && (p.__E = p.__ = null);
161
+ } catch (e) {
162
+ if (o.length = f, t.__v = null, c || a != null) {
163
+ if (e.then) {
164
+ for (t.__u |= c ? 160 : 128; s && s.nodeType == 8 && s.nextSibling;) s = s.nextSibling;
165
+ a != null && (a[a.indexOf(s)] = null), t.__e = s;
166
+ } else if (a != null) for (O = a.length; O--;) ee(a[O]);
167
+ } else t.__e = n.__e;
168
+ t.__k ??= n.__k || [], e.then || me(t), u.__e(e, t, n);
169
+ }
170
+ } else a == null && t.__v == n.__v ? (t.__k = n.__k, t.__e = n.__e) : s = t.__e = he(n.__e, t, n, r, i, a, o, c, l);
171
+ return (d = u.diffed) && d(t), 128 & t.__u ? void 0 : s;
172
+ }
173
+ function me(e) {
174
+ e && (e.__c && (e.__c.__e = !0), e.__k && e.__k.some(me));
175
+ }
176
+ function M(e, t, n) {
177
+ for (var r = 0; r < n.length; r++) P(n[r], n[++r], n[++r]);
178
+ u.__c && u.__c(t, e), e.some(function(t) {
179
+ try {
180
+ e = t.__h, t.__h = [], e.some(function(e) {
181
+ e.call(t);
182
+ });
183
+ } catch (e) {
184
+ u.__e(e, t.__v);
185
+ }
186
+ });
187
+ }
188
+ function N(e) {
189
+ return typeof e != "object" || !e || e.__b > 0 ? e : E(e) ? e.map(N) : e.constructor === void 0 ? D({}, e) : null;
190
+ }
191
+ function he(e, t, n, r, i, a, o, s, c) {
192
+ var d, f, p, m, h, g, _, v = n.props || C, y = t.props, b = t.type;
193
+ if (b == "svg" ? i = "http://www.w3.org/2000/svg" : b == "math" ? i = "http://www.w3.org/1998/Math/MathML" : i ||= "http://www.w3.org/1999/xhtml", a != null) {
194
+ for (d = 0; d < a.length; d++) if ((h = a[d]) && "setAttribute" in h == !!b && (b ? h.localName == b : h.nodeType == 3)) {
195
+ e = h, a[d] = null;
196
+ break;
197
+ }
198
+ }
199
+ if (e == null) {
200
+ if (b == null) return document.createTextNode(y);
201
+ e = document.createElementNS(i, b, y.is && y), s &&= (u.__m && u.__m(t, a), !1), a = null;
202
+ }
203
+ if (b == null) v === y || s && e.data == y || (e.data = y);
204
+ else {
205
+ if (a = b == "textarea" && y.defaultValue != null ? null : a && l.call(e.childNodes), !s && a != null) for (v = {}, d = 0; d < e.attributes.length; d++) v[(h = e.attributes[d]).name] = h.value;
206
+ for (d in v) h = v[d], d == "dangerouslySetInnerHTML" ? p = h : d == "children" || d in y || d == "value" && "defaultValue" in y || d == "checked" && "defaultChecked" in y || de(e, d, null, h, i);
207
+ for (d in y) h = y[d], d == "children" ? m = h : d == "dangerouslySetInnerHTML" ? f = h : d == "value" ? g = h : d == "checked" ? _ = h : s && typeof h != "function" || v[d] === h || de(e, d, h, v[d], i);
208
+ if (f) s || p && (f.__html == p.__html || f.__html == e.innerHTML) || (e.innerHTML = f.__html), t.__k = [];
209
+ else if (p && (e.innerHTML = ""), oe(t.type == "template" ? e.content : e, E(m) ? m : [m], t, n, r, b == "foreignObject" ? "http://www.w3.org/1999/xhtml" : i, a, o, a ? a[0] : n.__k && k(n, 0), s, c), a != null) for (d = a.length; d--;) ee(a[d]);
210
+ s && b != "textarea" || (d = "value", b == "progress" && g == null ? e.removeAttribute("value") : g != null && (g !== e[d] || b == "progress" && !g || b == "option" && g != v[d]) && de(e, d, g, v[d], i), d = "checked", _ != null && _ != e[d] && de(e, d, _, v[d], i));
211
+ }
212
+ return e;
213
+ }
214
+ function P(e, t, n) {
215
+ try {
216
+ if (typeof e == "function") {
217
+ var r = typeof e.__u == "function";
218
+ r && e.__u(), r && t == null || (e.__u = e(t));
219
+ } else e.current = t;
220
+ } catch (e) {
221
+ u.__e(e, n);
222
+ }
223
+ }
224
+ function ge(e, t, n) {
225
+ var r, i;
226
+ if (u.unmount && u.unmount(e), (r = e.ref) && (r.current && r.current != e.__e || P(r, null, t)), (r = e.__c) != null) {
227
+ if (r.componentWillUnmount) try {
228
+ r.componentWillUnmount();
229
+ } catch (e) {
230
+ u.__e(e, t);
231
+ }
232
+ r.base = r.__P = r.__n = null;
233
+ }
234
+ if (r = e.__k) for (i = 0; i < r.length; i++) r[i] && ge(r[i], t, n || typeof e.type != "function");
235
+ n || ee(e.__e), e.__c = e.__ = e.__e = void 0;
236
+ }
237
+ function _e(e, t, n) {
238
+ return this.constructor(e, n);
239
+ }
240
+ function ve(e, t, n) {
241
+ var r, i, a, o;
242
+ t == document && (t = document.documentElement), u.__ && u.__(e, t), i = (r = typeof n == "function") ? null : n && n.__k || t.__k, a = [], o = [], pe(t, e = (!r && n || t).__k = te(ne, null, [e]), i || C, C, t.namespaceURI, !r && n ? [n] : i ? null : t.firstChild ? l.call(t.childNodes) : null, a, !r && n ? n : i ? i.__e : t.firstChild, r, o), M(a, e, o), e.props.children = null;
243
+ }
244
+ l = w.slice, u = { __e: function(e, t, n, r) {
245
+ for (var i, a, o; t = t.__;) if ((i = t.__c) && !i.__) try {
246
+ if ((a = i.constructor) && a.getDerivedStateFromError != null && (i.setState(a.getDerivedStateFromError(e)), o = i.__d), i.componentDidCatch != null && (i.componentDidCatch(e, r || {}), o = i.__d), o) return i.__E = i;
247
+ } catch (t) {
248
+ e = t;
249
+ }
250
+ throw e;
251
+ } }, d = 0, re.prototype.setState = function(e, t) {
252
+ var n = this.__s != null && this.__s != this.state ? this.__s : this.__s = D({}, this.state);
253
+ typeof e == "function" && (e = e(D({}, n), this.props)), e && D(n, e), e != null && this.__v && (t && this._sb.push(t), j(this));
254
+ }, re.prototype.forceUpdate = function(e) {
255
+ this.__v && (this.__e = !0, e && this.__h.push(e), j(this));
256
+ }, re.prototype.render = ne, f = [], m = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, h = function(e, t) {
257
+ return e.__v.__b - t.__v.__b;
258
+ }, ae.__r = 0, g = Math.random().toString(8), _ = "__d" + g, v = "__a" + g, y = /(PointerCapture)$|Capture$/i, b = 0, x = fe(!1), S = fe(!0);
259
+ //#endregion
260
+ //#region node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js
261
+ var F = 0;
262
+ Array.isArray;
263
+ function I(e, t, n, r, i, a) {
264
+ t ||= {};
265
+ var o, s, c = t;
266
+ if ("ref" in c) for (s in c = {}, t) s == "ref" ? o = t[s] : c[s] = t[s];
267
+ var l = {
268
+ type: e,
269
+ props: c,
270
+ key: n,
271
+ ref: o,
272
+ __k: null,
273
+ __: null,
274
+ __b: 0,
275
+ __e: null,
276
+ __c: null,
277
+ constructor: void 0,
278
+ __v: --F,
279
+ __i: -1,
280
+ __u: 0,
281
+ __source: i,
282
+ __self: a
283
+ };
284
+ if (typeof e == "function" && (o = e.defaultProps)) for (s in o) c[s] === void 0 && (c[s] = o[s]);
285
+ return u.vnode && u.vnode(l), l;
286
+ }
287
+ //#endregion
288
+ //#region src/components/shared/toolbar/Style/Components/StyleToolbar.jsx
289
+ function L() {
290
+ let e = "forge-dropdown-item block w-full text-left cursor-pointer whitespace-nowrap px-3 py-1 text-[#333] no-underline transition-colors duration-100 hover:bg-[#f0f0f0]";
291
+ return /* @__PURE__ */ I("div", {
292
+ className: "forge-toolbar-group forge-toolbar-style flex items-center gap-0.5",
293
+ children: /* @__PURE__ */ I("div", {
294
+ className: "relative group",
295
+ children: [/* @__PURE__ */ I("button", {
296
+ type: "button",
297
+ className: "forge-toolbar-button group relative flex h-7 cursor-pointer items-center justify-center rounded-[2px] border border-[#ccc] bg-white px-2 text-sm leading-none transition-all duration-150 hover:bg-[#f0f0f0] active:translate-y-px [&.is-active]:bg-[#e5e5e5]",
298
+ "data-command": "style",
299
+ "aria-label": "Style",
300
+ children: [/* @__PURE__ */ I("span", {
301
+ className: "forge-icon",
302
+ children: "✦"
303
+ }), /* @__PURE__ */ I("span", {
304
+ className: "pointer-events-none absolute left-1/2 top-[calc(100%+8px)] z-30 -translate-x-1/2 whitespace-nowrap rounded-md border border-[#2c2c2c] bg-[#1e1e1e] px-2.5 py-1 text-[11px] font-medium leading-none text-white opacity-0 shadow-lg transition-all duration-200 group-hover:visible group-hover:opacity-100 group-has-[.is-open]:hidden rtl:left-1/2 rtl:-translate-x-1/2 before:absolute before:bottom-full before:left-1/2 before:-translate-x-1/2 before:border-x-[5px] before:border-b-[5px] before:border-t-0 before:border-solid before:border-x-transparent before:border-b-[#2c2c2c] after:absolute after:bottom-full after:left-1/2 after:-translate-x-1/2 after:translate-y-[1px] after:border-x-[4px] after:border-b-[4px] after:border-t-0 after:border-solid after:border-x-transparent after:border-b-[#1e1e1e]",
305
+ "data-i18n": "style",
306
+ children: "Style"
307
+ })]
308
+ }), /* @__PURE__ */ I("div", {
309
+ className: "forge-toolbar-dropdown forge-dropdown-style absolute left-0 top-[calc(100%+4px)] z-20 hidden [&.is-open]:block max-h-24 min-w-[110px] overflow-y-auto rounded-[2px] border border-[#ccc] bg-white p-0 shadow-[0_2px_6px_rgba(0,0,0,0.15)] rtl:left-auto rtl:right-0",
310
+ role: "list",
311
+ "aria-label": "Style",
312
+ children: [
313
+ /* @__PURE__ */ I("button", {
314
+ type: "button",
315
+ className: e,
316
+ "data-value": "p",
317
+ role: "listitem",
318
+ children: /* @__PURE__ */ I("p", {
319
+ className: "m-0 text-[13px] font-normal leading-[1.4]",
320
+ children: "Normal"
321
+ })
322
+ }),
323
+ /* @__PURE__ */ I("button", {
324
+ type: "button",
325
+ className: e,
326
+ "data-value": "blockquote",
327
+ role: "listitem",
328
+ children: /* @__PURE__ */ I("blockquote", {
329
+ className: "m-0 text-[13px] font-normal leading-[1.4]",
330
+ children: "Blockquote"
331
+ })
332
+ }),
333
+ /* @__PURE__ */ I("button", {
334
+ type: "button",
335
+ className: e,
336
+ "data-value": "pre",
337
+ role: "listitem",
338
+ children: /* @__PURE__ */ I("pre", {
339
+ className: "m-0 font-mono text-[13px] leading-[1.4]",
340
+ children: "Code"
341
+ })
342
+ }),
343
+ /* @__PURE__ */ I("button", {
344
+ type: "button",
345
+ className: e,
346
+ "data-value": "h1",
347
+ role: "listitem",
348
+ children: /* @__PURE__ */ I("h1", {
349
+ className: "m-0 text-[20px] font-normal leading-[1.4]",
350
+ children: "Heading 1"
351
+ })
352
+ }),
353
+ /* @__PURE__ */ I("button", {
354
+ type: "button",
355
+ className: e,
356
+ "data-value": "h2",
357
+ role: "listitem",
358
+ children: /* @__PURE__ */ I("h2", {
359
+ className: "m-0 text-[18px] font-normal leading-[1.4]",
360
+ children: "Heading 2"
361
+ })
362
+ }),
363
+ /* @__PURE__ */ I("button", {
364
+ type: "button",
365
+ className: e,
366
+ "data-value": "h3",
367
+ role: "listitem",
368
+ children: /* @__PURE__ */ I("h3", {
369
+ className: "m-0 text-[16px] font-normal leading-[1.4]",
370
+ children: "Heading 3"
371
+ })
372
+ }),
373
+ /* @__PURE__ */ I("button", {
374
+ type: "button",
375
+ className: e,
376
+ "data-value": "h4",
377
+ role: "listitem",
378
+ children: /* @__PURE__ */ I("h4", {
379
+ className: "m-0 text-[15px] font-normal leading-[1.4]",
380
+ children: "Heading 4"
381
+ })
382
+ }),
383
+ /* @__PURE__ */ I("button", {
384
+ type: "button",
385
+ className: e,
386
+ "data-value": "h5",
387
+ role: "listitem",
388
+ children: /* @__PURE__ */ I("h5", {
389
+ className: "m-0 text-[14px] font-normal leading-[1.4]",
390
+ children: "Heading 5"
391
+ })
392
+ }),
393
+ /* @__PURE__ */ I("button", {
394
+ type: "button",
395
+ className: e,
396
+ "data-value": "h6",
397
+ role: "listitem",
398
+ children: /* @__PURE__ */ I("h6", {
399
+ className: "m-0 text-[13px] font-normal leading-[1.4]",
400
+ children: "Heading 6"
401
+ })
402
+ })
403
+ ]
404
+ })]
405
+ })
406
+ });
407
+ }
408
+ //#endregion
409
+ //#region src/components/shared/toolbar/Style/Components/index.jsx
410
+ function ye() {
411
+ return L();
412
+ }
413
+ //#endregion
414
+ //#region src/components/shared/toolbar/font/Components/FontToolbar.jsx
415
+ function R({ onCommand: e, isBold: t, isUnderline: n }) {
416
+ let r = "group relative flex h-7 w-7 items-center justify-center p-0 text-sm leading-none cursor-pointer transition-colors duration-150 active:translate-y-px", i = "bg-white text-[#333] hover:bg-[#f0f0f0]", a = "bg-[#e2e8f0] text-black border-inner shadow-[inset_0_1px_3px_rgba(0,0,0,0.2)] font-bold", o = "pointer-events-none absolute left-1/2 top-[calc(100%+8px)] z-30 -translate-x-1/2 whitespace-nowrap rounded-md border border-[#2c2c2c] bg-[#1e1e1e] px-2.5 py-1 text-[11px] font-medium leading-none text-white opacity-0 shadow-lg transition-all duration-200 group-hover:visible group-hover:opacity-100 rtl:left-1/2 rtl:-translate-x-1/2 before:absolute before:bottom-full before:left-1/2 before:-translate-x-1/2 before:border-x-[5px] before:border-b-[5px] before:border-t-0 before:border-solid before:border-x-transparent before:border-b-[#2c2c2c] after:absolute after:bottom-full after:left-1/2 after:-translate-x-1/2 after:translate-y-[1px] after:border-x-[4px] after:border-b-[4px] after:border-t-0 after:border-solid after:border-x-transparent after:border-b-[#1e1e1e]";
417
+ return /* @__PURE__ */ I("div", {
418
+ className: "forge-toolbar-group forge-toolbar-font inline-flex items-center rounded-sm border border-[#ccc] bg-white divide-x divide-[#ccc] rtl:divide-x-reverse",
419
+ children: [
420
+ /* @__PURE__ */ I("button", {
421
+ type: "button",
422
+ className: `${r} ${t ? a : i}`,
423
+ onClick: () => e("bold"),
424
+ "aria-label": "Bold",
425
+ children: [/* @__PURE__ */ I("span", {
426
+ className: "text-sm font-bold font-serif",
427
+ children: "B"
428
+ }), /* @__PURE__ */ I("span", {
429
+ className: o,
430
+ "data-i18n": "bold",
431
+ children: "Bold"
432
+ })]
433
+ }),
434
+ /* @__PURE__ */ I("button", {
435
+ type: "button",
436
+ className: `${r} ${n ? a : i}`,
437
+ onClick: () => e("underline"),
438
+ "aria-label": "Underline",
439
+ children: [/* @__PURE__ */ I("span", {
440
+ className: "text-sm font-bold font-serif underline",
441
+ children: "U"
442
+ }), /* @__PURE__ */ I("span", {
443
+ className: o,
444
+ "data-i18n": "underline",
445
+ children: "Underline"
446
+ })]
447
+ }),
448
+ /* @__PURE__ */ I("button", {
449
+ type: "button",
450
+ className: `${r} ${i}`,
451
+ onClick: () => e("removeFormat"),
452
+ "aria-label": "Remove Font Style",
453
+ children: [/* @__PURE__ */ I("span", {
454
+ className: "inline-block h-4 w-4 text-center text-sm leading-none",
455
+ children: /* @__PURE__ */ I("svg", {
456
+ viewBox: "0 0 20 20",
457
+ className: "block h-4 w-4 fill-none stroke-black",
458
+ strokeWidth: "2",
459
+ children: /* @__PURE__ */ I("path", { d: "M 4 4 L 16 16 M 16 4 L 4 16" })
460
+ })
461
+ }), /* @__PURE__ */ I("span", {
462
+ className: o,
463
+ "data-i18n": "removeFormat",
464
+ children: "Remove Font Style"
465
+ })]
466
+ })
467
+ ]
468
+ });
469
+ }
470
+ //#endregion
471
+ //#region node_modules/preact/hooks/dist/hooks.module.js
472
+ var z, B, be, xe, V = 0, Se = [], H = u, Ce = H.__b, we = H.__r, Te = H.diffed, Ee = H.__c, De = H.unmount, Oe = H.__;
473
+ function ke(e, t) {
474
+ H.__h && H.__h(B, e, V || t), V = 0;
475
+ var n = B.__H || (B.__H = {
476
+ __: [],
477
+ __h: []
478
+ });
479
+ return e >= n.__.length && n.__.push({}), n.__[e];
480
+ }
481
+ function U(e) {
482
+ return V = 1, Ae(Re, e);
483
+ }
484
+ function Ae(e, t, n) {
485
+ var r = ke(z++, 2);
486
+ if (r.t = e, !r.__c && (r.__ = [n ? n(t) : Re(void 0, t), function(e) {
487
+ var t = r.__N ? r.__N[0] : r.__[0], n = r.t(t, e);
488
+ t !== n && (r.__N = [n, r.__[1]], r.__c.setState({}));
489
+ }], r.__c = B, !B.__f)) {
490
+ var i = function(e, t, n) {
491
+ if (!r.__c.__H) return !0;
492
+ var i = !1, o = r.__c.props !== e;
493
+ if (r.__c.__H.__.some(function(e) {
494
+ if (e.__N) {
495
+ i = !0;
496
+ var t = e.__[0];
497
+ e.__ = e.__N, e.__N = void 0, t !== e.__[0] && (o = !0);
498
+ }
499
+ }), a) {
500
+ var s = a.call(this, e, t, n);
501
+ return i ? s || o : s;
502
+ }
503
+ return !i || o;
504
+ };
505
+ B.__f = !0;
506
+ var a = B.shouldComponentUpdate, o = B.componentWillUpdate;
507
+ B.componentWillUpdate = function(e, t, n) {
508
+ if (this.__e) {
509
+ var r = a;
510
+ a = void 0, i(e, t, n), a = r;
511
+ }
512
+ o && o.call(this, e, t, n);
513
+ }, B.shouldComponentUpdate = i;
514
+ }
515
+ return r.__N || r.__;
516
+ }
517
+ function W(e, t) {
518
+ var n = ke(z++, 3);
519
+ !H.__s && Le(n.__H, t) && (n.__ = e, n.u = t, B.__H.__h.push(n));
520
+ }
521
+ function G(e) {
522
+ return V = 5, je(function() {
523
+ return { current: e };
524
+ }, []);
525
+ }
526
+ function je(e, t) {
527
+ var n = ke(z++, 7);
528
+ return Le(n.__H, t) && (n.__ = e(), n.__H = t, n.__h = e), n.__;
529
+ }
530
+ function Me() {
531
+ for (var e; e = Se.shift();) {
532
+ var t = e.__H;
533
+ if (e.__P && t) try {
534
+ t.__h.some(Fe), t.__h.some(Ie), t.__h = [];
535
+ } catch (n) {
536
+ t.__h = [], H.__e(n, e.__v);
537
+ }
538
+ }
539
+ }
540
+ H.__b = function(e) {
541
+ B = null, Ce && Ce(e);
542
+ }, H.__ = function(e, t) {
543
+ e && t.__k && t.__k.__m && (e.__m = t.__k.__m), Oe && Oe(e, t);
544
+ }, H.__r = function(e) {
545
+ we && we(e), z = 0;
546
+ var t = (B = e.__c).__H;
547
+ t && (be === B ? (t.__h = [], B.__h = [], t.__.some(function(e) {
548
+ e.__N && (e.__ = e.__N), e.u = e.__N = void 0;
549
+ })) : (t.__h.some(Fe), t.__h.some(Ie), t.__h = [], z = 0)), be = B;
550
+ }, H.diffed = function(e) {
551
+ Te && Te(e);
552
+ var t = e.__c;
553
+ t && t.__H && (t.__H.__h.length && (Se.push(t) !== 1 && xe === H.requestAnimationFrame || ((xe = H.requestAnimationFrame) || Pe)(Me)), t.__H.__.some(function(e) {
554
+ e.u &&= (e.__H = e.u, void 0);
555
+ })), be = B = null;
556
+ }, H.__c = function(e, t) {
557
+ t.some(function(e) {
558
+ try {
559
+ e.__h.some(Fe), e.__h = e.__h.filter(function(e) {
560
+ return !e.__ || Ie(e);
561
+ });
562
+ } catch (n) {
563
+ t.some(function(e) {
564
+ e.__h &&= [];
565
+ }), t = [], H.__e(n, e.__v);
566
+ }
567
+ }), Ee && Ee(e, t);
568
+ }, H.unmount = function(e) {
569
+ De && De(e);
570
+ var t, n = e.__c;
571
+ n && n.__H && (n.__H.__.some(function(e) {
572
+ try {
573
+ Fe(e);
574
+ } catch (e) {
575
+ t = e;
576
+ }
577
+ }), n.__H = void 0, t && H.__e(t, n.__v));
578
+ };
579
+ var Ne = typeof requestAnimationFrame == "function";
580
+ function Pe(e) {
581
+ var t, n = function() {
582
+ clearTimeout(r), Ne && cancelAnimationFrame(t), setTimeout(e);
583
+ }, r = setTimeout(n, 35);
584
+ Ne && (t = requestAnimationFrame(n));
585
+ }
586
+ function Fe(e) {
587
+ var t = B, n = e.__c;
588
+ typeof n == "function" && (e.__c = void 0, n()), B = t;
589
+ }
590
+ function Ie(e) {
591
+ var t = B;
592
+ e.__c = e.__(), B = t;
593
+ }
594
+ function Le(e, t) {
595
+ return !e || e.length !== t.length || t.some(function(t, n) {
596
+ return t !== e[n];
597
+ });
598
+ }
599
+ function Re(e, t) {
600
+ return typeof t == "function" ? t(e) : t;
601
+ }
602
+ //#endregion
603
+ //#region src/components/shared/toolbar/font/Hooks/boldHandler.jsx
604
+ var ze = (e, t, n) => {
605
+ if (!e.collapsed) {
606
+ if (n) {
607
+ let t = e.commonAncestorContainer;
608
+ for (t.nodeType === 3 && (t = t.parentNode); t && t.getAttribute && t.getAttribute("contenteditable") !== "true";) {
609
+ if (t.style && t.style.fontWeight) {
610
+ if (t.style.fontWeight = "", !t.getAttribute("style")) {
611
+ let e = t.parentNode;
612
+ for (; t.firstChild;) e.insertBefore(t.firstChild, t);
613
+ e.removeChild(t);
614
+ }
615
+ break;
616
+ }
617
+ t = t.parentNode;
618
+ }
619
+ } else {
620
+ let t = e.extractContents(), n = document.createElement("span");
621
+ n.style.fontWeight = "bold", n.appendChild(t), e.insertNode(n);
622
+ }
623
+ return;
624
+ }
625
+ if (n) {
626
+ let n = e.startContainer, r = n.nodeType === 1 ? n : n.parentNode;
627
+ for (; r && r.getAttribute && r.getAttribute("contenteditable") !== "true" && !(r.style && r.style.fontWeight);) r = r.parentNode;
628
+ let i = document.createElement("span");
629
+ i.innerHTML = "​", r && r.parentNode ? r.nextSibling ? r.parentNode.insertBefore(i, r.nextSibling) : r.parentNode.appendChild(i) : e.insertNode(i);
630
+ let a = document.createRange();
631
+ a.setStart(i, 1), a.collapse(!0), t.removeAllRanges(), t.addRange(a);
632
+ } else {
633
+ let n = document.createElement("span");
634
+ n.style.fontWeight = "bold", n.innerHTML = "​", e.insertNode(n);
635
+ let r = document.createRange();
636
+ r.setStart(n, 1), r.collapse(!0), t.removeAllRanges(), t.addRange(r);
637
+ }
638
+ }, Be = (e, t, n) => {
639
+ if (!e.collapsed) {
640
+ if (n) {
641
+ let t = e.commonAncestorContainer;
642
+ for (t.nodeType === 3 && (t = t.parentNode); t && t.getAttribute && t.getAttribute("contenteditable") !== "true";) {
643
+ if (t.style && t.style.textDecoration) {
644
+ if (t.style.textDecoration = "", !t.getAttribute("style")) {
645
+ let e = t.parentNode;
646
+ for (; t.firstChild;) e.insertBefore(t.firstChild, t);
647
+ e.removeChild(t);
648
+ }
649
+ break;
650
+ }
651
+ t = t.parentNode;
652
+ }
653
+ } else {
654
+ let t = e.extractContents(), n = document.createElement("span");
655
+ n.style.textDecoration = "underline", n.appendChild(t), e.insertNode(n);
656
+ }
657
+ return;
658
+ }
659
+ if (n) {
660
+ let n = e.startContainer, r = n.nodeType === 1 ? n : n.parentNode;
661
+ for (; r && r.getAttribute && r.getAttribute("contenteditable") !== "true" && !(r.style && r.style.textDecoration);) r = r.parentNode;
662
+ let i = document.createElement("span");
663
+ i.innerHTML = "​", r && r.parentNode ? r.nextSibling ? r.parentNode.insertBefore(i, r.nextSibling) : r.parentNode.appendChild(i) : e.insertNode(i);
664
+ let a = document.createRange();
665
+ a.setStart(i, 1), a.collapse(!0), t.removeAllRanges(), t.addRange(a);
666
+ } else {
667
+ let n = document.createElement("span");
668
+ n.style.textDecoration = "underline", n.innerHTML = "​", e.insertNode(n);
669
+ let r = document.createRange();
670
+ r.setStart(n, 1), r.collapse(!0), t.removeAllRanges(), t.addRange(r);
671
+ }
672
+ }, Ve = (e) => {
673
+ let t = document.createTreeWalker(e, NodeFilter.SHOW_TEXT, null, !1), n;
674
+ for (; n = t.nextNode();) n.nodeValue = n.nodeValue.replace(/\u00A0/g, " ");
675
+ }, He = (e) => {
676
+ e.querySelectorAll("span, b, u, strong").forEach((e) => {
677
+ let t = e.getAttribute("style") || e.getAttribute("class"), n = [
678
+ "B",
679
+ "U",
680
+ "STRONG"
681
+ ].includes(e.tagName);
682
+ if (!t && !n) {
683
+ let t = e.parentNode;
684
+ for (; e.firstChild;) t.insertBefore(e.firstChild, e);
685
+ t.removeChild(e);
686
+ } else (!e.textContent || e.textContent.replace(/\u200B/g, "").length === 0) && e.remove();
687
+ });
688
+ }, Ue = (e, t) => {
689
+ if (e.collapsed) return;
690
+ let n = e.commonAncestorContainer;
691
+ for (n.nodeType === 3 && (n = n.parentNode); n && n.getAttribute && n.getAttribute("contenteditable") !== "true";) {
692
+ let e = window.getComputedStyle(n).display;
693
+ if (e === "block" || e === "flex" || n.tagName === "PRE") break;
694
+ n = n.parentNode;
695
+ }
696
+ let r = e.extractContents().textContent.replace(/\u00A0/g, " "), i = document.createTextNode(r);
697
+ e.insertNode(i), n && n.getAttribute("contenteditable") !== "true" && (He(n), Ve(n), n.normalize());
698
+ let a = document.createRange();
699
+ a.selectNodeContents(i), t.removeAllRanges(), t.addRange(a);
700
+ };
701
+ //#endregion
702
+ //#region src/components/shared/toolbar/font/Hooks/fontLogic.jsx
703
+ function We() {
704
+ let [e, t] = U(!1), [n, r] = U(!1), i = () => {
705
+ let e = window.getSelection();
706
+ if (!e || e.rangeCount === 0) return;
707
+ let n = e.anchorNode;
708
+ if (!n) return;
709
+ n.nodeType === 3 && (n = n.parentNode);
710
+ let i = !1, a = !1;
711
+ for (; n && n.getAttribute && n.getAttribute("contenteditable") !== "true";) {
712
+ let e = window.getComputedStyle(n).fontWeight, t = window.getComputedStyle(n).textDecoration;
713
+ (e === "bold" || parseInt(e) >= 700 || n.tagName === "B" || n.tagName === "STRONG") && (i = !0), (t.includes("underline") || n.tagName === "U") && (a = !0), n = n.parentNode;
714
+ }
715
+ t(i), r(a);
716
+ };
717
+ return W(() => (document.addEventListener("selectionchange", i), () => document.removeEventListener("selectionchange", i)), []), {
718
+ executeCommand: (t) => {
719
+ let r = window.getSelection();
720
+ if (!r || r.rangeCount === 0) return;
721
+ let a = r.getRangeAt(0);
722
+ t === "bold" ? ze(a, r, e) : t === "underline" ? Be(a, r, n) : t === "removeFormat" && Ue(a, r), i();
723
+ },
724
+ isBold: e,
725
+ isUnderline: n
726
+ };
727
+ }
728
+ //#endregion
729
+ //#region src/components/shared/toolbar/font/Components/index.jsx
730
+ function Ge() {
731
+ let { executeCommand: e, isBold: t, isUnderline: n } = We();
732
+ return /* @__PURE__ */ I(R, {
733
+ onCommand: e,
734
+ isBold: t,
735
+ isUnderline: n
736
+ });
737
+ }
738
+ //#endregion
739
+ //#region src/components/shared/toolbar/FontName/Hooks/fontNameHandler.jsx
740
+ function K(e, t) {
741
+ let n = document.createElement("span");
742
+ n.style.fontFamily = t;
743
+ try {
744
+ return n.appendChild(e.extractContents()), e.insertNode(n), n;
745
+ } catch {
746
+ return null;
747
+ }
748
+ }
749
+ function Ke(e) {
750
+ let t = e.startContainer, n = e.startOffset, r = t.nodeType === 3 ? t.parentNode : t;
751
+ if (!r || r.nodeType !== 1 || r.tagName !== "SPAN" || !r.style || !r.style.fontFamily) return null;
752
+ let i = r, a = !1, o = !1, s = null;
753
+ return t.nodeType === 3 ? (s = t, a = n === 0 && t === i.firstChild, o = n === t.textContent.length && t === i.lastChild) : t === i && (a = n === 0, o = n === i.childNodes.length), {
754
+ fontSpan: i,
755
+ textNode: s,
756
+ offset: n,
757
+ atStart: a,
758
+ atEnd: o
759
+ };
760
+ }
761
+ function qe(e) {
762
+ let t = document.createElement("span");
763
+ return t.style.fontFamily = e, t.appendChild(document.createTextNode("​")), t;
764
+ }
765
+ function Je(e, t) {
766
+ let n = document.createRange();
767
+ n.setStart(e.firstChild, 1), n.collapse(!0), t.removeAllRanges(), t.addRange(n);
768
+ }
769
+ function Ye(e, t, n) {
770
+ let r = Ke(e);
771
+ if (r) {
772
+ let { fontSpan: e, textNode: i, offset: a, atStart: o, atEnd: s } = r;
773
+ if (o) {
774
+ let r = qe(n);
775
+ e.parentNode.insertBefore(r, e), Je(r, t);
776
+ return;
777
+ }
778
+ if (s) {
779
+ let r = qe(n);
780
+ e.nextSibling ? e.parentNode.insertBefore(r, e.nextSibling) : e.parentNode.appendChild(r), Je(r, t);
781
+ return;
782
+ }
783
+ if (i) {
784
+ let r = i.splitText(a), o = qe(n);
785
+ e.insertBefore(o, r), Je(o, t);
786
+ return;
787
+ }
788
+ }
789
+ let i = qe(n);
790
+ e.insertNode(i), Je(i, t);
791
+ }
792
+ var Xe = (e, t, n) => {
793
+ let r = n || "Arial";
794
+ if (!(!e || !t)) {
795
+ if (!e.collapsed) {
796
+ let n = K(e, r);
797
+ if (!n) return;
798
+ let i = document.createRange();
799
+ i.selectNodeContents(n), t.removeAllRanges(), t.addRange(i);
800
+ return;
801
+ }
802
+ Ye(e, t, r);
803
+ }
804
+ }, Ze = (e) => {
805
+ let t = window.getSelection();
806
+ if (!t || t.rangeCount === 0) return null;
807
+ let n = t.anchorNode;
808
+ if (!n || e && !e.contains(n)) return null;
809
+ for (n.nodeType === 3 && (n = n.parentNode); n && n !== e;) {
810
+ if (n.style && n.style.fontFamily) {
811
+ let e = n.style.fontFamily.split(",")[0].replace(/['"]/g, "").trim();
812
+ if (e) return e;
813
+ }
814
+ n = n.parentNode;
815
+ }
816
+ return null;
817
+ };
818
+ //#endregion
819
+ //#region src/components/shared/toolbar/FontName/Hooks/fontNameLogic.jsx
820
+ function Qe(e) {
821
+ let [t, n] = U("Arial"), r = G("Arial"), i = G(null), a = () => {
822
+ let t = window.getSelection();
823
+ if (t && t.rangeCount > 0) {
824
+ let n = t.getRangeAt(0), r = e?.current;
825
+ r && r.contains(n.commonAncestorContainer) && (i.current = n.cloneRange());
826
+ }
827
+ }, o = () => {
828
+ let t = e?.current;
829
+ if (!t) return;
830
+ let i = Ze(t);
831
+ i && (n(i), r.current = i);
832
+ };
833
+ return W(() => {
834
+ let t = () => {
835
+ a(), o();
836
+ };
837
+ document.addEventListener("selectionchange", t);
838
+ let n = e?.current;
839
+ if (!n) return () => {
840
+ document.removeEventListener("selectionchange", t);
841
+ };
842
+ let i = (e) => {
843
+ if (e.inputType !== "insertText" || !e.data) return;
844
+ let t = window.getSelection();
845
+ if (!t || t.rangeCount === 0) return;
846
+ let n = t.getRangeAt(0), i = n.startContainer;
847
+ if (i.nodeType === 3 && (i = i.parentNode), i && i.tagName === "SPAN" && i.style.fontFamily && i.style.fontFamily.replace(/['"]/g, "").toLowerCase() === r.current.toLowerCase()) return;
848
+ e.preventDefault();
849
+ let a = document.createElement("span");
850
+ a.style.fontFamily = r.current, a.textContent = e.data, n.deleteContents(), n.insertNode(a);
851
+ let o = document.createRange();
852
+ o.setStart(a.firstChild, a.textContent.length), o.collapse(!0), t.removeAllRanges(), t.addRange(o);
853
+ };
854
+ return n.addEventListener("beforeinput", i), () => {
855
+ document.removeEventListener("selectionchange", t), n.removeEventListener("beforeinput", i);
856
+ };
857
+ }, [e, e?.current]), {
858
+ currentFont: t,
859
+ applyFont: (t) => {
860
+ let o = t || "Arial";
861
+ r.current = o, n(o);
862
+ let s = e?.current;
863
+ if (!s) return;
864
+ s.focus();
865
+ let c = window.getSelection(), l = null;
866
+ if (c && c.rangeCount > 0) {
867
+ let e = c.getRangeAt(0);
868
+ s.contains(e.commonAncestorContainer) && (l = e);
869
+ }
870
+ if (!l && i.current && (c.removeAllRanges(), c.addRange(i.current), l = i.current), !l) {
871
+ let e = document.createRange();
872
+ e.selectNodeContents(s), e.collapse(!1), c.removeAllRanges(), c.addRange(e), l = e;
873
+ }
874
+ Xe(l, c, o), a();
875
+ }
876
+ };
877
+ }
878
+ //#endregion
879
+ //#region src/components/shared/toolbar/Hooks/dropdown.js
880
+ function q(e, t) {
881
+ function n() {
882
+ t.classList.remove("is-open"), e.classList.remove("is-active"), document.removeEventListener("click", r);
883
+ }
884
+ function r(r) {
885
+ !t.contains(r.target) && !e.contains(r.target) && n();
886
+ }
887
+ function i(n) {
888
+ n.stopPropagation();
889
+ let i = t.classList.contains("is-open");
890
+ document.querySelectorAll(".forge-toolbar-dropdown.is-open").forEach((e) => {
891
+ e.classList.remove("is-open");
892
+ }), document.querySelectorAll(".forge-toolbar-button.is-active").forEach((e) => {
893
+ e.classList.remove("is-active");
894
+ }), i || (t.classList.add("is-open"), e.classList.add("is-active"), document.addEventListener("click", r));
895
+ }
896
+ return e.addEventListener("click", i), function() {
897
+ e.removeEventListener("click", i), document.removeEventListener("click", r);
898
+ };
899
+ }
900
+ //#endregion
901
+ //#region src/components/shared/toolbar/FontName/Components/FontNameToolbar.jsx
902
+ var $e = [
903
+ "Arial",
904
+ "Arial Black",
905
+ "Comic Sans MS",
906
+ "Courier New",
907
+ "Helvetica",
908
+ "Impact",
909
+ "Tahoma",
910
+ "Times New Roman",
911
+ "Verdana",
912
+ "Nunito Sans",
913
+ "Segoe UI"
914
+ ], et = 32;
915
+ function J({ currentFont: e, applyFont: t }) {
916
+ let n = G(null), r = G(null);
917
+ W(() => {
918
+ if (n.current && r.current) return q(n.current, r.current);
919
+ }, []);
920
+ let i = (e) => {
921
+ t(e), r.current && r.current.classList.remove("is-open"), n.current && n.current.classList.remove("is-active");
922
+ }, a = "pointer-events-none absolute left-1/2 top-[calc(100%+8px)] z-30 -translate-x-1/2 whitespace-nowrap rounded-md border border-[#2c2c2c] bg-[#1e1e1e] px-2.5 py-1 text-[11px] font-medium leading-none text-white opacity-0 shadow-lg transition-all duration-200 group-hover:visible group-hover:opacity-100 rtl:left-1/2 rtl:-translate-x-1/2 before:absolute before:bottom-full before:left-1/2 before:-translate-x-1/2 before:border-x-[5px] before:border-b-[5px] before:border-t-0 before:border-solid before:border-x-transparent before:border-b-[#2c2c2c] after:absolute after:bottom-full after:left-1/2 after:-translate-x-1/2 after:translate-y-[1px] after:border-x-[4px] after:border-b-[4px] after:border-t-0 after:border-solid after:border-x-transparent after:border-b-[#1e1e1e]";
923
+ return /* @__PURE__ */ I("div", {
924
+ className: "forge-toolbar-group forge-toolbar-fontname relative flex shrink-0 items-center",
925
+ children: [/* @__PURE__ */ I("div", {
926
+ className: "forge-color-button-group flex h-[30px] items-center overflow-visible rounded border border-[#ccc] bg-white hover:border-[#aaa] hover:bg-[#f9f9f9]",
927
+ children: [/* @__PURE__ */ I("button", {
928
+ type: "button",
929
+ className: "forge-fontname-main group relative flex h-full w-[70px] shrink-0 items-center justify-center cursor-pointer border-none bg-transparent px-2 hover:bg-black/5",
930
+ onMouseDown: (e) => e.preventDefault(),
931
+ onClick: () => {
932
+ n.current && n.current.click();
933
+ },
934
+ "aria-label": "Current font",
935
+ children: [/* @__PURE__ */ I("span", {
936
+ className: "forge-current-fontname inline-block max-w-[50px] truncate text-xs text-[#333]",
937
+ style: { fontFamily: e },
938
+ children: e
939
+ }), /* @__PURE__ */ I("span", {
940
+ className: a,
941
+ "data-i18n": "fontName",
942
+ children: "Font Family"
943
+ })]
944
+ }), /* @__PURE__ */ I("button", {
945
+ ref: n,
946
+ type: "button",
947
+ className: "forge-fontname-dropdown-btn group relative flex h-full shrink-0 items-center justify-center min-w-[18px] cursor-pointer border-l border-[#ccc] bg-transparent px-1 hover:bg-black/5",
948
+ onMouseDown: (e) => e.preventDefault(),
949
+ "aria-label": "More fonts",
950
+ children: [/* @__PURE__ */ I(() => /* @__PURE__ */ I("svg", {
951
+ className: "h-2 w-2 fill-current text-[#666]",
952
+ viewBox: "0 0 10 6",
953
+ xmlns: "http://www.w3.org/2000/svg",
954
+ children: /* @__PURE__ */ I("path", { d: "M0 0l5 6 5-6H0z" })
955
+ }), {}), /* @__PURE__ */ I("span", {
956
+ className: a,
957
+ "data-i18n": "moreFont",
958
+ children: "More Fonts"
959
+ })]
960
+ })]
961
+ }), /* @__PURE__ */ I("div", {
962
+ ref: r,
963
+ className: "forge-toolbar-dropdown forge-dropdown-fontname absolute left-0 top-full z-20 hidden mt-1 min-w-[150px] overflow-y-auto rounded border border-[#ccc] bg-white p-1 shadow-md rtl:left-auto rtl:right-0 [&.is-open]:block",
964
+ style: { maxHeight: "128px" },
965
+ children: $e.map((e) => /* @__PURE__ */ I("button", {
966
+ type: "button",
967
+ className: "forge-dropdown-item flex w-full cursor-pointer items-center whitespace-nowrap rounded-sm px-2 text-left text-xs text-[#333] hover:bg-[#f0f0f0]",
968
+ style: {
969
+ fontFamily: e,
970
+ height: `${et}px`
971
+ },
972
+ onMouseDown: (e) => e.preventDefault(),
973
+ onClick: () => i(e),
974
+ children: e
975
+ }, e))
976
+ })]
977
+ });
978
+ }
979
+ //#endregion
980
+ //#region src/components/shared/toolbar/FontName/Components/index.jsx
981
+ function tt({ editorRef: e }) {
982
+ let { currentFont: t, applyFont: n } = Qe(e);
983
+ return /* @__PURE__ */ I(J, {
984
+ currentFont: t,
985
+ applyFont: n
986
+ });
987
+ }
988
+ //#endregion
989
+ //#region src/components/shared/toolbar/Color/Components/colorPalette.jsx
990
+ var nt = [
991
+ [
992
+ "#000000",
993
+ "#424242",
994
+ "#636363",
995
+ "#9C9C94",
996
+ "#CEC6CE",
997
+ "#EFEFEF",
998
+ "#F7F7F7",
999
+ "#FFFFFF"
1000
+ ],
1001
+ [
1002
+ "#FF0000",
1003
+ "#FF9C00",
1004
+ "#FFFF00",
1005
+ "#00FF00",
1006
+ "#00FFFF",
1007
+ "#0000FF",
1008
+ "#9C00FF",
1009
+ "#FF00FF"
1010
+ ],
1011
+ [
1012
+ "#F7C6CE",
1013
+ "#FFE7CE",
1014
+ "#FFEFC6",
1015
+ "#D6EFD6",
1016
+ "#CEDEE7",
1017
+ "#CEE7F7",
1018
+ "#D6D6E7",
1019
+ "#E7D6DE"
1020
+ ],
1021
+ [
1022
+ "#E79C9C",
1023
+ "#FFC69C",
1024
+ "#FFE79C",
1025
+ "#B5D6A5",
1026
+ "#A5C6CE",
1027
+ "#9CC6EF",
1028
+ "#B5A5D6",
1029
+ "#D6A5BD"
1030
+ ],
1031
+ [
1032
+ "#E76363",
1033
+ "#F7AD6B",
1034
+ "#FFD663",
1035
+ "#94BD7B",
1036
+ "#73A5AD",
1037
+ "#6BADDE",
1038
+ "#8C7BC6",
1039
+ "#C67BA5"
1040
+ ],
1041
+ [
1042
+ "#CE0000",
1043
+ "#E79439",
1044
+ "#EFC631",
1045
+ "#6BA54A",
1046
+ "#4A7B8C",
1047
+ "#3984C6",
1048
+ "#634AA5",
1049
+ "#A54A7B"
1050
+ ],
1051
+ [
1052
+ "#9C0000",
1053
+ "#B56308",
1054
+ "#BD9400",
1055
+ "#397B21",
1056
+ "#104A5A",
1057
+ "#085294",
1058
+ "#311873",
1059
+ "#731842"
1060
+ ],
1061
+ [
1062
+ "#630000",
1063
+ "#7B3900",
1064
+ "#846300",
1065
+ "#295218",
1066
+ "#083139",
1067
+ "#003163",
1068
+ "#21104A",
1069
+ "#4A1031"
1070
+ ]
1071
+ ];
1072
+ function rt({ event: e, onApply: t, currentColor: n }) {
1073
+ return /* @__PURE__ */ I("div", {
1074
+ className: "forge-color-palette flex flex-col gap-1",
1075
+ children: nt.map((r, i) => /* @__PURE__ */ I("div", {
1076
+ className: "forge-color-row flex gap-1 justify-between",
1077
+ children: r.map((r) => {
1078
+ let i = n?.toLowerCase() === r.toLowerCase();
1079
+ return /* @__PURE__ */ I("button", {
1080
+ type: "button",
1081
+ title: r,
1082
+ className: `forge-color-button h-4 w-4 cursor-pointer rounded-[2px] border p-0 hover:scale-110 hover:border-black transition-transform ${i ? "border-2 border-black" : "border-[#ccc]"}`,
1083
+ style: { backgroundColor: r },
1084
+ onMouseDown: (e) => e.preventDefault(),
1085
+ onClick: () => t(e, r),
1086
+ "aria-label": r,
1087
+ "aria-pressed": i
1088
+ }, r);
1089
+ })
1090
+ }, i))
1091
+ });
1092
+ }
1093
+ //#endregion
1094
+ //#region src/components/shared/toolbar/Color/Components/ColorToolbar.jsx
1095
+ function it({ logic: e }) {
1096
+ let { applyColor: t, applyRecentColor: n, resetColor: r, recentForeColor: i, recentBackColor: a } = e, o = G(null), s = G(null), c = G(null), l = G(null);
1097
+ W(() => {
1098
+ if (o.current && s.current) return q(o.current, s.current);
1099
+ }, []), W(() => {
1100
+ if (c.current && l.current) return q(c.current, l.current);
1101
+ }, []);
1102
+ let u = (e, n) => {
1103
+ t(e, n), s.current && s.current.classList.remove("is-open"), o.current && o.current.classList.remove("is-active");
1104
+ }, d = (e, n) => {
1105
+ t(e, n), l.current && l.current.classList.remove("is-open"), c.current && c.current.classList.remove("is-active");
1106
+ }, f = () => {
1107
+ r("foreColor"), s.current && s.current.classList.remove("is-open"), o.current && o.current.classList.remove("is-active");
1108
+ }, p = () => {
1109
+ r("backColor"), l.current && l.current.classList.remove("is-open"), c.current && c.current.classList.remove("is-active");
1110
+ }, m = "pointer-events-none absolute left-1/2 top-[calc(100%+8px)] z-30 -translate-x-1/2 whitespace-nowrap rounded-md border border-[#2c2c2c] bg-[#1e1e1e] px-2.5 py-1 text-[11px] font-medium leading-none text-white opacity-0 shadow-lg transition-all duration-200 group-hover:visible group-hover:opacity-100 group-has-[.is-open]:hidden rtl:left-1/2 rtl:-translate-x-1/2 before:absolute before:bottom-full before:left-1/2 before:-translate-x-1/2 before:border-x-[5px] before:border-b-[5px] before:border-t-0 before:border-solid before:border-x-transparent before:border-b-[#2c2c2c] after:absolute after:bottom-full after:left-1/2 after:-translate-x-1/2 after:translate-y-[1px] after:border-x-[4px] after:border-b-[4px] after:border-t-0 after:border-solid after:border-x-transparent after:border-b-[#1e1e1e]", h = () => /* @__PURE__ */ I("svg", {
1111
+ className: "h-2 w-2 fill-current text-[#666]",
1112
+ viewBox: "0 0 10 6",
1113
+ xmlns: "http://www.w3.org/2000/svg",
1114
+ children: /* @__PURE__ */ I("path", { d: "M0 0l5 6 5-6H0z" })
1115
+ });
1116
+ return /* @__PURE__ */ I("div", {
1117
+ className: "forge-toolbar-group forge-toolbar-color flex items-center gap-1",
1118
+ children: [/* @__PURE__ */ I("div", {
1119
+ className: "forge-color-item relative flex items-center",
1120
+ children: [/* @__PURE__ */ I("div", {
1121
+ className: "forge-color-button-group flex h-[30px] items-center overflow-visible rounded border border-[#ccc] bg-white hover:border-[#aaa] hover:bg-[#f9f9f9]",
1122
+ children: [/* @__PURE__ */ I("button", {
1123
+ type: "button",
1124
+ className: "forge-color-main group relative flex h-full items-center justify-center min-w-[28px] cursor-pointer border-none bg-transparent p-0 hover:bg-black/5",
1125
+ onMouseDown: (e) => e.preventDefault(),
1126
+ onClick: () => n("foreColor"),
1127
+ "aria-label": "Apply text color",
1128
+ children: [/* @__PURE__ */ I("span", {
1129
+ className: "forge-recent-color flex h-5 w-5 items-center justify-center rounded-[2px] border border-[#ccc] text-xs font-bold",
1130
+ style: {
1131
+ backgroundColor: "transparent",
1132
+ color: i
1133
+ },
1134
+ children: "A"
1135
+ }), /* @__PURE__ */ I("span", {
1136
+ className: m,
1137
+ "data-i18n": "recentColor",
1138
+ children: "Recent Color"
1139
+ })]
1140
+ }), /* @__PURE__ */ I("button", {
1141
+ ref: o,
1142
+ type: "button",
1143
+ className: "forge-color-dropdown-btn group relative flex h-full items-center justify-center min-w-[18px] cursor-pointer border-l border-[#ccc] bg-transparent px-1 hover:bg-black/5",
1144
+ onMouseDown: (e) => e.preventDefault(),
1145
+ "aria-label": "More text colors",
1146
+ children: [/* @__PURE__ */ I(h, {}), /* @__PURE__ */ I("span", {
1147
+ className: m,
1148
+ "data-i18n": "moreColor",
1149
+ children: "More Color"
1150
+ })]
1151
+ })]
1152
+ }), /* @__PURE__ */ I("div", {
1153
+ ref: s,
1154
+ className: "forge-toolbar-dropdown forge-dropdown-color absolute left-0 top-full z-20 hidden mt-1 max-h-[220px] min-w-[180px] overflow-y-auto rounded border border-[#ccc] bg-white p-2 shadow-md rtl:left-auto rtl:right-0 [&.is-open]:block",
1155
+ children: /* @__PURE__ */ I("div", {
1156
+ className: "forge-color-section",
1157
+ children: [/* @__PURE__ */ I("div", {
1158
+ className: "forge-color-section-header mb-1.5 flex items-center justify-between",
1159
+ children: [/* @__PURE__ */ I("span", {
1160
+ className: "forge-color-title text-xs font-bold text-[#333]",
1161
+ children: "Text Color"
1162
+ }), /* @__PURE__ */ I("button", {
1163
+ type: "button",
1164
+ className: "forge-color-reset cursor-pointer rounded border border-[#ccc] bg-[#f5f5f5] px-2 py-0.5 text-[11px] font-medium text-[#333] hover:border-[#999] hover:bg-[#e6e6e6]",
1165
+ onMouseDown: (e) => e.preventDefault(),
1166
+ onClick: f,
1167
+ children: "Reset"
1168
+ })]
1169
+ }), /* @__PURE__ */ I(rt, {
1170
+ event: "foreColor",
1171
+ onApply: u
1172
+ })]
1173
+ })
1174
+ })]
1175
+ }), /* @__PURE__ */ I("div", {
1176
+ className: "forge-color-item relative flex items-center",
1177
+ children: [/* @__PURE__ */ I("div", {
1178
+ className: "forge-color-button-group flex h-[30px] items-center overflow-visible rounded border border-[#ccc] bg-white hover:border-[#aaa] hover:bg-[#f9f9f9]",
1179
+ children: [/* @__PURE__ */ I("button", {
1180
+ type: "button",
1181
+ className: "forge-color-main group relative flex h-full items-center justify-center min-w-[28px] cursor-pointer border-none bg-transparent p-0 hover:bg-black/5",
1182
+ onMouseDown: (e) => e.preventDefault(),
1183
+ onClick: () => n("backColor"),
1184
+ "aria-label": "Apply background color",
1185
+ children: [/* @__PURE__ */ I("span", {
1186
+ className: "forge-recent-color flex h-5 w-5 items-center justify-center rounded-[2px] border border-[#ccc] text-xs font-bold",
1187
+ style: {
1188
+ backgroundColor: a || "#FFFFFF",
1189
+ color: "#000"
1190
+ },
1191
+ children: "A"
1192
+ }), /* @__PURE__ */ I("span", {
1193
+ className: m,
1194
+ "data-i18n": "recentBackColor",
1195
+ children: "Recent Background Color"
1196
+ })]
1197
+ }), /* @__PURE__ */ I("button", {
1198
+ ref: c,
1199
+ type: "button",
1200
+ className: "forge-color-dropdown-btn group relative flex h-full items-center justify-center min-w-[18px] cursor-pointer border-l border-[#ccc] bg-transparent px-1 hover:bg-black/5",
1201
+ onMouseDown: (e) => e.preventDefault(),
1202
+ "aria-label": "More background colors",
1203
+ children: [/* @__PURE__ */ I(h, {}), /* @__PURE__ */ I("span", {
1204
+ className: m,
1205
+ "data-i18n": "moreBackColor",
1206
+ children: "More Background Colors"
1207
+ })]
1208
+ })]
1209
+ }), /* @__PURE__ */ I("div", {
1210
+ ref: l,
1211
+ className: "forge-toolbar-dropdown forge-dropdown-color absolute left-0 top-full z-20 hidden mt-1 max-h-[220px] min-w-[180px] overflow-y-auto rounded border border-[#ccc] bg-white p-2 shadow-md rtl:left-auto rtl:right-0 [&.is-open]:block",
1212
+ children: /* @__PURE__ */ I("div", {
1213
+ className: "forge-color-section",
1214
+ children: [/* @__PURE__ */ I("div", {
1215
+ className: "forge-color-section-header mb-1.5 flex items-center justify-between",
1216
+ children: [/* @__PURE__ */ I("span", {
1217
+ className: "forge-color-title text-xs font-bold text-[#333]",
1218
+ children: "Background Color"
1219
+ }), /* @__PURE__ */ I("button", {
1220
+ type: "button",
1221
+ className: "forge-color-reset cursor-pointer rounded border border-[#ccc] bg-[#f5f5f5] px-2 py-0.5 text-[11px] font-medium text-[#333] hover:border-[#999] hover:bg-[#e6e6e6]",
1222
+ onMouseDown: (e) => e.preventDefault(),
1223
+ onClick: p,
1224
+ children: "White"
1225
+ })]
1226
+ }), /* @__PURE__ */ I(rt, {
1227
+ event: "backColor",
1228
+ onApply: d
1229
+ })]
1230
+ })
1231
+ })]
1232
+ })]
1233
+ });
1234
+ }
1235
+ //#endregion
1236
+ //#region src/components/shared/toolbar/Color/Hooks/colorUtils.jsx
1237
+ function at(e) {
1238
+ let t = document.createElement("span");
1239
+ t.style.color = e, document.body.appendChild(t);
1240
+ let n = window.getComputedStyle(t).color;
1241
+ return document.body.removeChild(t), n;
1242
+ }
1243
+ function ot(e, t) {
1244
+ let n = e;
1245
+ for (; n && n !== document.body;) {
1246
+ if (n.nodeType === Node.ELEMENT_NODE && n.tagName === "SPAN" && n.style.color && at(n.style.color) === t) return n;
1247
+ n = n.parentElement;
1248
+ }
1249
+ return null;
1250
+ }
1251
+ //#endregion
1252
+ //#region src/components/shared/toolbar/Color/Hooks/usePenMode.jsx
1253
+ function st(e, t) {
1254
+ W(() => {
1255
+ function n(n) {
1256
+ if (n.inputType !== "insertText" || !n.data || !e.current) return;
1257
+ let r = n.target;
1258
+ if (!r || !r.classList || !r.classList.contains(t)) return;
1259
+ let i = window.getSelection();
1260
+ if (!i || !i.rangeCount) return;
1261
+ let a = i.getRangeAt(0);
1262
+ if (!a.collapsed) return;
1263
+ let o = at(e.current), s = a.startContainer;
1264
+ s.nodeType === Node.TEXT_NODE && (s = s.parentElement);
1265
+ let c = ot(s, o);
1266
+ if (n.preventDefault(), c) {
1267
+ let e = document.createTextNode(n.data);
1268
+ a.insertNode(e), a.setStartAfter(e), a.collapse(!0), i.removeAllRanges(), i.addRange(a);
1269
+ return;
1270
+ }
1271
+ let l = document.createElement("span");
1272
+ l.style.color = e.current, l.textContent = n.data, a.deleteContents(), a.insertNode(l);
1273
+ let u = document.createRange();
1274
+ u.selectNodeContents(l), u.collapse(!1), i.removeAllRanges(), i.addRange(u);
1275
+ }
1276
+ return document.addEventListener("beforeinput", n, !0), () => document.removeEventListener("beforeinput", n, !0);
1277
+ }, []);
1278
+ }
1279
+ //#endregion
1280
+ //#region src/components/shared/toolbar/Color/Hooks/foreColorHandler.jsx
1281
+ var ct = (e, t, n) => {
1282
+ let r = n || "#000000";
1283
+ if (!e) return;
1284
+ if (!e.collapsed) {
1285
+ let n = e.extractContents(), i = document.createElement("span");
1286
+ i.style.color = r, i.appendChild(n), e.insertNode(i);
1287
+ let a = document.createRange();
1288
+ a.selectNodeContents(i), t.removeAllRanges(), t.addRange(a);
1289
+ return;
1290
+ }
1291
+ let i = document.createElement("span");
1292
+ i.style.color = r, i.appendChild(document.createTextNode("​")), e.insertNode(i);
1293
+ let a = document.createRange();
1294
+ a.setStart(i.firstChild, 1), a.collapse(!0), t.removeAllRanges(), t.addRange(a);
1295
+ };
1296
+ //#endregion
1297
+ //#region src/components/shared/toolbar/Color/Hooks/useForeColor.jsx
1298
+ function lt(e = "forge-editor__content") {
1299
+ let [t, n] = U("#000000"), r = G(null);
1300
+ st(r, e);
1301
+ let i = (e) => {
1302
+ let t = e || "#000000", i = window.getSelection();
1303
+ i && i.rangeCount > 0 && ct(i.getRangeAt(0), i, t), r.current = t, n(t);
1304
+ };
1305
+ return {
1306
+ recentForeColor: t,
1307
+ applyForeColor: i,
1308
+ applyRecentForeColor: () => {
1309
+ i(t);
1310
+ },
1311
+ resetForeColor: () => {
1312
+ i("#000000"), r.current = null;
1313
+ }
1314
+ };
1315
+ }
1316
+ //#endregion
1317
+ //#region src/components/shared/toolbar/Color/Hooks/usePenModeBack.jsx
1318
+ function ut(e, t) {
1319
+ W(() => {
1320
+ let n = (n) => {
1321
+ if (!e.current || n.inputType !== "insertText" || !n.data) return;
1322
+ let r = window.getSelection();
1323
+ if (!r || !r.rangeCount) return;
1324
+ let i = r.getRangeAt(0);
1325
+ if (!(i.startContainer.nodeType === 1 ? i.startContainer.closest(`.${t}`) : i.startContainer.parentElement?.closest(`.${t}`))) return;
1326
+ n.preventDefault();
1327
+ let a = document.createElement("span");
1328
+ a.style.backgroundColor = e.current, a.textContent = n.data, i.deleteContents(), i.insertNode(a);
1329
+ let o = document.createRange();
1330
+ o.setStartAfter(a), o.collapse(!0), r.removeAllRanges(), r.addRange(o);
1331
+ };
1332
+ return document.addEventListener("beforeinput", n, !0), () => {
1333
+ document.removeEventListener("beforeinput", n, !0);
1334
+ };
1335
+ }, [t, e]);
1336
+ }
1337
+ //#endregion
1338
+ //#region src/components/shared/toolbar/Color/Hooks/backColorHandler.jsx
1339
+ var dt = (e, t, n) => {
1340
+ let r = n || "#FFFFFF";
1341
+ if (!e) return;
1342
+ if (!e.collapsed) {
1343
+ let n = e.extractContents(), i = document.createElement("span");
1344
+ i.style.backgroundColor = r, i.appendChild(n), e.insertNode(i);
1345
+ let a = document.createRange();
1346
+ a.selectNodeContents(i), t.removeAllRanges(), t.addRange(a);
1347
+ return;
1348
+ }
1349
+ let i = document.createElement("span");
1350
+ i.style.backgroundColor = r, i.appendChild(document.createTextNode("​")), e.insertNode(i);
1351
+ let a = document.createRange();
1352
+ a.setStart(i.firstChild, 1), a.collapse(!0), t.removeAllRanges(), t.addRange(a);
1353
+ };
1354
+ //#endregion
1355
+ //#region src/components/shared/toolbar/Color/Hooks/useBackColor.jsx
1356
+ function ft(e = "forge-editor__content") {
1357
+ let [t, n] = U("#FFFFFF"), r = G(null);
1358
+ ut(r, e);
1359
+ let i = (e) => {
1360
+ let t = e || "#FFFFFF", i = window.getSelection();
1361
+ i && i.rangeCount > 0 && dt(i.getRangeAt(0), i, t), r.current = t, n(t);
1362
+ };
1363
+ return {
1364
+ recentBackColor: t,
1365
+ applyBackColor: i,
1366
+ applyRecentBackColor: () => {
1367
+ i(t);
1368
+ },
1369
+ resetBackColor: () => {
1370
+ i("#FFFFFF"), r.current = null;
1371
+ }
1372
+ };
1373
+ }
1374
+ //#endregion
1375
+ //#region src/components/shared/toolbar/Color/Hooks/colorLogic.jsx
1376
+ function pt() {
1377
+ let e = lt(), t = ft();
1378
+ return {
1379
+ applyColor: (n, r) => {
1380
+ n === "foreColor" ? e.applyForeColor(r) : n === "backColor" && t.applyBackColor(r);
1381
+ },
1382
+ applyRecentColor: (n) => {
1383
+ n === "foreColor" ? e.applyRecentForeColor() : n === "backColor" && t.applyRecentBackColor();
1384
+ },
1385
+ resetColor: (n) => {
1386
+ n === "foreColor" ? e.resetForeColor() : n === "backColor" && t.resetBackColor();
1387
+ },
1388
+ recentForeColor: e.recentForeColor,
1389
+ recentBackColor: t.recentBackColor
1390
+ };
1391
+ }
1392
+ //#endregion
1393
+ //#region src/components/shared/toolbar/Color/Components/index.jsx
1394
+ function mt() {
1395
+ return /* @__PURE__ */ I(it, { logic: pt() });
1396
+ }
1397
+ //#endregion
1398
+ //#region src/components/shared/toolbar/Paragraph/Components/ParagraphToolbar.jsx
1399
+ function ht({ logic: e = {} }) {
1400
+ let { saveSelectionRange: t, toggleUnorderedList: n, toggleOrderedList: r, setAlignment: i, outdent: a, indent: o } = e, [s, c] = U(!1), l = G(null);
1401
+ W(() => {
1402
+ let e = (e) => {
1403
+ l.current && !l.current.contains(e.target) && c(!1);
1404
+ };
1405
+ return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
1406
+ }, []);
1407
+ let u = (e, n, r = null) => {
1408
+ e.preventDefault(), typeof t == "function" && t(), typeof n == "function" && n(r);
1409
+ }, d = "forge-toolbar-button group relative flex h-8 items-center justify-center bg-white px-2.5 text-sm transition-all duration-150 hover:bg-[#f5f5f5] active:bg-[#e8e8e8] focus:outline-none", f = "forge-toolbar-icon inline-block h-4 w-4", p = "pointer-events-none absolute left-1/2 top-[calc(100%+8px)] z-30 -translate-x-1/2 whitespace-nowrap rounded-md border border-[#2c2c2c] bg-[#1e1e1e] px-2.5 py-1 text-[11px] font-medium leading-none text-white opacity-0 shadow-lg transition-all duration-200 group-hover:visible group-hover:opacity-100 rtl:left-1/2 rtl:-translate-x-1/2 before:absolute before:bottom-full before:left-1/2 before:-translate-x-1/2 before:border-x-[5px] before:border-b-[5px] before:border-t-0 before:border-solid before:border-x-transparent before:border-b-[#2c2c2c] after:absolute after:bottom-full after:left-1/2 after:-translate-x-1/2 after:translate-y-[1px] after:border-x-[4px] after:border-b-[4px] after:border-t-0 after:border-solid after:border-x-transparent after:border-b-[#1e1e1e]", m = "group relative flex h-7 w-7 items-center justify-center rounded hover:bg-gray-100";
1410
+ return /* @__PURE__ */ I("div", {
1411
+ ref: l,
1412
+ className: "forge-toolbar-group forge-toolbar-paragraph relative inline-flex items-center text-black",
1413
+ children: [
1414
+ /* @__PURE__ */ I("style", { children: "\n .forge-toolbar-paragraph svg * {\n vector-effect: non-scaling-stroke;\n }\n " }),
1415
+ /* @__PURE__ */ I("div", {
1416
+ className: "inline-flex rounded-md border border-[#d1d5db] bg-white shadow-sm -space-x-px",
1417
+ children: [
1418
+ /* @__PURE__ */ I("button", {
1419
+ type: "button",
1420
+ className: d,
1421
+ onMouseDown: (e) => u(e, n),
1422
+ "aria-label": "Unordered list",
1423
+ children: [/* @__PURE__ */ I("span", {
1424
+ className: f,
1425
+ children: /* @__PURE__ */ I("svg", {
1426
+ viewBox: "0 0 20 20",
1427
+ className: "block h-4 w-4",
1428
+ children: [
1429
+ /* @__PURE__ */ I("circle", {
1430
+ cx: "3",
1431
+ cy: "5",
1432
+ r: "1.5",
1433
+ fill: "black"
1434
+ }),
1435
+ /* @__PURE__ */ I("circle", {
1436
+ cx: "3",
1437
+ cy: "10",
1438
+ r: "1.5",
1439
+ fill: "black"
1440
+ }),
1441
+ /* @__PURE__ */ I("circle", {
1442
+ cx: "3",
1443
+ cy: "15",
1444
+ r: "1.5",
1445
+ fill: "black"
1446
+ }),
1447
+ /* @__PURE__ */ I("rect", {
1448
+ x: "7",
1449
+ y: "4",
1450
+ width: "11",
1451
+ height: "2",
1452
+ rx: "1",
1453
+ fill: "black"
1454
+ }),
1455
+ /* @__PURE__ */ I("rect", {
1456
+ x: "7",
1457
+ y: "9",
1458
+ width: "11",
1459
+ height: "2",
1460
+ rx: "1",
1461
+ fill: "black"
1462
+ }),
1463
+ /* @__PURE__ */ I("rect", {
1464
+ x: "7",
1465
+ y: "14",
1466
+ width: "11",
1467
+ height: "2",
1468
+ rx: "1",
1469
+ fill: "black"
1470
+ })
1471
+ ]
1472
+ })
1473
+ }), /* @__PURE__ */ I("span", {
1474
+ className: p,
1475
+ "data-i18n": "unorderedList",
1476
+ children: "Bullet list"
1477
+ })]
1478
+ }),
1479
+ /* @__PURE__ */ I("div", { className: "w-[1px] bg-[#e5e7eb] my-1" }),
1480
+ /* @__PURE__ */ I("button", {
1481
+ type: "button",
1482
+ className: d,
1483
+ onMouseDown: (e) => u(e, r),
1484
+ "aria-label": "Ordered list",
1485
+ children: [/* @__PURE__ */ I("span", {
1486
+ className: f,
1487
+ children: /* @__PURE__ */ I("svg", {
1488
+ viewBox: "0 0 20 20",
1489
+ className: "block h-4 w-4",
1490
+ children: [
1491
+ /* @__PURE__ */ I("rect", {
1492
+ x: "7",
1493
+ y: "4",
1494
+ width: "11",
1495
+ height: "2",
1496
+ rx: "1",
1497
+ fill: "black"
1498
+ }),
1499
+ /* @__PURE__ */ I("rect", {
1500
+ x: "7",
1501
+ y: "9",
1502
+ width: "11",
1503
+ height: "2",
1504
+ rx: "1",
1505
+ fill: "black"
1506
+ }),
1507
+ /* @__PURE__ */ I("rect", {
1508
+ x: "7",
1509
+ y: "14",
1510
+ width: "11",
1511
+ height: "2",
1512
+ rx: "1",
1513
+ fill: "black"
1514
+ }),
1515
+ /* @__PURE__ */ I("path", {
1516
+ d: "M 1.5 4.5 L 3.5 3 L 3.5 10 M 2 10 L 5 10",
1517
+ fill: "none",
1518
+ stroke: "black",
1519
+ strokeWidth: "1.6",
1520
+ strokeLinecap: "round",
1521
+ strokeLinejoin: "round"
1522
+ }),
1523
+ /* @__PURE__ */ I("path", {
1524
+ d: "M 1.5 14 C 1.5 12.8 4.5 12.8 4.5 14.5 C 4.5 16 1.5 16.5 1.5 18 L 5 18",
1525
+ fill: "none",
1526
+ stroke: "black",
1527
+ strokeWidth: "1.6",
1528
+ strokeLinecap: "round",
1529
+ strokeLinejoin: "round"
1530
+ })
1531
+ ]
1532
+ })
1533
+ }), /* @__PURE__ */ I("span", {
1534
+ className: p,
1535
+ "data-i18n": "orderedList",
1536
+ children: "Numbered list"
1537
+ })]
1538
+ }),
1539
+ /* @__PURE__ */ I("div", { className: "w-[1px] bg-[#e5e7eb] my-1" }),
1540
+ /* @__PURE__ */ I("button", {
1541
+ type: "button",
1542
+ className: `${d} gap-1 pr-1.5`,
1543
+ onMouseDown: (e) => {
1544
+ e.preventDefault(), typeof t == "function" && t();
1545
+ },
1546
+ onClick: () => c(!s),
1547
+ "aria-label": "Paragraph",
1548
+ children: [
1549
+ /* @__PURE__ */ I("span", {
1550
+ className: f,
1551
+ children: /* @__PURE__ */ I("svg", {
1552
+ viewBox: "0 0 20 20",
1553
+ className: "block h-4 w-4",
1554
+ children: [
1555
+ /* @__PURE__ */ I("rect", {
1556
+ x: "1",
1557
+ y: "4",
1558
+ width: "18",
1559
+ height: "2",
1560
+ rx: "1",
1561
+ fill: "black"
1562
+ }),
1563
+ /* @__PURE__ */ I("rect", {
1564
+ x: "1",
1565
+ y: "9",
1566
+ width: "18",
1567
+ height: "2",
1568
+ rx: "1",
1569
+ fill: "black"
1570
+ }),
1571
+ /* @__PURE__ */ I("rect", {
1572
+ x: "1",
1573
+ y: "14",
1574
+ width: "12",
1575
+ height: "2",
1576
+ rx: "1",
1577
+ fill: "black"
1578
+ })
1579
+ ]
1580
+ })
1581
+ }),
1582
+ /* @__PURE__ */ I("svg", {
1583
+ className: `h-2.5 w-2.5 fill-current text-gray-700 transition-transform ${s ? "rotate-180" : ""}`,
1584
+ viewBox: "0 0 20 20",
1585
+ children: /* @__PURE__ */ I("path", { d: "M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" })
1586
+ }),
1587
+ /* @__PURE__ */ I("span", {
1588
+ className: p,
1589
+ "data-i18n": "paragraph",
1590
+ children: "Paragraph options"
1591
+ })
1592
+ ]
1593
+ })
1594
+ ]
1595
+ }),
1596
+ s && /* @__PURE__ */ I("div", {
1597
+ className: "forge-toolbar-dropdown absolute left-0 top-full mt-1 z-20 min-w-[130px] rounded-md border border-[#ccc] bg-white p-1 shadow-lg rtl:left-auto rtl:right-0 block",
1598
+ role: "list",
1599
+ "aria-label": "Paragraph options",
1600
+ children: [/* @__PURE__ */ I("div", {
1601
+ className: "forge-toolbar-group forge-toolbar-align mb-0.5 flex gap-0.5 border-b border-[#eee] pb-1",
1602
+ children: [
1603
+ /* @__PURE__ */ I("button", {
1604
+ type: "button",
1605
+ className: m,
1606
+ onMouseDown: (e) => {
1607
+ u(e, i, "left"), c(!1);
1608
+ },
1609
+ "aria-label": "Align left",
1610
+ children: [/* @__PURE__ */ I("span", {
1611
+ className: f,
1612
+ children: /* @__PURE__ */ I("svg", {
1613
+ viewBox: "0 0 20 20",
1614
+ className: "block h-4 w-4",
1615
+ children: [
1616
+ /* @__PURE__ */ I("rect", {
1617
+ x: "1",
1618
+ y: "4",
1619
+ width: "18",
1620
+ height: "2",
1621
+ rx: "1",
1622
+ fill: "black"
1623
+ }),
1624
+ /* @__PURE__ */ I("rect", {
1625
+ x: "1",
1626
+ y: "9",
1627
+ width: "12",
1628
+ height: "2",
1629
+ rx: "1",
1630
+ fill: "black"
1631
+ }),
1632
+ /* @__PURE__ */ I("rect", {
1633
+ x: "1",
1634
+ y: "14",
1635
+ width: "18",
1636
+ height: "2",
1637
+ rx: "1",
1638
+ fill: "black"
1639
+ })
1640
+ ]
1641
+ })
1642
+ }), /* @__PURE__ */ I("span", {
1643
+ className: p,
1644
+ "data-i18n": "alignLeft",
1645
+ children: "Align left"
1646
+ })]
1647
+ }),
1648
+ /* @__PURE__ */ I("button", {
1649
+ type: "button",
1650
+ className: m,
1651
+ onMouseDown: (e) => {
1652
+ u(e, i, "center"), c(!1);
1653
+ },
1654
+ "aria-label": "Align center",
1655
+ children: [/* @__PURE__ */ I("span", {
1656
+ className: f,
1657
+ children: /* @__PURE__ */ I("svg", {
1658
+ viewBox: "0 0 20 20",
1659
+ className: "block h-4 w-4",
1660
+ children: [
1661
+ /* @__PURE__ */ I("rect", {
1662
+ x: "1",
1663
+ y: "4",
1664
+ width: "18",
1665
+ height: "2",
1666
+ rx: "1",
1667
+ fill: "black"
1668
+ }),
1669
+ /* @__PURE__ */ I("rect", {
1670
+ x: "4",
1671
+ y: "9",
1672
+ width: "12",
1673
+ height: "2",
1674
+ rx: "1",
1675
+ fill: "black"
1676
+ }),
1677
+ /* @__PURE__ */ I("rect", {
1678
+ x: "1",
1679
+ y: "14",
1680
+ width: "18",
1681
+ height: "2",
1682
+ rx: "1",
1683
+ fill: "black"
1684
+ })
1685
+ ]
1686
+ })
1687
+ }), /* @__PURE__ */ I("span", {
1688
+ className: p,
1689
+ "data-i18n": "alignCenter",
1690
+ children: "Align center"
1691
+ })]
1692
+ }),
1693
+ /* @__PURE__ */ I("button", {
1694
+ type: "button",
1695
+ className: m,
1696
+ onMouseDown: (e) => {
1697
+ u(e, i, "right"), c(!1);
1698
+ },
1699
+ "aria-label": "Align right",
1700
+ children: [/* @__PURE__ */ I("span", {
1701
+ className: f,
1702
+ children: /* @__PURE__ */ I("svg", {
1703
+ viewBox: "0 0 20 20",
1704
+ className: "block h-4 w-4",
1705
+ children: [
1706
+ /* @__PURE__ */ I("rect", {
1707
+ x: "1",
1708
+ y: "4",
1709
+ width: "18",
1710
+ height: "2",
1711
+ rx: "1",
1712
+ fill: "black"
1713
+ }),
1714
+ /* @__PURE__ */ I("rect", {
1715
+ x: "7",
1716
+ y: "9",
1717
+ width: "12",
1718
+ height: "2",
1719
+ rx: "1",
1720
+ fill: "black"
1721
+ }),
1722
+ /* @__PURE__ */ I("rect", {
1723
+ x: "1",
1724
+ y: "14",
1725
+ width: "18",
1726
+ height: "2",
1727
+ rx: "1",
1728
+ fill: "black"
1729
+ })
1730
+ ]
1731
+ })
1732
+ }), /* @__PURE__ */ I("span", {
1733
+ className: p,
1734
+ "data-i18n": "alignRight",
1735
+ children: "Align right"
1736
+ })]
1737
+ }),
1738
+ /* @__PURE__ */ I("button", {
1739
+ type: "button",
1740
+ className: m,
1741
+ onMouseDown: (e) => {
1742
+ u(e, i, "justify"), c(!1);
1743
+ },
1744
+ "aria-label": "Justify",
1745
+ children: [/* @__PURE__ */ I("span", {
1746
+ className: f,
1747
+ children: /* @__PURE__ */ I("svg", {
1748
+ viewBox: "0 0 20 20",
1749
+ className: "block h-4 w-4",
1750
+ children: [
1751
+ /* @__PURE__ */ I("rect", {
1752
+ x: "1",
1753
+ y: "4",
1754
+ width: "18",
1755
+ height: "2",
1756
+ rx: "1",
1757
+ fill: "black"
1758
+ }),
1759
+ /* @__PURE__ */ I("rect", {
1760
+ x: "1",
1761
+ y: "9",
1762
+ width: "18",
1763
+ height: "2",
1764
+ rx: "1",
1765
+ fill: "black"
1766
+ }),
1767
+ /* @__PURE__ */ I("rect", {
1768
+ x: "1",
1769
+ y: "14",
1770
+ width: "18",
1771
+ height: "2",
1772
+ rx: "1",
1773
+ fill: "black"
1774
+ })
1775
+ ]
1776
+ })
1777
+ }), /* @__PURE__ */ I("span", {
1778
+ className: p,
1779
+ "data-i18n": "justify",
1780
+ children: "Justify"
1781
+ })]
1782
+ })
1783
+ ]
1784
+ }), /* @__PURE__ */ I("div", {
1785
+ className: "forge-toolbar-group forge-toolbar-list flex gap-0.5 py-0.5",
1786
+ children: [/* @__PURE__ */ I("button", {
1787
+ type: "button",
1788
+ className: m,
1789
+ onMouseDown: (e) => {
1790
+ u(e, a), c(!1);
1791
+ },
1792
+ "aria-label": "Outdent",
1793
+ children: [/* @__PURE__ */ I("span", {
1794
+ className: f,
1795
+ children: /* @__PURE__ */ I("svg", {
1796
+ viewBox: "0 0 20 20",
1797
+ className: "block h-4 w-4",
1798
+ fill: "none",
1799
+ stroke: "black",
1800
+ strokeWidth: "2",
1801
+ strokeLinecap: "round",
1802
+ strokeLinejoin: "round",
1803
+ children: [
1804
+ /* @__PURE__ */ I("line", {
1805
+ x1: "9",
1806
+ y1: "4",
1807
+ x2: "19",
1808
+ y2: "4"
1809
+ }),
1810
+ /* @__PURE__ */ I("line", {
1811
+ x1: "9",
1812
+ y1: "10",
1813
+ x2: "19",
1814
+ y2: "10"
1815
+ }),
1816
+ /* @__PURE__ */ I("line", {
1817
+ x1: "9",
1818
+ y1: "16",
1819
+ x2: "19",
1820
+ y2: "16"
1821
+ }),
1822
+ /* @__PURE__ */ I("polyline", { points: "6,8 2,12 6,16" })
1823
+ ]
1824
+ })
1825
+ }), /* @__PURE__ */ I("span", {
1826
+ className: p,
1827
+ "data-i18n": "outdent",
1828
+ children: "Outdent"
1829
+ })]
1830
+ }), /* @__PURE__ */ I("button", {
1831
+ type: "button",
1832
+ className: m,
1833
+ onMouseDown: (e) => {
1834
+ u(e, o), c(!1);
1835
+ },
1836
+ "aria-label": "Indent",
1837
+ children: [/* @__PURE__ */ I("span", {
1838
+ className: f,
1839
+ children: /* @__PURE__ */ I("svg", {
1840
+ viewBox: "0 0 20 20",
1841
+ className: "block h-4 w-4",
1842
+ fill: "none",
1843
+ stroke: "black",
1844
+ strokeWidth: "2",
1845
+ strokeLinecap: "round",
1846
+ strokeLinejoin: "round",
1847
+ children: [
1848
+ /* @__PURE__ */ I("line", {
1849
+ x1: "9",
1850
+ y1: "4",
1851
+ x2: "19",
1852
+ y2: "4"
1853
+ }),
1854
+ /* @__PURE__ */ I("line", {
1855
+ x1: "9",
1856
+ y1: "10",
1857
+ x2: "19",
1858
+ y2: "10"
1859
+ }),
1860
+ /* @__PURE__ */ I("line", {
1861
+ x1: "9",
1862
+ y1: "16",
1863
+ x2: "19",
1864
+ y2: "16"
1865
+ }),
1866
+ /* @__PURE__ */ I("polyline", { points: "2,8 6,12 2,16" })
1867
+ ]
1868
+ })
1869
+ }), /* @__PURE__ */ I("span", {
1870
+ className: p,
1871
+ "data-i18n": "indent",
1872
+ children: "Indent"
1873
+ })]
1874
+ })]
1875
+ })]
1876
+ })
1877
+ ]
1878
+ });
1879
+ }
1880
+ //#endregion
1881
+ //#region src/components/shared/toolbar/Paragraph/Hooks/paragraphLogic.jsx
1882
+ function gt() {
1883
+ let e = window.getSelection();
1884
+ return e && e.rangeCount > 0 ? e.getRangeAt(0).cloneRange() : null;
1885
+ }
1886
+ function _t(e) {
1887
+ if (!e) return;
1888
+ let t = window.getSelection();
1889
+ t && (t.removeAllRanges(), t.addRange(e));
1890
+ }
1891
+ function Y(e) {
1892
+ if (!e) return;
1893
+ e.lastChild && e.lastChild.nodeName === "BR" && e.childNodes.length > 1 && e.removeChild(e.lastChild);
1894
+ let t = e;
1895
+ for (; t.lastChild && t.lastChild.nodeName !== "BR";) t = t.lastChild;
1896
+ let n = document.createRange();
1897
+ t.nodeType === 3 ? (n.setStart(t, t.textContent.length), n.collapse(!0)) : t.lastChild && t.lastChild.nodeName === "BR" ? (n.setStart(t, t.childNodes.length - 1), n.collapse(!0)) : (n.selectNodeContents(t), n.collapse(!1));
1898
+ let r = window.getSelection();
1899
+ r && (r.removeAllRanges(), r.addRange(n));
1900
+ }
1901
+ function vt(e) {
1902
+ if (!e || e.nodeType !== 1) return !1;
1903
+ let t = e.tagName.toLowerCase();
1904
+ return [
1905
+ "p",
1906
+ "div",
1907
+ "h1",
1908
+ "h2",
1909
+ "h3",
1910
+ "h4",
1911
+ "h5",
1912
+ "h6",
1913
+ "li",
1914
+ "blockquote",
1915
+ "pre"
1916
+ ].includes(t);
1917
+ }
1918
+ function yt(e) {
1919
+ if (!e) return null;
1920
+ let t = e.nodeType === 3 ? e.parentNode : e;
1921
+ for (; t && t !== document.body && !vt(t);) t = t.parentNode;
1922
+ return t && vt(t) ? t : null;
1923
+ }
1924
+ function bt(e) {
1925
+ if (!e) return null;
1926
+ let t = e.nodeType === 3 ? e.parentNode : e;
1927
+ for (; t && t !== document.body && t.tagName !== "LI";) t = t.parentNode;
1928
+ return t && t.tagName === "LI" ? t : null;
1929
+ }
1930
+ function xt(e) {
1931
+ let t = document.createElement(e);
1932
+ return t.className = e === "ul" ? "list-disc pl-5 my-2" : "list-decimal pl-5 my-2", t;
1933
+ }
1934
+ function St(e, t) {
1935
+ let n = xt(t), r = document.createElement("li");
1936
+ return r.innerHTML = e.innerHTML, n.appendChild(r), e.parentNode.replaceChild(n, e), r;
1937
+ }
1938
+ function Ct(e) {
1939
+ let t = e.parentNode, n = document.createDocumentFragment(), r = Array.from(e.children), i = null;
1940
+ return r.forEach((e) => {
1941
+ let t = document.createElement("div");
1942
+ t.innerHTML = e.innerHTML, n.appendChild(t), i = t;
1943
+ }), t.replaceChild(n, e), i;
1944
+ }
1945
+ function wt(e, t) {
1946
+ let n = xt(t);
1947
+ return n.innerHTML = e.innerHTML, e.parentNode.replaceChild(n, e), n;
1948
+ }
1949
+ function Tt() {
1950
+ let e = G(null), t = () => {
1951
+ e.current = gt();
1952
+ }, n = (t) => {
1953
+ _t(e.current);
1954
+ let n = window.getSelection();
1955
+ if (!n || !n.rangeCount) return;
1956
+ let r = n.anchorNode;
1957
+ if (!r) return;
1958
+ r.nodeType === 3 && (r = r.parentNode);
1959
+ let i = bt(r);
1960
+ if (i) {
1961
+ let n = i.parentNode;
1962
+ if (n && (n.tagName === "UL" || n.tagName === "OL")) {
1963
+ if (n.tagName.toLowerCase() === t) {
1964
+ let e = Ct(n);
1965
+ e && Y(e);
1966
+ } else {
1967
+ let e = wt(n, t).lastElementChild;
1968
+ e && Y(e);
1969
+ }
1970
+ e.current = gt();
1971
+ return;
1972
+ }
1973
+ }
1974
+ let a = yt(r);
1975
+ if (a) {
1976
+ if (a.getAttribute && a.getAttribute("contenteditable") === "true") {
1977
+ let e = document.createElement("div");
1978
+ e.innerHTML = a.innerHTML, a.innerHTML = "", a.appendChild(e), Y(St(e, t));
1979
+ } else Y(St(a, t));
1980
+ e.current = gt();
1981
+ }
1982
+ };
1983
+ return {
1984
+ saveSelectionRange: t,
1985
+ toggleUnorderedList: () => n("ul"),
1986
+ toggleOrderedList: () => n("ol"),
1987
+ setAlignment: (t) => {
1988
+ _t(e.current);
1989
+ let n = window.getSelection();
1990
+ if (!n || !n.rangeCount) return;
1991
+ let r = n.anchorNode;
1992
+ if (!r) return;
1993
+ r.nodeType === 3 && (r = r.parentNode);
1994
+ let i = r.closest("p, div, h1, h2, h3, h4, h5, h6, li, blockquote, pre");
1995
+ i && (i.style.textAlign = t), e.current = gt();
1996
+ },
1997
+ indent: () => {
1998
+ _t(e.current);
1999
+ let t = window.getSelection();
2000
+ if (!t || !t.rangeCount) return;
2001
+ let n = t.anchorNode;
2002
+ if (!n) return;
2003
+ n.nodeType === 3 && (n = n.parentNode);
2004
+ let r = bt(n);
2005
+ if (r) {
2006
+ let e = r.parentNode;
2007
+ if (!e || e.tagName !== "UL" && e.tagName !== "OL") return;
2008
+ let t = r.previousElementSibling;
2009
+ if (!t || t.tagName !== "LI") return;
2010
+ let n = t.querySelector(":scope > ul, :scope > ol");
2011
+ n || (n = xt(e.tagName.toLowerCase()), t.appendChild(n)), n.appendChild(r), Y(r);
2012
+ } else {
2013
+ let e = yt(n);
2014
+ if (!e) return;
2015
+ let t = parseInt(e.style.marginLeft) || 0;
2016
+ e.style.marginLeft = t + 20 + "px";
2017
+ }
2018
+ e.current = gt();
2019
+ },
2020
+ outdent: () => {
2021
+ _t(e.current);
2022
+ let t = window.getSelection();
2023
+ if (!t || !t.rangeCount) return;
2024
+ let n = t.anchorNode;
2025
+ if (!n) return;
2026
+ n.nodeType === 3 && (n = n.parentNode);
2027
+ let r = bt(n);
2028
+ if (r) {
2029
+ let e = r.parentNode;
2030
+ if (!e || e.tagName !== "UL" && e.tagName !== "OL") return;
2031
+ let t = e.parentNode;
2032
+ if (t && t.tagName === "LI") t.parentNode.insertBefore(r, t.nextSibling), e.children.length === 0 && e.remove(), Y(r);
2033
+ else {
2034
+ let t = document.createElement("div");
2035
+ t.innerHTML = r.innerHTML;
2036
+ let n = e.parentNode;
2037
+ e.children.length === 1 ? n.replaceChild(t, e) : (n.insertBefore(t, e.nextSibling), e.removeChild(r)), Y(t);
2038
+ }
2039
+ } else {
2040
+ let e = yt(n);
2041
+ if (!e) return;
2042
+ let t = parseInt(e.style.marginLeft) || 0;
2043
+ e.style.marginLeft = Math.max(0, t - 20) + "px";
2044
+ }
2045
+ e.current = gt();
2046
+ }
2047
+ };
2048
+ }
2049
+ //#endregion
2050
+ //#region src/components/shared/toolbar/Paragraph/Components/index.jsx
2051
+ function Et() {
2052
+ return /* @__PURE__ */ I(ht, { logic: Tt() });
2053
+ }
2054
+ //#endregion
2055
+ //#region src/components/shared/toolbar/Table/Components/TableToolbar.jsx
2056
+ var Dt = 10;
2057
+ function Ot({ logic: e }) {
2058
+ let { insertTable: t } = e, [n, r] = U(1), [i, a] = U(1), [o, s] = U(!1), c = G(null), l = G(null), u = G(null);
2059
+ W(() => {
2060
+ if (!o) return;
2061
+ function e(e) {
2062
+ l.current && !l.current.contains(e.target) && c.current && !c.current.contains(e.target) && s(!1);
2063
+ }
2064
+ return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
2065
+ }, [o]);
2066
+ let d = (e) => {
2067
+ if (!u.current) return;
2068
+ let t = u.current.getBoundingClientRect(), n = e.clientX - t.left, i = e.clientY - t.top, o = t.width / Dt, s = Math.min(Math.floor(n / o) + 1, Dt), c = Math.min(Math.floor(i / o) + 1, Dt);
2069
+ a(s), r(c);
2070
+ }, f = () => {
2071
+ r(1), a(1);
2072
+ }, p = () => {
2073
+ t(n, i), s(!1), r(1), a(1);
2074
+ }, m = i / Dt * 100, h = n / Dt * 100;
2075
+ return /* @__PURE__ */ I("div", {
2076
+ className: "forge-toolbar-group forge-toolbar-table relative flex items-center gap-0.5",
2077
+ children: [/* @__PURE__ */ I("button", {
2078
+ ref: c,
2079
+ type: "button",
2080
+ className: "forge-toolbar-button group relative flex h-8 cursor-pointer items-center justify-center rounded-[2px] border border-[#ccc] bg-white px-2 text-sm leading-none transition-all duration-150 hover:bg-[#f0f0f0] active:translate-y-px",
2081
+ "aria-label": "Table",
2082
+ onClick: () => s(!o),
2083
+ children: [/* @__PURE__ */ I("span", {
2084
+ className: "forge-toolbar-icon",
2085
+ children: "▦"
2086
+ }), /* @__PURE__ */ I("span", {
2087
+ className: "pointer-events-none absolute left-1/2 top-[calc(100%+8px)] z-30 -translate-x-1/2 whitespace-nowrap rounded-md border border-[#2c2c2c] bg-[#1e1e1e] px-2.5 py-1 text-[11px] font-medium leading-none text-white opacity-0 shadow-lg transition-all duration-200 group-hover:visible group-hover:opacity-100 rtl:left-1/2 rtl:-translate-x-1/2 before:absolute before:bottom-full before:left-1/2 before:-translate-x-1/2 before:border-x-[5px] before:border-b-[5px] before:border-t-0 before:border-solid before:border-x-transparent before:border-b-[#2c2c2c] after:absolute after:bottom-full after:left-1/2 after:-translate-x-1/2 after:translate-y-[1px] after:border-x-[4px] after:border-b-[4px] after:border-t-0 after:border-solid after:border-x-transparent after:border-b-[#1e1e1e]",
2088
+ "data-i18n": "table",
2089
+ children: "Table"
2090
+ })]
2091
+ }), /* @__PURE__ */ I("div", {
2092
+ ref: l,
2093
+ className: `forge-toolbar-dropdown forge-dropdown-table absolute left-0 top-full z-10 mt-1 min-w-[160px] rounded-[3px] border border-[#ccc] bg-white p-2 shadow-[0_2px_6px_rgba(0,0,0,0.15)] rtl:left-auto rtl:right-0 ${o ? "block" : "hidden"}`,
2094
+ role: "list",
2095
+ "aria-label": "Insert table",
2096
+ children: [/* @__PURE__ */ I("div", {
2097
+ ref: u,
2098
+ className: "note-dimension-picker relative mx-auto h-40 w-40 cursor-pointer overflow-hidden rounded-[3px] border border-[#ccc] bg-[#f5f5f5]",
2099
+ onMouseMove: d,
2100
+ onMouseLeave: f,
2101
+ onClick: p,
2102
+ children: [
2103
+ /* @__PURE__ */ I("div", { className: "absolute inset-0 z-[5]" }),
2104
+ /* @__PURE__ */ I("div", {
2105
+ className: "pointer-events-none absolute left-0 top-0 z-[3] border-2 border-[#4a90d9] bg-[rgba(74,144,217,0.4)] transition-[width,height] duration-75 ease-in-out",
2106
+ style: {
2107
+ width: m + "%",
2108
+ height: h + "%"
2109
+ }
2110
+ }),
2111
+ /* @__PURE__ */ I("div", { className: "pointer-events-none absolute inset-0 z-[2] bg-white/30" }),
2112
+ /* @__PURE__ */ I("div", { className: "pointer-events-none absolute inset-0 z-[1] bg-[linear-gradient(rgba(0,0,0,0.05)_1px,transparent_1px),linear-gradient(90deg,rgba(0,0,0,0.05)_1px,transparent_1px)] bg-[size:16px_16px]" })
2113
+ ]
2114
+ }), /* @__PURE__ */ I("div", {
2115
+ className: "note-dimension-display px-0 pt-1.5 pb-0.5 text-center text-[13px] font-semibold text-[#333]",
2116
+ children: [
2117
+ n,
2118
+ " x ",
2119
+ i
2120
+ ]
2121
+ })]
2122
+ })]
2123
+ });
2124
+ }
2125
+ //#endregion
2126
+ //#region src/components/shared/toolbar/Table/Hooks/tableLogic.jsx
2127
+ function kt() {
2128
+ let e = document.querySelector(".forge-editor__content");
2129
+ if (e) {
2130
+ e.focus();
2131
+ let t = document.createRange(), n = window.getSelection();
2132
+ if (n) {
2133
+ let r = e.lastChild;
2134
+ r ? (t.setStartAfter(r), t.collapse(!0)) : (t.selectNodeContents(e), t.collapse(!1)), n.removeAllRanges(), n.addRange(t);
2135
+ }
2136
+ }
2137
+ }
2138
+ function At(e) {
2139
+ let t = window.getSelection();
2140
+ if (!t || !t.rangeCount) {
2141
+ kt(), setTimeout(() => At(e), 50);
2142
+ return;
2143
+ }
2144
+ let n = t.getRangeAt(0);
2145
+ n.deleteContents();
2146
+ let r = n.createContextualFragment(e), i = r.lastChild;
2147
+ n.insertNode(r), i ? (n.setStartAfter(i), n.collapse(!0)) : n.collapse(!1), t.removeAllRanges(), t.addRange(n);
2148
+ }
2149
+ function jt() {
2150
+ return { insertTable: (e, t) => {
2151
+ let n = (100 / t).toFixed(2) + "%", r = "<table style=\"width:100%;table-layout:fixed;border-collapse:collapse;border:1px solid #ddd;\">";
2152
+ for (let i = 0; i < e; i++) {
2153
+ r += "<tr>";
2154
+ for (let e = 0; e < t; e++) r += `<td style="border:1px solid #ddd;padding:8px;width:${n};text-align:center;vertical-align:middle;overflow:hidden;word-break:break-word;"><br></td>`;
2155
+ r += "</tr>";
2156
+ }
2157
+ r += "</table><br>", kt(), At(r);
2158
+ } };
2159
+ }
2160
+ //#endregion
2161
+ //#region src/components/shared/toolbar/Table/Components/index.jsx
2162
+ function Mt() {
2163
+ return /* @__PURE__ */ I(Ot, { logic: jt() });
2164
+ }
2165
+ //#endregion
2166
+ //#region src/components/shared/toolbar/Insert/Components/InsertToolbar.jsx
2167
+ function Nt({ logic: e }) {
2168
+ let { insertLink: t, insertImage: n, insertVideo: r } = e, i = "forge-toolbar-button group relative flex h-8 cursor-pointer items-center justify-center gap-0.5 rounded-[2px] border border-[#ccc] bg-white px-[7px] py-1 text-sm leading-none transition-all duration-150 hover:bg-[#f0f0f0] active:translate-y-px", a = "forge-toolbar-icon inline-block min-w-4 text-center text-sm font-medium leading-none", o = "pointer-events-none absolute left-1/2 top-[calc(100%+8px)] z-30 -translate-x-1/2 whitespace-nowrap rounded-md border border-[#2c2c2c] bg-[#1e1e1e] px-2.5 py-1 text-[11px] font-medium leading-none text-white opacity-0 shadow-lg transition-all duration-200 group-hover:visible group-hover:opacity-100 rtl:left-1/2 rtl:-translate-x-1/2 before:absolute before:bottom-full before:left-1/2 before:-translate-x-1/2 before:border-x-[5px] before:border-b-[5px] before:border-t-0 before:border-solid before:border-x-transparent before:border-b-[#2c2c2c] after:absolute after:bottom-full after:left-1/2 after:-translate-x-1/2 after:translate-y-[1px] after:border-x-[4px] after:border-b-[4px] after:border-t-0 after:border-solid after:border-x-transparent after:border-b-[#1e1e1e]";
2169
+ return /* @__PURE__ */ I("div", {
2170
+ className: "forge-toolbar-group forge-toolbar-insert flex items-center gap-0.5",
2171
+ children: [
2172
+ /* @__PURE__ */ I("button", {
2173
+ type: "button",
2174
+ className: i,
2175
+ onClick: t,
2176
+ "aria-label": "Link",
2177
+ children: [/* @__PURE__ */ I("span", {
2178
+ className: a,
2179
+ children: "🔗"
2180
+ }), /* @__PURE__ */ I("span", {
2181
+ className: o,
2182
+ "data-i18n": "link",
2183
+ children: "Link"
2184
+ })]
2185
+ }),
2186
+ /* @__PURE__ */ I("button", {
2187
+ type: "button",
2188
+ className: i,
2189
+ onClick: n,
2190
+ "aria-label": "Image",
2191
+ children: [/* @__PURE__ */ I("span", {
2192
+ className: a,
2193
+ children: "🖼"
2194
+ }), /* @__PURE__ */ I("span", {
2195
+ className: o,
2196
+ "data-i18n": "image",
2197
+ children: "Image"
2198
+ })]
2199
+ }),
2200
+ /* @__PURE__ */ I("button", {
2201
+ type: "button",
2202
+ className: i,
2203
+ onClick: r,
2204
+ "aria-label": "Video",
2205
+ children: [/* @__PURE__ */ I("span", {
2206
+ className: a,
2207
+ children: "▶"
2208
+ }), /* @__PURE__ */ I("span", {
2209
+ className: o,
2210
+ "data-i18n": "video",
2211
+ children: "Video"
2212
+ })]
2213
+ })
2214
+ ]
2215
+ });
2216
+ }
2217
+ //#endregion
2218
+ //#region src/components/shared/Hooks/sweetAlert.jsx
2219
+ var Pt = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
2220
+ (function(n, r) {
2221
+ typeof e == "object" && t !== void 0 ? t.exports = r() : typeof define == "function" && define.amd ? define(r) : (n = typeof globalThis < "u" ? globalThis : n || self, n.Sweetalert2 = r());
2222
+ })(e, (function() {
2223
+ function e(e, t, n) {
2224
+ if (typeof e == "function" ? e === t : e.has(t)) return arguments.length < 3 ? t : n;
2225
+ throw TypeError("Private element is not present on this object");
2226
+ }
2227
+ function t(e, t) {
2228
+ if (t.has(e)) throw TypeError("Cannot initialize the same private elements twice on an object");
2229
+ }
2230
+ function n(t, n) {
2231
+ return t.get(e(t, n));
2232
+ }
2233
+ function r(e, n, r) {
2234
+ t(e, n), n.set(e, r);
2235
+ }
2236
+ function i(t, n, r) {
2237
+ return t.set(e(t, n), r), r;
2238
+ }
2239
+ let a = {}, o = () => {
2240
+ a.previousActiveElement instanceof HTMLElement ? (a.previousActiveElement.focus(), a.previousActiveElement = null) : document.body && document.body.focus();
2241
+ }, s = (e) => new Promise((t) => {
2242
+ if (!e) return t();
2243
+ let n = window.scrollX, r = window.scrollY;
2244
+ a.restoreFocusTimeout = setTimeout(() => {
2245
+ o(), t();
2246
+ }, 100), window.scrollTo(n, r);
2247
+ }), c = "swal2-", l = (/* @__PURE__ */ "container.shown.height-auto.iosfix.popup.modal.no-backdrop.no-transition.toast.toast-shown.show.hide.close.title.html-container.actions.confirm.deny.cancel.footer.icon.icon-content.image.input.file.range.select.radio.checkbox.label.textarea.inputerror.input-label.validation-message.progress-steps.active-progress-step.progress-step.progress-step-line.loader.loading.styled.top.top-start.top-end.top-left.top-right.center.center-start.center-end.center-left.center-right.bottom.bottom-start.bottom-end.bottom-left.bottom-right.grow-row.grow-column.grow-fullscreen.rtl.timer-progress-bar.timer-progress-bar-container.scrollbar-measure.icon-success.icon-warning.icon-info.icon-question.icon-error.draggable.dragging".split(".")).reduce((e, t) => (e[t] = c + t, e), {}), u = [
2248
+ "success",
2249
+ "warning",
2250
+ "info",
2251
+ "question",
2252
+ "error"
2253
+ ].reduce((e, t) => (e[t] = c + t, e), {}), d = "SweetAlert2:", f = (e) => e.charAt(0).toUpperCase() + e.slice(1), p = (e) => {
2254
+ console.warn(`${d} ${typeof e == "object" ? e.join(" ") : e}`);
2255
+ }, m = (e) => {
2256
+ console.error(`${d} ${e}`);
2257
+ }, h = [], g = (e) => {
2258
+ h.includes(e) || (h.push(e), p(e));
2259
+ }, _ = (e, t = null) => {
2260
+ g(`"${e}" is deprecated and will be removed in the next major release.${t ? ` Use "${t}" instead.` : ""}`);
2261
+ }, v = (e) => typeof e == "function" ? e() : e, y = (e) => e && typeof e.toPromise == "function", b = (e) => y(e) ? e.toPromise() : Promise.resolve(e), x = (e) => e && Promise.resolve(e) === e, S = () => navigator.userAgent.includes("Firefox"), C = () => document.body.querySelector(`.${l.container}`), w = (e) => {
2262
+ let t = C();
2263
+ return t ? t.querySelector(e) : null;
2264
+ }, T = (e) => w(`.${e}`), E = () => T(l.popup), D = () => T(l.icon), ee = () => T(l["icon-content"]), te = () => T(l.title), O = () => T(l["html-container"]), ne = () => T(l.image), re = () => T(l["progress-steps"]), k = () => T(l["validation-message"]), A = () => w(`.${l.actions} .${l.confirm}`), ie = () => w(`.${l.actions} .${l.cancel}`), j = () => w(`.${l.actions} .${l.deny}`), ae = () => T(l["input-label"]), oe = () => w(`.${l.loader}`), se = () => T(l.actions), ce = () => T(l.footer), le = () => T(l["timer-progress-bar"]), ue = () => T(l.close), de = () => {
2265
+ let e = E();
2266
+ if (!e) return [];
2267
+ let t = e.querySelectorAll("[tabindex]:not([tabindex=\"-1\"]):not([tabindex=\"0\"])"), n = Array.from(t).sort((e, t) => {
2268
+ let n = parseInt(e.getAttribute("tabindex") || "0"), r = parseInt(t.getAttribute("tabindex") || "0");
2269
+ return n > r ? 1 : n < r ? -1 : 0;
2270
+ }), r = e.querySelectorAll("\n a[href],\n area[href],\n input:not([disabled]),\n select:not([disabled]),\n textarea:not([disabled]),\n button:not([disabled]),\n iframe,\n object,\n embed,\n [tabindex=\"0\"],\n [contenteditable],\n audio[controls],\n video[controls],\n summary\n"), i = Array.from(r).filter((e) => e.getAttribute("tabindex") !== "-1");
2271
+ return [...new Set(n.concat(i))].filter((e) => V(e));
2272
+ }, fe = () => N(document.body, l.shown) && !N(document.body, l["toast-shown"]) && !N(document.body, l["no-backdrop"]), pe = () => {
2273
+ let e = E();
2274
+ return e ? N(e, l.toast) : !1;
2275
+ }, me = () => {
2276
+ let e = E();
2277
+ return e ? e.hasAttribute("data-loading") : !1;
2278
+ }, M = (e, t) => {
2279
+ if (e.textContent = "", t) {
2280
+ let n = new DOMParser().parseFromString(t, "text/html"), r = n.querySelector("head");
2281
+ r && Array.from(r.childNodes).forEach((t) => {
2282
+ e.appendChild(t);
2283
+ });
2284
+ let i = n.querySelector("body");
2285
+ i && Array.from(i.childNodes).forEach((t) => {
2286
+ t instanceof HTMLVideoElement || t instanceof HTMLAudioElement ? e.appendChild(t.cloneNode(!0)) : e.appendChild(t);
2287
+ });
2288
+ }
2289
+ }, N = (e, t) => t ? t.split(/\s+/).every((t) => e.classList.contains(t)) : !1, he = (e, t) => {
2290
+ Array.from(e.classList).forEach((n) => {
2291
+ !Object.values(l).includes(n) && !Object.values(u).includes(n) && !Object.values(t.showClass || {}).includes(n) && e.classList.remove(n);
2292
+ });
2293
+ }, P = (e, t, n) => {
2294
+ if (he(e, t), !t.customClass) return;
2295
+ let r = t.customClass[n];
2296
+ if (r) {
2297
+ if (typeof r != "string" && !r.forEach) {
2298
+ p(`Invalid type of customClass.${n}! Expected string or iterable object, got "${typeof r}"`);
2299
+ return;
2300
+ }
2301
+ F(e, r);
2302
+ }
2303
+ }, ge = (e, t) => {
2304
+ if (!t) return null;
2305
+ switch (t) {
2306
+ case "select":
2307
+ case "textarea":
2308
+ case "file": return e.querySelector(`.${l.popup} > .${l[t]}`);
2309
+ case "checkbox": return e.querySelector(`.${l.popup} > .${l.checkbox} input`);
2310
+ case "radio": return e.querySelector(`.${l.popup} > .${l.radio} input:checked`) || e.querySelector(`.${l.popup} > .${l.radio} input:first-child`);
2311
+ case "range": return e.querySelector(`.${l.popup} > .${l.range} input`);
2312
+ default: return e.querySelector(`.${l.popup} > .${l.input}`);
2313
+ }
2314
+ }, _e = (e) => {
2315
+ if (e.focus(), e.type !== "file") {
2316
+ let t = e.value;
2317
+ e.value = "", e.value = t;
2318
+ }
2319
+ }, ve = (e, t, n) => {
2320
+ if (!e || !t) return;
2321
+ let r = typeof t == "string" ? t.split(/\s+/).filter(Boolean) : t;
2322
+ (Array.isArray(e) ? e : [e]).forEach((e) => {
2323
+ r.forEach((t) => {
2324
+ n ? e.classList.add(t) : e.classList.remove(t);
2325
+ });
2326
+ });
2327
+ }, F = (e, t) => {
2328
+ ve(e, t, !0);
2329
+ }, I = (e, t) => {
2330
+ ve(e, t, !1);
2331
+ }, L = (e, t) => Array.from(e.children).find((e) => e instanceof HTMLElement && N(e, t)), ye = (e, t, n) => {
2332
+ n === `${parseInt(`${n}`)}` && (n = parseInt(n)), n || n === 0 ? e.style.setProperty(t, typeof n == "number" ? `${n}px` : n) : e.style.removeProperty(t);
2333
+ }, R = (e, t = "flex") => {
2334
+ e && (e.style.display = t);
2335
+ }, z = (e) => {
2336
+ e && (e.style.display = "none");
2337
+ }, B = (e, t = "block") => {
2338
+ e && new MutationObserver(() => {
2339
+ xe(e, e.innerHTML, t);
2340
+ }).observe(e, {
2341
+ childList: !0,
2342
+ subtree: !0
2343
+ });
2344
+ }, be = (e, t, n, r) => {
2345
+ let i = e.querySelector(t);
2346
+ i && i.style.setProperty(n, r);
2347
+ }, xe = (e, t, n = "flex") => {
2348
+ t ? R(e, n) : z(e);
2349
+ }, V = (e) => !!(e && (e.offsetWidth || e.offsetHeight || e.getClientRects().length)), Se = () => !V(A()) && !V(j()) && !V(ie()), H = (e) => e.scrollHeight > e.clientHeight, Ce = (e, t) => {
2350
+ let n = e;
2351
+ for (; n && n !== t;) {
2352
+ if (H(n)) return !0;
2353
+ n = n.parentElement;
2354
+ }
2355
+ return !1;
2356
+ }, we = (e) => {
2357
+ let t = window.getComputedStyle(e), n = parseFloat(t.getPropertyValue("animation-duration") || "0"), r = parseFloat(t.getPropertyValue("transition-duration") || "0");
2358
+ return n > 0 || r > 0;
2359
+ }, Te = (e, t = !1) => {
2360
+ let n = le();
2361
+ n && V(n) && (t && (n.style.transition = "none", n.style.width = "100%"), setTimeout(() => {
2362
+ n.style.transition = `width ${e / 1e3}s linear`, n.style.width = "0%";
2363
+ }, 10));
2364
+ }, Ee = () => {
2365
+ let e = le();
2366
+ if (!e) return;
2367
+ let t = parseInt(window.getComputedStyle(e).width);
2368
+ e.style.removeProperty("transition"), e.style.width = "100%";
2369
+ let n = t / parseInt(window.getComputedStyle(e).width) * 100;
2370
+ e.style.width = `${n}%`;
2371
+ }, De = () => typeof window > "u" || typeof document > "u", Oe = `
2372
+ <div aria-labelledby="${l.title}" aria-describedby="${l["html-container"]}" class="${l.popup}" tabindex="-1">
2373
+ <button type="button" class="${l.close}"></button>
2374
+ <ul class="${l["progress-steps"]}"></ul>
2375
+ <div class="${l.icon}"></div>
2376
+ <img class="${l.image}" />
2377
+ <h2 class="${l.title}" id="${l.title}"></h2>
2378
+ <div class="${l["html-container"]}" id="${l["html-container"]}"></div>
2379
+ <input class="${l.input}" id="${l.input}" />
2380
+ <input type="file" class="${l.file}" />
2381
+ <div class="${l.range}">
2382
+ <input type="range" />
2383
+ <output></output>
2384
+ </div>
2385
+ <select class="${l.select}" id="${l.select}"></select>
2386
+ <div class="${l.radio}"></div>
2387
+ <label class="${l.checkbox}">
2388
+ <input type="checkbox" id="${l.checkbox}" />
2389
+ <span class="${l.label}"></span>
2390
+ </label>
2391
+ <textarea class="${l.textarea}" id="${l.textarea}"></textarea>
2392
+ <div class="${l["validation-message"]}" id="${l["validation-message"]}"></div>
2393
+ <div class="${l.actions}">
2394
+ <div class="${l.loader}"></div>
2395
+ <button type="button" class="${l.confirm}"></button>
2396
+ <button type="button" class="${l.deny}"></button>
2397
+ <button type="button" class="${l.cancel}"></button>
2398
+ </div>
2399
+ <div class="${l.footer}"></div>
2400
+ <div class="${l["timer-progress-bar-container"]}">
2401
+ <div class="${l["timer-progress-bar"]}"></div>
2402
+ </div>
2403
+ </div>
2404
+ `.replace(/(^|\n)\s*/g, ""), ke = () => {
2405
+ let e = C();
2406
+ return e ? (e.remove(), I([document.documentElement, document.body], [
2407
+ l["no-backdrop"],
2408
+ l["toast-shown"],
2409
+ l["has-column"]
2410
+ ]), !0) : !1;
2411
+ }, U = () => {
2412
+ a.currentInstance && a.currentInstance.resetValidationMessage();
2413
+ }, Ae = () => {
2414
+ let e = E();
2415
+ if (!e) return;
2416
+ let t = L(e, l.input), n = L(e, l.file), r = e.querySelector(`.${l.range} input`), i = e.querySelector(`.${l.range} output`), a = L(e, l.select), o = e.querySelector(`.${l.checkbox} input`), s = L(e, l.textarea);
2417
+ t && (t.oninput = U), n && (n.onchange = U), a && (a.onchange = U), o && (o.onchange = U), s && (s.oninput = U), r && i && (r.oninput = () => {
2418
+ U(), i.value = r.value;
2419
+ }, r.onchange = () => {
2420
+ U(), i.value = r.value;
2421
+ });
2422
+ }, W = (e) => {
2423
+ if (typeof e == "string") {
2424
+ let t = document.querySelector(e);
2425
+ if (!t) throw Error(`Target element "${e}" not found`);
2426
+ return t;
2427
+ }
2428
+ return e;
2429
+ }, G = (e) => {
2430
+ let t = E();
2431
+ t && (t.setAttribute("role", e.toast ? "alert" : "dialog"), t.setAttribute("aria-live", e.toast ? "polite" : "assertive"), e.toast || t.setAttribute("aria-modal", "true"));
2432
+ }, je = (e) => {
2433
+ window.getComputedStyle(e).direction === "rtl" && (F(C(), l.rtl), a.isRTL = !0);
2434
+ }, Me = (e) => {
2435
+ let t = ke();
2436
+ if (De()) {
2437
+ m("SweetAlert2 requires document to initialize");
2438
+ return;
2439
+ }
2440
+ let n = document.createElement("div");
2441
+ n.className = l.container, t && F(n, l["no-transition"]), M(n, Oe), n.dataset.swal2Theme = e.theme;
2442
+ let r = W(e.target || "body");
2443
+ r.appendChild(n), e.topLayer && (n.setAttribute("popover", ""), n.showPopover()), G(e), je(r), Ae();
2444
+ }, Ne = (e, t) => {
2445
+ e instanceof HTMLElement ? t.appendChild(e) : typeof e == "object" ? Pe(e, t) : e && M(t, e);
2446
+ }, Pe = (e, t) => {
2447
+ "jquery" in e ? Fe(t, e) : M(t, e.toString());
2448
+ }, Fe = (e, t) => {
2449
+ if (e.textContent = "", 0 in t) for (let n = 0; n in t; n++) e.appendChild(t[n].cloneNode(!0));
2450
+ else e.appendChild(t.cloneNode(!0));
2451
+ }, Ie = (e, t) => {
2452
+ let n = se(), r = oe();
2453
+ !n || !r || (!t.showConfirmButton && !t.showDenyButton && !t.showCancelButton ? z(n) : R(n), P(n, t, "actions"), Le(n, r, t), M(r, t.loaderHtml || ""), P(r, t, "loader"));
2454
+ };
2455
+ function Le(e, t, n) {
2456
+ let r = A(), i = j(), a = ie();
2457
+ !r || !i || !a || (Be(r, "confirm", n), Be(i, "deny", n), Be(a, "cancel", n), Re(r, i, a, n), n.reverseButtons && (n.toast ? (e.insertBefore(a, r), e.insertBefore(i, r)) : (e.insertBefore(a, t), e.insertBefore(i, t), e.insertBefore(r, t))));
2458
+ }
2459
+ function Re(e, t, n, r) {
2460
+ if (!r.buttonsStyling) {
2461
+ I([
2462
+ e,
2463
+ t,
2464
+ n
2465
+ ], l.styled);
2466
+ return;
2467
+ }
2468
+ F([
2469
+ e,
2470
+ t,
2471
+ n
2472
+ ], l.styled), [
2473
+ [
2474
+ e,
2475
+ "confirm",
2476
+ r.confirmButtonColor
2477
+ ],
2478
+ [
2479
+ t,
2480
+ "deny",
2481
+ r.denyButtonColor
2482
+ ],
2483
+ [
2484
+ n,
2485
+ "cancel",
2486
+ r.cancelButtonColor
2487
+ ]
2488
+ ].forEach(([e, t, n]) => {
2489
+ n && e.style.setProperty(`--swal2-${t}-button-background-color`, n), ze(e);
2490
+ });
2491
+ }
2492
+ function ze(e) {
2493
+ let t = window.getComputedStyle(e);
2494
+ if (t.getPropertyValue("--swal2-action-button-focus-box-shadow")) return;
2495
+ let n = t.backgroundColor.replace(/rgba?\((\d+), (\d+), (\d+).*/, "rgba($1, $2, $3, 0.5)");
2496
+ e.style.setProperty("--swal2-action-button-focus-box-shadow", t.getPropertyValue("--swal2-outline").replace(/ rgba\(.*/, ` ${n}`));
2497
+ }
2498
+ function Be(e, t, n) {
2499
+ let r = f(t);
2500
+ xe(e, n[`show${r}Button`], "inline-block"), M(e, n[`${t}ButtonText`] || ""), e.setAttribute("aria-label", n[`${t}ButtonAriaLabel`] || ""), e.className = l[t], P(e, n, `${t}Button`);
2501
+ }
2502
+ let Ve = (e, t) => {
2503
+ let n = ue();
2504
+ n && (M(n, t.closeButtonHtml || ""), P(n, t, "closeButton"), xe(n, t.showCloseButton), n.setAttribute("aria-label", t.closeButtonAriaLabel || ""));
2505
+ }, He = (e, t) => {
2506
+ let n = C();
2507
+ n && (Ue(n, t.backdrop), We(n, t.position), Ge(n, t.grow), P(n, t, "container"));
2508
+ };
2509
+ function Ue(e, t) {
2510
+ typeof t == "string" ? e.style.background = t : t || F([document.documentElement, document.body], l["no-backdrop"]);
2511
+ }
2512
+ function We(e, t) {
2513
+ t && (t in l ? F(e, l[t]) : (p("The \"position\" parameter is not valid, defaulting to \"center\""), F(e, l.center)));
2514
+ }
2515
+ function Ge(e, t) {
2516
+ t && F(e, l[`grow-${t}`]);
2517
+ }
2518
+ var K = {
2519
+ innerParams: /* @__PURE__ */ new WeakMap(),
2520
+ domCache: /* @__PURE__ */ new WeakMap(),
2521
+ focusedElement: /* @__PURE__ */ new WeakMap()
2522
+ };
2523
+ let Ke = [
2524
+ "input",
2525
+ "file",
2526
+ "range",
2527
+ "select",
2528
+ "radio",
2529
+ "checkbox",
2530
+ "textarea"
2531
+ ], qe = (e, t) => {
2532
+ let n = E();
2533
+ if (!n) return;
2534
+ let r = K.innerParams.get(e), i = !r || t.input !== r.input;
2535
+ Ke.forEach((e) => {
2536
+ let r = L(n, l[e]);
2537
+ r && (Xe(e, t.inputAttributes), r.className = l[e], i && z(r));
2538
+ }), t.input && (i && Je(t), Ze(t));
2539
+ }, Je = (e) => {
2540
+ if (!e.input) return;
2541
+ if (!J[e.input]) {
2542
+ m(`Unexpected type of input! Expected ${Object.keys(J).join(" | ")}, got "${e.input}"`);
2543
+ return;
2544
+ }
2545
+ let t = $e(e.input);
2546
+ if (!t) return;
2547
+ let n = J[e.input](t, e);
2548
+ R(t), e.inputAutoFocus && setTimeout(() => {
2549
+ _e(n);
2550
+ });
2551
+ }, Ye = (e) => {
2552
+ for (let { name: t } of Array.from(e.attributes)) [
2553
+ "id",
2554
+ "type",
2555
+ "value",
2556
+ "style"
2557
+ ].includes(t) || e.removeAttribute(t);
2558
+ }, Xe = (e, t) => {
2559
+ let n = E();
2560
+ if (!n) return;
2561
+ let r = ge(n, e);
2562
+ if (r) {
2563
+ Ye(r);
2564
+ for (let e in t) r.setAttribute(e, t[e]);
2565
+ }
2566
+ }, Ze = (e) => {
2567
+ if (!e.input) return;
2568
+ let t = $e(e.input);
2569
+ t && P(t, e, "input");
2570
+ }, Qe = (e, t) => {
2571
+ !e.placeholder && t.inputPlaceholder && (e.placeholder = t.inputPlaceholder);
2572
+ }, q = (e, t, n) => {
2573
+ if (n.inputLabel) {
2574
+ let r = document.createElement("label"), i = l["input-label"];
2575
+ r.setAttribute("for", e.id), r.className = i, typeof n.customClass == "object" && F(r, n.customClass.inputLabel), r.innerText = n.inputLabel, t.insertAdjacentElement("beforebegin", r);
2576
+ }
2577
+ }, $e = (e) => {
2578
+ let t = E();
2579
+ if (t) return L(t, l[e] || l.input);
2580
+ }, et = (e, t) => {
2581
+ ["string", "number"].includes(typeof t) ? e.value = `${t}` : x(t) || p(`Unexpected type of inputValue! Expected "string", "number" or "Promise", got "${typeof t}"`);
2582
+ }, J = {};
2583
+ J.text = J.email = J.password = J.number = J.tel = J.url = J.search = J.date = J["datetime-local"] = J.time = J.week = J.month = (e, t) => {
2584
+ let n = e;
2585
+ return et(n, t.inputValue), q(n, n, t), Qe(n, t), n.type = t.input, n;
2586
+ }, J.file = (e, t) => {
2587
+ let n = e;
2588
+ return q(n, n, t), Qe(n, t), n;
2589
+ }, J.range = (e, t) => {
2590
+ let n = e, r = n.querySelector("input"), i = n.querySelector("output");
2591
+ return r && (et(r, t.inputValue), r.type = t.input, q(r, e, t)), i && et(i, t.inputValue), e;
2592
+ }, J.select = (e, t) => {
2593
+ let n = e;
2594
+ if (n.textContent = "", t.inputPlaceholder) {
2595
+ let e = document.createElement("option");
2596
+ M(e, t.inputPlaceholder), e.value = "", e.disabled = !0, e.selected = !0, n.appendChild(e);
2597
+ }
2598
+ return q(n, n, t), n;
2599
+ }, J.radio = (e) => {
2600
+ let t = e;
2601
+ return t.textContent = "", e;
2602
+ }, J.checkbox = (e, t) => {
2603
+ let n = E();
2604
+ if (!n) throw Error("Popup not found");
2605
+ let r = ge(n, "checkbox");
2606
+ if (!r) throw Error("Checkbox input not found");
2607
+ r.value = "1", r.checked = !!t.inputValue;
2608
+ let i = e.querySelector("span");
2609
+ if (i) {
2610
+ let e = t.inputPlaceholder || t.inputLabel;
2611
+ e && M(i, e);
2612
+ }
2613
+ return r;
2614
+ }, J.textarea = (e, t) => {
2615
+ let n = e;
2616
+ et(n, t.inputValue), Qe(n, t), q(n, n, t);
2617
+ let r = (e) => parseInt(window.getComputedStyle(e).marginLeft) + parseInt(window.getComputedStyle(e).marginRight);
2618
+ return setTimeout(() => {
2619
+ if ("MutationObserver" in window) {
2620
+ let e = E();
2621
+ if (!e) return;
2622
+ let i = parseInt(window.getComputedStyle(e).width);
2623
+ new MutationObserver(() => {
2624
+ if (!document.body.contains(n)) return;
2625
+ let e = n.offsetWidth + r(n), a = E();
2626
+ a && (e > i ? a.style.width = `${e}px` : ye(a, "width", t.width));
2627
+ }).observe(n, {
2628
+ attributes: !0,
2629
+ attributeFilter: ["style"]
2630
+ });
2631
+ }
2632
+ }), n;
2633
+ };
2634
+ let tt = (e, t) => {
2635
+ let n = O();
2636
+ n && (B(n), P(n, t, "htmlContainer"), t.html ? (Ne(t.html, n), R(n, "block")) : t.text ? (n.textContent = t.text, R(n, "block")) : z(n), qe(e, t));
2637
+ }, nt = (e, t) => {
2638
+ let n = ce();
2639
+ n && (B(n), xe(n, !!t.footer, "block"), t.footer && Ne(t.footer, n), P(n, t, "footer"));
2640
+ }, rt = (e, t) => {
2641
+ let n = K.innerParams.get(e), r = D();
2642
+ if (r) {
2643
+ if (n && t.icon === n.icon) {
2644
+ st(r, t), it(r, t);
2645
+ return;
2646
+ }
2647
+ if (!t.icon && !t.iconHtml) {
2648
+ z(r);
2649
+ return;
2650
+ }
2651
+ if (t.icon && Object.keys(u).indexOf(t.icon) === -1) {
2652
+ m(`Unknown icon! Expected "success", "error", "warning", "info" or "question", got "${t.icon}"`), z(r);
2653
+ return;
2654
+ }
2655
+ R(r), st(r, t), it(r, t), F(r, t.showClass && t.showClass.icon), window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", at);
2656
+ }
2657
+ }, it = (e, t) => {
2658
+ for (let [n, r] of Object.entries(u)) t.icon !== n && I(e, r);
2659
+ F(e, t.icon && u[t.icon]), ct(e, t), at(), P(e, t, "icon");
2660
+ }, at = () => {
2661
+ let e = E();
2662
+ if (!e) return;
2663
+ let t = window.getComputedStyle(e).getPropertyValue("background-color");
2664
+ e.querySelectorAll("[class^=swal2-success-circular-line], .swal2-success-fix").forEach((e) => {
2665
+ e.style.backgroundColor = t;
2666
+ });
2667
+ }, ot = (e) => `
2668
+ ${e.animation ? "<div class=\"swal2-success-circular-line-left\"></div>" : ""}
2669
+ <span class="swal2-success-line-tip"></span> <span class="swal2-success-line-long"></span>
2670
+ <div class="swal2-success-ring"></div>
2671
+ ${e.animation ? "<div class=\"swal2-success-fix\"></div>" : ""}
2672
+ ${e.animation ? "<div class=\"swal2-success-circular-line-right\"></div>" : ""}
2673
+ `, st = (e, t) => {
2674
+ if (!t.icon && !t.iconHtml) return;
2675
+ let n = e.innerHTML, r = "";
2676
+ t.iconHtml ? r = lt(t.iconHtml) : t.icon === "success" ? (r = ot(t), n = n.replace(/ style=".*?"/g, "")) : t.icon === "error" ? r = "\n <span class=\"swal2-x-mark\">\n <span class=\"swal2-x-mark-line-left\"></span>\n <span class=\"swal2-x-mark-line-right\"></span>\n </span>\n" : t.icon && (r = lt({
2677
+ question: "?",
2678
+ warning: "!",
2679
+ info: "i"
2680
+ }[t.icon])), n.trim() !== r.trim() && M(e, r);
2681
+ }, ct = (e, t) => {
2682
+ if (t.iconColor) {
2683
+ e.style.color = t.iconColor, e.style.borderColor = t.iconColor;
2684
+ for (let n of [
2685
+ ".swal2-success-line-tip",
2686
+ ".swal2-success-line-long",
2687
+ ".swal2-x-mark-line-left",
2688
+ ".swal2-x-mark-line-right"
2689
+ ]) be(e, n, "background-color", t.iconColor);
2690
+ be(e, ".swal2-success-ring", "border-color", t.iconColor);
2691
+ }
2692
+ }, lt = (e) => `<div class="${l["icon-content"]}">${e}</div>`, ut = (e, t) => {
2693
+ let n = ne();
2694
+ if (n) {
2695
+ if (!t.imageUrl) {
2696
+ z(n);
2697
+ return;
2698
+ }
2699
+ R(n, ""), n.setAttribute("src", t.imageUrl), n.setAttribute("alt", t.imageAlt || ""), ye(n, "width", t.imageWidth), ye(n, "height", t.imageHeight), n.className = l.image, P(n, t, "image");
2700
+ }
2701
+ }, dt = !1, ft = 0, pt = 0, mt = 0, ht = 0, gt = (e) => {
2702
+ e.addEventListener("mousedown", Y), document.body.addEventListener("mousemove", vt), e.addEventListener("mouseup", yt), e.addEventListener("touchstart", Y), document.body.addEventListener("touchmove", vt), e.addEventListener("touchend", yt);
2703
+ }, _t = (e) => {
2704
+ e.removeEventListener("mousedown", Y), document.body.removeEventListener("mousemove", vt), e.removeEventListener("mouseup", yt), e.removeEventListener("touchstart", Y), document.body.removeEventListener("touchmove", vt), e.removeEventListener("touchend", yt);
2705
+ }, Y = (e) => {
2706
+ let t = E();
2707
+ if (!t) return;
2708
+ let n = D();
2709
+ if (e.target === t || n && n.contains(e.target)) {
2710
+ dt = !0;
2711
+ let n = bt(e);
2712
+ ft = n.clientX, pt = n.clientY, mt = parseInt(t.style.insetInlineStart) || 0, ht = parseInt(t.style.insetBlockStart) || 0, F(t, "swal2-dragging");
2713
+ }
2714
+ }, vt = (e) => {
2715
+ let t = E();
2716
+ if (t && dt) {
2717
+ let { clientX: n, clientY: r } = bt(e), i = n - ft;
2718
+ t.style.insetInlineStart = `${mt + (a.isRTL ? -i : i)}px`, t.style.insetBlockStart = `${ht + (r - pt)}px`;
2719
+ }
2720
+ }, yt = () => {
2721
+ let e = E();
2722
+ dt = !1, I(e, "swal2-dragging");
2723
+ }, bt = (e) => {
2724
+ let t = e.type.startsWith("touch") ? e.touches[0] : e;
2725
+ return {
2726
+ clientX: t.clientX,
2727
+ clientY: t.clientY
2728
+ };
2729
+ }, xt = (e, t) => {
2730
+ let n = C(), r = E();
2731
+ if (!(!n || !r)) {
2732
+ if (t.toast) {
2733
+ ye(n, "width", t.width), r.style.width = "100%";
2734
+ let e = oe();
2735
+ e && r.insertBefore(e, D());
2736
+ } else ye(r, "width", t.width);
2737
+ ye(r, "padding", t.padding), t.color && (r.style.color = t.color), t.background && (r.style.background = t.background), z(k()), St(r, t), t.draggable && !t.toast ? (F(r, l.draggable), gt(r)) : (I(r, l.draggable), _t(r));
2738
+ }
2739
+ }, St = (e, t) => {
2740
+ let n = t.showClass || {};
2741
+ e.className = `${l.popup} ${V(e) ? n.popup : ""}`, t.toast ? (F([document.documentElement, document.body], l["toast-shown"]), F(e, l.toast)) : F(e, l.modal), P(e, t, "popup"), typeof t.customClass == "string" && F(e, t.customClass), t.icon && F(e, l[`icon-${t.icon}`]);
2742
+ }, Ct = (e, t) => {
2743
+ let n = re();
2744
+ if (!n) return;
2745
+ let { progressSteps: r, currentProgressStep: i } = t;
2746
+ if (!r || r.length === 0 || i === void 0) {
2747
+ z(n);
2748
+ return;
2749
+ }
2750
+ R(n), n.textContent = "", i >= r.length && p("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"), r.forEach((e, a) => {
2751
+ let o = wt(e);
2752
+ if (n.appendChild(o), a === i && F(o, l["active-progress-step"]), a !== r.length - 1) {
2753
+ let e = Tt(t);
2754
+ n.appendChild(e);
2755
+ }
2756
+ });
2757
+ }, wt = (e) => {
2758
+ let t = document.createElement("li");
2759
+ return F(t, l["progress-step"]), M(t, e), t;
2760
+ }, Tt = (e) => {
2761
+ let t = document.createElement("li");
2762
+ return F(t, l["progress-step-line"]), e.progressStepsDistance && ye(t, "width", e.progressStepsDistance), t;
2763
+ }, Et = (e, t) => {
2764
+ let n = te();
2765
+ n && (B(n), xe(n, !!(t.title || t.titleText), "block"), t.title && Ne(t.title, n), t.titleText && (n.innerText = t.titleText), P(n, t, "title"));
2766
+ }, Dt = (e, t) => {
2767
+ var n;
2768
+ xt(e, t), He(e, t), Ct(e, t), rt(e, t), ut(e, t), Et(e, t), Ve(e, t), tt(e, t), Ie(e, t), nt(e, t);
2769
+ let r = E();
2770
+ typeof t.didRender == "function" && r && t.didRender(r), (n = a.eventEmitter) == null || n.emit("didRender", r);
2771
+ }, Ot = () => V(E()), kt = () => A()?.click(), At = () => j()?.click(), jt = () => ie()?.click(), Mt = Object.freeze({
2772
+ cancel: "cancel",
2773
+ backdrop: "backdrop",
2774
+ close: "close",
2775
+ esc: "esc",
2776
+ timer: "timer"
2777
+ }), Nt = (e) => {
2778
+ if (e.keydownTarget && e.keydownHandlerAdded && e.keydownHandler) {
2779
+ let t = e.keydownHandler;
2780
+ e.keydownTarget.removeEventListener("keydown", t, { capture: e.keydownListenerCapture }), e.keydownHandlerAdded = !1;
2781
+ }
2782
+ }, Pt = (e, t, n) => {
2783
+ if (Nt(e), !t.toast) {
2784
+ let r = (e) => Rt(t, e, n);
2785
+ e.keydownHandler = r;
2786
+ let i = t.keydownListenerCapture ? window : E();
2787
+ if (i) {
2788
+ e.keydownTarget = i, e.keydownListenerCapture = t.keydownListenerCapture;
2789
+ let n = r;
2790
+ e.keydownTarget.addEventListener("keydown", n, { capture: e.keydownListenerCapture }), e.keydownHandlerAdded = !0;
2791
+ }
2792
+ }
2793
+ }, Ft = (e, t) => {
2794
+ var n;
2795
+ let r = de();
2796
+ return r.length ? (e += t, e === -2 && (e = r.length - 1), e === r.length ? e = 0 : e === -1 && (e = r.length - 1), r[e].focus(), !(S() && r[e] instanceof HTMLIFrameElement)) : ((n = E()) == null || n.focus(), !0);
2797
+ }, It = ["ArrowRight", "ArrowDown"], Lt = ["ArrowLeft", "ArrowUp"], Rt = (e, t, n) => {
2798
+ e && (t.isComposing || t.keyCode === 229 || (e.stopKeydownPropagation && t.stopPropagation(), t.key === "Enter" ? zt(t, e) : t.key === "Tab" ? Bt(t) : [...It, ...Lt].includes(t.key) ? Vt(t.key) : t.key === "Escape" && Ht(t, e, n)));
2799
+ }, zt = (e, t) => {
2800
+ if (!v(t.allowEnterKey)) return;
2801
+ let n = E();
2802
+ if (!n || !t.input) return;
2803
+ let r = ge(n, t.input);
2804
+ if (e.target && r && e.target instanceof HTMLElement && e.target.outerHTML === r.outerHTML) {
2805
+ if (["textarea", "file"].includes(t.input)) return;
2806
+ kt(), e.preventDefault();
2807
+ }
2808
+ }, Bt = (e) => {
2809
+ let t = e.target, n = de().findIndex((e) => e === t), r = !0;
2810
+ r = e.shiftKey ? Ft(n, -1) : Ft(n, 1), e.stopPropagation(), r && e.preventDefault();
2811
+ }, Vt = (e) => {
2812
+ let t = se(), n = A(), r = j(), i = ie();
2813
+ if (!t || !n || !r || !i) return;
2814
+ let a = [
2815
+ n,
2816
+ r,
2817
+ i
2818
+ ];
2819
+ if (document.activeElement instanceof HTMLElement && !a.includes(document.activeElement)) return;
2820
+ let o = It.includes(e) ? "nextElementSibling" : "previousElementSibling", s = document.activeElement;
2821
+ if (s) {
2822
+ for (let e = 0; e < t.children.length; e++) {
2823
+ if (s = s[o], !s) return;
2824
+ if (s instanceof HTMLButtonElement && V(s)) break;
2825
+ }
2826
+ s instanceof HTMLButtonElement && s.focus();
2827
+ }
2828
+ }, Ht = (e, t, n) => {
2829
+ e.preventDefault(), v(t.allowEscapeKey) && n(Mt.esc);
2830
+ };
2831
+ var X = {
2832
+ swalPromiseResolve: /* @__PURE__ */ new WeakMap(),
2833
+ swalPromiseReject: /* @__PURE__ */ new WeakMap()
2834
+ };
2835
+ let Ut = () => {
2836
+ let e = C();
2837
+ Array.from(document.body.children).forEach((t) => {
2838
+ t.contains(e) || (t.hasAttribute("aria-hidden") && t.setAttribute("data-previous-aria-hidden", t.getAttribute("aria-hidden") || ""), t.setAttribute("aria-hidden", "true"));
2839
+ });
2840
+ }, Wt = () => {
2841
+ Array.from(document.body.children).forEach((e) => {
2842
+ e.hasAttribute("data-previous-aria-hidden") ? (e.setAttribute("aria-hidden", e.getAttribute("data-previous-aria-hidden") || ""), e.removeAttribute("data-previous-aria-hidden")) : e.removeAttribute("aria-hidden");
2843
+ });
2844
+ }, Gt = typeof window < "u" && !!window.GestureEvent, Kt = Gt && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream, qt = () => {
2845
+ if (Gt && !N(document.body, l.iosfix)) {
2846
+ let e = document.body.scrollTop;
2847
+ document.body.style.top = `${e * -1}px`, F(document.body, l.iosfix), Jt();
2848
+ }
2849
+ }, Jt = () => {
2850
+ let e = C();
2851
+ if (!e) return;
2852
+ let t;
2853
+ e.ontouchstart = (e) => {
2854
+ t = Yt(e);
2855
+ }, e.ontouchmove = (e) => {
2856
+ t && (e.preventDefault(), e.stopPropagation());
2857
+ };
2858
+ }, Yt = (e) => {
2859
+ let t = e.target, n = C(), r = O();
2860
+ return !n || !r || Xt(e) || Zt(e) ? !1 : t === n || !H(n) && t instanceof HTMLElement && !Ce(t, r) && t.tagName !== "INPUT" && t.tagName !== "TEXTAREA" && !(H(r) && r.contains(t));
2861
+ }, Xt = (e) => !!(e.touches && e.touches.length && e.touches[0].touchType === "stylus"), Zt = (e) => e.touches && e.touches.length > 1, Qt = () => {
2862
+ if (N(document.body, l.iosfix)) {
2863
+ let e = parseInt(document.body.style.top, 10);
2864
+ I(document.body, l.iosfix), document.body.style.top = "", document.body.scrollTop = e * -1;
2865
+ }
2866
+ }, $t = () => {
2867
+ let e = document.createElement("div");
2868
+ e.className = l["scrollbar-measure"], document.body.appendChild(e);
2869
+ let t = e.getBoundingClientRect().width - e.clientWidth;
2870
+ return document.body.removeChild(e), t;
2871
+ }, en = null, tn = (e) => {
2872
+ en === null && (document.body.scrollHeight > window.innerHeight || e === "scroll") && (en = parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")), document.body.style.paddingRight = `${en + $t()}px`);
2873
+ }, nn = () => {
2874
+ en !== null && (document.body.style.paddingRight = `${en}px`, en = null);
2875
+ };
2876
+ function rn(e, t, n, r) {
2877
+ pe() ? fn(e, r) : (s(n).then(() => fn(e, r)), Nt(a)), Gt ? (t.setAttribute("style", "display:none !important"), t.removeAttribute("class"), t.innerHTML = "") : t.remove(), fe() && (nn(), Qt(), Wt()), an();
2878
+ }
2879
+ function an() {
2880
+ I([document.documentElement, document.body], [
2881
+ l.shown,
2882
+ l["height-auto"],
2883
+ l["no-backdrop"],
2884
+ l["toast-shown"]
2885
+ ]);
2886
+ }
2887
+ function Z(e) {
2888
+ e = ln(e);
2889
+ let t = X.swalPromiseResolve.get(this), n = on(this);
2890
+ this.isAwaitingPromise ? e.isDismissed || (cn(this), t(e)) : n && t(e);
2891
+ }
2892
+ let on = (e) => {
2893
+ let t = E();
2894
+ if (!t) return !1;
2895
+ let n = K.innerParams.get(e);
2896
+ if (!n || N(t, n.hideClass.popup)) return !1;
2897
+ I(t, n.showClass.popup), F(t, n.hideClass.popup);
2898
+ let r = C();
2899
+ return I(r, n.showClass.backdrop), F(r, n.hideClass.backdrop), un(e, t, n), !0;
2900
+ };
2901
+ function sn(e) {
2902
+ let t = X.swalPromiseReject.get(this);
2903
+ cn(this), t && t(e);
2904
+ }
2905
+ let cn = (e) => {
2906
+ e.isAwaitingPromise && (delete e.isAwaitingPromise, K.innerParams.get(e) || e._destroy());
2907
+ }, ln = (e) => e === void 0 ? {
2908
+ isConfirmed: !1,
2909
+ isDenied: !1,
2910
+ isDismissed: !0
2911
+ } : Object.assign({
2912
+ isConfirmed: !1,
2913
+ isDenied: !1,
2914
+ isDismissed: !1
2915
+ }, e), un = (e, t, n) => {
2916
+ var r;
2917
+ let i = C(), o = we(t);
2918
+ typeof n.willClose == "function" && n.willClose(t), (r = a.eventEmitter) == null || r.emit("willClose", t), o && i ? dn(e, t, i, !!n.returnFocus, n.didClose) : i && rn(e, i, !!n.returnFocus, n.didClose);
2919
+ }, dn = (e, t, n, r, i) => {
2920
+ a.swalCloseEventFinishedCallback = rn.bind(null, e, n, r, i);
2921
+ let o = function(e) {
2922
+ if (e.target === t) {
2923
+ var n;
2924
+ (n = a.swalCloseEventFinishedCallback) == null || n.call(a), delete a.swalCloseEventFinishedCallback, t.removeEventListener("animationend", o), t.removeEventListener("transitionend", o);
2925
+ }
2926
+ };
2927
+ t.addEventListener("animationend", o), t.addEventListener("transitionend", o);
2928
+ }, fn = (e, t) => {
2929
+ setTimeout(() => {
2930
+ var n;
2931
+ typeof t == "function" && t.bind(e.params)(), (n = a.eventEmitter) == null || n.emit("didClose"), e._destroy && e._destroy();
2932
+ });
2933
+ }, pn = (e) => {
2934
+ let t = E();
2935
+ if (t || new li(), t = E(), !t) return;
2936
+ let n = oe();
2937
+ pe() ? z(D()) : mn(t, e), R(n), t.setAttribute("data-loading", "true"), t.setAttribute("aria-busy", "true"), t.focus();
2938
+ }, mn = (e, t) => {
2939
+ let n = se(), r = oe();
2940
+ !n || !r || (!t && V(A()) && (t = A()), R(n), t && (z(t), r.setAttribute("data-button-to-replace", t.className), n.insertBefore(r, t)), F([e, n], l.loading));
2941
+ }, hn = (e, t) => {
2942
+ t.input === "select" || t.input === "radio" ? bn(e, t) : [
2943
+ "text",
2944
+ "email",
2945
+ "number",
2946
+ "tel",
2947
+ "textarea"
2948
+ ].some((e) => e === t.input) && (y(t.inputValue) || x(t.inputValue)) && (pn(A()), xn(e, t));
2949
+ }, gn = (e, t) => {
2950
+ let n = e.getInput();
2951
+ if (!n) return null;
2952
+ switch (t.input) {
2953
+ case "checkbox": return _n(n);
2954
+ case "radio": return vn(n);
2955
+ case "file": return yn(n);
2956
+ default: return t.inputAutoTrim ? n.value.trim() : n.value;
2957
+ }
2958
+ }, _n = (e) => +!!e.checked, vn = (e) => e.checked ? e.value : null, yn = (e) => e.files && e.files.length ? e.getAttribute("multiple") === null ? e.files[0] : e.files : null, bn = (e, t) => {
2959
+ let n = E();
2960
+ if (!n) return;
2961
+ let r = (e) => {
2962
+ t.input === "select" ? Sn(n, wn(e), t) : t.input === "radio" && Cn(n, wn(e), t);
2963
+ };
2964
+ y(t.inputOptions) || x(t.inputOptions) ? (pn(A()), b(t.inputOptions).then((t) => {
2965
+ e.hideLoading(), r(t);
2966
+ })) : typeof t.inputOptions == "object" ? r(t.inputOptions) : m(`Unexpected type of inputOptions! Expected object, Map or Promise, got ${typeof t.inputOptions}`);
2967
+ }, xn = (e, t) => {
2968
+ let n = e.getInput();
2969
+ n && (z(n), b(t.inputValue).then((r) => {
2970
+ n.value = t.input === "number" ? `${parseFloat(r) || 0}` : `${r}`, R(n), n.focus(), e.hideLoading();
2971
+ }).catch((t) => {
2972
+ m(`Error in inputValue promise: ${t}`), n.value = "", R(n), n.focus(), e.hideLoading();
2973
+ }));
2974
+ };
2975
+ function Sn(e, t, n) {
2976
+ let r = L(e, l.select);
2977
+ if (!r) return;
2978
+ let i = (e, t, r) => {
2979
+ let i = document.createElement("option");
2980
+ i.value = r, M(i, t), i.selected = Tn(r, n.inputValue), e.appendChild(i);
2981
+ };
2982
+ t.forEach((e) => {
2983
+ let t = e[0], n = e[1];
2984
+ if (Array.isArray(n)) {
2985
+ let e = document.createElement("optgroup");
2986
+ e.label = t, e.disabled = !1, r.appendChild(e), n.forEach((t) => i(e, t[1], t[0]));
2987
+ } else i(r, n, t);
2988
+ }), r.focus();
2989
+ }
2990
+ function Cn(e, t, n) {
2991
+ let r = L(e, l.radio);
2992
+ if (!r) return;
2993
+ t.forEach((e) => {
2994
+ let t = e[0], i = e[1], a = document.createElement("input"), o = document.createElement("label");
2995
+ a.type = "radio", a.name = l.radio, a.value = t, Tn(t, n.inputValue) && (a.checked = !0);
2996
+ let s = document.createElement("span");
2997
+ M(s, i), s.className = l.label, o.appendChild(a), o.appendChild(s), r.appendChild(o);
2998
+ });
2999
+ let i = r.querySelectorAll("input");
3000
+ i.length && i[0].focus();
3001
+ }
3002
+ let wn = (e) => (e instanceof Map ? Array.from(e) : Object.entries(e)).map(([e, t]) => [e, typeof t == "object" ? wn(t) : t]), Tn = (e, t) => !!t && t != null && t.toString() === e.toString(), En = (e) => {
3003
+ let t = K.innerParams.get(e);
3004
+ e.disableButtons(), t.input ? kn(e, "confirm") : Pn(e, !0);
3005
+ }, Dn = (e) => {
3006
+ let t = K.innerParams.get(e);
3007
+ e.disableButtons(), t.returnInputValueOnDeny ? kn(e, "deny") : jn(e, !1);
3008
+ }, On = (e, t) => {
3009
+ e.disableButtons(), t(Mt.cancel);
3010
+ }, kn = (e, t) => {
3011
+ let n = K.innerParams.get(e);
3012
+ if (!n.input) {
3013
+ m(`The "input" parameter is needed to be set when using returnInputValueOn${f(t)}`);
3014
+ return;
3015
+ }
3016
+ let r = e.getInput(), i = gn(e, n);
3017
+ n.inputValidator ? An(e, i, t) : r && !r.checkValidity() ? (e.enableButtons(), e.showValidationMessage(n.validationMessage || r.validationMessage)) : t === "deny" ? jn(e, i) : Pn(e, i);
3018
+ }, An = (e, t, n) => {
3019
+ let r = K.innerParams.get(e);
3020
+ e.disableInput(), Promise.resolve().then(() => b(r.inputValidator(t, r.validationMessage))).then((r) => {
3021
+ e.enableButtons(), e.enableInput(), r ? e.showValidationMessage(r) : n === "deny" ? jn(e, t) : Pn(e, t);
3022
+ });
3023
+ }, jn = (e, t) => {
3024
+ let n = K.innerParams.get(e);
3025
+ n.showLoaderOnDeny && pn(j()), n.preDeny ? (e.isAwaitingPromise = !0, Promise.resolve().then(() => b(n.preDeny(t, n.validationMessage))).then((n) => {
3026
+ n === !1 ? (e.hideLoading(), cn(e)) : e.close({
3027
+ isDenied: !0,
3028
+ value: n === void 0 ? t : n
3029
+ });
3030
+ }).catch((t) => Nn(e, t))) : e.close({
3031
+ isDenied: !0,
3032
+ value: t
3033
+ });
3034
+ }, Mn = (e, t) => {
3035
+ e.close({
3036
+ isConfirmed: !0,
3037
+ value: t
3038
+ });
3039
+ }, Nn = (e, t) => {
3040
+ e.rejectPromise(t);
3041
+ }, Pn = (e, t) => {
3042
+ let n = K.innerParams.get(e);
3043
+ n.showLoaderOnConfirm && pn(), n.preConfirm ? (e.resetValidationMessage(), e.isAwaitingPromise = !0, Promise.resolve().then(() => b(n.preConfirm(t, n.validationMessage))).then((n) => {
3044
+ V(k()) || n === !1 ? (e.hideLoading(), cn(e)) : Mn(e, n === void 0 ? t : n);
3045
+ }).catch((t) => Nn(e, t))) : Mn(e, t);
3046
+ };
3047
+ function Fn() {
3048
+ let e = K.innerParams.get(this);
3049
+ if (!e) return;
3050
+ let t = K.domCache.get(this);
3051
+ z(t.loader), pe() ? e.icon && R(D()) : In(t), I([t.popup, t.actions], l.loading), t.popup.removeAttribute("aria-busy"), t.popup.removeAttribute("data-loading"), this.enableButtons();
3052
+ }
3053
+ let In = (e) => {
3054
+ let t = e.loader.getAttribute("data-button-to-replace"), n = t ? e.popup.getElementsByClassName(t) : [];
3055
+ n.length ? R(n[0], "inline-block") : Se() && z(e.actions);
3056
+ };
3057
+ function Ln() {
3058
+ let e = K.innerParams.get(this), t = K.domCache.get(this);
3059
+ return t ? ge(t.popup, e.input) : null;
3060
+ }
3061
+ function Rn(e, t, n) {
3062
+ let r = K.domCache.get(e);
3063
+ t.forEach((e) => {
3064
+ r[e].disabled = n;
3065
+ });
3066
+ }
3067
+ function zn(e, t) {
3068
+ let n = E();
3069
+ !n || !e || (e.type === "radio" ? n.querySelectorAll(`[name="${l.radio}"]`).forEach((e) => {
3070
+ e.disabled = t;
3071
+ }) : e.disabled = t);
3072
+ }
3073
+ function Bn() {
3074
+ Rn(this, [
3075
+ "confirmButton",
3076
+ "denyButton",
3077
+ "cancelButton"
3078
+ ], !1);
3079
+ let e = K.focusedElement.get(this);
3080
+ e instanceof HTMLElement && document.activeElement === document.body && e.focus(), K.focusedElement.delete(this);
3081
+ }
3082
+ function Vn() {
3083
+ K.focusedElement.set(this, document.activeElement), Rn(this, [
3084
+ "confirmButton",
3085
+ "denyButton",
3086
+ "cancelButton"
3087
+ ], !0);
3088
+ }
3089
+ function Hn() {
3090
+ zn(this.getInput(), !1);
3091
+ }
3092
+ function Un() {
3093
+ zn(this.getInput(), !0);
3094
+ }
3095
+ function Wn(e) {
3096
+ let t = K.domCache.get(this), n = K.innerParams.get(this);
3097
+ M(t.validationMessage, e), t.validationMessage.className = l["validation-message"], n.customClass && n.customClass.validationMessage && F(t.validationMessage, n.customClass.validationMessage), R(t.validationMessage);
3098
+ let r = this.getInput();
3099
+ r && (r.setAttribute("aria-invalid", "true"), r.setAttribute("aria-describedby", l["validation-message"]), _e(r), F(r, l.inputerror));
3100
+ }
3101
+ function Gn() {
3102
+ let e = K.domCache.get(this);
3103
+ e.validationMessage && z(e.validationMessage);
3104
+ let t = this.getInput();
3105
+ t && (t.removeAttribute("aria-invalid"), t.removeAttribute("aria-describedby"), I(t, l.inputerror));
3106
+ }
3107
+ let Kn = {
3108
+ title: "",
3109
+ titleText: "",
3110
+ text: "",
3111
+ html: "",
3112
+ footer: "",
3113
+ icon: void 0,
3114
+ iconColor: void 0,
3115
+ iconHtml: void 0,
3116
+ template: void 0,
3117
+ toast: !1,
3118
+ draggable: !1,
3119
+ animation: !0,
3120
+ theme: "light",
3121
+ showClass: {
3122
+ popup: "swal2-show",
3123
+ backdrop: "swal2-backdrop-show",
3124
+ icon: "swal2-icon-show"
3125
+ },
3126
+ hideClass: {
3127
+ popup: "swal2-hide",
3128
+ backdrop: "swal2-backdrop-hide",
3129
+ icon: "swal2-icon-hide"
3130
+ },
3131
+ customClass: {},
3132
+ target: "body",
3133
+ color: void 0,
3134
+ backdrop: !0,
3135
+ heightAuto: !0,
3136
+ allowOutsideClick: !0,
3137
+ allowEscapeKey: !0,
3138
+ allowEnterKey: !0,
3139
+ stopKeydownPropagation: !0,
3140
+ keydownListenerCapture: !1,
3141
+ showConfirmButton: !0,
3142
+ showDenyButton: !1,
3143
+ showCancelButton: !1,
3144
+ preConfirm: void 0,
3145
+ preDeny: void 0,
3146
+ confirmButtonText: "OK",
3147
+ confirmButtonAriaLabel: "",
3148
+ confirmButtonColor: void 0,
3149
+ denyButtonText: "No",
3150
+ denyButtonAriaLabel: "",
3151
+ denyButtonColor: void 0,
3152
+ cancelButtonText: "Cancel",
3153
+ cancelButtonAriaLabel: "",
3154
+ cancelButtonColor: void 0,
3155
+ buttonsStyling: !0,
3156
+ reverseButtons: !1,
3157
+ focusConfirm: !0,
3158
+ focusDeny: !1,
3159
+ focusCancel: !1,
3160
+ returnFocus: !0,
3161
+ showCloseButton: !1,
3162
+ closeButtonHtml: "&times;",
3163
+ closeButtonAriaLabel: "Close this dialog",
3164
+ loaderHtml: "",
3165
+ showLoaderOnConfirm: !1,
3166
+ showLoaderOnDeny: !1,
3167
+ imageUrl: void 0,
3168
+ imageWidth: void 0,
3169
+ imageHeight: void 0,
3170
+ imageAlt: "",
3171
+ timer: void 0,
3172
+ timerProgressBar: !1,
3173
+ width: void 0,
3174
+ padding: void 0,
3175
+ background: void 0,
3176
+ input: void 0,
3177
+ inputPlaceholder: "",
3178
+ inputLabel: "",
3179
+ inputValue: "",
3180
+ inputOptions: {},
3181
+ inputAutoFocus: !0,
3182
+ inputAutoTrim: !0,
3183
+ inputAttributes: {},
3184
+ inputValidator: void 0,
3185
+ returnInputValueOnDeny: !1,
3186
+ validationMessage: void 0,
3187
+ grow: !1,
3188
+ position: "center",
3189
+ progressSteps: [],
3190
+ currentProgressStep: void 0,
3191
+ progressStepsDistance: void 0,
3192
+ willOpen: void 0,
3193
+ didOpen: void 0,
3194
+ didRender: void 0,
3195
+ willClose: void 0,
3196
+ didClose: void 0,
3197
+ didDestroy: void 0,
3198
+ scrollbarPadding: !0,
3199
+ topLayer: !1
3200
+ }, qn = /* @__PURE__ */ "allowEscapeKey.allowOutsideClick.background.buttonsStyling.cancelButtonAriaLabel.cancelButtonColor.cancelButtonText.closeButtonAriaLabel.closeButtonHtml.color.confirmButtonAriaLabel.confirmButtonColor.confirmButtonText.currentProgressStep.customClass.denyButtonAriaLabel.denyButtonColor.denyButtonText.didClose.didDestroy.draggable.footer.hideClass.html.icon.iconColor.iconHtml.imageAlt.imageHeight.imageUrl.imageWidth.preConfirm.preDeny.progressSteps.returnFocus.reverseButtons.showCancelButton.showCloseButton.showConfirmButton.showDenyButton.text.title.titleText.theme.willClose".split("."), Jn = { allowEnterKey: void 0 }, Yn = [
3201
+ "allowOutsideClick",
3202
+ "allowEnterKey",
3203
+ "backdrop",
3204
+ "draggable",
3205
+ "focusConfirm",
3206
+ "focusDeny",
3207
+ "focusCancel",
3208
+ "returnFocus",
3209
+ "heightAuto",
3210
+ "keydownListenerCapture"
3211
+ ], Xn = (e) => Object.prototype.hasOwnProperty.call(Kn, e), Zn = (e) => qn.indexOf(e) !== -1, Qn = (e) => Jn[e], $n = (e) => {
3212
+ Xn(e) || p(`Unknown parameter "${e}"`);
3213
+ }, er = (e) => {
3214
+ Yn.includes(e) && p(`The parameter "${e}" is incompatible with toasts`);
3215
+ }, tr = (e) => {
3216
+ let t = Qn(e);
3217
+ t && _(e, t);
3218
+ }, nr = (e) => {
3219
+ e.backdrop === !1 && e.allowOutsideClick && p("\"allowOutsideClick\" parameter requires `backdrop` parameter to be set to `true`"), e.theme && ![
3220
+ "light",
3221
+ "dark",
3222
+ "auto",
3223
+ "minimal",
3224
+ "borderless",
3225
+ "bootstrap-4",
3226
+ "bootstrap-4-light",
3227
+ "bootstrap-4-dark",
3228
+ "bootstrap-5",
3229
+ "bootstrap-5-light",
3230
+ "bootstrap-5-dark",
3231
+ "material-ui",
3232
+ "material-ui-light",
3233
+ "material-ui-dark",
3234
+ "embed-iframe",
3235
+ "bulma",
3236
+ "bulma-light",
3237
+ "bulma-dark"
3238
+ ].includes(e.theme) && p(`Invalid theme "${e.theme}"`);
3239
+ for (let t in e) $n(t), e.toast && er(t), tr(t);
3240
+ };
3241
+ function rr(e) {
3242
+ let t = C(), n = E(), r = K.innerParams.get(this);
3243
+ if (!n || N(n, r.hideClass.popup)) {
3244
+ p("You're trying to update the closed or closing popup, that won't work. Use the update() method in preConfirm parameter or show a new popup.");
3245
+ return;
3246
+ }
3247
+ let i = ir(e), a = Object.assign({}, r, i);
3248
+ nr(a), t && (t.dataset.swal2Theme = a.theme), Dt(this, a), K.innerParams.set(this, a), Object.defineProperties(this, { params: {
3249
+ value: Object.assign({}, this.params, e),
3250
+ writable: !1,
3251
+ enumerable: !0
3252
+ } });
3253
+ }
3254
+ let ir = (e) => {
3255
+ let t = {};
3256
+ return Object.keys(e).forEach((n) => {
3257
+ Zn(n) ? t[n] = e[n] : p(`Invalid parameter to update: ${n}`);
3258
+ }), t;
3259
+ };
3260
+ function ar() {
3261
+ var e;
3262
+ let t = K.domCache.get(this), n = K.innerParams.get(this);
3263
+ if (!n) {
3264
+ sr(this);
3265
+ return;
3266
+ }
3267
+ t.popup && a.swalCloseEventFinishedCallback && (a.swalCloseEventFinishedCallback(), delete a.swalCloseEventFinishedCallback), typeof n.didDestroy == "function" && n.didDestroy(), (e = a.eventEmitter) == null || e.emit("didDestroy"), or(this);
3268
+ }
3269
+ let or = (e) => {
3270
+ sr(e), delete e.params, delete a.keydownHandler, delete a.keydownTarget, delete a.currentInstance;
3271
+ }, sr = (e) => {
3272
+ e.isAwaitingPromise ? (cr(K, e), e.isAwaitingPromise = !0) : (cr(X, e), cr(K, e), delete e.isAwaitingPromise, delete e.disableButtons, delete e.enableButtons, delete e.getInput, delete e.disableInput, delete e.enableInput, delete e.hideLoading, delete e.disableLoading, delete e.showValidationMessage, delete e.resetValidationMessage, delete e.close, delete e.closePopup, delete e.closeModal, delete e.closeToast, delete e.rejectPromise, delete e.update, delete e._destroy);
3273
+ }, cr = (e, t) => {
3274
+ for (let n in e) e[n].delete(t);
3275
+ };
3276
+ var lr = /*#__PURE__*/ Object.freeze({
3277
+ __proto__: null,
3278
+ _destroy: ar,
3279
+ close: Z,
3280
+ closeModal: Z,
3281
+ closePopup: Z,
3282
+ closeToast: Z,
3283
+ disableButtons: Vn,
3284
+ disableInput: Un,
3285
+ disableLoading: Fn,
3286
+ enableButtons: Bn,
3287
+ enableInput: Hn,
3288
+ getInput: Ln,
3289
+ handleAwaitingPromise: cn,
3290
+ hideLoading: Fn,
3291
+ rejectPromise: sn,
3292
+ resetValidationMessage: Gn,
3293
+ showValidationMessage: Wn,
3294
+ update: rr
3295
+ });
3296
+ let ur = (e, t, n) => {
3297
+ e.toast ? dr(e, t, n) : (mr(t), hr(t), gr(e, t, n));
3298
+ }, dr = (e, t, n) => {
3299
+ t.popup.onclick = () => {
3300
+ e && (fr(e) || e.timer || e.input) || n(Mt.close);
3301
+ };
3302
+ }, fr = (e) => !!(e.showConfirmButton || e.showDenyButton || e.showCancelButton || e.showCloseButton), pr = !1, mr = (e) => {
3303
+ e.popup.onmousedown = () => {
3304
+ e.container.onmouseup = function(t) {
3305
+ e.container.onmouseup = () => {}, t.target === e.container && (pr = !0);
3306
+ };
3307
+ };
3308
+ }, hr = (e) => {
3309
+ e.container.onmousedown = (t) => {
3310
+ t.target === e.container && t.preventDefault(), e.popup.onmouseup = function(t) {
3311
+ e.popup.onmouseup = () => {}, (t.target === e.popup || t.target instanceof HTMLElement && e.popup.contains(t.target)) && (pr = !0);
3312
+ };
3313
+ };
3314
+ }, gr = (e, t, n) => {
3315
+ t.container.onclick = (r) => {
3316
+ if (pr) {
3317
+ pr = !1;
3318
+ return;
3319
+ }
3320
+ r.target === t.container && v(e.allowOutsideClick) && n(Mt.backdrop);
3321
+ };
3322
+ }, _r = (e) => typeof e == "object" && !!e && "jquery" in e, vr = (e) => e instanceof Element || _r(e), yr = (e) => {
3323
+ let t = {};
3324
+ return typeof e[0] == "object" && !vr(e[0]) ? Object.assign(t, e[0]) : [
3325
+ "title",
3326
+ "html",
3327
+ "icon"
3328
+ ].forEach((n, r) => {
3329
+ let i = e[r];
3330
+ typeof i == "string" || vr(i) ? t[n] = i : i !== void 0 && m(`Unexpected type of ${n}! Expected "string" or "Element", got ${typeof i}`);
3331
+ }), t;
3332
+ };
3333
+ function br(...e) {
3334
+ return new this(...e);
3335
+ }
3336
+ function xr(e) {
3337
+ class t extends this {
3338
+ _main(t, n) {
3339
+ return super._main(t, Object.assign({}, e, n));
3340
+ }
3341
+ }
3342
+ return t;
3343
+ }
3344
+ let Sr = () => a.timeout && a.timeout.getTimerLeft(), Cr = () => {
3345
+ if (a.timeout) return Ee(), a.timeout.stop();
3346
+ }, wr = () => {
3347
+ if (a.timeout) {
3348
+ let e = a.timeout.start();
3349
+ return Te(e), e;
3350
+ }
3351
+ }, Tr = () => {
3352
+ let e = a.timeout;
3353
+ return e && (e.running ? Cr() : wr());
3354
+ }, Er = (e) => {
3355
+ if (a.timeout) {
3356
+ let t = a.timeout.increase(e);
3357
+ return Te(t, !0), t;
3358
+ }
3359
+ }, Dr = () => !!(a.timeout && a.timeout.isRunning()), Or = !1, kr = {};
3360
+ function Ar(e = "data-swal-template") {
3361
+ kr[e] = this, Or ||= (document.body.addEventListener("click", jr), !0);
3362
+ }
3363
+ let jr = (e) => {
3364
+ for (let t = e.target; t && t !== document; t = t.parentNode) for (let e in kr) {
3365
+ let n = t.getAttribute && t.getAttribute(e);
3366
+ if (n) {
3367
+ kr[e].fire({ template: n });
3368
+ return;
3369
+ }
3370
+ }
3371
+ };
3372
+ class Mr {
3373
+ constructor() {
3374
+ this.events = {};
3375
+ }
3376
+ _getHandlersByEventName(e) {
3377
+ return this.events[e] === void 0 && (this.events[e] = []), this.events[e];
3378
+ }
3379
+ on(e, t) {
3380
+ let n = this._getHandlersByEventName(e);
3381
+ n.includes(t) || n.push(t);
3382
+ }
3383
+ once(e, t) {
3384
+ let n = (...r) => {
3385
+ this.removeListener(e, n), t.apply(this, r);
3386
+ };
3387
+ this.on(e, n);
3388
+ }
3389
+ emit(e, ...t) {
3390
+ this._getHandlersByEventName(e).forEach((e) => {
3391
+ try {
3392
+ e.apply(this, t);
3393
+ } catch (e) {
3394
+ console.error(e);
3395
+ }
3396
+ });
3397
+ }
3398
+ removeListener(e, t) {
3399
+ let n = this._getHandlersByEventName(e), r = n.indexOf(t);
3400
+ r > -1 && n.splice(r, 1);
3401
+ }
3402
+ removeAllListeners(e) {
3403
+ this.events[e] !== void 0 && (this.events[e].length = 0);
3404
+ }
3405
+ reset() {
3406
+ this.events = {};
3407
+ }
3408
+ }
3409
+ a.eventEmitter = new Mr();
3410
+ var Nr = /*#__PURE__*/ Object.freeze({
3411
+ __proto__: null,
3412
+ argsToParams: yr,
3413
+ bindClickHandler: Ar,
3414
+ clickCancel: jt,
3415
+ clickConfirm: kt,
3416
+ clickDeny: At,
3417
+ enableLoading: pn,
3418
+ fire: br,
3419
+ getActions: se,
3420
+ getCancelButton: ie,
3421
+ getCloseButton: ue,
3422
+ getConfirmButton: A,
3423
+ getContainer: C,
3424
+ getDenyButton: j,
3425
+ getFocusableElements: de,
3426
+ getFooter: ce,
3427
+ getHtmlContainer: O,
3428
+ getIcon: D,
3429
+ getIconContent: ee,
3430
+ getImage: ne,
3431
+ getInputLabel: ae,
3432
+ getLoader: oe,
3433
+ getPopup: E,
3434
+ getProgressSteps: re,
3435
+ getTimerLeft: Sr,
3436
+ getTimerProgressBar: le,
3437
+ getTitle: te,
3438
+ getValidationMessage: k,
3439
+ increaseTimer: Er,
3440
+ isDeprecatedParameter: Qn,
3441
+ isLoading: me,
3442
+ isTimerRunning: Dr,
3443
+ isUpdatableParameter: Zn,
3444
+ isValidParameter: Xn,
3445
+ isVisible: Ot,
3446
+ mixin: xr,
3447
+ off: (e, t) => {
3448
+ if (a.eventEmitter) {
3449
+ if (!e) {
3450
+ a.eventEmitter.reset();
3451
+ return;
3452
+ }
3453
+ t ? a.eventEmitter.removeListener(e, t) : a.eventEmitter.removeAllListeners(e);
3454
+ }
3455
+ },
3456
+ on: (e, t) => {
3457
+ a.eventEmitter && a.eventEmitter.on(e, t);
3458
+ },
3459
+ once: (e, t) => {
3460
+ a.eventEmitter && a.eventEmitter.once(e, t);
3461
+ },
3462
+ resumeTimer: wr,
3463
+ showLoading: pn,
3464
+ stopTimer: Cr,
3465
+ toggleTimer: Tr
3466
+ });
3467
+ class Pr {
3468
+ constructor(e, t) {
3469
+ this.callback = e, this.remaining = t, this.running = !1, this.start();
3470
+ }
3471
+ start() {
3472
+ return this.running || (this.running = !0, this.started = /* @__PURE__ */ new Date(), this.id = setTimeout(this.callback, this.remaining)), this.remaining;
3473
+ }
3474
+ stop() {
3475
+ return this.started && this.running && (this.running = !1, clearTimeout(this.id), this.remaining -= (/* @__PURE__ */ new Date()).getTime() - this.started.getTime()), this.remaining;
3476
+ }
3477
+ increase(e) {
3478
+ let t = this.running;
3479
+ return t && this.stop(), this.remaining += e, t && this.start(), this.remaining;
3480
+ }
3481
+ getTimerLeft() {
3482
+ return this.running && (this.stop(), this.start()), this.remaining;
3483
+ }
3484
+ isRunning() {
3485
+ return this.running;
3486
+ }
3487
+ }
3488
+ let Fr = [
3489
+ "swal-title",
3490
+ "swal-html",
3491
+ "swal-footer"
3492
+ ], Ir = (e) => {
3493
+ let t = typeof e.template == "string" ? document.querySelector(e.template) : e.template;
3494
+ if (!t) return {};
3495
+ let n = t.content;
3496
+ return Wr(n), Object.assign(Lr(n), Rr(n), zr(n), Br(n), Vr(n), Hr(n), Ur(n, Fr));
3497
+ }, Lr = (e) => {
3498
+ let t = {};
3499
+ return Array.from(e.querySelectorAll("swal-param")).forEach((e) => {
3500
+ Gr(e, ["name", "value"]);
3501
+ let n = e.getAttribute("name"), r = e.getAttribute("value");
3502
+ !n || !r || (n in Kn && typeof Kn[n] == "boolean" ? t[n] = r !== "false" : n in Kn && typeof Kn[n] == "object" ? t[n] = JSON.parse(r) : t[n] = r);
3503
+ }), t;
3504
+ }, Rr = (e) => {
3505
+ let t = {};
3506
+ return Array.from(e.querySelectorAll("swal-function-param")).forEach((e) => {
3507
+ let n = e.getAttribute("name"), r = e.getAttribute("value");
3508
+ !n || !r || (t[n] = Function(`return ${r}`)());
3509
+ }), t;
3510
+ }, zr = (e) => {
3511
+ let t = {};
3512
+ return Array.from(e.querySelectorAll("swal-button")).forEach((e) => {
3513
+ Gr(e, [
3514
+ "type",
3515
+ "color",
3516
+ "aria-label"
3517
+ ]);
3518
+ let n = e.getAttribute("type");
3519
+ if (!n || ![
3520
+ "confirm",
3521
+ "cancel",
3522
+ "deny"
3523
+ ].includes(n)) return;
3524
+ t[`${n}ButtonText`] = e.innerHTML, t[`show${f(n)}Button`] = !0;
3525
+ let r = e.getAttribute("color");
3526
+ r !== null && (t[`${n}ButtonColor`] = r);
3527
+ let i = e.getAttribute("aria-label");
3528
+ i !== null && (t[`${n}ButtonAriaLabel`] = i);
3529
+ }), t;
3530
+ }, Br = (e) => {
3531
+ let t = {}, n = e.querySelector("swal-image");
3532
+ if (n) {
3533
+ Gr(n, [
3534
+ "src",
3535
+ "width",
3536
+ "height",
3537
+ "alt"
3538
+ ]);
3539
+ let e = n.getAttribute("src");
3540
+ e !== null && (t.imageUrl = e || void 0);
3541
+ let r = n.getAttribute("width");
3542
+ r !== null && (t.imageWidth = r || void 0);
3543
+ let i = n.getAttribute("height");
3544
+ i !== null && (t.imageHeight = i || void 0);
3545
+ let a = n.getAttribute("alt");
3546
+ a !== null && (t.imageAlt = a || void 0);
3547
+ }
3548
+ return t;
3549
+ }, Vr = (e) => {
3550
+ let t = {}, n = e.querySelector("swal-icon");
3551
+ return n && (Gr(n, ["type", "color"]), n.hasAttribute("type") && (t.icon = n.getAttribute("type")), n.hasAttribute("color") && (t.iconColor = n.getAttribute("color")), t.iconHtml = n.innerHTML), t;
3552
+ }, Hr = (e) => {
3553
+ let t = {}, n = e.querySelector("swal-input");
3554
+ n && (Gr(n, [
3555
+ "type",
3556
+ "label",
3557
+ "placeholder",
3558
+ "value"
3559
+ ]), t.input = n.getAttribute("type") || "text", n.hasAttribute("label") && (t.inputLabel = n.getAttribute("label")), n.hasAttribute("placeholder") && (t.inputPlaceholder = n.getAttribute("placeholder")), n.hasAttribute("value") && (t.inputValue = n.getAttribute("value")));
3560
+ let r = Array.from(e.querySelectorAll("swal-input-option"));
3561
+ return r.length && (t.inputOptions = {}, r.forEach((e) => {
3562
+ Gr(e, ["value"]);
3563
+ let n = e.getAttribute("value");
3564
+ if (!n) return;
3565
+ let r = e.innerHTML;
3566
+ t.inputOptions[n] = r;
3567
+ })), t;
3568
+ }, Ur = (e, t) => {
3569
+ let n = {};
3570
+ for (let r in t) {
3571
+ let i = t[r], a = e.querySelector(i);
3572
+ a && (Gr(a, []), n[i.replace(/^swal-/, "")] = a.innerHTML.trim());
3573
+ }
3574
+ return n;
3575
+ }, Wr = (e) => {
3576
+ let t = Fr.concat([
3577
+ "swal-param",
3578
+ "swal-function-param",
3579
+ "swal-button",
3580
+ "swal-image",
3581
+ "swal-icon",
3582
+ "swal-input",
3583
+ "swal-input-option"
3584
+ ]);
3585
+ Array.from(e.children).forEach((e) => {
3586
+ let n = e.tagName.toLowerCase();
3587
+ t.includes(n) || p(`Unrecognized element <${n}>`);
3588
+ });
3589
+ }, Gr = (e, t) => {
3590
+ Array.from(e.attributes).forEach((n) => {
3591
+ t.indexOf(n.name) === -1 && p([`Unrecognized attribute "${n.name}" on <${e.tagName.toLowerCase()}>.`, `${t.length ? `Allowed attributes are: ${t.join(", ")}` : "To set the value, use HTML within the element."}`]);
3592
+ });
3593
+ }, Kr = (e) => {
3594
+ var t, n;
3595
+ let r = C(), i = E();
3596
+ if (!r || !i) return;
3597
+ typeof e.willOpen == "function" && e.willOpen(i), (t = a.eventEmitter) == null || t.emit("willOpen", i);
3598
+ let o = window.getComputedStyle(document.body).overflowY;
3599
+ if (Xr(r, i, e), setTimeout(() => {
3600
+ Jr(r, i);
3601
+ }, 10), fe() && (Yr(r, e.scrollbarPadding !== void 0 && e.scrollbarPadding, o), Ut()), Kt && e.backdrop === !1 && i.scrollHeight > r.clientHeight && (r.style.pointerEvents = "auto"), !pe() && !a.previousActiveElement && (a.previousActiveElement = document.activeElement), typeof e.didOpen == "function") {
3602
+ let t = e.didOpen;
3603
+ setTimeout(() => t(i));
3604
+ }
3605
+ (n = a.eventEmitter) == null || n.emit("didOpen", i);
3606
+ }, qr = (e) => {
3607
+ let t = E();
3608
+ if (!t || e.target !== t) return;
3609
+ let n = C();
3610
+ n && (t.removeEventListener("animationend", qr), t.removeEventListener("transitionend", qr), n.style.overflowY = "auto", I(n, l["no-transition"]));
3611
+ }, Jr = (e, t) => {
3612
+ we(t) ? (e.style.overflowY = "hidden", t.addEventListener("animationend", qr), t.addEventListener("transitionend", qr)) : e.style.overflowY = "auto";
3613
+ }, Yr = (e, t, n) => {
3614
+ qt(), t && n !== "hidden" && tn(n), setTimeout(() => {
3615
+ e.scrollTop = 0;
3616
+ });
3617
+ }, Xr = (e, t, n) => {
3618
+ var r;
3619
+ (r = n.showClass) != null && r.backdrop && F(e, n.showClass.backdrop), n.animation ? (t.style.setProperty("opacity", "0", "important"), R(t, "grid"), setTimeout(() => {
3620
+ var e;
3621
+ (e = n.showClass) != null && e.popup && F(t, n.showClass.popup), t.style.removeProperty("opacity");
3622
+ }, 10)) : R(t, "grid"), F([document.documentElement, document.body], l.shown), n.heightAuto && n.backdrop && !n.toast && F([document.documentElement, document.body], l["height-auto"]);
3623
+ };
3624
+ var Zr = {
3625
+ email: (e, t) => /^[a-zA-Z0-9.+_'-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]+$/.test(e) ? Promise.resolve() : Promise.resolve(t || "Invalid email address"),
3626
+ url: (e, t) => /^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/.test(e) ? Promise.resolve() : Promise.resolve(t || "Invalid URL")
3627
+ };
3628
+ function Qr(e) {
3629
+ e.inputValidator || (e.input === "email" && (e.inputValidator = Zr.email), e.input === "url" && (e.inputValidator = Zr.url));
3630
+ }
3631
+ function $r(e) {
3632
+ (!e.target || typeof e.target == "string" && !document.querySelector(e.target) || typeof e.target != "string" && !e.target.appendChild) && (p("Target parameter is not valid, defaulting to \"body\""), e.target = "body");
3633
+ }
3634
+ function ei(e) {
3635
+ Qr(e), e.showLoaderOnConfirm && !e.preConfirm && p("showLoaderOnConfirm is set to true, but preConfirm is not defined.\nshowLoaderOnConfirm should be used together with preConfirm, see usage example:\nhttps://sweetalert2.github.io/#ajax-request"), $r(e), typeof e.title == "string" && (e.title = e.title.split("\n").join("<br />")), Me(e);
3636
+ }
3637
+ let Q;
3638
+ var ti = /*#__PURE__*/ new WeakMap();
3639
+ class $ {
3640
+ constructor(...e) {
3641
+ if (r(this, ti, Promise.resolve({
3642
+ isConfirmed: !1,
3643
+ isDenied: !1,
3644
+ isDismissed: !0
3645
+ })), typeof window > "u") return;
3646
+ Q = this;
3647
+ let t = Object.freeze(this.constructor.argsToParams(e));
3648
+ this.params = t, this.isAwaitingPromise = !1, i(ti, this, this._main(Q.params));
3649
+ }
3650
+ _main(e, t = {}) {
3651
+ if (nr(Object.assign({}, t, e)), a.currentInstance) {
3652
+ let e = X.swalPromiseResolve.get(a.currentInstance), { isAwaitingPromise: t } = a.currentInstance;
3653
+ a.currentInstance._destroy(), t || e({ isDismissed: !0 }), fe() && Wt();
3654
+ }
3655
+ a.currentInstance = Q;
3656
+ let n = ri(e, t);
3657
+ ei(n), Object.freeze(n), a.timeout && (a.timeout.stop(), delete a.timeout), clearTimeout(a.restoreFocusTimeout);
3658
+ let r = ii(Q);
3659
+ return Dt(Q, n), K.innerParams.set(Q, n), ni(Q, r, n);
3660
+ }
3661
+ then(e) {
3662
+ return n(ti, this).then(e);
3663
+ }
3664
+ finally(e) {
3665
+ return n(ti, this).finally(e);
3666
+ }
3667
+ }
3668
+ let ni = (e, t, n) => new Promise((r, i) => {
3669
+ let o = (t) => {
3670
+ e.close({
3671
+ isDismissed: !0,
3672
+ dismiss: t,
3673
+ isConfirmed: !1,
3674
+ isDenied: !1
3675
+ });
3676
+ };
3677
+ X.swalPromiseResolve.set(e, r), X.swalPromiseReject.set(e, i), t.confirmButton.onclick = () => {
3678
+ En(e);
3679
+ }, t.denyButton.onclick = () => {
3680
+ Dn(e);
3681
+ }, t.cancelButton.onclick = () => {
3682
+ On(e, o);
3683
+ }, t.closeButton.onclick = () => {
3684
+ o(Mt.close);
3685
+ }, ur(n, t, o), Pt(a, n, o), hn(e, n), Kr(n), ai(a, n, o), oi(t, n), setTimeout(() => {
3686
+ t.container.scrollTop = 0;
3687
+ });
3688
+ }), ri = (e, t) => {
3689
+ let n = Ir(e), r = Object.assign({}, Kn, t, n, e);
3690
+ return r.showClass = Object.assign({}, Kn.showClass, r.showClass), r.hideClass = Object.assign({}, Kn.hideClass, r.hideClass), r.animation === !1 && (r.showClass = { backdrop: "swal2-noanimation" }, r.hideClass = {}), r;
3691
+ }, ii = (e) => {
3692
+ let t = {
3693
+ popup: E(),
3694
+ container: C(),
3695
+ actions: se(),
3696
+ confirmButton: A(),
3697
+ denyButton: j(),
3698
+ cancelButton: ie(),
3699
+ loader: oe(),
3700
+ closeButton: ue(),
3701
+ validationMessage: k(),
3702
+ progressSteps: re()
3703
+ };
3704
+ return K.domCache.set(e, t), t;
3705
+ }, ai = (e, t, n) => {
3706
+ let r = le();
3707
+ z(r), t.timer && (e.timeout = new Pr(() => {
3708
+ n("timer"), delete e.timeout;
3709
+ }, t.timer), t.timerProgressBar && r && (R(r), P(r, t, "timerProgressBar"), setTimeout(() => {
3710
+ e.timeout && e.timeout.running && Te(t.timer);
3711
+ })));
3712
+ }, oi = (e, t) => {
3713
+ if (!t.toast) {
3714
+ if (!v(t.allowEnterKey)) {
3715
+ _("allowEnterKey", "preConfirm: () => false"), e.popup.focus();
3716
+ return;
3717
+ }
3718
+ si(e) || ci(e, t) || Ft(-1, 1);
3719
+ }
3720
+ }, si = (e) => {
3721
+ let t = Array.from(e.popup.querySelectorAll("[autofocus]"));
3722
+ for (let e of t) if (e instanceof HTMLElement && V(e)) return e.focus(), !0;
3723
+ return !1;
3724
+ }, ci = (e, t) => t.focusDeny && V(e.denyButton) ? (e.denyButton.focus(), !0) : t.focusCancel && V(e.cancelButton) ? (e.cancelButton.focus(), !0) : t.focusConfirm && V(e.confirmButton) ? (e.confirmButton.focus(), !0) : !1;
3725
+ $.prototype.disableButtons = Vn, $.prototype.enableButtons = Bn, $.prototype.getInput = Ln, $.prototype.disableInput = Un, $.prototype.enableInput = Hn, $.prototype.hideLoading = Fn, $.prototype.disableLoading = Fn, $.prototype.showValidationMessage = Wn, $.prototype.resetValidationMessage = Gn, $.prototype.close = Z, $.prototype.closePopup = Z, $.prototype.closeModal = Z, $.prototype.closeToast = Z, $.prototype.rejectPromise = sn, $.prototype.update = rr, $.prototype._destroy = ar, Object.assign($, Nr), Object.keys(lr).forEach((e) => {
3726
+ $[e] = function(...t) {
3727
+ if (Q && Q[e]) return Q[e](...t);
3728
+ };
3729
+ }), $.DismissReason = Mt, $.version = "11.26.25";
3730
+ let li = $;
3731
+ return li.default = li, li;
3732
+ })), e !== void 0 && e.Sweetalert2 && (e.swal = e.sweetAlert = e.Swal = e.SweetAlert = e.Sweetalert2), typeof document < "u" && function(e, t) {
3733
+ var n = e.createElement("style");
3734
+ if (e.getElementsByTagName("head")[0].appendChild(n), n.styleSheet) n.styleSheet.disabled || (n.styleSheet.cssText = t);
3735
+ else try {
3736
+ n.innerHTML = t;
3737
+ } catch {
3738
+ n.innerText = t;
3739
+ }
3740
+ }(document, ":root{--swal2-outline: 0 0 0 3px rgba(100, 150, 200, 0.5);--swal2-container-padding: 0.625em;--swal2-backdrop: rgba(0, 0, 0, 0.4);--swal2-backdrop-transition: background-color 0.15s;--swal2-width: 32em;--swal2-padding: 0 0 1.25em;--swal2-border: none;--swal2-border-radius: 0.3125rem;--swal2-background: white;--swal2-color: #545454;--swal2-show-animation: swal2-show 0.3s;--swal2-hide-animation: swal2-hide 0.15s forwards;--swal2-icon-zoom: 1;--swal2-title-padding: 0.8em 1em 0;--swal2-html-container-padding: 1em 1.6em 0.3em;--swal2-input-border: 1px solid #d9d9d9;--swal2-input-border-radius: 0.1875em;--swal2-input-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.06), 0 0 0 3px transparent;--swal2-input-background: transparent;--swal2-input-transition: border-color 0.2s, box-shadow 0.2s;--swal2-input-hover-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.06), 0 0 0 3px transparent;--swal2-input-focus-border: 1px solid #b4dbed;--swal2-input-focus-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.06), 0 0 0 3px rgba(100, 150, 200, 0.5);--swal2-progress-step-background: #add8e6;--swal2-validation-message-background: #f0f0f0;--swal2-validation-message-color: #666;--swal2-footer-border-color: #eee;--swal2-footer-background: transparent;--swal2-footer-color: inherit;--swal2-timer-progress-bar-background: rgba(0, 0, 0, 0.3);--swal2-close-button-position: initial;--swal2-close-button-inset: auto;--swal2-close-button-font-size: 2.5em;--swal2-close-button-color: #ccc;--swal2-close-button-transition: color 0.2s, box-shadow 0.2s;--swal2-close-button-outline: initial;--swal2-close-button-box-shadow: inset 0 0 0 3px transparent;--swal2-close-button-focus-box-shadow: inset var(--swal2-outline);--swal2-close-button-hover-transform: none;--swal2-actions-justify-content: center;--swal2-actions-width: auto;--swal2-actions-margin: 1.25em auto 0;--swal2-actions-padding: 0;--swal2-actions-border-radius: 0;--swal2-actions-background: transparent;--swal2-action-button-transition: background-color 0.2s, box-shadow 0.2s;--swal2-action-button-hover: black 10%;--swal2-action-button-active: black 10%;--swal2-confirm-button-box-shadow: none;--swal2-confirm-button-border-radius: 0.25em;--swal2-confirm-button-background-color: #7066e0;--swal2-confirm-button-color: #fff;--swal2-deny-button-box-shadow: none;--swal2-deny-button-border-radius: 0.25em;--swal2-deny-button-background-color: #dc3741;--swal2-deny-button-color: #fff;--swal2-cancel-button-box-shadow: none;--swal2-cancel-button-border-radius: 0.25em;--swal2-cancel-button-background-color: #6e7881;--swal2-cancel-button-color: #fff;--swal2-toast-show-animation: swal2-toast-show 0.5s;--swal2-toast-hide-animation: swal2-toast-hide 0.1s forwards;--swal2-toast-border: none;--swal2-toast-box-shadow: 0 0 1px hsl(0deg 0% 0% / 0.075), 0 1px 2px hsl(0deg 0% 0% / 0.075), 1px 2px 4px hsl(0deg 0% 0% / 0.075), 1px 3px 8px hsl(0deg 0% 0% / 0.075), 2px 4px 16px hsl(0deg 0% 0% / 0.075)}[data-swal2-theme=dark]{--swal2-dark-theme-black: #19191a;--swal2-dark-theme-white: #e1e1e1;--swal2-background: var(--swal2-dark-theme-black);--swal2-color: var(--swal2-dark-theme-white);--swal2-footer-border-color: #555;--swal2-input-background: color-mix(in srgb, var(--swal2-dark-theme-black), var(--swal2-dark-theme-white) 10%);--swal2-validation-message-background: color-mix( in srgb, var(--swal2-dark-theme-black), var(--swal2-dark-theme-white) 10% );--swal2-validation-message-color: var(--swal2-dark-theme-white);--swal2-timer-progress-bar-background: rgba(255, 255, 255, 0.7)}@media(prefers-color-scheme: dark){[data-swal2-theme=auto]{--swal2-dark-theme-black: #19191a;--swal2-dark-theme-white: #e1e1e1;--swal2-background: var(--swal2-dark-theme-black);--swal2-color: var(--swal2-dark-theme-white);--swal2-footer-border-color: #555;--swal2-input-background: color-mix(in srgb, var(--swal2-dark-theme-black), var(--swal2-dark-theme-white) 10%);--swal2-validation-message-background: color-mix( in srgb, var(--swal2-dark-theme-black), var(--swal2-dark-theme-white) 10% );--swal2-validation-message-color: var(--swal2-dark-theme-white);--swal2-timer-progress-bar-background: rgba(255, 255, 255, 0.7)}}body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto !important}body.swal2-no-backdrop .swal2-container{background-color:rgba(0,0,0,0) !important;pointer-events:none}body.swal2-no-backdrop .swal2-container .swal2-popup{pointer-events:auto}body.swal2-no-backdrop .swal2-container .swal2-modal{box-shadow:0 0 10px var(--swal2-backdrop)}body.swal2-toast-shown .swal2-container{box-sizing:border-box;width:360px;max-width:100%;background-color:rgba(0,0,0,0);pointer-events:none}body.swal2-toast-shown .swal2-container.swal2-top{inset:0 auto auto 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{inset:0 0 auto auto}body.swal2-toast-shown .swal2-container.swal2-top-start,body.swal2-toast-shown .swal2-container.swal2-top-left{inset:0 auto auto 0}body.swal2-toast-shown .swal2-container.swal2-center-start,body.swal2-toast-shown .swal2-container.swal2-center-left{inset:50% auto auto 0;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{inset:50% auto auto 50%;transform:translate(-50%, -50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{inset:50% 0 auto auto;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-start,body.swal2-toast-shown .swal2-container.swal2-bottom-left{inset:auto auto 0 0}body.swal2-toast-shown .swal2-container.swal2-bottom{inset:auto auto 0 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{inset:auto 0 0 auto}@media print{body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown){overflow-y:scroll !important}body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown) .swal2-container{position:static !important}}div:where(.swal2-container){display:grid;position:fixed;z-index:1060;inset:0;box-sizing:border-box;grid-template-areas:\"top-start top top-end\" \"center-start center center-end\" \"bottom-start bottom-center bottom-end\";grid-template-rows:minmax(min-content, auto) minmax(min-content, auto) minmax(min-content, auto);height:100%;padding:var(--swal2-container-padding);overflow-x:hidden;transition:var(--swal2-backdrop-transition);-webkit-overflow-scrolling:touch}div:where(.swal2-container).swal2-backdrop-show,div:where(.swal2-container).swal2-noanimation{background:var(--swal2-backdrop)}div:where(.swal2-container).swal2-backdrop-hide{background:rgba(0,0,0,0) !important}div:where(.swal2-container).swal2-top-start,div:where(.swal2-container).swal2-center-start,div:where(.swal2-container).swal2-bottom-start{grid-template-columns:minmax(0, 1fr) auto auto}div:where(.swal2-container).swal2-top,div:where(.swal2-container).swal2-center,div:where(.swal2-container).swal2-bottom{grid-template-columns:auto minmax(0, 1fr) auto}div:where(.swal2-container).swal2-top-end,div:where(.swal2-container).swal2-center-end,div:where(.swal2-container).swal2-bottom-end{grid-template-columns:auto auto minmax(0, 1fr)}div:where(.swal2-container).swal2-top-start>.swal2-popup{align-self:start}div:where(.swal2-container).swal2-top>.swal2-popup{grid-column:2;place-self:start center}div:where(.swal2-container).swal2-top-end>.swal2-popup,div:where(.swal2-container).swal2-top-right>.swal2-popup{grid-column:3;place-self:start end}div:where(.swal2-container).swal2-center-start>.swal2-popup,div:where(.swal2-container).swal2-center-left>.swal2-popup{grid-row:2;align-self:center}div:where(.swal2-container).swal2-center>.swal2-popup{grid-column:2;grid-row:2;place-self:center center}div:where(.swal2-container).swal2-center-end>.swal2-popup,div:where(.swal2-container).swal2-center-right>.swal2-popup{grid-column:3;grid-row:2;place-self:center end}div:where(.swal2-container).swal2-bottom-start>.swal2-popup,div:where(.swal2-container).swal2-bottom-left>.swal2-popup{grid-column:1;grid-row:3;align-self:end}div:where(.swal2-container).swal2-bottom>.swal2-popup{grid-column:2;grid-row:3;place-self:end center}div:where(.swal2-container).swal2-bottom-end>.swal2-popup,div:where(.swal2-container).swal2-bottom-right>.swal2-popup{grid-column:3;grid-row:3;place-self:end end}div:where(.swal2-container).swal2-grow-row>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-column:1/4;width:100%}div:where(.swal2-container).swal2-grow-column>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-row:1/4;align-self:stretch}div:where(.swal2-container).swal2-no-transition{transition:none !important}div:where(.swal2-container)[popover]{width:auto;border:0}div:where(.swal2-container) div:where(.swal2-popup){display:none;position:relative;box-sizing:border-box;grid-template-columns:minmax(0, 100%);width:var(--swal2-width);max-width:100%;padding:var(--swal2-padding);border:var(--swal2-border);border-radius:var(--swal2-border-radius);background:var(--swal2-background);color:var(--swal2-color);font-family:inherit;font-size:1rem}div:where(.swal2-container) div:where(.swal2-popup):focus{outline:none}div:where(.swal2-container) div:where(.swal2-popup).swal2-loading{overflow-y:hidden}div:where(.swal2-container) div:where(.swal2-popup).swal2-draggable{cursor:grab}div:where(.swal2-container) div:where(.swal2-popup).swal2-draggable div:where(.swal2-icon){cursor:grab}div:where(.swal2-container) div:where(.swal2-popup).swal2-dragging{cursor:grabbing}div:where(.swal2-container) div:where(.swal2-popup).swal2-dragging div:where(.swal2-icon){cursor:grabbing}div:where(.swal2-container) h2:where(.swal2-title){position:relative;max-width:100%;margin:0;padding:var(--swal2-title-padding);color:inherit;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;overflow-wrap:break-word;cursor:initial}div:where(.swal2-container) div:where(.swal2-actions){display:flex;z-index:1;box-sizing:border-box;flex-wrap:wrap;align-items:center;justify-content:var(--swal2-actions-justify-content);width:var(--swal2-actions-width);margin:var(--swal2-actions-margin);padding:var(--swal2-actions-padding);border-radius:var(--swal2-actions-border-radius);background:var(--swal2-actions-background)}div:where(.swal2-container) div:where(.swal2-loader){display:none;align-items:center;justify-content:center;width:2.2em;height:2.2em;margin:0 1.875em;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border-width:.25em;border-style:solid;border-radius:100%;border-color:#2778c4 rgba(0,0,0,0) #2778c4 rgba(0,0,0,0)}div:where(.swal2-container) button:where(.swal2-styled){margin:.3125em;padding:.625em 1.1em;transition:var(--swal2-action-button-transition);border:none;box-shadow:0 0 0 3px rgba(0,0,0,0);font-weight:500}div:where(.swal2-container) button:where(.swal2-styled):not([disabled]){cursor:pointer}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm){border-radius:var(--swal2-confirm-button-border-radius);background:initial;background-color:var(--swal2-confirm-button-background-color);box-shadow:var(--swal2-confirm-button-box-shadow);color:var(--swal2-confirm-button-color);font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm):hover{background-color:color-mix(in srgb, var(--swal2-confirm-button-background-color), var(--swal2-action-button-hover))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm):active{background-color:color-mix(in srgb, var(--swal2-confirm-button-background-color), var(--swal2-action-button-active))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny){border-radius:var(--swal2-deny-button-border-radius);background:initial;background-color:var(--swal2-deny-button-background-color);box-shadow:var(--swal2-deny-button-box-shadow);color:var(--swal2-deny-button-color);font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny):hover{background-color:color-mix(in srgb, var(--swal2-deny-button-background-color), var(--swal2-action-button-hover))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny):active{background-color:color-mix(in srgb, var(--swal2-deny-button-background-color), var(--swal2-action-button-active))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel){border-radius:var(--swal2-cancel-button-border-radius);background:initial;background-color:var(--swal2-cancel-button-background-color);box-shadow:var(--swal2-cancel-button-box-shadow);color:var(--swal2-cancel-button-color);font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel):hover{background-color:color-mix(in srgb, var(--swal2-cancel-button-background-color), var(--swal2-action-button-hover))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel):active{background-color:color-mix(in srgb, var(--swal2-cancel-button-background-color), var(--swal2-action-button-active))}div:where(.swal2-container) button:where(.swal2-styled):focus-visible{outline:none;box-shadow:var(--swal2-action-button-focus-box-shadow)}div:where(.swal2-container) button:where(.swal2-styled)[disabled]:not(.swal2-loading){opacity:.4}div:where(.swal2-container) button:where(.swal2-styled)::-moz-focus-inner{border:0}div:where(.swal2-container) div:where(.swal2-footer){margin:1em 0 0;padding:1em 1em 0;border-top:1px solid var(--swal2-footer-border-color);background:var(--swal2-footer-background);color:var(--swal2-footer-color);font-size:1em;text-align:center;cursor:initial}div:where(.swal2-container) .swal2-timer-progress-bar-container{position:absolute;right:0;bottom:0;left:0;grid-column:auto !important;overflow:hidden;border-bottom-right-radius:var(--swal2-border-radius);border-bottom-left-radius:var(--swal2-border-radius)}div:where(.swal2-container) div:where(.swal2-timer-progress-bar){width:100%;height:.25em;background:var(--swal2-timer-progress-bar-background)}div:where(.swal2-container) img:where(.swal2-image){max-width:100%;margin:2em auto 1em;cursor:initial}div:where(.swal2-container) button:where(.swal2-close){position:var(--swal2-close-button-position);inset:var(--swal2-close-button-inset);z-index:2;align-items:center;justify-content:center;width:1.2em;height:1.2em;margin-top:0;margin-right:0;margin-bottom:-1.2em;padding:0;overflow:hidden;transition:var(--swal2-close-button-transition);border:none;border-radius:var(--swal2-border-radius);outline:var(--swal2-close-button-outline);background:rgba(0,0,0,0);color:var(--swal2-close-button-color);font-family:monospace;font-size:var(--swal2-close-button-font-size);cursor:pointer;justify-self:end}div:where(.swal2-container) button:where(.swal2-close):hover{transform:var(--swal2-close-button-hover-transform);background:rgba(0,0,0,0);color:#f27474}div:where(.swal2-container) button:where(.swal2-close):focus-visible{outline:none;box-shadow:var(--swal2-close-button-focus-box-shadow)}div:where(.swal2-container) button:where(.swal2-close)::-moz-focus-inner{border:0}div:where(.swal2-container) div:where(.swal2-html-container){z-index:1;justify-content:center;margin:0;padding:var(--swal2-html-container-padding);overflow:auto;color:inherit;font-size:1.125em;font-weight:normal;line-height:normal;text-align:center;overflow-wrap:break-word;word-break:break-word;cursor:initial}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea),div:where(.swal2-container) select:where(.swal2-select),div:where(.swal2-container) div:where(.swal2-radio),div:where(.swal2-container) label:where(.swal2-checkbox){margin:1em 2em 3px}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea){box-sizing:border-box;width:auto;transition:var(--swal2-input-transition);border:var(--swal2-input-border);border-radius:var(--swal2-input-border-radius);background:var(--swal2-input-background);box-shadow:var(--swal2-input-box-shadow);color:inherit;font-size:1.125em}div:where(.swal2-container) input:where(.swal2-input).swal2-inputerror,div:where(.swal2-container) input:where(.swal2-file).swal2-inputerror,div:where(.swal2-container) textarea:where(.swal2-textarea).swal2-inputerror{border-color:#f27474 !important;box-shadow:0 0 2px #f27474 !important}div:where(.swal2-container) input:where(.swal2-input):hover,div:where(.swal2-container) input:where(.swal2-file):hover,div:where(.swal2-container) textarea:where(.swal2-textarea):hover{box-shadow:var(--swal2-input-hover-box-shadow)}div:where(.swal2-container) input:where(.swal2-input):focus,div:where(.swal2-container) input:where(.swal2-file):focus,div:where(.swal2-container) textarea:where(.swal2-textarea):focus{border:var(--swal2-input-focus-border);outline:none;box-shadow:var(--swal2-input-focus-box-shadow)}div:where(.swal2-container) input:where(.swal2-input)::placeholder,div:where(.swal2-container) input:where(.swal2-file)::placeholder,div:where(.swal2-container) textarea:where(.swal2-textarea)::placeholder{color:#ccc}div:where(.swal2-container) .swal2-range{margin:1em 2em 3px;background:var(--swal2-background)}div:where(.swal2-container) .swal2-range input{width:80%}div:where(.swal2-container) .swal2-range output{width:20%;color:inherit;font-weight:600;text-align:center}div:where(.swal2-container) .swal2-range input,div:where(.swal2-container) .swal2-range output{height:2.625em;padding:0;font-size:1.125em;line-height:2.625em}div:where(.swal2-container) .swal2-input{height:2.625em;padding:0 .75em}div:where(.swal2-container) .swal2-file{width:75%;margin-right:auto;margin-left:auto;background:var(--swal2-input-background);font-size:1.125em}div:where(.swal2-container) .swal2-textarea{height:6.75em;padding:.75em}div:where(.swal2-container) .swal2-select{min-width:50%;max-width:100%;padding:.375em .625em;background:var(--swal2-input-background);color:inherit;font-size:1.125em}div:where(.swal2-container) .swal2-radio,div:where(.swal2-container) .swal2-checkbox{align-items:center;justify-content:center;background:var(--swal2-background);color:inherit}div:where(.swal2-container) .swal2-radio label,div:where(.swal2-container) .swal2-checkbox label{margin:0 .6em;font-size:1.125em}div:where(.swal2-container) .swal2-radio input,div:where(.swal2-container) .swal2-checkbox input{flex-shrink:0;margin:0 .4em}div:where(.swal2-container) label:where(.swal2-input-label){display:flex;justify-content:center;margin:1em auto 0}div:where(.swal2-container) div:where(.swal2-validation-message){align-items:center;justify-content:center;margin:1em 0 0;padding:.625em;overflow:hidden;background:var(--swal2-validation-message-background);color:var(--swal2-validation-message-color);font-size:1em;font-weight:300}div:where(.swal2-container) div:where(.swal2-validation-message)::before{content:\"!\";display:inline-block;width:1.5em;min-width:1.5em;height:1.5em;margin:0 .625em;border-radius:50%;background-color:#f27474;color:#fff;font-weight:600;line-height:1.5em;text-align:center}div:where(.swal2-container) .swal2-progress-steps{flex-wrap:wrap;align-items:center;max-width:100%;margin:1.25em auto;padding:0;background:rgba(0,0,0,0);font-weight:600}div:where(.swal2-container) .swal2-progress-steps li{display:inline-block;position:relative}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step{z-index:20;flex-shrink:0;width:2em;height:2em;border-radius:2em;background:#2778c4;color:#fff;line-height:2em;text-align:center}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:#2778c4}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step{background:var(--swal2-progress-step-background);color:#fff}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step-line{background:var(--swal2-progress-step-background)}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step-line{z-index:10;flex-shrink:0;width:2.5em;height:.4em;margin:0 -1px;background:#2778c4}div:where(.swal2-icon){position:relative;box-sizing:content-box;justify-content:center;width:5em;height:5em;margin:2.5em auto .6em;zoom:var(--swal2-icon-zoom);border:.25em solid rgba(0,0,0,0);border-radius:50%;border-color:#000;font-family:inherit;line-height:5em;cursor:default;user-select:none}div:where(.swal2-icon) .swal2-icon-content{display:flex;align-items:center;font-size:3.75em}div:where(.swal2-icon).swal2-error{border-color:#f27474;color:#f27474}div:where(.swal2-icon).swal2-error .swal2-x-mark{position:relative;flex-grow:1}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line]{display:block;position:absolute;top:2.3125em;width:2.9375em;height:.3125em;border-radius:.125em;background-color:#f27474}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-error.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-error.swal2-icon-show .swal2-x-mark{animation:swal2-animate-error-x-mark .5s}div:where(.swal2-icon).swal2-warning{border-color:#f8bb86;color:#f8bb86}div:where(.swal2-icon).swal2-warning.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-warning.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .5s}div:where(.swal2-icon).swal2-info{border-color:#3fc3ee;color:#3fc3ee}div:where(.swal2-icon).swal2-info.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-info.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .8s}div:where(.swal2-icon).swal2-question{border-color:#87adbd;color:#87adbd}div:where(.swal2-icon).swal2-question.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-question.swal2-icon-show .swal2-icon-content{animation:swal2-animate-question-mark .8s}div:where(.swal2-icon).swal2-success{border-color:#a5dc86;color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line]{position:absolute;width:3.75em;height:7.5em;border-radius:50%}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.4375em;left:-2.0635em;transform:rotate(-45deg);transform-origin:3.75em 3.75em;border-radius:7.5em 0 0 7.5em}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.6875em;left:1.875em;transform:rotate(-45deg);transform-origin:0 3.75em;border-radius:0 7.5em 7.5em 0}div:where(.swal2-icon).swal2-success .swal2-success-ring{position:absolute;z-index:2;top:-0.25em;left:-0.25em;box-sizing:content-box;width:100%;height:100%;border:.25em solid rgba(165,220,134,.3);border-radius:50%}div:where(.swal2-icon).swal2-success .swal2-success-fix{position:absolute;z-index:1;top:.5em;left:1.625em;width:.4375em;height:5.625em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line]{display:block;position:absolute;z-index:2;height:.3125em;border-radius:.125em;background-color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=tip]{top:2.875em;left:.8125em;width:1.5625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=long]{top:2.375em;right:.5em;width:2.9375em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-animate-success-line-tip .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-animate-success-line-long .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-circular-line-right{animation:swal2-rotate-success-circular-line 4.25s ease-in}[class^=swal2]{-webkit-tap-highlight-color:rgba(0,0,0,0)}.swal2-show{animation:var(--swal2-show-animation)}.swal2-hide{animation:var(--swal2-hide-animation)}.swal2-noanimation{transition:none}.swal2-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}.swal2-rtl .swal2-close{margin-right:initial;margin-left:0}.swal2-rtl .swal2-timer-progress-bar{right:0;left:auto}.swal2-toast{box-sizing:border-box;grid-column:1/4 !important;grid-row:1/4 !important;grid-template-columns:min-content auto min-content;padding:1em;overflow-y:hidden;border:var(--swal2-toast-border);background:var(--swal2-background);box-shadow:var(--swal2-toast-box-shadow);pointer-events:auto}.swal2-toast>*{grid-column:2}.swal2-toast h2:where(.swal2-title){margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-toast .swal2-loading{justify-content:center}.swal2-toast input:where(.swal2-input){height:2em;margin:.5em;font-size:1em}.swal2-toast .swal2-validation-message{font-size:1em}.swal2-toast div:where(.swal2-footer){margin:.5em 0 0;padding:.5em 0 0;font-size:.8em}.swal2-toast button:where(.swal2-close){grid-column:3/3;grid-row:1/99;align-self:center;width:.8em;height:.8em;margin:0;font-size:2em}.swal2-toast div:where(.swal2-html-container){margin:.5em 1em;padding:0;overflow:initial;font-size:1em;text-align:initial}.swal2-toast div:where(.swal2-html-container):empty{padding:0}.swal2-toast .swal2-loader{grid-column:1;grid-row:1/99;align-self:center;width:2em;height:2em;margin:.25em}.swal2-toast .swal2-icon{grid-column:1;grid-row:1/99;align-self:center;width:2em;min-width:2em;height:2em;margin:0 .5em 0 0}.swal2-toast .swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:1.8em;font-weight:bold}.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-toast div:where(.swal2-actions){justify-content:flex-start;height:auto;margin:0;margin-top:.5em;padding:0 .5em}.swal2-toast button:where(.swal2-styled){margin:.25em .5em;padding:.4em .6em;font-size:1em}.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-toast .swal2-success [class^=swal2-success-circular-line]{position:absolute;width:1.6em;height:3em;border-radius:50%}.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.8em;left:-0.5em;transform:rotate(-45deg);transform-origin:2em 2em;border-radius:4em 0 0 4em}.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.25em;left:.9375em;transform-origin:0 1.5em;border-radius:0 4em 4em 0}.swal2-toast .swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-toast .swal2-success .swal2-success-fix{top:0;left:.4375em;width:.4375em;height:2.6875em}.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{top:1.125em;left:.1875em;width:.75em}.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{top:.9375em;right:.1875em;width:1.375em}.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-toast-animate-success-line-tip .75s}.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-toast-animate-success-line-long .75s}.swal2-toast.swal2-show{animation:var(--swal2-toast-show-animation)}.swal2-toast.swal2-hide{animation:var(--swal2-toast-hide-animation)}@keyframes swal2-show{0%{transform:translate3d(0, -50px, 0) scale(0.9);opacity:0}100%{transform:translate3d(0, 0, 0) scale(1);opacity:1}}@keyframes swal2-hide{0%{transform:translate3d(0, 0, 0) scale(1);opacity:1}100%{transform:translate3d(0, -50px, 0) scale(0.9);opacity:0}}@keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-0.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(0.4);opacity:0}50%{margin-top:1.625em;transform:scale(0.4);opacity:0}80%{margin-top:-0.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0deg);opacity:1}}@keyframes swal2-rotate-loading{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}@keyframes swal2-toast-show{0%{transform:translateY(-0.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(0.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0deg)}}@keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-0.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}");
3741
+ })))(), 1);
3742
+ function Ft({ title: e, inputs: t, confirmText: n, cancelText: r }) {
3743
+ let i = t.map((e, t) => `<input id="${`swal-input-${t}`}" class="swal2-input" placeholder="${e.placeholder || ""}" value="${e.value || ""}">`).join("");
3744
+ return Pt.default.fire({
3745
+ title: e,
3746
+ html: i,
3747
+ focusConfirm: !1,
3748
+ preConfirm: () => {
3749
+ let e = t.map((e, t) => {
3750
+ let n = `swal-input-${t}`, r = document.getElementById(n);
3751
+ if (!r) return null;
3752
+ let i = r.value;
3753
+ return e.required && !i ? (Pt.default.showValidationMessage(e.requiredMessage || "This field is required"), !1) : i;
3754
+ });
3755
+ return !e.includes(!1) && e;
3756
+ },
3757
+ showCancelButton: !0,
3758
+ confirmButtonText: n || "Confirm",
3759
+ cancelButtonText: r || "Cancel"
3760
+ });
3761
+ }
3762
+ //#endregion
3763
+ //#region src/components/shared/toolbar/Insert/Hooks/insertLogic.jsx
3764
+ function It() {
3765
+ let e = window.getSelection();
3766
+ return e && e.rangeCount > 0 ? e.getRangeAt(0).cloneRange() : null;
3767
+ }
3768
+ function Lt(e) {
3769
+ if (!e) return;
3770
+ let t = window.getSelection();
3771
+ t && (t.removeAllRanges(), t.addRange(e));
3772
+ }
3773
+ function Rt() {
3774
+ let e = document.querySelector(".forge-editor__content");
3775
+ if (e) {
3776
+ e.focus();
3777
+ let t = document.createRange(), n = window.getSelection();
3778
+ if (n) {
3779
+ let r = e.lastChild;
3780
+ r ? (t.setStartAfter(r), t.collapse(!0)) : (t.selectNodeContents(e), t.collapse(!1)), n.removeAllRanges(), n.addRange(t);
3781
+ }
3782
+ }
3783
+ }
3784
+ function zt(e) {
3785
+ let t = window.getSelection();
3786
+ if (!t || !t.rangeCount) {
3787
+ Rt(), setTimeout(() => zt(e), 50);
3788
+ return;
3789
+ }
3790
+ let n = t.getRangeAt(0);
3791
+ n.deleteContents();
3792
+ let r = n.createContextualFragment(e), i = r.lastChild;
3793
+ n.insertNode(r), i ? (n.setStartAfter(i), n.collapse(!0)) : n.collapse(!1), t.removeAllRanges(), t.addRange(n);
3794
+ }
3795
+ function Bt() {
3796
+ return {
3797
+ insertLink: async () => {
3798
+ let e = It(), t = await Ft({
3799
+ title: "Insert Link",
3800
+ inputs: [{
3801
+ placeholder: "URL",
3802
+ value: "https://",
3803
+ required: !0,
3804
+ requiredMessage: "URL is required"
3805
+ }, { placeholder: "Link text (optional)" }],
3806
+ confirmText: "Insert",
3807
+ cancelText: "Cancel"
3808
+ });
3809
+ if (t.isConfirmed && t.value) {
3810
+ Lt(e);
3811
+ let [n, r] = t.value;
3812
+ zt(r ? `<a href="${n}" target="_blank" rel="noopener">${r}</a>` : `<a href="${n}" target="_blank" rel="noopener">${n}</a>`);
3813
+ }
3814
+ },
3815
+ insertImage: async () => {
3816
+ let e = It(), t = await Ft({
3817
+ title: "Insert Image",
3818
+ inputs: [{
3819
+ placeholder: "Image URL",
3820
+ value: "https://",
3821
+ required: !0,
3822
+ requiredMessage: "Image URL is required"
3823
+ }, {
3824
+ placeholder: "Alt text",
3825
+ value: "Image"
3826
+ }],
3827
+ confirmText: "Insert",
3828
+ cancelText: "Cancel"
3829
+ });
3830
+ if (t.isConfirmed && t.value) {
3831
+ Lt(e);
3832
+ let [n, r] = t.value;
3833
+ zt(`<img src="${n}" alt="${r}" style="max-width: 100%;">`);
3834
+ }
3835
+ },
3836
+ insertVideo: async () => {
3837
+ let e = It(), t = await Ft({
3838
+ title: "Insert Video",
3839
+ inputs: [{
3840
+ placeholder: "Video URL (YouTube/Vimeo)",
3841
+ value: "https://",
3842
+ required: !0,
3843
+ requiredMessage: "Video URL is required"
3844
+ }],
3845
+ confirmText: "Insert",
3846
+ cancelText: "Cancel"
3847
+ });
3848
+ if (t.isConfirmed && t.value) {
3849
+ Lt(e);
3850
+ let [n] = t.value, r;
3851
+ r = n.includes("youtube.com") || n.includes("youtu.be") ? `<iframe width="560" height="315" src="${n.replace("watch?v=", "embed/").replace("youtu.be/", "youtube.com/embed/")}" frameborder="0" allowfullscreen></iframe>` : `<video controls src="${n}" style="max-width: 100%;"></video>`, zt(r);
3852
+ }
3853
+ }
3854
+ };
3855
+ }
3856
+ //#endregion
3857
+ //#region src/components/shared/toolbar/Insert/Components/index.jsx
3858
+ function Vt() {
3859
+ return /* @__PURE__ */ I(Nt, { logic: Bt() });
3860
+ }
3861
+ //#endregion
3862
+ //#region src/components/shared/toolbar/View/Components/ViewToolbar.jsx
3863
+ function Ht({ logic: e }) {
3864
+ let { toggleFullscreen: t, toggleCodeView: n, showHelp: r } = e, i = "forge-toolbar-button group relative flex h-8 cursor-pointer items-center justify-center rounded-[2px] border border-[#ccc] bg-white px-2 text-sm leading-none transition-all duration-150 hover:bg-[#f0f0f0] active:translate-y-px", a = "pointer-events-none absolute left-1/2 top-[calc(100%+8px)] z-30 -translate-x-1/2 whitespace-nowrap rounded-md border border-[#2c2c2c] bg-[#1e1e1e] px-2.5 py-1 text-[11px] font-medium leading-none text-white opacity-0 shadow-lg transition-all duration-200 group-hover:visible group-hover:opacity-100 rtl:left-1/2 rtl:-translate-x-1/2 before:absolute before:bottom-full before:left-1/2 before:-translate-x-1/2 before:border-x-[5px] before:border-b-[5px] before:border-t-0 before:border-solid before:border-x-transparent before:border-b-[#2c2c2c] after:absolute after:bottom-full after:left-1/2 after:-translate-x-1/2 after:translate-y-[1px] after:border-x-[4px] after:border-b-[4px] after:border-t-0 after:border-solid after:border-x-transparent after:border-b-[#1e1e1e]";
3865
+ return /* @__PURE__ */ I("div", {
3866
+ className: "forge-toolbar-group forge-toolbar-view flex items-center gap-0.5",
3867
+ children: [/* @__PURE__ */ I("button", {
3868
+ type: "button",
3869
+ className: i,
3870
+ onClick: t,
3871
+ "aria-label": "Full Screen",
3872
+ children: [/* @__PURE__ */ I("span", {
3873
+ className: "forge-toolbar-icon",
3874
+ children: "⛶"
3875
+ }), /* @__PURE__ */ I("span", {
3876
+ className: a,
3877
+ "data-i18n": "fullscreen",
3878
+ children: "Full Screen"
3879
+ })]
3880
+ }), /* @__PURE__ */ I("button", {
3881
+ type: "button",
3882
+ className: i,
3883
+ onClick: n,
3884
+ "aria-label": "Code View",
3885
+ children: [/* @__PURE__ */ I("span", {
3886
+ className: "forge-toolbar-icon",
3887
+ children: "</>"
3888
+ }), /* @__PURE__ */ I("span", {
3889
+ className: a,
3890
+ "data-i18n": "codeview",
3891
+ children: "Code View"
3892
+ })]
3893
+ })]
3894
+ });
3895
+ }
3896
+ //#endregion
3897
+ //#region src/components/shared/toolbar/View/Hooks/viewLogic.jsx
3898
+ var X = /* @__PURE__ */ new Set([
3899
+ "br",
3900
+ "hr",
3901
+ "img",
3902
+ "input",
3903
+ "meta",
3904
+ "link",
3905
+ "area",
3906
+ "base",
3907
+ "col",
3908
+ "embed",
3909
+ "source",
3910
+ "track",
3911
+ "wbr"
3912
+ ]);
3913
+ function Ut(e) {
3914
+ return Array.from(e.attributes).map((e) => ` ${e.name}="${e.value.replace(/"/g, "&quot;")}"`).join("");
3915
+ }
3916
+ function Wt(e) {
3917
+ return e.replace(/\u200B/g, "");
3918
+ }
3919
+ function Gt(e) {
3920
+ if (e.nodeType === 3) return Wt(e.textContent);
3921
+ if (e.nodeType !== 1) return "";
3922
+ let t = e.tagName.toLowerCase(), n = Ut(e);
3923
+ return X.has(t) ? `<${t}${n}>` : `<${t}${n}>${Array.from(e.childNodes).map((e) => Gt(e)).join("")}</${t}>`;
3924
+ }
3925
+ function Kt(e, t, n) {
3926
+ let r = " ".repeat(t);
3927
+ if (e.nodeType === 3) {
3928
+ let t = Wt(e.textContent).trim();
3929
+ if (!t) return;
3930
+ n.push(r + t);
3931
+ return;
3932
+ }
3933
+ if (e.nodeType !== 1) return;
3934
+ let i = e.tagName.toLowerCase(), a = Ut(e);
3935
+ if (X.has(i)) {
3936
+ n.push(`${r}<${i}${a}>`);
3937
+ return;
3938
+ }
3939
+ let o = Array.from(e.childNodes).filter((e) => e.nodeType === 3 ? Wt(e.textContent).trim() !== "" : e.nodeType === 1);
3940
+ if (o.length === 0) {
3941
+ n.push(`${r}<${i}${a}></${i}>`);
3942
+ return;
3943
+ }
3944
+ if (!o.some((e) => e.nodeType === 1 && !X.has(e.tagName.toLowerCase()) && Array.from(e.childNodes).some((e) => e.nodeType === 1))) {
3945
+ let e = o.map((e) => Gt(e)).join("");
3946
+ n.push(`${r}<${i}${a}>${e}</${i}>`);
3947
+ return;
3948
+ }
3949
+ n.push(`${r}<${i}${a}>`), o.forEach((e) => Kt(e, t + 1, n)), n.push(`${r}</${i}>`);
3950
+ }
3951
+ function qt(e) {
3952
+ let t = document.createElement("template");
3953
+ t.innerHTML = e;
3954
+ let n = [];
3955
+ return Array.from(t.content.childNodes).forEach((e) => Kt(e, 0, n)), n.join("\n");
3956
+ }
3957
+ function Jt(e) {
3958
+ e.focus();
3959
+ let t = document.createRange();
3960
+ t.selectNodeContents(e), t.collapse(!1);
3961
+ let n = window.getSelection();
3962
+ n && (n.removeAllRanges(), n.addRange(t));
3963
+ }
3964
+ function Yt() {
3965
+ return {
3966
+ toggleFullscreen: () => {
3967
+ let e = document.querySelector(".forge-editor");
3968
+ e && (document.fullscreenElement ? document.exitFullscreen().catch(() => {}) : e.requestFullscreen().catch(() => {}));
3969
+ },
3970
+ toggleCodeView: () => {
3971
+ let e = document.querySelector(".forge-editor__content");
3972
+ if (!e) return;
3973
+ let t = document.querySelector(".forge-code-view-textarea");
3974
+ if (t) {
3975
+ let n = t.value;
3976
+ e.removeAttribute("data-code-view"), e.innerHTML = n.trim(), e.style.display = "", t.remove(), Jt(e);
3977
+ } else {
3978
+ let t = e.innerHTML, n = qt(t), r = document.createElement("textarea");
3979
+ r.className = e.className, r.classList.add("forge-code-view-textarea"), r.value = n, r.spellcheck = !1, r.setAttribute("dir", "ltr"), r.style.direction = "ltr", r.style.textAlign = "left", r.style.unicodeBidi = "plaintext", r.style.fontFamily = "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace", r.style.fontSize = "13px", r.style.lineHeight = "1.6", r.style.whiteSpace = "pre-wrap", r.style.overflowWrap = "break-word", r.style.tabSize = "2", r.style.border = "none", r.style.outline = "none", r.style.resize = "none", r.style.background = "transparent", e.style.display = "none", e.setAttribute("data-code-view", "true"), e.parentNode.insertBefore(r, e.nextSibling), r.focus(), r.setSelectionRange(r.value.length, r.value.length);
3980
+ }
3981
+ },
3982
+ showHelp: () => {
3983
+ let e = [
3984
+ "Forge Editor - Keyboard Shortcuts:",
3985
+ "",
3986
+ "Bold: Ctrl+B",
3987
+ "Underline: Ctrl+U",
3988
+ "Link: Ctrl+K",
3989
+ "Undo: Ctrl+Z",
3990
+ "Redo: Ctrl+Y",
3991
+ "",
3992
+ "Visit: https://github.com/your-repo/forge-edit"
3993
+ ].join("\n");
3994
+ alert(e);
3995
+ }
3996
+ };
3997
+ }
3998
+ //#endregion
3999
+ //#region src/components/shared/toolbar/View/Components/index.jsx
4000
+ function Xt() {
4001
+ return /* @__PURE__ */ I(Ht, { logic: Yt() });
4002
+ }
4003
+ //#endregion
4004
+ //#region src/components/shared/toolbar/Index/index.jsx
4005
+ function Zt({ editorRef: e }) {
4006
+ return /* @__PURE__ */ I("div", {
4007
+ className: "forge-editor__toolbar sticky top-0 z-10 m-0 flex flex-shrink-0 flex-wrap items-center justify-between gap-[4px] rounded-t-[3px] border-b border-[#ddd] bg-[#f5f5f5] p-[5px] text-[#333]",
4008
+ role: "toolbar",
4009
+ children: [
4010
+ /* @__PURE__ */ I(ye, {}),
4011
+ /* @__PURE__ */ I(Ge, {}),
4012
+ /* @__PURE__ */ I(tt, { editorRef: e }),
4013
+ /* @__PURE__ */ I(mt, {}),
4014
+ /* @__PURE__ */ I(Et, {}),
4015
+ /* @__PURE__ */ I(Mt, {}),
4016
+ /* @__PURE__ */ I(Vt, {}),
4017
+ /* @__PURE__ */ I(Xt, {})
4018
+ ]
4019
+ });
4020
+ }
4021
+ //#endregion
4022
+ //#region src/components/shared/statusbar/Components/index.jsx
4023
+ function Qt() {
4024
+ return /* @__PURE__ */ I("div", {
4025
+ className: "forge-statusbar box-border flex h-2.5 w-full flex-shrink-0 cursor-s-resize items-center justify-center rounded-b-[3px] border-t border-[#ccc] bg-[#f0f0f0]",
4026
+ role: "status",
4027
+ children: /* @__PURE__ */ I("div", {
4028
+ className: "flex flex-col items-center gap-px",
4029
+ "aria-label": "resize",
4030
+ children: [
4031
+ /* @__PURE__ */ I("div", { className: "h-px w-3 rounded-[1px] bg-[#888]" }),
4032
+ /* @__PURE__ */ I("div", { className: "h-px w-3 rounded-[1px] bg-[#888]" }),
4033
+ /* @__PURE__ */ I("div", { className: "h-px w-3 rounded-[1px] bg-[#888]" })
4034
+ ]
4035
+ })
4036
+ });
4037
+ }
4038
+ //#endregion
4039
+ //#region src/components/shared/statusbar/Hooks/resize.js
4040
+ var $t = 100;
4041
+ function en(e, t, n = {}) {
4042
+ if (!e || !t) return () => {};
4043
+ let r = n.minHeight ?? $t, i = n.maxHeight ?? Infinity, a = 0, o = 0;
4044
+ function s(e) {
4045
+ let n = e.clientY - a, s = o + n;
4046
+ s = Math.min(Math.max(s, r), i), t.style.height = `${s}px`;
4047
+ }
4048
+ function c() {
4049
+ document.removeEventListener("mousemove", s), document.removeEventListener("mouseup", c), document.body.style.removeProperty("user-select"), document.body.style.removeProperty("cursor");
4050
+ }
4051
+ function l(e) {
4052
+ e.preventDefault(), a = e.clientY, o = t.getBoundingClientRect().height, document.body.style.userSelect = "none", document.body.style.cursor = "s-resize", document.addEventListener("mousemove", s), document.addEventListener("mouseup", c);
4053
+ }
4054
+ return e.addEventListener("mousedown", l), function() {
4055
+ e.removeEventListener("mousedown", l), document.removeEventListener("mousemove", s), document.removeEventListener("mouseup", c);
4056
+ };
4057
+ }
4058
+ //#endregion
4059
+ //#region src/components/shared/toolbar/Style/Hooks/styleLogic.jsx
4060
+ function tn(e) {
4061
+ let t = window.getSelection(), n = document.createRange(), r = e;
4062
+ for (; r.lastChild && r.lastChild.nodeName !== "BR";) r = r.lastChild;
4063
+ r.nodeType === 3 ? (n.setStart(r, r.textContent.length), n.collapse(!0)) : r.lastChild && r.lastChild.nodeName === "BR" ? (n.setStart(r, r.childNodes.length - 1), n.collapse(!0)) : (n.selectNodeContents(r), n.collapse(!1)), t.removeAllRanges(), t.addRange(n);
4064
+ }
4065
+ function nn(e) {
4066
+ let t = window.getSelection();
4067
+ if (!t || !t.rangeCount) return;
4068
+ let n = t.getRangeAt(0).commonAncestorContainer;
4069
+ n.nodeType === 3 && (n = n.parentElement);
4070
+ let r = n.closest("p, h1, h2, h3, h4, h5, h6, blockquote, pre");
4071
+ if (r) {
4072
+ let t = r.textContent.trim().length > 0, n = document.createElement(e);
4073
+ if (t) for (; r.firstChild;) {
4074
+ let e = r.firstChild;
4075
+ if (e.nodeName === "BR" && r.childNodes.length === 1) {
4076
+ r.removeChild(e);
4077
+ continue;
4078
+ }
4079
+ n.appendChild(e);
4080
+ }
4081
+ else n.innerHTML = "<br>";
4082
+ r.replaceWith(n), tn(n);
4083
+ }
4084
+ }
4085
+ function rn(e) {
4086
+ if (!e) return;
4087
+ let t = e.querySelector("[data-command='style']"), n = e.querySelector(".forge-dropdown-style");
4088
+ !t || !n || (q(t, n), n.querySelectorAll(".forge-dropdown-item").forEach((e) => {
4089
+ e.addEventListener("mousedown", (r) => {
4090
+ r.preventDefault(), r.stopPropagation();
4091
+ let i = e.dataset.value || e.getAttribute("data-value");
4092
+ i && nn(i), n.classList.remove("is-open"), t.classList.remove("is-active");
4093
+ });
4094
+ }));
4095
+ }
4096
+ //#endregion
4097
+ //#region src/components/shared/i18n/index.js
4098
+ var an = {
4099
+ en: {
4100
+ style: "Style",
4101
+ normal: "Normal",
4102
+ blockquote: "Blockquote",
4103
+ code: "Code",
4104
+ header1: "Header 1",
4105
+ header2: "Header 2",
4106
+ header3: "Header 3",
4107
+ header4: "Header 4",
4108
+ header5: "Header 5",
4109
+ header6: "Header 6",
4110
+ bold: "Bold",
4111
+ underline: "Underline",
4112
+ removeFormat: "Remove Font Style",
4113
+ fontName: "Font Family",
4114
+ recentColor: "Recent Color",
4115
+ moreColor: "More Color",
4116
+ recentBackColor: "Recent Background Color",
4117
+ moreBackColor: "More Background Colors",
4118
+ insertUnorderedList: "Unordered List",
4119
+ insertOrderedList: "Ordered List",
4120
+ paragraph: "Paragraph",
4121
+ justifyLeft: "Align Left",
4122
+ justifyCenter: "Align Center",
4123
+ justifyRight: "Align Right",
4124
+ justifyFull: "Justify",
4125
+ outdent: "Outdent",
4126
+ indent: "Indent",
4127
+ table: "Table",
4128
+ link: "Link",
4129
+ picture: "Picture",
4130
+ video: "Video",
4131
+ fullscreen: "Full Screen",
4132
+ codeview: "Code View",
4133
+ help: "Help"
4134
+ },
4135
+ ar: {
4136
+ style: "نمط",
4137
+ normal: "عادي",
4138
+ blockquote: "اقتباس",
4139
+ code: "كود",
4140
+ header1: "عنوان 1",
4141
+ header2: "عنوان 2",
4142
+ header3: "عنوان 3",
4143
+ header4: "عنوان 4",
4144
+ header5: "عنوان 5",
4145
+ header6: "عنوان 6",
4146
+ bold: "عريض",
4147
+ underline: "تسطير",
4148
+ removeFormat: "إزالة تنسيق الخط",
4149
+ fontName: "نوع الخط",
4150
+ recentColor: "آخر لون مستخدم",
4151
+ moreColor: "المزيد من الألوان",
4152
+ recentBackColor: "آخر لون خلفية",
4153
+ moreBackColor: "المزيد من ألوان الخلفية",
4154
+ insertUnorderedList: "قائمة نقطية",
4155
+ insertOrderedList: "قائمة مرقمة",
4156
+ paragraph: "فقرة",
4157
+ justifyLeft: "محاذاة لليسار",
4158
+ justifyCenter: "محاذاة للوسط",
4159
+ justifyRight: "محاذاة لليمين",
4160
+ justifyFull: "ضبط",
4161
+ outdent: "تقليل المسافة البادئة",
4162
+ indent: "زيادة المسافة البادئة",
4163
+ table: "جدول",
4164
+ link: "رابط",
4165
+ picture: "صورة",
4166
+ video: "فيديو",
4167
+ fullscreen: "ملء الشاشة",
4168
+ codeview: "عرض الكود",
4169
+ help: "مساعدة"
4170
+ }
4171
+ }, Z = "en";
4172
+ function on(e, t) {
4173
+ return (an[e] || an[Z])[t] || an[Z][t] || t;
4174
+ }
4175
+ //#endregion
4176
+ //#region src/components/shared/i18n/apply.js
4177
+ function sn(e, t) {
4178
+ e.querySelectorAll("[data-i18n]").forEach((e) => {
4179
+ e.textContent = on(t, e.getAttribute("data-i18n"));
4180
+ });
4181
+ }
4182
+ //#endregion
4183
+ //#region src/components/shared/toolbar/Style/Utils/ensureParagraph.jsx
4184
+ function cn(e) {
4185
+ if (e && !(e.children.length > 0 || e.textContent.trim().length > 0)) {
4186
+ let t = document.createElement("p");
4187
+ t.innerHTML = "<br>", e.appendChild(t);
4188
+ }
4189
+ }
4190
+ //#endregion
4191
+ //#region src/components/shared/toolbar/Style/Utils/enterKeyHandler.jsx
4192
+ var ln = [
4193
+ "h1",
4194
+ "h2",
4195
+ "h3",
4196
+ "h4",
4197
+ "h5",
4198
+ "h6",
4199
+ "blockquote"
4200
+ ], un = ["pre"];
4201
+ function dn(e, t, n) {
4202
+ let r = e.nodeType === 3 ? e.parentNode : e;
4203
+ for (; r && r !== t;) {
4204
+ if (r.nodeType === 1 && n.includes(r.tagName.toLowerCase())) return r;
4205
+ r = r.parentNode;
4206
+ }
4207
+ return null;
4208
+ }
4209
+ function fn(e) {
4210
+ let t = window.getSelection(), n = document.createRange();
4211
+ n.selectNodeContents(e), n.collapse(!0), t.removeAllRanges(), t.addRange(n);
4212
+ }
4213
+ function pn(e) {
4214
+ if (!e) return () => {};
4215
+ let t = (t) => {
4216
+ if (t.key !== "Enter" || t.shiftKey || e.getAttribute("data-code-view") === "true" || e.contentEditable !== "true") return;
4217
+ let n = window.getSelection();
4218
+ if (!n || !n.rangeCount) return;
4219
+ let r = n.getRangeAt(0);
4220
+ if (dn(r.startContainer, e, un)) {
4221
+ t.preventDefault();
4222
+ let e = document.createElement("br");
4223
+ r.deleteContents(), r.insertNode(e);
4224
+ let i = document.createRange();
4225
+ i.setStartAfter(e), i.collapse(!0), n.removeAllRanges(), n.addRange(i);
4226
+ return;
4227
+ }
4228
+ let i = dn(r.startContainer, e, ln);
4229
+ if (!i) return;
4230
+ t.preventDefault();
4231
+ let a = document.createRange();
4232
+ a.setStart(r.endContainer, r.endOffset), a.setEndAfter(i.lastChild || i);
4233
+ let o = a.extractContents(), s = document.createElement("p");
4234
+ o.textContent.trim().length === 0 ? s.innerHTML = "<br>" : s.appendChild(o), i.nextSibling ? i.parentNode.insertBefore(s, i.nextSibling) : i.parentNode.appendChild(s), i.textContent.trim().length === 0 && i.childNodes.length === 0 && (i.innerHTML = "<br>"), fn(s);
4235
+ };
4236
+ return e.addEventListener("keydown", t), () => {
4237
+ e.removeEventListener("keydown", t);
4238
+ };
4239
+ }
4240
+ //#endregion
4241
+ //#region src/components/shared/toolbar/Hooks/contentClick.js
4242
+ function mn(e) {
4243
+ e.addEventListener("click", (t) => {
4244
+ if (t.target === e) {
4245
+ let t = window.getSelection();
4246
+ if (!t) return;
4247
+ let n = e.lastElementChild;
4248
+ if (!n || n.tagName === "PRE" || n.tagName === "BLOCKQUOTE" || /^H[1-6]$/.test(n.tagName)) {
4249
+ let n = document.createElement("p");
4250
+ n.innerHTML = "<br>", e.appendChild(n);
4251
+ let r = document.createRange();
4252
+ r.setStart(n, 0), r.collapse(!0), t.removeAllRanges(), t.addRange(r);
4253
+ }
4254
+ }
4255
+ });
4256
+ }
4257
+ //#endregion
4258
+ //#region src/components/shared/toolbar/ImagePopover/Components/ImagePopover.jsx
4259
+ function hn({ target: e, onClose: t, onResize: n, onFloat: r, onRemove: i }) {
4260
+ let a = G(null);
4261
+ if (!e) return null;
4262
+ let o = e.getBoundingClientRect(), s = {
4263
+ left: o.left + o.width / 2 - 100 + "px",
4264
+ top: o.bottom + 10 + "px"
4265
+ }, c = "note-btn cursor-pointer rounded-[2px] border border-[#ccc] bg-[#f5f5f5] px-2 py-1 text-xs leading-[1.4] transition-all duration-100 ease-in-out hover:border-[#999] hover:bg-[#e6e6e6] active:translate-y-px active:bg-[#d0d0d0]", l = "note-btn-group flex gap-0.5 border-r border-[#ddd] pr-1 last:border-r-0 last:pr-0", u = "not-italic text-sm leading-none";
4266
+ return /* @__PURE__ */ I("div", {
4267
+ ref: a,
4268
+ className: "note-popover bottom note-image-popover fixed z-[9999] min-w-[200px] rounded-[4px] border border-[#ccc] bg-white p-1.5 shadow-[0_2px_8px_rgba(0,0,0,0.15)]",
4269
+ style: s,
4270
+ children: [/* @__PURE__ */ I("div", {
4271
+ className: "absolute -top-2 left-1/2 -translate-x-1/2",
4272
+ children: [/* @__PURE__ */ I("div", { className: "border-l-8 border-r-8 border-b-8 border-l-transparent border-r-transparent border-b-[#ccc]" }), /* @__PURE__ */ I("div", { className: "absolute top-[1px] left-[-7px] border-l-7 border-r-7 border-b-7 border-l-transparent border-r-transparent border-b-white" })]
4273
+ }), /* @__PURE__ */ I("div", {
4274
+ className: "popover-content note-children-container flex flex-wrap items-center gap-1",
4275
+ children: [
4276
+ /* @__PURE__ */ I("div", {
4277
+ className: `${l} note-resize`,
4278
+ children: [
4279
+ /* @__PURE__ */ I("button", {
4280
+ type: "button",
4281
+ className: c,
4282
+ tabIndex: "-1",
4283
+ "aria-label": "Resize full",
4284
+ onClick: () => n(e, 1),
4285
+ children: /* @__PURE__ */ I("span", {
4286
+ className: "note-fontsize-10 text-[10px]",
4287
+ children: "100%"
4288
+ })
4289
+ }),
4290
+ /* @__PURE__ */ I("button", {
4291
+ type: "button",
4292
+ className: c,
4293
+ tabIndex: "-1",
4294
+ "aria-label": "Resize half",
4295
+ onClick: () => n(e, .5),
4296
+ children: /* @__PURE__ */ I("span", {
4297
+ className: "note-fontsize-10 text-[10px]",
4298
+ children: "50%"
4299
+ })
4300
+ }),
4301
+ /* @__PURE__ */ I("button", {
4302
+ type: "button",
4303
+ className: c,
4304
+ tabIndex: "-1",
4305
+ "aria-label": "Resize quarter",
4306
+ onClick: () => n(e, .25),
4307
+ children: /* @__PURE__ */ I("span", {
4308
+ className: "note-fontsize-10 text-[10px]",
4309
+ children: "25%"
4310
+ })
4311
+ }),
4312
+ /* @__PURE__ */ I("button", {
4313
+ type: "button",
4314
+ className: c,
4315
+ tabIndex: "-1",
4316
+ "aria-label": "Original size",
4317
+ onClick: () => n(e, "original"),
4318
+ children: /* @__PURE__ */ I("i", {
4319
+ className: `note-icon-rollback ${u}`,
4320
+ children: "↺"
4321
+ })
4322
+ })
4323
+ ]
4324
+ }),
4325
+ /* @__PURE__ */ I("div", {
4326
+ className: `${l} note-float`,
4327
+ children: [
4328
+ /* @__PURE__ */ I("button", {
4329
+ type: "button",
4330
+ className: c,
4331
+ tabIndex: "-1",
4332
+ "aria-label": "Float Left",
4333
+ onClick: () => r(e, "left"),
4334
+ children: /* @__PURE__ */ I("i", {
4335
+ className: `note-icon-float-left ${u}`,
4336
+ children: "◀"
4337
+ })
4338
+ }),
4339
+ /* @__PURE__ */ I("button", {
4340
+ type: "button",
4341
+ className: c,
4342
+ tabIndex: "-1",
4343
+ "aria-label": "Center",
4344
+ onClick: () => r(e, "center"),
4345
+ children: /* @__PURE__ */ I("i", {
4346
+ className: `note-icon-float-center ${u}`,
4347
+ children: "↔"
4348
+ })
4349
+ }),
4350
+ /* @__PURE__ */ I("button", {
4351
+ type: "button",
4352
+ className: c,
4353
+ tabIndex: "-1",
4354
+ "aria-label": "Float Right",
4355
+ onClick: () => r(e, "right"),
4356
+ children: /* @__PURE__ */ I("i", {
4357
+ className: `note-icon-float-right ${u}`,
4358
+ children: "▶"
4359
+ })
4360
+ }),
4361
+ /* @__PURE__ */ I("button", {
4362
+ type: "button",
4363
+ className: c,
4364
+ tabIndex: "-1",
4365
+ "aria-label": "Remove float",
4366
+ onClick: () => r(e, "none"),
4367
+ children: /* @__PURE__ */ I("i", {
4368
+ className: `note-icon-rollback ${u}`,
4369
+ children: "↺"
4370
+ })
4371
+ })
4372
+ ]
4373
+ }),
4374
+ /* @__PURE__ */ I("div", {
4375
+ className: `${l} note-remove`,
4376
+ children: /* @__PURE__ */ I("button", {
4377
+ type: "button",
4378
+ className: c,
4379
+ tabIndex: "-1",
4380
+ "aria-label": "Remove Image",
4381
+ onClick: () => i(e),
4382
+ children: /* @__PURE__ */ I("i", {
4383
+ className: `note-icon-trash ${u}`,
4384
+ children: "🗑"
4385
+ })
4386
+ })
4387
+ })
4388
+ ]
4389
+ })]
4390
+ });
4391
+ }
4392
+ //#endregion
4393
+ //#region src/components/shared/toolbar/ImagePopover/Hooks/useImagePopover.jsx
4394
+ function gn() {
4395
+ let [e, t] = U(null), [n, r] = U(!1);
4396
+ return W(() => {
4397
+ let e = (e) => {
4398
+ let i = e.target.closest("img");
4399
+ i ? (t(i), r(!0)) : n && (r(!1), t(null));
4400
+ }, i = (e) => {
4401
+ e.key === "Escape" && n && (r(!1), t(null));
4402
+ };
4403
+ return document.addEventListener("click", e), document.addEventListener("keydown", i), () => {
4404
+ document.removeEventListener("click", e), document.removeEventListener("keydown", i);
4405
+ };
4406
+ }, [n]), {
4407
+ target: n ? e : null,
4408
+ onClose: () => {
4409
+ r(!1), t(null);
4410
+ },
4411
+ onResize: (e, n) => {
4412
+ if (n === "original") e.style.width = "", e.style.height = "", e.removeAttribute("width"), e.removeAttribute("height");
4413
+ else {
4414
+ let t = e.naturalWidth || e.width, r = e.naturalHeight || e.height;
4415
+ e.style.width = t * n + "px", e.style.height = r * n + "px";
4416
+ }
4417
+ r(!1), t(null);
4418
+ },
4419
+ onFloat: (e, n) => {
4420
+ n === "none" ? (e.style.float = "", e.style.margin = "", e.style.display = "") : n === "center" ? (e.style.float = "none", e.style.display = "block", e.style.margin = "0 auto") : (e.style.float = n, e.style.display = "", e.style.margin = n === "left" ? "0 10px 5px 0" : "0 0 5px 10px"), r(!1), t(null);
4421
+ },
4422
+ onRemove: (e) => {
4423
+ e.parentElement.removeChild(e), r(!1), t(null);
4424
+ }
4425
+ };
4426
+ }
4427
+ //#endregion
4428
+ //#region src/components/shared/toolbar/ImagePopover/Components/index.jsx
4429
+ function _n() {
4430
+ return /* @__PURE__ */ I(hn, { ...gn() });
4431
+ }
4432
+ //#endregion
4433
+ //#region src/components/light/index.jsx
4434
+ function vn(e) {
4435
+ return {
4436
+ getHTML() {
4437
+ return e.innerHTML;
4438
+ },
4439
+ setHTML(t) {
4440
+ e.innerHTML = t;
4441
+ },
4442
+ getText() {
4443
+ return e.textContent;
4444
+ },
4445
+ getSelection() {
4446
+ let e = window.getSelection();
4447
+ return e ? e.toString() : "";
4448
+ }
4449
+ };
4450
+ }
4451
+ function yn(e) {
4452
+ let t = e.lang || "en", n = e.dir || "ltr", r = { current: null }, i = /* @__PURE__ */ I("div", {
4453
+ className: "forge-editor forge-editor--light flex flex-col w-full rounded-[3px] border border-[#ddd] bg-white box-border align-top min-h-[120px]",
4454
+ lang: t,
4455
+ dir: n,
4456
+ children: [
4457
+ /* @__PURE__ */ I(Zt, { editorRef: r }),
4458
+ /* @__PURE__ */ I("div", {
4459
+ className: "forge-editor__content flex-1 min-h-[60px] overflow-auto p-[10px] pb-12 outline-none box-border [&_blockquote]:my-2 [&_blockquote]:border-l-4 [&_blockquote]:border-[#ccc] [&_blockquote]:pl-4 [&_blockquote]:italic [&_pre]:bg-[#f4f4f4] [&_pre]:p-2 [&_pre]:rounded [&_h1]:text-2xl [&_h1]:font-bold [&_h2]:text-xl [&_h2]:font-bold [&_h3]:text-lg [&_h3]:font-bold",
4460
+ contentEditable: "true",
4461
+ "data-placeholder": e.placeholder || ""
4462
+ }),
4463
+ /* @__PURE__ */ I(Qt, {}),
4464
+ /* @__PURE__ */ I(_n, {})
4465
+ ]
4466
+ }), a = document.createElement("div");
4467
+ ve(i, a);
4468
+ let o = a.firstElementChild, s = o.querySelector(".forge-editor__content");
4469
+ r.current = s, cn(s), mn(s), pn(s);
4470
+ let c = o.querySelector(".forge-toolbar-style");
4471
+ c && rn(c);
4472
+ let l = o.querySelector(".forge-editor__toolbar");
4473
+ l && sn(l, t);
4474
+ let u = o.querySelector(".forge-statusbar");
4475
+ return u && en(u, o, { minHeight: 120 }), {
4476
+ element: o,
4477
+ ...vn(s)
4478
+ };
4479
+ }
4480
+ //#endregion
4481
+ export { yn as t };