@unicom-cloud/utils 0.1.31 → 0.1.32

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 (287) hide show
  1. package/case-name/index.js +1 -1
  2. package/caseName.js +1 -1
  3. package/class-name/index.js +6 -5
  4. package/className.js +1 -1
  5. package/clipboard-copy/index.js +1 -1
  6. package/clipboardCopy.js +1 -1
  7. package/constant/address.js +1 -1
  8. package/constant/chineseCharacters.js +1 -1
  9. package/constant/constellations.js +1 -1
  10. package/constant/domain.js +1 -1
  11. package/constant/emoji.js +1 -1
  12. package/constant/identity.js +1 -1
  13. package/constant/index.js +1 -1
  14. package/constant/isMobile.js +7 -0
  15. package/constant/keyboardCode.js +1 -1
  16. package/constant/licensePlate.js +1 -1
  17. package/constant/name.js +1 -1
  18. package/constant/platform.js +18 -17
  19. package/constant/protocol.js +1 -1
  20. package/constant/string.js +1 -1
  21. package/constant/ui.js +1 -1
  22. package/constant.js +1 -1
  23. package/content-disposition/index.js +1 -1
  24. package/contentDisposition.js +1 -1
  25. package/cookie/index.js +1 -1
  26. package/cookie/src/api.js +1 -1
  27. package/cookie/src/assign.js +1 -1
  28. package/cookie/src/converter.js +1 -1
  29. package/cookie.js +1 -1
  30. package/date/convertTime.js +1 -1
  31. package/date/convertToDuration.js +1 -1
  32. package/date/index.js +1 -1
  33. package/date.js +1 -1
  34. package/decimal/decimal.js +1 -1
  35. package/decimal/index.js +1 -1
  36. package/decimal.js +1 -1
  37. package/dom-helpers/activeElement.js +1 -1
  38. package/dom-helpers/addClass.js +1 -1
  39. package/dom-helpers/addEventListener.js +1 -1
  40. package/dom-helpers/animate.js +1 -1
  41. package/dom-helpers/animationFrame.js +1 -1
  42. package/dom-helpers/attribute.js +1 -1
  43. package/dom-helpers/camelize.js +1 -1
  44. package/dom-helpers/camelizeStyle.js +1 -1
  45. package/dom-helpers/canUseDOM.js +1 -1
  46. package/dom-helpers/childElements.js +1 -1
  47. package/dom-helpers/childNodes.js +1 -1
  48. package/dom-helpers/clear.js +1 -1
  49. package/dom-helpers/closest.js +1 -1
  50. package/dom-helpers/collectElements.js +1 -1
  51. package/dom-helpers/collectSiblings.js +1 -1
  52. package/dom-helpers/contains.js +1 -1
  53. package/dom-helpers/css.js +1 -1
  54. package/dom-helpers/filterEventHandler.js +1 -1
  55. package/dom-helpers/getComputedStyle.js +1 -1
  56. package/dom-helpers/getScrollAccessor.js +1 -1
  57. package/dom-helpers/hasClass.js +1 -1
  58. package/dom-helpers/height.js +1 -1
  59. package/dom-helpers/hyphenate.js +1 -1
  60. package/dom-helpers/hyphenateStyle.js +1 -1
  61. package/dom-helpers/index.js +1 -1
  62. package/dom-helpers/insertAfter.js +1 -1
  63. package/dom-helpers/isDocument.js +1 -1
  64. package/dom-helpers/isInput.js +1 -1
  65. package/dom-helpers/isTransform.js +1 -1
  66. package/dom-helpers/isVisible.js +1 -1
  67. package/dom-helpers/isWindow.js +1 -1
  68. package/dom-helpers/listen.js +1 -1
  69. package/dom-helpers/matches.js +1 -1
  70. package/dom-helpers/nextUntil.js +1 -1
  71. package/dom-helpers/offset.js +1 -1
  72. package/dom-helpers/offsetParent.js +1 -1
  73. package/dom-helpers/ownerDocument.js +1 -1
  74. package/dom-helpers/ownerWindow.js +1 -1
  75. package/dom-helpers/parents.js +1 -1
  76. package/dom-helpers/position.js +1 -1
  77. package/dom-helpers/prepend.js +1 -1
  78. package/dom-helpers/querySelectorAll.js +1 -1
  79. package/dom-helpers/reflow.js +1 -1
  80. package/dom-helpers/remove.js +1 -1
  81. package/dom-helpers/removeClass.js +1 -1
  82. package/dom-helpers/removeEventListener.js +1 -1
  83. package/dom-helpers/scrollLeft.js +1 -1
  84. package/dom-helpers/scrollParent.js +1 -1
  85. package/dom-helpers/scrollTo.js +1 -1
  86. package/dom-helpers/scrollTop.js +1 -1
  87. package/dom-helpers/scrollbarSize.js +1 -1
  88. package/dom-helpers/siblings.js +1 -1
  89. package/dom-helpers/text.js +1 -1
  90. package/dom-helpers/toggleClass.js +1 -1
  91. package/dom-helpers/transitionEnd.js +1 -1
  92. package/dom-helpers/triggerEvent.js +1 -1
  93. package/dom-helpers/types.js +1 -1
  94. package/dom-helpers/width.js +1 -1
  95. package/domHelpers.js +1 -1
  96. package/emitter/index.js +1 -1
  97. package/emitter/src/index.js +1 -1
  98. package/emitter.js +1 -1
  99. package/file/fileToURL.js +1 -1
  100. package/file/index.js +1 -1
  101. package/file/saveAs.js +1 -1
  102. package/file.js +1 -1
  103. package/idb/index.js +1 -1
  104. package/idb.js +1 -1
  105. package/index.js +1 -1
  106. package/invariant/index.js +1 -1
  107. package/invariant.js +1 -1
  108. package/is/index.js +1 -1
  109. package/is.js +1 -1
  110. package/lunar/index.js +1 -1
  111. package/lunar/lib/Holiday.js +1 -1
  112. package/lunar/lib/HolidayUtil.js +1 -1
  113. package/lunar/lib/I18n.js +1 -1
  114. package/lunar/lib/JieQi.js +1 -1
  115. package/lunar/lib/Lunar.js +1 -1
  116. package/lunar/lib/LunarMonth.js +1 -1
  117. package/lunar/lib/LunarTime.js +1 -1
  118. package/lunar/lib/LunarUtil.js +1 -1
  119. package/lunar/lib/LunarYear.js +1 -1
  120. package/lunar/lib/ShouXingUtil.js +1 -1
  121. package/lunar/lib/Solar.js +1 -1
  122. package/lunar/lib/SolarHalfYear.js +1 -1
  123. package/lunar/lib/SolarMonth.js +1 -1
  124. package/lunar/lib/SolarSeason.js +1 -1
  125. package/lunar/lib/SolarUtil.js +1 -1
  126. package/lunar/lib/SolarWeek.js +1 -1
  127. package/lunar/lib/SolarYear.js +1 -1
  128. package/lunar/lib/index.js +1 -1
  129. package/lunar.js +1 -1
  130. package/math/index.js +1 -1
  131. package/math.js +1 -1
  132. package/md5/index.js +1 -1
  133. package/md5.js +1 -1
  134. package/mock/MockWebSocket.js +1 -1
  135. package/mock/MockXMLHttpRequest.js +1 -1
  136. package/mock/index.js +1 -1
  137. package/mock.js +1 -1
  138. package/normalize-wheel/ExecutionEnvironment.js +1 -1
  139. package/normalize-wheel/UserAgent_DEPRECATED.js +1 -1
  140. package/normalize-wheel/index.js +1 -1
  141. package/normalize-wheel/isEventSupported.js +1 -1
  142. package/normalizeWheel.js +1 -1
  143. package/number-to-chinese/index.js +1 -1
  144. package/numberToChinese.js +1 -1
  145. package/nzh/cn.js +1 -1
  146. package/nzh/hk.js +1 -1
  147. package/nzh/index.js +1 -1
  148. package/nzh/nzh.js +1 -1
  149. package/nzh/src/autoGet.js +1 -1
  150. package/nzh/src/index.js +1 -1
  151. package/nzh/src/langs/cn_b.js +1 -1
  152. package/nzh/src/langs/cn_s.js +1 -1
  153. package/nzh/src/langs/hk_b.js +1 -1
  154. package/nzh/src/langs/hk_s.js +1 -1
  155. package/nzh/src/utils.js +1 -1
  156. package/nzh.js +1 -1
  157. package/object-keys-sort/index.js +1 -1
  158. package/object-prototype-to-string-call/index.js +1 -1
  159. package/objectKeysSort.js +1 -1
  160. package/objectPrototypeToStringCall.js +1 -1
  161. package/package.json +1 -1
  162. package/pinyin/index.js +1 -1
  163. package/pinyin/simplified.js +1 -1
  164. package/pinyin/src/core.js +1 -1
  165. package/pinyin/src/simplified.js +1 -1
  166. package/pinyin/src/simplified_dict.js +1 -1
  167. package/pinyin/src/traditional.js +1 -1
  168. package/pinyin/src/traditional_dict.js +1 -1
  169. package/pinyin/traditional.js +1 -1
  170. package/pinyin.js +1 -1
  171. package/query-string/base.js +1 -1
  172. package/query-string/index.js +1 -1
  173. package/query-string/splitOnFirst.js +1 -1
  174. package/queryString.js +1 -1
  175. package/random/address.js +1 -1
  176. package/random/constellation.js +1 -1
  177. package/random/image.js +1 -1
  178. package/random/index.js +1 -1
  179. package/random/licensePlate.js +1 -1
  180. package/random/name.js +1 -1
  181. package/random/number.js +1 -1
  182. package/random/text.js +1 -1
  183. package/random/time.js +1 -1
  184. package/random/web.js +1 -1
  185. package/random.js +1 -1
  186. package/screenfull/index.js +1 -1
  187. package/screenfull.js +1 -1
  188. package/sleep/index.js +1 -1
  189. package/sleep.js +1 -1
  190. package/snapdom/index.js +1 -1
  191. package/snapdom/src/api/preCache.js +1 -1
  192. package/snapdom/src/api/snapdom.js +198 -153
  193. package/snapdom/src/core/cache.js +1 -1
  194. package/snapdom/src/core/capture.js +121 -326
  195. package/snapdom/src/core/clone.js +117 -266
  196. package/snapdom/src/core/context.js +1 -1
  197. package/snapdom/src/core/plugins.js +1 -1
  198. package/snapdom/src/core/prepare.js +48 -157
  199. package/snapdom/src/exporters/download.js +9 -10
  200. package/snapdom/src/exporters/toBlob.js +10 -15
  201. package/snapdom/src/exporters/toCanvas.js +72 -65
  202. package/snapdom/src/exporters/toImg.js +1 -1
  203. package/snapdom/src/modules/CSSVar.js +1 -1
  204. package/snapdom/src/modules/background.js +1 -1
  205. package/snapdom/src/modules/changeCSS.js +1 -1
  206. package/snapdom/src/modules/counter.js +1 -1
  207. package/snapdom/src/modules/fonts.js +118 -112
  208. package/snapdom/src/modules/iconFonts.js +133 -69
  209. package/snapdom/src/modules/images.js +36 -33
  210. package/snapdom/src/modules/lineClamp.js +1 -1
  211. package/snapdom/src/modules/pseudo.js +275 -161
  212. package/snapdom/src/modules/rasterize.js +6 -7
  213. package/snapdom/src/modules/snapFetch.js +1 -1
  214. package/snapdom/src/modules/styles.js +89 -67
  215. package/snapdom/src/modules/svgDefs.js +73 -60
  216. package/snapdom/src/utils/browser.js +13 -8
  217. package/snapdom/src/utils/capture.helpers.js +131 -0
  218. package/snapdom/src/utils/clone.helpers.js +283 -0
  219. package/snapdom/src/utils/css.js +1 -1
  220. package/snapdom/src/utils/helpers.js +1 -1
  221. package/snapdom/src/utils/image.js +15 -24
  222. package/snapdom/src/utils/prepare.helpers.js +8 -0
  223. package/snapdom/src/utils/transforms.helpers.js +211 -0
  224. package/snapdom.js +1 -1
  225. package/string/index.js +1 -1
  226. package/string.js +1 -1
  227. package/tinycolor/index.js +1 -1
  228. package/tinycolor/src/conversion.js +1 -1
  229. package/tinycolor/src/css-color-names.js +1 -1
  230. package/tinycolor/src/format-input.js +1 -1
  231. package/tinycolor/src/from-ratio.js +1 -1
  232. package/tinycolor/src/index.js +1 -1
  233. package/tinycolor/src/random.js +1 -1
  234. package/tinycolor/src/readability.js +1 -1
  235. package/tinycolor/src/to-ms-filter.js +1 -1
  236. package/tinycolor/src/utils.js +1 -1
  237. package/tinycolor.js +1 -1
  238. package/tree/index.js +1 -1
  239. package/tree/search/index.js +1 -1
  240. package/tree.js +1 -1
  241. package/tween/index.js +1 -1
  242. package/tween/src/easing.js +1 -1
  243. package/tween/src/tween.js +1 -1
  244. package/tween.js +1 -1
  245. package/types/constant/isMobile.d.ts +3 -0
  246. package/types/snapdom/src/api/snapdom.d.ts +10 -79
  247. package/types/snapdom/src/exporters/toCanvas.d.ts +11 -3
  248. package/types/snapdom/src/exporters/toJpg.d.ts +1 -0
  249. package/types/snapdom/src/exporters/toPng.d.ts +6 -0
  250. package/types/snapdom/src/exporters/toSvg.d.ts +1 -0
  251. package/types/snapdom/src/exporters/toWebp.d.ts +1 -0
  252. package/types/snapdom/src/modules/iconFonts.d.ts +7 -20
  253. package/types/snapdom/src/modules/pseudo.d.ts +18 -0
  254. package/types/snapdom/src/modules/rasterize.d.ts +6 -10
  255. package/types/snapdom/src/utils/browser.d.ts +0 -3
  256. package/types/snapdom/src/utils/capture.helpers.d.ts +45 -0
  257. package/types/snapdom/src/utils/clone.helpers.d.ts +97 -0
  258. package/types/snapdom/src/utils/image.d.ts +0 -8
  259. package/types/snapdom/src/utils/index.d.ts +1 -1
  260. package/types/snapdom/src/utils/prepare.helpers.d.ts +9 -0
  261. package/types/snapdom/src/utils/transforms.helpers.d.ts +118 -0
  262. package/ui-color/compareColorByRange.js +1 -1
  263. package/ui-color/index.js +1 -1
  264. package/uiColor.js +1 -1
  265. package/url-toolkit/index.js +1 -1
  266. package/url-toolkit/src/url-toolkit.js +1 -1
  267. package/urlToolkit.js +1 -1
  268. package/validate/index.js +1 -1
  269. package/validate/src/index.js +1 -1
  270. package/validate/src/locale/en-US.js +1 -1
  271. package/validate/src/locale/zh-CN.js +1 -1
  272. package/validate/src/message.js +1 -1
  273. package/validate/src/rules/array.js +1 -1
  274. package/validate/src/rules/base.js +1 -1
  275. package/validate/src/rules/boolean.js +1 -1
  276. package/validate/src/rules/custom.js +1 -1
  277. package/validate/src/rules/number.js +1 -1
  278. package/validate/src/rules/object.js +1 -1
  279. package/validate/src/rules/string.js +1 -1
  280. package/validate/src/rules/type.js +1 -1
  281. package/validate/src/utils.js +1 -1
  282. package/validate.js +1 -1
  283. package/version/index.js +1 -1
  284. package/version.js +1 -1
  285. package/xlsx/index.js +1 -1
  286. package/xlsx/xlsx.js +1 -1
  287. package/xlsx.js +1 -1
