@epa-wg/custom-element-dist 0.0.25 → 0.0.26

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 (304) hide show
  1. package/.storybook/main.ts +1 -3
  2. package/.storybook/preview-head.html +8 -0
  3. package/.storybook/preview.ts +13 -5
  4. package/README.md +4 -4
  5. package/bin/postinstall.sh +3 -2
  6. package/bin/vitest/vitest-browser-importmaps.mjs +20 -0
  7. package/coverage/coverage-final.json +12 -9
  8. package/coverage/index.html +51 -36
  9. package/coverage/src/custom-element/coverage.svg +1 -1
  10. package/coverage/src/custom-element/custom-element.js/coverage.svg +1 -1
  11. package/coverage/src/custom-element/custom-element.js.html +422 -371
  12. package/coverage/src/custom-element/demo/coverage.svg +10 -0
  13. package/coverage/src/custom-element/demo/index.html +116 -0
  14. package/coverage/src/custom-element/demo/z.js/coverage.svg +10 -0
  15. package/coverage/src/custom-element/demo/z.js.html +112 -0
  16. package/coverage/src/custom-element/http-request.js.html +10 -10
  17. package/coverage/src/custom-element/index.html +31 -16
  18. package/coverage/src/custom-element/local-storage.js.html +1 -1
  19. package/coverage/src/custom-element/location-element.js.html +3 -3
  20. package/coverage/src/custom-element/module-url.js/coverage.svg +10 -0
  21. package/coverage/src/custom-element/module-url.js.html +181 -0
  22. package/coverage/src/index.html +1 -1
  23. package/coverage/src/mocks/coverage.svg +1 -1
  24. package/coverage/src/mocks/handlers.ts/coverage.svg +1 -1
  25. package/coverage/src/mocks/handlers.ts.html +36 -12
  26. package/coverage/src/mocks/index.html +19 -19
  27. package/coverage/src/stories/attributes.test.stories.ts.html +6 -9
  28. package/coverage/src/stories/coverage.svg +1 -1
  29. package/coverage/src/stories/css.test.stories.ts.html +1 -1
  30. package/coverage/src/stories/dom-merge.test.stories.ts.html +1 -1
  31. package/coverage/src/stories/external-template.test.stories.ts.html +22 -10
  32. package/coverage/src/stories/form.test.stories.ts.html +1 -1
  33. package/coverage/src/stories/http-request.stories.ts.html +1 -1
  34. package/coverage/src/stories/index.html +34 -19
  35. package/coverage/src/stories/local-storage.test.stories.ts.html +1 -1
  36. package/coverage/src/stories/location-element.test.stories.ts.html +1 -1
  37. package/coverage/src/stories/module-url.test.stories.ts/coverage.svg +10 -0
  38. package/coverage/src/stories/module-url.test.stories.ts.html +634 -0
  39. package/coverage/src/stories/set-url.test.stories.ts.html +1 -1
  40. package/coverage/src/stories/slice-events.test.stories.ts.html +1 -1
  41. package/coverage/src/stories/slots.test.stories.ts.html +1 -1
  42. package/coverage/src/stories/testStoryBook.ts.html +12 -12
  43. package/coverage/src/stories/version-select.test.stories.ts.html +98 -20
  44. package/coverage/src/sum.ts.html +1 -1
  45. package/dist/confused.svg +1 -0
  46. package/dist/custom-element-CckoVsvO.cjs +53 -0
  47. package/dist/{custom-element-DAe7uvIt.js → custom-element-b7c_7Kz4.js} +175 -167
  48. package/dist/custom-element-bundle.cjs +1 -1
  49. package/dist/custom-element-bundle.js +2 -2
  50. package/dist/demo/a.html +60 -0
  51. package/dist/demo/b.html +13 -0
  52. package/dist/demo/confused.svg +38 -0
  53. package/dist/demo/data-slices.html +216 -0
  54. package/dist/demo/dce-social-preview.png +0 -0
  55. package/dist/demo/demo.css +26 -0
  56. package/dist/demo/dom-merge.html +123 -0
  57. package/dist/demo/embed-1.html +2 -0
  58. package/dist/demo/external-template.html +239 -0
  59. package/dist/demo/form.html +239 -0
  60. package/dist/demo/hex-grid-dce.html +183 -0
  61. package/dist/demo/hex-grid-transform.png +0 -0
  62. package/dist/demo/hex-grid.html +66 -0
  63. package/dist/demo/html-template.html +126 -0
  64. package/dist/demo/html-template.xhtml +45 -0
  65. package/dist/demo/html-template.xml +45 -0
  66. package/dist/demo/http-request.html +143 -0
  67. package/dist/demo/lib-dir/Smiley.svg +24 -0
  68. package/dist/demo/lib-dir/embed-lib.html +34 -0
  69. package/dist/demo/local-storage.html +218 -0
  70. package/dist/demo/location-element.html +168 -0
  71. package/dist/demo/logo.png +0 -0
  72. package/dist/demo/module-url.html +215 -0
  73. package/dist/demo/npm-versions-demo.html +105 -0
  74. package/dist/demo/npm-versions.html +65 -0
  75. package/dist/demo/parameters.html +70 -0
  76. package/dist/demo/s.xml +28 -0
  77. package/dist/demo/s.xslt +97 -0
  78. package/dist/demo/s1.xslt +60 -0
  79. package/dist/demo/scoped-css.html +169 -0
  80. package/dist/demo/set-url.html +141 -0
  81. package/dist/demo/ss.html +57 -0
  82. package/dist/demo/table.xml +25 -0
  83. package/dist/demo/table.xsl +293 -0
  84. package/dist/demo/template.xsl +46 -0
  85. package/dist/demo/tree.xml +25 -0
  86. package/dist/demo/tree.xsl +33 -0
  87. package/dist/demo/wc-square.svg +1 -0
  88. package/dist/demo/xhtml-template.xhtml +45 -0
  89. package/dist/demo/z.html +62 -0
  90. package/dist/demo/z.js +9 -0
  91. package/dist/demo/z.xml +60 -0
  92. package/dist/embed-1.html +1 -2
  93. package/dist/mockServiceWorker.js +1 -1
  94. package/package.json +93 -93
  95. package/public/confused.svg +1 -0
  96. package/public/demo/a.html +60 -0
  97. package/public/demo/b.html +13 -0
  98. package/public/demo/confused.svg +38 -0
  99. package/public/demo/data-slices.html +216 -0
  100. package/public/demo/dce-social-preview.png +0 -0
  101. package/public/demo/demo.css +26 -0
  102. package/public/demo/dom-merge.html +123 -0
  103. package/public/demo/embed-1.html +2 -0
  104. package/public/demo/external-template.html +239 -0
  105. package/public/demo/form.html +239 -0
  106. package/public/demo/hex-grid-dce.html +183 -0
  107. package/public/demo/hex-grid-transform.png +0 -0
  108. package/public/demo/hex-grid.html +66 -0
  109. package/public/demo/html-template.html +126 -0
  110. package/public/demo/html-template.xhtml +45 -0
  111. package/public/demo/html-template.xml +45 -0
  112. package/public/demo/http-request.html +143 -0
  113. package/public/demo/lib-dir/Smiley.svg +24 -0
  114. package/public/demo/lib-dir/embed-lib.html +34 -0
  115. package/public/demo/local-storage.html +218 -0
  116. package/public/demo/location-element.html +168 -0
  117. package/public/demo/logo.png +0 -0
  118. package/public/demo/module-url.html +215 -0
  119. package/public/demo/npm-versions-demo.html +105 -0
  120. package/public/demo/npm-versions.html +65 -0
  121. package/public/demo/parameters.html +70 -0
  122. package/public/demo/s.xml +28 -0
  123. package/public/demo/s.xslt +97 -0
  124. package/public/demo/s1.xslt +60 -0
  125. package/public/demo/scoped-css.html +169 -0
  126. package/public/demo/set-url.html +141 -0
  127. package/public/demo/ss.html +57 -0
  128. package/public/demo/table.xml +25 -0
  129. package/public/demo/table.xsl +293 -0
  130. package/public/demo/template.xsl +46 -0
  131. package/public/demo/tree.xml +25 -0
  132. package/public/demo/tree.xsl +33 -0
  133. package/public/demo/wc-square.svg +1 -0
  134. package/public/demo/xhtml-template.xhtml +45 -0
  135. package/public/demo/z.html +62 -0
  136. package/public/demo/z.js +9 -0
  137. package/public/demo/z.xml +60 -0
  138. package/public/embed-1.html +1 -2
  139. package/public/mockServiceWorker.js +1 -1
  140. package/src/custom-element/custom-element.js +36 -19
  141. package/src/custom-element/demo/confused.svg +1 -0
  142. package/src/custom-element/demo/demo.css +5 -1
  143. package/src/custom-element/demo/embed-1.html +1 -2
  144. package/src/custom-element/demo/external-template.html +122 -62
  145. package/src/custom-element/demo/lib-dir/Smiley.svg +24 -0
  146. package/src/custom-element/demo/lib-dir/embed-lib.html +34 -0
  147. package/src/custom-element/demo/module-url.html +215 -0
  148. package/src/custom-element/demo/npm-versions-demo.html +105 -0
  149. package/src/custom-element/demo/npm-versions.html +65 -0
  150. package/src/custom-element/demo/s.xml +27 -35
  151. package/src/custom-element/demo/s.xslt +96 -96
  152. package/src/custom-element/demo/set-url.html +1 -1
  153. package/src/custom-element/demo/z.js +9 -0
  154. package/src/custom-element/ide/customData-dce.json +215 -181
  155. package/src/custom-element/ide/web-types-dce.json +184 -159
  156. package/src/custom-element/ide/web-types-xsl.json +1 -1
  157. package/src/custom-element/index.html +2 -1
  158. package/src/custom-element/module-url.js +33 -0
  159. package/src/mocks/handlers.ts +10 -1
  160. package/src/mocks/versions.mock.ts +786 -0
  161. package/src/stories/attributes.test.stories.ts +0 -1
  162. package/src/stories/external-template.test.stories.ts +11 -7
  163. package/src/stories/module-url.test.stories.ts +183 -0
  164. package/src/stories/version-select.test.stories.ts +38 -12
  165. package/storybook-static/assets/Color-KGDBMAHA-CH-YyWYq.js +1 -0
  166. package/storybook-static/assets/{Configure-D0qG3gR9.js → Configure-DFL_bm2M.js} +2 -2
  167. package/storybook-static/assets/DocsRenderer-PKQXORMH-Bz-_1hmS.js +2 -0
  168. package/storybook-static/assets/{attributes.test.stories-W34tZdUt.js → attributes.test.stories-DIQXccHc.js} +2 -3
  169. package/storybook-static/assets/{css.test.stories-BZFYx1TQ.js → css.test.stories-BV2hi4CY.js} +1 -1
  170. package/storybook-static/assets/custom-element-wn23PUwN.js +231 -0
  171. package/storybook-static/assets/{dom-merge.test.stories-S-7U5N3h.js → dom-merge.test.stories-Dws0C2-g.js} +1 -1
  172. package/storybook-static/assets/{entry-preview-DrgzXgwT.js → entry-preview-BKQ8UCxI.js} +1 -1
  173. package/storybook-static/assets/{entry-preview-docs-Bxv0qQWs.js → entry-preview-docs-BMKNVQXA.js} +2 -2
  174. package/storybook-static/assets/{external-template.test.stories-QIO3lAFz.js → external-template.test.stories-BHO48b0j.js} +19 -16
  175. package/storybook-static/assets/{form.test.stories-ClYhj9F1.js → form.test.stories-dv9mwp24.js} +1 -1
  176. package/storybook-static/assets/handlers-CaCq2ZPF.js +467 -0
  177. package/storybook-static/assets/http-request.stories-B2ke7LtS.js +281 -0
  178. package/storybook-static/assets/iframe-D4Sos1HO.js +2 -0
  179. package/storybook-static/assets/index-BnXBQqj9.js +605 -0
  180. package/storybook-static/assets/index-C8k3Z-3Y.js +28 -0
  181. package/storybook-static/assets/index-Cpxqn5iQ.js +1 -0
  182. package/storybook-static/assets/{index-DXimoRZY.js → index-D-8MO0q_.js} +1 -1
  183. package/storybook-static/assets/index-DGdNYaqV.js +8 -0
  184. package/storybook-static/assets/index-Dz4OaB2k.js +1 -0
  185. package/storybook-static/assets/index-sm7QlJZE.js +1 -0
  186. package/storybook-static/assets/lit-element-DzhCn-8W.js +19 -0
  187. package/storybook-static/assets/{local-storage.test.stories-BqgYwqr-.js → local-storage.test.stories-BpogLNq-.js} +1 -1
  188. package/storybook-static/assets/{location-element.test.stories-DvH1TWK4.js → location-element.test.stories-BiFvBop7.js} +1 -1
  189. package/storybook-static/assets/module-url.test.stories-BXoM34tX.js +208 -0
  190. package/storybook-static/assets/{preview-BKCN0mOr.js → preview-0Jj89qip.js} +1 -1
  191. package/storybook-static/assets/{preview-TCN6m6T-.js → preview-BJPLiuSt.js} +1 -1
  192. package/storybook-static/assets/{preview-BDY5ThwJ.js → preview-BMWqy4Bi.js} +1 -1
  193. package/storybook-static/assets/preview-BnWGZYux.js +1 -0
  194. package/storybook-static/assets/preview-Cg7hXPRq.js +2 -0
  195. package/storybook-static/assets/{preview-BAz7FMXc.js → preview-DB9FwMii.js} +1 -1
  196. package/storybook-static/assets/preview-Djh1_Tal.js +20 -0
  197. package/storybook-static/assets/{preview-DRnyIGXK.js → preview-oHxXRSIu.js} +15 -15
  198. package/storybook-static/assets/{set-url.test.stories-GlJOh31I.js → set-url.test.stories-Cg5Z0r7x.js} +1 -1
  199. package/storybook-static/assets/{slice-events.test.stories-VoNjuPCX.js → slice-events.test.stories-D_ttGp3g.js} +1 -1
  200. package/storybook-static/assets/{slots.test.stories-Da2j9YuO.js → slots.test.stories-DBNXOm0T.js} +1 -1
  201. package/storybook-static/assets/version-select.test.stories-CgV3UCim.js +109 -0
  202. package/storybook-static/confused.svg +1 -0
  203. package/storybook-static/demo/a.html +60 -0
  204. package/storybook-static/demo/b.html +13 -0
  205. package/storybook-static/demo/confused.svg +38 -0
  206. package/storybook-static/demo/data-slices.html +216 -0
  207. package/storybook-static/demo/dce-social-preview.png +0 -0
  208. package/storybook-static/demo/demo.css +26 -0
  209. package/storybook-static/demo/dom-merge.html +123 -0
  210. package/storybook-static/demo/embed-1.html +2 -0
  211. package/storybook-static/demo/external-template.html +239 -0
  212. package/storybook-static/demo/form.html +239 -0
  213. package/storybook-static/demo/hex-grid-dce.html +183 -0
  214. package/storybook-static/demo/hex-grid-transform.png +0 -0
  215. package/storybook-static/demo/hex-grid.html +66 -0
  216. package/storybook-static/demo/html-template.html +126 -0
  217. package/storybook-static/demo/html-template.xhtml +45 -0
  218. package/storybook-static/demo/html-template.xml +45 -0
  219. package/storybook-static/demo/http-request.html +143 -0
  220. package/storybook-static/demo/lib-dir/Smiley.svg +24 -0
  221. package/storybook-static/demo/lib-dir/embed-lib.html +34 -0
  222. package/storybook-static/demo/local-storage.html +218 -0
  223. package/storybook-static/demo/location-element.html +168 -0
  224. package/storybook-static/demo/logo.png +0 -0
  225. package/storybook-static/demo/module-url.html +215 -0
  226. package/storybook-static/demo/npm-versions-demo.html +105 -0
  227. package/storybook-static/demo/npm-versions.html +65 -0
  228. package/storybook-static/demo/parameters.html +70 -0
  229. package/storybook-static/demo/s.xml +28 -0
  230. package/storybook-static/demo/s.xslt +97 -0
  231. package/storybook-static/demo/s1.xslt +60 -0
  232. package/storybook-static/demo/scoped-css.html +169 -0
  233. package/storybook-static/demo/set-url.html +141 -0
  234. package/storybook-static/demo/ss.html +57 -0
  235. package/storybook-static/demo/table.xml +25 -0
  236. package/storybook-static/demo/table.xsl +293 -0
  237. package/storybook-static/demo/template.xsl +46 -0
  238. package/storybook-static/demo/tree.xml +25 -0
  239. package/storybook-static/demo/tree.xsl +33 -0
  240. package/storybook-static/demo/wc-square.svg +1 -0
  241. package/storybook-static/demo/xhtml-template.xhtml +45 -0
  242. package/storybook-static/demo/z.html +62 -0
  243. package/storybook-static/demo/z.js +9 -0
  244. package/storybook-static/demo/z.xml +60 -0
  245. package/storybook-static/embed-1.html +1 -2
  246. package/storybook-static/favicon.svg +1 -7
  247. package/storybook-static/iframe.html +42 -30
  248. package/storybook-static/index.html +36 -18
  249. package/storybook-static/index.json +1 -1
  250. package/storybook-static/mockServiceWorker.js +1 -1
  251. package/storybook-static/nunito-sans-bold-italic.woff2 +0 -0
  252. package/storybook-static/nunito-sans-bold.woff2 +0 -0
  253. package/storybook-static/nunito-sans-italic.woff2 +0 -0
  254. package/storybook-static/nunito-sans-regular.woff2 +0 -0
  255. package/storybook-static/project.json +1 -1
  256. package/storybook-static/sb-addons/chromatic-com-storybook-9/manager-bundle.js +32 -32
  257. package/storybook-static/sb-addons/chromatic-com-storybook-9/manager-bundle.js.LEGAL.txt +1 -1
  258. package/storybook-static/sb-addons/essentials-actions-3/manager-bundle.js +1 -1
  259. package/storybook-static/sb-addons/essentials-controls-2/manager-bundle.js +395 -43
  260. package/storybook-static/sb-addons/essentials-controls-2/manager-bundle.js.LEGAL.txt +0 -18
  261. package/storybook-static/sb-addons/essentials-viewport-5/manager-bundle.js +1 -1
  262. package/storybook-static/sb-addons/interactions-10/manager-bundle.js +221 -22
  263. package/storybook-static/sb-addons/storybook-core-core-server-presets-0/common-manager-bundle.js +3 -0
  264. package/storybook-static/sb-common-assets/favicon.svg +1 -0
  265. package/storybook-static/sb-manager/globals-module-info.js +995 -1
  266. package/storybook-static/sb-manager/globals-runtime.js +53525 -1
  267. package/storybook-static/sb-manager/globals.js +48 -1
  268. package/storybook-static/sb-manager/runtime.js +11884 -1
  269. package/storybook-static/sb-preview/globals.js +33 -1
  270. package/storybook-static/sb-preview/runtime.js +9437 -108
  271. package/vite.config.js +2 -1
  272. package/dist/custom-element-DZvvhscI.cjs +0 -53
  273. package/storybook-static/assets/Color-PRSJMWNM-CRSv4C7i.js +0 -1
  274. package/storybook-static/assets/DocsRenderer-K4EAMTCU-CG_P5zRZ.js +0 -2
  275. package/storybook-static/assets/WithTooltip-KJL26V4Q-CUqUi5E8.js +0 -1
  276. package/storybook-static/assets/custom-element-DpIq8E2p.js +0 -219
  277. package/storybook-static/assets/formatter-2WMMO6ZP-C-UiBIma.js +0 -58
  278. package/storybook-static/assets/http-request.stories-DCqY5s2i.js +0 -300
  279. package/storybook-static/assets/iframe-CURpvmVV.js +0 -2
  280. package/storybook-static/assets/index-CKw1EbdP.js +0 -1
  281. package/storybook-static/assets/index-CVRyq5ci.js +0 -27
  282. package/storybook-static/assets/index-Cc7K62zD.js +0 -3
  283. package/storybook-static/assets/index-DYpTqTNu.js +0 -1
  284. package/storybook-static/assets/index-DsWii_Ep.js +0 -548
  285. package/storybook-static/assets/index-DuIEV_9C.js +0 -13
  286. package/storybook-static/assets/lit-element-CenEXOuS.js +0 -19
  287. package/storybook-static/assets/preview-B4GcaC1c.js +0 -1
  288. package/storybook-static/assets/preview-B63p-W8V.js +0 -20
  289. package/storybook-static/assets/preview-DjDbQHPa.js +0 -2
  290. package/storybook-static/assets/syntaxhighlighter-BP7B2CQK-CDpEe51g.js +0 -1
  291. package/storybook-static/assets/version-select.test.stories-DLwf-TPB.js +0 -60
  292. package/storybook-static/sb-addons/storybook-core-server-presets-0/common-manager-bundle.js +0 -3
  293. package/storybook-static/sb-common-assets/fonts.css +0 -31
  294. package/storybook-static/sb-manager/WithTooltip-KJL26V4Q-5LS5AN27.js +0 -1
  295. package/storybook-static/sb-manager/chunk-B3YDJJJH.js +0 -347
  296. package/storybook-static/sb-manager/chunk-BLWCBWKL.js +0 -9
  297. package/storybook-static/sb-manager/chunk-GUVK2GTO.js +0 -6
  298. package/storybook-static/sb-manager/chunk-LFRML3ZV.js +0 -186
  299. package/storybook-static/sb-manager/chunk-MC7RAF2B.js +0 -274
  300. package/storybook-static/sb-manager/chunk-ZR5JZWHI.js +0 -1
  301. package/storybook-static/sb-manager/formatter-2WMMO6ZP-JI7RHVTW.js +0 -58
  302. package/storybook-static/sb-manager/index.js +0 -1
  303. package/storybook-static/sb-manager/syntaxhighlighter-BP7B2CQK-WOJYHKQR.js +0 -1
  304. /package/storybook-static/sb-addons/{storybook-core-server-presets-0 → storybook-core-core-server-presets-0}/common-manager-bundle.js.LEGAL.txt +0 -0
