@epa-wg/custom-element-dist 0.0.33 → 0.0.35

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 (185) hide show
  1. package/.claude/settings.local.json +18 -0
  2. package/.gitattributes +4 -0
  3. package/.github/workflows/deploy.yml +59 -0
  4. package/.idea/copilot.data.migration.agent.xml +6 -0
  5. package/.idea/copilot.data.migration.ask.xml +6 -0
  6. package/.idea/copilot.data.migration.ask2agent.xml +6 -0
  7. package/.idea/copilot.data.migration.edit.xml +6 -0
  8. package/.idea/custom-element-dist.iml +2 -0
  9. package/.storybook/main.ts +20 -17
  10. package/.storybook/preview.ts +23 -23
  11. package/.yarn/install-state.gz +0 -0
  12. package/.yarnrc.yml +1 -0
  13. package/README.md +6 -4
  14. package/coverage/block-navigation.js +1 -1
  15. package/coverage/coverage-final.json +4 -3
  16. package/coverage/index.html +34 -19
  17. package/coverage/sorter.js +21 -7
  18. package/coverage/src/custom-element/coverage.svg +1 -1
  19. package/coverage/src/custom-element/custom-element.js/coverage.svg +1 -1
  20. package/coverage/src/custom-element/custom-element.js.html +448 -391
  21. package/coverage/src/custom-element/http-request.js/coverage.svg +1 -1
  22. package/coverage/src/custom-element/http-request.js.html +38 -17
  23. package/coverage/src/custom-element/index.html +26 -26
  24. package/coverage/src/custom-element/local-storage.js.html +1 -1
  25. package/coverage/src/custom-element/location-element.js.html +1 -1
  26. package/coverage/src/custom-element/module-url.js.html +1 -1
  27. package/coverage/src/index.html +1 -1
  28. package/coverage/src/material/theme/colors.js/coverage.svg +10 -0
  29. package/coverage/src/material/theme/colors.js.html +217 -0
  30. package/coverage/src/material/theme/coverage.svg +10 -0
  31. package/coverage/src/material/theme/index.html +116 -0
  32. package/coverage/src/mocks/handlers.ts.html +1 -1
  33. package/coverage/src/mocks/index.html +1 -1
  34. package/coverage/src/stories/frame.canvas.ts.html +1 -1
  35. package/coverage/src/stories/http-request.stories.ts.html +1 -1
  36. package/coverage/src/stories/index.html +1 -1
  37. package/coverage/src/stories/testStoryBook.ts.html +12 -12
  38. package/coverage/src/sum.ts.html +1 -1
  39. package/dist/custom-element-Bssk9jRy.cjs +97 -0
  40. package/dist/{custom-element-WnOqmEOe.js → custom-element-BzDjIYMe.js} +193 -183
  41. package/dist/custom-element-bundle.cjs +1 -1
  42. package/dist/custom-element-bundle.js +3 -3
  43. package/dist/demo/a.html +10 -3
  44. package/dist/demo/a.svg +26 -26
  45. package/dist/demo/html-template.html +4 -3
  46. package/dist/demo/s.xml +1 -75
  47. package/dist/demo/s.xslt +351 -72
  48. package/dist/demo/s1.xml +3706 -0
  49. package/dist/http-request-DSaowcG1.cjs +1 -0
  50. package/dist/{http-request-BOvP4KTl.js → http-request-DTCzZ1gc.js} +15 -9
  51. package/dist/mockServiceWorker.js +105 -63
  52. package/package.json +5 -4
  53. package/public/demo/a.html +10 -3
  54. package/public/demo/a.svg +26 -26
  55. package/public/demo/html-template.html +4 -3
  56. package/public/demo/s.xml +1 -75
  57. package/public/demo/s.xslt +351 -72
  58. package/public/demo/s1.xml +3706 -0
  59. package/public/mockServiceWorker.js +105 -63
  60. package/src/custom-element/custom-element.js +28 -9
  61. package/src/custom-element/demo/a.html +10 -3
  62. package/src/custom-element/demo/a.svg +26 -26
  63. package/src/custom-element/demo/html-template.html +4 -3
  64. package/src/custom-element/demo/s.xml +1 -75
  65. package/src/custom-element/demo/s.xslt +351 -72
  66. package/src/custom-element/demo/s1.xml +3706 -0
  67. package/src/custom-element/http-request.js +7 -0
  68. package/src/custom-element/ide/customData-dce.json +123 -0
  69. package/src/custom-element/ide/web-types-dce.json +128 -1
  70. package/src/custom-element/ide/web-types-xsl.json +1 -1
  71. package/src/material/angular.css +987 -987
  72. package/src/material/components/action.html +262 -0
  73. package/src/material/components/autocomplete.html +167 -239
  74. package/src/material/components/badge.html +238 -239
  75. package/src/material/components/dropdown.html +0 -1
  76. package/src/material/components/icon-link.html +160 -161
  77. package/src/material/components/icon.html +251 -252
  78. package/src/material/components/input.html +569 -570
  79. package/src/material/components/menu.html +235 -236
  80. package/src/material/components.html +157 -158
  81. package/src/material/demo.css +36 -36
  82. package/src/material/index.html +109 -110
  83. package/src/material/material.css +356 -356
  84. package/src/material/theme/Base-Principles.md +339 -0
  85. package/src/material/theme/README.md +298 -18
  86. package/src/material/theme/UI Domain Model in web applications.svg +1 -0
  87. package/src/material/theme/User Semantic Theme tokens.svg +1 -0
  88. package/src/material/theme/action-pending-poc.html +62 -0
  89. package/src/material/theme/actions-color.html +141 -0
  90. package/src/material/theme/colors-light.html +631 -0
  91. package/src/material/theme/colors-native.html +51 -0
  92. package/src/material/theme/colors-poc.html +66 -0
  93. package/src/material/theme/colors.html +297 -0
  94. package/src/material/theme/colors.js +44 -0
  95. package/src/material/theme/consumer-theme.css +745 -0
  96. package/src/material/theme/semantic.css +132 -132
  97. package/src/material/theme/style-bug.html +123 -0
  98. package/src/material/theme/theme-data.css +43 -0
  99. package/src/material/theme/theme-data.xhtml +2926 -0
  100. package/src/material/theme/todo.md +274 -0
  101. package/src/material/theme/tokens/action-colors.png +0 -0
  102. package/src/material/theme/tokens/cem-article-illustration-4x1-letterbox-2000x500.png +0 -0
  103. package/src/material/theme/tokens/cem-breakpoints.md +519 -0
  104. package/src/material/theme/tokens/cem-colors.md +715 -0
  105. package/src/material/theme/tokens/cem-consumerflow-typography-matrix.svg +198 -0
  106. package/src/material/theme/tokens/cem-coupling.md +372 -0
  107. package/src/material/theme/tokens/cem-data-vs-reading-numerals.svg +164 -0
  108. package/src/material/theme/tokens/cem-dimension.md +625 -0
  109. package/src/material/theme/tokens/cem-layering.md +562 -0
  110. package/src/material/theme/tokens/cem-m3-parity.md +343 -0
  111. package/src/material/theme/tokens/cem-responsive.md +238 -0
  112. package/src/material/theme/tokens/cem-shape.md +691 -0
  113. package/src/material/theme/tokens/cem-stroke-density-illustration-4to1-v3.svg +102 -0
  114. package/src/material/theme/tokens/cem-stroke.md +480 -0
  115. package/src/material/theme/tokens/cem-timing.md +198 -0
  116. package/src/material/theme/tokens/cem-typography-model-stack.svg +64 -0
  117. package/src/material/theme/tokens/cem-voice-fonts-typography.md +718 -0
  118. package/src/material/theme/tokens/cem-voice-ladder.svg +91 -0
  119. package/src/material/theme/tokens/chips.png +0 -0
  120. package/src/material/theme/tokens/columns-page.png +0 -0
  121. package/src/material/theme/tokens/initials.png +0 -0
  122. package/src/material/theme/tokens/nav-buttons.png +0 -0
  123. package/src/material/theme/tokens/script.png +0 -0
  124. package/src/material/theme/tokens/sufler.png +0 -0
  125. package/src/material/theme/tokens/typography-icons.png +0 -0
  126. package/src/mocks/versions.mock.ts +1 -1
  127. package/src/stories/__screenshots__/dom-merge.test.stories.ts/dom-merge-dom-merge-OrderPreservingOn2ndTransform-1.png +0 -0
  128. package/src/stories/__screenshots__/xslt-conditionals.test.stories.ts/xslt-conditionals-xslt-conditionals-MultipleIfOrderingWorkaround-1.png +0 -0
  129. package/src/stories/dom-merge.test.stories.ts +25 -1
  130. package/src/stories/xslt-conditionals.test.stories.ts +492 -0
  131. package/src/stories/xslt-for-each.test.stories.ts +336 -0
  132. package/src/stories/xslt-if.test.stories.ts +89 -0
  133. package/storybook-static/assets/{Color-F6OSRLHC-Cbp293x2.js → Color-F6OSRLHC-DeDlDLjU.js} +1 -1
  134. package/storybook-static/assets/{Configure-BrFr4SLE.js → Configure-CH_tIP5N.js} +1 -1
  135. package/storybook-static/assets/{DocsRenderer-CFRXHY34-DhHzJiIO.js → DocsRenderer-CFRXHY34-Bc9EPsUI.js} +2 -2
  136. package/storybook-static/assets/{attributes.test.stories-Gg9LQTEK.js → attributes.test.stories-BtamFQkF.js} +1 -1
  137. package/storybook-static/assets/{css.test.stories-B_3ltOrx.js → css.test.stories-BfNxLgwr.js} +1 -1
  138. package/storybook-static/assets/{custom-element-CPnvJnn8.js → custom-element-CnmjNo0g.js} +6 -6
  139. package/storybook-static/assets/{dom-merge.test.stories-nQxcgLoM.js → dom-merge.test.stories-DxnitrLK.js} +47 -6
  140. package/storybook-static/assets/entry-preview-BNCt9WBs.js +26 -0
  141. package/storybook-static/assets/{entry-preview-docs-Dwczwtsc.js → entry-preview-docs-CbF8-81D.js} +2 -2
  142. package/storybook-static/assets/{external-template.test.stories-DZ-rjnfd.js → external-template.test.stories-BTsww7B0.js} +1 -1
  143. package/storybook-static/assets/{form.test.stories-DQhPYtMj.js → form.test.stories-DNJFtPJb.js} +1 -1
  144. package/storybook-static/assets/{frame.canvas-ClTqYyMN.js → frame.canvas-E5n9h6j1.js} +1 -1
  145. package/storybook-static/assets/{handlers-CLkps6Nz.js → handlers-Dvg8CAeR.js} +1 -1
  146. package/storybook-static/assets/http-request-BWeEEBkP.js +1 -0
  147. package/storybook-static/assets/{http-request.stories-jo0f73nw.js → http-request.stories-DgrBNle8.js} +1 -1
  148. package/storybook-static/assets/{iframe-CZwRpnn9.js → iframe-DiVWehoI.js} +11 -11
  149. package/storybook-static/assets/{index-Dr4PwNfd.js → index-CGuyH0k-.js} +87 -87
  150. package/storybook-static/assets/{index-CJQtnF9V.js → index-CdEbhcV9.js} +1 -1
  151. package/storybook-static/assets/index-DO1nmyvI.js +11 -0
  152. package/storybook-static/assets/{index-B68YUdzy.js → index-w6iX3YlR.js} +3 -3
  153. package/storybook-static/assets/{local-storage.test.stories-uA5EKRPf.js → local-storage.test.stories-Hwq80yUr.js} +1 -1
  154. package/storybook-static/assets/{location-element.test.stories-Cu-6Elcg.js → location-element.test.stories-mEhZzm7x.js} +1 -1
  155. package/storybook-static/assets/{module-url.test.stories-CD_wusXQ.js → module-url.test.stories-Bj46iT0V.js} +1 -1
  156. package/storybook-static/assets/{preview-CuCH40jj.js → preview-BjbXcJci.js} +2 -2
  157. package/storybook-static/assets/{preview-BFlNN3Wj.js → preview-Bn8igYMp.js} +1 -1
  158. package/storybook-static/assets/{preview-Cm4PPhHS.js → preview-CfuT8gak.js} +1 -1
  159. package/storybook-static/assets/{set-url.test.stories-CY7B9BVZ.js → set-url.test.stories-hzxLcqmm.js} +1 -1
  160. package/storybook-static/assets/{slice-events.test.stories-BVnPXm6e.js → slice-events.test.stories-DVyXFRU1.js} +1 -1
  161. package/storybook-static/assets/{slots.test.stories-Dxsa9KdA.js → slots.test.stories-CS544nS4.js} +1 -1
  162. package/storybook-static/assets/{version-select.test.stories-Buga1PAa.js → version-select.test.stories-D36nfYBq.js} +1 -1
  163. package/storybook-static/assets/xslt-conditionals.test.stories-BS1PTIHe.js +633 -0
  164. package/storybook-static/assets/xslt-for-each.test.stories-CtPS20RK.js +329 -0
  165. package/storybook-static/assets/xslt-if.test.stories-DcHrAMSY.js +71 -0
  166. package/storybook-static/demo/a.html +10 -3
  167. package/storybook-static/demo/a.svg +26 -26
  168. package/storybook-static/demo/html-template.html +4 -3
  169. package/storybook-static/demo/s.xml +1 -75
  170. package/storybook-static/demo/s.xslt +351 -72
  171. package/storybook-static/demo/s1.xml +3706 -0
  172. package/storybook-static/iframe.html +2 -2
  173. package/storybook-static/index.json +1 -1
  174. package/storybook-static/mockServiceWorker.js +105 -63
  175. package/storybook-static/project.json +1 -1
  176. package/storybook-static/sb-addons/essentials-controls-1/manager-bundle.js +69 -66
  177. package/storybook-static/sb-addons/essentials-docs-3/manager-bundle.js +62 -59
  178. package/dist/custom-element-6slVaFEs.cjs +0 -97
  179. package/dist/http-request-DPrY7mGh.cjs +0 -1
  180. package/storybook-static/assets/attributes.test.stories-CzWkKw0e.js +0 -1
  181. package/storybook-static/assets/entry-preview-DHVXbf3x.js +0 -26
  182. package/storybook-static/assets/external-template.test.stories-BivZqBTp.js +0 -1
  183. package/storybook-static/assets/http-request-DNq59pnj.js +0 -1
  184. package/storybook-static/assets/index-BwkS7JH_.js +0 -8
  185. package/storybook-static/assets/module-url.test.stories-CTjUAk3J.js +0 -1