@@ -1,5 +1,5 @@
1
- /* 2025-11-19 10:03:21 */
2
- var S = [
1
+ /* 2025-11-27 12:11:03 */
2
+ const v = [
3
3
  // /uicons/i,
4
4
  /font\s*awesome/i,
5
5
  /material\s*icons/i,
@@ -11,103 +11,167 @@ var S = [
11
11
  /heroicons/i,
12
12
  /layui/i,
13
13
  /lucide/i
14
- ], d = [];
15
- function M(n) {
16
- const t = Array.isArray(n) ? n : [n];
17
- for (const o of t)
18
- o instanceof RegExp ? d.push(o) : typeof o == "string" ? d.push(new RegExp(o, "i")) : console.warn("[snapdom] Ignored invalid iconFont value:", o);
14
+ ], h = Object.assign(
15
+ {
16
+ materialIconsFilled: "https://fonts.gstatic.com/s/materialicons/v48/flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ.woff2",
17
+ materialIconsOutlined: "https://fonts.gstatic.com/s/materialiconsoutlined/v110/gok-H7zzDkdnRel8-DQ6KAXJ69wP1tGnf4ZGhUcel5euIg.woff2",
18
+ materialIconsRound: "https://fonts.gstatic.com/s/materialiconsround/v109/LDItaoyNOAY6Uewc665JcIzCKsKc_M9flwmPq_HTTw.woff2",
19
+ materialIconsSharp: "https://fonts.gstatic.com/s/materialiconssharp/v110/oPWQ_lt5nv4pWNJpghLP75WiFR4kLh3kvmvRImcycg.woff2"
20
+ },
21
+ typeof window < "u" && window.__SNAPDOM_ICON_FONTS__ || {}
22
+ );
23
+ let F = [];
24
+ function R(o) {
25
+ const t = Array.isArray(o) ? o : [o];
26
+ for (const s of t)
27
+ s instanceof RegExp ? F.push(s) : typeof s == "string" ? F.push(new RegExp(s, "i")) : console.warn("[snapdom] Ignored invalid iconFont value:", s);
19
28
  }
20
- function $(n) {
21
- const t = typeof n == "string" ? n : "", o = [...S, ...d];
22
- for (const s of o)
23
- if (s instanceof RegExp && s.test(t)) return !0;
29
+ function _(o) {
30
+ const t = typeof o == "string" ? o : "", s = [...v, ...F];
31
+ for (const e of s)
32
+ if (e instanceof RegExp && e.test(t)) return !0;
24
33
  return !!(/icon/i.test(t) || /glyph/i.test(t) || /symbols/i.test(t) || /feather/i.test(t) || /fontawesome/i.test(t));
25
34
  }
26
- function b(n = "") {
27
- const t = String(n).toLowerCase();
35
+ function S(o = "") {
36
+ const t = String(o).toLowerCase();
28
37
  return /\bmaterial\s*icons\b/.test(t) || /\bmaterial\s*symbols\b/.test(t);
29
38
  }
30
- async function I(n = "Material Icons", t = 24) {
39
+ const x = /* @__PURE__ */ new Map();
40
+ function M(o = "") {
41
+ const t = /* @__PURE__ */ Object.create(null), s = String(o || ""), e = /['"]?\s*([A-Za-z]{3,4})\s*['"]?\s*([+-]?\d+(?:\.\d+)?)\s*/g;
42
+ let c;
43
+ for (; c = e.exec(s); ) t[c[1].toUpperCase()] = Number(c[2]);
44
+ return t;
45
+ }
46
+ async function L(o, t, s) {
47
+ const e = String(o || ""), c = e.toLowerCase(), f = String(t || "").toLowerCase();
48
+ if (/\bmaterial\s*icons\b/.test(c) && !/\bsymbols\b/.test(c))
49
+ return { familyForMeasure: e, familyForCanvas: e };
50
+ if (!/\bmaterial\s*symbols\b/.test(c))
51
+ return { familyForMeasure: e, familyForCanvas: e };
52
+ const m = s && (s.FILL ?? s.fill);
53
+ let a = "outlined";
54
+ /\brounded\b/.test(f) || /\bround\b/.test(f) ? a = "rounded" : /\bsharp\b/.test(f) ? a = "sharp" : /\boutlined\b/.test(f) && (a = "outlined");
55
+ const r = m === 1;
56
+ let l = null;
57
+ if (r && (a === "outlined" && h.materialIconsFilled ? l = {
58
+ url: h.materialIconsFilled,
59
+ alias: "snapdom-mi-filled"
60
+ } : a === "rounded" && h.materialIconsRound ? l = {
61
+ url: h.materialIconsRound,
62
+ alias: "snapdom-mi-round"
63
+ } : a === "sharp" && h.materialIconsSharp && (l = {
64
+ url: h.materialIconsSharp,
65
+ alias: "snapdom-mi-sharp"
66
+ })), !l)
67
+ return { familyForMeasure: e, familyForCanvas: e };
68
+ if (!x.has(l.alias))
69
+ try {
70
+ const n = new FontFace(l.alias, `url(${l.url})`, {
71
+ style: "normal",
72
+ weight: "400"
73
+ });
74
+ document.fonts.add(n), await n.load(), x.set(l.alias, !0);
75
+ } catch {
76
+ return { familyForMeasure: e, familyForCanvas: e };
77
+ }
78
+ const u = `"${l.alias}"`;
79
+ return { familyForMeasure: u, familyForCanvas: u };
80
+ }
81
+ async function A(o = "Material Icons", t = 24) {
31
82
  try {
32
83
  await Promise.all([
33
- document.fonts.load(`400 ${t}px "${n.replace(/["']/g, "")}"`),
84
+ document.fonts.load(
85
+ `400 ${t}px "${String(o).replace(/["']/g, "")}"`
86
+ ),
34
87
  document.fonts.ready
35
88
  ]);
36
89
  } catch {
37
90
  }
38
91
  }
39
- function v(n) {
40
- let t = n.getPropertyValue("-webkit-text-fill-color")?.trim() || "";
41
- const o = /rgba?\(\s*0\s*,\s*0\s*,\s*0\s*,\s*0\s*\)/i.test(t);
42
- if (t && !o && t.toLowerCase() !== "currentcolor")
92
+ function $(o) {
93
+ let t = o.getPropertyValue("-webkit-text-fill-color")?.trim() || "";
94
+ const s = /^transparent$/i.test(t) || /rgba?\(\s*0\s*,\s*0\s*,\s*0\s*,\s*0\s*\)/i.test(t);
95
+ if (t && !s && t.toLowerCase() !== "currentcolor")
43
96
  return t;
44
- const s = n.color?.trim();
45
- return s && s !== "inherit" ? s : "#000";
97
+ const e = o.color?.trim();
98
+ return e && e !== "inherit" ? e : "#000";
46
99
  }
47
- async function F(n, {
100
+ async function N(o, {
48
101
  family: t = "Material Icons",
49
- weight: o = "normal",
50
- fontSize: s = 32,
51
- color: u = "#000",
52
- variation: y = ""
102
+ weight: s = "normal",
103
+ fontSize: e = 32,
104
+ color: c = "#000",
105
+ variation: f = "",
106
+ className: i = ""
53
107
  } = {}) {
54
- const i = String(t || "").replace(/^['"]+|['"]+$/g, ""), r = window.devicePixelRatio || 1;
55
- await I(i, s);
56
- const e = document.createElement("span");
57
- e.textContent = n, e.style.position = "absolute", e.style.visibility = "hidden", e.style.left = "-99999px", e.style.whiteSpace = "nowrap", e.style.fontFamily = `"${i}"`, e.style.fontWeight = String(o || "normal"), e.style.fontSize = `${s}px`, e.style.lineHeight = "1", e.style.margin = "0", e.style.padding = "0", e.style.fontFeatureSettings = "'liga' 1", e.style.fontVariantLigatures = "normal", y && (e.style.fontVariationSettings = y), e.style.color = u, document.body.appendChild(e);
58
- const a = e.getBoundingClientRect(), g = Math.max(1, Math.ceil(a.width)), m = Math.max(1, Math.ceil(a.height));
59
- document.body.removeChild(e);
60
- const c = document.createElement("canvas");
61
- c.width = g * r, c.height = m * r;
62
- const l = c.getContext("2d");
63
- l.scale(r, r), l.font = `${o ? `${o} ` : ""}${s}px "${i}"`, l.textAlign = "left", l.textBaseline = "top", l.fillStyle = u;
108
+ const m = String(t || "").replace(/^['"]+|['"]+$/g, ""), a = window.devicePixelRatio || 1, r = M(f), { familyForMeasure: l, familyForCanvas: u } = await L(
109
+ m,
110
+ i,
111
+ r
112
+ );
113
+ await A(
114
+ u.replace(/^["']+|["']+$/g, ""),
115
+ e
116
+ );
117
+ const n = document.createElement("span");
118
+ n.textContent = o, n.style.position = "absolute", n.style.visibility = "hidden", n.style.left = "-99999px", n.style.whiteSpace = "nowrap", n.style.fontFamily = l, n.style.fontWeight = String(s || "normal"), n.style.fontSize = `${e}px`, n.style.lineHeight = "1", n.style.margin = "0", n.style.padding = "0", n.style.fontFeatureSettings = "'liga' 1", n.style.fontVariantLigatures = "normal", n.style.color = c, document.body.appendChild(n);
119
+ const p = n.getBoundingClientRect(), w = Math.max(1, Math.ceil(p.width)), b = Math.max(1, Math.ceil(p.height));
120
+ document.body.removeChild(n);
121
+ const g = document.createElement("canvas");
122
+ g.width = w * a, g.height = b * a;
123
+ const d = g.getContext("2d");
124
+ d.scale(a, a), d.font = `${s ? `${s} ` : ""}${e}px ${u}`, d.textAlign = "left", d.textBaseline = "top", d.fillStyle = c;
64
125
  try {
65
- l.fontKerning = "normal";
126
+ d.fontKerning = "normal";
66
127
  } catch {
67
128
  }
68
- return l.fillText(n, 0, 0), {
69
- dataUrl: c.toDataURL(),
70
- width: g,
71
- height: m
129
+ return d.fillText(o, 0, 0), {
130
+ dataUrl: g.toDataURL(),
131
+ width: w,
132
+ height: b
72
133
  };
73
134
  }
74
- async function A(n, t) {
75
- if (!(n instanceof Element)) return 0;
76
- const o = '.material-icons, [class*="material-symbols"]', s = Array.from(n.querySelectorAll(o)).filter(
135
+ async function E(o, t) {
136
+ if (!(o instanceof Element)) return 0;
137
+ const s = '.material-icons, [class*="material-symbols"]', e = Array.from(o.querySelectorAll(s)).filter(
77
138
  (i) => i && i.textContent && i.textContent.trim()
78
139
  );
79
- if (s.length === 0) return 0;
80
- const u = t instanceof Element ? Array.from(t.querySelectorAll(o)).filter(
140
+ if (e.length === 0) return 0;
141
+ const c = t instanceof Element ? Array.from(t.querySelectorAll(s)).filter(
81
142
  (i) => i && i.textContent && i.textContent.trim()
82
143
  ) : [];
83
- let y = 0;
84
- for (let i = 0; i < s.length; i++) {
85
- const r = s[i], e = u[i] || null;
144
+ let f = 0;
145
+ for (let i = 0; i < e.length; i++) {
146
+ const m = e[i], a = c[i] || null;
86
147
  try {
87
- const a = getComputedStyle(e || r), g = a.fontFamily || "Material Icons";
88
- if (!b(g)) continue;
89
- const m = (e || r).textContent.trim();
90
- if (!m) continue;
91
- const c = parseInt(a.fontSize, 10) || 24, l = a.fontWeight && a.fontWeight !== "normal" ? a.fontWeight : "normal", h = v(a), p = a.fontVariationSettings && a.fontVariationSettings !== "normal" ? a.fontVariationSettings : "", { dataUrl: x, width: w, height: C } = await F(m, {
92
- family: g,
93
- weight: l,
94
- fontSize: c,
95
- color: h,
96
- variation: p
148
+ const r = getComputedStyle(a || m), l = r.fontFamily || "Material Icons";
149
+ if (!S(l)) continue;
150
+ const u = (a || m).textContent.trim();
151
+ if (!u) continue;
152
+ const n = parseInt(r.fontSize, 10) || 24, p = r.fontWeight && r.fontWeight !== "normal" ? r.fontWeight : "normal", w = $(r), b = r.fontVariationSettings && r.fontVariationSettings !== "normal" ? r.fontVariationSettings : "", g = (a || m).className || "", { dataUrl: d, width: I, height: C } = await N(u, {
153
+ family: l,
154
+ weight: p,
155
+ fontSize: n,
156
+ color: w,
157
+ variation: b,
158
+ className: g
97
159
  });
98
- r.textContent = "";
99
- const f = r.ownerDocument.createElement("img");
100
- f.src = x, f.alt = m, f.style.height = `${c}px`, f.style.width = `${Math.max(1, Math.round(w / C * c))}px`, f.style.objectFit = "contain", f.style.verticalAlign = getComputedStyle(r).verticalAlign || "baseline", r.appendChild(f), y++;
160
+ m.textContent = "";
161
+ const y = m.ownerDocument.createElement("img");
162
+ y.src = d, y.alt = u, y.style.height = `${n}px`, y.style.width = `${Math.max(1, Math.round(I / C * n))}px`, y.style.objectFit = "contain", y.style.verticalAlign = getComputedStyle(m).verticalAlign || "baseline", m.appendChild(y), f++;
101
163
  } catch {
102
164
  }
103
165
  }
104
- return y;
166
+ return f;
105
167
  }
106
168
  export {
107
- I as ensureMaterialFontsReady,
108
- M as extendIconFonts,
109
- $ as isIconFont,
110
- b as isMaterialFamily,
111
- A as ligatureIconToImage,
112
- F as materialIconToImage
169
+ h as ICON_FONT_URLS,
170
+ v as defaultIconFonts,
171
+ A as ensureMaterialFontsReady,
172
+ R as extendIconFonts,
173
+ _ as isIconFont,
174
+ S as isMaterialFamily,
175
+ E as ligatureIconToImage,
176
+ N as materialIconToImage
113
177
  };
@@ -1,60 +1,63 @@
1
- /* 2025-11-19 10:03:21 */
2
- import { snapFetch as f } from "./snapFetch.js";
3
- async function H(u, s = {}) {
4
- const i = Array.from(u.querySelectorAll("img")), p = async (t) => {
1
+ /* 2025-11-27 12:11:03 */
2
+ import { snapFetch as d } from "./snapFetch.js";
3
+ function u(e) {
4
+ const n = parseInt(e.dataset?.snapdomWidth || "", 10) || 0, h = parseInt(e.dataset?.snapdomHeight || "", 10) || 0, l = parseInt(e.getAttribute("width") || "", 10) || 0, t = parseInt(e.getAttribute("height") || "", 10) || 0, s = parseFloat(e.style?.width || "") || 0, c = parseFloat(e.style?.height || "") || 0, i = n || s || l || e.width || e.naturalWidth || 100, r = h || c || t || e.height || e.naturalHeight || 100;
5
+ return { width: i, height: r };
6
+ }
7
+ async function y(e, n = {}) {
8
+ const h = Array.from(e.querySelectorAll("img")), l = async (t) => {
5
9
  if (!t.getAttribute("src")) {
6
- const e = t.currentSrc || t.src || "";
7
- e && t.setAttribute("src", e);
10
+ const a = t.currentSrc || t.src || "";
11
+ a && t.setAttribute("src", a);
8
12
  }
9
13
  t.removeAttribute("srcset"), t.removeAttribute("sizes");
10
- const a = t.src || "";
11
- if (!a) return;
12
- const r = await f(a, {
14
+ const s = t.src || "";
15
+ if (!s) return;
16
+ const c = await d(s, {
13
17
  as: "dataURL",
14
- useProxy: s.useProxy
18
+ useProxy: n.useProxy
15
19
  });
16
- if (r.ok && typeof r.data == "string" && r.data.startsWith("data:")) {
17
- t.src = r.data, t.width || (t.width = t.naturalWidth || 100), t.height || (t.height = t.naturalHeight || 100);
20
+ if (c.ok && typeof c.data == "string" && c.data.startsWith("data:")) {
21
+ t.src = c.data, t.width || (t.width = t.naturalWidth || 100), t.height || (t.height = t.naturalHeight || 100);
18
22
  return;
19
23
  }
20
- const { fallbackURL: n } = s || {};
21
- if (n)
24
+ const { width: i, height: r } = u(t), { fallbackURL: o } = n || {};
25
+ if (o)
22
26
  try {
23
- const e = parseInt(t.dataset?.snapdomWidth || "", 10) || 0, y = parseInt(t.dataset?.snapdomHeight || "", 10) || 0, w = parseInt(t.getAttribute("width") || "", 10) || 0, b = parseInt(t.getAttribute("height") || "", 10) || 0, x = parseFloat(t.style?.width || "") || 0, W = parseFloat(t.style?.height || "") || 0, h = e || x || w || t.width || void 0, l = y || W || b || t.height || void 0, d = typeof n == "function" ? await n({ width: h, height: l, src: a, element: t }) : n;
24
- if (d) {
25
- const k = await f(d, {
27
+ const a = typeof o == "function" ? await o({ width: i, height: r, src: s, element: t }) : o;
28
+ if (a) {
29
+ const f = await d(a, {
26
30
  as: "dataURL",
27
- useProxy: s.useProxy
31
+ useProxy: n.useProxy
28
32
  });
29
- t.src = k.data, !t.width && h && (t.width = h), !t.height && l && (t.height = l), t.width || (t.width = t.naturalWidth || 100), t.height || (t.height = t.naturalHeight || 100);
33
+ t.src = f.data, t.width || (t.width = i), t.height || (t.height = r);
30
34
  return;
31
35
  }
32
36
  } catch {
33
37
  }
34
- const o = t.width || t.naturalWidth || 100, c = t.height || t.naturalHeight || 100;
35
- if (s.placeholders !== !1) {
36
- const e = document.createElement("div");
37
- e.style.cssText = [
38
- `width:${o}px`,
39
- `height:${c}px`,
38
+ if (n.placeholders !== !1) {
39
+ const a = document.createElement("div");
40
+ a.style.cssText = [
41
+ `width:${i}px`,
42
+ `height:${r}px`,
40
43
  "background:#ccc",
41
44
  "display:inline-block",
42
45
  "text-align:center",
43
- `line-height:${c}px`,
46
+ `line-height:${r}px`,
44
47
  "color:#666",
45
48
  "font-size:12px",
46
49
  "overflow:hidden"
47
- ].join(";"), e.textContent = "img", t.replaceWith(e);
50
+ ].join(";"), a.textContent = "img", t.replaceWith(a);
48
51
  } else {
49
- const e = document.createElement("div");
50
- e.style.cssText = `display:inline-block;width:${o}px;height:${c}px;visibility:hidden;`, t.replaceWith(e);
52
+ const a = document.createElement("div");
53
+ a.style.cssText = `display:inline-block;width:${i}px;height:${r}px;visibility:hidden;`, t.replaceWith(a);
51
54
  }
52
55
  };
53
- for (let t = 0; t < i.length; t += 4) {
54
- const a = i.slice(t, t + 4).map(p);
55
- await Promise.allSettled(a);
56
+ for (let t = 0; t < h.length; t += 4) {
57
+ const s = h.slice(t, t + 4).map(l);
58
+ await Promise.allSettled(s);
56
59
  }
57
60
  }
58
61
  export {
59
- H as inlineImages
62
+ y as inlineImages
60
63
  };
@@ -1,4 +1,4 @@
1
- /* 2025-11-19 10:03:21 */
1
+ /* 2025-11-27 12:11:03 */
2
2
  function h(t) {
3
3
  if (!t) return () => {
4
4
  };