@templatical/editor 0.26.0 → 0.26.1

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 (82) hide show
  1. package/dist/{AiChatSidebar-c-3yyjN1.js → AiChatSidebar-B_fwa6zc.js} +1 -1
  2. package/dist/{AiFeatureMenu-B-COyG7k.js → AiFeatureMenu-BBBKsYD4.js} +1 -1
  3. package/dist/{BlockPreviewCanvas-CJPHGI93.js → BlockPreviewCanvas-zyyq2de0.js} +1 -1
  4. package/dist/{CloudEditor-BdSQ8hfv.js → CloudEditor-DM3RRCVn.js} +8 -8
  5. package/dist/{CollaboratorBar-mGoi6yye.js → CollaboratorBar-Coj8Ebwf.js} +1 -1
  6. package/dist/{DesignReferenceSidebar-CgYkySre.js → DesignReferenceSidebar-hDXOvGoV.js} +1 -1
  7. package/dist/{MergeTagModeToggle-hAJgIKhw.js → MergeTagModeToggle-D0t5NHBZ.js} +1 -1
  8. package/dist/{ParagraphEditor-DBG63S70.js → ParagraphEditor-B-CYrQMY.js} +2 -2
  9. package/dist/{SaveBlockDialog-Dq9UVihi.js → SaveBlockDialog-CoVPZfUv.js} +3 -3
  10. package/dist/{SavedBlocksBrowserModal-CtFG4zeV.js → SavedBlocksBrowserModal-DX13xw0O.js} +4 -4
  11. package/dist/{SavedBlocksPanels-DNVdso_W.js → SavedBlocksPanels-B7pBiZcc.js} +1 -1
  12. package/dist/{SavedBlocksPickBar-Cv4dIpP-.js → SavedBlocksPickBar-ZfqXByph.js} +1 -1
  13. package/dist/{SnapshotHistory-DsOtMHOV.js → SnapshotHistory-BxABntv5.js} +1 -1
  14. package/dist/{TestEmailModal-CIwqtGfr.js → TestEmailModal-Db4qheuy.js} +5 -5
  15. package/dist/{TestEmailPanel-l6LDmBGM.js → TestEmailPanel-B-SXSnRg.js} +1 -1
  16. package/dist/{TitleEditor-imoBUynh.js → TitleEditor-DmoaKooA.js} +2 -2
  17. package/dist/{TplModal-DDDHcoir.js → TplModal-Bym-Kf_i.js} +1 -1
  18. package/dist/{blockTypeIcons-CfLN4A6t.js → blockTypeIcons-BnCXsB2I.js} +1 -1
  19. package/dist/bundle-stats.json +5 -5
  20. package/dist/cdn/chunks/{AiChatSidebar-BHqNxNcX.js → AiChatSidebar-CFvS4-EZ.js} +2 -2
  21. package/dist/cdn/chunks/{AiChatSidebar-BHqNxNcX.js.map → AiChatSidebar-CFvS4-EZ.js.map} +1 -1
  22. package/dist/cdn/chunks/{AiFeatureMenu-D2AIDwEG.js → AiFeatureMenu-a0gBZiJ9.js} +2 -2
  23. package/dist/cdn/chunks/{AiFeatureMenu-D2AIDwEG.js.map → AiFeatureMenu-a0gBZiJ9.js.map} +1 -1
  24. package/dist/cdn/chunks/{BlockPreviewCanvas-DH5ULGkw.js → BlockPreviewCanvas-C27XK2q0.js} +2 -2
  25. package/dist/cdn/chunks/{BlockPreviewCanvas-DH5ULGkw.js.map → BlockPreviewCanvas-C27XK2q0.js.map} +1 -1
  26. package/dist/cdn/chunks/{CloudEditor-C0nB1JfD.js → CloudEditor-Ddnatfuw.js} +11 -11
  27. package/dist/cdn/chunks/{CloudEditor-C0nB1JfD.js.map → CloudEditor-Ddnatfuw.js.map} +1 -1
  28. package/dist/cdn/chunks/{CollaboratorBar-f6Ni7KNH.js → CollaboratorBar-C5Xf6Mz9.js} +2 -2
  29. package/dist/cdn/chunks/{CollaboratorBar-f6Ni7KNH.js.map → CollaboratorBar-C5Xf6Mz9.js.map} +1 -1
  30. package/dist/cdn/chunks/{DesignReferenceSidebar-DBoEBKxQ.js → DesignReferenceSidebar-CZiP00JN.js} +2 -2
  31. package/dist/cdn/chunks/{DesignReferenceSidebar-DBoEBKxQ.js.map → DesignReferenceSidebar-CZiP00JN.js.map} +1 -1
  32. package/dist/cdn/chunks/{MergeTagModeToggle-D8iKvz7v.js → MergeTagModeToggle-ClGdRNpZ.js} +2 -2
  33. package/dist/cdn/chunks/{MergeTagModeToggle-D8iKvz7v.js.map → MergeTagModeToggle-ClGdRNpZ.js.map} +1 -1
  34. package/dist/cdn/chunks/{ParagraphEditor-Cuc83Blj.js → ParagraphEditor-BNc146Pp.js} +3 -3
  35. package/dist/cdn/chunks/{ParagraphEditor-Cuc83Blj.js.map → ParagraphEditor-BNc146Pp.js.map} +1 -1
  36. package/dist/cdn/chunks/{SaveBlockDialog-B8KHhVkI.js → SaveBlockDialog-ogieDQp7.js} +4 -4
  37. package/dist/cdn/chunks/{SaveBlockDialog-B8KHhVkI.js.map → SaveBlockDialog-ogieDQp7.js.map} +1 -1
  38. package/dist/cdn/chunks/{SavedBlocksBrowserModal-B-sjsIJv.js → SavedBlocksBrowserModal-DSpZcT_T.js} +4 -4
  39. package/dist/cdn/chunks/{SavedBlocksBrowserModal-B-sjsIJv.js.map → SavedBlocksBrowserModal-DSpZcT_T.js.map} +1 -1
  40. package/dist/cdn/chunks/{SavedBlocksPanels-Bb-eDMAh.js → SavedBlocksPanels-WYrSyf-l.js} +2 -2
  41. package/dist/cdn/chunks/{SavedBlocksPanels-Bb-eDMAh.js.map → SavedBlocksPanels-WYrSyf-l.js.map} +1 -1
  42. package/dist/cdn/chunks/{SavedBlocksPickBar-GudFfXa4.js → SavedBlocksPickBar-DGbLBG5P.js} +2 -2
  43. package/dist/cdn/chunks/{SavedBlocksPickBar-GudFfXa4.js.map → SavedBlocksPickBar-DGbLBG5P.js.map} +1 -1
  44. package/dist/cdn/chunks/{SnapshotHistory-Srpzt2na.js → SnapshotHistory-VyL4tJwn.js} +2 -2
  45. package/dist/cdn/chunks/{SnapshotHistory-Srpzt2na.js.map → SnapshotHistory-VyL4tJwn.js.map} +1 -1
  46. package/dist/cdn/chunks/{TestEmailModal-DLeoJqaJ.js → TestEmailModal-DRte11oT.js} +6 -6
  47. package/dist/cdn/chunks/{TestEmailModal-DLeoJqaJ.js.map → TestEmailModal-DRte11oT.js.map} +1 -1
  48. package/dist/cdn/chunks/{TestEmailPanel-Dr7Dkq2P.js → TestEmailPanel-CpK5t4E3.js} +2 -2
  49. package/dist/cdn/chunks/{TestEmailPanel-Dr7Dkq2P.js.map → TestEmailPanel-CpK5t4E3.js.map} +1 -1
  50. package/dist/cdn/chunks/{TitleEditor-DzYRr18C.js → TitleEditor-EkDchueW.js} +3 -3
  51. package/dist/cdn/chunks/{TitleEditor-DzYRr18C.js.map → TitleEditor-EkDchueW.js.map} +1 -1
  52. package/dist/cdn/chunks/{TplModal-byw7-3wg.js → TplModal-BGLstO3F.js} +2 -2
  53. package/dist/cdn/chunks/{TplModal-byw7-3wg.js.map → TplModal-BGLstO3F.js.map} +1 -1
  54. package/dist/cdn/chunks/{cloud-CuItCnN_.js → cloud-CNpvDuv7.js} +2 -2
  55. package/dist/cdn/chunks/{cloud-CuItCnN_.js.map → cloud-CNpvDuv7.js.map} +1 -1
  56. package/dist/cdn/chunks/{extensions-B7laxHjs.js → extensions-CZAB08kD.js} +3 -3
  57. package/dist/cdn/chunks/{extensions-B7laxHjs.js.map → extensions-CZAB08kD.js.map} +1 -1
  58. package/dist/cdn/chunks/{src-C0N74uvF.js → src-BRRRFqXr.js} +2 -2
  59. package/dist/cdn/chunks/{src-C0N74uvF.js.map → src-BRRRFqXr.js.map} +1 -1
  60. package/dist/cdn/chunks/{src-BYKYmEOD.js → src-COnW7gMq.js} +120 -121
  61. package/dist/cdn/chunks/src-COnW7gMq.js.map +1 -0
  62. package/dist/cdn/chunks/{src-EKTTBQ0y.js → src-DsvVSm7Z.js} +219 -165
  63. package/dist/cdn/chunks/src-DsvVSm7Z.js.map +1 -0
  64. package/dist/cdn/chunks/{src-Bi-Qhtfs.js → src-DzH5U9Vm.js} +79 -79
  65. package/dist/cdn/chunks/{src-Bi-Qhtfs.js.map → src-DzH5U9Vm.js.map} +1 -1
  66. package/dist/cdn/chunks/{styles-C7s-VtJi.js → styles-DEU_sn3k.js} +452 -452
  67. package/dist/cdn/chunks/{styles-C7s-VtJi.js.map → styles-DEU_sn3k.js.map} +1 -1
  68. package/dist/cdn/chunks/{useEditorCore-C_nUXiph.js → useEditorCore-fyFmWS3D.js} +36 -36
  69. package/dist/cdn/chunks/{useEditorCore-C_nUXiph.js.map → useEditorCore-fyFmWS3D.js.map} +1 -1
  70. package/dist/cdn/chunks/{useMergeTag-CPa_9VOq.js → useMergeTag-DjQoCGEz.js} +2 -2
  71. package/dist/cdn/chunks/{useMergeTag-CPa_9VOq.js.map → useMergeTag-DjQoCGEz.js.map} +1 -1
  72. package/dist/cdn/editor.js +7 -7
  73. package/dist/{cloud-C7-FhzMc.js → cloud-4SuOLNTK.js} +1 -1
  74. package/dist/{dist-D5zCZFdU.js → dist-BvYvG5SQ.js} +108 -56
  75. package/dist/{extensions-CxwhoG8v.js → extensions-Dz5jj0wf.js} +2 -2
  76. package/dist/{styles-C_slTGwp.js → styles-DbP2S8Z1.js} +6 -6
  77. package/dist/templatical-editor.js +7 -7
  78. package/dist/{useEditorCore-r4gWzCBA.js → useEditorCore-CbcmGpwp.js} +4 -4
  79. package/dist/{useMergeTag-C-_WxrgL.js → useMergeTag-B9xG9EJ7.js} +1 -1
  80. package/package.json +8 -8
  81. package/dist/cdn/chunks/src-BYKYmEOD.js.map +0 -1
  82. package/dist/cdn/chunks/src-EKTTBQ0y.js.map +0 -1