@@ -1,18 +1,18 @@
1
- const K = "http://www.w3.org/1999/XSL/Transform", R = "http://www.w3.org/1999/xhtml", be = "http://exslt.org/common", d = (e, l) => e?.getAttribute?.(l), se = (e) => e.nodeType === 3, ye = (e) => typeof e == "string", ge = (e) => e && typeof e.nodeType == "number", L = (e, l) => (e.ownerDocument || e).createTextNode(l), oe = (e) => {
1
+ const K = "http://www.w3.org/1999/XSL/Transform", R = "http://www.w3.org/1999/xhtml", ye = "http://exslt.org/common", d = (e, s) => e?.getAttribute?.(s), se = (e) => e.nodeType === 3, ge = (e) => typeof e == "string", le = (e) => e && typeof e.nodeType == "number", L = (e, s) => (e.ownerDocument || e).createTextNode(s), ce = (e) => {
2
2
  for (; e.firstChild; ) e.firstChild.remove();
3
3
  return e;
4
- }, F = (e) => (e.getAttributeNames().map((l) => e.removeAttribute(l)), oe(e)), ce = (e) => (e?.setAttribute("xmlns:xsl", K), e), me = (e) => (e?.setAttribute("xmlns:xhtml", R), ce(e)), ue = (e) => /^[_a-zA-Z][-_:a-zA-Z0-9]*$/.test(e), le = (e, l) => (Object.keys(l).map((t) => e[t] = l[t]), e), $ = (e, l = "", t = document) => {
5
- const s = (n) => ((o) => (l && o.append(L(t.ownerDocument || t, l)), o))((t.ownerDocument || t).createElement(n));
6
- if (ue(e))
7
- return s(e);
8
- const a = s("dce-object");
4
+ }, F = (e) => (e.getAttributeNames().map((s) => e.removeAttribute(s)), ce(e)), me = (e) => (e?.setAttribute("xmlns:xsl", K), e), ue = (e) => (e?.setAttribute("xmlns:xhtml", R), me(e)), de = (e) => /^[_a-zA-Z][-_:a-zA-Z0-9]*$/.test(e), ne = (e, s) => (Object.keys(s).map((t) => e[t] = s[t]), e), C = (e, s = "", t = document) => {
5
+ const l = (n) => ((o) => (s && o.append(L(t.ownerDocument || t, s)), o))((t.ownerDocument || t).createElement(n));
6
+ if (de(e))
7
+ return l(e);
8
+ const a = l("dce-object");
9
9
  return a.setAttribute("dce-object-name", e), a;
10
- }, ne = (e, l) => {
11
- const t = e.ownerDocument.createElementNS(e.namespaceURI, l);
12
- for (let s of e.attributes)
13
- t.setAttribute(s.name, s.value);
14
- for (let s of e.childNodes)
15
- t.append(s.cloneNode(!0));
10
+ }, ae = (e, s) => {
11
+ const t = e.ownerDocument.createElementNS(e.namespaceURI, s);
12
+ for (let l of e.attributes)
13
+ t.setAttribute(l.name, l.value);
14
+ for (let l of e.childNodes)
15
+ t.append(l.cloneNode(!0));
16
16
  return t;
17
17
  };
18
18
  function U(e) {
@@ -21,66 +21,70 @@ function U(e) {
21
21
  function q(e) {
22
22
  return new XMLSerializer().serializeToString(e);
23
23
  }
24
- function B(e, l, t, s) {
25
- const a = (g) => e.ownerDocument.createElement(g), o = ((g, x, v) => (x.append(v = a(g)), v))(l, e);
26
- return [...t].forEach((g) => o.append(s(g))), o;
24
+ function B(e, s, t, l) {
25
+ const a = (y) => e.ownerDocument.createElement(y), o = ((y, x, v) => (x.append(v = a(y)), v))(s, e);
26
+ return [...t].forEach((y) => o.append(l(y))), o;
27
27
  }
28
28
  function Ae(e) {
29
- return e.slot || (e.setAttribute || (e = $("span", e.textContent.replaceAll(`
29
+ return e.slot || (e.setAttribute || (e = C("span", e.textContent.replaceAll(`
30
30
  `, ""))), e.setAttribute("slot", "")), e;
31
31
  }
32
- function J(e, l) {
33
- e.getAttributeNames().forEach((t) => l.includes(t) || e.removeAttribute(t));
32
+ function J(e, s) {
33
+ e.getAttributeNames().forEach((t) => s.includes(t) || e.removeAttribute(t));
34
34
  }
35
- const ae = (e) => [...e].filter((l) => !(l.nodeType === 3 && l.data.trim() === ""));
36
- function I(e, l, t) {
37
- const s = typeof e;
38
- if (s === "string")
39
- return $(l, e, t);
40
- if (s === "number")
41
- return $(l, "" + e, t);
35
+ const ie = (e) => [...e].filter((s) => !(s.nodeType === 3 && s.data.trim() === ""));
36
+ function I(e, s, t) {
37
+ const l = typeof e;
38
+ if (l === "string")
39
+ return C(s, e, t);
40
+ if (l === "number")
41
+ return C(s, "" + e, t);
42
+ if (le(e)) {
43
+ const n = C(s);
44
+ return n.append(e), n;
45
+ }
42
46
  if (e instanceof Array) {
43
- const n = $("array", "", t);
44
- return e.map((o) => n.append(I(o, l, t))), n;
47
+ const n = C("array", "", t);
48
+ return e.map((o) => n.append(I(o, s, t))), n;
45
49
  }
46
50
  if (e instanceof FormData) {
47
- const n = $("form-data", "", t);
51
+ const n = C("form-data", "", t);
48
52
  for (const o of e)
49
53
  n.append(I(o[1], o[0], t));
50
54
  return n;
51
55
  }
52
- const a = $(l, "", t);
56
+ const a = C(s, "", t);
53
57
  for (let n in e)
54
- ge(e[n]) || typeof e[n] == "function" || e[n] instanceof Window || (typeof e[n] != "object" && ue(n) ? a.setAttribute(n, e[n]) : a.append(I(e[n], n, t)));
58
+ typeof e[n] == "function" || e[n] instanceof Window || le(e[n]) && !(n === "data" || n === "value") || (typeof e[n] != "object" && de(n) ? a.setAttribute(n, e[n]) : a.append(I(e[n], n, t)));
55
59
  return a;
56
60
  }
57
- function ie(e) {
58
- if (z(e, "*", (l) => [...l.childNodes].filter((t) => t.nodeType === 3 && t.parentNode.localName !== "style" && t.data).forEach((t) => {
59
- const s = t.data, a = s.matchAll(/{([^}]*)}/g);
61
+ function re(e) {
62
+ if (z(e, "*", (s) => [...s.childNodes].filter((t) => t.nodeType === 3 && t.parentNode.localName !== "style" && t.data).forEach((t) => {
63
+ const l = t.data, a = l.matchAll(/{([^}]*)}/g);
60
64
  if (a) {
61
- let n = 0, o = (x) => L(t, x), g = [];
65
+ let n = 0, o = (x) => L(t, x), y = [];
62
66
  if ([...a].forEach((x) => {
63
- x.index > n && g.push(o(x.input.substring(n, x.index)));
67
+ x.index > n && y.push(o(x.input.substring(n, x.index)));
64
68
  const v = e.querySelector("value-of").cloneNode();
65
- v.setAttribute("select", x[1]), g.push(v), n = x.index + x[0].length;
66
- }), n < s.length && g.push(o(s.substring(n, s.length))), g.length) {
67
- for (let x of g)
68
- l.insertBefore(x, t);
69
- l.removeChild(t);
69
+ v.setAttribute("select", x[1]), y.push(v), n = x.index + x[0].length;
70
+ }), n < l.length && y.push(o(l.substring(n, l.length))), y.length) {
71
+ for (let x of y)
72
+ s.insertBefore(x, t);
73
+ s.removeChild(t);
70
74
  }
71
75
  }
72
76
  })), "all" in e) {
73
- let l = 1;
77
+ let s = 1;
74
78
  for (let t of e.all)
75
- t.setAttribute && !t.tagName.startsWith("xsl:") && t.setAttribute("data-dce-id", "" + l++);
79
+ t.setAttribute && !t.tagName.startsWith("xsl:") && t.setAttribute("data-dce-id", "" + s++);
76
80
  }
77
81
  return e;
78
82
  }
79
- function ve(e, l = "xsl:stylesheet") {
80
- const t = [], s = {}, a = {};
81
- if (e.tagName === l || e.documentElement?.tagName === l)
82
- return ie(le(e, { declaredAttributes: t, hardcodedAttributes: s, exposedAttributes: a }));
83
- const n = U(`<xsl:stylesheet version="1.0" xmlns:xsl="${K}" xmlns:xhtml="${R}" xmlns:exsl="${be}" exclude-result-prefixes="exsl" >
83
+ function ve(e, s = "xsl:stylesheet") {
84
+ const t = [], l = {}, a = {};
85
+ if (e.tagName === s || e.documentElement?.tagName === s)
86
+ return re(ne(e, { declaredAttributes: t, hardcodedAttributes: l, exposedAttributes: a }));
87
+ const n = U(`<xsl:stylesheet version="1.0" xmlns:xsl="${K}" xmlns:xhtml="${R}" xmlns:exsl="${ye}" exclude-result-prefixes="exsl" >
84
88
  <xsl:output method="xml"/>
85
89
  <xsl:template match="/"><dce-root xmlns="${R}"><xsl:apply-templates select="*" /></dce-root></xsl:template>
86
90
  <xsl:template match="*[name()='template']">
@@ -136,21 +140,21 @@ function ve(e, l = "xsl:stylesheet") {
136
140
  </xsl:copy>
137
141
  </xsl:for-each>
138
142
  </xsl:template>
139
- </xsl:stylesheet>`), o = new XSLTProcessor(), g = ((i) => {
143
+ </xsl:stylesheet>`), o = new XSLTProcessor(), y = ((i) => {
140
144
  z(i, "custom-element", (h) => {
141
145
  h.firstElementChild.localName === "template" && ([...h.firstElementChild.content.childNodes].forEach((b) => h.append(b)), h.firstElementChild.remove());
142
146
  }), z(i, "script", (h) => h.remove());
143
147
  const r = i.content ?? i.firstElementChild?.content ?? i.body ?? i;
144
148
  Le.forEach((h) => z(r, h, (b) => De(b, r)));
145
- const f = i.firstElementChild?.content || i.content, y = (h) => {
149
+ const f = i.firstElementChild?.content || i.content, g = (h) => {
146
150
  const b = U("<xhtml/>"), T = b.importNode(h, !0);
147
- return b.replaceChild(T, b.documentElement), T.namespaceURI === R && !d(T, "xmlns") && T.setAttribute("xmlns", R), me(T);
151
+ return b.replaceChild(T, b.documentElement), T.namespaceURI === R && !d(T, "xmlns") && T.setAttribute("xmlns", R), ue(T);
148
152
  };
149
153
  if (f) {
150
- const h = $("div");
151
- return [...f.childNodes].map((b) => h.append(b.cloneNode(!0))), y(h);
154
+ const h = C("div");
155
+ return [...f.childNodes].map((b) => h.append(b.cloneNode(!0))), g(h);
152
156
  }
153
- return y(i.documentElement || i.body || i);
157
+ return g(i.documentElement || i.body || i);
154
158
  })(e), x = U(
155
159
  `<xsl:stylesheet version="1.0"
156
160
  xmlns:xsl="${K}"
@@ -189,9 +193,9 @@ function ve(e, l = "xsl:stylesheet") {
189
193
  </xsl:stylesheet>`
190
194
  );
191
195
  o.importStylesheet(n);
192
- const v = o.transformToFragment(g, document), u = (i, r) => i.querySelector(r), w = u(x, 'template[mode="payload"]');
196
+ const v = o.transformToFragment(y, document), u = (i, r) => i.querySelector(r), w = u(x, 'template[mode="payload"]');
193
197
  if (!v)
194
- return console.error("transformation error", { xml: g.outerHTML, xsl: q(n) });
198
+ return console.error("transformation error", { xml: y.outerHTML, xsl: q(n) });
195
199
  if (v.firstElementChild.localName !== "dce-root") {
196
200
  const i = v.ownerDocument.createElement("dce-root");
197
201
  [...v.childNodes].forEach((r) => i.append(r)), v.append(i);
@@ -199,7 +203,7 @@ function ve(e, l = "xsl:stylesheet") {
199
203
  [...v.querySelectorAll("[test]")].forEach((i) => {
200
204
  const r = d(i, "test"), f = r.replace(
201
205
  /hasBoolAttribute\((.*?)\)/g,
202
- (y, h, b, T, M) => {
206
+ (g, h, b, T, M) => {
203
207
  const D = h.substring(1);
204
208
  return `(not($${D} = 'false') and ($${D} = '' or $${D} = '${D}' or $${D} = 'true' ))`;
205
209
  }
@@ -207,24 +211,24 @@ function ve(e, l = "xsl:stylesheet") {
207
211
  r !== f && i.setAttribute("test", f);
208
212
  }), [...v.querySelectorAll("dce-root>attribute")].forEach((i) => {
209
213
  J(i, "namespace,name,select");
210
- const r = ne(i, "xsl:param"), f = d(i, "name");
211
- if (t.push(f), i.childNodes.length && (s[f] = i.textContent), w.append(r), i.hasAttribute("select")) {
214
+ const r = ae(i, "xsl:param"), f = d(i, "name");
215
+ if (t.push(f), i.childNodes.length && (l[f] = i.textContent), w.append(r), i.hasAttribute("select")) {
212
216
  a[f] = d(i, "select"), J(r, "select,name");
213
- let y = d(i, "select").split("??"), h;
214
- if (y?.length > 1) {
217
+ let g = d(i, "select").split("??"), h;
218
+ if (g?.length > 1) {
215
219
  r.removeAttribute("select");
216
220
  const b = u(x, 'template[match="ignore"]>choose').cloneNode(!0);
217
- F(b.firstElementChild).append(L(b, "{" + y[0] + "}")), b.firstElementChild.setAttribute("test", y[0]);
218
- for (let T = 1; T < y.length - 1; T++) {
221
+ F(b.firstElementChild).append(L(b, "{" + g[0] + "}")), b.firstElementChild.setAttribute("test", g[0]);
222
+ for (let T = 1; T < g.length - 1; T++) {
219
223
  const M = b.firstElementChild.cloneNode(!0);
220
- F(M).append(L(b, "{" + y[T] + "}")), M.setAttribute("test", y[T]), b.insertBefore(M, b.lastElementChild);
224
+ F(M).append(L(b, "{" + g[T] + "}")), M.setAttribute("test", g[T]), b.insertBefore(M, b.lastElementChild);
221
225
  }
222
- F(b.lastElementChild).append(L(b, "{" + y[y.length - 1] + "}")), r.append(b), h = b.cloneNode(!0);
226
+ F(b.lastElementChild).append(L(b, "{" + g[g.length - 1] + "}")), r.append(b), h = b.cloneNode(!0);
223
227
  } else
224
- h = ne(i, "xsl:value-of");
228
+ h = ae(i, "xsl:value-of");
225
229
  h.removeAttribute("name"), i.append(h), i.removeAttribute("select");
226
230
  } else
227
- J(r, "name"), r.setAttribute("select", "/datadom/attributes/" + f), s[f] || i.remove();
231
+ J(r, "name"), r.setAttribute("select", "/datadom/attributes/" + f), l[f] || i.remove();
228
232
  }), [...v.querySelectorAll("[value]")].filter((i) => i.getAttribute("value").match(/\{(.*)\?\?(.*)\}/g)).forEach((i) => {
229
233
  const r = d(i, "value");
230
234
  r && i.setAttribute("value", $e(r));
@@ -235,51 +239,51 @@ function ve(e, l = "xsl:stylesheet") {
235
239
  const O = u(x, 'call-template[name="slot"]'), H = (i) => {
236
240
  const r = O.cloneNode(!0), f = d(i, "name");
237
241
  f && r.firstElementChild.setAttribute("select", `'${f}'`);
238
- for (let y of i.childNodes)
239
- r.lastElementChild.append(y);
242
+ for (let g of i.childNodes)
243
+ r.lastElementChild.append(g);
240
244
  return r;
241
245
  };
242
246
  z(w, "slot", (i) => i.parentNode.replaceChild(H(i), i));
243
- const p = ie(x);
244
- return le(p, { declaredAttributes: t, hardcodedAttributes: s, exposedAttributes: a }), p;
247
+ const p = re(x);
248
+ return ne(p, { declaredAttributes: t, hardcodedAttributes: l, exposedAttributes: a }), p;
245
249
  }
246
250
  async function Ee(e) {
247
- return await new Promise((t, s) => {
251
+ return await new Promise((t, l) => {
248
252
  const a = new XMLHttpRequest();
249
253
  a.open("GET", e), a.responseType = "document", a.onload = () => {
250
- a.readyState === a.DONE && a.status === 200 ? t(a.responseXML?.body || a.responseXML || $("div", a.responseText)) : s(`${a.statusText} - ${e}`);
251
- }, a.addEventListener("error", (n) => s(n)), a.send();
254
+ a.readyState === a.DONE && a.status === 200 ? t(a.responseXML?.body || a.responseXML || C("div", a.responseText)) : l(`${a.statusText} - ${e}`);
255
+ }, a.addEventListener("error", (n) => l(n)), a.send();
252
256
  });
253
257
  }
254
- function Ne(e, l, t = !1) {
255
- if (e === l)
258
+ function Ne(e, s, t = !1) {
259
+ if (e === s)
256
260
  return !0;
257
- if (typeof e != "object" || e === null || typeof l != "object" || l === null || Object.keys(e).length !== Object.keys(l).length)
261
+ if (typeof e != "object" || e === null || typeof s != "object" || s === null || Object.keys(e).length !== Object.keys(s).length)
258
262
  return t;
259
- for (let s in e)
260
- if (!(s in l) || !Ne(e[s], l[s]))
263
+ for (let l in e)
264
+ if (!(l in s) || !Ne(e[l], s[l]))
261
265
  return t;
262
266
  return !0;
263
267
  }
264
- const de = (e) => e.split("|").map((l) => l.trim()).filter((l) => l), we = (e, l) => de(l).map((t) => {
265
- let s = e.ownerDocument, a = (n) => (e.append(n), n);
268
+ const pe = (e) => e.split("|").map((s) => s.trim()).filter((s) => s), we = (e, s) => pe(s).map((t) => {
269
+ let l = e.ownerDocument, a = (n) => (e.append(n), n);
266
270
  if (t.includes("/")) {
267
- const n = [], o = s.evaluate(t, e);
268
- for (let g; g = o.iterateNext(); )
269
- n.push(g);
271
+ const n = [], o = l.evaluate(t, e);
272
+ for (let y; y = o.iterateNext(); )
273
+ n.push(y);
270
274
  return n;
271
275
  }
272
- return [...e.childNodes].find((n) => n.localName === t) || a($(t, "", s));
276
+ return [...e.childNodes].find((n) => n.localName === t) || a(C(t, "", l));
273
277
  }).flat();
274
- function re(e, l, t, s) {
278
+ function oe(e, s, t, l) {
275
279
  if (!t.sliceProcessed)
276
- return t.sliceProcessed = 1, we(e, l ?? "").map((a) => {
277
- const n = e.ownerDocument, o = t.sliceEventSource, g = t.sliceElement, x = () => [...a.childNodes].filter((u) => u.nodeType === 3 || u.localName === "value" || u.localName === "form-data").map((u) => u.remove());
280
+ return t.sliceProcessed = 1, we(e, s ?? "").map((a) => {
281
+ const n = e.ownerDocument, o = t.sliceEventSource, y = t.sliceElement, x = () => [...a.childNodes].filter((u) => u.nodeType === 3 || u.localName === "value" || u.localName === "form-data").map((u) => u.remove());
278
282
  o.getAttributeNames().map((u) => a.setAttribute(u, d(o, u))), [...a.childNodes].filter((u) => u.localName === "event").map((u) => u.remove()), "validationMessage" in o && a.setAttribute("validation-message", o.validationMessage), t.type === "init" && x(), a.append(I(t, "event", n));
279
283
  const v = (o.type === "checkbox" || o.type === "radio") && !o.checked;
280
- if (g.hasAttribute("slice-value")) {
284
+ if (y.hasAttribute("slice-value")) {
281
285
  o.value === void 0 ? a.removeAttribute("value") : a.setAttribute("value", o.value);
282
- const u = v ? "" : P(d(g, "slice-value"), a);
286
+ const u = v ? "" : P(d(y, "slice-value"), a);
283
287
  x(), a.append(L(n, u));
284
288
  } else {
285
289
  if ("elements" in o)
@@ -288,130 +292,136 @@ function re(e, l, t, s) {
288
292
  if (x(), u == null)
289
293
  [...a.childNodes].filter((w) => w.localName !== "event").map((w) => w.remove()), a.removeAttribute("value");
290
294
  else {
291
- const w = ye(u) ? L(n, u) : I(u, "value", a.ownerDocument);
295
+ const w = ge(u) ? L(n, u) : I(u, "value", a.ownerDocument);
292
296
  a.append(w), a.setAttribute("value", u);
293
297
  }
294
298
  }
295
299
  return a;
296
300
  });
297
301
  }
298
- function z(e, l, t) {
299
- e.querySelectorAll && [...e.querySelectorAll(l)].forEach(t);
302
+ function z(e, s, t) {
303
+ e.querySelectorAll && [...e.querySelectorAll(s)].forEach(t);
300
304
  }
301
- const Te = async (e, l) => {
305
+ const Te = async (e, s) => {
302
306
  if (!e || !e.trim())
303
- return [l];
307
+ return [s];
304
308
  if (e.startsWith("#"))
305
309
  return ((t) => {
306
- const s = t.querySelectorAll(e);
307
- return [...s.length ? s : t.getRootNode().querySelectorAll(e)];
308
- })(l.parentElement);
310
+ const l = t.querySelectorAll(e);
311
+ return [...l.length ? l : t.getRootNode().querySelectorAll(e)];
312
+ })(s.parentElement);
309
313
  try {
310
- const [t, s] = e.split("#");
314
+ const [t, l] = e.split("#");
311
315
  if (e.charAt(0) === ".")
312
- e = new URL(t, l.closest("[base]")?.getAttribute("base") || location).href;
316
+ e = new URL(t, s.closest("[base]")?.getAttribute("base") || location).href;
313
317
  else
314
318
  try {
315
- e = import.meta.resolve(t), s && (e += "#" + s);
319
+ e = import.meta.resolve(t), l && (e += "#" + l);
316
320
  } catch (n) {
317
321
  console.error(n.message);
318
322
  }
319
323
  const a = await Ee(e);
320
- if (l.setAttributeNS("xml", "base", e), s) {
321
- const n = a.querySelectorAll("#" + s);
322
- return n.length ? [...n] : (console.error("template not found", e + "#" + s), [l]);
324
+ if (s.setAttributeNS("xml", "base", e), l) {
325
+ const n = a.querySelectorAll("#" + l);
326
+ return n.length ? [...n] : (console.error("template not found", e + "#" + l), [s]);
323
327
  }
324
328
  return [a];
325
329
  } catch {
326
- return [l];
330
+ return [s];
327
331
  }
328
332
  };
329
- function pe(e, l) {
333
+ function fe(e, s) {
330
334
  for (let n of e.attributes)
331
335
  try {
332
336
  const o = n.name;
333
- n.namespaceURI ? (!l.hasAttributeNS(n.namespaceURI, o) || l.getAttributeNS(n.namespaceURI, o) !== n.value) && l.setAttributeNS(n.namespaceURI, o, n.value) : (!l.hasAttribute(o) || l.getAttribute(o) !== n.value) && l.setAttribute(n.name, n.value), n.name === "value" && (l.value = n.value);
337
+ if (o.startsWith("xmlns"))
338
+ continue;
339
+ n.namespaceURI ? (!s.hasAttributeNS(n.namespaceURI, o) || s.getAttributeNS(n.namespaceURI, o) !== n.value) && s.setAttributeNS(n.namespaceURI, o, n.value) : (!s.hasAttribute(o) || s.getAttribute(o) !== n.value) && s.setAttribute(n.name, n.value), n.name === "value" && (s.value = n.value);
334
340
  } catch (o) {
335
341
  console.warn("attribute assignment error", o?.message || o);
336
342
  }
337
- const t = l.dceExportedAttributes, s = l.getAttribute("dce-exported-attributes"), a = s ? new Set(s.split(" ")) : null;
338
- for (let n of l.getAttributeNames())
339
- !e.hasAttribute(n) && !t?.has(n) && !a?.has(n) && l.removeAttribute(n);
343
+ const t = s.dceExportedAttributes, l = s.getAttribute("dce-exported-attributes"), a = l ? new Set(l.split(" ")) : null;
344
+ for (let n of s.getAttributeNames())
345
+ !e.hasAttribute(n) && !t?.has(n) && !a?.has(n) && s.removeAttribute(n);
340
346
  }
341
- function fe(e, l = 0) {
347
+ function he(e, s = 0) {
342
348
  const t = {};
343
- for (const s of e.childNodes) {
344
- const a = d(s, "data-dce-id") || s.dceId || 0;
349
+ for (const l of e.childNodes) {
350
+ const a = d(l, "data-dce-id") || l.dceId || 0;
345
351
  if (!t[a])
346
- a ? t[a] = 1 : (t[a] = s.dceId = ++l, s.setAttribute && s.setAttribute("data-dce-id", s.dceId));
352
+ a ? t[a] = 1 : (t[a] = l.dceId = ++s, l.setAttribute && l.setAttribute("data-dce-id", l.dceId));
347
353
  else {
348
- const n = s.dceId = a + "-" + t[a]++;
349
- s.setAttribute && s.setAttribute("data-dce-id", n);
354
+ const n = l.dceId = a + "-" + t[a]++;
355
+ l.setAttribute && l.setAttribute("data-dce-id", n);
350
356
  }
351
- s.childNodes.length && fe(s);
357
+ l.childNodes.length && he(l);
352
358
  }
353
359
  }
354
- function Se(e, l, t) {
360
+ function Se(e, s, t) {
355
361
  t = 1 * t;
356
- for (let s of e.childNodes)
357
- if ((s.dceId ?? s.getAttribute("data-dce-id") * 1) > t)
358
- return e.insertBefore(l, s);
359
- e.append(l);
362
+ for (let l of e.childNodes)
363
+ if ((l.dceId ?? l.getAttribute("data-dce-id") * 1) > t)
364
+ return e.insertBefore(s, l);
365
+ e.append(s);
360
366
  }
361
- function he(e, l) {
362
- if (e.firstElementChild?.localName === "dce-root" && l[0]?.localName !== "dce-root")
367
+ function xe(e, s) {
368
+ if (e.firstElementChild?.localName === "dce-root" && s[0]?.localName !== "dce-root")
363
369
  return;
364
- if (!l.length)
365
- return e.firstElementChild?.localName !== "dce-root" && oe(e);
370
+ if (!s.length)
371
+ return e.firstElementChild?.localName !== "dce-root" && ce(e);
366
372
  const t = {};
367
- for (let s of e.childNodes)
368
- t[s.dceId], se(s) ? (s.data.trim(), t[s.dceId || 0] = s) : t[d(s, "data-dce-id") || 0] = s;
369
- for (let s of [...l]) {
370
- const a = d(s, "data-dce-id") || s.dceId, n = t[a];
371
- n ? (se(s) ? n.nodeValue !== s.nodeValue && (n.nodeValue = s.nodeValue) : (pe(s, n), (n.childNodes.length || s.childNodes.length) && he(n, s.childNodes)), delete t[a]) : Se(e, s, a);
373
+ for (let l of e.childNodes)
374
+ t[l.dceId], se(l) ? (l.data.trim(), t[l.dceId || 0] = l) : t[d(l, "data-dce-id") || 0] = l;
375
+ for (let l of [...s]) {
376
+ const a = d(l, "data-dce-id") || l.dceId, n = t[a];
377
+ n ? (se(l) ? n.nodeValue !== l.nodeValue && (n.nodeValue = l.nodeValue) : (fe(l, n), (n.childNodes.length || l.childNodes.length) && xe(n, l.childNodes)), delete t[a]) : Se(e, l, a);
372
378
  }
373
- for (let s of Object.values(t))
374
- s.localName !== "dce-root" && s.remove();
379
+ for (let l of Object.values(t))
380
+ l.localName !== "dce-root" && l.remove();
375
381
  }
376
- function Ce(e, l) {
377
- return e.hasAttribute(l) || e.setAttribute(l, crypto.randomUUID()), e.getAttribute(l);
382
+ function Ce(e, s) {
383
+ return e.hasAttribute(s) || e.setAttribute(s, crypto.randomUUID()), e.getAttribute(s);
378
384
  }
379
385
  const $e = (e) => [...e?.matchAll(/([^{}]*)(\{)([^}]+)}([^{}]*)/g)].map((t) => `${t[1]}{${Q(t[3])}}${t[4]}`).join(""), Q = (e) => {
380
386
  if (!e.trim())
381
387
  return e;
382
- const l = e.split("??"), t = l.shift(), s = Q(l.join("??"));
383
- return l.length ? `concat( ${t} , substring( ${s} , (1+string-length( ${s} )) * string-length( ${t} ) ) )` : e;
384
- }, P = (e, l) => {
388
+ const s = e.split("??"), t = s.shift(), l = Q(s.join("??"));
389
+ return s.length ? `concat( ${t} , substring( ${l} , (1+string-length( ${l} )) * string-length( ${t} ) ) )` : e;
390
+ }, P = (e, s) => {
385
391
  const t = e.split("??");
386
392
  if (t.length > 1)
387
- return P(t[0], l) || P(t[1], l);
393
+ return P(t[0], s) || P(t[1], s);
388
394
  e = Q(e);
389
- const s = l.ownerDocument.evaluate(e, l);
390
- switch (s.resultType) {
395
+ const l = s.ownerDocument.evaluate(e, s);
396
+ switch (l.resultType) {
391
397
  case XPathResult.NUMBER_TYPE:
392
- return s.numberValue;
398
+ return l.numberValue;
393
399
  case XPathResult.STRING_TYPE:
394
- return s.stringValue;
400
+ return l.stringValue;
395
401
  case XPathResult.BOOLEAN_TYPE:
396
- return s.booleanValue;
402
+ return l.booleanValue;
397
403
  }
398
404
  let a = "";
399
- for (let n; n = s.iterateNext(); )
405
+ for (let n; n = l.iterateNext(); )
400
406
  a += n.textContent;
401
407
  return a;
402
- }, Le = "stylesheet,transform,import,include,strip-space,preserve-space,output,key,decimal-format,namespace-alias,value-of,copy-of,number,apply-templates,apply-imports,for-each,sort,if,choose,when,otherwise,attribute-set,call-template,with-param,variable,param,text,processing-instruction,element,attribute,comment,copy,message,fallback".split(","), De = (e, l) => {
403
- const t = $("xsl:" + e.localName);
404
- for (let s of e.attributes)
405
- t.setAttribute(s.name, s.value);
408
+ }, Le = "stylesheet,transform,import,include,strip-space,preserve-space,output,key,decimal-format,namespace-alias,value-of,copy-of,number,apply-templates,apply-imports,for-each,sort,if,choose,when,otherwise,attribute-set,call-template,with-param,variable,param,text,processing-instruction,element,attribute,comment,copy,message,fallback".split(","), De = (e, s) => {
409
+ const t = C("xsl:" + e.localName);
410
+ for (let a of e.attributes)
411
+ t.setAttribute(a.name, a.value);
406
412
  for (; e.firstChild; )
407
413
  t.append(e.firstChild);
414
+ const l = "if,choose,for-each".includes(e.localName) ? (() => {
415
+ const a = C("span");
416
+ return a.append(t), a;
417
+ })() : t;
408
418
  if (e.parentElement)
409
- e.parentElement.replaceChild(t, e);
419
+ e.parentElement.replaceChild(l, e);
410
420
  else {
411
- const s = e.parentElement || l, a = [...s.childNodes];
412
- a.forEach((n, o) => {
413
- n === e && (a[o] = t);
414
- }), s.replaceChildren(...a);
421
+ const a = e.parentElement || s, n = [...a.childNodes];
422
+ n.forEach((o, y) => {
423
+ o === e && (n[y] = l);
424
+ }), a.replaceChildren(...n);
415
425
  }
416
426
  };
417
427
  class je extends HTMLElement {
@@ -419,13 +429,13 @@ class je extends HTMLElement {
419
429
  async connectedCallback() {
420
430
  this.firstElementChild && this.firstElementChild.localName !== "template" && console.log(`custom-element used without template wrapping content
421
431
  `, this.outerHTML);
422
- const l = await Te(d(this, "src"), this), t = d(this, "tag"), s = t || "dce-" + crypto.randomUUID();
423
- for (const p of l)
432
+ const s = await Te(d(this, "src"), this), t = d(this, "tag"), l = t || "dce-" + crypto.randomUUID();
433
+ for (const p of s)
424
434
  z(p.templateNode || p.content || p, "style", (i) => {
425
435
  const r = i.closest("slot"), f = r ? `slot[name="${r.name}"]` : "";
426
- i.innerHTML = `${s} ${f}{${i.innerHTML}}`, this.append(i);
436
+ i.innerHTML = `${l} ${f}{${i.innerHTML}}`, this.append(i);
427
437
  });
428
- const a = l.map((p) => ve(p)), n = a.map((p, i) => {
438
+ const a = s.map((p) => ve(p)), n = a.map((p, i) => {
429
439
  i = new XSLTProcessor();
430
440
  try {
431
441
  i.importStylesheet(p);
@@ -436,7 +446,7 @@ class je extends HTMLElement {
436
446
  });
437
447
  Object.defineProperty(this, "xsltString", { get: () => a.map((p) => q(p)).join(`
438
448
  `) });
439
- const o = this, g = [...this.templateNode.querySelectorAll("[slice]")], x = g.map((p) => d(p, "slice")).filter((p) => !p.includes("/")).filter((p, i, r) => r.indexOf(p) === i).map(de).flat(), { declaredAttributes: v, hardcodedAttributes: u, exposedAttributes: w } = a[0], ee = /* @__PURE__ */ new Set([...Object.keys(u), ...Object.keys(w)]);
449
+ const o = this, y = [...this.templateNode.querySelectorAll("[slice]")], x = y.map((p) => d(p, "slice")).filter((p) => !p.includes("/")).filter((p, i, r) => r.indexOf(p) === i).map(pe).flat(), { declaredAttributes: v, hardcodedAttributes: u, exposedAttributes: w } = a[0], ee = /* @__PURE__ */ new Set([...Object.keys(u), ...Object.keys(w)]);
440
450
  class O extends HTMLElement {
441
451
  static get observedAttributes() {
442
452
  return v;
@@ -446,29 +456,29 @@ class je extends HTMLElement {
446
456
  return ee;
447
457
  }
448
458
  connectedCallback() {
449
- let i = ae(this.childNodes);
459
+ let i = ie(this.childNodes);
450
460
  if (this.firstElementChild?.tagName === "TEMPLATE") {
451
461
  this.firstElementChild !== this.lastElementChild && console.error("payload should have TEMPLATE as only child", this.outerHTML);
452
462
  const c = this.firstElementChild;
453
- c.remove(), i = ae(c.content.childNodes);
463
+ c.remove(), i = ie(c.content.childNodes);
454
464
  for (const E of i)
455
465
  if (E.localName === "style") {
456
466
  const m = Ce(this, "data-dce-style");
457
- E.innerHTML = `${s}[data-dce-style="${m}"]{${E.innerHTML}}`, c.insertAdjacentElement("beforebegin", E);
467
+ E.innerHTML = `${l}[data-dce-style="${m}"]{${E.innerHTML}}`, c.insertAdjacentElement("beforebegin", E);
458
468
  } else
459
469
  E.nodeType === 1 ? c.insertAdjacentElement("beforebegin", E) : E.nodeType === 3 && c.insertAdjacentText("beforebegin", E.data);
460
470
  }
461
- const r = U("<datadom/>").documentElement, f = (c, E = "") => ((m) => (E && m.append(L(r, E)), m))(r.ownerDocument.createElement(c)), y = B(r, "payload", i, Ae);
462
- ce(y), me(y), this.innerHTML = "";
471
+ const r = U("<datadom/>").documentElement, f = (c, E = "") => ((m) => (E && m.append(L(r, E)), m))(r.ownerDocument.createElement(c)), g = B(r, "payload", i, Ae);
472
+ me(g), ue(g), this.innerHTML = "";
463
473
  const h = B(r, "attributes", this.attributes, (c) => f(c.nodeName, c.value)), b = (c) => this.hasAttribute(c) || [...h.children].find((E) => E.localName === c);
464
- pe(this, h), Object.keys(u).map((c) => b(c) || h.append(f(c, u[c]))), Object.keys(w).map((c) => b(c) || h.append(f(c))), B(r, "dataset", Object.keys(this.dataset), (c) => f(c, this.dataset[c]));
474
+ fe(this, h), Object.keys(u).map((c) => b(c) || h.append(f(c, u[c]))), Object.keys(w).map((c) => b(c) || h.append(f(c))), B(r, "dataset", Object.keys(this.dataset), (c) => f(c, this.dataset[c]));
465
475
  const T = B(r, "slice", x, (c) => f(c, "")), M = (c) => P(c, T);
466
476
  this.xml = r;
467
477
  const D = [], te = () => {
468
478
  const c = {};
469
479
  for (let E; E = D.pop(); ) {
470
480
  const m = d(E.sliceElement, "slice");
471
- c[m] || (re(T, m, E), c[m] = E);
481
+ c[m] || (oe(T, m, E), c[m] = E);
472
482
  }
473
483
  Object.keys(c).length !== 0 && V();
474
484
  };
@@ -490,7 +500,7 @@ class je extends HTMLElement {
490
500
  xml:
491
501
  `, q(r)), _;
492
502
  }).map((A) => {
493
- A && (fe(A), he(this, A.childNodes));
503
+ A && (he(A), xe(this, A.childNodes));
494
504
  });
495
505
  let N = 0;
496
506
  return Object.entries(u).map(([A, S]) => {
@@ -520,9 +530,9 @@ xml:
520
530
  z(this, "[slice],[slice-event]", (m) => {
521
531
  let N = d(m, "slice-event");
522
532
  const A = m.hasAttribute("slice-value") || m.hasAttribute("value") || m.value, S = E(m);
523
- m.dceInitialized || (m.dceInitialized = 1, S.hasAttribute("custom-validity") && (N += " change submit"), [...new Set((N || "change").split(" "))].forEach((_) => S.addEventListener(_, (C) => {
524
- C.sliceElement = m, C.sliceEventSource = C.currentTarget || C.target, C.sliceProcessed = 0;
525
- const xe = re(T, d(C.sliceElement, "slice"), C);
533
+ m.dceInitialized || (m.dceInitialized = 1, S.hasAttribute("custom-validity") && (N += " change submit"), [...new Set((N || "change").split(" "))].forEach((_) => S.addEventListener(_, ($) => {
534
+ $.sliceElement = m, $.sliceEventSource = $.currentTarget || $.target, $.sliceProcessed = 0;
535
+ const be = oe(T, d($.sliceElement, "slice"), $);
526
536
  z(this, "[custom-validity]", (k) => {
527
537
  if (!k.setCustomValidity)
528
538
  return;
@@ -536,11 +546,11 @@ xml:
536
546
  });
537
547
  const Y = d(S, "custom-validity"), j = Y && P(Y, h), G = j === !0 ? "" : j;
538
548
  if (Y) {
539
- if (m.setCustomValidity ? m.setCustomValidity(G) : m.validationMessage = G, xe.map((k) => k.setAttribute("validation-message", G)), C.type === "submit")
540
- return j === !0 ? void 0 : (setTimeout(V, 1), !!j === j ? (j || C.preventDefault(), j) : j ? (C.preventDefault(), !1) : void 0);
549
+ if (m.setCustomValidity ? m.setCustomValidity(G) : m.validationMessage = G, be.map((k) => k.setAttribute("validation-message", G)), $.type === "submit")
550
+ return j === !0 ? void 0 : (setTimeout(V, 1), !!j === j ? (j || $.preventDefault(), j) : j ? ($.preventDefault(), !1) : void 0);
541
551
  setTimeout(V, 1);
542
552
  }
543
- this.onSlice(C);
553
+ this.onSlice($);
544
554
  })), (!N || N.includes("init")) && (A ? this.onSlice({ type: "init", target: S, sliceElement: m, sliceEventSource: S }) : m.value = M(d(m, "slice"))));
545
555
  }), this.#e = 0;
546
556
  };
@@ -549,8 +559,8 @@ xml:
549
559
  #t(i, r) {
550
560
  i === "value" && (this.value = r);
551
561
  const f = this.xml.querySelector("attributes");
552
- let y = this.xml.querySelector(`attributes>${i}`);
553
- y ? F(y).append(L(y, r)) : (y = $(i, r, this.xml), f.append(y)), this.#e || f.setAttribute(i, r), this.dispatchEvent(new CustomEvent("change", { bubbles: !0, detail: { [i]: r } }));
562
+ let g = this.xml.querySelector(`attributes>${i}`);
563
+ g ? F(g).append(L(g, r)) : (g = C(i, r, this.xml), f.append(g)), this.#e || f.setAttribute(i, r), this.dispatchEvent(new CustomEvent("change", { bubbles: !0, detail: { [i]: r } }));
554
564
  }
555
565
  attributeChangedCallback(i, r, f) {
556
566
  !this.xml || this.#e || (this.#t(i, f), this.transform());
@@ -565,7 +575,7 @@ xml:
565
575
  if (t)
566
576
  H(t);
567
577
  else {
568
- const p = s;
578
+ const p = l;
569
579
  this.setAttribute("tag", p), H(p);
570
580
  const i = document.createElement(p);
571
581
  this.getAttributeNames().forEach((r) => i.setAttribute(r, this.getAttribute(r))), i.append(...[...this.childNodes].filter((r) => r.localName !== "style")), this.append(i);
@@ -586,24 +596,24 @@ export {
586
596
  je as C,
587
597
  q as a,
588
598
  ve as b,
589
- ne as c,
599
+ ae as c,
590
600
  Ee as d,
591
601
  Ne as e,
592
602
  we as f,
593
- re as g,
594
- pe as h,
595
- fe as i,
603
+ oe as g,
604
+ fe as h,
605
+ he as i,
596
606
  Se as j,
597
- he as k,
607
+ xe as k,
598
608
  Ce as l,
599
- le as m,
609
+ ne as m,
600
610
  $e as n,
601
611
  I as o,
602
612
  Q as p,
603
613
  P as q,
604
614
  Le as r,
605
- ae as s,
606
- ie as t,
615
+ ie as s,
616
+ re as t,
607
617
  De as u,
608
618
  U as x
609
619
  };