@artinstack/migrator 0.1.9 → 0.1.12

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 (34) hide show
  1. package/dist/{bundle-B3XS20r_.d.ts → bundle-CysqqLij.d.ts} +1 -1
  2. package/dist/chunk-J7EUSPEA.js +667 -0
  3. package/dist/chunk-J7EUSPEA.js.map +1 -0
  4. package/dist/{chunk-3YJFSTYR.js → chunk-MUFGDYGI.js} +2 -1
  5. package/dist/chunk-MUFGDYGI.js.map +1 -0
  6. package/dist/{chunk-KTQGOM45.js → chunk-PFUXPS7A.js} +1 -1
  7. package/dist/chunk-PFUXPS7A.js.map +1 -0
  8. package/dist/{chunk-FB3MMCHY.js → chunk-Q44KGFIH.js} +97 -531
  9. package/dist/chunk-Q44KGFIH.js.map +1 -0
  10. package/dist/chunk-QFJXNEXG.js +355 -0
  11. package/dist/chunk-QFJXNEXG.js.map +1 -0
  12. package/dist/{chunk-PPT5RIZ4.js → chunk-VRRYN6NS.js} +40 -236
  13. package/dist/chunk-VRRYN6NS.js.map +1 -0
  14. package/dist/{chunk-S4SUJT2D.js → chunk-WCAHVNWW.js} +98 -3
  15. package/dist/chunk-WCAHVNWW.js.map +1 -0
  16. package/dist/cli/index.js +12 -6
  17. package/dist/cli/index.js.map +1 -1
  18. package/dist/index.d.ts +4 -4
  19. package/dist/index.js +9 -6
  20. package/dist/normalizer/index.d.ts +10 -4
  21. package/dist/normalizer/index.js +2 -2
  22. package/dist/sinks/index.d.ts +13 -3
  23. package/dist/sinks/index.js +5 -3
  24. package/dist/transformers/index.d.ts +1 -1
  25. package/dist/transformers/index.js +3 -2
  26. package/dist/{types-Ce4r6zqt.d.ts → types-CLNmloya.d.ts} +15 -1
  27. package/package.json +1 -1
  28. package/dist/chunk-3YJFSTYR.js.map +0 -1
  29. package/dist/chunk-BONZ3U3I.js +0 -124
  30. package/dist/chunk-BONZ3U3I.js.map +0 -1
  31. package/dist/chunk-FB3MMCHY.js.map +0 -1
  32. package/dist/chunk-KTQGOM45.js.map +0 -1
  33. package/dist/chunk-PPT5RIZ4.js.map +0 -1
  34. package/dist/chunk-S4SUJT2D.js.map +0 -1