@@ -106,27 +106,27 @@ function u(e) {
106
106
  function d(e) {
107
107
  return e.type === "html";
108
108
  }
109
- function f(e) {
109
+ function ee(e) {
110
110
  return e.type === "menu";
111
111
  }
112
- function p(e) {
112
+ function te(e) {
113
113
  return e.type === "table";
114
114
  }
115
- function ee(e) {
115
+ function ne(e) {
116
116
  return e.type === "custom";
117
117
  }
118
118
  //#endregion
119
119
  //#region ../types/src/defaults.ts
120
- var m = {
120
+ var f = {
121
121
  content: "<p>Enter your title</p>",
122
122
  level: 2,
123
123
  textAlign: "left"
124
- }, h = { content: "<p>Enter your text here</p>" }, g = {
124
+ }, p = { content: "<p>Enter your text here</p>" }, m = {
125
125
  src: "",
126
126
  alt: "",
127
127
  width: "full",
128
128
  align: "center"
129
- }, _ = {
129
+ }, h = {
130
130
  text: "Click Here",
131
131
  url: "",
132
132
  backgroundColor: "#333333",
@@ -140,36 +140,36 @@ var m = {
140
140
  left: 24
141
141
  },
142
142
  align: "center"
143
- }, v = {
143
+ }, g = {
144
144
  lineStyle: "solid",
145
145
  color: "#e0e0e0",
146
146
  thickness: 1,
147
147
  width: "full"
148
- }, y = { columns: "1" }, b = {
148
+ }, _ = { columns: "1" }, v = {
149
149
  url: "",
150
150
  thumbnailUrl: "",
151
151
  alt: "Video",
152
152
  width: "full",
153
153
  align: "center"
154
- }, x = {
154
+ }, y = {
155
155
  iconStyle: "solid",
156
156
  iconSize: "medium",
157
157
  spacing: 10,
158
158
  align: "center"
159
- }, S = { height: 24 }, C = { content: "" }, w = {
159
+ }, b = { height: 24 }, x = { content: "" }, S = {
160
160
  fontSize: 15,
161
161
  textAlign: "center",
162
162
  separator: "|",
163
163
  separatorColor: "#e0e0e0",
164
164
  spacing: 10
165
- }, T = {
165
+ }, C = {
166
166
  hasHeaderRow: !0,
167
167
  borderColor: "#e0e0e0",
168
168
  borderWidth: 1,
169
169
  cellPadding: 8,
170
170
  fontSize: 15,
171
171
  textAlign: "left"
172
- }, E = {
172
+ }, w = {
173
173
  targetDate: "",
174
174
  timezone: "UTC",
175
175
  showDays: !0,
@@ -189,21 +189,21 @@ var m = {
189
189
  expiredMessage: "This offer has expired",
190
190
  expiredImageUrl: "",
191
191
  hideOnExpiry: !1
192
- }, te = {
193
- title: m,
194
- paragraph: h,
195
- image: g,
196
- button: _,
197
- divider: v,
198
- section: y,
199
- video: b,
200
- social: x,
201
- spacer: S,
202
- html: C,
203
- menu: w,
204
- table: T,
205
- countdown: E
206
- }, D = {
192
+ }, re = {
193
+ title: f,
194
+ paragraph: p,
195
+ image: m,
196
+ button: h,
197
+ divider: g,
198
+ section: _,
199
+ video: v,
200
+ social: y,
201
+ spacer: b,
202
+ html: x,
203
+ menu: S,
204
+ table: C,
205
+ countdown: w
206
+ }, T = {
207
207
  width: 600,
208
208
  backgroundColor: "#ffffff",
209
209
  textColor: "#1a1a1a",
@@ -211,24 +211,24 @@ var m = {
211
211
  fontFamily: "Arial",
212
212
  locale: "en"
213
213
  };
214
- function O(e) {
214
+ function E(e) {
215
215
  return typeof e == "object" && !!e && !Array.isArray(e) && Object.getPrototypeOf(e) === Object.prototype;
216
216
  }
217
- function k(e, t) {
217
+ function D(e, t) {
218
218
  let n = { ...e };
219
219
  for (let r of Object.keys(t)) {
220
220
  let i = e[r], a = t[r];
221
- a !== void 0 && (n[r] = O(i) && O(a) ? k(i, a) : a);
221
+ a !== void 0 && (n[r] = E(i) && E(a) ? D(i, a) : a);
222
222
  }
223
223
  return n;
224
224
  }
225
225
  //#endregion
226
226
  //#region ../types/src/template.ts
227
- function ne(e = "Arial", t) {
227
+ function ie(e = "Arial", t) {
228
228
  return {
229
229
  blocks: [],
230
230
  settings: {
231
- ...D,
231
+ ...T,
232
232
  fontFamily: e,
233
233
  ...t
234
234
  }
@@ -236,13 +236,13 @@ function ne(e = "Arial", t) {
236
236
  }
237
237
  //#endregion
238
238
  //#region ../types/src/factory.ts
239
- function A(e, t) {
240
- return !t || Object.keys(t).length === 0 ? e : k(e, t);
239
+ function O(e, t) {
240
+ return !t || Object.keys(t).length === 0 ? e : D(e, t);
241
241
  }
242
- function j() {
242
+ function k() {
243
243
  return crypto.randomUUID();
244
244
  }
245
- function re(e = 0) {
245
+ function ae(e = 0) {
246
246
  return {
247
247
  top: e,
248
248
  right: e,
@@ -250,135 +250,135 @@ function re(e = 0) {
250
250
  left: e
251
251
  };
252
252
  }
253
- function M(e = 10) {
254
- return { padding: re(e) };
253
+ function A(e = 10) {
254
+ return { padding: ae(e) };
255
255
  }
256
- function N(e = {}) {
257
- return A({
258
- id: j(),
256
+ function j(e = {}) {
257
+ return O({
258
+ id: k(),
259
259
  type: "title",
260
+ ...f,
261
+ styles: A()
262
+ }, e);
263
+ }
264
+ function M(e = {}) {
265
+ return O({
266
+ id: k(),
267
+ type: "paragraph",
268
+ ...p,
269
+ styles: A()
270
+ }, e);
271
+ }
272
+ function N(e = {}) {
273
+ return O({
274
+ id: k(),
275
+ type: "image",
260
276
  ...m,
261
- styles: M()
277
+ styles: A()
262
278
  }, e);
263
279
  }
264
280
  function P(e = {}) {
265
- return A({
266
- id: j(),
267
- type: "paragraph",
281
+ return O({
282
+ id: k(),
283
+ type: "button",
268
284
  ...h,
269
- styles: M()
285
+ styles: A()
270
286
  }, e);
271
287
  }
272
288
  function F(e = {}) {
273
- return A({
274
- id: j(),
275
- type: "image",
289
+ return O({
290
+ id: k(),
291
+ type: "divider",
276
292
  ...g,
277
- styles: M()
293
+ styles: A(20)
278
294
  }, e);
279
295
  }
280
296
  function I(e = {}) {
281
- return A({
282
- id: j(),
283
- type: "button",
297
+ return O({
298
+ id: k(),
299
+ type: "section",
284
300
  ..._,
285
- styles: M()
301
+ children: [[]],
302
+ styles: A(20)
286
303
  }, e);
287
304
  }
288
305
  function L(e = {}) {
289
- return A({
290
- id: j(),
291
- type: "divider",
306
+ return O({
307
+ id: k(),
308
+ type: "video",
292
309
  ...v,
293
- styles: M(20)
310
+ styles: A()
294
311
  }, e);
295
312
  }
296
313
  function R(e = {}) {
297
- return A({
298
- id: j(),
299
- type: "section",
314
+ return O({
315
+ id: k(),
316
+ type: "social",
317
+ icons: [],
300
318
  ...y,
301
- children: [[]],
302
- styles: M(20)
319
+ styles: A()
303
320
  }, e);
304
321
  }
305
322
  function z(e = {}) {
306
- return A({
307
- id: j(),
308
- type: "video",
323
+ return O({
324
+ id: k(),
325
+ type: "spacer",
309
326
  ...b,
310
- styles: M()
327
+ styles: A(0)
311
328
  }, e);
312
329
  }
313
330
  function B(e = {}) {
314
- return A({
315
- id: j(),
316
- type: "social",
317
- icons: [],
331
+ return O({
332
+ id: k(),
333
+ type: "html",
318
334
  ...x,
319
- styles: M()
335
+ styles: A()
320
336
  }, e);
321
337
  }
322
338
  function V(e = {}) {
323
- return A({
324
- id: j(),
325
- type: "spacer",
326
- ...S,
327
- styles: M(0)
328
- }, e);
329
- }
330
- function H(e = {}) {
331
- return A({
332
- id: j(),
333
- type: "html",
334
- ...C,
335
- styles: M()
336
- }, e);
337
- }
338
- function U(e = {}) {
339
- return A({
340
- id: j(),
339
+ return O({
340
+ id: k(),
341
341
  type: "menu",
342
342
  items: [],
343
- ...w,
344
- styles: M()
343
+ ...S,
344
+ styles: A()
345
345
  }, e);
346
346
  }
347
- function ie(e, t) {
347
+ function oe(e, t) {
348
348
  return Array.from({ length: t }, () => ({
349
- id: j(),
349
+ id: k(),
350
350
  cells: Array.from({ length: e }, () => ({
351
- id: j(),
351
+ id: k(),
352
352
  content: ""
353
353
  }))
354
354
  }));
355
355
  }
356
- function W(e = {}) {
357
- return A({
358
- id: j(),
356
+ function H(e = {}) {
357
+ return O({
358
+ id: k(),
359
359
  type: "table",
360
- rows: ie(3, 3),
361
- ...T,
362
- styles: M()
360
+ rows: oe(3, 3),
361
+ ...C,
362
+ styles: A()
363
363
  }, e);
364
364
  }
365
- function G(e = {}) {
366
- return A({
367
- id: j(),
365
+ function se(e = {}) {
366
+ return O({
367
+ id: k(),
368
368
  type: "countdown",
369
- ...E,
370
- styles: M()
369
+ ...w,
370
+ styles: A()
371
371
  }, e);
372
372
  }
373
- function ae(e) {
373
+ function ce(e) {
374
374
  return e.type === "repeatable" ? e.default ?? [] : e.type === "boolean" ? e.default ?? !1 : e.type === "number" ? e.default ?? 0 : e.default ?? "";
375
375
  }
376
- function oe(e) {
376
+ function le(e) {
377
377
  let t = {};
378
- for (let n of e.fields) t[n.key] = ae(n);
379
- let n = A(M(), e.defaultStyles);
378
+ for (let n of e.fields) t[n.key] = ce(n);
379
+ let n = O(A(), e.defaultStyles);
380
380
  return {
381
- id: j(),
381
+ id: k(),
382
382
  type: "custom",
383
383
  customType: e.type,
384
384
  fieldValues: t,
@@ -386,31 +386,31 @@ function oe(e) {
386
386
  ...e.dataSource ? { dataSourceFetched: !1 } : {}
387
387
  };
388
388
  }
389
- function K(e, t) {
389
+ function ue(e, t) {
390
390
  switch (e) {
391
- case "section": return R(t?.section);
392
- case "title": return N(t?.title);
393
- case "paragraph": return P(t?.paragraph);
394
- case "image": return F(t?.image);
395
- case "button": return I(t?.button);
396
- case "divider": return L(t?.divider);
397
- case "video": return z(t?.video);
398
- case "social": return B(t?.social);
399
- case "spacer": return V(t?.spacer);
400
- case "html": return H(t?.html);
401
- case "menu": return U(t?.menu);
402
- case "table": return W(t?.table);
403
- case "countdown": return G(t?.countdown);
391
+ case "section": return I(t?.section);
392
+ case "title": return j(t?.title);
393
+ case "paragraph": return M(t?.paragraph);
394
+ case "image": return N(t?.image);
395
+ case "button": return P(t?.button);
396
+ case "divider": return F(t?.divider);
397
+ case "video": return L(t?.video);
398
+ case "social": return R(t?.social);
399
+ case "spacer": return z(t?.spacer);
400
+ case "html": return B(t?.html);
401
+ case "menu": return V(t?.menu);
402
+ case "table": return H(t?.table);
403
+ case "countdown": return se(t?.countdown);
404
404
  default: throw Error(`Unknown block type: ${e}`);
405
405
  }
406
406
  }
407
- function q(e) {
407
+ function U(e) {
408
408
  let t = JSON.parse(JSON.stringify(e));
409
- return t.id = j(), t.type === "section" && (t.children = t.children.map((e) => e.map((e) => q(e)))), t;
409
+ return t.id = k(), t.type === "section" && (t.children = t.children.map((e) => e.map((e) => U(e)))), t;
410
410
  }
411
411
  //#endregion
412
412
  //#region ../types/src/clone.ts
413
- function se(e) {
413
+ function de(e) {
414
414
  let t = /* @__PURE__ */ new WeakSet();
415
415
  return JSON.parse(JSON.stringify(e, (e, n) => {
416
416
  if (typeof n == "object" && n) {
@@ -421,6 +421,60 @@ function se(e) {
421
421
  }));
422
422
  }
423
423
  //#endregion
424
+ //#region ../types/src/html-scan.ts
425
+ var W = /* @__PURE__ */ new Set(["\"", "'"]);
426
+ function G(e, t) {
427
+ let n = null;
428
+ for (let r = t; r < e.length; r++) {
429
+ let t = e[r];
430
+ if (n !== null) {
431
+ t === n && (n = null);
432
+ continue;
433
+ }
434
+ if (W.has(t)) {
435
+ n = t;
436
+ continue;
437
+ }
438
+ if (t === ">") return r;
439
+ }
440
+ return -1;
441
+ }
442
+ function fe(e) {
443
+ return e !== " " && e !== " " && e !== "\n" && e !== "\r" && e !== "\f" && e !== "=" && e !== ">" && e !== "/";
444
+ }
445
+ function K(e) {
446
+ return e === " " || e === " " || e === "\n" || e === "\r" || e === "\f";
447
+ }
448
+ function q(e, t) {
449
+ let n = t.toLowerCase(), r = 0;
450
+ for (; r < e.length;) {
451
+ for (; r < e.length && (K(e[r]) || e[r] === "/");) r++;
452
+ if (r >= e.length) break;
453
+ let t = r;
454
+ for (; r < e.length && fe(e[r]);) r++;
455
+ let i = e.substring(t, r).toLowerCase();
456
+ if (i === "") {
457
+ r++;
458
+ continue;
459
+ }
460
+ for (; r < e.length && K(e[r]);) r++;
461
+ if (e[r] !== "=") continue;
462
+ for (r++; r < e.length && K(e[r]);) r++;
463
+ let a = e[r];
464
+ if (W.has(a)) {
465
+ let t = r + 1, o = e.indexOf(a, t);
466
+ if (o === -1) return null;
467
+ if (i === n) return e.substring(t, o);
468
+ r = o + 1;
469
+ continue;
470
+ }
471
+ let o = r;
472
+ for (; r < e.length && !K(e[r]) && e[r] !== ">";) r++;
473
+ if (i === n) return e.substring(o, r);
474
+ }
475
+ return null;
476
+ }
477
+ //#endregion
424
478
  //#region ../types/src/merge-tags.ts
425
479
  var J = {
426
480
  liquid: {
@@ -439,33 +493,33 @@ var J = {
439
493
  value: /%%=.+?=%%/g,
440
494
  logic: /%%\[\s*(\w+).*?\]%%/g
441
495
  }
442
- }, ce = {
496
+ }, pe = {
443
497
  liquid: "{{",
444
498
  handlebars: "{{",
445
499
  mailchimp: "*|",
446
500
  ampscript: "%%="
447
- }, le = {
501
+ }, me = {
448
502
  liquid: "}}",
449
503
  handlebars: "}}",
450
504
  mailchimp: "|*",
451
505
  ampscript: "=%%"
452
506
  };
453
- function ue(e) {
454
- for (let t of Object.keys(J)) if (J[t].value.source === e.value.source) return ce[t];
507
+ function he(e) {
508
+ for (let t of Object.keys(J)) if (J[t].value.source === e.value.source) return pe[t];
455
509
  return null;
456
510
  }
457
- function de(e) {
458
- for (let t of Object.keys(J)) if (J[t].value.source === e.value.source) return le[t];
511
+ function ge(e) {
512
+ for (let t of Object.keys(J)) if (J[t].value.source === e.value.source) return me[t];
459
513
  return null;
460
514
  }
461
- function fe(e) {
515
+ function _e(e) {
462
516
  return e ? typeof e == "string" ? J[e] ?? J.liquid : e : J.liquid;
463
517
  }
464
518
  function Y(e) {
465
519
  let t = e.source, n = e.flags.replace("g", "");
466
520
  return RegExp(`^${t}$`, n);
467
521
  }
468
- function pe(e, t) {
522
+ function ve(e, t) {
469
523
  let n = e?.trim() || "";
470
524
  return !Y(t.logic).test(n) && Y(t.value).test(n);
471
525
  }
@@ -473,83 +527,83 @@ function X(e, t) {
473
527
  let n = t.find((t) => t.value === e);
474
528
  return n ? n.label : e;
475
529
  }
476
- function me(e, t) {
530
+ function ye(e, t) {
477
531
  return $(e, "data-merge-tag", (e) => X(e, t));
478
532
  }
479
533
  function Z(e, t) {
480
534
  return t.find((t) => t.value === e)?.sample;
481
535
  }
482
- function he(e, t) {
483
- return $(e, "data-merge-tag", (e) => ve(Z(e, t) ?? X(e, t)), { unwrap: (e) => Z(e, t) !== void 0 });
536
+ function be(e, t) {
537
+ return $(e, "data-merge-tag", (e) => Ce(Z(e, t) ?? X(e, t)), { unwrap: (e) => Z(e, t) !== void 0 });
484
538
  }
485
- function ge(e) {
539
+ function xe(e) {
486
540
  return e.some((e) => e.sample !== void 0);
487
541
  }
488
- function _e(e, t) {
542
+ function Se(e, t) {
489
543
  if (!e) return e;
490
544
  let n = e;
491
545
  for (let e of t) e.sample !== void 0 && (n = n.split(e.value).join(e.sample));
492
546
  return n;
493
547
  }
494
- function ve(e) {
548
+ function Ce(e) {
495
549
  return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
496
550
  }
497
- function ye(e, t) {
551
+ function we(e, t) {
498
552
  if (!e) return !1;
499
553
  let n = new RegExp(t.value.source, t.value.flags), r = new RegExp(t.logic.source, t.logic.flags);
500
554
  return n.test(e) || r.test(e);
501
555
  }
502
- function be(e, t) {
556
+ function Te(e, t) {
503
557
  return Y(t.logic).test(e?.trim() || "");
504
558
  }
505
559
  function Q(e, t) {
506
560
  let n = new RegExp(t.logic.source, t.logic.flags.replace("g", "")), r = e.match(n);
507
561
  return r && r[1] ? r[1].toUpperCase() : e;
508
562
  }
509
- function xe(e, t) {
563
+ function Ee(e, t) {
510
564
  return $(e, "data-logic-merge-tag", (e) => Q(e, t));
511
565
  }
512
566
  function $(e, t, n, r) {
513
- let i = RegExp(`(?:^|\\s)${t}="([^"<>]*)"`), a = "", o = 0;
514
- for (; o < e.length;) {
515
- let t = e.indexOf("<span", o);
516
- if (t === -1) {
517
- a += e.substring(o);
567
+ let i = "", a = 0;
568
+ for (; a < e.length;) {
569
+ let o = e.indexOf("<span", a);
570
+ if (o === -1) {
571
+ i += e.substring(a);
518
572
  break;
519
573
  }
520
- let s = e[t + 5];
574
+ let s = e[o + 5];
521
575
  if (s !== ">" && s !== " " && s !== " " && s !== "\n" && s !== "\r" && s !== "/") {
522
- a += e.substring(o, t + 5), o = t + 5;
576
+ i += e.substring(a, o + 5), a = o + 5;
523
577
  continue;
524
578
  }
525
- let c = e.indexOf(">", t + 5);
579
+ let c = G(e, o + 5);
526
580
  if (c === -1) {
527
- a += e.substring(o);
581
+ i += e.substring(a);
528
582
  break;
529
583
  }
530
584
  let l = e.indexOf("</span>", c + 1);
531
585
  if (l === -1) {
532
- a += e.substring(o);
586
+ i += e.substring(a);
533
587
  break;
534
588
  }
535
- let u = e.substring(t + 5, c), d = i.exec(u);
536
- if (!d) {
537
- a += e.substring(o, t + 5), o = t + 5;
589
+ let u = q(e.substring(o + 5, c), t);
590
+ if (u === null) {
591
+ i += e.substring(a, o + 5), a = o + 5;
538
592
  continue;
539
593
  }
540
- let f = d[1], p = n(f);
541
- r?.unwrap?.(f) ? (a += e.substring(o, t), a += p) : (a += e.substring(o, c + 1), a += p, a += "</span>"), o = l + 7;
594
+ let d = n(u);
595
+ r?.unwrap?.(u) ? (i += e.substring(a, o), i += d) : (i += e.substring(a, c + 1), i += d, i += "</span>"), a = l + 7;
542
596
  }
543
- return a;
597
+ return i;
544
598
  }
545
599
  //#endregion
546
600
  //#region ../types/src/preview-resolution.ts
547
- function Se(e) {
601
+ function De(e) {
548
602
  return typeof e != "object" || !e ? !1 : Array.isArray(e.blocks);
549
603
  }
550
604
  //#endregion
551
605
  //#region ../types/src/config.ts
552
- var Ce = class extends Error {
606
+ var Oe = class extends Error {
553
607
  statusCode;
554
608
  constructor(e, t) {
555
609
  super(e), this.statusCode = t, this.name = "SdkError";
@@ -565,6 +619,6 @@ var Ce = class extends Error {
565
619
  }
566
620
  };
567
621
  //#endregion
568
- export { e as $, B as A, ee as B, oe as C, U as D, F as E, j as F, i as G, d as H, ne as I, u as J, n as K, te as L, W as M, N, P as O, z as P, t as Q, D as R, G as S, H as T, a as U, s as V, f as W, r as X, p as Y, c as Z, _e as _, Q as a, K as b, de as c, be as d, pe as f, he as g, fe as h, ye as i, V as j, R as k, ue as l, me as m, Se as n, X as o, xe as p, l as q, J as r, Z as s, Ce as t, ge as u, se as v, L as w, I as x, q as y, o as z };
622
+ export { c as $, M as A, T as B, P as C, B as D, F as E, j as F, a as G, ne as H, L as I, n as J, ee as K, k as L, R as M, z as N, N as O, H as P, r as Q, ie as R, ue as S, le as T, s as U, o as V, d as W, u as X, l as Y, te as Z, Se as _, Q as a, de as b, ge as c, Te as d, t as et, ve as f, be as g, _e as h, we as i, I as j, V as k, he as l, ye as m, De as n, X as o, Ee as p, i as q, J as r, Z as s, Oe as t, e as tt, xe as u, G as v, se as w, U as x, q as y, re as z };
569
623
 
570
- //# sourceMappingURL=src-EKTTBQ0y.js.map
624
+ //# sourceMappingURL=src-DsvVSm7Z.js.map