@@ -1,12 +1,12 @@
1
- const B = "http://www.w3.org/1999/XSL/Transform", q = "http://www.w3.org/1999/xhtml", ie = "http://exslt.org/common", x = (e, l) => e.getAttribute?.(l), Y = (e) => e.nodeType === 3, re = (e) => typeof e == "string", oe = (e) => e && typeof e.nodeType == "number", S = (e, l) => (e.ownerDocument || e).createTextNode(l), K = (e) => {
1
+ const B = "http://www.w3.org/1999/XSL/Transform", q = "http://www.w3.org/1999/xhtml", ie = "http://exslt.org/common", x = (e, l) => e.getAttribute?.(l), Y = (e) => e.nodeType === 3, oe = (e) => typeof e == "string", re = (e) => e && typeof e.nodeType == "number", S = (e, l) => (e.ownerDocument || e).createTextNode(l), K = (e) => {
2
2
  for (; e.firstChild; ) e.firstChild.remove();
3
3
  return e;
4
- }, U = (e) => (e.getAttributeNames().map((l) => e.removeAttribute(l)), K(e)), Q = (e) => (e?.setAttribute("xmlns:xsl", B), e), ee = (e) => (e?.setAttribute("xmlns:xhtml", q), Q(e)), te = (e) => /^[_a-zA-Z][-_:a-zA-Z0-9]*$/.test(e), A = (e, l = "", t = document) => {
5
- const s = (a) => ((o) => (l && o.append(S(t.ownerDocument || t, l)), o))((t.ownerDocument || t).createElement(a));
4
+ }, U = (e) => (e.getAttributeNames().map((l) => e.removeAttribute(l)), K(e)), Q = (e) => (e?.setAttribute("xmlns:xsl", B), e), ee = (e) => (e?.setAttribute("xmlns:xhtml", q), Q(e)), te = (e) => /^[_a-zA-Z][-_:a-zA-Z0-9]*$/.test(e), N = (e, l = "", t = document) => {
5
+ const s = (n) => ((r) => (l && r.append(S(t.ownerDocument || t, l)), r))((t.ownerDocument || t).createElement(n));
6
6
  if (te(e))
7
7
  return s(e);
8
- const n = s("dce-object");
9
- return n.setAttribute("dce-object-name", e), n;
8
+ const a = s("dce-object");
9
+ return a.setAttribute("dce-object-name", e), a;
10
10
  }, G = (e, l) => {
11
11
  const t = e.ownerDocument.createElementNS(e.namespaceURI, l);
12
12
  for (let s of e.attributes)
@@ -22,44 +22,44 @@ function H(e) {
22
22
  return new XMLSerializer().serializeToString(e);
23
23
  }
24
24
  function X(e, l, t, s) {
25
- const n = (h) => e.ownerDocument.createElement(h), o = ((h, p, m) => (p.append(m = n(h)), m))(l, e);
26
- return [...t].forEach((h) => o.append(s(h))), o;
25
+ const a = (h) => e.ownerDocument.createElement(h), r = ((h, p, u) => (p.append(u = a(h)), u))(l, e);
26
+ return [...t].forEach((h) => r.append(s(h))), r;
27
27
  }
28
28
  function ce(e) {
29
- return e.slot || (e.setAttribute || (e = A("span", e.textContent.replaceAll(`
29
+ return e.slot || (e.setAttribute || (e = N("span", e.textContent.replaceAll(`
30
30
  `, ""))), e.setAttribute("slot", "")), e;
31
31
  }
32
- function D(e, l, t) {
32
+ function $(e, l, t) {
33
33
  const s = typeof e;
34
34
  if (s === "string")
35
- return A(l, e, t);
35
+ return N(l, e, t);
36
36
  if (s === "number")
37
- return A(l, "" + e, t);
37
+ return N(l, "" + e, t);
38
38
  if (e instanceof Array) {
39
- const a = A("array", "", t);
40
- return e.map((o) => a.append(D(o, l, t))), a;
39
+ const n = N("array", "", t);
40
+ return e.map((r) => n.append($(r, l, t))), n;
41
41
  }
42
42
  if (e instanceof FormData) {
43
- const a = A("form-data", "", t);
44
- for (const o of e)
45
- a.append(D(o[1], o[0], t));
46
- return a;
43
+ const n = N("form-data", "", t);
44
+ for (const r of e)
45
+ n.append($(r[1], r[0], t));
46
+ return n;
47
47
  }
48
- const n = A(l, "", t);
49
- for (let a in e)
50
- oe(e[a]) || typeof e[a] == "function" || e[a] instanceof Window || (typeof e[a] != "object" && te(a) ? n.setAttribute(a, e[a]) : n.append(D(e[a], a, t)));
51
- return n;
48
+ const a = N(l, "", t);
49
+ for (let n in e)
50
+ re(e[n]) || typeof e[n] == "function" || e[n] instanceof Window || (typeof e[n] != "object" && te(n) ? a.setAttribute(n, e[n]) : a.append($(e[n], n, t)));
51
+ return a;
52
52
  }
53
53
  function Z(e) {
54
54
  if (C(e, "*", (l) => [...l.childNodes].filter((t) => t.nodeType === 3 && t.parentNode.localName !== "style" && t.data).forEach((t) => {
55
- const s = t.data, n = s.matchAll(/{([^}]*)}/g);
56
- if (n) {
57
- let a = 0, o = (p) => S(t, p), h = [];
58
- if ([...n].forEach((p) => {
59
- p.index > a && h.push(o(p.input.substring(a, p.index)));
60
- const m = e.querySelector("value-of").cloneNode();
61
- m.setAttribute("select", p[1]), h.push(m), a = p.index + p[0].length;
62
- }), a < s.length && h.push(o(s.substring(a, s.length))), h.length) {
55
+ const s = t.data, a = s.matchAll(/{([^}]*)}/g);
56
+ if (a) {
57
+ let n = 0, r = (p) => S(t, p), h = [];
58
+ if ([...a].forEach((p) => {
59
+ p.index > n && h.push(r(p.input.substring(n, p.index)));
60
+ const u = e.querySelector("value-of").cloneNode();
61
+ u.setAttribute("select", p[1]), h.push(u), n = p.index + p[0].length;
62
+ }), n < s.length && h.push(r(s.substring(n, s.length))), h.length) {
63
63
  for (let p of h)
64
64
  l.insertBefore(p, t);
65
65
  l.removeChild(t);
@@ -88,20 +88,20 @@ function me(e, l = "xsl:stylesheet") {
88
88
  <xsl:template mode="sanitize" match="text()"><dce-text><xsl:copy/></dce-text></xsl:template>
89
89
  <xsl:template mode="sanitize" match="xsl:value-of|*[name()='slot']"><dce-text><xsl:copy><xsl:apply-templates mode="sanitize" select="*|@*|text()"/></xsl:copy></dce-text></xsl:template>
90
90
  <xsl:template mode="sanitize" match="xhtml:*"><xsl:element name="{local-name()}"><xsl:apply-templates mode="sanitize" select="*|@*|text()"/></xsl:element></xsl:template>
91
- </xsl:stylesheet>`), s = new XSLTProcessor(), n = ((i) => {
92
- C(i, "script", (b) => b.remove());
91
+ </xsl:stylesheet>`), s = new XSLTProcessor(), a = ((i) => {
92
+ C(i, "script", (y) => y.remove());
93
93
  const c = i.content ?? i.firstElementChild?.content ?? i.body ?? i;
94
- ve.forEach((b) => C(c, b, (v) => ge(v, c)));
95
- const E = i.firstElementChild?.content || i.content, g = (b) => {
96
- const v = M("<xhtml/>"), $ = v.importNode(b, !0);
97
- return v.replaceChild($, v.documentElement), ee($);
94
+ ve.forEach((y) => C(c, y, (v) => ge(v, c)));
95
+ const E = i.firstElementChild?.content || i.content, g = (y) => {
96
+ const v = M("<xhtml/>"), D = v.importNode(y, !0);
97
+ return v.replaceChild(D, v.documentElement), ee(D);
98
98
  };
99
99
  if (E) {
100
- const b = A("div");
101
- return [...E.childNodes].map((v) => b.append(v.cloneNode(!0))), g(b);
100
+ const y = N("div");
101
+ return [...E.childNodes].map((v) => y.append(v.cloneNode(!0))), g(y);
102
102
  }
103
103
  return g(i.documentElement || i.body || i);
104
- })(e), a = M(
104
+ })(e), n = M(
105
105
  `<xsl:stylesheet version="1.0"
106
106
  xmlns:xsl="${B}"
107
107
  xmlns:xhtml="${q}"
@@ -139,31 +139,31 @@ function me(e, l = "xsl:stylesheet") {
139
139
  </xsl:stylesheet>`
140
140
  );
141
141
  s.importStylesheet(t);
142
- const o = s.transformToFragment(n, document), h = (i, c) => i.querySelector(c), p = h(a, 'template[mode="payload"]');
143
- if (!o)
144
- return console.error("transformation error", { xml: n.outerHTML, xsl: H(t) });
145
- const m = [];
146
- [...o.querySelectorAll("dce-root>attribute")].forEach((i) => {
142
+ const r = s.transformToFragment(a, document), h = (i, c) => i.querySelector(c), p = h(n, 'template[mode="payload"]');
143
+ if (!r)
144
+ return console.error("transformation error", { xml: a.outerHTML, xsl: H(t) });
145
+ const u = [];
146
+ [...r.querySelectorAll("dce-root>attribute")].forEach((i) => {
147
147
  const c = G(i, "xsl:param"), E = x(i, "name");
148
148
  p.append(c);
149
149
  let g = x(c, "select")?.split("??");
150
150
  g || (g = ["//" + E, `'${c.textContent}'`], U(c), c.setAttribute("name", E));
151
- let b;
151
+ let y;
152
152
  if (g?.length > 1) {
153
153
  c.removeAttribute("select");
154
- const v = h(a, 'template[match="ignore"]>choose').cloneNode(!0);
155
- U(v.firstElementChild).append(S(v, "{" + g[0] + "}")), U(v.lastElementChild).append(S(v, "{" + g[1] + "}")), v.firstElementChild.setAttribute("test", g[0]), c.append(v), b = v.cloneNode(!0);
154
+ const v = h(n, 'template[match="ignore"]>choose').cloneNode(!0);
155
+ U(v.firstElementChild).append(S(v, "{" + g[0] + "}")), U(v.lastElementChild).append(S(v, "{" + g[1] + "}")), v.firstElementChild.setAttribute("test", g[0]), c.append(v), y = v.cloneNode(!0);
156
156
  } else
157
- b = G(i, "xsl:value-of");
158
- b.removeAttribute("name"), i.append(b), i.removeAttribute("select"), m.push(c);
159
- }), [...o.querySelectorAll("[value]")].filter((i) => i.getAttribute("value").match(/\{(.*)\?\?(.*)\}/g)).forEach((i) => {
157
+ y = G(i, "xsl:value-of");
158
+ y.removeAttribute("name"), i.append(y), i.removeAttribute("select"), u.push(c);
159
+ }), [...r.querySelectorAll("[value]")].filter((i) => i.getAttribute("value").match(/\{(.*)\?\?(.*)\}/g)).forEach((i) => {
160
160
  const c = x(i, "value");
161
- c && i.setAttribute("value", be(c));
161
+ c && i.setAttribute("value", ye(c));
162
162
  });
163
- for (const i of o.childNodes)
164
- p.append(a.importNode(i, !0));
165
- [...p.querySelectorAll("template")].forEach((i) => p.ownerDocument.documentElement.append(i));
166
- const P = h(a, 'call-template[name="slot"]'), d = (i) => {
163
+ for (const i of r.childNodes)
164
+ p.append(n.importNode(i, !0));
165
+ [...p.getElementsByTagName("xsl:template")].forEach((i) => p.ownerDocument.documentElement.append(i));
166
+ const P = h(n, 'call-template[name="slot"]'), d = (i) => {
167
167
  const c = P.cloneNode(!0), E = x(i, "name");
168
168
  E && c.firstElementChild.setAttribute("select", `'${E}'`);
169
169
  for (let g of i.childNodes)
@@ -171,15 +171,15 @@ function me(e, l = "xsl:stylesheet") {
171
171
  return c;
172
172
  };
173
173
  C(p, "slot", (i) => i.parentNode.replaceChild(d(i), i));
174
- const u = Z(a);
175
- return u.params = m, u;
174
+ const m = Z(n);
175
+ return m.params = u, m;
176
176
  }
177
177
  async function ue(e) {
178
178
  return await new Promise((t, s) => {
179
- const n = new XMLHttpRequest();
180
- n.open("GET", e), n.responseType = "document", n.onload = () => {
181
- n.readyState === n.DONE && n.status === 200 && t(n.responseXML || A("div", n.responseText)), s(n.statusText);
182
- }, n.addEventListener("error", (a) => s(a)), n.send();
179
+ const a = new XMLHttpRequest();
180
+ a.open("GET", e), a.responseType = "document", a.onload = () => {
181
+ a.readyState === a.DONE && a.status === 200 ? t(a.responseXML?.body || a.responseXML || N("div", a.responseText)) : s(`${a.statusText} - ${e}`);
182
+ }, a.addEventListener("error", (n) => s(n)), a.send();
183
183
  });
184
184
  }
185
185
  function de(e, l, t = !1) {
@@ -193,30 +193,30 @@ function de(e, l, t = !1) {
193
193
  return !0;
194
194
  }
195
195
  const se = (e) => e.split("|").map((l) => l.trim()).filter((l) => l), pe = (e, l) => se(l).map((t) => {
196
- let s = e.ownerDocument, n = (a) => (e.append(a), a);
196
+ let s = e.ownerDocument, a = (n) => (e.append(n), n);
197
197
  if (t.includes("/")) {
198
- const a = [], o = s.evaluate(t, e);
199
- for (let h; h = o.iterateNext(); )
200
- a.push(h);
201
- return a;
198
+ const n = [], r = s.evaluate(t, e);
199
+ for (let h; h = r.iterateNext(); )
200
+ n.push(h);
201
+ return n;
202
202
  }
203
- return [...e.childNodes].find((a) => a.localName === t) || n(A(t, "", s));
203
+ return [...e.childNodes].find((n) => n.localName === t) || a(N(t, "", s));
204
204
  }).flat();
205
205
  function J(e, l, t, s) {
206
206
  if (!t.sliceProcessed)
207
- return t.sliceProcessed = 1, pe(e, l ?? "").map((n) => {
208
- const a = e.ownerDocument, o = t.sliceEventSource, h = t.sliceElement, p = () => [...n.childNodes].filter((m) => m.nodeType === 3 || m.localName === "value" || m.localName === "form-data").map((m) => m.remove());
209
- if (o.getAttributeNames().map((m) => n.setAttribute(m, x(o, m))), [...n.childNodes].filter((m) => m.localName === "event").map((m) => m.remove()), "validationMessage" in o && n.setAttribute("validation-message", o.validationMessage), t.type === "init" && p(), n.append(D(t, "event", a)), h.hasAttribute("slice-value")) {
210
- o.value === void 0 ? n.removeAttribute("value") : n.setAttribute("value", o.value);
211
- const m = L(x(h, "slice-value"), n);
212
- p(), n.append(S(a, m));
207
+ return t.sliceProcessed = 1, pe(e, l ?? "").map((a) => {
208
+ const n = e.ownerDocument, r = t.sliceEventSource, h = t.sliceElement, p = () => [...a.childNodes].filter((u) => u.nodeType === 3 || u.localName === "value" || u.localName === "form-data").map((u) => u.remove());
209
+ if (r.getAttributeNames().map((u) => a.setAttribute(u, x(r, u))), [...a.childNodes].filter((u) => u.localName === "event").map((u) => u.remove()), "validationMessage" in r && a.setAttribute("validation-message", r.validationMessage), t.type === "init" && p(), a.append($(t, "event", n)), h.hasAttribute("slice-value")) {
210
+ r.value === void 0 ? a.removeAttribute("value") : a.setAttribute("value", r.value);
211
+ const u = L(x(h, "slice-value"), a);
212
+ p(), a.append(S(n, u));
213
213
  } else {
214
- if ("elements" in o)
215
- return p(), n.append(D(new FormData(o), "value", n.ownerDocument)), n;
216
- const m = o.value ?? x(h, "value");
217
- p(), m == null ? [...n.childNodes].filter((w) => w.localName !== "event").map((w) => w.remove()) : re(m) ? n.append(S(a, m)) : n.append(D(m, "value", n.ownerDocument));
214
+ if ("elements" in r)
215
+ return p(), a.append($(new FormData(r), "value", a.ownerDocument)), a;
216
+ const u = r.value ?? x(r, "value");
217
+ p(), u == null ? [...a.childNodes].filter((w) => w.localName !== "event").map((w) => w.remove()) : oe(u) ? a.append(S(n, u)) : a.append($(u, "value", a.ownerDocument));
218
218
  }
219
- return n;
219
+ return a;
220
220
  });
221
221
  }
222
222
  function C(e, l, t) {
@@ -227,20 +227,25 @@ const fe = async (e, l) => {
227
227
  return [l];
228
228
  if (e.startsWith("#"))
229
229
  return ((t) => {
230
- if (!t) return [];
231
230
  const s = t.querySelectorAll(e);
232
- if (s.length)
233
- return [...s];
234
- const n = t.getRootNode();
235
- return n === t ? [] : getByHashId(n);
231
+ return [...s.length ? s : t.getRootNode().querySelectorAll(e)];
236
232
  })(l.parentElement);
237
233
  try {
238
- const t = await ue(e), s = new URL(e, location).hash;
239
- if (s) {
240
- const n = t.querySelectorAll(s);
234
+ const [t, s] = e.split("#");
235
+ if (e.charAt(0) === ".")
236
+ e = new URL(t, l.closest("[base]")?.getAttribute("base") || location).href;
237
+ else
238
+ try {
239
+ e = import.meta.resolve(t), s && (e += "#" + s);
240
+ } catch (n) {
241
+ console.error(n.message);
242
+ }
243
+ const a = await ue(e);
244
+ if (l.setAttributeNS("xml", "base", e), s) {
245
+ const n = a.querySelectorAll("#" + s);
241
246
  return n.length ? [...n] : [l];
242
247
  }
243
- return [t];
248
+ return [a];
244
249
  } catch {
245
250
  return [l];
246
251
  }
@@ -252,12 +257,12 @@ function he(e, l) {
252
257
  function le(e, l = 0) {
253
258
  const t = {};
254
259
  for (const s of e.childNodes) {
255
- const n = x(s, "data-dce-id") || s.dceId || 0;
256
- if (!t[n])
257
- n ? t[n] = 1 : (t[n] = s.dceId = ++l, s.setAttribute && s.setAttribute("data-dce-id", s.dceId));
260
+ const a = x(s, "data-dce-id") || s.dceId || 0;
261
+ if (!t[a])
262
+ a ? t[a] = 1 : (t[a] = s.dceId = ++l, s.setAttribute && s.setAttribute("data-dce-id", s.dceId));
258
263
  else {
259
- const a = s.dceId = n + "-" + t[n]++;
260
- s.setAttribute && s.setAttribute("data-dce-id", a);
264
+ const n = s.dceId = a + "-" + t[a]++;
265
+ s.setAttribute && s.setAttribute("data-dce-id", n);
261
266
  }
262
267
  s.childNodes.length && le(s);
263
268
  }
@@ -269,23 +274,25 @@ function xe(e, l, t) {
269
274
  return e.insertBefore(l, s);
270
275
  e.append(l);
271
276
  }
272
- function ne(e, l) {
277
+ function ae(e, l) {
278
+ if (e.firstElementChild?.localName === "dce-root" && l[0].localName !== "dce-root")
279
+ return;
273
280
  if (!l.length)
274
- return K(e);
281
+ return e.firstElementChild?.localName !== "dce-root" && K(e);
275
282
  const t = {};
276
283
  for (let s of e.childNodes)
277
284
  t[s.dceId], Y(s) ? (s.data.trim(), t[s.dceId || 0] = s) : t[x(s, "data-dce-id") || 0] = s;
278
285
  for (let s of [...l]) {
279
- const n = x(s, "data-dce-id") || s.dceId, a = t[n];
280
- a ? (Y(s) ? a.nodeValue !== s.nodeValue && (a.nodeValue = s.nodeValue) : (he(s, a), (a.childNodes.length || s.childNodes.length) && ne(a, s.childNodes)), delete t[n]) : xe(e, s, n);
286
+ const a = x(s, "data-dce-id") || s.dceId, n = t[a];
287
+ n ? (Y(s) ? n.nodeValue !== s.nodeValue && (n.nodeValue = s.nodeValue) : (he(s, n), (n.childNodes.length || s.childNodes.length) && ae(n, s.childNodes)), delete t[a]) : xe(e, s, a);
281
288
  }
282
289
  for (let s of Object.values(t))
283
- s.remove();
290
+ s.localName !== "dce-root" && s.remove();
284
291
  }
285
- function ye(e, l) {
292
+ function be(e, l) {
286
293
  return e.hasAttribute(l) || e.setAttribute(l, crypto.randomUUID()), e.getAttribute(l);
287
294
  }
288
- const be = (e) => [...e?.matchAll(/([^{}]*)(\{)([^}]+)}([^{}]*)/g)].map((t) => `${t[1]}{${F(t[3])}}${t[4]}`).join(""), F = (e) => {
295
+ const ye = (e) => [...e?.matchAll(/([^{}]*)(\{)([^}]+)}([^{}]*)/g)].map((t) => `${t[1]}{${F(t[3])}}${t[4]}`).join(""), F = (e) => {
289
296
  if (!e.trim())
290
297
  return e;
291
298
  const l = e.split("??"), t = l.shift(), s = F(l.join("??"));
@@ -304,12 +311,12 @@ const be = (e) => [...e?.matchAll(/([^{}]*)(\{)([^}]+)}([^{}]*)/g)].map((t) => `
304
311
  case XPathResult.BOOLEAN_TYPE:
305
312
  return s.booleanValue;
306
313
  }
307
- let n = "";
308
- for (let a; a = s.iterateNext(); )
309
- n += a.textContent;
310
- return n;
311
- }, ve = "stylesheet,transform,import,include,strip-space,preserve-space,output,key,decimal-format,namespace-alias,template,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(","), ge = (e, l) => {
312
- const t = A("xsl:" + e.localName);
314
+ let a = "";
315
+ for (let n; n = s.iterateNext(); )
316
+ a += n.textContent;
317
+ return a;
318
+ }, ve = "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(","), ge = (e, l) => {
319
+ const t = N("xsl:" + e.localName);
313
320
  for (let s of e.attributes)
314
321
  t.setAttribute(s.name, s.value);
315
322
  for (; e.firstChild; )
@@ -317,10 +324,10 @@ const be = (e) => [...e?.matchAll(/([^{}]*)(\{)([^}]+)}([^{}]*)/g)].map((t) => `
317
324
  if (e.parentElement)
318
325
  e.parentElement.replaceChild(t, e);
319
326
  else {
320
- const s = e.parentElement || l, n = [...s.childNodes];
321
- n.forEach((a, o) => {
322
- a === e && (n[o] = t);
323
- }), s.replaceChildren(...n);
327
+ const s = e.parentElement || l, a = [...s.childNodes];
328
+ a.forEach((n, r) => {
329
+ n === e && (a[r] = t);
330
+ }), s.replaceChildren(...a);
324
331
  }
325
332
  };
326
333
  class Ee extends HTMLElement {
@@ -328,73 +335,73 @@ class Ee extends HTMLElement {
328
335
  async connectedCallback() {
329
336
  const l = await fe(x(this, "src"), this), t = x(this, "tag"), s = t || "dce-" + crypto.randomUUID();
330
337
  for (const d of l)
331
- C(d.templateNode || d.content || d, "style", (u) => {
332
- const i = u.closest("slot"), c = i ? `slot[name="${i.name}"]` : "";
333
- u.innerHTML = `${s} ${c}{${u.innerHTML}}`, this.append(u);
338
+ C(d.templateNode || d.content || d, "style", (m) => {
339
+ const i = m.closest("slot"), c = i ? `slot[name="${i.name}"]` : "";
340
+ m.innerHTML = `${s} ${c}{${m.innerHTML}}`, this.append(m);
334
341
  });
335
- const n = l.map((d) => me(d)), a = n.map((d, u) => (u = new XSLTProcessor(), u.importStylesheet(d), u));
336
- Object.defineProperty(this, "xsltString", { get: () => n.map((d) => H(d)).join(`
342
+ const a = l.map((d) => me(d)), n = a.map((d, m) => (m = new XSLTProcessor(), m.importStylesheet(d), m));
343
+ Object.defineProperty(this, "xsltString", { get: () => a.map((d) => H(d)).join(`
337
344
  `) });
338
- const o = this, h = [...this.templateNode.querySelectorAll("[slice]")], p = h.map((d) => x(d, "slice")).filter((d) => !d.includes("/")).filter((d, u, i) => i.indexOf(d) === u).map(se).flat(), m = n.reduce((d, u) => (u.params && d.push(...u.params), d), []);
345
+ const r = this, h = [...this.templateNode.querySelectorAll("[slice]")], p = h.map((d) => x(d, "slice")).filter((d) => !d.includes("/")).filter((d, m, i) => i.indexOf(d) === m).map(se).flat(), u = a.reduce((d, m) => (m.params && d.push(...m.params), d), []);
339
346
  class w extends HTMLElement {
340
347
  static get observedAttributes() {
341
- return m.map((u) => x(u, "name"));
348
+ return u.map((m) => x(m, "name"));
342
349
  }
343
350
  #e = 0;
344
351
  connectedCallback() {
345
- let u = this.childNodes;
352
+ let m = this.childNodes;
346
353
  if (this.firstElementChild?.tagName === "TEMPLATE") {
347
354
  this.firstElementChild !== this.lastElementChild && console.error("payload should have TEMPLATE as only child", this.outerHTML);
348
355
  const f = this.firstElementChild;
349
- f.remove(), u = f.content.childNodes;
350
- for (const r of [...f.content.childNodes])
351
- if (r.localName === "style") {
352
- const y = ye(this, "data-dce-style");
353
- r.innerHTML = `${s}[data-dce-style="${y}"]{${r.innerHTML}}`, f.insertAdjacentElement("beforebegin", r);
356
+ f.remove(), m = f.content.childNodes;
357
+ for (const o of [...f.content.childNodes])
358
+ if (o.localName === "style") {
359
+ const b = be(this, "data-dce-style");
360
+ o.innerHTML = `${s}[data-dce-style="${b}"]{${o.innerHTML}}`, f.insertAdjacentElement("beforebegin", o);
354
361
  } else
355
- r.nodeType === 1 ? f.insertAdjacentElement("beforebegin", r) : r.nodeType === 3 && f.insertAdjacentText("beforebegin", r.data);
362
+ o.nodeType === 1 ? f.insertAdjacentElement("beforebegin", o) : o.nodeType === 3 && f.insertAdjacentText("beforebegin", o.data);
356
363
  }
357
- const i = M("<datadom/>").documentElement, c = (f, r = "") => ((y) => (r && y.append(S(i, r)), y))(i.ownerDocument.createElement(f)), E = X(i, "payload", u, ce);
364
+ const i = M("<datadom/>").documentElement, c = (f, o = "") => ((b) => (o && b.append(S(i, o)), b))(i.ownerDocument.createElement(f)), E = X(i, "payload", m, ce);
358
365
  Q(E), ee(E), this.innerHTML = "";
359
366
  const g = X(i, "attributes", this.attributes, (f) => c(f.nodeName, f.value));
360
367
  X(i, "dataset", Object.keys(this.dataset), (f) => c(f, this.dataset[f]));
361
- const b = X(i, "slice", p, (f) => c(f, "")), v = (f) => L(f, b);
368
+ const y = X(i, "slice", p, (f) => c(f, "")), v = (f) => L(f, y);
362
369
  this.xml = i;
363
- const $ = [], W = () => {
370
+ const D = [], W = () => {
364
371
  const f = {};
365
- for (let r; r = $.pop(); ) {
366
- const y = x(r.sliceElement, "slice");
367
- f[y] || (J(b, y, r), f[y] = r);
372
+ for (let o; o = D.pop(); ) {
373
+ const b = x(o.sliceElement, "slice");
374
+ f[b] || (J(y, b, o), f[b] = o);
368
375
  }
369
- Object.keys(f).length !== 0 && I();
376
+ Object.keys(f).length !== 0 && R();
370
377
  };
371
378
  let V;
372
379
  this.onSlice = (f) => {
373
- $.push(f), V || (V = setTimeout(() => {
380
+ D.push(f), V || (V = setTimeout(() => {
374
381
  W(), V = 0;
375
382
  }, 1));
376
383
  };
377
- const I = this.transform = () => {
384
+ const R = this.transform = () => {
378
385
  if (this.#e)
379
386
  debugger;
380
- this.#e = 1, a.map((r, y) => {
381
- const R = r.transformToFragment(i.ownerDocument, document);
382
- return R || console.error(`XSLT transformation error. xsl:
383
- `, H(n[y]), `
387
+ this.#e = 1, n.map((o, b) => {
388
+ const I = o.transformToFragment(i.ownerDocument, document);
389
+ return I || console.error(`XSLT transformation error. xsl:
390
+ `, H(a[b]), `
384
391
  xml:
385
- `, H(i)), R;
386
- }).map((r) => {
387
- r && (le(r), ne(this, r.childNodes));
388
- }), w.observedAttributes.map((r) => {
389
- let y = x(this.firstElementChild, r);
390
- y !== x(this, r) && (this.setAttribute(r, y), this.#t(r, y));
391
- }), C(this, "[slice],[slice-event]", (r) => {
392
- if (!r.dceInitialized) {
393
- r.dceInitialized = 1;
394
- let y = x(r, "slice-event");
395
- r.hasAttribute("custom-validity") && (y += " change submit"), [...new Set((y || "change").split(" "))].forEach((R) => (r.localName === "slice" ? r.parentElement : r).addEventListener(R, (N) => {
396
- N.sliceElement = r, N.sliceEventSource = N.currentTarget || N.target;
397
- const ae = J(b, x(N.sliceElement, "slice"), N);
392
+ `, H(i)), I;
393
+ }).map((o) => {
394
+ o && (le(o), ae(this, o.childNodes));
395
+ }), w.observedAttributes.map((o) => {
396
+ let b = x(this.firstElementChild, o);
397
+ b !== x(this, o) && (this.setAttribute(o, b), this.#t(o, b));
398
+ }), C(this, "[slice],[slice-event]", (o) => {
399
+ if (!o.dceInitialized) {
400
+ o.dceInitialized = 1;
401
+ let b = x(o, "slice-event");
402
+ o.hasAttribute("custom-validity") && (b += " change submit"), [...new Set((b || "change").split(" "))].forEach((I) => (o.localName === "slice" ? o.parentElement : o).addEventListener(I, (A) => {
403
+ A.sliceElement = o, A.sliceEventSource = A.currentTarget || A.target;
404
+ const ne = J(y, x(A.sliceElement, "slice"), A);
398
405
  C(this, "[custom-validity]", (z) => {
399
406
  if (!z.setCustomValidity)
400
407
  return;
@@ -406,28 +413,29 @@ xml:
406
413
  console.error(j, "xPath", _);
407
414
  }
408
415
  });
409
- const k = x(r, "custom-validity"), T = k && L(k, g), O = T === !0 ? "" : T;
416
+ const k = x(o, "custom-validity"), T = k && L(k, g), O = T === !0 ? "" : T;
410
417
  if (k) {
411
- if (r.setCustomValidity ? r.setCustomValidity(O) : r.validationMessage = O, ae.map((z) => z.setAttribute("validation-message", O)), N.type === "submit")
412
- return T === !0 ? void 0 : (setTimeout(I, 1), !!T === T ? (T || N.preventDefault(), T) : T ? (N.preventDefault(), !1) : void 0);
413
- setTimeout(I, 1);
418
+ if (o.setCustomValidity ? o.setCustomValidity(O) : o.validationMessage = O, ne.map((z) => z.setAttribute("validation-message", O)), A.type === "submit")
419
+ return T === !0 ? void 0 : (setTimeout(R, 1), !!T === T ? (T || A.preventDefault(), T) : T ? (A.preventDefault(), !1) : void 0);
420
+ setTimeout(R, 1);
414
421
  }
415
- this.onSlice(N);
416
- })), (!y || y.includes("init")) && (r.hasAttribute("slice-value") || r.hasAttribute("value") || r.value ? this.onSlice({ type: "init", target: r, sliceElement: r, sliceEventSource: r }) : r.value = v(x(r, "slice")));
422
+ this.onSlice(A);
423
+ })), (!b || b.includes("init")) && (o.hasAttribute("slice-value") || o.hasAttribute("value") || o.value ? this.onSlice({ type: "init", target: o, sliceElement: o, sliceEventSource: o }) : o.value = v(x(o, "slice")));
417
424
  }
418
425
  }), this.#e = 0;
419
426
  };
420
- I(), W();
427
+ R(), W();
421
428
  }
422
- #t(u, i) {
423
- let c = this.xml.querySelector(`attributes>${u}`);
424
- c ? U(c).append(S(c, i)) : (c = A(u, i, this.xml), this.xml.querySelector("attributes").append(c));
429
+ #t(m, i) {
430
+ m === "value" && (this.value = i);
431
+ let c = this.xml.querySelector(`attributes>${m}`);
432
+ c ? U(c).append(S(c, i)) : (c = N(m, i, this.xml), this.xml.querySelector("attributes").append(c)), this.dispatchEvent(new CustomEvent("change", { bubbles: !0, detail: { [m]: i } }));
425
433
  }
426
- attributeChangedCallback(u, i, c) {
427
- !this.xml || this.#e || (this.#t(u, c), this.transform());
434
+ attributeChangedCallback(m, i, c) {
435
+ !this.xml || this.#e || (this.#t(m, c), this.transform());
428
436
  }
429
437
  get dce() {
430
- return o;
438
+ return r;
431
439
  }
432
440
  }
433
441
  const P = (d) => {
@@ -438,8 +446,8 @@ xml:
438
446
  else {
439
447
  const d = s;
440
448
  this.setAttribute("tag", d), P(d);
441
- const u = document.createElement(d);
442
- this.getAttributeNames().forEach((i) => u.setAttribute(i, this.getAttribute(i))), u.append(...[...this.childNodes].filter((i) => i.localName !== "style")), this.append(u);
449
+ const m = document.createElement(d);
450
+ this.getAttributeNames().forEach((i) => m.setAttribute(i, this.getAttribute(i))), m.append(...[...this.childNodes].filter((i) => i.localName !== "style")), this.append(m);
443
451
  }
444
452
  }
445
453
  get templateNode() {
@@ -463,13 +471,13 @@ export {
463
471
  J as f,
464
472
  le as g,
465
473
  xe as h,
466
- ne as i,
467
- ye as j,
468
- be as k,
474
+ ae as i,
475
+ be as j,
476
+ ye as k,
469
477
  F as l,
470
478
  he as m,
471
479
  L as n,
472
- D as o,
480
+ $ as o,
473
481
  ve as p,
474
482
  ge as q,
475
483
  Z as t,
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./custom-element-DZvvhscI.cjs"),l=require("./http-request-DPrY7mGh.cjs"),t=require("./local-storage-Boafngui.cjs"),a=require("./location-element-DRB7hCwA.cjs");exports.CustomElement=e.CustomElement;exports.appendByDceId=e.appendByDceId;exports.assureSlices=e.assureSlices;exports.assureUID=e.assureUID;exports.assureUnique=e.assureUnique;exports.createXsltFromDom=e.createXsltFromDom;exports.deepEqual=e.deepEqual;exports.default=e.CustomElement;exports.evalCurly=e.evalCurly;exports.event2slice=e.event2slice;exports.merge=e.merge;exports.mergeAttr=e.mergeAttr;exports.obj2node=e.obj2node;exports.tagUid=e.tagUid;exports.toXsl=e.toXsl;exports.xPath=e.xPath;exports.xPathDefaults=e.xPathDefaults;exports.xhrTemplate=e.xhrTemplate;exports.xml2dom=e.xml2dom;exports.xmlString=e.xmlString;exports.xslTags=e.xslTags;exports.HttpRequestElement=l.HttpRequestElement;exports.LocalStorageElement=t.LocalStorageElement;exports.localStorageSetItem=t.localStorageSetItem;exports.LocationElement=a.LocationElement;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./custom-element-CckoVsvO.cjs"),l=require("./http-request-DPrY7mGh.cjs"),t=require("./local-storage-Boafngui.cjs"),a=require("./location-element-DRB7hCwA.cjs");exports.CustomElement=e.CustomElement;exports.appendByDceId=e.appendByDceId;exports.assureSlices=e.assureSlices;exports.assureUID=e.assureUID;exports.assureUnique=e.assureUnique;exports.createXsltFromDom=e.createXsltFromDom;exports.deepEqual=e.deepEqual;exports.default=e.CustomElement;exports.evalCurly=e.evalCurly;exports.event2slice=e.event2slice;exports.merge=e.merge;exports.mergeAttr=e.mergeAttr;exports.obj2node=e.obj2node;exports.tagUid=e.tagUid;exports.toXsl=e.toXsl;exports.xPath=e.xPath;exports.xPathDefaults=e.xPathDefaults;exports.xhrTemplate=e.xhrTemplate;exports.xml2dom=e.xml2dom;exports.xmlString=e.xmlString;exports.xslTags=e.xslTags;exports.HttpRequestElement=l.HttpRequestElement;exports.LocalStorageElement=t.LocalStorageElement;exports.localStorageSetItem=t.localStorageSetItem;exports.LocationElement=a.LocationElement;
@@ -1,5 +1,5 @@
1
- import { C as e } from "./custom-element-DAe7uvIt.js";
2
- import { h as o, e as r, j as l, g as m, c as p, d as x, k as n, f as u, i as c, m as d, o as f, t as g, q as i, n as E, l as S, b as h, x as q, a as D, p as L } from "./custom-element-DAe7uvIt.js";
1
+ import { C as e } from "./custom-element-b7c_7Kz4.js";
2
+ import { h as o, e as r, j as l, g as m, c as p, d as x, k as n, f as u, i as c, m as d, o as f, t as g, q as i, n as E, l as S, b as h, x as q, a as D, p as L } from "./custom-element-b7c_7Kz4.js";
3
3
  import { H as I } from "./http-request-BOvP4KTl.js";
4
4
  import { L as b, l as j } from "./local-storage-BqDEu2kF.js";
5
5
  import { L as y } from "./location-element-FJlONi2n.js";
@@ -0,0 +1,60 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xhtml="http://www.w3.org/1999/xhtml">
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
5
+ <title>Data slices - Declarative Custom Element implementation demo</title>
6
+ <link rel="icon" href="./wc-square.svg"/>
7
+
8
+ <script type="module" src="../http-request.js"></script>
9
+ <script type="module" src="../custom-element.js"></script>
10
+ <style>
11
+ @import "./demo.css";
12
+
13
+ label {
14
+ display: flex;
15
+ }
16
+
17
+ label:has(input[type="text"],input[type="password"],input:not([type]) ) {
18
+ flex-direction: column;
19
+ }
20
+
21
+ nav {
22
+ max-width: 32em;
23
+ }
24
+ </style>
25
+ <!-- https://github.com/mdn/learning-area/blob/main/html/forms/form-validation/custom-error-message.html
26
+ todo: apply setCustomValidity( warningStr )
27
+ -->
28
+
29
+ </head>
30
+ <body>
31
+
32
+ <fieldset>
33
+ <legend><b style="color:green">green</b> in instance style can be overridden in payload as <i
34
+ style="color:red">red</i> in 1st instance
35
+ </legend>
36
+ <custom-element tag="dce-3">
37
+ <template>
38
+ <u>
39
+ <slot>is green</slot>
40
+ </u>
41
+ </template>
42
+ <style>dce-3 {
43
+ color: green
44
+ }</style>
45
+ </custom-element>
46
+ <u>should be</u> <i style="color:red">red</i>:
47
+ <dce-3 id="dce32">
48
+ <template>
49
+ <style> color:red; </style>
50
+ <u>red</u>
51
+ </template>
52
+ </dce-3> <br/>
53
+ should be GREEN:
54
+ <dce-3 id="dce31">green</dce-3>
55
+ </fieldset>
56
+
57
+ <script type="module" src="https://unpkg.com/html-demo-element@1/html-demo-element.js"></script>
58
+
59
+ </body>
60
+ </html>