@@ -0,0 +1,355 @@
1
+ import {
2
+ createMigrationMediaRefReplaceWith,
3
+ isMigrationMediaRef,
4
+ normalizeAssetUrl,
5
+ resolveMigrationMediaSourceId
6
+ } from "./chunk-S4GMDRGX.js";
7
+
8
+ // src/transformers/rewrite-inline-images.ts
9
+ import * as cheerio from "cheerio";
10
+ var BACKGROUND_IMAGE_URL_PATTERN = /background(?:-image)?\s*:[^;]*?url\s*\(\s*(['"]?)([^'")]+)\1\s*\)/gi;
11
+ function resolveRewriteOptions(options) {
12
+ const replaceWith = options.replaceWith ?? createMigrationMediaRefReplaceWith();
13
+ const requireUploaded = options.requireUploaded ?? Boolean(options.replaceWith);
14
+ return { replaceWith, requireUploaded };
15
+ }
16
+ function tryRewriteUrl(src, options, uploadedBySourceId, referencedSources, unresolved) {
17
+ const normalized = normalizeAssetUrl(src);
18
+ if (!normalized) return void 0;
19
+ if (isMigrationMediaRef(normalized)) {
20
+ referencedSources.add(normalized);
21
+ return normalized;
22
+ }
23
+ referencedSources.add(normalized);
24
+ const ref = options.resolveAsset(normalized);
25
+ if (!ref?.sourceAssetId) {
26
+ unresolved.add(normalized);
27
+ return void 0;
28
+ }
29
+ const { replaceWith, requireUploaded } = resolveRewriteOptions(options);
30
+ const uploaded = uploadedBySourceId.get(ref.sourceAssetId);
31
+ if (requireUploaded && !uploaded) {
32
+ unresolved.add(normalized);
33
+ return void 0;
34
+ }
35
+ return replaceWith(ref, uploaded);
36
+ }
37
+ function rewriteBackgroundUrlsInStyle(style, options, uploadedBySourceId, referencedSources, unresolved) {
38
+ return style.replace(BACKGROUND_IMAGE_URL_PATTERN, (full, quote, rawUrl) => {
39
+ const replaced = tryRewriteUrl(rawUrl.trim(), options, uploadedBySourceId, referencedSources, unresolved);
40
+ if (!replaced) return full;
41
+ const urlCall = quote ? `url(${quote}${replaced}${quote})` : `url(${replaced})`;
42
+ return full.replace(/url\s*\(\s*(['"]?)([^'")]+)\1\s*\)/i, urlCall);
43
+ });
44
+ }
45
+ function rewriteSrcset(srcset, options, uploadedBySourceId, referencedSources, unresolved) {
46
+ return srcset.split(",").map((entry) => {
47
+ const trimmed = entry.trim();
48
+ if (!trimmed) return entry;
49
+ const [urlPart, descriptor] = trimmed.split(/\s+/, 2);
50
+ const replaced = tryRewriteUrl(urlPart ?? "", options, uploadedBySourceId, referencedSources, unresolved);
51
+ if (!replaced) return entry;
52
+ return descriptor ? `${replaced} ${descriptor}` : replaced;
53
+ }).join(", ");
54
+ }
55
+ function rewriteInlineImages(html, options, uploadedBySourceId) {
56
+ if (!html.trim()) {
57
+ return { html, referencedSources: [], unresolved: [] };
58
+ }
59
+ const $ = cheerio.load(html, { xml: false });
60
+ const referencedSources = /* @__PURE__ */ new Set();
61
+ const unresolved = /* @__PURE__ */ new Set();
62
+ $("img").each((_, element) => {
63
+ const img = $(element);
64
+ const src = img.attr("src")?.trim();
65
+ if (src && !src.startsWith("data:")) {
66
+ const replaced = tryRewriteUrl(src, options, uploadedBySourceId, referencedSources, unresolved);
67
+ if (replaced) img.attr("src", replaced);
68
+ }
69
+ const srcset = img.attr("srcset")?.trim();
70
+ if (srcset) {
71
+ img.attr("srcset", rewriteSrcset(srcset, options, uploadedBySourceId, referencedSources, unresolved));
72
+ }
73
+ });
74
+ $("[data-bg-image]").each((_, element) => {
75
+ const node = $(element);
76
+ const bgImage = node.attr("data-bg-image")?.trim();
77
+ if (!bgImage || bgImage.startsWith("data:")) return;
78
+ const replaced = tryRewriteUrl(bgImage, options, uploadedBySourceId, referencedSources, unresolved);
79
+ if (replaced) node.attr("data-bg-image", replaced);
80
+ });
81
+ $("[style]").each((_, element) => {
82
+ const node = $(element);
83
+ const style = node.attr("style");
84
+ if (!style?.includes("background")) return;
85
+ const rewritten = rewriteBackgroundUrlsInStyle(
86
+ style,
87
+ options,
88
+ uploadedBySourceId,
89
+ referencedSources,
90
+ unresolved
91
+ );
92
+ if (rewritten !== style) node.attr("style", rewritten);
93
+ });
94
+ return {
95
+ html: $.root().html() ?? html,
96
+ referencedSources: [...referencedSources],
97
+ unresolved: [...unresolved]
98
+ };
99
+ }
100
+ function stampMigrationMediaRefs(html, options) {
101
+ return rewriteInlineImages(
102
+ html,
103
+ {
104
+ resolveAsset: (src) => {
105
+ const sourceAssetId = resolveMigrationMediaSourceId(
106
+ src,
107
+ options.urlToSourceId,
108
+ options.originUrlRewrite
109
+ );
110
+ if (!sourceAssetId) return void 0;
111
+ return { originalSrc: src, sourceAssetId };
112
+ },
113
+ replaceWith: options.replaceWith,
114
+ requireUploaded: options.requireUploaded ?? false
115
+ },
116
+ /* @__PURE__ */ new Map()
117
+ );
118
+ }
119
+
120
+ // src/parsers/wordpress/builders/registry.ts
121
+ function layoutEscapeRegExp(value) {
122
+ return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
123
+ }
124
+ function shortcodeOpenRegex(token) {
125
+ return new RegExp(`\\[${layoutEscapeRegExp(token)}\\b([^\\]]*)\\]`, "gi");
126
+ }
127
+ function shortcodeCloseRegex(token) {
128
+ return new RegExp(`\\[\\/${layoutEscapeRegExp(token)}\\b[^\\]]*\\]`, "gi");
129
+ }
130
+ var FRACTIONAL_COLUMN_WIDTHS = {
131
+ one_col: "100%",
132
+ one_half: "50%",
133
+ one_third: "33.33%",
134
+ two_third: "66.67%",
135
+ two_thirds: "66.67%",
136
+ one_fourth: "25%",
137
+ three_fourth: "75%",
138
+ three_fourths: "75%"
139
+ };
140
+ function parseFractionalColumnWidth(token) {
141
+ return FRACTIONAL_COLUMN_WIDTHS[token];
142
+ }
143
+ function prefixedLayoutMap(config) {
144
+ return {
145
+ kind: "prefixed",
146
+ sectionRegex: shortcodeOpenRegex(config.section),
147
+ sectionCloseRegex: shortcodeCloseRegex(config.section),
148
+ rowRegex: shortcodeOpenRegex(config.row),
149
+ rowCloseRegex: shortcodeCloseRegex(config.row),
150
+ columnRegex: shortcodeOpenRegex(config.column),
151
+ columnCloseRegex: shortcodeCloseRegex(config.column),
152
+ bgParamName: config.bgParamName,
153
+ colsParamName: config.colsParamName
154
+ };
155
+ }
156
+ function extendedPrefixedLayoutMap(levels) {
157
+ return { kind: "extended-prefixed", levels };
158
+ }
159
+ function fractionalLayoutMap(config) {
160
+ const columnWidths = {};
161
+ for (const token of config.columns) {
162
+ const width = parseFractionalColumnWidth(token);
163
+ if (width) columnWidths[token] = width;
164
+ }
165
+ return {
166
+ kind: "fractional",
167
+ sectionRegex: shortcodeOpenRegex(config.section),
168
+ sectionCloseRegex: shortcodeCloseRegex(config.section),
169
+ rowRegex: shortcodeOpenRegex(config.row),
170
+ rowCloseRegex: shortcodeCloseRegex(config.row),
171
+ columnTokens: config.columns,
172
+ columnOpenRegexes: config.columns.map(shortcodeOpenRegex),
173
+ columnCloseRegexes: config.columns.map(shortcodeCloseRegex),
174
+ columnWidths,
175
+ bgParamName: config.bgParamName
176
+ };
177
+ }
178
+ var WP_WIDGET_PLACEHOLDER = "\u200B";
179
+ var WORDPRESS_WIDGET_REGISTRY = {
180
+ mapShortcodePrefixes: [
181
+ "blox_gmap",
182
+ "tatsu_gmap",
183
+ "tatsu_map",
184
+ "et_pb_map",
185
+ "vc_gmaps",
186
+ "vc_map"
187
+ ],
188
+ contactFormRules: [
189
+ { tag: "contact-form-7", source: "contact-form-7", idParam: "id" },
190
+ { tag: "contact_form", source: "contact-form-7", idParam: "id" },
191
+ { tag: "gravityform", source: "gravityforms", idParam: "id" },
192
+ { tag: "ninja_form", source: "ninja-forms", idParam: "id" },
193
+ { tag: "wpforms", source: "wpforms", idParam: "id" }
194
+ ],
195
+ videoShortcodePrefixes: [
196
+ "youtube",
197
+ "vimeo",
198
+ "embed",
199
+ "tatsu_video",
200
+ "et_pb_video",
201
+ "vc_video"
202
+ ],
203
+ portfolioShortcode: "portfolio",
204
+ blogShortcodeTags: ["blog", "recent_posts"],
205
+ galleryShortcode: "gallery",
206
+ idGalleryShortcodes: ["oshine_gallery", "vc_gallery", "nggallery"]
207
+ };
208
+ var UNRESOLVABLE_SHORTCODE_PREFIXES = [
209
+ "woocommerce_cart",
210
+ "woocommerce_checkout",
211
+ "woocommerce_my_account"
212
+ ];
213
+ var WORDPRESS_BUILDER_REGISTRY = [
214
+ {
215
+ id: "tatsu",
216
+ detect: /\[(?:\/)?tatsu_/i,
217
+ layoutMap: prefixedLayoutMap({
218
+ section: "tatsu_section",
219
+ row: "tatsu_row",
220
+ column: "tatsu_column",
221
+ bgParamName: "bg_image",
222
+ colsParamName: "layout"
223
+ }),
224
+ wrapperRules: [
225
+ { shortcodePrefix: "tatsu_text" },
226
+ { shortcodePrefix: "tatsu_inline_text" },
227
+ { shortcodePrefix: "tatsu_text_with_shortcodes" },
228
+ { shortcodePrefix: "tatsu_icon_group" }
229
+ ],
230
+ urlRules: [
231
+ { shortcodePrefix: "tatsu_image", urlParams: ["image", "url", "src"], tag: "img" },
232
+ { shortcodePrefix: "tatsu_single_image", urlParams: ["image", "url", "src"], tag: "img" }
233
+ ],
234
+ iconImageRules: [
235
+ { shortcodePrefix: "tatsu_icon", imageParam: "icon_image", hrefParam: "href" }
236
+ ],
237
+ scaffoldingPrefixes: ["tatsu_"]
238
+ },
239
+ {
240
+ id: "divi",
241
+ detect: /\[(?:\/)?et_pb_/i,
242
+ layoutMap: prefixedLayoutMap({
243
+ section: "et_pb_section",
244
+ row: "et_pb_row",
245
+ column: "et_pb_column",
246
+ bgParamName: "background_image"
247
+ }),
248
+ urlRules: [{ shortcodePrefix: "et_pb_image", urlParams: ["src", "url"], tag: "img" }],
249
+ scaffoldingPrefixes: ["et_pb_"]
250
+ },
251
+ {
252
+ id: "wpbakery",
253
+ detect: /\[(?:\/)?vc_/i,
254
+ layoutMap: extendedPrefixedLayoutMap([
255
+ { role: "section", tokens: ["vc_section"], bgParamName: "bg_image" },
256
+ { role: "row", tokens: ["vc_row"], colsParamName: "layout" },
257
+ { role: "column", tokens: ["vc_column_inner", "vc_column"], widthParamName: "width" }
258
+ ]),
259
+ urlRules: [
260
+ { shortcodePrefix: "vc_single_image", urlParams: ["image", "src", "url"], tag: "img" }
261
+ ],
262
+ scaffoldingPrefixes: ["vc_"]
263
+ },
264
+ {
265
+ id: "fusion",
266
+ detect: /\[(?:\/)?fusion_/i,
267
+ layoutMap: prefixedLayoutMap({
268
+ section: "fusion_builder_container",
269
+ row: "fusion_builder_row",
270
+ column: "fusion_builder_column",
271
+ bgParamName: "background_image"
272
+ }),
273
+ scaffoldingPrefixes: ["fusion_"]
274
+ },
275
+ {
276
+ id: "beaver",
277
+ detect: /\[(?:\/)?fl_(?:row|col|builder)/i,
278
+ layoutMap: extendedPrefixedLayoutMap([
279
+ { role: "row", tokens: ["fl_row"] },
280
+ { role: "column", tokens: ["fl_col"] }
281
+ ]),
282
+ scaffoldingPrefixes: ["fl_"]
283
+ },
284
+ {
285
+ id: "elementor",
286
+ detect: /\[(?:\/)?elementor[-_]/i,
287
+ urlRules: [
288
+ { shortcodePrefix: "elementor-widget", urlParams: ["url", "src", "image"], tag: "img" }
289
+ ],
290
+ scaffoldingPrefixes: ["elementor_"]
291
+ },
292
+ {
293
+ id: "oshine",
294
+ detect: /\[(?:special_sub_title|special_heading5|blox_\w+|grid_content|grids|testimonial\b|portfolio\b|recent_posts\b|animate_icon\w*|section\b|row\b|one_col|one_third|one_half|one_fourth|two_third|three_fourth|text\b)/i,
295
+ layoutMap: fractionalLayoutMap({
296
+ section: "section",
297
+ row: "row",
298
+ columns: [
299
+ "one_col",
300
+ "one_third",
301
+ "two_third",
302
+ "two_thirds",
303
+ "one_half",
304
+ "one_fourth",
305
+ "three_fourth",
306
+ "three_fourths"
307
+ ],
308
+ bgParamName: "bg_image"
309
+ }),
310
+ layoutMaps: [
311
+ extendedPrefixedLayoutMap([
312
+ { role: "section", tokens: ["blox_row"], bgParamName: "bg_image" },
313
+ { role: "row", tokens: ["blox_row_inner"], colsParamName: "columns" },
314
+ {
315
+ role: "column",
316
+ tokens: ["blox_column_inner", "blox_column"],
317
+ widthParamName: "width"
318
+ }
319
+ ])
320
+ ],
321
+ textRules: [
322
+ {
323
+ shortcodePrefix: "special_sub_title",
324
+ fields: [{ param: "title_content", tag: "p" }]
325
+ },
326
+ {
327
+ shortcodePrefix: "special_heading5",
328
+ fields: [
329
+ { param: "title_content", tag: "h2" },
330
+ { param: "caption_content", tag: "h4" }
331
+ ]
332
+ }
333
+ ],
334
+ wrapperRules: [
335
+ { shortcodePrefix: "grid_content" },
336
+ { shortcodePrefix: "testimonial", urlParams: ["author_image"] },
337
+ { shortcodePrefix: "blox_text" }
338
+ ],
339
+ urlRules: [
340
+ { shortcodePrefix: "blox_image", urlParams: ["image", "img", "src", "url"], tag: "img" }
341
+ ],
342
+ scaffoldingPrefixes: ["blox_", "animate_icon"],
343
+ legacyScaffoldingTokens: ["text", "icon", "linebreak", "grids", "testimonials"]
344
+ }
345
+ ];
346
+
347
+ export {
348
+ rewriteInlineImages,
349
+ stampMigrationMediaRefs,
350
+ WP_WIDGET_PLACEHOLDER,
351
+ WORDPRESS_WIDGET_REGISTRY,
352
+ UNRESOLVABLE_SHORTCODE_PREFIXES,
353
+ WORDPRESS_BUILDER_REGISTRY
354
+ };
355
+ //# sourceMappingURL=chunk-QFJXNEXG.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/transformers/rewrite-inline-images.ts","../src/parsers/wordpress/builders/registry.ts"],"sourcesContent":["import * as cheerio from \"cheerio\";\n\nimport {\n buildMigrationMediaUrlIndex,\n createMigrationMediaRefReplaceWith,\n isMigrationMediaRef,\n normalizeAssetUrl,\n resolveMigrationMediaSourceId,\n type OriginUrlRewriteConfig,\n} from \"../lib/media-urls.js\";\n\nexport interface RewriteInlineImageRef {\n originalSrc: string;\n sourceAssetId?: string;\n}\n\nexport interface UploadedAssetRef {\n targetId: string;\n publicUrl?: string;\n}\n\nexport interface RewriteInlineImagesOptions {\n resolveAsset: (src: string) => RewriteInlineImageRef | undefined;\n /**\n * Replace a resolved source id with a migration ref or CDN URL.\n * When omitted, defaults to OSS-14 `artinstack-migration://asset/…` refs.\n */\n replaceWith?: (ref: RewriteInlineImageRef, uploaded?: UploadedAssetRef) => string;\n /**\n * When true, skip URLs that cannot be matched to an uploaded vault target.\n * Default: false when using migration refs; true when a custom `replaceWith` is supplied.\n */\n requireUploaded?: boolean;\n}\n\nexport interface RewriteInlineImagesResult {\n html: string;\n referencedSources: string[];\n unresolved: string[];\n}\n\n/** Inline CSS `background` / `background-image: url(…)` (quoted or bare). */\nconst BACKGROUND_IMAGE_URL_PATTERN =\n /background(?:-image)?\\s*:[^;]*?url\\s*\\(\\s*(['\"]?)([^'\")]+)\\1\\s*\\)/gi;\n\nfunction resolveRewriteOptions(\n options: RewriteInlineImagesOptions,\n): Required<Pick<RewriteInlineImagesOptions, \"replaceWith\" | \"requireUploaded\">> {\n const replaceWith = options.replaceWith ?? createMigrationMediaRefReplaceWith();\n const requireUploaded = options.requireUploaded ?? Boolean(options.replaceWith);\n return { replaceWith, requireUploaded };\n}\n\nfunction tryRewriteUrl(\n src: string,\n options: RewriteInlineImagesOptions,\n uploadedBySourceId: Map<string, UploadedAssetRef>,\n referencedSources: Set<string>,\n unresolved: Set<string>,\n): string | undefined {\n const normalized = normalizeAssetUrl(src);\n if (!normalized) return undefined;\n\n if (isMigrationMediaRef(normalized)) {\n referencedSources.add(normalized);\n return normalized;\n }\n\n referencedSources.add(normalized);\n const ref = options.resolveAsset(normalized);\n if (!ref?.sourceAssetId) {\n unresolved.add(normalized);\n return undefined;\n }\n\n const { replaceWith, requireUploaded } = resolveRewriteOptions(options);\n const uploaded = uploadedBySourceId.get(ref.sourceAssetId);\n if (requireUploaded && !uploaded) {\n unresolved.add(normalized);\n return undefined;\n }\n\n return replaceWith(ref, uploaded);\n}\n\nfunction rewriteBackgroundUrlsInStyle(\n style: string,\n options: RewriteInlineImagesOptions,\n uploadedBySourceId: Map<string, UploadedAssetRef>,\n referencedSources: Set<string>,\n unresolved: Set<string>,\n): string {\n return style.replace(BACKGROUND_IMAGE_URL_PATTERN, (full, quote: string, rawUrl: string) => {\n const replaced = tryRewriteUrl(rawUrl.trim(), options, uploadedBySourceId, referencedSources, unresolved);\n if (!replaced) return full;\n\n const urlCall = quote\n ? `url(${quote}${replaced}${quote})`\n : `url(${replaced})`;\n return full.replace(/url\\s*\\(\\s*(['\"]?)([^'\")]+)\\1\\s*\\)/i, urlCall);\n });\n}\n\nfunction rewriteSrcset(\n srcset: string,\n options: RewriteInlineImagesOptions,\n uploadedBySourceId: Map<string, UploadedAssetRef>,\n referencedSources: Set<string>,\n unresolved: Set<string>,\n): string {\n return srcset\n .split(\",\")\n .map((entry) => {\n const trimmed = entry.trim();\n if (!trimmed) return entry;\n const [urlPart, descriptor] = trimmed.split(/\\s+/, 2);\n const replaced = tryRewriteUrl(urlPart ?? \"\", options, uploadedBySourceId, referencedSources, unresolved);\n if (!replaced) return entry;\n return descriptor ? `${replaced} ${descriptor}` : replaced;\n })\n .join(\", \");\n}\n\n/** Rewrite `<img src>` / `srcset`, `data-bg-image`, and inline CSS backgrounds using uploaded asset targets. */\nexport function rewriteInlineImages(\n html: string,\n options: RewriteInlineImagesOptions,\n uploadedBySourceId: Map<string, UploadedAssetRef>,\n): RewriteInlineImagesResult {\n if (!html.trim()) {\n return { html, referencedSources: [], unresolved: [] };\n }\n\n const $ = cheerio.load(html, { xml: false });\n const referencedSources = new Set<string>();\n const unresolved = new Set<string>();\n\n $(\"img\").each((_, element) => {\n const img = $(element);\n const src = img.attr(\"src\")?.trim();\n if (src && !src.startsWith(\"data:\")) {\n const replaced = tryRewriteUrl(src, options, uploadedBySourceId, referencedSources, unresolved);\n if (replaced) img.attr(\"src\", replaced);\n }\n\n const srcset = img.attr(\"srcset\")?.trim();\n if (srcset) {\n img.attr(\"srcset\", rewriteSrcset(srcset, options, uploadedBySourceId, referencedSources, unresolved));\n }\n });\n\n $(\"[data-bg-image]\").each((_, element) => {\n const node = $(element);\n const bgImage = node.attr(\"data-bg-image\")?.trim();\n if (!bgImage || bgImage.startsWith(\"data:\")) return;\n const replaced = tryRewriteUrl(bgImage, options, uploadedBySourceId, referencedSources, unresolved);\n if (replaced) node.attr(\"data-bg-image\", replaced);\n });\n\n $(\"[style]\").each((_, element) => {\n const node = $(element);\n const style = node.attr(\"style\");\n if (!style?.includes(\"background\")) return;\n const rewritten = rewriteBackgroundUrlsInStyle(\n style,\n options,\n uploadedBySourceId,\n referencedSources,\n unresolved,\n );\n if (rewritten !== style) node.attr(\"style\", rewritten);\n });\n\n return {\n html: $.root().html() ?? html,\n referencedSources: [...referencedSources],\n unresolved: [...unresolved],\n };\n}\n\nexport interface StampMigrationMediaRefsOptions {\n /** Pre-built url/pathname → sourceId map (from attachments + inline assets). */\n urlToSourceId: Map<string, string>;\n /** Canonicalize lookup keys during stamp (OSS-15). */\n originUrlRewrite?: OriginUrlRewriteConfig;\n replaceWith?: RewriteInlineImagesOptions[\"replaceWith\"];\n requireUploaded?: boolean;\n}\n\n/**\n * OSS-14 — replace resolved `wp-content/uploads` URLs with `artinstack-migration://asset/…`\n * refs. Does not invent refs for unknown URLs (left unchanged + listed in `unresolved`).\n */\nexport function stampMigrationMediaRefs(\n html: string,\n options: StampMigrationMediaRefsOptions,\n): RewriteInlineImagesResult {\n return rewriteInlineImages(\n html,\n {\n resolveAsset: (src) => {\n const sourceAssetId = resolveMigrationMediaSourceId(\n src,\n options.urlToSourceId,\n options.originUrlRewrite,\n );\n if (!sourceAssetId) return undefined;\n return { originalSrc: src, sourceAssetId };\n },\n replaceWith: options.replaceWith,\n requireUploaded: options.requireUploaded ?? false,\n },\n new Map(),\n );\n}\n\n/** Build a url index from attachment rows and/or normalized assets. */\nexport { buildMigrationMediaUrlIndex };\n","export type BuilderHtmlTag = \"img\" | \"video\" | \"iframe\";\nexport type TextHtmlTag = \"p\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\";\n\n/** Bucket 1 — shortcodes with asset URL params → standard HTML. */\nexport interface BuilderUrlRule {\n shortcodePrefix: string;\n urlParams: string[];\n tag: BuilderHtmlTag;\n}\n\n/** Bucket 1 — shortcodes with text params → semantic HTML. */\nexport interface BuilderTextRule {\n shortcodePrefix: string;\n fields: { param: string; tag: TextHtmlTag }[];\n}\n\n/** Bucket 1 — shortcodes with inner HTML (+ optional image param). */\nexport interface BuilderWrapperRule {\n shortcodePrefix: string;\n urlParams?: string[];\n}\n\n/** Bucket 1 — image-based icon modules (`icon_image` param) → linked `<img>`. */\nexport interface BuilderIconImageRule {\n shortcodePrefix: string;\n imageParam: string;\n hrefParam?: string;\n}\n\n/** Bucket 1 — dynamic embeds replaced with a static migration placeholder. */\nexport interface BuilderPlaceholderRule {\n shortcodePrefix: string;\n html: string;\n}\n\n/** Profile A — prefixed namespace tokens (Tatsu, Divi, WPBakery, …). */\nexport interface PrefixedLayoutMap {\n kind: \"prefixed\";\n sectionRegex: RegExp;\n sectionCloseRegex: RegExp;\n rowRegex: RegExp;\n rowCloseRegex: RegExp;\n columnRegex: RegExp;\n columnCloseRegex: RegExp;\n bgParamName?: string;\n colsParamName?: string;\n}\n\n/** Profile B — legacy Blox fractional column tokens (`one_third`, `one_half`, …). */\nexport interface FractionalLayoutMap {\n kind: \"fractional\";\n sectionRegex: RegExp;\n sectionCloseRegex: RegExp;\n rowRegex: RegExp;\n rowCloseRegex: RegExp;\n columnTokens: string[];\n columnOpenRegexes: RegExp[];\n columnCloseRegexes: RegExp[];\n columnWidths: Record<string, string>;\n bgParamName?: string;\n}\n\n/** Profile C — multiple tokens per layout role (Blox prefixed, WPBakery inner columns, …). */\nexport interface ExtendedPrefixedLayoutLevel {\n role: \"section\" | \"row\" | \"column\";\n tokens: string[];\n bgParamName?: string;\n colsParamName?: string;\n widthParamName?: string;\n}\n\nexport interface ExtendedPrefixedLayoutMap {\n kind: \"extended-prefixed\";\n levels: ExtendedPrefixedLayoutLevel[];\n}\n\nexport type StructuralLayoutMap =\n | PrefixedLayoutMap\n | FractionalLayoutMap\n | ExtendedPrefixedLayoutMap;\n\nfunction layoutEscapeRegExp(value: string): string {\n return value.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n}\n\nfunction shortcodeOpenRegex(token: string): RegExp {\n return new RegExp(`\\\\[${layoutEscapeRegExp(token)}\\\\b([^\\\\]]*)\\\\]`, \"gi\");\n}\n\nfunction shortcodeCloseRegex(token: string): RegExp {\n return new RegExp(`\\\\[\\\\/${layoutEscapeRegExp(token)}\\\\b[^\\\\]]*\\\\]`, \"gi\");\n}\n\nconst FRACTIONAL_COLUMN_WIDTHS: Record<string, string> = {\n one_col: \"100%\",\n one_half: \"50%\",\n one_third: \"33.33%\",\n two_third: \"66.67%\",\n two_thirds: \"66.67%\",\n one_fourth: \"25%\",\n three_fourth: \"75%\",\n three_fourths: \"75%\",\n};\n\nexport function parseFractionalColumnWidth(token: string): string | undefined {\n return FRACTIONAL_COLUMN_WIDTHS[token];\n}\n\n/** Profile A — section/row/column share a static namespace prefix. */\nexport function prefixedLayoutMap(config: {\n section: string;\n row: string;\n column: string;\n bgParamName?: string;\n colsParamName?: string;\n}): PrefixedLayoutMap {\n return {\n kind: \"prefixed\",\n sectionRegex: shortcodeOpenRegex(config.section),\n sectionCloseRegex: shortcodeCloseRegex(config.section),\n rowRegex: shortcodeOpenRegex(config.row),\n rowCloseRegex: shortcodeCloseRegex(config.row),\n columnRegex: shortcodeOpenRegex(config.column),\n columnCloseRegex: shortcodeCloseRegex(config.column),\n bgParamName: config.bgParamName,\n colsParamName: config.colsParamName,\n };\n}\n\n/** Profile B — legacy Blox/Oshine mathematical column shortcodes. */\n/** Profile C — map several shortcode names per section/row/column role (longest token first). */\nexport function extendedPrefixedLayoutMap(\n levels: ExtendedPrefixedLayoutLevel[],\n): ExtendedPrefixedLayoutMap {\n return { kind: \"extended-prefixed\", levels };\n}\n\nexport function fractionalLayoutMap(config: {\n section: string;\n row: string;\n columns: string[];\n bgParamName?: string;\n}): FractionalLayoutMap {\n const columnWidths: Record<string, string> = {};\n for (const token of config.columns) {\n const width = parseFractionalColumnWidth(token);\n if (width) columnWidths[token] = width;\n }\n\n return {\n kind: \"fractional\",\n sectionRegex: shortcodeOpenRegex(config.section),\n sectionCloseRegex: shortcodeCloseRegex(config.section),\n rowRegex: shortcodeOpenRegex(config.row),\n rowCloseRegex: shortcodeCloseRegex(config.row),\n columnTokens: config.columns,\n columnOpenRegexes: config.columns.map(shortcodeOpenRegex),\n columnCloseRegexes: config.columns.map(shortcodeCloseRegex),\n columnWidths,\n bgParamName: config.bgParamName,\n };\n}\n\n/** Per builder-family registry entry — declarative map executed by the flatten engine. */\nexport interface BuilderThemeConfig {\n id: string;\n detect: RegExp;\n layoutMap?: StructuralLayoutMap;\n /** Additional layout maps applied after `layoutMap` (e.g. Blox prefixed + legacy fractional). */\n layoutMaps?: StructuralLayoutMap[];\n urlRules?: BuilderUrlRule[];\n textRules?: BuilderTextRule[];\n wrapperRules?: BuilderWrapperRule[];\n iconImageRules?: BuilderIconImageRule[];\n placeholderRules?: BuilderPlaceholderRule[];\n scaffoldingPrefixes?: string[];\n legacyScaffoldingTokens?: string[];\n}\n\n/** @deprecated Alias — families not themes. */\nexport type BuilderFamilyConfig = BuilderThemeConfig;\n\n// ---------------------------------------------------------------------------\n// Widget registry (OSS-12 / OSS-16) — cross-builder; not BuilderThemeConfig\n// ---------------------------------------------------------------------------\n\n/** Keeps empty widget stubs from collapsing during cheerio text sweeps. */\nexport const WP_WIDGET_PLACEHOLDER = \"\\u200B\";\n\nexport interface WordPressContactFormWidgetRule {\n /** Shortcode tag name (e.g. `contact-form-7`). */\n tag: string;\n /** Value for `data-wp-form-source`. */\n source: string;\n /** Attribute holding the form id (e.g. `id`). */\n idParam: string;\n}\n\n/** Declarative widget tables consumed by `flattenWordPressWidgets()` in flatten.ts. */\nexport interface WordPressWidgetRegistry {\n mapShortcodePrefixes: readonly string[];\n contactFormRules: readonly WordPressContactFormWidgetRule[];\n videoShortcodePrefixes: readonly string[];\n /** Core / plugin portfolio dynamic shortcode tag. */\n portfolioShortcode: string;\n /** Builder blog roll modules (Tatsu/Oshine `[blog]`, etc.). */\n blogShortcodeTags: readonly string[];\n /** WordPress core gallery shortcode tag (`ids=` split handled in engine). */\n galleryShortcode: string;\n /** Builder/plugin gallery shortcodes with explicit `ids=` attachment lists (OSS-12). */\n idGalleryShortcodes: readonly string[];\n}\n\nexport const WORDPRESS_WIDGET_REGISTRY: WordPressWidgetRegistry = {\n mapShortcodePrefixes: [\n \"blox_gmap\",\n \"tatsu_gmap\",\n \"tatsu_map\",\n \"et_pb_map\",\n \"vc_gmaps\",\n \"vc_map\",\n ],\n contactFormRules: [\n { tag: \"contact-form-7\", source: \"contact-form-7\", idParam: \"id\" },\n { tag: \"contact_form\", source: \"contact-form-7\", idParam: \"id\" },\n { tag: \"gravityform\", source: \"gravityforms\", idParam: \"id\" },\n { tag: \"ninja_form\", source: \"ninja-forms\", idParam: \"id\" },\n { tag: \"wpforms\", source: \"wpforms\", idParam: \"id\" },\n ],\n videoShortcodePrefixes: [\n \"youtube\",\n \"vimeo\",\n \"embed\",\n \"tatsu_video\",\n \"et_pb_video\",\n \"vc_video\",\n ],\n portfolioShortcode: \"portfolio\",\n blogShortcodeTags: [\"blog\", \"recent_posts\"],\n galleryShortcode: \"gallery\",\n idGalleryShortcodes: [\"oshine_gallery\", \"vc_gallery\", \"nggallery\"],\n};\n\n/** Shortcodes that cannot become static HTML — reported in conflicts, never stripped. */\nexport const UNRESOLVABLE_SHORTCODE_PREFIXES = [\n \"woocommerce_cart\",\n \"woocommerce_checkout\",\n \"woocommerce_my_account\",\n] as const;\n\nexport const WORDPRESS_BUILDER_REGISTRY: BuilderThemeConfig[] = [\n {\n id: \"tatsu\",\n detect: /\\[(?:\\/)?tatsu_/i,\n layoutMap: prefixedLayoutMap({\n section: \"tatsu_section\",\n row: \"tatsu_row\",\n column: \"tatsu_column\",\n bgParamName: \"bg_image\",\n colsParamName: \"layout\",\n }),\n wrapperRules: [\n { shortcodePrefix: \"tatsu_text\" },\n { shortcodePrefix: \"tatsu_inline_text\" },\n { shortcodePrefix: \"tatsu_text_with_shortcodes\" },\n { shortcodePrefix: \"tatsu_icon_group\" },\n ],\n urlRules: [\n { shortcodePrefix: \"tatsu_image\", urlParams: [\"image\", \"url\", \"src\"], tag: \"img\" },\n { shortcodePrefix: \"tatsu_single_image\", urlParams: [\"image\", \"url\", \"src\"], tag: \"img\" },\n ],\n iconImageRules: [\n { shortcodePrefix: \"tatsu_icon\", imageParam: \"icon_image\", hrefParam: \"href\" },\n ],\n scaffoldingPrefixes: [\"tatsu_\"],\n },\n {\n id: \"divi\",\n detect: /\\[(?:\\/)?et_pb_/i,\n layoutMap: prefixedLayoutMap({\n section: \"et_pb_section\",\n row: \"et_pb_row\",\n column: \"et_pb_column\",\n bgParamName: \"background_image\",\n }),\n urlRules: [{ shortcodePrefix: \"et_pb_image\", urlParams: [\"src\", \"url\"], tag: \"img\" }],\n scaffoldingPrefixes: [\"et_pb_\"],\n },\n {\n id: \"wpbakery\",\n detect: /\\[(?:\\/)?vc_/i,\n layoutMap: extendedPrefixedLayoutMap([\n { role: \"section\", tokens: [\"vc_section\"], bgParamName: \"bg_image\" },\n { role: \"row\", tokens: [\"vc_row\"], colsParamName: \"layout\" },\n { role: \"column\", tokens: [\"vc_column_inner\", \"vc_column\"], widthParamName: \"width\" },\n ]),\n urlRules: [\n { shortcodePrefix: \"vc_single_image\", urlParams: [\"image\", \"src\", \"url\"], tag: \"img\" },\n ],\n scaffoldingPrefixes: [\"vc_\"],\n },\n {\n id: \"fusion\",\n detect: /\\[(?:\\/)?fusion_/i,\n layoutMap: prefixedLayoutMap({\n section: \"fusion_builder_container\",\n row: \"fusion_builder_row\",\n column: \"fusion_builder_column\",\n bgParamName: \"background_image\",\n }),\n scaffoldingPrefixes: [\"fusion_\"],\n },\n {\n id: \"beaver\",\n detect: /\\[(?:\\/)?fl_(?:row|col|builder)/i,\n layoutMap: extendedPrefixedLayoutMap([\n { role: \"row\", tokens: [\"fl_row\"] },\n { role: \"column\", tokens: [\"fl_col\"] },\n ]),\n scaffoldingPrefixes: [\"fl_\"],\n },\n {\n id: \"elementor\",\n detect: /\\[(?:\\/)?elementor[-_]/i,\n urlRules: [\n { shortcodePrefix: \"elementor-widget\", urlParams: [\"url\", \"src\", \"image\"], tag: \"img\" },\n ],\n scaffoldingPrefixes: [\"elementor_\"],\n },\n {\n id: \"oshine\",\n detect:\n /\\[(?:special_sub_title|special_heading5|blox_\\w+|grid_content|grids|testimonial\\b|portfolio\\b|recent_posts\\b|animate_icon\\w*|section\\b|row\\b|one_col|one_third|one_half|one_fourth|two_third|three_fourth|text\\b)/i,\n layoutMap: fractionalLayoutMap({\n section: \"section\",\n row: \"row\",\n columns: [\n \"one_col\",\n \"one_third\",\n \"two_third\",\n \"two_thirds\",\n \"one_half\",\n \"one_fourth\",\n \"three_fourth\",\n \"three_fourths\",\n ],\n bgParamName: \"bg_image\",\n }),\n layoutMaps: [\n extendedPrefixedLayoutMap([\n { role: \"section\", tokens: [\"blox_row\"], bgParamName: \"bg_image\" },\n { role: \"row\", tokens: [\"blox_row_inner\"], colsParamName: \"columns\" },\n {\n role: \"column\",\n tokens: [\"blox_column_inner\", \"blox_column\"],\n widthParamName: \"width\",\n },\n ]),\n ],\n textRules: [\n {\n shortcodePrefix: \"special_sub_title\",\n fields: [{ param: \"title_content\", tag: \"p\" }],\n },\n {\n shortcodePrefix: \"special_heading5\",\n fields: [\n { param: \"title_content\", tag: \"h2\" },\n { param: \"caption_content\", tag: \"h4\" },\n ],\n },\n ],\n wrapperRules: [\n { shortcodePrefix: \"grid_content\" },\n { shortcodePrefix: \"testimonial\", urlParams: [\"author_image\"] },\n { shortcodePrefix: \"blox_text\" },\n ],\n urlRules: [\n { shortcodePrefix: \"blox_image\", urlParams: [\"image\", \"img\", \"src\", \"url\"], tag: \"img\" },\n ],\n scaffoldingPrefixes: [\"blox_\", \"animate_icon\"],\n legacyScaffoldingTokens: [\"text\", \"icon\", \"linebreak\", \"grids\", \"testimonials\"],\n },\n];\n\n/** @deprecated Use urlRules on BuilderThemeConfig — kept for type migration clarity. */\nexport type BuilderContentRule = BuilderUrlRule;\n"],"mappings":";;;;;;;;AAAA,YAAY,aAAa;AA0CzB,IAAM,+BACJ;AAEF,SAAS,sBACP,SAC+E;AAC/E,QAAM,cAAc,QAAQ,eAAe,mCAAmC;AAC9E,QAAM,kBAAkB,QAAQ,mBAAmB,QAAQ,QAAQ,WAAW;AAC9E,SAAO,EAAE,aAAa,gBAAgB;AACxC;AAEA,SAAS,cACP,KACA,SACA,oBACA,mBACA,YACoB;AACpB,QAAM,aAAa,kBAAkB,GAAG;AACxC,MAAI,CAAC,WAAY,QAAO;AAExB,MAAI,oBAAoB,UAAU,GAAG;AACnC,sBAAkB,IAAI,UAAU;AAChC,WAAO;AAAA,EACT;AAEA,oBAAkB,IAAI,UAAU;AAChC,QAAM,MAAM,QAAQ,aAAa,UAAU;AAC3C,MAAI,CAAC,KAAK,eAAe;AACvB,eAAW,IAAI,UAAU;AACzB,WAAO;AAAA,EACT;AAEA,QAAM,EAAE,aAAa,gBAAgB,IAAI,sBAAsB,OAAO;AACtE,QAAM,WAAW,mBAAmB,IAAI,IAAI,aAAa;AACzD,MAAI,mBAAmB,CAAC,UAAU;AAChC,eAAW,IAAI,UAAU;AACzB,WAAO;AAAA,EACT;AAEA,SAAO,YAAY,KAAK,QAAQ;AAClC;AAEA,SAAS,6BACP,OACA,SACA,oBACA,mBACA,YACQ;AACR,SAAO,MAAM,QAAQ,8BAA8B,CAAC,MAAM,OAAe,WAAmB;AAC1F,UAAM,WAAW,cAAc,OAAO,KAAK,GAAG,SAAS,oBAAoB,mBAAmB,UAAU;AACxG,QAAI,CAAC,SAAU,QAAO;AAEtB,UAAM,UAAU,QACZ,OAAO,KAAK,GAAG,QAAQ,GAAG,KAAK,MAC/B,OAAO,QAAQ;AACnB,WAAO,KAAK,QAAQ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