@epa-wg/custom-element-dist 0.0.32 → 0.0.34

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 (300) hide show
  1. package/.claude/settings.local.json +18 -0
  2. package/.github/workflows/deploy.yml +59 -0
  3. package/.idea/copilot.data.migration.agent.xml +6 -0
  4. package/.idea/copilot.data.migration.ask.xml +6 -0
  5. package/.idea/copilot.data.migration.edit.xml +6 -0
  6. package/.idea/custom-element-dist.iml +2 -0
  7. package/.storybook/main.ts +20 -21
  8. package/.storybook/preview.ts +23 -25
  9. package/README.md +6 -4
  10. package/coverage/block-navigation.js +1 -1
  11. package/coverage/coverage-final.json +8 -18
  12. package/coverage/index.html +45 -30
  13. package/coverage/sorter.js +21 -7
  14. package/coverage/src/custom-element/coverage.svg +1 -1
  15. package/coverage/src/custom-element/custom-element.js/coverage.svg +1 -1
  16. package/coverage/src/custom-element/custom-element.js.html +687 -480
  17. package/coverage/src/custom-element/http-request.js/coverage.svg +1 -1
  18. package/coverage/src/custom-element/http-request.js.html +39 -18
  19. package/coverage/src/custom-element/index.html +35 -35
  20. package/coverage/src/custom-element/local-storage.js.html +1 -1
  21. package/coverage/src/custom-element/location-element.js.html +31 -31
  22. package/coverage/src/custom-element/module-url.js/coverage.svg +1 -1
  23. package/coverage/src/custom-element/module-url.js.html +20 -20
  24. package/coverage/src/index.html +1 -1
  25. package/coverage/src/{stories/local-storage.test.stories.ts → material/theme/colors.js}/coverage.svg +1 -1
  26. package/coverage/src/material/theme/colors.js.html +217 -0
  27. package/coverage/src/{stories/location-element.test.stories.ts → material/theme}/coverage.svg +1 -1
  28. package/coverage/src/material/theme/index.html +116 -0
  29. package/coverage/src/mocks/handlers.ts.html +1 -1
  30. package/coverage/src/mocks/index.html +1 -1
  31. package/coverage/src/stories/coverage.svg +1 -1
  32. package/coverage/src/stories/{external-template.test.stories.ts → frame.canvas.ts}/coverage.svg +1 -1
  33. package/coverage/src/stories/frame.canvas.ts.html +175 -0
  34. package/coverage/src/stories/http-request.stories.ts.html +1 -1
  35. package/coverage/src/stories/index.html +14 -179
  36. package/coverage/src/stories/testStoryBook.ts.html +12 -12
  37. package/coverage/src/sum.ts.html +1 -1
  38. package/dist/custom-element-BoYMoUtP.js +619 -0
  39. package/dist/custom-element-BqtjrCRF.cjs +97 -0
  40. package/dist/custom-element-bundle.cjs +1 -1
  41. package/dist/custom-element-bundle.js +3 -3
  42. package/dist/demo/a.html +10 -3
  43. package/dist/demo/a.svg +26 -26
  44. package/dist/demo/attributes.html +153 -0
  45. package/dist/demo/external-templates-sb-6.html +42 -0
  46. package/dist/demo/external-templates-sb-7.html +42 -0
  47. package/dist/demo/html-template.html +5 -4
  48. package/dist/demo/module-url-sb-2.html +46 -0
  49. package/dist/demo/module-url-sb-4.html +48 -0
  50. package/dist/demo/module-url-sb-5.html +53 -0
  51. package/dist/demo/s.xml +3859 -7
  52. package/dist/demo/s.xslt +13 -48
  53. package/dist/demo/s1.xml +3706 -0
  54. package/dist/demo/ss.html +13 -4
  55. package/dist/http-request-DSaowcG1.cjs +1 -0
  56. package/dist/{http-request-BOvP4KTl.js → http-request-DTCzZ1gc.js} +15 -9
  57. package/dist/mockServiceWorker.js +31 -8
  58. package/package.json +25 -26
  59. package/public/demo/a.html +10 -3
  60. package/public/demo/a.svg +26 -26
  61. package/public/demo/attributes.html +153 -0
  62. package/public/demo/external-templates-sb-6.html +42 -0
  63. package/public/demo/external-templates-sb-7.html +42 -0
  64. package/public/demo/html-template.html +5 -4
  65. package/public/demo/module-url-sb-2.html +46 -0
  66. package/public/demo/module-url-sb-4.html +48 -0
  67. package/public/demo/module-url-sb-5.html +53 -0
  68. package/public/demo/s.xml +3859 -7
  69. package/public/demo/s.xslt +13 -48
  70. package/public/demo/s1.xml +3706 -0
  71. package/public/demo/ss.html +13 -4
  72. package/public/mockServiceWorker.js +31 -8
  73. package/src/custom-element/custom-element.d.ts +4 -0
  74. package/src/custom-element/custom-element.js +119 -50
  75. package/src/custom-element/demo/a.html +10 -3
  76. package/src/custom-element/demo/a.svg +26 -26
  77. package/src/custom-element/demo/attributes.html +153 -0
  78. package/src/custom-element/demo/html-template.html +5 -4
  79. package/src/custom-element/demo/s.xml +3859 -7
  80. package/src/custom-element/demo/s.xslt +13 -48
  81. package/src/custom-element/demo/s1.xml +3706 -0
  82. package/src/custom-element/demo/ss.html +13 -4
  83. package/src/custom-element/http-request.js +7 -0
  84. package/src/custom-element/ide/web-types-dce.json +1 -1
  85. package/src/custom-element/ide/web-types-xsl.json +1 -1
  86. package/src/custom-element/index.html +1 -1
  87. package/src/material/angular.css +987 -987
  88. package/src/material/components/action.html +262 -0
  89. package/src/material/components/autocomplete.html +167 -239
  90. package/src/material/components/badge.html +239 -0
  91. package/src/material/components/dropdown.html +7 -13
  92. package/src/material/components/icon-link.html +160 -160
  93. package/src/material/components/icon.html +252 -0
  94. package/src/material/components/input.html +569 -362
  95. package/src/material/components/menu.html +235 -234
  96. package/src/material/components.html +157 -121
  97. package/src/material/demo.css +36 -36
  98. package/src/material/index.html +109 -110
  99. package/src/material/material.css +356 -356
  100. package/src/material/theme/Base-Principles.md +339 -0
  101. package/src/material/theme/README.md +298 -18
  102. package/src/material/theme/UI Domain Model in web applications.svg +1 -0
  103. package/src/material/theme/User Semantic Theme tokens.svg +1 -0
  104. package/src/material/theme/action-pending-poc.html +62 -0
  105. package/src/material/theme/actions-color.html +141 -0
  106. package/src/material/theme/colors-light.html +631 -0
  107. package/src/material/theme/colors-native.html +51 -0
  108. package/src/material/theme/colors-poc.html +66 -0
  109. package/src/material/theme/colors.html +297 -0
  110. package/src/material/theme/colors.js +44 -0
  111. package/src/material/theme/consumer-theme.css +745 -0
  112. package/src/material/theme/semantic.css +132 -113
  113. package/src/material/theme/style-bug.html +123 -0
  114. package/src/material/theme/theme-data.css +43 -0
  115. package/src/material/theme/theme-data.xhtml +2926 -0
  116. package/src/material/theme/todo.md +274 -0
  117. package/src/material/theme/tokens/action-colors.png +0 -0
  118. package/src/material/theme/tokens/cem-article-illustration-4x1-letterbox-2000x500.png +0 -0
  119. package/src/material/theme/tokens/cem-breakpoints.md +519 -0
  120. package/src/material/theme/tokens/cem-colors.md +715 -0
  121. package/src/material/theme/tokens/cem-consumerflow-typography-matrix.svg +198 -0
  122. package/src/material/theme/tokens/cem-coupling.md +372 -0
  123. package/src/material/theme/tokens/cem-data-vs-reading-numerals.svg +164 -0
  124. package/src/material/theme/tokens/cem-dimension.md +625 -0
  125. package/src/material/theme/tokens/cem-layering.md +562 -0
  126. package/src/material/theme/tokens/cem-m3-parity.md +343 -0
  127. package/src/material/theme/tokens/cem-responsive.md +238 -0
  128. package/src/material/theme/tokens/cem-shape.md +691 -0
  129. package/src/material/theme/tokens/cem-stroke-density-illustration-4to1-v3.svg +102 -0
  130. package/src/material/theme/tokens/cem-stroke.md +480 -0
  131. package/src/material/theme/tokens/cem-timing.md +198 -0
  132. package/src/material/theme/tokens/cem-typography-model-stack.svg +64 -0
  133. package/src/material/theme/tokens/cem-voice-fonts-typography.md +718 -0
  134. package/src/material/theme/tokens/cem-voice-ladder.svg +91 -0
  135. package/src/material/theme/tokens/chips.png +0 -0
  136. package/src/material/theme/tokens/columns-page.png +0 -0
  137. package/src/material/theme/tokens/initials.png +0 -0
  138. package/src/material/theme/tokens/nav-buttons.png +0 -0
  139. package/src/material/theme/tokens/script.png +0 -0
  140. package/src/material/theme/tokens/sufler.png +0 -0
  141. package/src/material/theme/tokens/typography-icons.png +0 -0
  142. package/src/mocks/versions.mock.ts +1 -1
  143. package/src/stories/__screenshots__/attributes.test.stories.ts +1 -0
  144. package/src/stories/__screenshots__/dom-merge.test.stories.ts/dom-merge-dom-merge-OrderPreservingOn2ndTransform-1.png +0 -0
  145. package/src/stories/__screenshots__/external-template.test.stories.ts +1 -0
  146. package/src/stories/__screenshots__/module-url.test.stories.ts +1 -0
  147. package/src/stories/__screenshots__/stories.test.ts/attributes-Attributes-definition-1.png +0 -0
  148. package/src/stories/__screenshots__/stories.test.ts/attributes-Attributes-runtime-change-1.png +0 -0
  149. package/src/stories/__screenshots__/stories.test.ts/attributes-Instance-Attributes-1.png +0 -0
  150. package/src/stories/__screenshots__/stories.test.ts/attributes-Instance-Attributes-2.png +0 -0
  151. package/src/stories/__screenshots__/stories.test.ts/attributes-cloneAs-el-newTag--1.png +0 -0
  152. package/src/stories/__screenshots__/stories.test.ts/attributes-mergeAttr--from--to---1.png +0 -0
  153. package/src/stories/__screenshots__/stories.test.ts/attributes-mergeAttr--from--to---2.png +0 -0
  154. package/src/stories/__screenshots__/stories.test.ts/attributes-mergeAttr--from--to---3.png +0 -0
  155. package/src/stories/__screenshots__/stories.test.ts/attributes-mix-to-from--1.png +0 -0
  156. package/src/stories/__screenshots__/stories.test.ts/http-request-Attributes-definition-1.png +0 -0
  157. package/src/stories/__screenshots__/stories.test.ts/http-request-Attributes-runtime-change-1.png +0 -0
  158. package/src/stories/__screenshots__/stories.test.ts/http-request-Instance-Attributes-1.png +0 -0
  159. package/src/stories/__screenshots__/stories.test.ts/http-request-Instance-Attributes-2.png +0 -0
  160. package/src/stories/__screenshots__/stories.test.ts/http-request-cloneAs-el-newTag--1.png +0 -0
  161. package/src/stories/__screenshots__/stories.test.ts/http-request-http-request-headers-and-response-status-and-headers-1.png +0 -0
  162. package/src/stories/__screenshots__/stories.test.ts/http-request-http-request-with-delayed--5-seconds-response-1.png +0 -0
  163. package/src/stories/__screenshots__/stories.test.ts/http-request-http-request-with-error-1.png +0 -0
  164. package/src/stories/__screenshots__/stories.test.ts/http-request-mergeAttr--from--to---1.png +0 -0
  165. package/src/stories/__screenshots__/stories.test.ts/http-request-mergeAttr--from--to---2.png +0 -0
  166. package/src/stories/__screenshots__/stories.test.ts/http-request-mergeAttr--from--to---3.png +0 -0
  167. package/src/stories/__screenshots__/stories.test.ts/http-request-mix-to-from--1.png +0 -0
  168. package/src/stories/__screenshots__/stories.test.ts/http-request-url-and-slice-1.png +0 -0
  169. package/src/stories/__screenshots__/stories.test.ts/http-request-url-change-1.png +0 -0
  170. package/src/stories/__screenshots__/xslt-conditionals.test.stories.ts/xslt-conditionals-xslt-conditionals-MultipleIfOrderingWorkaround-1.png +0 -0
  171. package/src/stories/attributes.test.stories.ts +83 -17
  172. package/src/stories/dom-merge.test.stories.ts +25 -1
  173. package/src/stories/external-template.test.stories.ts +16 -14
  174. package/src/stories/frame.canvas.ts +31 -0
  175. package/src/stories/module-url.test.stories.ts +29 -61
  176. package/src/stories/xslt-conditionals.test.stories.ts +492 -0
  177. package/src/stories/xslt-if.test.stories.ts +89 -0
  178. package/storybook-static/assets/Color-F6OSRLHC-CzTOSlqB.js +1 -0
  179. package/storybook-static/assets/Configure-7GqRsAoJ.js +165 -0
  180. package/storybook-static/assets/DocsRenderer-CFRXHY34-Duc5rSIm.js +2 -0
  181. package/storybook-static/assets/{attributes.test.stories-D1X6EBrd.js → attributes.test.stories-DYuxF8h1.js} +109 -38
  182. package/storybook-static/assets/{css.test.stories-Cp_g2hE1.js → css.test.stories-LOmvINyb.js} +1 -1
  183. package/storybook-static/assets/custom-element-Bwx7otrT.js +97 -0
  184. package/storybook-static/assets/{dom-merge.test.stories-hbpdCka0.js → dom-merge.test.stories-CEKhWjaS.js} +47 -6
  185. package/storybook-static/assets/entry-preview-BNCt9WBs.js +26 -0
  186. package/storybook-static/assets/entry-preview-docs-CbF8-81D.js +2 -0
  187. package/storybook-static/assets/{external-template.test.stories-BK89h6sk.js → external-template.test.stories-jHu0wsJ-.js} +38 -40
  188. package/storybook-static/assets/{form.test.stories-BfoLe_rw.js → form.test.stories-CUyUnmwP.js} +1 -1
  189. package/storybook-static/assets/frame.canvas-E5n9h6j1.js +1 -0
  190. package/storybook-static/assets/{handlers-yVPwH_Nz.js → handlers-F7GUfMqr.js} +17 -14
  191. package/storybook-static/assets/http-request-BWeEEBkP.js +1 -0
  192. package/storybook-static/assets/{http-request.stories-CBFJS2Ws.js → http-request.stories-wyX5-QOv.js} +1 -1
  193. package/storybook-static/assets/iframe-BS_DPWl0.js +199 -0
  194. package/storybook-static/assets/index-CGuyH0k-.js +240 -0
  195. package/storybook-static/assets/index-DB7LLObI.js +1 -0
  196. package/storybook-static/assets/index-DO1nmyvI.js +11 -0
  197. package/storybook-static/assets/index-V1EGs-wm.js +621 -0
  198. package/storybook-static/assets/{local-storage.test.stories-C0Yzy6Am.js → local-storage.test.stories-BxOhsf1k.js} +1 -1
  199. package/storybook-static/assets/{location-element.test.stories-DNFrEu5A.js → location-element.test.stories-DqhvvUoa.js} +1 -1
  200. package/storybook-static/assets/module-url.test.stories-C1gG9G7Y.js +142 -0
  201. package/storybook-static/assets/preview-1xJJ3sKE.js +1 -0
  202. package/storybook-static/assets/preview-Bn8igYMp.js +1 -0
  203. package/storybook-static/assets/preview-CTOeX_lO.js +1 -0
  204. package/storybook-static/assets/preview-Cwy1XFu2.js +2 -0
  205. package/storybook-static/assets/preview-D6sehqkw.js +50 -0
  206. package/storybook-static/assets/preview-DfTudP20.js +1 -0
  207. package/storybook-static/assets/{set-url.test.stories-BBfLxv2u.js → set-url.test.stories-BKQNdknJ.js} +1 -1
  208. package/storybook-static/assets/{slice-events.test.stories-HcXF8XQI.js → slice-events.test.stories-ChqULCeA.js} +1 -1
  209. package/storybook-static/assets/{slots.test.stories-i6mnIFM2.js → slots.test.stories-BlyLoCRe.js} +1 -1
  210. package/storybook-static/assets/{version-select.test.stories-BsUFH6Va.js → version-select.test.stories-CPGSh1tR.js} +1 -1
  211. package/storybook-static/assets/xslt-conditionals.test.stories-YC6QPqWZ.js +633 -0
  212. package/storybook-static/assets/xslt-if.test.stories-BRSWy2-x.js +71 -0
  213. package/storybook-static/demo/a.html +10 -3
  214. package/storybook-static/demo/a.svg +26 -26
  215. package/storybook-static/demo/attributes.html +153 -0
  216. package/storybook-static/demo/external-templates-sb-6.html +42 -0
  217. package/storybook-static/demo/external-templates-sb-7.html +42 -0
  218. package/storybook-static/demo/html-template.html +5 -4
  219. package/storybook-static/demo/module-url-sb-2.html +46 -0
  220. package/storybook-static/demo/module-url-sb-4.html +48 -0
  221. package/storybook-static/demo/module-url-sb-5.html +53 -0
  222. package/storybook-static/demo/s.xml +3859 -7
  223. package/storybook-static/demo/s.xslt +13 -48
  224. package/storybook-static/demo/s1.xml +3706 -0
  225. package/storybook-static/demo/ss.html +13 -4
  226. package/storybook-static/iframe.html +2 -2
  227. package/storybook-static/index.html +6 -10
  228. package/storybook-static/index.json +1 -1
  229. package/storybook-static/mockServiceWorker.js +31 -8
  230. package/storybook-static/project.json +1 -1
  231. package/storybook-static/sb-addons/essentials-actions-2/manager-bundle.js +3 -0
  232. package/storybook-static/sb-addons/essentials-backgrounds-4/manager-bundle.js +8 -8
  233. package/storybook-static/sb-addons/essentials-controls-1/manager-bundle.js +394 -0
  234. package/storybook-static/sb-addons/essentials-docs-3/manager-bundle.js +233 -0
  235. package/storybook-static/sb-addons/essentials-measure-7/manager-bundle.js +1 -1
  236. package/storybook-static/sb-addons/essentials-outline-8/manager-bundle.js +1 -1
  237. package/storybook-static/sb-addons/essentials-toolbars-6/manager-bundle.js +1 -1
  238. package/storybook-static/sb-addons/essentials-viewport-5/manager-bundle.js +1 -1
  239. package/storybook-static/sb-addons/interactions-9/manager-bundle.js +58 -58
  240. package/storybook-static/sb-manager/globals-module-info.js +9 -0
  241. package/storybook-static/sb-manager/globals-runtime.js +10719 -10473
  242. package/storybook-static/sb-manager/runtime.js +4944 -6321
  243. package/coverage/src/stories/attributes.test.stories.ts/coverage.svg +0 -10
  244. package/coverage/src/stories/attributes.test.stories.ts.html +0 -814
  245. package/coverage/src/stories/css.test.stories.ts/coverage.svg +0 -10
  246. package/coverage/src/stories/css.test.stories.ts.html +0 -460
  247. package/coverage/src/stories/dom-merge.test.stories.ts/coverage.svg +0 -10
  248. package/coverage/src/stories/dom-merge.test.stories.ts.html +0 -706
  249. package/coverage/src/stories/external-template.test.stories.ts.html +0 -865
  250. package/coverage/src/stories/form.test.stories.ts/coverage.svg +0 -10
  251. package/coverage/src/stories/form.test.stories.ts.html +0 -661
  252. package/coverage/src/stories/local-storage.test.stories.ts.html +0 -1315
  253. package/coverage/src/stories/location-element.test.stories.ts.html +0 -523
  254. package/coverage/src/stories/module-url.test.stories.ts/coverage.svg +0 -10
  255. package/coverage/src/stories/module-url.test.stories.ts.html +0 -640
  256. package/coverage/src/stories/set-url.test.stories.ts/coverage.svg +0 -10
  257. package/coverage/src/stories/set-url.test.stories.ts.html +0 -433
  258. package/coverage/src/stories/slice-events.test.stories.ts/coverage.svg +0 -10
  259. package/coverage/src/stories/slice-events.test.stories.ts.html +0 -952
  260. package/coverage/src/stories/slots.test.stories.ts/coverage.svg +0 -10
  261. package/coverage/src/stories/slots.test.stories.ts.html +0 -742
  262. package/coverage/src/stories/version-select.test.stories.ts/coverage.svg +0 -10
  263. package/coverage/src/stories/version-select.test.stories.ts.html +0 -397
  264. package/dist/custom-element-D2wf_rqP.js +0 -576
  265. package/dist/custom-element-Dtzhbjkc.cjs +0 -97
  266. package/dist/http-request-DPrY7mGh.cjs +0 -1
  267. package/storybook-static/assets/Color-F6OSRLHC-BU3iy8jH.js +0 -1
  268. package/storybook-static/assets/Configure-DN6ifayP.js +0 -165
  269. package/storybook-static/assets/DocsRenderer-CFRXHY34-BaVEufDj.js +0 -2
  270. package/storybook-static/assets/custom-element-uuAtIYWS.js +0 -97
  271. package/storybook-static/assets/entry-preview-DHVXbf3x.js +0 -26
  272. package/storybook-static/assets/entry-preview-docs-BbcIMweR.js +0 -2
  273. package/storybook-static/assets/http-request-DNq59pnj.js +0 -1
  274. package/storybook-static/assets/iframe-CJEL_4Nu.js +0 -2
  275. package/storybook-static/assets/index-BcZLpTeD.js +0 -8
  276. package/storybook-static/assets/index-CxRwF5Or.js +0 -234
  277. package/storybook-static/assets/index-D-8MO0q_.js +0 -1
  278. package/storybook-static/assets/index-D5fBh-7N.js +0 -1
  279. package/storybook-static/assets/index-DM-KBPdl.js +0 -1
  280. package/storybook-static/assets/index-RSFf30w1.js +0 -1
  281. package/storybook-static/assets/index-SnjB5uV8.js +0 -769
  282. package/storybook-static/assets/module-url.test.stories-CXibF5Ta.js +0 -208
  283. package/storybook-static/assets/preview-BhhEZcNS.js +0 -1
  284. package/storybook-static/assets/preview-Bnd0XhaF.js +0 -52
  285. package/storybook-static/assets/preview-CNKoaWES.js +0 -1
  286. package/storybook-static/assets/preview-DAeyCMnM.js +0 -1
  287. package/storybook-static/assets/preview-DHPc-V4N.js +0 -1
  288. package/storybook-static/assets/preview-DJMlNTk8.js +0 -2
  289. package/storybook-static/assets/preview-DYzi3Z2p.js +0 -1
  290. package/storybook-static/sb-addons/chromatic-com-storybook-10/manager-bundle.js +0 -333
  291. package/storybook-static/sb-addons/chromatic-com-storybook-10/manager-bundle.js.LEGAL.txt +0 -40
  292. package/storybook-static/sb-addons/essentials-actions-3/manager-bundle.js +0 -3
  293. package/storybook-static/sb-addons/essentials-controls-2/manager-bundle.js +0 -391
  294. package/storybook-static/sb-addons/links-1/manager-bundle.js +0 -3
  295. package/storybook-static/sb-preview/globals.js +0 -33
  296. package/storybook-static/sb-preview/runtime.js +0 -7174
  297. package/test-runner-jest.config.js +0 -15
  298. /package/storybook-static/sb-addons/{essentials-actions-3 → essentials-actions-2}/manager-bundle.js.LEGAL.txt +0 -0
  299. /package/storybook-static/sb-addons/{essentials-controls-2 → essentials-controls-1}/manager-bundle.js.LEGAL.txt +0 -0
  300. /package/storybook-static/sb-addons/{links-1 → essentials-docs-3}/manager-bundle.js.LEGAL.txt +0 -0
