@sheetxl/sdk 0.4.20 → 0.4.22

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.
Files changed (105) hide show
  1. package/browser/cjs/7IXJLhV4t0ot3XB5.cjs +7 -0
  2. package/browser/cjs/{CHIrWDL1wDd2pj7r.cjs → 88wgo6pjVpM9y5ul.cjs} +1 -1
  3. package/browser/cjs/{CgISg2QUFvnxelIg.cjs → B1FA-mZrhIhB8VoC.cjs} +1 -1
  4. package/browser/cjs/{HoZidg9qBDX62oNO.cjs → BFSSWIb-BPsXlS8k.cjs} +1 -1
  5. package/browser/cjs/{lTo12h7XrLmPRVhi.cjs → BG_fhZO0IruefQYx.cjs} +1 -1
  6. package/browser/cjs/{aBAvcAfOvtWy7o9B.cjs → BHMiYQTwGjWzRdGf.cjs} +1 -1
  7. package/browser/cjs/{We0naT5G_vQo6RkK.cjs → BSj9kpCBxyd5EZvX.cjs} +1 -1
  8. package/browser/cjs/{B8nuUUIsnE-6vbAQ.cjs → BYwSD92n1THKdj9V.cjs} +1 -1
  9. package/browser/cjs/{CW9IcRQqCCBSJ1g0.cjs → Bein9-S48RBhhxLW.cjs} +1 -1
  10. package/browser/cjs/{C4KbNJbRD0LfrFFV.cjs → CFE-vojYpMggdKVQ.cjs} +1 -1
  11. package/browser/cjs/{BTPJz0JSs5PWhtbO.cjs → CGslljb6hC8DcpsE.cjs} +1 -1
  12. package/browser/cjs/{gn5aPOY6C-poXjky.cjs → CV_Kse7BQ7sBx0S2.cjs} +1 -1
  13. package/browser/cjs/{BfMzZ_GULllzBk6l.cjs → CW7Kbm45TFbAZYO3.cjs} +1 -1
  14. package/browser/cjs/{ZJeHuklpnM-x2Uor.cjs → Cx69pnzjeLfQMYgm.cjs} +1 -1
  15. package/browser/cjs/{BVwLRpPOJOkPiLVI.cjs → D1ZVN_gmSiXwUeCX.cjs} +1 -1
  16. package/browser/cjs/D1uvbAWH1atUhVUP.cjs +53 -0
  17. package/browser/cjs/{BvS85P-7zLIudyqb.cjs → D2eWn6G2QvkYzR0D.cjs} +1 -1
  18. package/browser/cjs/{CYueUIoDZwYE9fRk.cjs → D3ZDdkSutmtUfAG2.cjs} +1 -1
  19. package/browser/cjs/{BTa_vDbaAzt6YXV1.cjs → DItG5mSJNZ40zltg.cjs} +1 -1
  20. package/browser/cjs/{XxdMKuC0y29VOQ05.cjs → DMROSNSDJaUVqfoW.cjs} +1 -1
  21. package/browser/cjs/{Bw07AlLqg6ZIoMRL.cjs → DWG2lOB7T0SRr5Ni.cjs} +1 -1
  22. package/browser/cjs/Dub6MS5nk4D_Iv7p.cjs +124 -0
  23. package/browser/cjs/{BHa5nV8AH6dlgs29.cjs → Ko4UgjHi20zmyEpu.cjs} +1 -1
  24. package/browser/cjs/{CxXM6xsDd2bFDSNd.cjs → OgnqbIZEb37S4Hcz.cjs} +1 -1
  25. package/browser/cjs/{BkFMWwFWaisNXSf2.cjs → SkNXytY6UX9i6WhY.cjs} +2 -2
  26. package/browser/cjs/{CFwigDisNJzRlbSY.cjs → ZyyHV9ugA--j9V3Q.cjs} +1 -1
  27. package/browser/cjs/index.cjs +2 -2
  28. package/browser/cjs/{D9SMcp02EIWqiYk0.cjs → rPn2U0Q2Eagh41Xd.cjs} +1 -1
  29. package/browser/esm/{DK_FQ6Q7AZUprApR.mjs → -z0NclKcw0SSbo2L.mjs} +7603 -8898
  30. package/browser/esm/{DuvsEieHOiBb-GPZ.mjs → 45xuwq8di_97VrOg.mjs} +1 -1
  31. package/browser/esm/{CDbE_dl8edWRC33Z.mjs → B5M_o8HB4RRWBd_Y.mjs} +1 -1
  32. package/browser/esm/{9tFMamEgahdtRDzr.mjs → BANL0IBU0th0Z0aE.mjs} +1 -1
  33. package/browser/esm/{DOK9VvFQyTAsf7SL.mjs → BE-hRu2cYg4ljCeu.mjs} +1 -1
  34. package/browser/esm/{BNS7zLc3zoynBPYO.mjs → BcSVj-rRzZCTKFUS.mjs} +6 -4
  35. package/browser/esm/{DIePzm-XT-alFdDB.mjs → BsPKTSv0eCvPH73D.mjs} +1 -1
  36. package/{node/esm/Bqc8bvJoWC0_qUKU.mjs → browser/esm/C1VWw92RN5017GH2.mjs} +1 -1
  37. package/{node/esm/iYqJLAQld4jtK1Be.mjs → browser/esm/C1m7sGNTYP1bb_Uu.mjs} +1 -1
  38. package/{node/esm/DdDDFLZKFx1DAkKM.mjs → browser/esm/CB1_HpaA6RdaxTgB.mjs} +1 -1
  39. package/browser/esm/{DV9p0Ai4HUPYjT-H.mjs → CESAJuxgB8SgHaC0.mjs} +2 -2
  40. package/browser/esm/{_q37vK_NIykwwqbg.mjs → CF-2-aQTgc-DoXzn.mjs} +1 -1
  41. package/{node/esm/CivKgcEQiXpDFLHE.mjs → browser/esm/CIOhVshLBBACTKw4.mjs} +1 -1
  42. package/{node/esm/DlNI2fuUSYxsUPt8.mjs → browser/esm/CMSKXl6rbx5miTNQ.mjs} +1 -1
  43. package/{node/esm/D3YTY3N6YHU69ymA.mjs → browser/esm/CiTlupx_cuXQySFz.mjs} +1 -1
  44. package/browser/esm/{DoIENSc8L0Rof6Kz.mjs → D3P3XCQVij2nAmi9.mjs} +46 -44
  45. package/{node/esm/bIOUtGNQ6YQktkYZ.mjs → browser/esm/D6IgoU0LlIv_Vb4m.mjs} +1 -1
  46. package/{node/esm/DaJrKgrSikJvUv0q.mjs → browser/esm/DDHWZD7Y6pihyVio.mjs} +1 -1
  47. package/browser/esm/{mxJXDPqwl0wNxd66.mjs → DEAxRkKlMDxHooJB.mjs} +1 -1
  48. package/browser/esm/{BcUYcXaMbk6W8AWk.mjs → DI52n-xcpb7jEqop.mjs} +1 -1
  49. package/{node/esm/DP9RiXAeb1fiRFpG.mjs → browser/esm/Dd2ZeNLusT_ZXcoE.mjs} +1 -1
  50. package/browser/esm/{fP2GLQ5W7VVbn5TA.mjs → E-RGQA1dKJwkkonk.mjs} +1 -1
  51. package/{node/esm/aF3uflTbayaEj07D.mjs → browser/esm/NvmvIR3jfjlY98jJ.mjs} +1 -1
  52. package/browser/esm/{BoB-LPOX1uKjZhKH.mjs → OABZjfPgUYHzd5rY.mjs} +1 -1
  53. package/browser/esm/{BNURhfAYTEVJWTYT.mjs → XxsAmmMnL6UJ_NtN.mjs} +1 -1
  54. package/browser/esm/{io70M3K8dlSe5V-4.mjs → ease-qEarwjnTOzw.mjs} +1 -1
  55. package/browser/esm/index.mjs +54 -82
  56. package/{node/esm/HTDFLMWuQb82Y-GF.mjs → browser/esm/pyVBYhEMGgaVvnd1.mjs} +1 -1
  57. package/licenses/dependencies.txt +0 -66
  58. package/node/esm/{9tFMamEgahdtRDzr.mjs → BANL0IBU0th0Z0aE.mjs} +1 -1
  59. package/node/esm/{DOK9VvFQyTAsf7SL.mjs → BE-hRu2cYg4ljCeu.mjs} +1 -1
  60. package/node/esm/{BpBhk74DpxGo00aZ.mjs → BFQWsItEwIA8MHSr.mjs} +1 -1
  61. package/{browser/esm/Bqc8bvJoWC0_qUKU.mjs → node/esm/C1VWw92RN5017GH2.mjs} +1 -1
  62. package/{browser/esm/iYqJLAQld4jtK1Be.mjs → node/esm/C1m7sGNTYP1bb_Uu.mjs} +1 -1
  63. package/node/esm/{B7ZcsKf8cxOEMq7p.mjs → C2cb5mfR_vAlX9Fe.mjs} +1 -1
  64. package/node/esm/{CDjHCv3dEEOY9Foy.mjs → C5pshc3Ik9rfVQTG.mjs} +1 -1
  65. package/{browser/esm/DdDDFLZKFx1DAkKM.mjs → node/esm/CB1_HpaA6RdaxTgB.mjs} +1 -1
  66. package/node/esm/{MrOJ8ENTixputV8_.mjs → CE5UUdZ8bidtZxVI.mjs} +362 -360
  67. package/{browser/esm/CivKgcEQiXpDFLHE.mjs → node/esm/CIOhVshLBBACTKw4.mjs} +1 -1
  68. package/{browser/esm/DlNI2fuUSYxsUPt8.mjs → node/esm/CMSKXl6rbx5miTNQ.mjs} +1 -1
  69. package/node/esm/{Tl8jbxaeK1y9aMPJ.mjs → CNmI4DKpe0t8gN4o.mjs} +1 -1
  70. package/node/esm/{BXc12GgwQ08R7S8e.mjs → CPs770aIZwPh6mF0.mjs} +1 -1
  71. package/node/esm/{rpVHlxg6GM8pJL5c.mjs → Cb6FcT6gppjhiDSw.mjs} +253 -251
  72. package/{browser/esm/D3YTY3N6YHU69ymA.mjs → node/esm/CiTlupx_cuXQySFz.mjs} +1 -1
  73. package/{browser/esm/bIOUtGNQ6YQktkYZ.mjs → node/esm/D6IgoU0LlIv_Vb4m.mjs} +1 -1
  74. package/{browser/esm/DaJrKgrSikJvUv0q.mjs → node/esm/DDHWZD7Y6pihyVio.mjs} +1 -1
  75. package/node/esm/{mxJXDPqwl0wNxd66.mjs → DEAxRkKlMDxHooJB.mjs} +1 -1
  76. package/{browser/esm/DP9RiXAeb1fiRFpG.mjs → node/esm/Dd2ZeNLusT_ZXcoE.mjs} +1 -1
  77. package/node/esm/{C6lX28OYg20N0MeO.mjs → DzsYVdrM0pVVPfdv.mjs} +1 -1
  78. package/{browser/esm/aF3uflTbayaEj07D.mjs → node/esm/NvmvIR3jfjlY98jJ.mjs} +1 -1
  79. package/node/esm/{BNURhfAYTEVJWTYT.mjs → XxsAmmMnL6UJ_NtN.mjs} +1 -1
  80. package/node/esm/{io70M3K8dlSe5V-4.mjs → ease-qEarwjnTOzw.mjs} +1 -1
  81. package/node/esm/index.mjs +12252 -13543
  82. package/{browser/esm/HTDFLMWuQb82Y-GF.mjs → node/esm/pyVBYhEMGgaVvnd1.mjs} +1 -1
  83. package/node/esm/{CHnRYVDwiNY7YZxQ.mjs → xlM5nOnBp3h54uCb.mjs} +1 -1
  84. package/package.json +4 -4
  85. package/browser/cjs/BRvrxzKBJ-g1N73t.cjs +0 -1501
  86. package/browser/cjs/Ba3X8U1ch1pBFv_a.cjs +0 -124
  87. package/browser/cjs/C2DyH3SwPIgmFosH.cjs +0 -7
  88. package/browser/cjs/CEW45o7VnarqfsgH.cjs +0 -6
  89. package/browser/cjs/CZ4_zpdkkZ0zH7aN.cjs +0 -6
  90. package/browser/cjs/CbYFnsibjJUHV0xm.cjs +0 -6
  91. package/browser/cjs/D_zdscoLJ72sNgWv.cjs +0 -32
  92. package/browser/cjs/mf_wa0ubPjGaRkSW.cjs +0 -13
  93. package/browser/cjs/wcsUsHAbDuK3rvVp.cjs +0 -60
  94. package/browser/esm/B0RFp5vlJWj9U4Wn.mjs +0 -29
  95. package/browser/esm/BikAM7lQn1NrVPNP.mjs +0 -21
  96. package/browser/esm/C0d1-jgvvUt3Bpg9.mjs +0 -472
  97. package/browser/esm/CqYcEZmhnI3bq0wV.mjs +0 -820
  98. package/browser/esm/DbvBy4EEBdPhE-8G.mjs +0 -24
  99. package/browser/esm/DhIglmQyhLXPjrbo.mjs +0 -1575
  100. package/node/esm/BI2k0XM8cAqRUH3e.mjs +0 -80
  101. package/node/esm/BPSX88j1UHZNFlgn.mjs +0 -14
  102. package/node/esm/BcQcJWzyihj46-gX.mjs +0 -454
  103. package/node/esm/C4d62D9fLTRjV7rI.mjs +0 -29
  104. package/node/esm/D_13otLly5j8n5Gg.mjs +0 -813
  105. package/node/esm/Dsf-AEKpZlzGOrcG.mjs +0 -16
@@ -1,820 +0,0 @@
1
- /**
2
- * @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.4.20
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("./B0RFp5vlJWj9U4Wn.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
- };