@emailens/cli 0.13.17 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -3,42 +3,47 @@ import { createRequire as __cr } from "node:module";
3
3
  const require = __cr(import.meta.url);
4
4
  import {
5
5
  AI_FIX_SYSTEM_PROMPT,
6
- EMAIL_CLIENTS,
6
+ EMAIL_DIRS,
7
7
  TARGETING_POLICY_ARG,
8
8
  analyzeEmail,
9
9
  auditEmail,
10
10
  compile,
11
- csstree_esm_exports,
12
11
  defineCommand,
13
- es_exports,
14
12
  estimateAiFixTokens,
13
+ findEmailsDir,
15
14
  generateAiFix,
16
15
  generateCompatibilityScore,
17
- init_csstree_esm,
18
- init_es,
19
16
  lint_default,
20
17
  parseTargetingPolicy,
21
18
  positionsApply,
22
19
  readInput,
23
- require_boolbase,
24
- require_lib,
25
- require_mime_type,
26
20
  require_picocolors,
27
- require_undici,
28
- require_whatwg_encoding,
29
21
  resolveClients,
30
22
  resolveFormat,
31
23
  runMain,
32
24
  simulateDarkMode,
33
- toFramework,
25
+ toFramework
26
+ } from "./chunk-MCD4OEZU.js";
27
+ import {
28
+ EMAIL_CLIENTS,
29
+ csstree_esm_exports,
30
+ es_exports,
31
+ init_csstree_esm,
32
+ init_es,
33
+ require_boolbase,
34
+ require_lib,
35
+ require_mime_type,
36
+ require_undici,
37
+ require_whatwg_encoding,
34
38
  transformForAllClients
35
- } from "./chunk-ICIM22UE.js";
36
- import "./chunk-ABDTBRVK.js";
37
- import "./chunk-2AP7CT6R.js";
38
- import "./chunk-NXBRJX3V.js";
39
+ } from "./chunk-NGCLN4RF.js";
40
+ import "./chunk-LURVXP3P.js";
41
+ import "./chunk-YE65PQ5Z.js";
42
+ import "./chunk-5MSFYC7W.js";
39
43
  import {
40
44
  CompileError
41
- } from "./chunk-TQGPCAMW.js";
45
+ } from "./chunk-WAXESPJE.js";
46
+ import "./chunk-JKHKS7VL.js";
42
47
  import {
43
48
  __commonJS,
44
49
  __require,
@@ -20844,7 +20849,7 @@ var require_commonjs3 = __commonJS({
20844
20849
  path: urlObject.pathname + urlObject.search,
20845
20850
  ...requestOptions
20846
20851
  };
20847
- const promise = new Promise((resolve2, reject) => {
20852
+ const promise = new Promise((resolve3, reject) => {
20848
20853
  undiciStream = new undici.Client(urlObject.origin).compose(undici.interceptors.redirect({ maxRedirections: 5 })).stream(streamOptions, (res) => {
20849
20854
  var _a, _b;
20850
20855
  if (res.statusCode < 200 || res.statusCode >= 300) {
@@ -20867,7 +20872,7 @@ var require_commonjs3 = __commonJS({
20867
20872
  baseURI,
20868
20873
  ...cheerioOptions
20869
20874
  };
20870
- return decodeStream(opts, (err, $) => err ? reject(err) : resolve2($));
20875
+ return decodeStream(opts, (err, $) => err ? reject(err) : resolve3($));
20871
20876
  });
20872
20877
  });
20873
20878
  await undiciStream;
@@ -23451,7 +23456,7 @@ var require_dist = __commonJS({
23451
23456
  "outlook-macos": "supported",
23452
23457
  "apple-mail-macos": "supported",
23453
23458
  "apple-mail-ios": "supported",
23454
- "yahoo-mail": "supported",
23459
+ "yahoo-mail": "partial",
23455
23460
  "yahoo-mail-android": "supported",
23456
23461
  "yahoo-mail-ios": "supported",
23457
23462
  "samsung-mail": "supported",
@@ -26414,12 +26419,12 @@ var require_dist = __commonJS({
26414
26419
  "outlook-windows": "unsupported",
26415
26420
  "outlook-windows-legacy": "unsupported",
26416
26421
  "outlook-ios": "unsupported",
26417
- "outlook-android": "unsupported",
26422
+ "outlook-android": "supported",
26418
26423
  "outlook-macos": "unsupported",
26419
26424
  "apple-mail-macos": "supported",
26420
26425
  "apple-mail-ios": "supported",
26421
- "yahoo-mail": "supported",
26422
- "yahoo-mail-android": "supported",
26426
+ "yahoo-mail": "unsupported",
26427
+ "yahoo-mail-android": "unsupported",
26423
26428
  "yahoo-mail-ios": "supported",
26424
26429
  "samsung-mail": "supported",
26425
26430
  "thunderbird": "supported",
@@ -27012,12 +27017,12 @@ var require_dist = __commonJS({
27012
27017
  "outlook-windows": "supported",
27013
27018
  "outlook-windows-legacy": "unsupported",
27014
27019
  "outlook-ios": "supported",
27015
- "outlook-android": "supported",
27020
+ "outlook-android": "unsupported",
27016
27021
  "outlook-macos": "supported",
27017
27022
  "apple-mail-macos": "supported",
27018
27023
  "apple-mail-ios": "supported",
27019
- "yahoo-mail": "supported",
27020
- "yahoo-mail-android": "supported",
27024
+ "yahoo-mail": "unsupported",
27025
+ "yahoo-mail-android": "unsupported",
27021
27026
  "yahoo-mail-ios": "supported",
27022
27027
  "samsung-mail": "supported",
27023
27028
  "thunderbird": "supported",
@@ -28535,7 +28540,7 @@ var require_dist = __commonJS({
28535
28540
  "gmail-android": ["Partial. Not supported with non Google accounts. But it can be used in the `background` shorthand property instead."],
28536
28541
  "gmail-ios": ["Partial. Not supported with non Google accounts. But it can be used in the `background` shorthand property instead."],
28537
28542
  "outlook-windows-legacy": ["Background images size can be used in VML with the `size` attribute. See [VML documentation](https://docs.microsoft.com/en-us/windows/win32/vml/size-attribute--fill--vml)."],
28538
- "yahoo-mail": ["Partial. Does not support multiple values. The comma between two values is removed."],
28543
+ "yahoo-mail": ["Observed 2026-11-09 (Emailens real-device checks, Yahoo Mail web (Chrome): foodpanda campaign (2026-10-28), AliExpress (2026-11-09)): Partial. Ignored inside the background shorthand (`background: url() 0 0 / cover`): the image draws at its natural size. The background-size property written on its own works."],
28539
28544
  "yahoo-mail-android": ["Partial. Does not support multiple values. The comma between two values is removed."],
28540
28545
  "yahoo-mail-ios": ["Partial. Does not support multiple values. The comma between two values is removed."],
28541
28546
  "aol": ["Partial. Does not support multiple values. The comma between two values is removed."]
@@ -29017,7 +29022,10 @@ var require_dist = __commonJS({
29017
29022
  "gmail-ios": ["Partial. Not supported with non Google accounts."]
29018
29023
  },
29019
29024
  "text-shadow": {
29020
- "outlook-web": ["Observed 2026-10-14 (Emailens real-device probe, Outlook.com (Chrome)): A red text-shadow rendered behind bold text."]
29025
+ "outlook-web": ["Observed 2026-10-14 (Emailens real-device probe, Outlook.com (Chrome)): A red text-shadow rendered behind bold text."],
29026
+ "outlook-android": ["Observed 2026-11-08 (Emailens probe sheets 20-22, the Outlook Android app, our own seed inbox): A green text-shadow drew behind the text."],
29027
+ "yahoo-mail": ["Observed 2026-11-08 (Emailens probe sheets 20-22, Yahoo Mail web (Chrome), our own seed inbox): A green text-shadow did not draw; the text rendered plain."],
29028
+ "yahoo-mail-android": ["Observed 2026-11-08 (Emailens probe sheets 20-22, the Yahoo Mail Android app, our own seed inbox): A green text-shadow did not draw; the text rendered plain."]
29021
29029
  },
29022
29030
  "text-transform": {
29023
29031
  "outlook-windows-legacy": ["Partial. `lowercase` value is not supported."]
@@ -29071,9 +29079,12 @@ var require_dist = __commonJS({
29071
29079
  },
29072
29080
  "visibility": {
29073
29081
  "outlook-ios": ['Buggy. `visibility:collapse` applied to a `<tr>` only hides content and does not "remove" it from layout.'],
29082
+ "outlook-android": ["Observed 2026-11-08 (Emailens probe sheets 20-22, the Outlook Android app, our own seed inbox): An element at `visibility:hidden` stayed visible. Use `display:none` (or remove the element) to hide it."],
29074
29083
  "outlook-macos": ['Buggy. `visibility:collapse` applied to a `<tr>` only hides content and does not "remove" it from layout.'],
29075
29084
  "apple-mail-macos": ['Buggy. `visibility:collapse` applied to a `<tr>` only hides content and does not "remove" it from layout.'],
29076
29085
  "apple-mail-ios": ['Buggy. `visibility:collapse` applied to a `<tr>` only hides content and does not "remove" it from layout.'],
29086
+ "yahoo-mail": ["Observed 2026-11-08 (Emailens probe sheets 20-22, Yahoo Mail web (Chrome), our own seed inbox): An element at `visibility:hidden` stayed visible. Use `display:none` (or remove the element) to hide it."],
29087
+ "yahoo-mail-android": ["Observed 2026-11-08 (Emailens probe sheets 20-22, the Yahoo Mail Android app, our own seed inbox): An element at `visibility:hidden` stayed visible. Use `display:none` (or remove the element) to hide it."],
29077
29088
  "yahoo-mail-ios": ['Buggy. `visibility:collapse` applied to a `<tr>` only hides content and does not "remove" it from layout.'],
29078
29089
  "protonmail": ['Buggy. `visibility:collapse` applied to a `<tr>` only hides content and does not "remove" it from layout.']
29079
29090
  },
@@ -33699,6 +33710,13 @@ h1 {
33699
33710
  (whole, n) => Number(n) > MAX_BORDER_PX ? `${MAX_BORDER_PX}px` : whole
33700
33711
  );
33701
33712
  var flattenMargin = (value) => value.split(/\s+/).map((part) => part === "auto" || /^-/.test(part) ? "0" : part).join(" ");
33713
+ var flattenDivMargin = (prop, value) => {
33714
+ if (prop === "margin-left" || prop === "margin-right") return value.trim() === "auto" ? "0" : value;
33715
+ if (prop !== "margin") return flattenMargin(value);
33716
+ const parts = value.trim().split(/\s+/);
33717
+ const vertical = (i) => i === 0 || i === 2 && parts.length >= 3;
33718
+ return parts.map((part, i) => part === "auto" || /^-/.test(part) && vertical(i) ? "0" : part).join(" ");
33719
+ };
33702
33720
  function holdsNoText($, el) {
33703
33721
  const own = $(el).clone();
33704
33722
  own.find("table").remove();
@@ -33981,7 +33999,7 @@ h1 {
33981
33999
  if (tag === "div" || tag === "table") {
33982
34000
  for (const prop of MARGIN) {
33983
34001
  const value = props.get(prop);
33984
- if (value !== void 0) props.set(prop, flattenMargin(value));
34002
+ if (value !== void 0) props.set(prop, tag === "div" ? flattenDivMargin(prop, value) : flattenMargin(value));
33985
34003
  }
33986
34004
  if (tag === "table" && /center/i.test((_f = $(el).attr("align")) != null ? _f : "")) {
33987
34005
  props.delete("margin-top");
@@ -35084,7 +35102,7 @@ h1 {
35084
35102
  "notes": ""
35085
35103
  }
35086
35104
  ];
35087
- var GMAIL_WRAPPER_SELECTOR = /(?:^|[\s>~+(])u\s*\+\s*([.#][\w-]+)/i;
35105
+ var GMAIL_WRAPPER_SELECTOR = /(?:^|[\s>~+(,{}])u\s*\+\s*([.#][\w-]+)/i;
35088
35106
  var TARGETING_MATCHERS = [
35089
35107
  {
35090
35108
  id: "gmail-android-div-u-body",
@@ -35531,6 +35549,160 @@ h1 {
35531
35549
  function getWorkingTargetingHacks() {
35532
35550
  return TARGETING_HACKS.filter((h) => h.status === "working");
35533
35551
  }
35552
+ var RUN = "2026-10-14";
35553
+ var seen = (level, source, note) => ({
35554
+ level,
35555
+ observed: RUN,
35556
+ source,
35557
+ note
35558
+ });
35559
+ var newOutlookMac = (level, note) => ({
35560
+ level,
35561
+ observed: "2026-10-27",
35562
+ source: "Emailens probe sheets 20-22, the new Outlook for Mac",
35563
+ note
35564
+ });
35565
+ var yahooWeb = (level, note) => ({
35566
+ level,
35567
+ observed: "2026-10-27",
35568
+ source: "Emailens probe, Yahoo Mail web (Chrome), real-device run E8fVpFwwLtL8",
35569
+ note
35570
+ });
35571
+ var gmailWeb = (level, note) => ({
35572
+ level,
35573
+ observed: "2026-10-28",
35574
+ source: "Emailens probe, Gmail web (Chrome), real-device run 1isFNBBaOyEo",
35575
+ note
35576
+ });
35577
+ var worker = (level, source, note) => ({
35578
+ level,
35579
+ observed: "2026-11-08",
35580
+ source: `Emailens probe sheets 20-22, ${source}, our own seed inbox`,
35581
+ note
35582
+ });
35583
+ var OBSERVED_OVERRIDES = {
35584
+ // Email Geeks #email-code, 2026-10-29: "Yahoo strips action and formaction".
35585
+ // Six forms sent to our Yahoo seed; the delivered HTML had neither.
35586
+ "<form>": {
35587
+ "yahoo-mail": {
35588
+ level: "unsupported",
35589
+ observed: "2026-10-29",
35590
+ source: "Emailens probe, Yahoo Mail web (Chrome), our own seed inbox",
35591
+ note: 'The form is kept but its `action` is removed (absolute, relative and empty alike), and so is `formaction` on a button; Yahoo adds `target="_blank"`. The form cannot reach your server: link to a landing page instead. `type="email"` is also dropped from inputs; `method`, text, radio and submit inputs are kept.'
35592
+ }
35593
+ },
35594
+ // display:flex holds and so does width; the item sizing does not. A label
35595
+ // column at `flex:0 0 34%` beside a paragraph collapsed to a letter wide.
35596
+ flex: {
35597
+ "yahoo-mail": yahooWeb(
35598
+ "unsupported",
35599
+ "The `flex` shorthand is dropped: an item at `flex:0 0 34%` shrank to its narrowest, breaking words letter by letter. Size flex items with `width` (and `flex-shrink:0`), or use a table."
35600
+ ),
35601
+ "gmail-web": gmailWeb(
35602
+ "unsupported",
35603
+ "The `flex` shorthand is dropped: an item at `flex:0 0 34%` lost its 34% and sized to its content. `width:34%` on the same item held, and so did a table."
35604
+ )
35605
+ },
35606
+ "flex-basis": {
35607
+ "yahoo-mail": yahooWeb(
35608
+ "unsupported",
35609
+ "Dropped, with flex-grow and flex-shrink beside it: the item sized to its content instead of 34%. `width:34%` on the same item held."
35610
+ ),
35611
+ "gmail-web": gmailWeb(
35612
+ "unsupported",
35613
+ "Dropped, with flex-grow and flex-shrink beside it: the item sized to its content instead of 34%. `width:34%` on the same item held."
35614
+ )
35615
+ },
35616
+ // caniemail 16.80 says not supported; plain track lists are kept and the
35617
+ // functions dropped, twice over two runs.
35618
+ "grid-template-columns": {
35619
+ "outlook-macos": newOutlookMac(
35620
+ "partial",
35621
+ "Plain track sizes work (`300px 300px`, `1fr 1fr`); a value with `repeat()` or `minmax()` is dropped, so the grid falls back to one column."
35622
+ )
35623
+ },
35624
+ // Sheet 20 case 30: an orange block at visibility:hidden over a green cell
35625
+ // stayed orange. Gmail web, on the same sheet, hid it.
35626
+ visibility: {
35627
+ "yahoo-mail": worker(
35628
+ "unsupported",
35629
+ "Yahoo Mail web (Chrome)",
35630
+ "An element at `visibility:hidden` stayed visible. Use `display:none` (or remove the element) to hide it."
35631
+ ),
35632
+ "yahoo-mail-android": worker(
35633
+ "unsupported",
35634
+ "the Yahoo Mail Android app",
35635
+ "An element at `visibility:hidden` stayed visible. Use `display:none` (or remove the element) to hide it."
35636
+ ),
35637
+ "outlook-android": worker(
35638
+ "unsupported",
35639
+ "the Outlook Android app",
35640
+ "An element at `visibility:hidden` stayed visible. Use `display:none` (or remove the element) to hide it."
35641
+ )
35642
+ },
35643
+ "box-shadow": {
35644
+ "yahoo-mail": seen(
35645
+ "supported",
35646
+ "Emailens real-device probe, Yahoo Mail (Chrome)",
35647
+ "A box-shadow on a table cell rendered with its offset and colour."
35648
+ )
35649
+ },
35650
+ // Sheet 22 case 13: a green text-shadow drew in Gmail and Outlook Android,
35651
+ // not in either Yahoo.
35652
+ "text-shadow": {
35653
+ "yahoo-mail": worker(
35654
+ "unsupported",
35655
+ "Yahoo Mail web (Chrome)",
35656
+ "A green text-shadow did not draw; the text rendered plain."
35657
+ ),
35658
+ "yahoo-mail-android": worker(
35659
+ "unsupported",
35660
+ "the Yahoo Mail Android app",
35661
+ "A green text-shadow did not draw; the text rendered plain."
35662
+ ),
35663
+ "outlook-web": seen(
35664
+ "supported",
35665
+ "Emailens real-device probe, Outlook.com (Chrome)",
35666
+ "A red text-shadow rendered behind bold text."
35667
+ ),
35668
+ "outlook-android": worker(
35669
+ "supported",
35670
+ "the Outlook Android app",
35671
+ "A green text-shadow drew behind the text."
35672
+ )
35673
+ },
35674
+ // foodpanda's logos and coupon on real Yahoo Mail web (2026-10-28): drawn
35675
+ // at their natural size, the size written inside the `background` shorthand
35676
+ // ignored (yahoo-background-size.test.ts). Written on its own it holds:
35677
+ // AliExpress's 29 product photos drew fitted (fidelity bench, 2026-11-09).
35678
+ "background-size": {
35679
+ "yahoo-mail": {
35680
+ level: "partial",
35681
+ observed: "2026-11-09",
35682
+ source: "Emailens real-device checks, Yahoo Mail web (Chrome): foodpanda campaign (2026-10-28), AliExpress (2026-11-09)",
35683
+ note: "Partial. Ignored inside the background shorthand (`background: url() 0 0 / cover`): the image draws at its natural size. The background-size property written on its own works."
35684
+ }
35685
+ },
35686
+ "text-decoration": {
35687
+ "apple-mail-macos": seen(
35688
+ "partial",
35689
+ "Emailens real-device probe, Apple Mail (macOS)",
35690
+ "The multi-value shorthand `text-decoration: underline wavy #d33` was dropped whole: no line at all. A single line value works; style and colour need -webkit-text-decoration."
35691
+ ),
35692
+ "apple-mail-ios": seen(
35693
+ "partial",
35694
+ "Emailens real-device probe, Apple Mail (iPhone 13)",
35695
+ "The multi-value shorthand `text-decoration: underline wavy #d33` was dropped whole: no line at all. A single line value works; style and colour need -webkit-text-decoration."
35696
+ ),
35697
+ "outlook-macos": seen(
35698
+ "partial",
35699
+ // The legacy app (Outlook 2019 for Mac). Not yet re-checked on the new
35700
+ // Outlook for Mac, which the outlook-macos column now describes.
35701
+ "Emailens real-device probe, Outlook 2019 for Mac (legacy app)",
35702
+ "The multi-value shorthand `text-decoration: underline wavy #d33` was dropped whole: no line at all. A single line value works; style and colour need -webkit-text-decoration."
35703
+ )
35704
+ }
35705
+ };
35534
35706
  function isWordEngineClient(clientId) {
35535
35707
  return clientId === "outlook-windows-legacy";
35536
35708
  }
@@ -35573,14 +35745,35 @@ h1 {
35573
35745
  }
35574
35746
  return serializeStyle(out);
35575
35747
  }
35576
- function inlineStyles($, keepFontFace = true) {
35748
+ function sameProperty(a, b) {
35749
+ const props = (d) => d.split(";").map((p) => p.split(":")[0].trim().toLowerCase());
35750
+ const mine = new Set(props(b));
35751
+ return props(a).some((p) => p && mine.has(p));
35752
+ }
35753
+ function linkRule(color) {
35754
+ return { selector: 'a[href]:not([href="mailto:"])', weight: 100.5, declText: `color: ${color}`, client: true };
35755
+ }
35756
+ function specificity2(selector) {
35757
+ let ids = 0;
35758
+ let classes = 0;
35759
+ let types = 0;
35760
+ csstree3.walk(selector, (node) => {
35761
+ if (node.type === "IdSelector") ids++;
35762
+ else if (node.type === "ClassSelector" || node.type === "AttributeSelector") classes++;
35763
+ else if (node.type === "TypeSelector" && node.name !== "*") types++;
35764
+ });
35765
+ return ids * 1e4 + classes * 100 + types;
35766
+ }
35767
+ function inlineStyles($, keepFontFace = true, clientRules = []) {
35577
35768
  const styleBlocks = [];
35578
35769
  $("style").each((_, el) => {
35579
35770
  styleBlocks.push($(el).text());
35580
35771
  });
35581
- if (styleBlocks.length === 0) return "";
35772
+ if (styleBlocks.length === 0 && clientRules.length === 0) return "";
35582
35773
  const preserved = [];
35583
35774
  const inlined = /* @__PURE__ */ new WeakMap();
35775
+ const rules = [...clientRules];
35776
+ const kept = [];
35584
35777
  for (const block of styleBlocks) {
35585
35778
  let ast;
35586
35779
  try {
@@ -35618,22 +35811,33 @@ h1 {
35618
35811
  const isClientTargeting = shouldPreserveSelector(selectorText);
35619
35812
  if (hasPseudoSelector(selectorText) || isClientTargeting) {
35620
35813
  preserved.push(csstree3.generate(node));
35814
+ if (!hasPseudoSelector(selectorText))
35815
+ node.prelude.children.forEach((selector) => {
35816
+ kept.push({ selector: csstree3.generate(selector), weight: specificity2(selector), declText });
35817
+ });
35621
35818
  return;
35622
35819
  }
35623
- try {
35624
- $(selectorText).each((_, el) => {
35625
- let state = inlined.get(el);
35626
- if (!state) {
35627
- state = { author: cascade(/* @__PURE__ */ new Map(), $(el).attr("style") || ""), sheet: /* @__PURE__ */ new Map() };
35628
- inlined.set(el, state);
35629
- }
35630
- $(el).attr("style", mergeInline(state, declText));
35631
- });
35632
- } catch (e) {
35633
- }
35820
+ node.prelude.children.forEach((selector) => {
35821
+ rules.push({ selector: csstree3.generate(selector), weight: specificity2(selector), declText });
35822
+ });
35634
35823
  }
35635
35824
  });
35636
35825
  }
35826
+ for (const { selector, declText, weight, client } of rules.sort((a, b) => a.weight - b.weight)) {
35827
+ try {
35828
+ $(selector).each((_, el) => {
35829
+ if (client && kept.some((k) => k.weight > weight && sameProperty(k.declText, declText) && $(el).is(k.selector)))
35830
+ return;
35831
+ let state = inlined.get(el);
35832
+ if (!state) {
35833
+ state = { author: cascade(/* @__PURE__ */ new Map(), $(el).attr("style") || ""), sheet: /* @__PURE__ */ new Map() };
35834
+ inlined.set(el, state);
35835
+ }
35836
+ $(el).attr("style", mergeInline(state, declText));
35837
+ });
35838
+ } catch (e) {
35839
+ }
35840
+ }
35637
35841
  return preserved.join("\n");
35638
35842
  }
35639
35843
  function makeWarning(base, prop, clientId, framework) {
@@ -35842,9 +36046,10 @@ h1 {
35842
36046
  }
35843
36047
  var EMPTY_SET = /* @__PURE__ */ new Set();
35844
36048
  var OUTLOOK_WEB_STRIPPED = /* @__PURE__ */ new Set(["position", "transform", "animation", "transition"]);
35845
- var YAHOO_STRIPPED = /* @__PURE__ */ new Set(["position", "box-shadow", "transform", "animation", "transition", "opacity"]);
36049
+ var YAHOO_STRIPPED = /* @__PURE__ */ new Set(["position", "box-shadow", "transform", "animation", "transition"]);
36050
+ var YAHOO_IOS_STRIPPED = /* @__PURE__ */ new Set([...YAHOO_STRIPPED, "opacity"]);
35846
36051
  var YAHOO_WEB_STRIPPED = /* @__PURE__ */ new Set([
35847
- ...[...YAHOO_STRIPPED].filter((p) => p !== "box-shadow"),
36052
+ ...YAHOO_STRIPPED,
35848
36053
  "flex",
35849
36054
  "flex-basis",
35850
36055
  // A width:100% + padding + border-box CTA came out 566px in a 534px column
@@ -35855,6 +36060,9 @@ h1 {
35855
36060
  var CLIENT_CONFIGS = {
35856
36061
  "gmail-web": {
35857
36062
  id: "gmail-web",
36063
+ // 324 of 458 links with no inline colour came out #15c in real Gmail web
36064
+ // (emailens fidelity bench, 2026-11-09); its weight: see linkRule().
36065
+ linkColor: "#15c",
35858
36066
  // caniemail's set. A 2026-10-14 render said Gmail web kept box-shadow,
35859
36067
  // text-shadow, visibility, animation, gap and grid; caniemail's own tests in
35860
36068
  // real Gmail web (Chrome and Firefox, 2026-10-24) did not, and the <style>
@@ -35912,8 +36120,15 @@ h1 {
35912
36120
  strippedProperties: OUTLOOK_WEB_STRIPPED,
35913
36121
  stripMode: "strip",
35914
36122
  stripStyleAnimations: true,
36123
+ // No web font, as on Mac: postmark~welcome's @import of Nunito Sans drew
36124
+ // Arial on the worker's new Outlook (bench 2026-11-09); caniemail agrees.
36125
+ dropAtRules: /^@font-face\b|^@import\b/i,
36126
+ // @media reads the window, not the reading pane: of 27 emails with a
36127
+ // max-width query firing at 620, the worker's new Outlook drew none
36128
+ // mobile (bench 2026-11-09). 766 is that read window, 957 px at 125%.
36129
+ mediaWidth: 766,
35915
36130
  inlineAndStripStyles: false,
35916
- stripExternalStylesheets: false,
36131
+ stripExternalStylesheets: true,
35917
36132
  stripForms: false,
35918
36133
  stripSvg: false
35919
36134
  },
@@ -36056,7 +36271,9 @@ h1 {
36056
36271
  dropValues: /radial-gradient\(/i,
36057
36272
  // Real Yahoo web drew foodpanda's `url(...) center / cover` logos at their
36058
36273
  // 236px and its `0% 0% / 100% 100%` coupon at the picture's own size,
36059
- // cropped to the cell (emailens agreement run, 2026-10-28).
36274
+ // cropped to the cell (emailens agreement run, 2026-10-28): the size inside
36275
+ // the shorthand is ignored. Written on its own it holds (AliExpress,
36276
+ // fidelity bench 2026-11-09).
36060
36277
  dropBackgroundSize: true,
36061
36278
  // A <style> with a comma-separated media query list is dropped whole: a
36062
36279
  // probe on real Yahoo web lost the block for `screen and
@@ -36088,7 +36305,7 @@ h1 {
36088
36305
  },
36089
36306
  "yahoo-mail-ios": {
36090
36307
  id: "yahoo-mail-ios",
36091
- strippedProperties: YAHOO_STRIPPED,
36308
+ strippedProperties: YAHOO_IOS_STRIPPED,
36092
36309
  stripMode: "strip",
36093
36310
  inlineAndStripStyles: false,
36094
36311
  stripExternalStylesheets: false,
@@ -36180,6 +36397,21 @@ h1 {
36180
36397
  additionalChecks: superhumanAdditionalChecks
36181
36398
  }
36182
36399
  };
36400
+ var PLAIN_PROPERTY = /^[a-z][a-z-]*$/;
36401
+ function applyObservations(observations, configs) {
36402
+ for (const [property, byClient] of Object.entries(observations)) {
36403
+ if (!PLAIN_PROPERTY.test(property)) continue;
36404
+ for (const [clientId, o] of Object.entries(byClient)) {
36405
+ const config = configs[clientId];
36406
+ if (!config || o.level === "partial") continue;
36407
+ const strip = new Set(config.strippedProperties);
36408
+ if (o.level === "unsupported") strip.add(property);
36409
+ else strip.delete(property);
36410
+ config.strippedProperties = strip;
36411
+ }
36412
+ }
36413
+ }
36414
+ applyObservations(OBSERVED_OVERRIDES, CLIENT_CONFIGS);
36183
36415
  var TEXT_DECORATION_LINE = /^(?:none|underline|overline|line-through|blink)(?:\s+(?:underline|overline|line-through|blink))*\s*(?:!important)?$/i;
36184
36416
  var isLineOnly = (value) => TEXT_DECORATION_LINE.test(value.trim());
36185
36417
  function dropWarnings(html, config, clientId, framework) {
@@ -36194,9 +36426,25 @@ h1 {
36194
36426
  }
36195
36427
  function hasDrops(config) {
36196
36428
  return Boolean(
36197
- config.dropSelectors || config.dropAtRules || config.dropValues || config.dropProperties || config.dropNesting || config.dropElements || config.dropAttributes
36429
+ config.dropSelectors || config.dropAtRules || config.dropValues || config.dropProperties || config.dropNesting || config.dropElements || config.dropAttributes || config.mediaWidth
36198
36430
  );
36199
36431
  }
36432
+ function mediaAtWidth(prelude, width) {
36433
+ let any = false;
36434
+ for (const query of prelude.toLowerCase().split(",")) {
36435
+ const words = query.replace(/\([^)]*\)/g, " ").trim().split(/\s+/).filter(Boolean);
36436
+ if (words.some((w) => !["only", "screen", "all", "print", "and"].includes(w))) return null;
36437
+ let match = !words.includes("print");
36438
+ for (const f of query.matchAll(/\(([^)]*)\)/g)) {
36439
+ const m = /^\s*(min|max)-width\s*:\s*([\d.]+)px\s*$/.exec(f[1]);
36440
+ if (!m) return null;
36441
+ const px2 = Number(m[2]);
36442
+ if (m[1] === "min" ? width < px2 : width > px2) match = false;
36443
+ }
36444
+ any || (any = match);
36445
+ }
36446
+ return any;
36447
+ }
36200
36448
  function prepareDropSource(html, config) {
36201
36449
  if (!hasDrops(config)) return html;
36202
36450
  const $ = cheerio3.load(html);
@@ -36258,9 +36506,16 @@ h1 {
36258
36506
  enter(node, item, list) {
36259
36507
  if (!list || !item) return;
36260
36508
  const head = node.type === "Atrule" ? `@${node.name}${node.prelude ? ` ${csstree3.generate(node.prelude)}` : ""}` : "";
36509
+ const atWidth = config.mediaWidth && node.type === "Atrule" && node.name === "media" && node.prelude ? mediaAtWidth(csstree3.generate(node.prelude), config.mediaWidth) : null;
36261
36510
  if (dropAtRules && node.type === "Atrule" && dropAtRules.test(head)) {
36262
36511
  list.remove(item);
36263
36512
  dropped.add(`@${node.name}`);
36513
+ } else if (atWidth === false) {
36514
+ list.remove(item);
36515
+ dropped.add("@media (width)");
36516
+ } else if (atWidth === true && node.type === "Atrule" && node.block) {
36517
+ list.insertList(node.block.children, item);
36518
+ list.remove(item);
36264
36519
  } else if (dropSelectors && node.type === "Rule") {
36265
36520
  const m = csstree3.generate(node.prelude).match(dropSelectors);
36266
36521
  if (m) {
@@ -36401,8 +36656,13 @@ h1 {
36401
36656
  if (config.additionalChecks && config.inlineAndStripStyles) {
36402
36657
  warnings.push(...config.additionalChecks($, clientId, html, framework));
36403
36658
  }
36659
+ applyTargetingSimulation($, clientId);
36404
36660
  if (config.inlineAndStripStyles) {
36405
- const preserved = inlineStyles($, ((_a2 = CSS_SUPPORT["@font-face"]) == null ? void 0 : _a2[clientId]) !== "unsupported");
36661
+ const preserved = inlineStyles(
36662
+ $,
36663
+ ((_a2 = CSS_SUPPORT["@font-face"]) == null ? void 0 : _a2[clientId]) !== "unsupported",
36664
+ config.linkColor ? [linkRule(config.linkColor)] : []
36665
+ );
36406
36666
  $("style").remove();
36407
36667
  if (preserved.trim()) {
36408
36668
  const head = $("head");
@@ -36494,7 +36754,7 @@ h1 {
36494
36754
  }
36495
36755
  if (config.dropBackgroundSize) {
36496
36756
  const SIZE = /url\([^)]*\)|\s*\/\s*(?:cover|contain|auto|[\d.]+(?:px|%|em|rem|vw|vh)?)(?:\s+(?:auto|[\d.]+(?:px|%|em|rem|vw|vh)?))?/gi;
36497
- const unsize = (css) => css.replace(/(^|[;{\s])background-size\s*:[^;}]*;?/gi, "$1").replace(
36757
+ const unsize = (css) => css.replace(
36498
36758
  /(background\s*:[^;}]*)/gi,
36499
36759
  (decl) => decl.replace(SIZE, (m) => m.startsWith("url(") ? m : "")
36500
36760
  );
@@ -36593,7 +36853,6 @@ h1 {
36593
36853
  warnings.push(...config.additionalChecks($, clientId, html, framework));
36594
36854
  }
36595
36855
  if (isWordEngineClient(clientId)) applyWordBoxModel($);
36596
- applyTargetingSimulation($, clientId);
36597
36856
  return { clientId, html: $.html(), warnings };
36598
36857
  }
36599
36858
  function transformForClient(html, clientId, framework) {
@@ -36626,9 +36885,12 @@ h1 {
36626
36885
  const result = applyTransform(downleveled, config, framework);
36627
36886
  if (dropSource !== source) result.warnings.unshift(...dropWarnings(source, config, clientId, framework));
36628
36887
  if (wordEngine) result.html = vmlToCss(result.html);
36629
- if (isWordEngineClient(clientId)) result.html = applyMsoHide(result.html);
36888
+ if (isWordEngineClient(clientId)) result.html = standardsMode(applyMsoHide(result.html));
36630
36889
  return result;
36631
36890
  }
36891
+ function standardsMode(html) {
36892
+ return /^\s*(?:<!--[\s\S]*?-->\s*)*<!doctype/i.test(html) ? html : `<!DOCTYPE html>${html}`;
36893
+ }
36632
36894
  function transformForAllClients2(html, framework) {
36633
36895
  if (!html || !html.trim()) {
36634
36896
  return Object.keys(CLIENT_CONFIGS).map((clientId) => ({
@@ -36671,7 +36933,7 @@ h1 {
36671
36933
  result = applyTransformDom(clientDom, source, config, framework);
36672
36934
  }
36673
36935
  if (wordEngine) result.html = vmlToCss(result.html);
36674
- if (isWordEngineClient(clientId)) result.html = applyMsoHide(result.html);
36936
+ if (isWordEngineClient(clientId)) result.html = standardsMode(applyMsoHide(result.html));
36675
36937
  return result;
36676
36938
  });
36677
36939
  }
@@ -37884,9 +38146,9 @@ h1 {
37884
38146
  }
37885
38147
  if (parts.length === classes.length && classes.length === 1) {
37886
38148
  const name = classes[0].name;
37887
- const seen = (_a2 = propsByClass.get(name)) != null ? _a2 : /* @__PURE__ */ new Set();
37888
- for (const p of props) seen.add(p);
37889
- propsByClass.set(name, seen);
38149
+ const seen2 = (_a2 = propsByClass.get(name)) != null ? _a2 : /* @__PURE__ */ new Set();
38150
+ for (const p of props) seen2.add(p);
38151
+ propsByClass.set(name, seen2);
37890
38152
  }
37891
38153
  }
37892
38154
  }
@@ -38015,18 +38277,18 @@ h1 {
38015
38277
  const names = ((_a2 = $(el).attr("class")) != null ? _a2 : "").split(/\s+/).filter(Boolean);
38016
38278
  if (names.length < 2) return;
38017
38279
  const loc = locOfElement(el);
38018
- const seen = /* @__PURE__ */ new Map();
38280
+ const seen2 = /* @__PURE__ */ new Map();
38019
38281
  for (const sheet of sheets) {
38020
38282
  for (const name of names) {
38021
38283
  for (const prop of (_b = sheet.propsByClass.get(name)) != null ? _b : []) {
38022
- const first = seen.get(prop);
38284
+ const first = seen2.get(prop);
38023
38285
  if (first && first !== name) {
38024
38286
  conflictExample || (conflictExample = `.${first} and .${name} both set ${prop}`);
38025
38287
  conflictCount++;
38026
38288
  if (loc) conflicting.push(loc);
38027
38289
  return;
38028
38290
  }
38029
- if (!first) seen.set(prop, name);
38291
+ if (!first) seen2.set(prop, name);
38030
38292
  }
38031
38293
  }
38032
38294
  if (names.some((n) => sheet.classesWithDescendants.has(n))) {
@@ -38087,7 +38349,7 @@ h1 {
38087
38349
  const found = { selector: "", props: [], elements: [], inherits: false };
38088
38350
  const body = $("body").first();
38089
38351
  if (!body.length) return found;
38090
- const seen = /* @__PURE__ */ new Set();
38352
+ const seen2 = /* @__PURE__ */ new Set();
38091
38353
  const props = /* @__PURE__ */ new Set();
38092
38354
  for (const el of $("style").toArray()) {
38093
38355
  let ast;
@@ -38135,8 +38397,8 @@ h1 {
38135
38397
  if (value === "inherit") found.inherits = true;
38136
38398
  hit2 = true;
38137
38399
  }
38138
- if (hit2 && !seen.has(target)) {
38139
- seen.add(target);
38400
+ if (hit2 && !seen2.has(target)) {
38401
+ seen2.add(target);
38140
38402
  found.elements.push(target);
38141
38403
  found.selector || (found.selector = text.trim());
38142
38404
  }
@@ -38224,8 +38486,8 @@ h1 {
38224
38486
  );
38225
38487
  return m ? (_a2 = m[1]) != null ? _a2 : m[2] : void 0;
38226
38488
  }
38227
- function add(issues, seen, key, issue) {
38228
- const existing = seen.get(key);
38489
+ function add(issues, seen2, key, issue) {
38490
+ const existing = seen2.get(key);
38229
38491
  if (existing) {
38230
38492
  if (!issue.loc || !existing.locs) return;
38231
38493
  if (existing.locs.some((l) => l.offset === issue.loc.offset)) return;
@@ -38236,32 +38498,32 @@ h1 {
38236
38498
  existing.locs.push(issue.loc);
38237
38499
  return;
38238
38500
  }
38239
- seen.set(key, issue);
38501
+ seen2.set(key, issue);
38240
38502
  issues.push(issue);
38241
38503
  }
38242
38504
  function withLoc(issue, loc) {
38243
38505
  return loc ? __spreadProps(__spreadValues({}, issue), { loc, locs: [loc] }) : issue;
38244
38506
  }
38245
38507
  var TEXT_HOSTS = /<\s*(center|v:textbox|div|p|table|h[1-6]|span|font|a)\b/i;
38246
- function checkLooseText(issues, seen, open, inner, source) {
38508
+ function checkLooseText(issues, seen2, open, inner, source) {
38247
38509
  if (TEXT_HOSTS.test(inner)) return;
38248
38510
  const text = inner.replace(/<!--[\s\S]*?-->/g, "").replace(/<[^>]*>/g, "").replace(/&nbsp;|\s/g, "");
38249
38511
  if (text === "") return;
38250
- add(issues, seen, `loosetext:${open.name}`, withLoc({
38512
+ add(issues, seen2, `loosetext:${open.name}`, withLoc({
38251
38513
  rule: "vml-unrendered-text",
38252
38514
  severity: "error",
38253
38515
  message: `<v:${open.name}> has label text with no element around it, which Outlook does not draw.`,
38254
38516
  detail: `Verified in Outlook Classic: the shape renders its fill and shape correctly and shows no text at all, so the reader gets a blank coloured block where the label should be. Nothing errors and the HTML fallback still reads correctly in every other client, so this ships unnoticed. Wrap the text in <center> (what the bulletproof-button pattern uses) or in <v:textbox>.`
38255
38517
  }, locAt(source, open.offset, open.length)));
38256
38518
  }
38257
- function checkFillPicture(issues, seen, open, inner, source) {
38519
+ function checkFillPicture(issues, seen2, open, inner, source) {
38258
38520
  if (/<v:imagedata\b/i.test(inner)) return;
38259
38521
  const fill = inner.match(/<v:fill\b([^>]*)>/i);
38260
38522
  if (!fill || attr(fill[1], "src") === void 0) return;
38261
38523
  const label = inner.replace(/<!--[\s\S]*?-->/g, "").replace(/<[^>]*>/g, "").replace(/&nbsp;|\s/g, "");
38262
38524
  const picture2 = label === "";
38263
38525
  const measured = `Measured on real Outlook: 2007 and 2010 draw the picture, but 2013, 2016 and 2019 show only the fill's colour.`;
38264
- add(issues, seen, `fillpicture:${open.name}`, withLoc(picture2 ? {
38526
+ add(issues, seen2, `fillpicture:${open.name}`, withLoc(picture2 ? {
38265
38527
  rule: "vml-roundrect-fill-picture",
38266
38528
  severity: "error",
38267
38529
  message: `<v:roundrect> paints its picture with <v:fill src>, which Outlook 2013, 2016 and 2019 leave blank.`,
@@ -38293,7 +38555,7 @@ h1 {
38293
38555
  }
38294
38556
  return tags;
38295
38557
  }
38296
- function checkGhostTables(issues, seen, blocks, source) {
38558
+ function checkGhostTables(issues, seen2, blocks, source) {
38297
38559
  var _a2;
38298
38560
  const tags = ghostTags(blocks);
38299
38561
  if (tags.length === 0) return;
@@ -38311,7 +38573,7 @@ h1 {
38311
38573
  for (const [name, list] of opens) {
38312
38574
  if (!GHOST_TAGS.has(name)) continue;
38313
38575
  for (const tag of list.slice(0, 1)) {
38314
- add(issues, seen, `ghost-open:${name}`, withLoc({
38576
+ add(issues, seen2, `ghost-open:${name}`, withLoc({
38315
38577
  rule: "ghost-table-unbalanced",
38316
38578
  severity: "error",
38317
38579
  message: `<${name}> is opened inside an Outlook conditional comment and never closed.`,
@@ -38320,7 +38582,7 @@ h1 {
38320
38582
  }
38321
38583
  }
38322
38584
  for (const tag of strays.slice(0, 1)) {
38323
- add(issues, seen, `ghost-stray:${tag.name}`, withLoc({
38585
+ add(issues, seen2, `ghost-stray:${tag.name}`, withLoc({
38324
38586
  rule: "ghost-table-unbalanced",
38325
38587
  severity: "error",
38326
38588
  message: `Closing </${tag.name}> inside an Outlook conditional comment has no matching opening tag.`,
@@ -38334,8 +38596,8 @@ h1 {
38334
38596
  const blocks = msoBlocks(html);
38335
38597
  const tags = vmlTags(blocks);
38336
38598
  const issues = [];
38337
- const seen = /* @__PURE__ */ new Map();
38338
- checkGhostTables(issues, seen, blocks, source);
38599
+ const seen2 = /* @__PURE__ */ new Map();
38600
+ checkGhostTables(issues, seen2, blocks, source);
38339
38601
  if (tags.length === 0) return { hasVml: false, issues };
38340
38602
  const openShapes = [];
38341
38603
  let groupDepth = 0;
@@ -38351,11 +38613,11 @@ h1 {
38351
38613
  if (idx !== -1) {
38352
38614
  const open = openShapes[idx];
38353
38615
  const inner = html.slice(open.offset + open.length, tag.offset);
38354
- checkLooseText(issues, seen, open, inner, source);
38355
- if (name === "roundrect") checkFillPicture(issues, seen, open, inner, source);
38616
+ checkLooseText(issues, seen2, open, inner, source);
38617
+ if (name === "roundrect") checkFillPicture(issues, seen2, open, inner, source);
38356
38618
  }
38357
38619
  if (idx === -1) {
38358
- add(issues, seen, `stray:${name}`, withLoc({
38620
+ add(issues, seen2, `stray:${name}`, withLoc({
38359
38621
  rule: "vml-unbalanced-tag",
38360
38622
  severity: "error",
38361
38623
  message: `Closing </v:${name}> has no matching opening tag.`,
@@ -38371,7 +38633,7 @@ h1 {
38371
38633
  if (isShape) {
38372
38634
  const parent = openShapes[openShapes.length - 1];
38373
38635
  if (parent && groupDepth === 0) {
38374
- add(issues, seen, `nested:${parent.name}>${name}`, withLoc({
38636
+ add(issues, seen2, `nested:${parent.name}>${name}`, withLoc({
38375
38637
  rule: "vml-nested-shape",
38376
38638
  severity: "error",
38377
38639
  message: `<v:${name}> is nested inside <v:${parent.name}>. Outlook does not support nesting one VML shape inside another.`,
@@ -38400,7 +38662,7 @@ h1 {
38400
38662
  if (!m) continue;
38401
38663
  const value = m[1].trim();
38402
38664
  if (value === "" || /^[a-z%]+$/i.test(value)) {
38403
- add(issues, seen, `dim:${name}:${prop}:${value}`, withLoc({
38665
+ add(issues, seen2, `dim:${name}:${prop}:${value}`, withLoc({
38404
38666
  rule: "vml-invalid-dimension",
38405
38667
  severity: "error",
38406
38668
  message: `<v:${name}> has an invalid ${prop}: "${prop}:${value}" is missing its number.`,
@@ -38415,7 +38677,7 @@ h1 {
38415
38677
  const raw = arcsize.trim();
38416
38678
  const pct = raw.endsWith("%") ? parseFloat(raw) : parseFloat(raw) * 100;
38417
38679
  if (Number.isFinite(pct) && (pct < 0 || pct > 100)) {
38418
- add(issues, seen, `arcsize:${raw}`, withLoc({
38680
+ add(issues, seen2, `arcsize:${raw}`, withLoc({
38419
38681
  rule: "vml-arcsize-range",
38420
38682
  severity: "warning",
38421
38683
  message: `<v:roundrect> has arcsize="${raw}", outside the valid 0%\u2013100% range.`,
@@ -38426,7 +38688,7 @@ h1 {
38426
38688
  }
38427
38689
  }
38428
38690
  for (const tag of openShapes) {
38429
- add(issues, seen, `unclosed:${tag.name}`, withLoc({
38691
+ add(issues, seen2, `unclosed:${tag.name}`, withLoc({
38430
38692
  rule: "vml-unbalanced-tag",
38431
38693
  severity: "error",
38432
38694
  message: `<v:${tag.name}> is never closed.`,
@@ -38434,7 +38696,7 @@ h1 {
38434
38696
  }, locAt(source, tag.offset, tag.length)));
38435
38697
  }
38436
38698
  if (/<head[\s>]/i.test(html) && !/<o:PixelsPerInch[\s>]/i.test(html)) {
38437
- add(issues, seen, "ppi", withLoc({
38699
+ add(issues, seen2, "ppi", withLoc({
38438
38700
  rule: "vml-pixels-per-inch",
38439
38701
  severity: "warning",
38440
38702
  message: `This email uses VML but does not declare <o:PixelsPerInch>96</o:PixelsPerInch>.`,
@@ -38458,6 +38720,9 @@ h1 {
38458
38720
  next = adjustBody(live$, next);
38459
38721
  return appendKillers(next, html, wordHtml, vml, framework);
38460
38722
  }
38723
+ var nonZeroPadding = (style) => [...style.matchAll(/(?:^|[^-])padding(?:-(?:top|right|bottom|left))?\s*:\s*([^;]*)/gi)].some(
38724
+ ([, value]) => !/^(?:\s*0(?:px|em|rem|%|pt)?)+\s*(?:!important)?\s*$/i.test(value)
38725
+ );
38461
38726
  var hit = (re) => (style) => re.test(style);
38462
38727
  var LAYER_TOKEN = {
38463
38728
  image: null,
@@ -38514,7 +38779,7 @@ h1 {
38514
38779
  apply(word$, wordRules, WORD, "linear-gradient", hit(/linear-gradient\s*\(/i), wordFill, "Outlook Classic drops this linear-gradient, and no v:fill covers it.", true);
38515
38780
  apply(word$, wordRules, WORD, "max-width", hit(/max-width\s*:/i), (el, style) => maxWidthCovered(word$, el, style), "Outlook Classic only honours max-width on a table. Wrap the element in a table with a fixed width.", true);
38516
38781
  apply(word$, wordRules, WORD, "min-width", hit(/min-width\s*:/i), (el, style) => minWidthCovered(word$, el, style), "Outlook Classic ignores min-width. Give the box a width, or put it in a cell with one.", true);
38517
- apply(word$, wordRules, WORD, "padding", hit(/(?:^|[^-])padding(?:-(?:top|right|bottom|left))?\s*:/i), (el) => paddingCovered(word$, el, true), "Outlook Classic drops this padding. Put it on a table cell, or set mso-padding-alt on one.", true);
38782
+ apply(word$, wordRules, WORD, "padding", nonZeroPadding, (el) => paddingCovered(word$, el, true), "Outlook Classic drops this padding. Put it on a table cell, or set mso-padding-alt on one.", true);
38518
38783
  apply(word$, wordRules, WORD, "float", hit(/float\s*:/i), never, "Outlook Classic drops this float. The MSO branch needs a table with align.", true);
38519
38784
  apply(word$, wordRules, WORD, "display:flex", hit(/display\s*:\s*(?:inline-)?flex\b/i), never, "Outlook Classic receives this flex box. The MSO branch needs a table.", true);
38520
38785
  apply(word$, wordRules, WORD, "display:grid", hit(/display\s*:\s*(?:inline-)?grid\b/i), never, "Outlook Classic receives this grid box. The MSO branch needs a table.", true);
@@ -38943,12 +39208,12 @@ h1 {
38943
39208
  }
38944
39209
  function appendKillers(warnings, html, wordHtml, vml, framework) {
38945
39210
  const extra = [];
38946
- const seen = new Set(warnings.map((w) => `${w.client}:${w.property}`));
39211
+ const seen2 = new Set(warnings.map((w) => `${w.client}:${w.property}`));
38947
39212
  const push = (client, property, severity, message) => {
38948
39213
  var _a2;
38949
39214
  const key = `${client}:${property}`;
38950
- if (seen.has(key)) return;
38951
- seen.add(key);
39215
+ if (seen2.has(key)) return;
39216
+ seen2.add(key);
38952
39217
  extra.push({
38953
39218
  severity,
38954
39219
  client,
@@ -39088,11 +39353,11 @@ h1 {
39088
39353
  suggestion: "Avoid client-specific hacks in strict mode, or switch to progressive targeting policy."
39089
39354
  };
39090
39355
  }
39091
- function recordMatch(report, seen, matcher, policy, matchedText, selector) {
39092
- if (seen.has(matcher.id)) return;
39356
+ function recordMatch(report, seen2, matcher, policy, matchedText, selector) {
39357
+ if (seen2.has(matcher.id)) return;
39093
39358
  const hack = targetingHackForMatcher(matcher);
39094
39359
  if (!hack) return;
39095
- seen.add(matcher.id);
39360
+ seen2.add(matcher.id);
39096
39361
  report.detectedHacks.push({
39097
39362
  hack,
39098
39363
  foundIn: matcher.foundIn,
@@ -39102,14 +39367,14 @@ h1 {
39102
39367
  const warning = applyLint(matcher, hack, policy, { matchedText, selector });
39103
39368
  if (warning) report.warnings.push(warning);
39104
39369
  }
39105
- function scanHtmlForTargeting(html, report, seen, policy) {
39370
+ function scanHtmlForTargeting(html, report, seen2, policy) {
39106
39371
  for (const matcher of HTML_MATCHERS) {
39107
39372
  const match = html.match(matcher.pattern);
39108
39373
  if (!match) continue;
39109
- recordMatch(report, seen, matcher, policy, match[0]);
39374
+ recordMatch(report, seen2, matcher, policy, match[0]);
39110
39375
  }
39111
39376
  }
39112
- function scanCssAstForTargeting(ast, report, seen, policy) {
39377
+ function scanCssAstForTargeting(ast, report, seen2, policy) {
39113
39378
  csstree8.walk(ast, {
39114
39379
  visit: "Rule",
39115
39380
  enter(node) {
@@ -39118,7 +39383,7 @@ h1 {
39118
39383
  const selectorText = csstree8.generate(child).trim();
39119
39384
  for (const matcher of SELECTOR_MATCHERS) {
39120
39385
  if (matcher.pattern.test(selectorText)) {
39121
- recordMatch(report, seen, matcher, policy, selectorText, selectorText);
39386
+ recordMatch(report, seen2, matcher, policy, selectorText, selectorText);
39122
39387
  }
39123
39388
  }
39124
39389
  });
@@ -39132,13 +39397,13 @@ h1 {
39132
39397
  const haystack = `@${node.name} ${atRulePrelude}`;
39133
39398
  for (const matcher of ATRULE_MATCHERS) {
39134
39399
  if (matcher.pattern.test(atRulePrelude) || matcher.pattern.test(haystack)) {
39135
- recordMatch(report, seen, matcher, policy, haystack);
39400
+ recordMatch(report, seen2, matcher, policy, haystack);
39136
39401
  }
39137
39402
  }
39138
39403
  }
39139
39404
  });
39140
39405
  }
39141
- function scanStyleBlocks(html, report, seen, policy) {
39406
+ function scanStyleBlocks(html, report, seen2, policy) {
39142
39407
  const styleRegex = /<style\b[^>]*>([\s\S]*?)<\/style>/gi;
39143
39408
  let styleMatch;
39144
39409
  while ((styleMatch = styleRegex.exec(html)) !== null) {
@@ -39148,14 +39413,14 @@ h1 {
39148
39413
  } catch (e) {
39149
39414
  continue;
39150
39415
  }
39151
- scanCssAstForTargeting(ast, report, seen, policy);
39416
+ scanCssAstForTargeting(ast, report, seen2, policy);
39152
39417
  }
39153
39418
  }
39154
39419
  function checkTargetingHacks(html, policy = "progressive") {
39155
39420
  const report = emptyTargetingReport();
39156
- const seen = /* @__PURE__ */ new Set();
39157
- scanHtmlForTargeting(html, report, seen, policy);
39158
- scanStyleBlocks(html, report, seen, policy);
39421
+ const seen2 = /* @__PURE__ */ new Set();
39422
+ scanHtmlForTargeting(html, report, seen2, policy);
39423
+ scanStyleBlocks(html, report, seen2, policy);
39159
39424
  return report;
39160
39425
  }
39161
39426
  var WORD_ENGINE_CLIENT = "outlook-windows-legacy";
@@ -39428,24 +39693,24 @@ h1 {
39428
39693
  if (!cssLoc) return;
39429
39694
  const loc = locInCssBlock(blockAnchor, cssLoc);
39430
39695
  if (!loc) return;
39431
- const seen = selectorLocs.get(key);
39432
- if (!seen) {
39696
+ const seen2 = selectorLocs.get(key);
39697
+ if (!seen2) {
39433
39698
  selectorLocs.set(key, { locs: [loc], scopes: [scope != null ? scope : null] });
39434
39699
  return;
39435
39700
  }
39436
- if (seen.locs.some((l) => l.offset === loc.offset)) return;
39437
- if (seen.locs.length >= MAX_WARNING_LOCATIONS) {
39438
- seen.truncated = true;
39701
+ if (seen2.locs.some((l) => l.offset === loc.offset)) return;
39702
+ if (seen2.locs.length >= MAX_WARNING_LOCATIONS) {
39703
+ seen2.truncated = true;
39439
39704
  return;
39440
39705
  }
39441
- seen.locs.push(loc);
39442
- if (seen.scopes) seen.scopes.push(scope != null ? scope : null);
39706
+ seen2.locs.push(loc);
39707
+ if (seen2.scopes) seen2.scopes.push(scope != null ? scope : null);
39443
39708
  }
39444
39709
  function recordLoc(key, cssLoc, value, scope) {
39445
39710
  const loc = locInCssBlock(blockAnchor, cssLoc);
39446
39711
  if (!loc) return;
39447
- const seen = propertyLocs.get(key);
39448
- if (!seen) {
39712
+ const seen2 = propertyLocs.get(key);
39713
+ if (!seen2) {
39449
39714
  propertyLocs.set(key, __spreadProps(__spreadValues({
39450
39715
  locs: [loc]
39451
39716
  }, value !== void 0 ? { values: [value] } : {}), {
@@ -39453,14 +39718,14 @@ h1 {
39453
39718
  }));
39454
39719
  return;
39455
39720
  }
39456
- if (seen.locs.some((l) => l.offset === loc.offset)) return;
39457
- if (seen.locs.length >= MAX_WARNING_LOCATIONS) {
39458
- seen.truncated = true;
39721
+ if (seen2.locs.some((l) => l.offset === loc.offset)) return;
39722
+ if (seen2.locs.length >= MAX_WARNING_LOCATIONS) {
39723
+ seen2.truncated = true;
39459
39724
  return;
39460
39725
  }
39461
- seen.locs.push(loc);
39462
- if (seen.values && value !== void 0) seen.values.push(value);
39463
- if (seen.scopes) seen.scopes.push(scope != null ? scope : null);
39726
+ seen2.locs.push(loc);
39727
+ if (seen2.values && value !== void 0) seen2.values.push(value);
39728
+ if (seen2.scopes) seen2.scopes.push(scope != null ? scope : null);
39464
39729
  }
39465
39730
  $("style").each((_, el) => {
39466
39731
  const cssText = $(el).text();
@@ -40308,11 +40573,11 @@ Client-agnostic rendering bugs. Apply each fix directly to the code.
40308
40573
  return { warnings, truncated: false, removed: 0 };
40309
40574
  }
40310
40575
  let result = [...warnings];
40311
- const seen = /* @__PURE__ */ new Set();
40576
+ const seen2 = /* @__PURE__ */ new Set();
40312
40577
  result = result.filter((w) => {
40313
40578
  const key = `${w.property}:${w.severity}`;
40314
- if (seen.has(key)) return false;
40315
- seen.add(key);
40579
+ if (seen2.has(key)) return false;
40580
+ seen2.add(key);
40316
40581
  return true;
40317
40582
  });
40318
40583
  if (estimateFits(result, html, maxTokens)) {
@@ -40973,7 +41238,7 @@ ${targetingFixBullets()}
40973
41238
  }
40974
41239
  function checkUrlShorteners($) {
40975
41240
  const issues = [];
40976
- const seen = /* @__PURE__ */ new Set();
41241
+ const seen2 = /* @__PURE__ */ new Set();
40977
41242
  $("a[href]").each((_, el) => {
40978
41243
  const href = $(el).attr("href") || "";
40979
41244
  let hostname;
@@ -40983,8 +41248,8 @@ ${targetingFixBullets()}
40983
41248
  return;
40984
41249
  }
40985
41250
  for (const shortener of URL_SHORTENERS) {
40986
- if ((hostname === shortener || hostname.endsWith("." + shortener)) && !seen.has(shortener)) {
40987
- seen.add(shortener);
41251
+ if ((hostname === shortener || hostname.endsWith("." + shortener)) && !seen2.has(shortener)) {
41252
+ seen2.add(shortener);
40988
41253
  issues.push({
40989
41254
  rule: "url-shortener",
40990
41255
  severity: "warning",
@@ -41672,7 +41937,7 @@ Href: ${href}`
41672
41937
  });
41673
41938
  if (!decls.length) return;
41674
41939
  for (const selector of splitTopLevel(selectorList).map((x) => x.trim()).filter(Boolean)) {
41675
- const specificity2 = specificityOf(selector);
41940
+ const specificity3 = specificityOf(selector);
41676
41941
  let matched;
41677
41942
  try {
41678
41943
  matched = $(selector).toArray();
@@ -41684,7 +41949,7 @@ Href: ${href}`
41684
41949
  record(el, d.prop, __spreadProps(__spreadValues({}, d), {
41685
41950
  inline: false,
41686
41951
  presentational: false,
41687
- specificity: specificity2,
41952
+ specificity: specificity3,
41688
41953
  order: order++
41689
41954
  }));
41690
41955
  }
@@ -41998,10 +42263,10 @@ Href: ${href}`
41998
42263
  return issues.filter((i) => i.rule === "low-contrast");
41999
42264
  }
42000
42265
  function contrastDelta(candidates, baseline, rule, prefix, details) {
42001
- const seen = new Set(lowContrastOnly(baseline).map((i) => i.element));
42266
+ const seen2 = new Set(lowContrastOnly(baseline).map((i) => i.element));
42002
42267
  return lowContrastOnly(candidates).filter((issue) => {
42003
- if (seen.has(issue.element)) return false;
42004
- seen.add(issue.element);
42268
+ if (seen2.has(issue.element)) return false;
42269
+ seen2.add(issue.element);
42005
42270
  return true;
42006
42271
  }).map((issue) => __spreadProps(__spreadValues(__spreadValues({
42007
42272
  severity: issue.severity,
@@ -42512,15 +42777,15 @@ Href: ${href}`
42512
42777
  function checkTemplateVariablesFromDom($, source) {
42513
42778
  var _a2;
42514
42779
  const issues = [];
42515
- const seen = /* @__PURE__ */ new Set();
42780
+ const seen2 = /* @__PURE__ */ new Set();
42516
42781
  const textNodes = visibleTextNodes($);
42517
42782
  const positioned = textNodes.some((n) => n.sourceCodeLocation);
42518
42783
  for (const node of positioned ? textNodes : []) {
42519
42784
  const data = (_a2 = node.data) != null ? _a2 : "";
42520
42785
  for (const { variable, label, index } of findVariables(data)) {
42521
42786
  const key = `text:${variable}`;
42522
- if (seen.has(key)) continue;
42523
- seen.add(key);
42787
+ if (seen2.has(key)) continue;
42788
+ seen2.add(key);
42524
42789
  const loc = locInTextNode(node, index, variable.length, source);
42525
42790
  issues.push(__spreadValues({
42526
42791
  rule: "unresolved-variable",
@@ -42537,8 +42802,8 @@ Href: ${href}`
42537
42802
  }).join("");
42538
42803
  for (const { variable, label } of findVariables(textContent)) {
42539
42804
  const key = `text:${variable}`;
42540
- if (seen.has(key)) continue;
42541
- seen.add(key);
42805
+ if (seen2.has(key)) continue;
42806
+ seen2.add(key);
42542
42807
  issues.push({
42543
42808
  rule: "unresolved-variable",
42544
42809
  severity: "error",
@@ -42556,8 +42821,8 @@ Href: ${href}`
42556
42821
  if (!value) continue;
42557
42822
  for (const { variable, label } of findVariables(value)) {
42558
42823
  const key = `attr:${attr2}:${variable}`;
42559
- if (seen.has(key)) continue;
42560
- seen.add(key);
42824
+ if (seen2.has(key)) continue;
42825
+ seen2.add(key);
42561
42826
  const loc = locOfAttr(el, attr2);
42562
42827
  const espLink = attr2 === "href" && ESP_SYSTEM_LINK.test(variable);
42563
42828
  issues.push(__spreadValues({
@@ -42597,9 +42862,9 @@ Href: ${href}`
42597
42862
  if (maxMatch && parseInt(maxMatch[1], 10) <= EMAIL_MAX_WIDTH) return true;
42598
42863
  return false;
42599
42864
  }
42600
- function addWidthIssue(width, label, issues, seen, loc) {
42865
+ function addWidthIssue(width, label, issues, seen2, loc) {
42601
42866
  const key = `w:${label}:${width}`;
42602
- const existing = seen.get(key);
42867
+ const existing = seen2.get(key);
42603
42868
  if (existing) {
42604
42869
  addOccurrence(existing, loc);
42605
42870
  return;
@@ -42610,7 +42875,7 @@ Href: ${href}`
42610
42875
  message: `${label} has a fixed width of ${width}px, wider than the ${EMAIL_MAX_WIDTH}px email frame; it will force horizontal scrolling, especially on mobile.`,
42611
42876
  detail: `Use width:100% with max-width:${EMAIL_MAX_WIDTH}px instead of a fixed width beyond the frame.`
42612
42877
  }, loc ? { loc, locs: [loc] } : {});
42613
- seen.set(key, issue);
42878
+ seen2.set(key, issue);
42614
42879
  issues.push(issue);
42615
42880
  }
42616
42881
  function locateInNodes(nodes, starts, index, length, source) {
@@ -42645,7 +42910,7 @@ Href: ${href}`
42645
42910
  function checkOverflowFromDom($, source) {
42646
42911
  var _a2;
42647
42912
  const issues = [];
42648
- const seen = /* @__PURE__ */ new Map();
42913
+ const seen2 = /* @__PURE__ */ new Map();
42649
42914
  const tokensSeen = /* @__PURE__ */ new Set();
42650
42915
  $("[width], [style*='width']").each((_, el) => {
42651
42916
  const $el = $(el);
@@ -42654,7 +42919,7 @@ Href: ${href}`
42654
42919
  if (isFluid($el.attr("style") || "")) return;
42655
42920
  const tag = (el.tagName || "element").toLowerCase();
42656
42921
  const fromStyle = /(?:^|[;\s])width\s*:\s*\d+px/i.test($el.attr("style") || "");
42657
- addWidthIssue(width, `<${tag}>`, issues, seen, locOfAttr(el, fromStyle ? "style" : "width"));
42922
+ addWidthIssue(width, `<${tag}>`, issues, seen2, locOfAttr(el, fromStyle ? "style" : "width"));
42658
42923
  });
42659
42924
  $("style").each((_, el) => {
42660
42925
  const cssText = $(el).text();
@@ -42689,7 +42954,7 @@ Href: ${href}`
42689
42954
  });
42690
42955
  if (widthPx !== null && widthPx > EMAIL_MAX_WIDTH && !fluid) {
42691
42956
  const selector = csstree11.generate(node.prelude).trim().slice(0, 40);
42692
- addWidthIssue(widthPx, selector || "rule", issues, seen, widthLoc);
42957
+ addWidthIssue(widthPx, selector || "rule", issues, seen2, widthLoc);
42693
42958
  }
42694
42959
  }
42695
42960
  });
@@ -42719,7 +42984,7 @@ Href: ${href}`
42719
42984
  }
42720
42985
  if (!rowHasFluid && explicitCellCount >= 2 && rowFixedPx > EMAIL_MAX_WIDTH) {
42721
42986
  const key = `row:${rowFixedPx}:${explicitCellCount}`;
42722
- if (!seen.has(key)) {
42987
+ if (!seen2.has(key)) {
42723
42988
  const loc = locOfElement(trEl) || locOfElement(tableEl);
42724
42989
  const issue = __spreadValues({
42725
42990
  rule: "table-row-overflow",
@@ -42727,7 +42992,7 @@ Href: ${href}`
42727
42992
  message: `Table row has ${explicitCellCount} columns totaling ${rowFixedPx}px, wider than the ${EMAIL_MAX_WIDTH}px email frame; it will force horizontal scrolling on mobile.`,
42728
42993
  detail: `Make columns fluid with percentage widths (e.g. width:50%) or stack columns vertically on small screens.`
42729
42994
  }, loc ? { loc, locs: [loc] } : {});
42730
- seen.set(key, issue);
42995
+ seen2.set(key, issue);
42731
42996
  issues.push(issue);
42732
42997
  }
42733
42998
  }
@@ -42744,7 +43009,7 @@ Href: ${href}`
42744
43009
  const parentWidth = fixedPxWidth($parent);
42745
43010
  if (parentWidth !== null && parentWidth > 0 && imgWidth > parentWidth) {
42746
43011
  const key = `img-overflow:${imgWidth}:${parentWidth}`;
42747
- if (!seen.has(key)) {
43012
+ if (!seen2.has(key)) {
42748
43013
  const loc = locOfAttr(imgEl, "width") || locOfElement(imgEl);
42749
43014
  const issue = __spreadValues({
42750
43015
  rule: "image-container-overflow",
@@ -42752,7 +43017,7 @@ Href: ${href}`
42752
43017
  message: `<img> has fixed width ${imgWidth}px exceeding its container's width (${parentWidth}px); it will blow out the layout.`,
42753
43018
  detail: `Set width:100% with max-width:${imgWidth}px or reduce the image width to fit within ${parentWidth}px.`
42754
43019
  }, loc ? { loc, locs: [loc] } : {});
42755
- seen.set(key, issue);
43020
+ seen2.set(key, issue);
42756
43021
  issues.push(issue);
42757
43022
  }
42758
43023
  }
@@ -42876,7 +43141,7 @@ Href: ${href}`
42876
43141
  }
42877
43142
  issue.locs.push(loc);
42878
43143
  }
42879
- function inspectDeclarations(style, issues, seen, locs) {
43144
+ function inspectDeclarations(style, issues, seen2, locs) {
42880
43145
  var _a2, _b, _c;
42881
43146
  const combined = `${(_a2 = style.get("background-image")) != null ? _a2 : ""} ${(_b = style.get("background")) != null ? _b : ""}`;
42882
43147
  const isGradient = GRADIENT_RE.test(combined);
@@ -42886,7 +43151,7 @@ Href: ${href}`
42886
43151
  const fix = stop ? `background-color: ${stop};` : `background-color: <solid colour matching the image>;`;
42887
43152
  const key = `bg:${fix}`;
42888
43153
  const loc = (_c = locs == null ? void 0 : locs.get("background-image")) != null ? _c : locs == null ? void 0 : locs.get("background");
42889
- const existing = seen.get(key);
43154
+ const existing = seen2.get(key);
42890
43155
  if (existing) {
42891
43156
  addOccurrence2(existing, loc);
42892
43157
  } else {
@@ -42897,7 +43162,7 @@ Href: ${href}`
42897
43162
  detail: isGradient ? `Add a solid fallback beneath the gradient using its first colour stop.` : `Add a solid background-color so the area still has colour when the image is dropped.`,
42898
43163
  fix
42899
43164
  }, loc ? { loc, locs: [loc] } : {});
42900
- seen.set(key, issue);
43165
+ seen2.set(key, issue);
42901
43166
  issues.push(issue);
42902
43167
  }
42903
43168
  }
@@ -42906,7 +43171,7 @@ Href: ${href}`
42906
43171
  const fix = `font-family: ${font.trim()}, Arial, sans-serif;`;
42907
43172
  const key = `font:${font.trim().toLowerCase()}`;
42908
43173
  const loc = locs == null ? void 0 : locs.get("font-family");
42909
- const existing = seen.get(key);
43174
+ const existing = seen2.get(key);
42910
43175
  if (existing) {
42911
43176
  addOccurrence2(existing, loc);
42912
43177
  } else {
@@ -42917,7 +43182,7 @@ Href: ${href}`
42917
43182
  detail: `End the stack with a web-safe font and a generic family.`,
42918
43183
  fix
42919
43184
  }, loc ? { loc, locs: [loc] } : {});
42920
- seen.set(key, issue);
43185
+ seen2.set(key, issue);
42921
43186
  issues.push(issue);
42922
43187
  }
42923
43188
  }
@@ -42933,12 +43198,12 @@ Href: ${href}`
42933
43198
  }
42934
43199
  function checkVisualFromDom($, source) {
42935
43200
  const issues = [];
42936
- const seen = /* @__PURE__ */ new Map();
43201
+ const seen2 = /* @__PURE__ */ new Map();
42937
43202
  $("[style]").each((_, el) => {
42938
43203
  const attrLoc = locOfAttr(el, "style");
42939
43204
  const style = parseInlineStyle($(el).attr("style") || "");
42940
43205
  const locs = attrLoc ? new Map([...style.keys()].map((prop) => [prop, attrLoc])) : void 0;
42941
- inspectDeclarations(style, issues, seen, locs);
43206
+ inspectDeclarations(style, issues, seen2, locs);
42942
43207
  });
42943
43208
  $("style").each((_, el) => {
42944
43209
  const cssText = $(el).text();
@@ -42959,7 +43224,7 @@ Href: ${href}`
42959
43224
  const loc = locInCssBlock(anchor, child.loc);
42960
43225
  if (loc) locs.set(child.property.toLowerCase(), loc);
42961
43226
  });
42962
- inspectDeclarations(ruleToMap(node), issues, seen, locs);
43227
+ inspectDeclarations(ruleToMap(node), issues, seen2, locs);
42963
43228
  }
42964
43229
  });
42965
43230
  });
@@ -43075,13 +43340,13 @@ Href: ${href}`
43075
43340
  return clusters;
43076
43341
  }
43077
43342
  function distinctValues(values, normalise2) {
43078
- const seen = /* @__PURE__ */ new Map();
43343
+ const seen2 = /* @__PURE__ */ new Map();
43079
43344
  for (const raw of values) {
43080
43345
  const key = normalise2(raw);
43081
43346
  if (!key) continue;
43082
- if (!seen.has(key)) seen.set(key, raw.trim());
43347
+ if (!seen2.has(key)) seen2.set(key, raw.trim());
43083
43348
  }
43084
- return [...seen.values()];
43349
+ return [...seen2.values()];
43085
43350
  }
43086
43351
  function checkDesignConsistencyFromDom($) {
43087
43352
  const found = collect($);
@@ -43191,10 +43456,10 @@ Href: ${href}`
43191
43456
  design: EMPTY_DESIGN
43192
43457
  };
43193
43458
  function dedupeByElement(issues) {
43194
- const seen = /* @__PURE__ */ new Set();
43459
+ const seen2 = /* @__PURE__ */ new Set();
43195
43460
  return issues.filter((issue) => {
43196
- if (seen.has(issue.element)) return false;
43197
- seen.add(issue.element);
43461
+ if (seen2.has(issue.element)) return false;
43462
+ seen2.add(issue.element);
43198
43463
  return true;
43199
43464
  });
43200
43465
  }
@@ -43441,7 +43706,7 @@ Href: ${href}`
43441
43706
  // package.json
43442
43707
  var package_default = {
43443
43708
  name: "@emailens/cli",
43444
- version: "0.13.17",
43709
+ version: "0.14.0",
43445
43710
  description: "CLI tool for email compatibility analysis: lint, preview and export HTML, MJML, Maizzle and React Email rendering across 21 email clients.",
43446
43711
  type: "module",
43447
43712
  bin: {
@@ -43473,16 +43738,21 @@ var package_default = {
43473
43738
  },
43474
43739
  dependencies: {},
43475
43740
  peerDependencies: {
43476
- "playwright-core": "^1.62.1"
43741
+ "playwright-core": "^1.62.1",
43742
+ sharp: ">=0.33.0"
43477
43743
  },
43478
43744
  peerDependenciesMeta: {
43479
43745
  "playwright-core": {
43480
43746
  optional: true
43747
+ },
43748
+ sharp: {
43749
+ optional: true
43481
43750
  }
43482
43751
  },
43483
43752
  devDependencies: {
43484
43753
  "@anthropic-ai/sdk": "^0.52.0",
43485
- "@emailens/engine": "^0.18.19",
43754
+ "@emailens/engine": "^0.19.0",
43755
+ "@react-email/components": "1.0.12",
43486
43756
  "@types/bun": "^1.4.0",
43487
43757
  "@types/mjml": "^4.7.4",
43488
43758
  "@types/node": "^25.9.5",
@@ -43492,6 +43762,9 @@ var package_default = {
43492
43762
  ora: "^8.2.0",
43493
43763
  picocolors: "^1.1.1",
43494
43764
  "playwright-core": "^1.62.1",
43765
+ react: "19.3.1",
43766
+ "react-dom": "19.3.1",
43767
+ "react-email": "6.11.8",
43495
43768
  tsup: "^8.5.1",
43496
43769
  typescript: "^5.9.3"
43497
43770
  },
@@ -46068,6 +46341,141 @@ var inbox_default = defineCommand({
46068
46341
  subCommands: { wait }
46069
46342
  });
46070
46343
 
46344
+ // src/commands/react-email.ts
46345
+ var import_picocolors6 = __toESM(require_picocolors(), 1);
46346
+ import { spawn } from "child_process";
46347
+ import { watch } from "fs";
46348
+ import { resolve as resolve2 } from "path";
46349
+ var react_email_default = defineCommand({
46350
+ meta: {
46351
+ name: "react-email",
46352
+ description: "Lint every React Email template in this project: no export step, PreviewProps applied. --watch re-checks on save"
46353
+ },
46354
+ args: {
46355
+ dir: { type: "positional", required: false, description: `Emails folder (default: the first of ${EMAIL_DIRS.join(", ")})` },
46356
+ watch: { type: "boolean", alias: "w", description: "Re-check whenever a template changes" },
46357
+ json: { type: "boolean", description: "Output as JSON" },
46358
+ info: { type: "boolean", description: "List info findings too" },
46359
+ failOnWarning: { type: "boolean", description: "Exit 2 if warnings found" },
46360
+ skip: { type: "string", description: "Comma-separated checks to skip, as for lint" },
46361
+ "email-type": { type: "string", description: "transactional: sign-in, receipts and alerts need no unsubscribe link" },
46362
+ gate: { type: "boolean", description: "Also run each email through the pre-send gate (Pro, needs EMAILENS_API_KEY)" },
46363
+ "api-key": { type: "string", description: "API key for --gate (default: EMAILENS_API_KEY)" },
46364
+ reporter: { type: "string", description: "github: annotate the pull request" },
46365
+ quiet: { type: "boolean", alias: "q", description: "No hosted-preview line after a failure" }
46366
+ },
46367
+ async run({ args, rawArgs }) {
46368
+ const dir = args.dir ? resolve2(args.dir) : findEmailsDir();
46369
+ if (!dir) {
46370
+ console.error(import_picocolors6.default.red(`No emails folder here. Looked for ${EMAIL_DIRS.join(", ")}; pass the folder: emailens react-email path/to/emails`));
46371
+ process.exit(1);
46372
+ }
46373
+ if (!args.watch) {
46374
+ await lint_default.run({ args: { ...args, input: dir, _: [] }, rawArgs, cmd: lint_default });
46375
+ return;
46376
+ }
46377
+ const passOn = rawArgs.filter((a) => a !== "--watch" && a !== "-w" && a !== args.dir);
46378
+ const check = () => {
46379
+ console.clear();
46380
+ spawn(process.execPath, [process.argv[1], "lint", dir, ...passOn], { stdio: "inherit" }).on(
46381
+ "exit",
46382
+ () => console.log(import_picocolors6.default.dim(`
46383
+ Watching ${dir} for changes. Ctrl+C to stop.`))
46384
+ );
46385
+ };
46386
+ let timer;
46387
+ watch(dir, { recursive: true }, () => {
46388
+ clearTimeout(timer);
46389
+ timer = setTimeout(check, 150);
46390
+ });
46391
+ check();
46392
+ }
46393
+ });
46394
+
46395
+ // src/commands/design.ts
46396
+ var import_picocolors7 = __toESM(require_picocolors(), 1);
46397
+ var MARK = { kept: import_picocolors7.default.green("\u2713"), changed: import_picocolors7.default.yellow("~"), broken: import_picocolors7.default.red("\u2717") };
46398
+ function designExitCode(results, strict = false) {
46399
+ const failing = results.some(
46400
+ (r) => r.verdict === "broken" || strict && r.verdict === "changed"
46401
+ );
46402
+ return failing ? 1 : 0;
46403
+ }
46404
+ var design_default = defineCommand({
46405
+ meta: {
46406
+ name: "design",
46407
+ description: "Check the email still looks like its design in each client's live preview (needs a browser)"
46408
+ },
46409
+ args: {
46410
+ input: {
46411
+ type: "positional",
46412
+ description: "HTML, JSX, MJML or Maizzle file path, or - for stdin",
46413
+ required: true
46414
+ },
46415
+ format: {
46416
+ type: "string",
46417
+ alias: "f",
46418
+ description: "Input format: html, jsx, mjml, maizzle"
46419
+ },
46420
+ clients: {
46421
+ type: "string",
46422
+ alias: "c",
46423
+ description: "Comma-separated client IDs (default: all)"
46424
+ },
46425
+ strict: {
46426
+ type: "boolean",
46427
+ description: "Fail on Needs work too, not only on Broken"
46428
+ },
46429
+ json: {
46430
+ type: "boolean",
46431
+ description: "Output as JSON"
46432
+ },
46433
+ quiet: {
46434
+ type: "boolean",
46435
+ alias: "q",
46436
+ description: "Suppress spinners and decorations"
46437
+ }
46438
+ },
46439
+ async run({ args }) {
46440
+ const spinner = args.quiet || args.json ? null : ora();
46441
+ try {
46442
+ if (args.format) resolveFormat(args.format);
46443
+ const source = await readInput(args.input);
46444
+ const format = resolveFormat(args.format, args.input, source);
46445
+ const html = await compile(source, format);
46446
+ const clientIds = resolveClients(args.clients);
46447
+ const { checkDesignAcross } = await import("./design-3W7LDIBV.js");
46448
+ spinner?.start(process.env.BROWSERLESS_URL ? "Connecting to Browserless..." : "Starting Chromium...");
46449
+ const results = await checkDesignAcross(html, clientIds, {
46450
+ framework: toFramework(format),
46451
+ onProgress: (done, total) => {
46452
+ if (spinner) spinner.text = `Checking the design (${done}/${total})...`;
46453
+ }
46454
+ });
46455
+ spinner?.stop();
46456
+ if (!results.length && !args.json) {
46457
+ console.log("No design to compare: the input is not a rendered email.");
46458
+ } else if (args.json) {
46459
+ console.log(JSON.stringify({ design: results }, null, 2));
46460
+ } else {
46461
+ for (const r of results) {
46462
+ console.log(`${MARK[r.verdict]} ${import_picocolors7.default.bold(r.name.padEnd(26))} ${r.label}`);
46463
+ if (r.verdict === "kept") continue;
46464
+ console.log(import_picocolors7.default.dim(` ${r.sentence}`));
46465
+ for (const reason of r.reasons) console.log(` - ${reason}`);
46466
+ if (r.more) console.log(import_picocolors7.default.dim(` and ${r.more} more`));
46467
+ }
46468
+ }
46469
+ const code = designExitCode(results, args.strict);
46470
+ if (code) process.exit(code);
46471
+ } catch (err) {
46472
+ spinner?.fail("Design check failed");
46473
+ console.error(err.message);
46474
+ process.exit(1);
46475
+ }
46476
+ }
46477
+ });
46478
+
46071
46479
  // src/index.ts
46072
46480
  var main2 = defineCommand({
46073
46481
  meta,
@@ -46079,7 +46487,9 @@ var main2 = defineCommand({
46079
46487
  fix: fix_default,
46080
46488
  audit: audit_default,
46081
46489
  lint: lint_default,
46082
- inbox: inbox_default
46490
+ inbox: inbox_default,
46491
+ "react-email": react_email_default,
46492
+ design: design_default
46083
46493
  }
46084
46494
  });
46085
46495
  runMain(main2);