@@ -1,576 +0,0 @@
1
- const G = "http://www.w3.org/1999/XSL/Transform", O = "http://www.w3.org/1999/xhtml", he = "http://exslt.org/common", f = (e, l) => e.getAttribute?.(l), ee = (e) => e.nodeType === 3, xe = (e) => typeof e == "string", be = (e) => e && typeof e.nodeType == "number", $ = (e, l) => (e.ownerDocument || e).createTextNode(l), ie = (e) => {
2
- for (; e.firstChild; ) e.firstChild.remove();
3
- return e;
4
- }, Z = (e) => (e.getAttributeNames().map((l) => e.removeAttribute(l)), ie(e)), oe = (e) => (e?.setAttribute("xmlns:xsl", G), e), re = (e) => (e?.setAttribute("xmlns:xhtml", O), oe(e)), ce = (e) => /^[_a-zA-Z][-_:a-zA-Z0-9]*$/.test(e), te = (e, l) => (Object.keys(l).map((t) => e[t] = l[t]), e), S = (e, l = "", t = document) => {
5
- const s = (i) => ((r) => (l && r.append($(t.ownerDocument || t, l)), r))((t.ownerDocument || t).createElement(i));
6
- if (ce(e))
7
- return s(e);
8
- const n = s("dce-object");
9
- return n.setAttribute("dce-object-name", e), n;
10
- }, se = (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));
16
- return t;
17
- };
18
- function X(e) {
19
- return new DOMParser().parseFromString(e, "application/xml");
20
- }
21
- function I(e) {
22
- return new XMLSerializer().serializeToString(e);
23
- }
24
- function H(e, l, t, s) {
25
- const n = (x) => e.ownerDocument.createElement(x), r = ((x, h, v) => (h.append(v = n(x)), v))(l, e);
26
- return [...t].forEach((x) => r.append(s(x))), r;
27
- }
28
- function ye(e) {
29
- return e.slot || (e.setAttribute || (e = S("span", e.textContent.replaceAll(`
30
- `, ""))), e.setAttribute("slot", "")), e;
31
- }
32
- function Y(e, l) {
33
- e.getAttributeNames().forEach((t) => l.includes(t) || e.removeAttribute(t));
34
- }
35
- const le = (e) => [...e].filter((l) => !(l.nodeType === 3 && l.data.trim() === ""));
36
- function z(e, l, t) {
37
- const s = typeof e;
38
- if (s === "string")
39
- return S(l, e, t);
40
- if (s === "number")
41
- return S(l, "" + e, t);
42
- if (e instanceof Array) {
43
- const i = S("array", "", t);
44
- return e.map((r) => i.append(z(r, l, t))), i;
45
- }
46
- if (e instanceof FormData) {
47
- const i = S("form-data", "", t);
48
- for (const r of e)
49
- i.append(z(r[1], r[0], t));
50
- return i;
51
- }
52
- const n = S(l, "", t);
53
- for (let i in e)
54
- be(e[i]) || typeof e[i] == "function" || e[i] instanceof Window || (typeof e[i] != "object" && ce(i) ? n.setAttribute(i, e[i]) : n.append(z(e[i], i, t)));
55
- return n;
56
- }
57
- function ne(e) {
58
- if (D(e, "*", (l) => [...l.childNodes].filter((t) => t.nodeType === 3 && t.parentNode.localName !== "style" && t.data).forEach((t) => {
59
- const s = t.data, n = s.matchAll(/{([^}]*)}/g);
60
- if (n) {
61
- let i = 0, r = (h) => $(t, h), x = [];
62
- if ([...n].forEach((h) => {
63
- h.index > i && x.push(r(h.input.substring(i, h.index)));
64
- const v = e.querySelector("value-of").cloneNode();
65
- v.setAttribute("select", h[1]), x.push(v), i = h.index + h[0].length;
66
- }), i < s.length && x.push(r(s.substring(i, s.length))), x.length) {
67
- for (let h of x)
68
- l.insertBefore(h, t);
69
- l.removeChild(t);
70
- }
71
- }
72
- })), "all" in e) {
73
- let l = 1;
74
- for (let t of e.all)
75
- t.setAttribute && !t.tagName.startsWith("xsl:") && t.setAttribute("data-dce-id", "" + l++);
76
- }
77
- return e;
78
- }
79
- function ge(e, l = "xsl:stylesheet") {
80
- const t = [], s = {}, n = {};
81
- if (e.tagName === l || e.documentElement?.tagName === l)
82
- return ne(te(e, { declaredAttributes: t, hardcodedAttributes: s, exposedAttributes: n }));
83
- const i = X(`<xsl:stylesheet version="1.0" xmlns:xsl="${G}" xmlns:xhtml="${O}" xmlns:exsl="${he}" exclude-result-prefixes="exsl" >
84
- <xsl:output method="xml"/>
85
- <xsl:template match="/"><dce-root xmlns="${O}"><xsl:apply-templates select="*" /></dce-root></xsl:template>
86
- <xsl:template match="*[name()='template']">
87
- <xsl:apply-templates mode="sanitize" select="*|text()"/>
88
- </xsl:template>
89
- <xsl:template match="*">
90
- <xsl:apply-templates mode="sanitize" select="*|text()"/>
91
- </xsl:template>
92
- <xsl:template match="*[name()='svg']|*[name()='math']">
93
- <xsl:apply-templates mode="sanitize" select="."/>
94
- </xsl:template>
95
- <xsl:template mode="sanitize" match="*[count(text())=1 and count(*)=0]">
96
- <xsl:copy>
97
- <xsl:apply-templates mode="sanitize" select="@*"/>
98
- <xsl:value-of select="text()"></xsl:value-of>
99
- </xsl:copy>
100
- </xsl:template>
101
- <xsl:template mode="sanitize" match="xhtml:*[count(text())=1 and count(*)=0]">
102
- <xsl:element name="{local-name()}">
103
- <xsl:apply-templates mode="sanitize" select="@*"/>
104
- <xsl:value-of select="text()"></xsl:value-of>
105
- </xsl:element>
106
- </xsl:template>
107
- <xsl:template mode="sanitize" match="*|@*">
108
- <xsl:copy>
109
- <xsl:apply-templates mode="sanitize" select="*|@*|text()"/>
110
- </xsl:copy>
111
- </xsl:template>
112
- <xsl:template mode="sanitize" match="text()[normalize-space(.) = '']"/>
113
- <xsl:template mode="sanitize" match="text()">
114
- <dce-text>
115
- <xsl:copy/>
116
- </dce-text>
117
- </xsl:template>
118
- <xsl:template mode="sanitize" match="xsl:value-of|*[name()='slot']">
119
- <xsl:copy>
120
- <xsl:apply-templates mode="sanitize" select="*|@*|text()"/>
121
- </xsl:copy>
122
- </xsl:template>
123
- <xsl:template mode="sanitize" match="xhtml:*">
124
- <xsl:element name="{local-name()}">
125
- <xsl:apply-templates mode="sanitize" select="*|@*|text()"/>
126
- </xsl:element>
127
- </xsl:template>
128
- <xsl:template mode="sanitize" match="xhtml:input">
129
- <xsl:element name="{local-name()}">
130
- <xsl:apply-templates mode="sanitize" select="*[not(name()='slice')]|@*|text()"/>
131
- </xsl:element>
132
- <xsl:for-each select="slice">
133
- <xsl:copy>
134
- <xsl:attribute name="for" >^</xsl:attribute>
135
- <xsl:apply-templates mode="sanitize" select="*|@*|text()"/>
136
- </xsl:copy>
137
- </xsl:for-each>
138
- </xsl:template>
139
- </xsl:stylesheet>`), r = new XSLTProcessor(), x = ((a) => {
140
- D(a, "custom-element", (y) => {
141
- y.firstElementChild.localName === "template" && ([...y.firstElementChild.content.childNodes].forEach((g) => y.append(g)), y.firstElementChild.remove());
142
- }), D(a, "script", (y) => y.remove());
143
- const c = a.content ?? a.firstElementChild?.content ?? a.body ?? a;
144
- Le.forEach((y) => D(c, y, (g) => De(g, c)));
145
- const A = a.firstElementChild?.content || a.content, N = (y) => {
146
- const g = X("<xhtml/>"), k = g.importNode(y, !0);
147
- return g.replaceChild(k, g.documentElement), re(k);
148
- };
149
- if (A) {
150
- const y = S("div");
151
- return [...A.childNodes].map((g) => y.append(g.cloneNode(!0))), N(y);
152
- }
153
- return N(a.documentElement || a.body || a);
154
- })(e), h = X(
155
- `<xsl:stylesheet version="1.0"
156
- xmlns:xsl="${G}"
157
- xmlns:xhtml="${O}"
158
- xmlns:dce="urn:schemas-epa-wg:dce"
159
- xmlns:exsl="http://exslt.org/common"
160
- exclude-result-prefixes="exsl"
161
- >
162
- <xsl:template match="ignore">
163
- <xsl:choose>
164
- <xsl:when test="//attr">{//attr}</xsl:when>
165
- <xsl:otherwise>{def}</xsl:otherwise>
166
- </xsl:choose><xsl:value-of select="."></xsl:value-of></xsl:template>
167
- <xsl:template mode="payload" match="attributes"></xsl:template>
168
- <xsl:template match="/">
169
- <xsl:apply-templates mode="payload" select="/datadom/attributes"/>
170
- </xsl:template>
171
- <xsl:template name="slot" >
172
- <xsl:param name="slotname" />
173
- <xsl:param name="defaultvalue" />
174
- <xsl:choose>
175
- <xsl:when test="//payload/*[@slot=$slotname]">
176
- <xsl:copy-of select="//payload/*[@slot=$slotname]"/>
177
- </xsl:when>
178
- <xsl:otherwise>
179
- <xsl:copy-of select="$defaultvalue"/>
180
- </xsl:otherwise>
181
- </xsl:choose>
182
- </xsl:template>
183
- <xsl:variable name="js-injected-body">
184
- <xsl:call-template name="slot" >
185
- <xsl:with-param name="slotname" select="''"/>
186
- <xsl:with-param name="defaultvalue"/>
187
- </xsl:call-template>
188
- </xsl:variable>
189
- </xsl:stylesheet>`
190
- );
191
- r.importStylesheet(i);
192
- const v = r.transformToFragment(x, document), d = (a, c) => a.querySelector(c), w = d(h, 'template[mode="payload"]');
193
- if (!v)
194
- return console.error("transformation error", { xml: x.outerHTML, xsl: I(i) });
195
- if (v.firstElementChild.localName !== "dce-root") {
196
- const a = v.ownerDocument.createElement("dce-root");
197
- [...v.childNodes].forEach((c) => a.append(c)), v.append(a);
198
- }
199
- [...v.querySelectorAll("dce-root>attribute")].forEach((a) => {
200
- Y(a, "namespace,name,select");
201
- const c = se(a, "xsl:param"), A = f(a, "name");
202
- if (t.push(A), a.childNodes.length && (s[A] = a.textContent), w.append(c), a.hasAttribute("select")) {
203
- n[A] = f(a, "select"), Y(c, "select,name");
204
- let N = f(a, "select").split("??"), y;
205
- if (N?.length > 1) {
206
- c.removeAttribute("select");
207
- const g = d(h, 'template[match="ignore"]>choose').cloneNode(!0);
208
- Z(g.firstElementChild).append($(g, "{" + N[0] + "}")), Z(g.lastElementChild).append($(g, "{" + N[1] + "}")), g.firstElementChild.setAttribute("test", "string-length(" + N[0] + ")"), c.append(g), y = g.cloneNode(!0);
209
- } else
210
- y = se(a, "xsl:value-of");
211
- y.removeAttribute("name"), a.append(y), a.removeAttribute("select");
212
- } else
213
- Y(c, "name"), c.setAttribute("select", "/datadom/attributes/" + A);
214
- }), [...v.querySelectorAll("[value]")].filter((a) => a.getAttribute("value").match(/\{(.*)\?\?(.*)\}/g)).forEach((a) => {
215
- const c = f(a, "value");
216
- c && a.setAttribute("value", Ce(c));
217
- });
218
- for (const a of v.childNodes)
219
- w.append(h.importNode(a, !0));
220
- [...w.getElementsByTagName("xsl:template")].forEach((a) => w.ownerDocument.documentElement.append(a));
221
- const q = d(h, 'call-template[name="slot"]'), p = (a) => {
222
- const c = q.cloneNode(!0), A = f(a, "name");
223
- A && c.firstElementChild.setAttribute("select", `'${A}'`);
224
- for (let N of a.childNodes)
225
- c.lastElementChild.append(N);
226
- return c;
227
- };
228
- D(w, "slot", (a) => a.parentNode.replaceChild(p(a), a));
229
- const u = ne(h);
230
- return te(u, { declaredAttributes: t, hardcodedAttributes: s, exposedAttributes: n }), u;
231
- }
232
- async function ve(e) {
233
- return await new Promise((t, s) => {
234
- const n = new XMLHttpRequest();
235
- n.open("GET", e), n.responseType = "document", n.onload = () => {
236
- n.readyState === n.DONE && n.status === 200 ? t(n.responseXML?.body || n.responseXML || S("div", n.responseText)) : s(`${n.statusText} - ${e}`);
237
- }, n.addEventListener("error", (i) => s(i)), n.send();
238
- });
239
- }
240
- function Ee(e, l, t = !1) {
241
- if (e === l)
242
- return !0;
243
- if (typeof e != "object" || e === null || typeof l != "object" || l === null || Object.keys(e).length !== Object.keys(l).length)
244
- return t;
245
- for (let s in e)
246
- if (!(s in l) || !Ee(e[s], l[s]))
247
- return t;
248
- return !0;
249
- }
250
- const me = (e) => e.split("|").map((l) => l.trim()).filter((l) => l), Ne = (e, l) => me(l).map((t) => {
251
- let s = e.ownerDocument, n = (i) => (e.append(i), i);
252
- if (t.includes("/")) {
253
- const i = [], r = s.evaluate(t, e);
254
- for (let x; x = r.iterateNext(); )
255
- i.push(x);
256
- return i;
257
- }
258
- return [...e.childNodes].find((i) => i.localName === t) || n(S(t, "", s));
259
- }).flat();
260
- function ae(e, l, t, s) {
261
- if (!t.sliceProcessed)
262
- return t.sliceProcessed = 1, Ne(e, l ?? "").map((n) => {
263
- const i = e.ownerDocument, r = t.sliceEventSource, x = t.sliceElement, h = () => [...n.childNodes].filter((d) => d.nodeType === 3 || d.localName === "value" || d.localName === "form-data").map((d) => d.remove());
264
- r.getAttributeNames().map((d) => n.setAttribute(d, f(r, d))), [...n.childNodes].filter((d) => d.localName === "event").map((d) => d.remove()), "validationMessage" in r && n.setAttribute("validation-message", r.validationMessage), t.type === "init" && h(), n.append(z(t, "event", i));
265
- const v = (r.type === "checkbox" || r.type === "radio") && !r.checked;
266
- if (x.hasAttribute("slice-value")) {
267
- r.value === void 0 ? n.removeAttribute("value") : n.setAttribute("value", r.value);
268
- const d = v ? "" : j(f(x, "slice-value"), n);
269
- h(), n.append($(i, d));
270
- } else {
271
- if ("elements" in r)
272
- return h(), n.append(z(new FormData(r), "value", n.ownerDocument)), n;
273
- const d = v ? "" : r.value ?? f(r, "value");
274
- h(), d == null ? [...n.childNodes].filter((w) => w.localName !== "event").map((w) => w.remove()) : xe(d) ? n.append($(i, d)) : n.append(z(d, "value", n.ownerDocument));
275
- }
276
- return n;
277
- });
278
- }
279
- function D(e, l, t) {
280
- e.querySelectorAll && [...e.querySelectorAll(l)].forEach(t);
281
- }
282
- const Ae = async (e, l) => {
283
- if (!e || !e.trim())
284
- return [l];
285
- if (e.startsWith("#"))
286
- return ((t) => {
287
- const s = t.querySelectorAll(e);
288
- return [...s.length ? s : t.getRootNode().querySelectorAll(e)];
289
- })(l.parentElement);
290
- try {
291
- const [t, s] = e.split("#");
292
- if (e.charAt(0) === ".")
293
- e = new URL(t, l.closest("[base]")?.getAttribute("base") || location).href;
294
- else
295
- try {
296
- e = import.meta.resolve(t), s && (e += "#" + s);
297
- } catch (i) {
298
- console.error(i.message);
299
- }
300
- const n = await ve(e);
301
- if (l.setAttributeNS("xml", "base", e), s) {
302
- const i = n.querySelectorAll("#" + s);
303
- return i.length ? [...i] : (console.error("template not found", e + "#" + s), [l]);
304
- }
305
- return [n];
306
- } catch {
307
- return [l];
308
- }
309
- };
310
- function we(e, l) {
311
- for (let t of e.attributes)
312
- try {
313
- t.namespaceURI ? l.setAttributeNS(t.namespaceURI, t.name, t.value) : l.setAttribute(t.name, t.value), t.name === "value" && (l.value = t.value);
314
- } catch (s) {
315
- console.warn("attribute assignment error", s?.message || s);
316
- }
317
- }
318
- function de(e, l = 0) {
319
- const t = {};
320
- for (const s of e.childNodes) {
321
- const n = f(s, "data-dce-id") || s.dceId || 0;
322
- if (!t[n])
323
- n ? t[n] = 1 : (t[n] = s.dceId = ++l, s.setAttribute && s.setAttribute("data-dce-id", s.dceId));
324
- else {
325
- const i = s.dceId = n + "-" + t[n]++;
326
- s.setAttribute && s.setAttribute("data-dce-id", i);
327
- }
328
- s.childNodes.length && de(s);
329
- }
330
- }
331
- function Te(e, l, t) {
332
- t = 1 * t;
333
- for (let s of e.childNodes)
334
- if ((s.dceId ?? s.getAttribute("data-dce-id") * 1) > t)
335
- return e.insertBefore(l, s);
336
- e.append(l);
337
- }
338
- function ue(e, l) {
339
- if (e.firstElementChild?.localName === "dce-root" && l[0]?.localName !== "dce-root")
340
- return;
341
- if (!l.length)
342
- return e.firstElementChild?.localName !== "dce-root" && ie(e);
343
- const t = {};
344
- for (let s of e.childNodes)
345
- t[s.dceId], ee(s) ? (s.data.trim(), t[s.dceId || 0] = s) : t[f(s, "data-dce-id") || 0] = s;
346
- for (let s of [...l]) {
347
- const n = f(s, "data-dce-id") || s.dceId, i = t[n];
348
- i ? (ee(s) ? i.nodeValue !== s.nodeValue && (i.nodeValue = s.nodeValue) : (we(s, i), (i.childNodes.length || s.childNodes.length) && ue(i, s.childNodes)), delete t[n]) : Te(e, s, n);
349
- }
350
- for (let s of Object.values(t))
351
- s.localName !== "dce-root" && s.remove();
352
- }
353
- function Se(e, l) {
354
- return e.hasAttribute(l) || e.setAttribute(l, crypto.randomUUID()), e.getAttribute(l);
355
- }
356
- const Ce = (e) => [...e?.matchAll(/([^{}]*)(\{)([^}]+)}([^{}]*)/g)].map((t) => `${t[1]}{${J(t[3])}}${t[4]}`).join(""), J = (e) => {
357
- if (!e.trim())
358
- return e;
359
- const l = e.split("??"), t = l.shift(), s = J(l.join("??"));
360
- return l.length ? `concat( ${t} , substring( ${s} , (1+string-length( ${s} )) * string-length( ${t} ) ) )` : e;
361
- }, j = (e, l) => {
362
- const t = e.split("??");
363
- if (t.length > 1)
364
- return j(t[0], l) || j(t[1], l);
365
- e = J(e);
366
- const s = l.ownerDocument.evaluate(e, l);
367
- switch (s.resultType) {
368
- case XPathResult.NUMBER_TYPE:
369
- return s.numberValue;
370
- case XPathResult.STRING_TYPE:
371
- return s.stringValue;
372
- case XPathResult.BOOLEAN_TYPE:
373
- return s.booleanValue;
374
- }
375
- let n = "";
376
- for (let i; i = s.iterateNext(); )
377
- n += i.textContent;
378
- return n;
379
- }, 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) => {
380
- const t = S("xsl:" + e.localName);
381
- for (let s of e.attributes)
382
- t.setAttribute(s.name, s.value);
383
- for (; e.firstChild; )
384
- t.append(e.firstChild);
385
- if (e.parentElement)
386
- e.parentElement.replaceChild(t, e);
387
- else {
388
- const s = e.parentElement || l, n = [...s.childNodes];
389
- n.forEach((i, r) => {
390
- i === e && (n[r] = t);
391
- }), s.replaceChildren(...n);
392
- }
393
- };
394
- class $e extends HTMLElement {
395
- static observedAttributes = ["src", "tag", "hidden"];
396
- async connectedCallback() {
397
- this.firstElementChild && this.firstElementChild.localName !== "template" && console.warn(`custom-element used without template wrapping content
398
- `, this.outerHTML);
399
- const l = await Ae(f(this, "src"), this), t = f(this, "tag"), s = t || "dce-" + crypto.randomUUID();
400
- for (const p of l)
401
- D(p.templateNode || p.content || p, "style", (u) => {
402
- const a = u.closest("slot"), c = a ? `slot[name="${a.name}"]` : "";
403
- u.innerHTML = `${s} ${c}{${u.innerHTML}}`, this.append(u);
404
- });
405
- const n = l.map((p) => ge(p)), i = n.map((p, u) => {
406
- u = new XSLTProcessor();
407
- try {
408
- u.importStylesheet(p);
409
- } catch (a) {
410
- console.error(a, I(p));
411
- }
412
- return u;
413
- });
414
- Object.defineProperty(this, "xsltString", { get: () => n.map((p) => I(p)).join(`
415
- `) });
416
- const r = this, x = [...this.templateNode.querySelectorAll("[slice]")], h = x.map((p) => f(p, "slice")).filter((p) => !p.includes("/")).filter((p, u, a) => a.indexOf(p) === u).map(me).flat(), { declaredAttributes: v, hardcodedAttributes: d, exposedAttributes: w } = n[0];
417
- class V extends HTMLElement {
418
- static get observedAttributes() {
419
- return v;
420
- }
421
- #e = 0;
422
- connectedCallback() {
423
- let u = le(this.childNodes);
424
- if (this.firstElementChild?.tagName === "TEMPLATE") {
425
- this.firstElementChild !== this.lastElementChild && console.error("payload should have TEMPLATE as only child", this.outerHTML);
426
- const m = this.firstElementChild;
427
- m.remove(), u = le(m.content.childNodes);
428
- for (const E of u)
429
- if (E.localName === "style") {
430
- const o = Se(this, "data-dce-style");
431
- E.innerHTML = `${s}[data-dce-style="${o}"]{${E.innerHTML}}`, m.insertAdjacentElement("beforebegin", E);
432
- } else
433
- E.nodeType === 1 ? m.insertAdjacentElement("beforebegin", E) : E.nodeType === 3 && m.insertAdjacentText("beforebegin", E.data);
434
- }
435
- const a = X("<datadom/>").documentElement, c = (m, E = "") => ((o) => (E && o.append($(a, E)), o))(a.ownerDocument.createElement(m)), A = H(a, "payload", u, ye);
436
- oe(A), re(A), this.innerHTML = "";
437
- const N = H(a, "attributes", this.attributes, (m) => c(m.nodeName, m.value)), y = (m) => this.hasAttribute(m) || [...N.children].find((E) => E.localName === m);
438
- Object.keys(d).map((m) => y(m) || N.append(c(m, d[m]))), v.map((m) => y(m) || N.append(c(m))), H(a, "dataset", Object.keys(this.dataset), (m) => c(m, this.dataset[m]));
439
- const g = H(a, "slice", h, (m) => c(m, "")), k = (m) => j(m, g);
440
- this.xml = a;
441
- const K = [], Q = () => {
442
- const m = {};
443
- for (let E; E = K.pop(); ) {
444
- const o = f(E.sliceElement, "slice");
445
- m[o] || (ae(g, o, E), m[o] = E);
446
- }
447
- Object.keys(m).length !== 0 && U();
448
- };
449
- let _;
450
- this.onSlice = (m) => {
451
- K.push(m), _ || (_ = setTimeout(() => {
452
- Q(), _ = 0;
453
- }, 1));
454
- };
455
- const U = this.transform = () => {
456
- if (this.#e)
457
- debugger;
458
- this.#e = 1, i.map((o, b) => {
459
- const C = o.transformToFragment(a.ownerDocument, document);
460
- return C || console.error(`XSLT transformation error. xsl:
461
- `, I(n[b]), `
462
- xml:
463
- `, I(a)), C;
464
- }).map((o) => {
465
- o && (de(o), ue(this, o.childNodes));
466
- }), Object.entries(d).map(([o, b]) => {
467
- !this.hasAttribute(o) && b !== f(this, o) && (this.setAttribute(o, b), this.#t(o, b));
468
- }), Object.keys(w).map((o) => {
469
- let b = f(this.firstElementChild, o);
470
- b !== f(this, o) && (this.setAttribute(o, b), this.#t(o, b));
471
- });
472
- function E(o) {
473
- let b = o;
474
- if (o.localName === "slice") {
475
- const C = f(o, "for");
476
- if (C || (b = o.parentElement), C === "^")
477
- do
478
- b = b.previousElementSibling;
479
- while (b.localName === "slice");
480
- else
481
- b = this.querySelector(C);
482
- if (!b)
483
- return console.warn(`can not find selector in "slice for=${C}" `, o.outerHTML);
484
- f(o, "slice") || o.setAttribute("slice", f(o, "name"));
485
- }
486
- return b;
487
- }
488
- D(this, "[slice],[slice-event]", (o) => {
489
- let b = f(o, "slice-event");
490
- const C = o.hasAttribute("slice-value") || o.hasAttribute("value") || o.value, M = E(o);
491
- o.dceInitialized || (o.dceInitialized = 1, M.hasAttribute("custom-validity") && (b += " change submit"), [...new Set((b || "change").split(" "))].forEach((pe) => M.addEventListener(pe, (T) => {
492
- T.sliceElement = o, T.sliceEventSource = T.currentTarget || T.target, T.sliceProcessed = 0;
493
- const fe = ae(g, f(T.sliceElement, "slice"), T);
494
- D(this, "[custom-validity]", (P) => {
495
- if (!P.setCustomValidity)
496
- return;
497
- const W = f(P, "custom-validity");
498
- try {
499
- const R = W && j(W, N);
500
- P.setCustomValidity(R === !0 ? "" : R === !1 ? "invalid" : R);
501
- } catch (R) {
502
- console.error(R, "xPath", W);
503
- }
504
- });
505
- const B = f(M, "custom-validity"), L = B && j(B, N), F = L === !0 ? "" : L;
506
- if (B) {
507
- if (o.setCustomValidity ? o.setCustomValidity(F) : o.validationMessage = F, fe.map((P) => P.setAttribute("validation-message", F)), T.type === "submit")
508
- return L === !0 ? void 0 : (setTimeout(U, 1), !!L === L ? (L || T.preventDefault(), L) : L ? (T.preventDefault(), !1) : void 0);
509
- setTimeout(U, 1);
510
- }
511
- this.onSlice(T);
512
- })), (!b || b.includes("init")) && (C ? this.onSlice({ type: "init", target: M, sliceElement: o, sliceEventSource: M }) : o.value = k(f(o, "slice"))));
513
- }), this.#e = 0;
514
- };
515
- U(), Q();
516
- }
517
- #t(u, a) {
518
- u === "value" && (this.value = a);
519
- let c = this.xml.querySelector(`attributes>${u}`);
520
- c ? Z(c).append($(c, a)) : (c = S(u, a, this.xml), this.xml.querySelector("attributes").append(c)), this.dispatchEvent(new CustomEvent("change", { bubbles: !0, detail: { [u]: a } }));
521
- }
522
- attributeChangedCallback(u, a, c) {
523
- !this.xml || this.#e || (this.#t(u, c), this.transform());
524
- }
525
- get dce() {
526
- return r;
527
- }
528
- }
529
- const q = (p) => {
530
- window.customElements.get(p) !== V && window.customElements.define(p, V);
531
- };
532
- if (t)
533
- q(t);
534
- else {
535
- const p = s;
536
- this.setAttribute("tag", p), q(p);
537
- const u = document.createElement(p);
538
- this.getAttributeNames().forEach((a) => u.setAttribute(a, this.getAttribute(a))), u.append(...[...this.childNodes].filter((a) => a.localName !== "style")), this.append(u);
539
- }
540
- }
541
- get templateNode() {
542
- return this.firstElementChild?.tagName === "TEMPLATE" ? this.firstElementChild.content : this;
543
- }
544
- get dce() {
545
- return this;
546
- }
547
- get xslt() {
548
- return X(this.xsltString);
549
- }
550
- }
551
- window.customElements.define("custom-element", $e);
552
- export {
553
- $e as C,
554
- I as a,
555
- ge as b,
556
- se as c,
557
- ve as d,
558
- Ee as e,
559
- Ne as f,
560
- ae as g,
561
- we as h,
562
- de as i,
563
- Te as j,
564
- ue as k,
565
- Se as l,
566
- te as m,
567
- Ce as n,
568
- z as o,
569
- J as p,
570
- j as q,
571
- Le as r,
572
- le as s,
573
- ne as t,
574
- De as u,
575
- X as x
576
- };