@sheetxl/sdk 0.4.10 → 0.4.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/cjs/1aBi7EjSv7rlHImN.cjs +7 -0
- package/browser/cjs/2U_vaFrfcRohWzeU.cjs +7 -0
- package/browser/cjs/2nOrVMTAGGx_9TGL.cjs +7 -0
- package/browser/cjs/36TOhwWf_rpUol3H.cjs +7 -0
- package/browser/cjs/5zykq8Nm9_DGD2DJ.cjs +7 -0
- package/browser/cjs/7sNFPxy75NuqCDQh.cjs +7 -0
- package/browser/cjs/B73Zu8_s9vFWOh_O.cjs +7 -0
- package/browser/cjs/BAsFktGxZpUGmZLe.cjs +7 -0
- package/browser/cjs/BEsz-1T9Bb9AaMYL.cjs +7 -0
- package/browser/cjs/B_NhkERIkAJotIbp.cjs +7 -0
- package/browser/cjs/BdTk8Nhw8G_OzMbe.cjs +7 -0
- package/browser/cjs/Bo-zjba28_CWMlTu.cjs +7 -0
- package/browser/cjs/C06jNASkAfV7kAJt.cjs +7 -0
- package/browser/cjs/C9wOzvC_v6DonctC.cjs +7 -0
- package/browser/cjs/CMCnH7IuCm_auikF.cjs +7 -0
- package/browser/cjs/CVXGzVLWLx2CJQm9.cjs +13 -0
- package/browser/cjs/CaFJIY4BbuoM7WDD.cjs +7 -0
- package/{node/esm/Dk3ABmYKlVup4l-u.mjs → browser/cjs/CcEyzUYgzJ50PUJe.cjs} +2 -5
- package/browser/cjs/Ch3tbUYQx16tKF7k.cjs +7 -0
- package/browser/cjs/Cv7d06asyk54h4qg.cjs +7 -0
- package/browser/cjs/DDRgvBqROJxESdD7.cjs +7 -0
- package/browser/cjs/DHpCAbHLYqvLP0Z6.cjs +7 -0
- package/browser/cjs/DNv6ybWP5Fldgc2s.cjs +7 -0
- package/browser/cjs/Dl3IO1DS4B5jgpKI.cjs +7 -0
- package/browser/cjs/DtBxSbHruNTMTsh-.cjs +10 -0
- package/browser/cjs/EU56rWjRMrkea9af.cjs +7 -0
- package/browser/cjs/Yi2_Rw5GDVzd_VxU.cjs +7 -0
- package/browser/cjs/ZJKVquWhB5WR-iPJ.cjs +7 -0
- package/browser/cjs/ZcKbNkAX98aqbRl3.cjs +7 -0
- package/browser/cjs/index.cjs +4 -3
- package/browser/cjs/kyw6u7fpNVXpqgsI.cjs +7 -0
- package/browser/cjs/nQY-7MdNrbTu3EmK.cjs +7 -0
- package/browser/cjs/trblZTDJ1nAz0rWR.cjs +7 -0
- package/browser/cjs/uyHKBD07R0GGZXep.cjs +10 -0
- package/browser/esm/1RkwhM87R80gyTMd.mjs +7 -0
- package/browser/esm/5w39mZuW-sWnmmdV.mjs +7 -0
- package/browser/esm/A8C5de6v1CBMgJZq.mjs +7 -0
- package/browser/esm/B9JgD2n0XcFJj3bo.mjs +7 -0
- package/browser/esm/BEs22-ynP5XGO3w2.mjs +7 -0
- package/browser/esm/BHc7eG4nZizeMBb5.mjs +7 -0
- package/browser/esm/BO0ncqgpx-62w_oX.mjs +7 -0
- package/browser/esm/BQCIUvZDEabV77HK.mjs +7 -0
- package/browser/esm/BVi-ZLSVMKE-zvx4.mjs +7 -0
- package/browser/esm/BsDRByzxyMQ1n9k6.mjs +7 -0
- package/browser/esm/BuUARF4geX1QlFaV.mjs +7 -0
- package/browser/esm/Bv47rNz3qnYylQjD.mjs +7 -0
- package/browser/esm/C-CL0OoNkb1zC70z.mjs +7 -0
- package/browser/esm/CK55N2ZgYHqyYvC2.mjs +7 -0
- package/browser/esm/{CsPZhcz5eLf-CbkJ.mjs → CM_TdYA35a4ZBdwx.mjs} +2 -7
- package/browser/esm/COIpRrbH0PIAxGAv.mjs +7 -0
- package/browser/esm/CV82qaLuZfxcBBSy.mjs +10 -0
- package/browser/esm/CW0tmrVd5h3U4RZa.mjs +7 -0
- package/browser/esm/ChEVz9V1woVRX6WL.mjs +7 -0
- package/browser/esm/CuVRE_tWXcHiZiqD.mjs +7 -0
- package/browser/esm/DCgtfzoZVReua9he.mjs +7 -0
- package/browser/esm/DS7nkzMuzXOAIPF2.mjs +7 -0
- package/browser/esm/DTfK5ukJi2A2cG4a.mjs +13 -0
- package/browser/esm/Dk8xANVVmSj4hMfy.mjs +7 -0
- package/browser/esm/DkBcYI5GMfGWjMpw.mjs +7 -0
- package/browser/esm/DoolQNF8KdKfxJym.mjs +7 -0
- package/browser/esm/Du5u3LhdTaqIps_D.mjs +7 -0
- package/browser/esm/DyvAZkeumXN8GHi4.mjs +7 -0
- package/browser/esm/PVTl6mvmxvLJIzh9.mjs +7 -0
- package/browser/esm/Y5czqevaHtgUcl4L.mjs +7 -0
- package/browser/esm/iKCrpPPbOnKlkUDb.mjs +7 -0
- package/browser/esm/index.mjs +2 -84
- package/browser/esm/lfu13YaazVLqtmeU.mjs +10 -0
- package/browser/esm/s7QvhDE2kJkgBcZ8.mjs +7 -0
- package/licenses/dependencies.txt +3 -3
- package/node/esm/3LAM4nbl-SF93GnL.mjs +80 -0
- package/node/esm/{DQwOIKwLzYjUwPmT.mjs → BMXFtr-jXZGBZS1-.mjs} +1 -1
- package/node/esm/{mkuXwkQcdkBHUMsY.mjs → BmYqJNOwK3UJW3Xe.mjs} +1 -1
- package/node/esm/{B2GPpiwGDiHZ4Mnx.mjs → C9U5rfU-8XoDc_V8.mjs} +4 -4
- package/node/esm/{BD4U7piuPUWGdmvF.mjs → CFWQqFvDJMGXn8Qq.mjs} +1 -1
- package/node/esm/{BJgxNxKnNgVBP4Hp.mjs → CFsZ2V-cxUHf5_Sy.mjs} +1 -1
- package/node/esm/{0OTV9xpta6cm7Yx6.mjs → COCgGLfPgG-NG4Ei.mjs} +1 -1
- package/node/esm/{C8OHYChkHQk2jVzy.mjs → CW0oFlrKt5Uj6nuK.mjs} +1 -1
- package/node/esm/{BelMCqHHX_Ln7ik4.mjs → CXrQQnxTwsX0wNvN.mjs} +2 -2
- package/{browser/esm/CA504N_MgS6GSFmG.mjs → node/esm/CfeR1dXEw7Hep352.mjs} +1 -1
- package/node/esm/{CYs7VtVLEbhMy_iG.mjs → Ck1Jwm7rnsCLVeO1.mjs} +1 -1
- package/node/esm/{Cyb9hq0LVkNm7yoj.mjs → Cn1RL1hYSYnF25uZ.mjs} +1 -1
- package/{browser/esm/DbezlvRyCGtHZgSZ.mjs → node/esm/CnhQwEj214g59Jgw.mjs} +1 -1
- package/node/esm/{DrU-yP_Fb9i7w1lb.mjs → Cuk6l5jbAp5qG99L.mjs} +1 -1
- package/node/esm/{CXhWG2Dg31l6Mo8r.mjs → D8Hpg5A5WcmsFCPu.mjs} +1 -1
- package/node/esm/{CdbncxwuP2LcomiC.mjs → D90o-RTQ6VATF0Rk.mjs} +1 -1
- package/{browser/esm/Dk3ABmYKlVup4l-u.mjs → node/esm/DLdBwr1RlyAhJCV0.mjs} +1 -1
- package/node/esm/{Dq32tysuLIKWEFO_.mjs → DRM7eoEZII5c6Rbr.mjs} +1 -1
- package/{browser/esm/70MScShy9oEFZGC-.mjs → node/esm/DSPiPnJGbhnNKLaY.mjs} +1 -1
- package/node/esm/{DXj8p7NZndUJBRAj.mjs → DUlT61b-CgdPCdu7.mjs} +1 -1
- package/{browser/esm/CCcaxwoCKpK91TYc.mjs → node/esm/DWlgrg4IlFnKTR6y.mjs} +1 -1
- package/{browser/esm/sUZorY3sws86BcMb.mjs → node/esm/DbLo1yZBy3dKaDrf.mjs} +1 -1
- package/{browser/esm/BLET1HFCb5u0-_Eo.mjs → node/esm/DpmEPBmhU3gneOpb.mjs} +1 -1
- package/node/esm/{Br_wraXbAu-VOj0p.mjs → JIc401vM9srbtF9d.mjs} +1 -1
- package/node/esm/{Blozz9cX9jUqOnkK.mjs → KATYAmh0NIiQ-uaD.mjs} +1 -1
- package/node/esm/{YqgO5dqnNDu6tJAq.mjs → QvMgUimFvzdL6-mo.mjs} +2 -2
- package/node/esm/{CxkMMFqIme5dCX9o.mjs → VINTYbFQolKKX9Cn.mjs} +1 -1
- package/node/esm/index.mjs +8 -8
- package/node/esm/{BW04nsyJWeVHBcFW.mjs → jqWzWUQAPXE6S4pP.mjs} +1 -1
- package/node/esm/{BYw54CVi5Zykf7P_.mjs → p6tOM2g4fibuTbKy.mjs} +1 -1
- package/node/esm/{BWm5puKy7haAGpHu.mjs → sroYp2c6WrIr_3vO.mjs} +2 -2
- package/{browser/esm/3AEwlfYXdvg1zUXm.mjs → node/esm/uUNVoKRRBhW28hYx.mjs} +1 -1
- package/package.json +4 -4
- package/browser/cjs/-4uKwgMCs2uA4zYY.cjs +0 -6
- package/browser/cjs/23Opade9fWTWmOw5.cjs +0 -6
- package/browser/cjs/6SNZR9WEya-Mi0Ec.cjs +0 -1501
- package/browser/cjs/7lk46bEggXm0Adux.cjs +0 -6
- package/browser/cjs/B0U3u9iqqnQvnw_Z.cjs +0 -6
- package/browser/cjs/BEQPlpKfeBPKELfa.cjs +0 -6
- package/browser/cjs/BKdxsyIZAckH_1Rs.cjs +0 -6
- package/browser/cjs/BKu_2G3LBpnvF7WK.cjs +0 -6
- package/browser/cjs/BTWYrYyq7P04Hhgy.cjs +0 -6
- package/browser/cjs/BVgdgozKIof0HqZa.cjs +0 -6
- package/browser/cjs/BXi-7ztAEss53BNW.cjs +0 -6
- package/browser/cjs/BzzSS21ndAnpHnTK.cjs +0 -6
- package/browser/cjs/C-JX44FribP4xuCm.cjs +0 -6
- package/browser/cjs/C12NQkp7rKKeLgpL.cjs +0 -60
- package/browser/cjs/CIisU9Fr1gqlOapx.cjs +0 -13
- package/browser/cjs/CRjnB0UGZizopxIy.cjs +0 -7
- package/browser/cjs/CfmxldeTiQsDhe4k.cjs +0 -6
- package/browser/cjs/CrkVZFNUXb_YVEfl.cjs +0 -6
- package/browser/cjs/Csmvu-Gg7GIET2fx.cjs +0 -124
- package/browser/cjs/D5kea7N3qYrpyi6Z.cjs +0 -6
- package/browser/cjs/DDPVADUPfi4JqKY9.cjs +0 -15
- package/browser/cjs/DJSDSOdIMakiUL9U.cjs +0 -6
- package/browser/cjs/DgJG2zU2CpBE2JKD.cjs +0 -6
- package/browser/cjs/DqHT7AmlwwAApU0v.cjs +0 -32
- package/browser/cjs/DqdKJmCBZ3tiiTyS.cjs +0 -6
- package/browser/cjs/Dy_w3ejsXCUjhwLi.cjs +0 -6
- package/browser/cjs/EAjldglgyKcpKzX6.cjs +0 -6
- package/browser/cjs/QraWsiDLYuP865Pt.cjs +0 -6
- package/browser/cjs/TMXcSm2F77kJ6GbS.cjs +0 -6
- package/browser/cjs/g9Un0PdQLp8LcMP-.cjs +0 -6
- package/browser/cjs/hNHT5yLsXAZ-mS5K.cjs +0 -6
- package/browser/cjs/o_FLjAWENTjXcsuZ.cjs +0 -6
- package/browser/cjs/rBPqKMZ7T6poaL7T.cjs +0 -6
- package/browser/esm/3-pvLx1jF0RJ56jT.mjs +0 -472
- package/browser/esm/3kB3KaOgV-3ox4C3.mjs +0 -426
- package/browser/esm/BJgxNxKnNgVBP4Hp.mjs +0 -10
- package/browser/esm/BO-YRuEp35GIVL4O.mjs +0 -10
- package/browser/esm/BOL-jxmJyje4-Hxe.mjs +0 -10
- package/browser/esm/BSFibAPQFeBovPl3.mjs +0 -10
- package/browser/esm/BW04nsyJWeVHBcFW.mjs +0 -10
- package/browser/esm/BaGFns-M8bCUjgnc.mjs +0 -3974
- package/browser/esm/BifIJRmeTJJLYCr-.mjs +0 -24
- package/browser/esm/Br_wraXbAu-VOj0p.mjs +0 -10
- package/browser/esm/BvE9cJg2esqHIr98.mjs +0 -10
- package/browser/esm/CMO8yX7mxIaFV5GC.mjs +0 -820
- package/browser/esm/Cqf8ZomeNI_0U-UD.mjs +0 -29
- package/browser/esm/DQwOIKwLzYjUwPmT.mjs +0 -10
- package/browser/esm/DXj8p7NZndUJBRAj.mjs +0 -10
- package/browser/esm/DcPcMjMOmfyIGaSN.mjs +0 -1575
- package/browser/esm/DhqkybSwX2wqkqcf.mjs +0 -24009
- package/browser/esm/DpJLw2aGOg6yuBjH.mjs +0 -10
- package/browser/esm/Dq32tysuLIKWEFO_.mjs +0 -10
- package/browser/esm/DrU-yP_Fb9i7w1lb.mjs +0 -10
- package/browser/esm/WY6tkuqX7I-Tw85_.mjs +0 -5651
- package/browser/esm/mkuXwkQcdkBHUMsY.mjs +0 -10
- package/browser/esm/skZ-cAv6270PFv3k.mjs +0 -10
- package/browser/esm/xUdz3zy_nz-hMfhq.mjs +0 -21
- package/node/esm/3AEwlfYXdvg1zUXm.mjs +0 -10
- package/node/esm/70MScShy9oEFZGC-.mjs +0 -10
- package/node/esm/BLET1HFCb5u0-_Eo.mjs +0 -10
- package/node/esm/CA504N_MgS6GSFmG.mjs +0 -10
- package/node/esm/CCcaxwoCKpK91TYc.mjs +0 -10
- package/node/esm/CSgS-BWwvF8YA6gv.mjs +0 -80
- package/node/esm/DbezlvRyCGtHZgSZ.mjs +0 -10
- package/node/esm/sUZorY3sws86BcMb.mjs +0 -10
|
@@ -1,820 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.4.10
|
|
3
|
-
*
|
|
4
|
-
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
|
-
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
-
*/
|
|
7
|
-
const h = "text/html", b = "text/plain", L = "image/png", Tt = Object.freeze({ left: 0, top: 0 }), Ct = Object.freeze({ left: 0, top: 0, bottom: 0, right: 0 }), Mt = Object.freeze({ x: 0, y: 0, width: 0, height: 0 });
|
|
8
|
-
Object.freeze(Object.defineProperty({ __proto__: null, EmptyBounds: Mt, EmptyRect: Ct, EmptyTopLeft: Tt }, Symbol.toStringTag, { value: "Module" }));
|
|
9
|
-
const m = "column", j = "row", Rt = Object.freeze({ colIndex: 0, rowIndex: 0 }), At = Object.freeze({ colStart: 0, rowStart: 0, colEnd: 0, rowEnd: 0 }), yt = (e, t) => e.colStart === t.colStart ? e.rowStart - t.rowStart : e.colStart - t.colStart, gt = (e, t) => e.rowStart === t.rowStart ? e.colStart - t.colStart : e.rowStart - t.rowStart, Ft = (e, t) => e.rowEnd === t.rowEnd ? t.colEnd - e.colEnd : t.rowEnd - e.rowEnd, Lt = (e, t) => e.colEnd === t.colEnd ? t.rowEnd - e.rowEnd : t.colEnd - e.colEnd, J = (e, t) => e.colIndex === t.colIndex ? e.rowIndex - t.rowIndex : e.colIndex - t.colIndex, H = (e, t) => e.rowIndex === t.rowIndex ? e.colIndex - t.colIndex : e.rowIndex - t.rowIndex, bt = (e = j, t = !1) => t ? e !== m ? Ft : Lt : e !== m ? gt : yt, K = (e, t) => e === t || !(!e || !t) && e.rowIndex === t.rowIndex && e.colIndex === t.colIndex, D = (e, t) => e === t || !(!e || !t) && e.rowStart === t.rowStart && e.rowEnd === t.rowEnd && e.colStart === t.colStart && e.colEnd === t.colEnd, $ = (e, t) => !(!e || !t || e.colStart > t.colEnd || t.colStart > e.colEnd || e.rowStart > t.rowEnd || t.rowStart > e.rowEnd), Y = (e, t) => {
|
|
10
|
-
if (e === t) return !0;
|
|
11
|
-
if (!e || !t || e.length !== t.length) return !1;
|
|
12
|
-
for (let r = 0; r < e.length; r++) if (!D(e[r], t[r])) return !1;
|
|
13
|
-
return !0;
|
|
14
|
-
}, U = (e, t, r) => {
|
|
15
|
-
if (!e && !t) return null;
|
|
16
|
-
if (!e) return r ? t : { ...t };
|
|
17
|
-
if (!t) return r ? e : { ...e };
|
|
18
|
-
const n = Math.min(e.colStart, t.colStart), o = Math.min(e.rowStart, t.rowStart), a = Math.max(e.colEnd, t.colEnd), i = Math.max(e.rowEnd, t.rowEnd);
|
|
19
|
-
let l = r;
|
|
20
|
-
return l ? (l.colStart = n, l.rowStart = o, l.colEnd = a, l.rowEnd = i) : l = { colStart: n, rowStart: o, colEnd: a, rowEnd: i }, l;
|
|
21
|
-
}, Z = (e, t) => {
|
|
22
|
-
if (!t || t.length === 0) return e;
|
|
23
|
-
const r = { ...e };
|
|
24
|
-
for (let n = 0; n < t.length; n++) {
|
|
25
|
-
const o = t[n];
|
|
26
|
-
$(r, o) && (r.rowStart = Math.min(r.rowStart, o.rowStart), r.colStart = Math.min(r.colStart, o.colStart), r.rowEnd = Math.max(r.rowEnd, o.rowEnd), r.colEnd = Math.max(r.colEnd, o.colEnd));
|
|
27
|
-
}
|
|
28
|
-
return r;
|
|
29
|
-
}, Ut = [null, null], Pt = (e, t, r) => {
|
|
30
|
-
if (e[0].value === e[1].value) return t;
|
|
31
|
-
};
|
|
32
|
-
function X(e, t = 2, r, n = j, o) {
|
|
33
|
-
let a = [...e];
|
|
34
|
-
if (t <= 0 || e.length <= 1) return a;
|
|
35
|
-
let i = n === m, l = 0, s = !1;
|
|
36
|
-
do {
|
|
37
|
-
const c = a.sort(bt(i ? j : m));
|
|
38
|
-
a = [], a.push(c[0]);
|
|
39
|
-
const d = c.length;
|
|
40
|
-
let w = 0, u = c[0], f = u.colStart, p = u.rowStart, x = u.colEnd, _ = u.rowEnd;
|
|
41
|
-
for (let A = 1; A < d; A++) {
|
|
42
|
-
const g = c[A];
|
|
43
|
-
let G = !1;
|
|
44
|
-
if (G = i ? u && p === g.rowStart && _ === g.rowEnd && x + 1 === g.colStart : u && f === g.colStart && x === g.colEnd && _ + 1 === g.rowStart, G) {
|
|
45
|
-
let S = { colStart: f, rowStart: p, colEnd: i ? g.colEnd : x, rowEnd: i ? _ : g.rowEnd };
|
|
46
|
-
if (u.value !== void 0 && (S.value = u.value), r) {
|
|
47
|
-
const F = o ?? [null, null];
|
|
48
|
-
F[0] = u, F[1] = g, S = r(F, S, n);
|
|
49
|
-
}
|
|
50
|
-
if (S) {
|
|
51
|
-
a[w] = S, s = !0, u = S, f = u.colStart, p = u.rowStart, x = u.colEnd, _ = u.rowEnd;
|
|
52
|
-
continue;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
a[++w] = g, u = g, f = u.colStart, p = u.rowStart, x = u.colEnd, _ = u.rowEnd;
|
|
56
|
-
}
|
|
57
|
-
l++, i = !i, l === 1 && (s = !0);
|
|
58
|
-
} while (l < t && s && a.length > 1);
|
|
59
|
-
return a;
|
|
60
|
-
}
|
|
61
|
-
Object.freeze(Object.defineProperty({ __proto__: null, EmptyCell: Rt, EmptyRange: At, cellToRange: (e, t) => {
|
|
62
|
-
if (!e) return null;
|
|
63
|
-
let r = t;
|
|
64
|
-
return r || (r = { ...e }, delete r.colIndex, delete r.rowIndex), r.colStart = e.colIndex ?? 0, r.rowStart = e.rowIndex ?? 0, r.colEnd = e.colIndex ?? 0, r.rowEnd = e.rowIndex ?? 0, r;
|
|
65
|
-
}, columnFirstCellComparator: J, columnFirstRangeComparator: yt, createCellComparator: (e = j, t = !1) => t ? e !== m ? (r, n) => r.rowIndex === n.rowIndex ? n.colIndex - r.colIndex : n.rowIndex - r.rowIndex : (r, n) => r.colIndex === n.colIndex ? n.rowIndex - r.rowIndex : n.colIndex - r.colIndex : e !== m ? H : J, createConflatingRanges: (e, t = !1) => {
|
|
66
|
-
const r = [];
|
|
67
|
-
let n, o, a = Number.MIN_SAFE_INTEGER, i = Number.MIN_SAFE_INTEGER;
|
|
68
|
-
return { append: (l, s, c) => {
|
|
69
|
-
let d = !0;
|
|
70
|
-
const w = c !== void 0;
|
|
71
|
-
if (w) {
|
|
72
|
-
const p = e ? e(o, c, t) : o === c ? c : void 0;
|
|
73
|
-
p === void 0 ? d = !1 : c = p;
|
|
74
|
-
}
|
|
75
|
-
if (d && s === i + 1 && l === a) return t ? n.rowEnd = s : n.colEnd = s, i = s, void (o = c);
|
|
76
|
-
n && r.push(n);
|
|
77
|
-
const u = t ? l : s, f = t ? s : l;
|
|
78
|
-
n = { colStart: u, rowStart: f, colEnd: u, rowEnd: f }, w && (n.value = c), a = l, i = s, o = c;
|
|
79
|
-
}, done: (l) => (n && (r.push(n), n = null), l ? X(r, 3, l === !0 ? Pt : l, t ? m : j, Ut) : r) };
|
|
80
|
-
}, createRangeComparator: bt, defaultRange: (e, t, r) => e ? r ? (r.colStart = e.colStart ?? t.colStart, r.rowStart = e.rowStart ?? t.rowStart, r.colEnd = e.colEnd ?? t.colEnd, r.rowEnd = e.rowEnd ?? t.rowEnd, r) : { colStart: e.colStart ?? t.colStart, rowStart: e.rowStart ?? t.rowStart, colEnd: e.colEnd ?? t.colEnd, rowEnd: e.rowEnd ?? t.rowEnd } : t, extendRangeToIntersectingRanges: Z, extendRangeToUnionRanges: (e, t) => {
|
|
81
|
-
if (!t || t.length === 0) return e;
|
|
82
|
-
let r = e, n = null;
|
|
83
|
-
for (; !D(r, n); ) n = r, r = Z(n, t);
|
|
84
|
-
return r;
|
|
85
|
-
}, indexOfCoords: (e, t) => {
|
|
86
|
-
const r = { colStart: e.colIndex, rowStart: e.rowIndex, colEnd: e.colIndex, rowEnd: e.rowIndex };
|
|
87
|
-
for (let n = t.length - 1; n >= 0; n--) if ($(r, t[n])) return n;
|
|
88
|
-
return -1;
|
|
89
|
-
}, intersectRanges: (e, t, r) => {
|
|
90
|
-
if (!e) return r ? t : { ...t };
|
|
91
|
-
if (!t) return r ? e : { ...e };
|
|
92
|
-
if (!e && !t || e.rowStart > t.rowEnd || e.rowEnd < t.rowStart || e.colStart > t.colEnd || e.colEnd < t.colStart) return null;
|
|
93
|
-
const n = Math.max(e.colStart, t.colStart), o = Math.max(e.rowStart, t.rowStart), a = Math.min(e.colEnd, t.colEnd), i = Math.min(e.rowEnd, t.rowEnd);
|
|
94
|
-
let l = r;
|
|
95
|
-
return l ? (l.colStart = n, l.rowStart = o, l.colEnd = a, l.rowEnd = i) : l = { colStart: n, rowStart: o, colEnd: a, rowEnd: i }, l;
|
|
96
|
-
}, isCellWithinRange: (e, t) => !(!e || !t || e.rowIndex < t.rowStart || e.rowIndex > t.rowEnd || e.colIndex < t.colStart || e.colIndex > t.colEnd), isEqualCells: K, isEqualRanges: D, isEqualRangesArrays: Y, isEqualSelectionCoords: (e, t) => e === t || !(!e || !t) && e.rangeIndex === t.rangeIndex && !!K(e.cell, t.cell) && Y(e.ranges, t.ranges), isRangeWithinRange: (e, t) => !(e.rowStart < t.rowStart || e.rowEnd > t.rowEnd || e.colStart < t.colStart || e.colEnd > t.colEnd), isRangesIntersect: $, isSingleCell: (e) => !!e && e.rowEnd === e.rowStart && e.colStart === e.colEnd, isValidRange: (e) => !(!e || typeof e.colStart != "number" || e.colStart < 0 || typeof e.colEnd != "number" || e.colEnd < e.colStart || typeof e.rowStart != "number" || e.rowStart < 0 || typeof e.rowEnd != "number" || e.rowEnd < e.rowStart), mergeRangedValues: X, rowFirstCellComparator: H, rowFirstRangeComparator: gt, sanitizeRange: (e) => e ? { colStart: e.colIndex ?? e.colStart ?? 0, rowStart: e.rowIndex ?? e.rowStart ?? 0, colEnd: e.colIndex ?? e.colEnd ?? 0, rowEnd: e.rowIndex ?? e.rowEnd ?? 0 } : null, translateRange: (e, t = -e.rowStart, r = -e.colStart, n) => n ? (n.colStart = e.colStart + r, n.rowStart = e.rowStart + t, n.colEnd = e.colEnd + r, n.rowEnd = e.rowEnd + t, n) : { colStart: e.colStart + r, rowStart: e.rowStart + t, colEnd: e.colEnd + r, rowEnd: e.rowEnd + t }, unionRanges: U, unionRangesArrays: (e, t, r) => {
|
|
97
|
-
if (!e || e.length === 0) return null;
|
|
98
|
-
if (e.length === 1 && !t) return e[0];
|
|
99
|
-
let n = e[0];
|
|
100
|
-
for (let o = 1; o < e.length; o++) n = U(n, e[o], r);
|
|
101
|
-
return t && (n = U(n, t, r)), n;
|
|
102
|
-
} }, Symbol.toStringTag, { value: "Module" }));
|
|
103
|
-
const kt = typeof Symbol == "function" && Symbol.for ? Symbol.for("react.element") : 60103;
|
|
104
|
-
function Nt(e) {
|
|
105
|
-
return /* @__PURE__ */ function(t) {
|
|
106
|
-
return !!t && typeof t == "object";
|
|
107
|
-
}(e) && !function(t) {
|
|
108
|
-
const r = Object.prototype.toString.call(t);
|
|
109
|
-
return r === "[object RegExp]" || r === "[object Date]" || t.$$typeof === kt;
|
|
110
|
-
}(e);
|
|
111
|
-
}
|
|
112
|
-
function I(e, t) {
|
|
113
|
-
return t.clone !== !1 && t.isMergeableObject(e) ? E((r = e, Array.isArray(r) ? [] : {}), e, t) : e;
|
|
114
|
-
var r;
|
|
115
|
-
}
|
|
116
|
-
function Bt(e, t, r) {
|
|
117
|
-
return e.concat(t).map(function(n) {
|
|
118
|
-
return I(n, r);
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
function Q(e) {
|
|
122
|
-
return Object.keys(e).concat((t = e, Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(t).filter(function(r) {
|
|
123
|
-
return Object.propertyIsEnumerable.call(t, r);
|
|
124
|
-
}) : []));
|
|
125
|
-
var t;
|
|
126
|
-
}
|
|
127
|
-
function tt(e, t) {
|
|
128
|
-
try {
|
|
129
|
-
return t in e;
|
|
130
|
-
} catch {
|
|
131
|
-
return !1;
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
function E(e, t, r) {
|
|
135
|
-
(r = r || {}).arrayMerge = r.arrayMerge || Bt, r.isMergeableObject = r.isMergeableObject || Nt, r.cloneUnlessOtherwiseSpecified = I;
|
|
136
|
-
const n = Array.isArray(t);
|
|
137
|
-
return n === Array.isArray(e) ? n ? r.arrayMerge(e, t, r) : function(o, a, i) {
|
|
138
|
-
const l = {};
|
|
139
|
-
return i.isMergeableObject(o) && Q(o).forEach(function(s) {
|
|
140
|
-
l[s] = I(o[s], i);
|
|
141
|
-
}), Q(a).forEach(function(s) {
|
|
142
|
-
var c, d;
|
|
143
|
-
tt(c = o, d = s) && (!Object.hasOwnProperty.call(c, d) || !Object.propertyIsEnumerable.call(c, d)) || (tt(o, s) && i.isMergeableObject(a[s]) ? l[s] = function(w, u) {
|
|
144
|
-
if (!u.customMerge) return E;
|
|
145
|
-
const f = u.customMerge(w);
|
|
146
|
-
return typeof f == "function" ? f : E;
|
|
147
|
-
}(s, i)(o[s], a[s], i) : l[s] = I(a[s], i));
|
|
148
|
-
}), l;
|
|
149
|
-
}(e, t, r) : I(t, r);
|
|
150
|
-
}
|
|
151
|
-
E.all = function(e, t) {
|
|
152
|
-
if (!Array.isArray(e)) throw new Error("first argument should be an array");
|
|
153
|
-
return e.reduce(function(r, n) {
|
|
154
|
-
return E(r, n, t);
|
|
155
|
-
}, {});
|
|
156
|
-
};
|
|
157
|
-
const zt = Object.freeze([]), qt = Object.freeze({}), et = (e) => e, R = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {
|
|
158
|
-
let t = 16 * Math.random() | 0;
|
|
159
|
-
return (e === "x" ? t : 3 & t | 8).toString(16);
|
|
160
|
-
}), mt = (e, t) => e === t || !(!Array.isArray(e) || !Array.isArray(t) || e.length !== t.length) && e.every((r, n) => r === t[n]), O = (e) => typeof e == "object" && !Array.isArray(e) && e !== null, Et = (e) => typeof e != "object" || Array.isArray(e) || e === null ? e : (Object.keys(e).forEach(function(t) {
|
|
161
|
-
e[t] && typeof e[t] == "object" ? Et(e[t]) : e[t] !== null && e[t] !== void 0 || delete e[t], typeof e[t] == "object" && Object.keys(e[t]).length === 0 && delete e[t];
|
|
162
|
-
}), Object.keys(e).length === 0 ? null : e), Dt = (e, t) => !(e !== t && !mt(e, t) && !e.isEqual?.(t)), St = (e, t, r = Dt) => {
|
|
163
|
-
if (e == null || e === t) return null;
|
|
164
|
-
if (!e || typeof e != "object" || Array.isArray(e) || e.isImmutable?.()) return r(e, t) ? null : e;
|
|
165
|
-
const n = Object.keys(e);
|
|
166
|
-
if (n.length === 0) return null;
|
|
167
|
-
let o = !1;
|
|
168
|
-
for (let a = 0; a < n.length; a++) {
|
|
169
|
-
const i = n[a];
|
|
170
|
-
St(e[i], t?.[i], r) === null && (o = !0, delete e[i]);
|
|
171
|
-
}
|
|
172
|
-
return o && Object.keys(e).length === 0 ? null : void 0;
|
|
173
|
-
}, rt = typeof performance == "object" && typeof performance.now == "function" ? () => performance.now() : () => Date.now(), nt = (e) => e == null, ot = (e, t) => !(t.left > e.right || t.right < e.left || t.top > e.bottom || t.bottom < e.top), at = !(typeof window > "u" || !window.document || !window.document.createElement), y = { Windows: "windows", MacOS: "macos", IOS: "ios", Linux: "linux", Android: "android", Safari: "safari", Firefox: "firefox", Node: "node", Unknown: "unknown" }, T = () => {
|
|
174
|
-
if (vt()) return y.Node;
|
|
175
|
-
const e = globalThis.navigator !== void 0 && globalThis.navigator.userAgent ? globalThis.navigator.userAgent.toLowerCase() : "";
|
|
176
|
-
return e ? /(win32|win64|windows|wince)/i.test(e) ? y.Windows : /(macintosh|macintel|macppc|mac68k|macos)/i.test(e) ? y.MacOS : /(iphone|ipad|ipod)/i.test(e) ? y.IOS : /android/.test(e) ? y.Android : /linux/.test(e) ? y.Linux : /^((?!chrome|android|).)*safari/i.test(e) ? y.Safari : /^((?!chrome|android|Seamonkey).)*firefox/i.test(e) ? y.Firefox : y.Unknown : y.Unknown;
|
|
177
|
-
};
|
|
178
|
-
function vt() {
|
|
179
|
-
return typeof process < "u" && process.release?.name === "node" || (typeof process < "u" && process.browser, !1);
|
|
180
|
-
}
|
|
181
|
-
const it = (e, t = !1) => (document.hasFocus() || t) && (e === document.activeElement || e?.contains(document.activeElement)), $t = Object.freeze(Object.defineProperty({ __proto__: null, EmptyArray: zt, EmptyObject: qt, OSType: y, arrayMove: function(e, t, r) {
|
|
182
|
-
const n = e.slice();
|
|
183
|
-
return n.splice(r < 0 ? n.length + r : r, 0, n.splice(t, 1)[0]), n;
|
|
184
|
-
}, asNumber: (e) => {
|
|
185
|
-
const t = 1 * e;
|
|
186
|
-
return Number.isFinite(t) ? t : 0;
|
|
187
|
-
}, camelToPrettyCase: (e) => e.length === 1 ? e.toUpperCase() : e.replace(/([A-Z])/g, " $1").replace(/^./, function(t) {
|
|
188
|
-
return t.toUpperCase();
|
|
189
|
-
}).trim(), canUseDOM: at, cancelTimeout: (e) => {
|
|
190
|
-
cancelAnimationFrame(e.id);
|
|
191
|
-
}, castToString: (e) => e == null || e === void 0 ? "" : typeof e != "string" ? "" + e : e, cloneObject: (e) => nt(e) ? e : JSON.parse(JSON.stringify(e)), consoleWithNoSource: (...e) => new Promise((t) => {
|
|
192
|
-
setTimeout(() => {
|
|
193
|
-
Function("console.log.apply(console, arguments)").apply(null, e), t();
|
|
194
|
-
});
|
|
195
|
-
}), debounce: function(e, t = 300, r = !1) {
|
|
196
|
-
let n, o, a, i, l = 0;
|
|
197
|
-
function s() {
|
|
198
|
-
let d = Date.now() - l;
|
|
199
|
-
d < t && d >= 0 ? n = setTimeout(s, t - d) : (n = null, r || (i = e.apply(a, o), a = o = null));
|
|
200
|
-
}
|
|
201
|
-
t == null && (t = 100);
|
|
202
|
-
const c = function() {
|
|
203
|
-
a = globalThis, o = arguments, l = Date.now();
|
|
204
|
-
var d = r && !n;
|
|
205
|
-
return n || (n = setTimeout(s, t)), d && (i = e.apply(a, o), a = o = null), i;
|
|
206
|
-
};
|
|
207
|
-
return c.clear = function() {
|
|
208
|
-
n && (clearTimeout(n), n = null);
|
|
209
|
-
}, c.flush = function() {
|
|
210
|
-
n && (i = e.apply(a, o), a = o = null, clearTimeout(n), n = null);
|
|
211
|
-
}, c;
|
|
212
|
-
}, deepEqual: function e(t, r) {
|
|
213
|
-
if (t === r) return !0;
|
|
214
|
-
if (t && r && typeof t == "object" && typeof r == "object") {
|
|
215
|
-
if (t.constructor !== r.constructor) return !1;
|
|
216
|
-
let n, o, a;
|
|
217
|
-
if (Array.isArray(t)) {
|
|
218
|
-
if (n = t.length, n != r.length) return !1;
|
|
219
|
-
for (o = n; o-- !== 0; ) if (!e(t[o], r[o])) return !1;
|
|
220
|
-
return !0;
|
|
221
|
-
}
|
|
222
|
-
if (t instanceof Map && r instanceof Map) {
|
|
223
|
-
if (t.size !== r.size) return !1;
|
|
224
|
-
for (o of t.entries()) if (!r.has(o[0])) return !1;
|
|
225
|
-
for (o of t.entries()) if (!e(o[1], r.get(o[0]))) return !1;
|
|
226
|
-
return !0;
|
|
227
|
-
}
|
|
228
|
-
if (t instanceof Set && r instanceof Set) {
|
|
229
|
-
if (t.size !== r.size) return !1;
|
|
230
|
-
for (o of t.entries()) if (!r.has(o[0])) return !1;
|
|
231
|
-
return !0;
|
|
232
|
-
}
|
|
233
|
-
if (ArrayBuffer.isView(t) && ArrayBuffer.isView(r)) {
|
|
234
|
-
if (n = t.length, n != r.length) return !1;
|
|
235
|
-
for (o = n; o-- !== 0; ) if (t[o] !== r[o]) return !1;
|
|
236
|
-
return !0;
|
|
237
|
-
}
|
|
238
|
-
if (t.constructor === RegExp) return t.source === r.source && t.flags === r.flags;
|
|
239
|
-
if (t.valueOf !== Object.prototype.valueOf) return t.valueOf() === r.valueOf();
|
|
240
|
-
if (t.toString !== Object.prototype.toString) return t.toString() === r.toString();
|
|
241
|
-
if (a = Object.keys(t), n = a.length, n !== Object.keys(r).length) return !1;
|
|
242
|
-
for (o = n; o-- !== 0; ) if (!Object.prototype.hasOwnProperty.call(r, a[o])) return !1;
|
|
243
|
-
for (o = n; o-- !== 0; ) {
|
|
244
|
-
let i = a[o];
|
|
245
|
-
if (!(i === "_owner" && t.$$typeof || e(t[i], r[i]))) return !1;
|
|
246
|
-
}
|
|
247
|
-
return !0;
|
|
248
|
-
}
|
|
249
|
-
return t != t && r != r;
|
|
250
|
-
}, deepFreeze: function e(t) {
|
|
251
|
-
return Object.freeze(t), Object.keys(t).forEach((r) => {
|
|
252
|
-
typeof t[r] != "object" || t[r] === null || Object.isFrozen(t[r]) || e(t[r]);
|
|
253
|
-
}), t;
|
|
254
|
-
}, deepMerge: E, diffValues: (e, t) => {
|
|
255
|
-
const r = {}, n = Object.keys(t), o = n.length;
|
|
256
|
-
for (let a = 0; a < o; a++) {
|
|
257
|
-
const i = n[a];
|
|
258
|
-
e[i] !== t[i] && (e[i] === void 0 ? r[i] = t[i] : r[i] = e[i]);
|
|
259
|
-
}
|
|
260
|
-
return Object.keys(r).length === 0 ? null : r;
|
|
261
|
-
}, findEqualOrGreater: function(e, t, r = et) {
|
|
262
|
-
let n = 0, o = e.length - 1;
|
|
263
|
-
for (; n <= o; ) {
|
|
264
|
-
let a = Math.floor((n + o) / 2), i = r(e[a]);
|
|
265
|
-
if (i === t) return a;
|
|
266
|
-
i < t ? n = a + 1 : o = a - 1;
|
|
267
|
-
}
|
|
268
|
-
return n;
|
|
269
|
-
}, findEqualOrLesser: function(e, t, r = et) {
|
|
270
|
-
let n = e.length - 1, o = 0;
|
|
271
|
-
for (; n >= o; ) {
|
|
272
|
-
let a = Math.floor((n + o) / 2), i = r(e[a]);
|
|
273
|
-
if (i === t) return a;
|
|
274
|
-
i > t ? n = a - 1 : o = a + 1;
|
|
275
|
-
}
|
|
276
|
-
return n;
|
|
277
|
-
}, findNextStep: (e, t = !0, r = 15, n = 10, o = 400) => {
|
|
278
|
-
const a = Math.max(e - n, 0) + (t ? 1 : -1);
|
|
279
|
-
return Math.min(o, Math[t ? "ceil" : "floor"](a / r) * r + n);
|
|
280
|
-
}, getDPI: () => {
|
|
281
|
-
let e = 1;
|
|
282
|
-
return typeof window == "object" && (e = window.devicePixelRatio || 1), e;
|
|
283
|
-
}, getFromPath: (e, t) => {
|
|
284
|
-
const r = t.split(".");
|
|
285
|
-
let n = e;
|
|
286
|
-
for (let o = 0; o < r.length; o++) {
|
|
287
|
-
const a = r[o];
|
|
288
|
-
if (!n) return null;
|
|
289
|
-
let i = n[a];
|
|
290
|
-
if (typeof i == "function" && (i = i.bind(n)()), !i || !O(i)) return i;
|
|
291
|
-
n = i;
|
|
292
|
-
}
|
|
293
|
-
return n ?? null;
|
|
294
|
-
}, getOS: T, hasFocus: it, isDefined: (e) => e != null, isEmpty: (e) => e == null || e === "", isEqualArrays: mt, isEqualBounds: (e, t) => e === t || !(e && !t || t && !e) && e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height, isEqualObjectKeys: (e, t) => {
|
|
295
|
-
if (e === t) return !0;
|
|
296
|
-
if (e && !t || t && !e) return !1;
|
|
297
|
-
const r = Object.keys(e);
|
|
298
|
-
if (r.length !== Object.keys(t).length) return !1;
|
|
299
|
-
for (let n = 0; n < r.length; n++) if (e[r[n]] !== t[r[n]]) return !1;
|
|
300
|
-
return !0;
|
|
301
|
-
}, isNode: vt, isNullOrUndefined: nt, isNumeric: (e) => {
|
|
302
|
-
const t = 1 * e;
|
|
303
|
-
return Number.isFinite(t) && typeof t == "number";
|
|
304
|
-
}, isObject: O, isPromiseLike: (e) => !!e && typeof e.then == "function", isRectInsideRect: (e, t) => e.top >= t.top && e.bottom <= t.bottom && e.left >= t.left && e.right <= t.right, isRectIntersect: ot, mergeContentful: (...e) => {
|
|
305
|
-
const t = e.length;
|
|
306
|
-
if (t > 0 && e[t - 1] !== void 0 && !O(e[t - 1])) return e[t - 1];
|
|
307
|
-
let r = e[0] || {};
|
|
308
|
-
for (let n = 1; n < t; n++) r = E(r, e[n] || {}, { arrayMerge: (o, a) => [...a] });
|
|
309
|
-
return r;
|
|
310
|
-
}, nextTick: (e) => {
|
|
311
|
-
typeof window < "u" && typeof window.requestAnimationFrame == "function" ? window.requestAnimationFrame(() => {
|
|
312
|
-
e();
|
|
313
|
-
}) : (typeof setImmediate == "function" ? setImmediate : setTimeout)(() => {
|
|
314
|
-
e();
|
|
315
|
-
});
|
|
316
|
-
}, openFileDialog: (e = "*.*") => new Promise((t, r) => {
|
|
317
|
-
if (!at) return void r("Unable to open dialog with no dom.");
|
|
318
|
-
const n = document.createElement("input");
|
|
319
|
-
n.type = "file", n.accept = e;
|
|
320
|
-
let o = null, a = !1;
|
|
321
|
-
globalThis.addEventListener?.("focus", () => {
|
|
322
|
-
setTimeout(() => {
|
|
323
|
-
o || a || (a = !0, t(null));
|
|
324
|
-
}, 1e3);
|
|
325
|
-
}, { once: !0, passive: !0 }), n.onchange = () => {
|
|
326
|
-
if (o = n.files[0], o) {
|
|
327
|
-
if (a) return void console.warn("File open detected after faux cancel.", o);
|
|
328
|
-
t(o);
|
|
329
|
-
}
|
|
330
|
-
}, n.autofocus = !0, n.click();
|
|
331
|
-
}), rafThrottle: (e) => {
|
|
332
|
-
let t, r = !1, n = function() {
|
|
333
|
-
r = !1, e(t);
|
|
334
|
-
};
|
|
335
|
-
return function(o) {
|
|
336
|
-
t = o, t && t.persist && t.persist(), r || (r = !0, requestAnimationFrame(n));
|
|
337
|
-
};
|
|
338
|
-
}, removeEmptyProperties: Et, removeEqualValues: St, removeListenerAll: (e) => {
|
|
339
|
-
if (!e) return [];
|
|
340
|
-
for (let t = 0; t < e.length; t++) e[t] && e[t]();
|
|
341
|
-
return [];
|
|
342
|
-
}, requestTimeout: (e, t) => {
|
|
343
|
-
const r = rt(), n = { id: requestAnimationFrame(function o() {
|
|
344
|
-
rt() - r >= t ? e.call(null) : n.id = requestAnimationFrame(o);
|
|
345
|
-
}) };
|
|
346
|
-
return n;
|
|
347
|
-
}, roundAccurately: (e, t = 0) => {
|
|
348
|
-
if (e == null || !isFinite(e)) return null;
|
|
349
|
-
const r = 10 ** t;
|
|
350
|
-
return Number(Math.round(e * r) / r);
|
|
351
|
-
}, setToPath: (e, t, r) => {
|
|
352
|
-
const n = t.split(".");
|
|
353
|
-
let o = e;
|
|
354
|
-
if (!o) throw new Error("Can not set path to a null path.");
|
|
355
|
-
for (let a = 0; o && a < n.length - 1; a++) {
|
|
356
|
-
const i = n[a];
|
|
357
|
-
let l = o[i];
|
|
358
|
-
if (l == null && (l = {}, o[i] = l), !O(l)) throw new Error("Can not set path to a non object path.");
|
|
359
|
-
o = l;
|
|
360
|
-
}
|
|
361
|
-
if (typeof r != "number" && typeof r != "boolean" && typeof r != "string" && !O(r)) throw new Error(`Can not set path to ${r} that is not a a supported primitive.`);
|
|
362
|
-
return o[n[n.length - 1]] = r, e;
|
|
363
|
-
}, splitNumber: (e) => {
|
|
364
|
-
let t = Math.abs(e);
|
|
365
|
-
if (isNaN(t) || !isFinite(e)) return null;
|
|
366
|
-
let r = 0 | t, n = t - r, o = 0, a = 0, i = 1;
|
|
367
|
-
if (n > 5e-8) for (; a < 8 && Math.abs(o / i - n) > 5e-8; ) a++, i *= 10, o = Math.round(n * i);
|
|
368
|
-
return { ip: Math.trunc(e), fp: o, ipLength: Math.ceil(Math.log10(r + 1)), fpLength: a };
|
|
369
|
-
}, subtractRect: (e, t, r = !1) => {
|
|
370
|
-
if (!t) return [e];
|
|
371
|
-
if (!ot(e, t)) return [];
|
|
372
|
-
const n = [];
|
|
373
|
-
let o = e;
|
|
374
|
-
const a = () => {
|
|
375
|
-
t.top > o.top && t.top < o.bottom && (n.push({ ...o, bottom: t.top }), o = { ...o, top: t.top });
|
|
376
|
-
}, i = () => {
|
|
377
|
-
t.bottom > o.top && t.bottom < o.bottom && (n.push({ ...o, top: t.bottom }), o = { ...o, bottom: t.bottom });
|
|
378
|
-
}, l = () => {
|
|
379
|
-
t.right > o.left && t.right < o.right && (n.push({ ...o, left: t.right }), o = { ...o, right: t.right });
|
|
380
|
-
}, s = () => {
|
|
381
|
-
t.left > o.left && t.left < o.right && (n.push({ ...o, right: t.left }), o = { ...o, left: t.left });
|
|
382
|
-
};
|
|
383
|
-
return r ? (s(), l(), a(), i()) : (a(), i(), l(), s()), n;
|
|
384
|
-
}, textToKey: (e) => e.replace(/[^a-zA-Z0-9]/g, "").toLowerCase(), throttle: function(e, t) {
|
|
385
|
-
let r = null;
|
|
386
|
-
return (...n) => {
|
|
387
|
-
const o = Date.now();
|
|
388
|
-
(!r || o - r >= t) && (r = o, e(...n));
|
|
389
|
-
};
|
|
390
|
-
}, toSafeJSON: function e(t) {
|
|
391
|
-
if (t === null || typeof t != "object") return t;
|
|
392
|
-
if (typeof t.toJSON == "function") return t.toJSON();
|
|
393
|
-
if (Array.isArray(t)) return t.map((n) => e(n));
|
|
394
|
-
if (typeof t.toString == "function" && t.toString !== Object.prototype.toString) return t.toString();
|
|
395
|
-
const r = {};
|
|
396
|
-
for (const n in t) t.hasOwnProperty(n) && (r[n] = e(t[n]));
|
|
397
|
-
return r;
|
|
398
|
-
}, transpose: (e) => {
|
|
399
|
-
if (!e) return e;
|
|
400
|
-
const t = e.length, r = e[0].length, n = [];
|
|
401
|
-
for (let o = 0; o < r; o++) n[o] = Array(t);
|
|
402
|
-
for (let o = 0; o < t; o++) for (let a = 0; a < r; a++) n[a][o] = e[o][a];
|
|
403
|
-
return n;
|
|
404
|
-
}, uuidV4: R, validEnumValue: (e, t) => {
|
|
405
|
-
if (!Object.values(e).includes(t)) throw new Error(`Invalid type: ${t ?? "null"}. Must be one of: ${Object.values(t).join(", ")}.`);
|
|
406
|
-
}, whenFocus: async (e, t = !1) => new Promise((r) => {
|
|
407
|
-
it(e, t) ? r(!0) : e.addEventListener("focusin", () => {
|
|
408
|
-
r(!0);
|
|
409
|
-
}, { once: !0 }), e.focus();
|
|
410
|
-
}) }, Symbol.toStringTag, { value: "Module" }));
|
|
411
|
-
Object.freeze(Object.defineProperty({ __proto__: null, MESSAGE_ERROR_INVALID_ARG: (e) => `Invalid argument: '${e}'.` }, Symbol.toStringTag, { value: "Module" }));
|
|
412
|
-
const xt = (e) => {
|
|
413
|
-
const t = new Uint8Array(e), r = t.byteLength;
|
|
414
|
-
let n = "";
|
|
415
|
-
for (let o = 0; o < r; o++) n += String.fromCharCode(t[o]);
|
|
416
|
-
if (typeof window < "u" && typeof globalThis.btoa == "function") return globalThis.btoa(n);
|
|
417
|
-
if (typeof Buffer < "u") return Buffer.from(n, "binary").toString("base64");
|
|
418
|
-
throw new Error("Unsupported environment");
|
|
419
|
-
}, W = (e) => new Promise((t, r) => {
|
|
420
|
-
if (e) if (typeof FileReader < "u") {
|
|
421
|
-
const n = new FileReader();
|
|
422
|
-
n.onload = () => {
|
|
423
|
-
t(n.result);
|
|
424
|
-
}, n.onerror = () => {
|
|
425
|
-
r(n.error);
|
|
426
|
-
}, n.readAsText(e);
|
|
427
|
-
} else if (typeof Buffer < "u") {
|
|
428
|
-
const n = (o) => Buffer.from(o).toString("utf-8");
|
|
429
|
-
e.arrayBuffer().then((o) => {
|
|
430
|
-
t(n(o));
|
|
431
|
-
}).catch((o) => {
|
|
432
|
-
r(o);
|
|
433
|
-
});
|
|
434
|
-
} else r(new Error("Unsupported environment"));
|
|
435
|
-
else t("");
|
|
436
|
-
});
|
|
437
|
-
Object.freeze(Object.defineProperty({ __proto__: null, DEFAULT_MIME_TYPE: "*/*", arrayBufferToBase64: xt, base64ToArrayBuffer: (e) => {
|
|
438
|
-
const t = typeof window < "u" && typeof globalThis.atob == "function" ? globalThis.atob(e) : Buffer.from(e, "base64").toString("binary"), r = t.length, n = new Uint8Array(r);
|
|
439
|
-
for (let o = 0; o < r; o++) n[o] = t.charCodeAt(o);
|
|
440
|
-
return n.buffer;
|
|
441
|
-
}, blobToString: W }, Symbol.toStringTag, { value: "Module" }));
|
|
442
|
-
const _t = "data:image/png;base64,", Ot = "Unable to resolve image.", lt = (e) => new Promise(async (t, r) => {
|
|
443
|
-
let n = null;
|
|
444
|
-
try {
|
|
445
|
-
n = new Image(), n.src = e, n.addEventListener("load", function() {
|
|
446
|
-
t({ width: n.naturalWidth, height: n.naturalHeight });
|
|
447
|
-
}, { once: !0 }), n.addEventListener("error", function() {
|
|
448
|
-
URL.revokeObjectURL(e), r("Invalid Image");
|
|
449
|
-
}, { once: !0 }), await n.decode("sync");
|
|
450
|
-
} catch {
|
|
451
|
-
n?.src && URL.revokeObjectURL(n.src);
|
|
452
|
-
}
|
|
453
|
-
n || r(Ot);
|
|
454
|
-
}), P = "image/svg+xml";
|
|
455
|
-
var st, ct;
|
|
456
|
-
Object.freeze(Object.defineProperty({ __proto__: null, DATA_URL_PNG_PREFIX: _t, getImageDataUrl: (e, t = 1) => new Promise(async (r, n) => {
|
|
457
|
-
let o = null;
|
|
458
|
-
try {
|
|
459
|
-
o = new Image(), o.src = e, o.addEventListener("load", function() {
|
|
460
|
-
try {
|
|
461
|
-
const a = document.createElement("canvas");
|
|
462
|
-
a.width = o.naturalWidth, a.height = o.naturalHeight, a.getContext("2d").drawImage(o, 0, 0);
|
|
463
|
-
const i = a.toDataURL("image/png", t);
|
|
464
|
-
r({ elemImg: o, dataUrl: i });
|
|
465
|
-
} catch (a) {
|
|
466
|
-
URL.revokeObjectURL(e), n(a);
|
|
467
|
-
}
|
|
468
|
-
}, { once: !0 }), o.addEventListener("error", function() {
|
|
469
|
-
URL.revokeObjectURL(e), n("Invalid Image");
|
|
470
|
-
}, { once: !0 }), await o.decode("sync");
|
|
471
|
-
} catch {
|
|
472
|
-
o?.src && URL.revokeObjectURL(o.src);
|
|
473
|
-
}
|
|
474
|
-
o || n(Ot);
|
|
475
|
-
}), loadImageDetails: async (e, t = null) => {
|
|
476
|
-
let r = null;
|
|
477
|
-
const n = async () => {
|
|
478
|
-
try {
|
|
479
|
-
const a = t ?? "image/*", i = URL.createObjectURL(new Blob([e], { type: a })), l = await lt(i);
|
|
480
|
-
r = { mimeType: a, naturalDimensions: l, asUrl: i };
|
|
481
|
-
} catch {
|
|
482
|
-
}
|
|
483
|
-
}, o = async () => {
|
|
484
|
-
try {
|
|
485
|
-
const a = new TextDecoder().decode(e), i = URL.createObjectURL(new Blob([a], { type: P })), l = await lt(i);
|
|
486
|
-
r = { mimeType: t ?? P, naturalDimensions: l, asUrl: i, asSVGText: a };
|
|
487
|
-
} catch {
|
|
488
|
-
}
|
|
489
|
-
};
|
|
490
|
-
if (t === P ? await o() : t.startsWith("image/") ? await n() : (await n(), r || await o()), !r) throw new Error("Failed to load image");
|
|
491
|
-
return r;
|
|
492
|
-
} }, Symbol.toStringTag, { value: "Module" })), (ct = st || (st = {})).resolveTypedUpdates = (e, t, r, n) => {
|
|
493
|
-
if (e === null) return e;
|
|
494
|
-
if (e === void 0) return n;
|
|
495
|
-
let o = e;
|
|
496
|
-
if (t?.shorthand) {
|
|
497
|
-
const s = t?.shorthand(e, r);
|
|
498
|
-
s !== void 0 && (o = s);
|
|
499
|
-
}
|
|
500
|
-
if (o !== null && t?.getSubType) {
|
|
501
|
-
const s = t.getSubType(o);
|
|
502
|
-
s && (t = s);
|
|
503
|
-
}
|
|
504
|
-
const a = t?.properties, i = t?.arrayType ?? !1;
|
|
505
|
-
let l = o;
|
|
506
|
-
if (t && t.merge && l && n) l = t.merge(l, n, r);
|
|
507
|
-
else if (!i && a) {
|
|
508
|
-
const s = Object.keys({ ...o, ...n });
|
|
509
|
-
l = null;
|
|
510
|
-
for (let c = 0; c < s.length; c++) {
|
|
511
|
-
const d = s[c];
|
|
512
|
-
let w, u = o[d];
|
|
513
|
-
if (u !== void 0) {
|
|
514
|
-
const f = a[d];
|
|
515
|
-
w = f ? (0, ct.resolveTypedUpdates)(u, f, r, n?.[d]) : u;
|
|
516
|
-
} else w = n?.[d];
|
|
517
|
-
w != null && (l = l ?? {}, l[d] = w);
|
|
518
|
-
}
|
|
519
|
-
}
|
|
520
|
-
return l;
|
|
521
|
-
};
|
|
522
|
-
const ut = `The Safari browser does not support advanced copy and paste.
|
|
523
|
-
Copy and paste will be limited to within the browser tab.
|
|
524
|
-
|
|
525
|
-
Please use Chrome or Edge if external copy and paste is required.`, k = `You do not have permissions to access the clipboard.
|
|
526
|
-
All copy and paste operations will be limited to the browser tab.`, It = { Safari: `The Safari browser does not support advanced copy and paste.
|
|
527
|
-
Copy and paste will be limited to within the browser tab.
|
|
528
|
-
|
|
529
|
-
Please use Chrome or Edge if external copy and paste is required.`, Perms: k, PermsWrite: T() === y.Safari ? ut : k, PermsRead: T() === y.Safari ? ut : k }, N = async () => new Promise((e) => {
|
|
530
|
-
document.hasFocus() ? e() : globalThis.addEventListener?.("focus", () => {
|
|
531
|
-
e();
|
|
532
|
-
}, { once: !0 }), document.activeElement.focus?.();
|
|
533
|
-
}), B = async (e, t, r) => {
|
|
534
|
-
if (T() === y.Safari) return await r(new Error(It.Safari));
|
|
535
|
-
try {
|
|
536
|
-
const n = async (i) => {
|
|
537
|
-
try {
|
|
538
|
-
return await i();
|
|
539
|
-
} catch (l) {
|
|
540
|
-
if (l.message?.includes("Document is not focused")) return !1;
|
|
541
|
-
throw l;
|
|
542
|
-
}
|
|
543
|
-
}, o = await globalThis?.navigator?.permissions?.query({ name: e, allowWithoutGesture: !0, allowWithoutSanitization: !0 });
|
|
544
|
-
let a = !1;
|
|
545
|
-
if (o.state === "prompt" && (a = await n(t)), a || o.state !== "granted" || (a = await t()), !a) return await r(new Error(o.state));
|
|
546
|
-
} catch (n) {
|
|
547
|
-
return n.message === "No valid data on clipboard" || n.name === "DataError" ? void 0 : await r(n);
|
|
548
|
-
}
|
|
549
|
-
}, jt = async (e) => {
|
|
550
|
-
try {
|
|
551
|
-
return await e.read({ unsanitized: [h] });
|
|
552
|
-
} catch {
|
|
553
|
-
}
|
|
554
|
-
return await e.read();
|
|
555
|
-
};
|
|
556
|
-
if (!globalThis.ClipboardItem) {
|
|
557
|
-
const e = (r, n) => new Blob([n], { type: r });
|
|
558
|
-
class t {
|
|
559
|
-
constructor(n, o) {
|
|
560
|
-
this._items = {}, this._types = Object.keys(n);
|
|
561
|
-
const a = {}, i = Object.keys(n);
|
|
562
|
-
for (let l = 0; l < i.length; l++) {
|
|
563
|
-
const s = i[l];
|
|
564
|
-
let c = n[s];
|
|
565
|
-
a[s] = typeof c == "string" ? e(s, c) : c;
|
|
566
|
-
}
|
|
567
|
-
this._items = a, this._presentationStyle = o?.presentationStyle ?? "unspecified";
|
|
568
|
-
}
|
|
569
|
-
get types() {
|
|
570
|
-
return this._types;
|
|
571
|
-
}
|
|
572
|
-
getType(n) {
|
|
573
|
-
return Promise.resolve(this._items[n]);
|
|
574
|
-
}
|
|
575
|
-
supports(n) {
|
|
576
|
-
return !0;
|
|
577
|
-
}
|
|
578
|
-
}
|
|
579
|
-
globalThis.ClipboardItem = t;
|
|
580
|
-
}
|
|
581
|
-
const V = async (e, t = h) => new Promise(async (r, n) => {
|
|
582
|
-
try {
|
|
583
|
-
const o = await (async (a, i) => {
|
|
584
|
-
if (!a) return null;
|
|
585
|
-
const l = await jt(a);
|
|
586
|
-
let s = !1;
|
|
587
|
-
for (let c = 0; !s && l && c < l.length; c++) if (s = l[c].types.includes(i), s) return await l[c].getType(i);
|
|
588
|
-
return s ? void 0 : null;
|
|
589
|
-
})(e, t);
|
|
590
|
-
if (o) {
|
|
591
|
-
const a = new FileReader();
|
|
592
|
-
a.onload = () => {
|
|
593
|
-
r(a.result);
|
|
594
|
-
}, a.onerror = () => {
|
|
595
|
-
r("");
|
|
596
|
-
}, a.readAsText(o);
|
|
597
|
-
} else r("");
|
|
598
|
-
} catch (o) {
|
|
599
|
-
n(o);
|
|
600
|
-
}
|
|
601
|
-
}), dt = async (e, t = h) => {
|
|
602
|
-
const r = await V(e, t);
|
|
603
|
-
if (!r) return null;
|
|
604
|
-
let n = null;
|
|
605
|
-
try {
|
|
606
|
-
n = new DOMParser().parseFromString(r, h);
|
|
607
|
-
} catch {
|
|
608
|
-
console.warn("Can't parse html from clipboard.");
|
|
609
|
-
}
|
|
610
|
-
return n;
|
|
611
|
-
}, C = "clipboard-uuid", v = "web text/uuid", ft = (e) => `<div style="display:none" ${C}="${e}"/>`, Wt = (e, t) => {
|
|
612
|
-
let r = null;
|
|
613
|
-
try {
|
|
614
|
-
const n = new DOMParser().parseFromString(t, h);
|
|
615
|
-
n.body.firstElementChild.setAttribute(C, e), r = n.getElementsByTagName("body")[0].innerHTML;
|
|
616
|
-
} catch (n) {
|
|
617
|
-
console.warn("Can't embed uuid.", n);
|
|
618
|
-
}
|
|
619
|
-
return r;
|
|
620
|
-
}, pt = (e, t) => {
|
|
621
|
-
if (!t || !e) return !1;
|
|
622
|
-
try {
|
|
623
|
-
const r = t.querySelectorAll(`[${C}="${e}"]`);
|
|
624
|
-
if (r && r.length === 1) return !0;
|
|
625
|
-
if (t.querySelector("parsererror")) throw new Error("We are unable to parse node");
|
|
626
|
-
return !1;
|
|
627
|
-
} catch {
|
|
628
|
-
return !1;
|
|
629
|
-
}
|
|
630
|
-
};
|
|
631
|
-
class wt {
|
|
632
|
-
constructor(t) {
|
|
633
|
-
if (t?.nativeClipboard === void 0 || t?.nativeClipboard === !0) try {
|
|
634
|
-
this._nativeClipboard = globalThis?.navigator.clipboard;
|
|
635
|
-
} catch {
|
|
636
|
-
t?.nativeClipboard === !0 && console.warn("NativeClipboard option set to true but no native clipboard available.");
|
|
637
|
-
}
|
|
638
|
-
else this._nativeClipboard = t?.nativeClipboard === !1 ? null : t?.nativeClipboard;
|
|
639
|
-
this._disableCheckOnFocus = t?.disableCheckOnFocus ?? !1, this._init();
|
|
640
|
-
}
|
|
641
|
-
async _checkForChanges() {
|
|
642
|
-
this._nativeClipboard && this._state && !this._disableCheckOnFocus && await B("clipboard-read", async () => {
|
|
643
|
-
await N();
|
|
644
|
-
const t = await V(this._nativeClipboard, v);
|
|
645
|
-
if (!this._state || t && t === this._state.uuid) return !0;
|
|
646
|
-
const r = await dt(this._nativeClipboard, h);
|
|
647
|
-
return !this._state || (pt(this._state.uuid, r) || this.clear(), !0);
|
|
648
|
-
}, async (t) => {
|
|
649
|
-
t?.message === "denied" || t.message?.includes("Document is not focused") || T() === y.Safari || console.warn("Unable to detect clipboard changes: ", t);
|
|
650
|
-
});
|
|
651
|
-
}
|
|
652
|
-
_init() {
|
|
653
|
-
const t = this;
|
|
654
|
-
this._listeners = /* @__PURE__ */ new Map(), this._listenersCapture = /* @__PURE__ */ new Map(), this._state = null, this._nativeClipboard && (this._onFocus = () => {
|
|
655
|
-
t._checkForChanges();
|
|
656
|
-
}, this._onBlur = () => {
|
|
657
|
-
globalThis.addEventListener?.("focus", t._onFocus, { once: !0 });
|
|
658
|
-
}, globalThis.addEventListener?.("blur", this._onBlur), this._nativeClipboard.addEventListener("clipboardchange", (r) => {
|
|
659
|
-
t._checkForChanges();
|
|
660
|
-
}));
|
|
661
|
-
}
|
|
662
|
-
async read() {
|
|
663
|
-
if (!this._nativeClipboard) return this._state?.items ?? null;
|
|
664
|
-
const t = this;
|
|
665
|
-
return await B("clipboard-read", async () => {
|
|
666
|
-
if (await N(), this._state?.uuid) {
|
|
667
|
-
const r = await V(this._nativeClipboard, v);
|
|
668
|
-
if (r && r === t._state.uuid) return !0;
|
|
669
|
-
const n = await dt(this._nativeClipboard, h);
|
|
670
|
-
if (pt(t._state?.uuid, n)) return !0;
|
|
671
|
-
}
|
|
672
|
-
return t._state = { items: await jt(this._nativeClipboard), uuid: null, ref: null }, this.dispatchEvent(new Event("clipboardread")), !0;
|
|
673
|
-
}, async (r) => {
|
|
674
|
-
this.dispatchEvent(new Event("clipboarderrorread"));
|
|
675
|
-
}), this._state?.items ?? [];
|
|
676
|
-
}
|
|
677
|
-
async write(t) {
|
|
678
|
-
return this._write({ uuid: R(), items: t, ref: null });
|
|
679
|
-
}
|
|
680
|
-
async _write(t) {
|
|
681
|
-
if (!this._nativeClipboard) return this._state = t, this.dispatchEvent(new Event("clipboardwrite")), this.dispatchEvent(new Event("clipboardchange")), null;
|
|
682
|
-
const r = this, n = [], o = t.uuid;
|
|
683
|
-
let a = t.items ?? [];
|
|
684
|
-
const i = () => {
|
|
685
|
-
r._state = { uuid: o, ref: t.ref, items: n }, r.dispatchEvent(new Event("clipboardwrite")), r.dispatchEvent(new Event("clipboardchange"));
|
|
686
|
-
};
|
|
687
|
-
await B("clipboard-write", async () => {
|
|
688
|
-
await N(), o && a.length === 0 && (a.push(new ClipboardItem({ [v]: new Blob([o], { type: v }) })), a.push(new ClipboardItem({ [h]: new Blob([ft(o)], { type: h }) })));
|
|
689
|
-
for (let l = 0; l < Math.min(1, a.length); l++) {
|
|
690
|
-
const s = a[l];
|
|
691
|
-
let c = s.types.indexOf(h), d = null;
|
|
692
|
-
if (c !== -1) {
|
|
693
|
-
const f = await s.getType(h);
|
|
694
|
-
d = await W(f), d && (d = Wt(o, d));
|
|
695
|
-
}
|
|
696
|
-
if (!d && s.types.includes(b)) {
|
|
697
|
-
const f = await s.getType(b);
|
|
698
|
-
if (f) {
|
|
699
|
-
let p = null;
|
|
700
|
-
typeof f == "string" ? (console.warn("text as string", f), p = f) : p = await W(f), p && (d = `<div ${C}="${o}">${p}</div>`);
|
|
701
|
-
}
|
|
702
|
-
}
|
|
703
|
-
if (!d && s.types.includes(L)) {
|
|
704
|
-
const f = await s.getType(L), p = xt(await f.arrayBuffer());
|
|
705
|
-
d = `<div ${C}="${o}"><img src="${_t + p}"/></div>`;
|
|
706
|
-
}
|
|
707
|
-
!d && o && (d = ft(o));
|
|
708
|
-
const w = new Blob([d ?? ""], { type: h }), u = {};
|
|
709
|
-
for (let f = 0; f < s.types.length; f++) {
|
|
710
|
-
const p = s.types[f];
|
|
711
|
-
u[p] = f === c ? w : s.getType(p);
|
|
712
|
-
}
|
|
713
|
-
d && c === -1 && (u[h] = w), o && (u[v] = new Blob([o], { type: v })), n.push(new ClipboardItem(u));
|
|
714
|
-
}
|
|
715
|
-
try {
|
|
716
|
-
n && n.length !== 0 ? await this._nativeClipboard.write(n) : await (async (l) => {
|
|
717
|
-
l && await l.writeText("");
|
|
718
|
-
})(this._nativeClipboard);
|
|
719
|
-
} catch (l) {
|
|
720
|
-
l.message?.includes("Document is not focused") || console.warn("Unable to write to native clipboard: ", l);
|
|
721
|
-
}
|
|
722
|
-
return i(), !0;
|
|
723
|
-
}, async (l) => {
|
|
724
|
-
this.dispatchEvent(new Event("clipboarderrorwrite")), i();
|
|
725
|
-
});
|
|
726
|
-
}
|
|
727
|
-
async writeReference(t) {
|
|
728
|
-
if (!t) return void this.clear();
|
|
729
|
-
let r = null;
|
|
730
|
-
const n = {};
|
|
731
|
-
try {
|
|
732
|
-
const a = await t.toText?.() ?? null;
|
|
733
|
-
a && (n[b] = new Blob([a ?? ""], { type: b }));
|
|
734
|
-
} catch (a) {
|
|
735
|
-
r = a;
|
|
736
|
-
}
|
|
737
|
-
try {
|
|
738
|
-
const a = await t.toHtml?.() ?? null;
|
|
739
|
-
a && (n[h] = new Blob([a], { type: h }));
|
|
740
|
-
} catch (a) {
|
|
741
|
-
r = a, console.warn("export to html", a);
|
|
742
|
-
}
|
|
743
|
-
try {
|
|
744
|
-
const a = await t.toImage?.() ?? null;
|
|
745
|
-
a && (n[L] = a);
|
|
746
|
-
} catch (a) {
|
|
747
|
-
r = a, console.warn("export to png", a);
|
|
748
|
-
}
|
|
749
|
-
const o = this._write({ uuid: R(), ref: t, items: Object.keys(n).length > 0 ? [new ClipboardItem(n)] : null });
|
|
750
|
-
if (r) throw r;
|
|
751
|
-
return o;
|
|
752
|
-
}
|
|
753
|
-
clear(t = !1) {
|
|
754
|
-
this._state && (this._state = null, t && this._write({ uuid: null, ref: null, items: null }), this.dispatchEvent(new Event("clipboardwrite")), this.dispatchEvent(new Event("clipboardchange")));
|
|
755
|
-
}
|
|
756
|
-
async readReference() {
|
|
757
|
-
return await this.read(), this._state?.ref ?? null;
|
|
758
|
-
}
|
|
759
|
-
readText() {
|
|
760
|
-
return new Promise(async (t, r) => {
|
|
761
|
-
const n = await this.read();
|
|
762
|
-
let o = null;
|
|
763
|
-
for (let i = 0; !o && n && i < n.length; i++) n[i].types.includes(b) && (o = await n[i].getType(b));
|
|
764
|
-
if (!o) return void t("");
|
|
765
|
-
const a = new FileReader();
|
|
766
|
-
a.onload = () => {
|
|
767
|
-
t(a.result);
|
|
768
|
-
}, a.readAsText(o), a.onerror = (i) => {
|
|
769
|
-
r(i);
|
|
770
|
-
};
|
|
771
|
-
});
|
|
772
|
-
}
|
|
773
|
-
async writeText(t) {
|
|
774
|
-
const r = [new ClipboardItem({ [b]: new Blob([t], { type: b }) })];
|
|
775
|
-
return this._write({ uuid: R(), items: r, ref: null });
|
|
776
|
-
}
|
|
777
|
-
addEventListener(t, r, n = {}) {
|
|
778
|
-
const o = n?.capture ? this._listenersCapture : this._listeners;
|
|
779
|
-
let a = o.get(t);
|
|
780
|
-
a || (a = /* @__PURE__ */ new Map(), o.set(t, a)), a.set(r, typeof n == "boolean" ? {} : n);
|
|
781
|
-
}
|
|
782
|
-
dispatchEvent(t) {
|
|
783
|
-
if (!t) return;
|
|
784
|
-
const r = (n) => {
|
|
785
|
-
const o = n.get(t.type);
|
|
786
|
-
o && o.forEach((a, i) => {
|
|
787
|
-
try {
|
|
788
|
-
typeof i == "function" ? i(t) : i.handleEvent && i.handleEvent(t), a.once && o.delete(i);
|
|
789
|
-
} catch (l) {
|
|
790
|
-
console.warn(l);
|
|
791
|
-
}
|
|
792
|
-
});
|
|
793
|
-
};
|
|
794
|
-
return r(this._listenersCapture), r(this._listeners), !0;
|
|
795
|
-
}
|
|
796
|
-
removeEventListener(t, r, n) {
|
|
797
|
-
const o = n?.capture ? this._listenersCapture : this._listeners, a = o.get(t);
|
|
798
|
-
a && (a.delete(r), a.size === 0 && o.delete(t));
|
|
799
|
-
}
|
|
800
|
-
close() {
|
|
801
|
-
globalThis.removeEventListener?.("focus", this._onFocus), globalThis.removeEventListener?.("blur", this._onBlur);
|
|
802
|
-
}
|
|
803
|
-
}
|
|
804
|
-
var z;
|
|
805
|
-
(z = wt || (wt = {})).ErrorMessages = It, z.Global = new z();
|
|
806
|
-
let ht = null, q = null, M = null;
|
|
807
|
-
const Vt = Object.freeze({ compileTypescript: async function(e) {
|
|
808
|
-
if (!e?.source) return null;
|
|
809
|
-
if (q && $t.deepEqual(q, e)) return ht;
|
|
810
|
-
const t = await async function() {
|
|
811
|
-
if (M) return M;
|
|
812
|
-
const { TypeScriptCompiler: n } = await import("./Cqf8ZomeNI_0U-UD.mjs");
|
|
813
|
-
return M = new n(), M;
|
|
814
|
-
}(), r = await t.compileModule(e);
|
|
815
|
-
return ht = r, q = e, r;
|
|
816
|
-
} }), Gt = Object.freeze(Object.defineProperty({ __proto__: null, ScriptingUtils: Vt }, Symbol.toStringTag, { value: "Module" }));
|
|
817
|
-
export {
|
|
818
|
-
$t as $,
|
|
819
|
-
Gt as i
|
|
820
|
-
};
|