@aurodesignsystem-dev/auro-formkit 0.0.0-pr1001.0

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 (297) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/LICENSE +201 -0
  3. package/NOTICE +2 -0
  4. package/README.md +314 -0
  5. package/components/bibtemplate/dist/auro-bibtemplate.d.ts +50 -0
  6. package/components/bibtemplate/dist/buttonVersion.d.ts +2 -0
  7. package/components/bibtemplate/dist/headerVersion.d.ts +2 -0
  8. package/components/bibtemplate/dist/iconVersion.d.ts +2 -0
  9. package/components/bibtemplate/dist/index.d.ts +2 -0
  10. package/components/bibtemplate/dist/index.js +1940 -0
  11. package/components/bibtemplate/dist/registered.js +1940 -0
  12. package/components/bibtemplate/dist/styles/color-css.d.ts +2 -0
  13. package/components/bibtemplate/dist/styles/style-css.d.ts +2 -0
  14. package/components/bibtemplate/dist/styles/tokens-css.d.ts +2 -0
  15. package/components/checkbox/README.md +142 -0
  16. package/components/checkbox/demo/api.html +61 -0
  17. package/components/checkbox/demo/api.js +17 -0
  18. package/components/checkbox/demo/api.md +436 -0
  19. package/components/checkbox/demo/api.min.js +1870 -0
  20. package/components/checkbox/demo/index.html +57 -0
  21. package/components/checkbox/demo/index.js +8 -0
  22. package/components/checkbox/demo/index.md +327 -0
  23. package/components/checkbox/demo/index.min.js +1845 -0
  24. package/components/checkbox/demo/readme.html +57 -0
  25. package/components/checkbox/demo/readme.md +142 -0
  26. package/components/checkbox/dist/auro-checkbox-group.d.ts +166 -0
  27. package/components/checkbox/dist/auro-checkbox.d.ts +136 -0
  28. package/components/checkbox/dist/helptextVersion.d.ts +2 -0
  29. package/components/checkbox/dist/index.d.ts +3 -0
  30. package/components/checkbox/dist/index.js +1794 -0
  31. package/components/checkbox/dist/registered.js +1795 -0
  32. package/components/checkbox/dist/styles/auro-checkbox-css.d.ts +2 -0
  33. package/components/checkbox/dist/styles/auro-checkbox-group-css.d.ts +2 -0
  34. package/components/checkbox/dist/styles/color-css.d.ts +2 -0
  35. package/components/checkbox/dist/styles/colorGroup-css.d.ts +2 -0
  36. package/components/checkbox/dist/styles/tokens-css.d.ts +2 -0
  37. package/components/combobox/README.md +154 -0
  38. package/components/combobox/demo/api.html +63 -0
  39. package/components/combobox/demo/api.js +36 -0
  40. package/components/combobox/demo/api.md +1326 -0
  41. package/components/combobox/demo/api.min.js +18691 -0
  42. package/components/combobox/demo/index.html +63 -0
  43. package/components/combobox/demo/index.js +26 -0
  44. package/components/combobox/demo/index.md +725 -0
  45. package/components/combobox/demo/index.min.js +18545 -0
  46. package/components/combobox/demo/readme.html +57 -0
  47. package/components/combobox/demo/readme.md +154 -0
  48. package/components/combobox/dist/auro-combobox.d.ts +434 -0
  49. package/components/combobox/dist/bibtemplateVersion.d.ts +2 -0
  50. package/components/combobox/dist/dropdownVersion.d.ts +2 -0
  51. package/components/combobox/dist/index.d.ts +2 -0
  52. package/components/combobox/dist/index.js +16999 -0
  53. package/components/combobox/dist/inputVersion.d.ts +2 -0
  54. package/components/combobox/dist/registered.js +17001 -0
  55. package/components/combobox/dist/styles/emphasized/style-css.d.ts +2 -0
  56. package/components/combobox/dist/styles/snowflake/style-css.d.ts +2 -0
  57. package/components/combobox/dist/styles/style-css.d.ts +2 -0
  58. package/components/counter/README.md +146 -0
  59. package/components/counter/demo/api.html +61 -0
  60. package/components/counter/demo/api.js +20 -0
  61. package/components/counter/demo/api.md +730 -0
  62. package/components/counter/demo/api.min.js +10406 -0
  63. package/components/counter/demo/index.html +61 -0
  64. package/components/counter/demo/index.js +21 -0
  65. package/components/counter/demo/index.md +401 -0
  66. package/components/counter/demo/index.min.js +10370 -0
  67. package/components/counter/demo/readme.html +57 -0
  68. package/components/counter/demo/readme.md +146 -0
  69. package/components/counter/dist/auro-counter-button.d.ts +14 -0
  70. package/components/counter/dist/auro-counter-group.d.ts +386 -0
  71. package/components/counter/dist/auro-counter-wrapper.d.ts +22 -0
  72. package/components/counter/dist/auro-counter.d.ts +113 -0
  73. package/components/counter/dist/bibtemplateVersion.d.ts +2 -0
  74. package/components/counter/dist/dropdownVersion.d.ts +2 -0
  75. package/components/counter/dist/helptextVersion.d.ts +2 -0
  76. package/components/counter/dist/iconVersion.d.ts +2 -0
  77. package/components/counter/dist/index.d.ts +3 -0
  78. package/components/counter/dist/index.js +10313 -0
  79. package/components/counter/dist/registered.js +10314 -0
  80. package/components/counter/dist/styles/color-css.d.ts +2 -0
  81. package/components/counter/dist/styles/counter-button-color-css.d.ts +2 -0
  82. package/components/counter/dist/styles/counter-button-css.d.ts +2 -0
  83. package/components/counter/dist/styles/counter-group-css.d.ts +2 -0
  84. package/components/counter/dist/styles/counter-wrapper-color-css.d.ts +2 -0
  85. package/components/counter/dist/styles/counter-wrapper-css.d.ts +2 -0
  86. package/components/counter/dist/styles/shapeSize-css.d.ts +2 -0
  87. package/components/counter/dist/styles/style-css.d.ts +2 -0
  88. package/components/counter/dist/styles/tokens-css.d.ts +2 -0
  89. package/components/datepicker/README.md +141 -0
  90. package/components/datepicker/demo/api.html +63 -0
  91. package/components/datepicker/demo/api.js +35 -0
  92. package/components/datepicker/demo/api.md +1529 -0
  93. package/components/datepicker/demo/api.min.js +29755 -0
  94. package/components/datepicker/demo/index.html +62 -0
  95. package/components/datepicker/demo/index.js +19 -0
  96. package/components/datepicker/demo/index.md +204 -0
  97. package/components/datepicker/demo/index.min.js +29476 -0
  98. package/components/datepicker/demo/readme.html +57 -0
  99. package/components/datepicker/demo/readme.md +141 -0
  100. package/components/datepicker/dist/auro-calendar-cell.d.ts +163 -0
  101. package/components/datepicker/dist/auro-calendar-month.d.ts +20 -0
  102. package/components/datepicker/dist/auro-calendar.d.ts +133 -0
  103. package/components/datepicker/dist/auro-datepicker.d.ts +625 -0
  104. package/components/datepicker/dist/bibtemplateVersion.d.ts +2 -0
  105. package/components/datepicker/dist/buttonVersion.d.ts +2 -0
  106. package/components/datepicker/dist/dropdownVersion.d.ts +2 -0
  107. package/components/datepicker/dist/iconVersion.d.ts +2 -0
  108. package/components/datepicker/dist/index.d.ts +2 -0
  109. package/components/datepicker/dist/index.js +29406 -0
  110. package/components/datepicker/dist/inputVersion.d.ts +2 -0
  111. package/components/datepicker/dist/popoverVersion.d.ts +2 -0
  112. package/components/datepicker/dist/registered.js +29406 -0
  113. package/components/datepicker/dist/styles/classic/color-css.d.ts +2 -0
  114. package/components/datepicker/dist/styles/classic/style-css.d.ts +2 -0
  115. package/components/datepicker/dist/styles/color-calendar-css.d.ts +2 -0
  116. package/components/datepicker/dist/styles/color-cell-css.d.ts +2 -0
  117. package/components/datepicker/dist/styles/color-css.d.ts +2 -0
  118. package/components/datepicker/dist/styles/color-month-css.d.ts +2 -0
  119. package/components/datepicker/dist/styles/shapeSize-css.d.ts +2 -0
  120. package/components/datepicker/dist/styles/snowflake/color-css.d.ts +2 -0
  121. package/components/datepicker/dist/styles/snowflake/style-css.d.ts +2 -0
  122. package/components/datepicker/dist/styles/style-auro-calendar-cell-css.d.ts +2 -0
  123. package/components/datepicker/dist/styles/style-auro-calendar-css.d.ts +2 -0
  124. package/components/datepicker/dist/styles/style-auro-calendar-month-css.d.ts +2 -0
  125. package/components/datepicker/dist/styles/style-css.d.ts +2 -0
  126. package/components/datepicker/dist/styles/tokens-css.d.ts +2 -0
  127. package/components/datepicker/dist/utilities.d.ts +78 -0
  128. package/components/datepicker/dist/utilitiesCalendar.d.ts +38 -0
  129. package/components/datepicker/dist/utilitiesCalendarRender.d.ts +50 -0
  130. package/components/datepicker/dist/vendor/wc-range-datepicker/day.d.ts +5 -0
  131. package/components/datepicker/dist/vendor/wc-range-datepicker/range-datepicker-calendar.d.ts +60 -0
  132. package/components/datepicker/dist/vendor/wc-range-datepicker/range-datepicker-cell.d.ts +1 -0
  133. package/components/datepicker/dist/vendor/wc-range-datepicker/range-datepicker.d.ts +57 -0
  134. package/components/dropdown/README.md +144 -0
  135. package/components/dropdown/demo/api.html +63 -0
  136. package/components/dropdown/demo/api.js +21 -0
  137. package/components/dropdown/demo/api.md +1266 -0
  138. package/components/dropdown/demo/api.min.js +4442 -0
  139. package/components/dropdown/demo/index.html +61 -0
  140. package/components/dropdown/demo/index.js +19 -0
  141. package/components/dropdown/demo/index.md +337 -0
  142. package/components/dropdown/demo/index.min.js +4405 -0
  143. package/components/dropdown/demo/readme.html +57 -0
  144. package/components/dropdown/demo/readme.md +144 -0
  145. package/components/dropdown/dist/auro-dropdown.d.ts +425 -0
  146. package/components/dropdown/dist/auro-dropdownBib.d.ts +68 -0
  147. package/components/dropdown/dist/dropdownVersion.d.ts +2 -0
  148. package/components/dropdown/dist/helptextVersion.d.ts +2 -0
  149. package/components/dropdown/dist/iconVersion.d.ts +2 -0
  150. package/components/dropdown/dist/index.d.ts +2 -0
  151. package/components/dropdown/dist/index.js +4350 -0
  152. package/components/dropdown/dist/registered.js +4350 -0
  153. package/components/dropdown/dist/styles/classic/bibColors-css.d.ts +2 -0
  154. package/components/dropdown/dist/styles/classic/bibStyles-css.d.ts +2 -0
  155. package/components/dropdown/dist/styles/classic/color-css.d.ts +2 -0
  156. package/components/dropdown/dist/styles/classic/style-css.d.ts +2 -0
  157. package/components/dropdown/dist/styles/color-css.d.ts +2 -0
  158. package/components/dropdown/dist/styles/emphasized/style-css.d.ts +2 -0
  159. package/components/dropdown/dist/styles/shapeSize-css.d.ts +2 -0
  160. package/components/dropdown/dist/styles/snowflake/style-css.d.ts +2 -0
  161. package/components/dropdown/dist/styles/style-css.d.ts +2 -0
  162. package/components/dropdown/dist/styles/tokens-css.d.ts +2 -0
  163. package/components/form/README.md +142 -0
  164. package/components/form/demo/api.html +56 -0
  165. package/components/form/demo/api.js +3 -0
  166. package/components/form/demo/api.md +51 -0
  167. package/components/form/demo/api.min.js +638 -0
  168. package/components/form/demo/autocomplete.html +31 -0
  169. package/components/form/demo/index.html +57 -0
  170. package/components/form/demo/index.js +4 -0
  171. package/components/form/demo/index.md +403 -0
  172. package/components/form/demo/index.min.js +639 -0
  173. package/components/form/demo/readme.html +57 -0
  174. package/components/form/demo/readme.md +142 -0
  175. package/components/form/demo/registerDemoDeps.js +23 -0
  176. package/components/form/demo/working.html +124 -0
  177. package/components/form/dist/auro-form.d.ts +223 -0
  178. package/components/form/dist/index.d.ts +2 -0
  179. package/components/form/dist/index.js +614 -0
  180. package/components/form/dist/registered.d.ts +1 -0
  181. package/components/form/dist/registered.js +614 -0
  182. package/components/form/dist/styles/style-css.d.ts +2 -0
  183. package/components/helptext/dist/auro-helptext.d.ts +59 -0
  184. package/components/helptext/dist/index.d.ts +2 -0
  185. package/components/helptext/dist/index.js +207 -0
  186. package/components/helptext/dist/registered.js +207 -0
  187. package/components/helptext/dist/styles/color-css.d.ts +2 -0
  188. package/components/helptext/dist/styles/style-css.d.ts +2 -0
  189. package/components/helptext/dist/styles/tokens-css.d.ts +2 -0
  190. package/components/input/README.md +139 -0
  191. package/components/input/demo/api.html +48 -0
  192. package/components/input/demo/api.js +29 -0
  193. package/components/input/demo/api.md +1366 -0
  194. package/components/input/demo/api.min.js +8542 -0
  195. package/components/input/demo/index.html +49 -0
  196. package/components/input/demo/index.js +20 -0
  197. package/components/input/demo/index.md +270 -0
  198. package/components/input/demo/index.min.js +8461 -0
  199. package/components/input/demo/readme.html +57 -0
  200. package/components/input/demo/readme.md +139 -0
  201. package/components/input/dist/auro-input.d.ts +167 -0
  202. package/components/input/dist/base-input.d.ts +566 -0
  203. package/components/input/dist/buttonVersion.d.ts +2 -0
  204. package/components/input/dist/helptextVersion.d.ts +2 -0
  205. package/components/input/dist/i18n.d.ts +18 -0
  206. package/components/input/dist/iconVersion.d.ts +2 -0
  207. package/components/input/dist/index.d.ts +2 -0
  208. package/components/input/dist/index.js +8367 -0
  209. package/components/input/dist/registered.js +8367 -0
  210. package/components/input/dist/styles/classic/color-css.d.ts +2 -0
  211. package/components/input/dist/styles/classic/style-css.d.ts +2 -0
  212. package/components/input/dist/styles/color-css.d.ts +2 -0
  213. package/components/input/dist/styles/default/borders-css.d.ts +2 -0
  214. package/components/input/dist/styles/default/color-css.d.ts +2 -0
  215. package/components/input/dist/styles/default/mixins-css.d.ts +2 -0
  216. package/components/input/dist/styles/default/notificationIcons-css.d.ts +2 -0
  217. package/components/input/dist/styles/default/style-css.d.ts +2 -0
  218. package/components/input/dist/styles/emphasized/color-css.d.ts +2 -0
  219. package/components/input/dist/styles/emphasized/style-css.d.ts +2 -0
  220. package/components/input/dist/styles/mixins-css.d.ts +2 -0
  221. package/components/input/dist/styles/shapeSize-css.d.ts +2 -0
  222. package/components/input/dist/styles/snowflake/style-css.d.ts +2 -0
  223. package/components/input/dist/styles/style-css.d.ts +2 -0
  224. package/components/input/dist/styles/tokens-css.d.ts +2 -0
  225. package/components/input/dist/utilities.d.ts +25 -0
  226. package/components/layoutElement/dist/auroElement.d.ts +34 -0
  227. package/components/layoutElement/dist/index.d.ts +2 -0
  228. package/components/layoutElement/dist/index.js +98 -0
  229. package/components/layoutElement/dist/registered.js +98 -0
  230. package/components/menu/README.md +145 -0
  231. package/components/menu/demo/api.html +62 -0
  232. package/components/menu/demo/api.js +27 -0
  233. package/components/menu/demo/api.md +1011 -0
  234. package/components/menu/demo/api.min.js +1762 -0
  235. package/components/menu/demo/index.html +58 -0
  236. package/components/menu/demo/index.js +28 -0
  237. package/components/menu/demo/index.md +61 -0
  238. package/components/menu/demo/index.min.js +1708 -0
  239. package/components/menu/demo/readme.html +57 -0
  240. package/components/menu/demo/readme.md +145 -0
  241. package/components/menu/dist/auro-menu-utils.d.ts +34 -0
  242. package/components/menu/dist/auro-menu.d.ts +246 -0
  243. package/components/menu/dist/auro-menuoption.d.ts +81 -0
  244. package/components/menu/dist/dropdownVersion.d.ts +2 -0
  245. package/components/menu/dist/iconVersion.d.ts +2 -0
  246. package/components/menu/dist/index.d.ts +4 -0
  247. package/components/menu/dist/index.js +1691 -0
  248. package/components/menu/dist/registered.js +1651 -0
  249. package/components/menu/dist/styles/default/color-menu-css.d.ts +2 -0
  250. package/components/menu/dist/styles/default/color-menuoption-css.d.ts +2 -0
  251. package/components/menu/dist/styles/default/style-menu-css.d.ts +2 -0
  252. package/components/menu/dist/styles/default/style-menuoption-css.d.ts +2 -0
  253. package/components/menu/dist/styles/default/tokens-css.d.ts +2 -0
  254. package/components/radio/README.md +137 -0
  255. package/components/radio/demo/api.html +59 -0
  256. package/components/radio/demo/api.js +19 -0
  257. package/components/radio/demo/api.md +602 -0
  258. package/components/radio/demo/api.min.js +1951 -0
  259. package/components/radio/demo/index.html +56 -0
  260. package/components/radio/demo/index.js +8 -0
  261. package/components/radio/demo/index.md +150 -0
  262. package/components/radio/demo/index.min.js +1908 -0
  263. package/components/radio/demo/readme.html +57 -0
  264. package/components/radio/demo/readme.md +137 -0
  265. package/components/radio/dist/auro-radio-group.d.ts +194 -0
  266. package/components/radio/dist/auro-radio.d.ts +147 -0
  267. package/components/radio/dist/helptextVersion.d.ts +2 -0
  268. package/components/radio/dist/index.d.ts +3 -0
  269. package/components/radio/dist/index.js +1857 -0
  270. package/components/radio/dist/registered.js +1858 -0
  271. package/components/radio/dist/styles/auro-radio-group-css.d.ts +2 -0
  272. package/components/radio/dist/styles/color-css.d.ts +2 -0
  273. package/components/radio/dist/styles/groupColor-css.d.ts +2 -0
  274. package/components/radio/dist/styles/style-css.d.ts +2 -0
  275. package/components/radio/dist/styles/tokens-css.d.ts +2 -0
  276. package/components/select/README.md +145 -0
  277. package/components/select/demo/api.html +77 -0
  278. package/components/select/demo/api.js +35 -0
  279. package/components/select/demo/api.md +1413 -0
  280. package/components/select/demo/api.min.js +10502 -0
  281. package/components/select/demo/index.html +73 -0
  282. package/components/select/demo/index.js +9 -0
  283. package/components/select/demo/index.md +1151 -0
  284. package/components/select/demo/index.min.js +10390 -0
  285. package/components/select/demo/readme.html +57 -0
  286. package/components/select/demo/readme.md +145 -0
  287. package/components/select/dist/auro-select.d.ts +512 -0
  288. package/components/select/dist/bibtemplateVersion.d.ts +2 -0
  289. package/components/select/dist/dropdownVersion.d.ts +2 -0
  290. package/components/select/dist/helptextVersion.d.ts +2 -0
  291. package/components/select/dist/index.d.ts +2 -0
  292. package/components/select/dist/index.js +8898 -0
  293. package/components/select/dist/registered.js +8898 -0
  294. package/components/select/dist/styles/shapeSize-css.d.ts +2 -0
  295. package/components/select/dist/styles/style-css.d.ts +2 -0
  296. package/components/select/dist/styles/tokens-css.d.ts +2 -0
  297. package/package.json +218 -0
@@ -0,0 +1,1951 @@
1
+ function dynamicExample() {
2
+ const values = ['Yes', 'No', 'Maybe'];
3
+ const radioGroup = document.getElementById('dynamicExample');
4
+
5
+ for (let i = 0; i < values.length; i++) {
6
+ const radio = document.createElement('auro-radio');
7
+
8
+ radio.id = `dynamicRadio${i}`;
9
+ radio.label = values[i];
10
+ radio.name = 'radioDemo';
11
+ radio.value = values[i];
12
+ radio.textContent = values[i];
13
+
14
+ radioGroup.appendChild(radio);
15
+ }
16
+ }
17
+
18
+ function resetStateExample() {
19
+ const elem = document.querySelector('#resetStateExample');
20
+
21
+ document.querySelector('#resetStateBtn').addEventListener('click', () => {
22
+ elem.reset();
23
+ });
24
+ }
25
+
26
+ /**
27
+ * @license
28
+ * Copyright 2019 Google LLC
29
+ * SPDX-License-Identifier: BSD-3-Clause
30
+ */
31
+ const t$2=globalThis,e$4=t$2.ShadowRoot&&(void 0===t$2.ShadyCSS||t$2.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s$3=Symbol(),o$5=new WeakMap;let n$3 = class n{constructor(t,e,o){if(this._$cssResult$=true,o!==s$3)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e;}get styleSheet(){let t=this.o;const s=this.t;if(e$4&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=o$5.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&o$5.set(s,t));}return t}toString(){return this.cssText}};const r$2=t=>new n$3("string"==typeof t?t:t+"",void 0,s$3),i$5=(t,...e)=>{const o=1===t.length?t[0]:e.reduce(((e,s,o)=>e+(t=>{if(true===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[o+1]),t[0]);return new n$3(o,t,s$3)},S$1=(s,o)=>{if(e$4)s.adoptedStyleSheets=o.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const e of o){const o=document.createElement("style"),n=t$2.litNonce;void 0!==n&&o.setAttribute("nonce",n),o.textContent=e.cssText,s.appendChild(o);}},c$2=e$4?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return r$2(e)})(t):t;
32
+
33
+ /**
34
+ * @license
35
+ * Copyright 2017 Google LLC
36
+ * SPDX-License-Identifier: BSD-3-Clause
37
+ */const{is:i$4,defineProperty:e$3,getOwnPropertyDescriptor:h$1,getOwnPropertyNames:r$1,getOwnPropertySymbols:o$4,getPrototypeOf:n$2}=Object,a$2=globalThis,c$1=a$2.trustedTypes,l$2=c$1?c$1.emptyScript:"",p$1=a$2.reactiveElementPolyfillSupport,d$1=(t,s)=>t,u$2={toAttribute(t,s){switch(s){case Boolean:t=t?l$2:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t);}return t},fromAttribute(t,s){let i=t;switch(s){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t);}catch(t){i=null;}}return i}},f$1=(t,s)=>!i$4(t,s),b={attribute:true,type:String,converter:u$2,reflect:false,useDefault:false,hasChanged:f$1};Symbol.metadata??=Symbol("metadata"),a$2.litPropertyMetadata??=new WeakMap;let y$1 = class y extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t);}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,s=b){if(s.state&&(s.attribute=false),this._$Ei(),this.prototype.hasOwnProperty(t)&&((s=Object.create(s)).wrapped=true),this.elementProperties.set(t,s),!s.noAccessor){const i=Symbol(),h=this.getPropertyDescriptor(t,i,s);void 0!==h&&e$3(this.prototype,t,h);}}static getPropertyDescriptor(t,s,i){const{get:e,set:r}=h$1(this.prototype,t)??{get(){return this[s]},set(t){this[s]=t;}};return {get:e,set(s){const h=e?.call(this);r?.call(this,s),this.requestUpdate(t,h,i);},configurable:true,enumerable:true}}static getPropertyOptions(t){return this.elementProperties.get(t)??b}static _$Ei(){if(this.hasOwnProperty(d$1("elementProperties")))return;const t=n$2(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties);}static finalize(){if(this.hasOwnProperty(d$1("finalized")))return;if(this.finalized=true,this._$Ei(),this.hasOwnProperty(d$1("properties"))){const t=this.properties,s=[...r$1(t),...o$4(t)];for(const i of s)this.createProperty(i,t[i]);}const t=this[Symbol.metadata];if(null!==t){const s=litPropertyMetadata.get(t);if(void 0!==s)for(const[t,i]of s)this.elementProperties.set(t,i);}this._$Eh=new Map;for(const[t,s]of this.elementProperties){const i=this._$Eu(t,s);void 0!==i&&this._$Eh.set(i,t);}this.elementStyles=this.finalizeStyles(this.styles);}static finalizeStyles(s){const i=[];if(Array.isArray(s)){const e=new Set(s.flat(1/0).reverse());for(const s of e)i.unshift(c$2(s));}else void 0!==s&&i.push(c$2(s));return i}static _$Eu(t,s){const i=s.attribute;return false===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=false,this.hasUpdated=false,this._$Em=null,this._$Ev();}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)));}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.();}removeController(t){this._$EO?.delete(t);}_$E_(){const t=new Map,s=this.constructor.elementProperties;for(const i of s.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t);}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return S$1(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(true),this._$EO?.forEach((t=>t.hostConnected?.()));}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()));}attributeChangedCallback(t,s,i){this._$AK(t,i);}_$ET(t,s){const i=this.constructor.elementProperties.get(t),e=this.constructor._$Eu(t,i);if(void 0!==e&&true===i.reflect){const h=(void 0!==i.converter?.toAttribute?i.converter:u$2).toAttribute(s,i.type);this._$Em=t,null==h?this.removeAttribute(e):this.setAttribute(e,h),this._$Em=null;}}_$AK(t,s){const i=this.constructor,e=i._$Eh.get(t);if(void 0!==e&&this._$Em!==e){const t=i.getPropertyOptions(e),h="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:u$2;this._$Em=e;const r=h.fromAttribute(s,t.type);this[e]=r??this._$Ej?.get(e)??r,this._$Em=null;}}requestUpdate(t,s,i){if(void 0!==t){const e=this.constructor,h=this[t];if(i??=e.getPropertyOptions(t),!((i.hasChanged??f$1)(h,s)||i.useDefault&&i.reflect&&h===this._$Ej?.get(t)&&!this.hasAttribute(e._$Eu(t,i))))return;this.C(t,s,i);} false===this.isUpdatePending&&(this._$ES=this._$EP());}C(t,s,{useDefault:i,reflect:e,wrapped:h},r){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,r??s??this[t]),true!==h||void 0!==r)||(this._$AL.has(t)||(this.hasUpdated||i||(s=void 0),this._$AL.set(t,s)),true===e&&this._$Em!==t&&(this._$Eq??=new Set).add(t));}async _$EP(){this.isUpdatePending=true;try{await this._$ES;}catch(t){Promise.reject(t);}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,s]of this._$Ep)this[t]=s;this._$Ep=void 0;}const t=this.constructor.elementProperties;if(t.size>0)for(const[s,i]of t){const{wrapped:t}=i,e=this[s];true!==t||this._$AL.has(s)||void 0===e||this.C(s,void 0,i,e);}}let t=false;const s=this._$AL;try{t=this.shouldUpdate(s),t?(this.willUpdate(s),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(s)):this._$EM();}catch(s){throw t=false,this._$EM(),s}t&&this._$AE(s);}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=true,this.firstUpdated(t)),this.updated(t);}_$EM(){this._$AL=new Map,this.isUpdatePending=false;}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return true}update(t){this._$Eq&&=this._$Eq.forEach((t=>this._$ET(t,this[t]))),this._$EM();}updated(t){}firstUpdated(t){}};y$1.elementStyles=[],y$1.shadowRootOptions={mode:"open"},y$1[d$1("elementProperties")]=new Map,y$1[d$1("finalized")]=new Map,p$1?.({ReactiveElement:y$1}),(a$2.reactiveElementVersions??=[]).push("2.1.1");
38
+
39
+ /**
40
+ * @license
41
+ * Copyright 2017 Google LLC
42
+ * SPDX-License-Identifier: BSD-3-Clause
43
+ */
44
+ const t$1=globalThis,i$3=t$1.trustedTypes,s$2=i$3?i$3.createPolicy("lit-html",{createHTML:t=>t}):void 0,e$2="$lit$",h=`lit$${Math.random().toFixed(9).slice(2)}$`,o$3="?"+h,n$1=`<${o$3}>`,r=document,l$1=()=>r.createComment(""),c=t=>null===t||"object"!=typeof t&&"function"!=typeof t,a$1=Array.isArray,u$1=t=>a$1(t)||"function"==typeof t?.[Symbol.iterator],d="[ \t\n\f\r]",f=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,v=/-->/g,_=/>/g,m=RegExp(`>|${d}(?:([^\\s"'>=/]+)(${d}*=${d}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),p=/'/g,g=/"/g,$=/^(?:script|style|textarea|title)$/i,y=t=>(i,...s)=>({_$litType$:t,strings:i,values:s}),x=y(1),T=Symbol.for("lit-noChange"),E=Symbol.for("lit-nothing"),A=new WeakMap,C=r.createTreeWalker(r,129);function P(t,i){if(!a$1(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==s$2?s$2.createHTML(i):i}const V=(t,i)=>{const s=t.length-1,o=[];let r,l=2===i?"<svg>":3===i?"<math>":"",c=f;for(let i=0;i<s;i++){const s=t[i];let a,u,d=-1,y=0;for(;y<s.length&&(c.lastIndex=y,u=c.exec(s),null!==u);)y=c.lastIndex,c===f?"!--"===u[1]?c=v:void 0!==u[1]?c=_:void 0!==u[2]?($.test(u[2])&&(r=RegExp("</"+u[2],"g")),c=m):void 0!==u[3]&&(c=m):c===m?">"===u[0]?(c=r??f,d=-1):void 0===u[1]?d=-2:(d=c.lastIndex-u[2].length,a=u[1],c=void 0===u[3]?m:'"'===u[3]?g:p):c===g||c===p?c=m:c===v||c===_?c=f:(c=m,r=void 0);const x=c===m&&t[i+1].startsWith("/>")?" ":"";l+=c===f?s+n$1:d>=0?(o.push(a),s.slice(0,d)+e$2+s.slice(d)+h+x):s+h+(-2===d?i:x);}return [P(t,l+(t[s]||"<?>")+(2===i?"</svg>":3===i?"</math>":"")),o]};class N{constructor({strings:t,_$litType$:s},n){let r;this.parts=[];let c=0,a=0;const u=t.length-1,d=this.parts,[f,v]=V(t,s);if(this.el=N.createElement(f,n),C.currentNode=this.el.content,2===s||3===s){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes);}for(;null!==(r=C.nextNode())&&d.length<u;){if(1===r.nodeType){if(r.hasAttributes())for(const t of r.getAttributeNames())if(t.endsWith(e$2)){const i=v[a++],s=r.getAttribute(t).split(h),e=/([.?@])?(.*)/.exec(i);d.push({type:1,index:c,name:e[2],strings:s,ctor:"."===e[1]?H:"?"===e[1]?I:"@"===e[1]?L:k}),r.removeAttribute(t);}else t.startsWith(h)&&(d.push({type:6,index:c}),r.removeAttribute(t));if($.test(r.tagName)){const t=r.textContent.split(h),s=t.length-1;if(s>0){r.textContent=i$3?i$3.emptyScript:"";for(let i=0;i<s;i++)r.append(t[i],l$1()),C.nextNode(),d.push({type:2,index:++c});r.append(t[s],l$1());}}}else if(8===r.nodeType)if(r.data===o$3)d.push({type:2,index:c});else {let t=-1;for(;-1!==(t=r.data.indexOf(h,t+1));)d.push({type:7,index:c}),t+=h.length-1;}c++;}}static createElement(t,i){const s=r.createElement("template");return s.innerHTML=t,s}}function S(t,i,s=t,e){if(i===T)return i;let h=void 0!==e?s._$Co?.[e]:s._$Cl;const o=c(i)?void 0:i._$litDirective$;return h?.constructor!==o&&(h?._$AO?.(false),void 0===o?h=void 0:(h=new o(t),h._$AT(t,s,e)),void 0!==e?(s._$Co??=[])[e]=h:s._$Cl=h),void 0!==h&&(i=S(t,h._$AS(t,i.values),h,e)),i}class M{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i;}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:i},parts:s}=this._$AD,e=(t?.creationScope??r).importNode(i,true);C.currentNode=e;let h=C.nextNode(),o=0,n=0,l=s[0];for(;void 0!==l;){if(o===l.index){let i;2===l.type?i=new R(h,h.nextSibling,this,t):1===l.type?i=new l.ctor(h,l.name,l.strings,this,t):6===l.type&&(i=new z(h,this,t)),this._$AV.push(i),l=s[++n];}o!==l?.index&&(h=C.nextNode(),o++);}return C.currentNode=r,e}p(t){let i=0;for(const s of this._$AV) void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,i),i+=s.strings.length-2):s._$AI(t[i])),i++;}}class R{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,i,s,e){this.type=2,this._$AH=E,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=e,this._$Cv=e?.isConnected??true;}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===t?.nodeType&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=S(this,t,i),c(t)?t===E||null==t||""===t?(this._$AH!==E&&this._$AR(),this._$AH=E):t!==this._$AH&&t!==T&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):u$1(t)?this.k(t):this._(t);}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t));}_(t){this._$AH!==E&&c(this._$AH)?this._$AA.nextSibling.data=t:this.T(r.createTextNode(t)),this._$AH=t;}$(t){const{values:i,_$litType$:s}=t,e="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=N.createElement(P(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===e)this._$AH.p(i);else {const t=new M(e,this),s=t.u(this.options);t.p(i),this.T(s),this._$AH=t;}}_$AC(t){let i=A.get(t.strings);return void 0===i&&A.set(t.strings,i=new N(t)),i}k(t){a$1(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let s,e=0;for(const h of t)e===i.length?i.push(s=new R(this.O(l$1()),this.O(l$1()),this,this.options)):s=i[e],s._$AI(h),e++;e<i.length&&(this._$AR(s&&s._$AB.nextSibling,e),i.length=e);}_$AR(t=this._$AA.nextSibling,i){for(this._$AP?.(false,true,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i;}}setConnected(t){ void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t));}}class k{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,i,s,e,h){this.type=1,this._$AH=E,this._$AN=void 0,this.element=t,this.name=i,this._$AM=e,this.options=h,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=E;}_$AI(t,i=this,s,e){const h=this.strings;let o=false;if(void 0===h)t=S(this,t,i,0),o=!c(t)||t!==this._$AH&&t!==T,o&&(this._$AH=t);else {const e=t;let n,r;for(t=h[0],n=0;n<h.length-1;n++)r=S(this,e[s+n],i,n),r===T&&(r=this._$AH[n]),o||=!c(r)||r!==this._$AH[n],r===E?t=E:t!==E&&(t+=(r??"")+h[n+1]),this._$AH[n]=r;}o&&!e&&this.j(t);}j(t){t===E?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"");}}class H extends k{constructor(){super(...arguments),this.type=3;}j(t){this.element[this.name]=t===E?void 0:t;}}class I extends k{constructor(){super(...arguments),this.type=4;}j(t){this.element.toggleAttribute(this.name,!!t&&t!==E);}}class L extends k{constructor(t,i,s,e,h){super(t,i,s,e,h),this.type=5;}_$AI(t,i=this){if((t=S(this,t,i,0)??E)===T)return;const s=this._$AH,e=t===E&&s!==E||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,h=t!==E&&(s===E||e);e&&this.element.removeEventListener(this.name,this,s),h&&this.element.addEventListener(this.name,this,t),this._$AH=t;}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t);}}class z{constructor(t,i,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=s;}get _$AU(){return this._$AM._$AU}_$AI(t){S(this,t);}}const j=t$1.litHtmlPolyfillSupport;j?.(N,R),(t$1.litHtmlVersions??=[]).push("3.3.0");const B=(t,i,s)=>{const e=s?.renderBefore??i;let h=e._$litPart$;if(void 0===h){const t=s?.renderBefore??null;e._$litPart$=h=new R(i.insertBefore(l$1(),t),t,void 0,s??{});}return h._$AI(t),h};
45
+
46
+ /**
47
+ * @license
48
+ * Copyright 2017 Google LLC
49
+ * SPDX-License-Identifier: BSD-3-Clause
50
+ */const s$1=globalThis;let i$2 = class i extends y$1{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0;}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=B(r,this.renderRoot,this.renderOptions);}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(true);}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(false);}render(){return T}};i$2._$litElement$=true,i$2["finalized"]=true,s$1.litElementHydrateSupport?.({LitElement:i$2});const o$2=s$1.litElementPolyfillSupport;o$2?.({LitElement:i$2});(s$1.litElementVersions??=[]).push("4.2.0");
51
+
52
+ /**
53
+ * @license
54
+ * Copyright 2017 Google LLC
55
+ * SPDX-License-Identifier: BSD-3-Clause
56
+ */
57
+ const t={ATTRIBUTE:1},e$1=t=>(...e)=>({_$litDirective$:t,values:e});let i$1 = class i{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i;}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};
58
+
59
+ /**
60
+ * @license
61
+ * Copyright 2018 Google LLC
62
+ * SPDX-License-Identifier: BSD-3-Clause
63
+ */const e=e$1(class extends i$1{constructor(t$1){if(super(t$1),t$1.type!==t.ATTRIBUTE||"class"!==t$1.name||t$1.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return " "+Object.keys(t).filter((s=>t[s])).join(" ")+" "}update(s,[i]){if(void 0===this.st){this.st=new Set,void 0!==s.strings&&(this.nt=new Set(s.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in i)i[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(i)}const r=s.element.classList;for(const t of this.st)t in i||(r.remove(t),this.st.delete(t));for(const t in i){const s=!!i[t];s===this.st.has(t)||this.nt?.has(t)||(s?(r.add(t),this.st.add(t)):(r.remove(t),this.st.delete(t)));}return T}});
64
+
65
+ /**
66
+ * @license
67
+ * Copyright 2018 Google LLC
68
+ * SPDX-License-Identifier: BSD-3-Clause
69
+ */const o$1=o=>o??E;
70
+
71
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t():"function"==typeof define&&define.amd?define(t):t();}(0,function(){function e(e){var t=true,n=false,o=null,d={text:true,search:true,url:true,tel:true,email:true,password:true,number:true,date:true,month:true,week:true,time:true,datetime:true,"datetime-local":true};function i(e){return !!(e&&e!==document&&"HTML"!==e.nodeName&&"BODY"!==e.nodeName&&"classList"in e&&"contains"in e.classList)}function s(e){e.classList.contains("focus-visible")||(e.classList.add("focus-visible"),e.setAttribute("data-focus-visible-added",""));}function u(e){t=false;}function a(){document.addEventListener("mousemove",c),document.addEventListener("mousedown",c),document.addEventListener("mouseup",c),document.addEventListener("pointermove",c),document.addEventListener("pointerdown",c),document.addEventListener("pointerup",c),document.addEventListener("touchmove",c),document.addEventListener("touchstart",c),document.addEventListener("touchend",c);}function c(e){e.target.nodeName&&"html"===e.target.nodeName.toLowerCase()||(t=false,document.removeEventListener("mousemove",c),document.removeEventListener("mousedown",c),document.removeEventListener("mouseup",c),document.removeEventListener("pointermove",c),document.removeEventListener("pointerdown",c),document.removeEventListener("pointerup",c),document.removeEventListener("touchmove",c),document.removeEventListener("touchstart",c),document.removeEventListener("touchend",c));}document.addEventListener("keydown",function(n){n.metaKey||n.altKey||n.ctrlKey||(i(e.activeElement)&&s(e.activeElement),t=true);},true),document.addEventListener("mousedown",u,true),document.addEventListener("pointerdown",u,true),document.addEventListener("touchstart",u,true),document.addEventListener("visibilitychange",function(e){"hidden"===document.visibilityState&&(n&&(t=true),a());},true),a(),e.addEventListener("focus",function(e){var n,o,u;i(e.target)&&(t||(n=e.target,o=n.type,"INPUT"===(u=n.tagName)&&d[o]&&!n.readOnly||"TEXTAREA"===u&&!n.readOnly||n.isContentEditable))&&s(e.target);},true),e.addEventListener("blur",function(e){var t;i(e.target)&&(e.target.classList.contains("focus-visible")||e.target.hasAttribute("data-focus-visible-added"))&&(n=true,window.clearTimeout(o),o=window.setTimeout(function(){n=false;},100),(t=e.target).hasAttribute("data-focus-visible-added")&&(t.classList.remove("focus-visible"),t.removeAttribute("data-focus-visible-added")));},true),e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&e.host?e.host.setAttribute("data-js-focus-visible",""):e.nodeType===Node.DOCUMENT_NODE&&(document.documentElement.classList.add("js-focus-visible"),document.documentElement.setAttribute("data-js-focus-visible",""));}if("undefined"!=typeof window&&"undefined"!=typeof document){var t;window.applyFocusVisiblePolyfill=e;try{t=new CustomEvent("focus-visible-polyfill-ready");}catch(e){(t=document.createEvent("CustomEvent")).initCustomEvent("focus-visible-polyfill-ready",false,false,{});}window.dispatchEvent(t);}"undefined"!=typeof document&&e(document);});
72
+
73
+ var styleCss$2 = i$5`.body-default{font-size:var(--wcss-body-default-font-size, 1rem);line-height:var(--wcss-body-default-line-height, 1.5rem)}.body-default,.body-lg{font-family:var(--wcss-body-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-weight:var(--wcss-body-weight, 450);letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-lg{font-size:var(--wcss-body-lg-font-size, 1.125rem);line-height:var(--wcss-body-lg-line-height, 1.625rem)}.body-sm{font-size:var(--wcss-body-sm-font-size, 0.875rem);line-height:var(--wcss-body-sm-line-height, 1.25rem)}.body-sm,.body-xs{font-family:var(--wcss-body-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-weight:var(--wcss-body-weight, 450);letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-xs{font-size:var(--wcss-body-xs-font-size, 0.75rem);line-height:var(--wcss-body-xs-line-height, 1rem)}.body-2xs{font-family:var(--wcss-body-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-body-2xs-font-size, 0.625rem);font-weight:var(--wcss-body-weight, 450);letter-spacing:var(--wcss-body-letter-spacing, 0);line-height:var(--wcss-body-2xs-line-height, 0.875rem)}.display-2xl{font-family:var(--wcss-display-2xl-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-2xl-font-size, clamp(3.5rem, 6vw, 5.375rem));font-weight:var(--wcss-display-2xl-weight, 300);letter-spacing:var(--wcss-display-2xl-letter-spacing, 0);line-height:var(--wcss-display-2xl-line-height, 1.3)}.display-xl{font-family:var(--wcss-display-xl-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-xl-font-size, clamp(3rem, 5.3333333333vw, 4.5rem));font-weight:var(--wcss-display-xl-weight, 300);letter-spacing:var(--wcss-display-xl-letter-spacing, 0);line-height:var(--wcss-display-xl-line-height, 1.3)}.display-lg{font-family:var(--wcss-display-lg-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-lg-font-size, clamp(2.75rem, 4.6666666667vw, 4rem));font-weight:var(--wcss-display-lg-weight, 300);letter-spacing:var(--wcss-display-lg-letter-spacing, 0);line-height:var(--wcss-display-lg-line-height, 1.3)}.display-md{font-family:var(--wcss-display-md-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-md-font-size, clamp(2.5rem, 4vw, 3.5rem));font-weight:var(--wcss-display-md-weight, 300);letter-spacing:var(--wcss-display-md-letter-spacing, 0);line-height:var(--wcss-display-md-line-height, 1.3)}.display-sm{font-family:var(--wcss-display-sm-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-sm-font-size, clamp(2rem, 3.6666666667vw, 3rem));font-weight:var(--wcss-display-sm-weight, 300);letter-spacing:var(--wcss-display-sm-letter-spacing, 0);line-height:var(--wcss-display-sm-line-height, 1.3)}.display-xs{font-family:var(--wcss-display-xs-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-xs-font-size, clamp(1.75rem, 3vw, 2.375rem));font-weight:var(--wcss-display-xs-weight, 300);letter-spacing:var(--wcss-display-xs-letter-spacing, 0);line-height:var(--wcss-display-xs-line-height, 1.3)}.heading-xl{font-family:var(--wcss-heading-xl-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-xl-font-size, clamp(2rem, 3vw, 2.5rem));font-weight:var(--wcss-heading-xl-weight, 300);letter-spacing:var(--wcss-heading-xl-letter-spacing, 0);line-height:var(--wcss-heading-xl-line-height, 1.3)}.heading-lg{font-family:var(--wcss-heading-lg-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-lg-font-size, clamp(1.75rem, 2.6666666667vw, 2.25rem));font-weight:var(--wcss-heading-lg-weight, 300);letter-spacing:var(--wcss-heading-lg-letter-spacing, 0);line-height:var(--wcss-heading-lg-line-height, 1.3)}.heading-md{font-family:var(--wcss-heading-md-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-md-font-size, clamp(1.625rem, 2.3333333333vw, 1.75rem));font-weight:var(--wcss-heading-md-weight, 300);letter-spacing:var(--wcss-heading-md-letter-spacing, 0);line-height:var(--wcss-heading-md-line-height, 1.3)}.heading-sm{font-family:var(--wcss-heading-sm-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-sm-font-size, clamp(1.375rem, 2vw, 1.5rem));font-weight:var(--wcss-heading-sm-weight, 300);letter-spacing:var(--wcss-heading-sm-letter-spacing, 0);line-height:var(--wcss-heading-sm-line-height, 1.3)}.heading-xs{font-family:var(--wcss-heading-xs-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-xs-font-size, clamp(1.25rem, 1.6666666667vw, 1.25rem));font-weight:var(--wcss-heading-xs-weight, 450);letter-spacing:var(--wcss-heading-xs-letter-spacing, 0);line-height:var(--wcss-heading-xs-line-height, 1.3)}.heading-2xs{font-family:var(--wcss-heading-2xs-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-2xs-font-size, clamp(1.125rem, 1.5vw, 1.125rem));font-weight:var(--wcss-heading-2xs-weight, 450);letter-spacing:var(--wcss-heading-2xs-letter-spacing, 0);line-height:var(--wcss-heading-2xs-line-height, 1.3)}.accent-2xl{font-family:var(--wcss-accent-2xl-family, "Good OT", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-2xl-font-size, clamp(2rem, 3.1666666667vw, 2.375rem));font-weight:var(--wcss-accent-2xl-weight, 450);letter-spacing:var(--wcss-accent-2xl-letter-spacing, 0.05em);line-height:var(--wcss-accent-2xl-line-height, 1)}.accent-2xl,.accent-xl{text-transform:uppercase}.accent-xl{font-family:var(--wcss-accent-xl-family, "Good OT", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-xl-font-size, clamp(1.625rem, 2.3333333333vw, 2rem));font-weight:var(--wcss-accent-xl-weight, 450);letter-spacing:var(--wcss-accent-xl-letter-spacing, 0.05em);line-height:var(--wcss-accent-xl-line-height, 1.3)}.accent-lg{font-family:var(--wcss-accent-lg-family, "Good OT", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-lg-font-size, clamp(1.5rem, 2.1666666667vw, 1.75rem));font-weight:var(--wcss-accent-lg-weight, 450);letter-spacing:var(--wcss-accent-lg-letter-spacing, 0.05em);line-height:var(--wcss-accent-lg-line-height, 1.3)}.accent-lg,.accent-md{text-transform:uppercase}.accent-md{font-family:var(--wcss-accent-md-family, "Good OT", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-md-font-size, clamp(1.375rem, 1.8333333333vw, 1.5rem));font-weight:var(--wcss-accent-md-weight, 500);letter-spacing:var(--wcss-accent-md-letter-spacing, 0.05em);line-height:var(--wcss-accent-md-line-height, 1.3)}.accent-sm{font-family:var(--wcss-accent-sm-family, "Good OT", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-sm-font-size, clamp(1.125rem, 1.5vw, 1.25rem));font-weight:var(--wcss-accent-sm-weight, 500);letter-spacing:var(--wcss-accent-sm-letter-spacing, 0.05em);line-height:var(--wcss-accent-sm-line-height, 1.3)}.accent-sm,.accent-xs{text-transform:uppercase}.accent-xs{font-family:var(--wcss-accent-xs-family, "Good OT", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-xs-font-size, clamp(1rem, 1.3333333333vw, 1rem));font-weight:var(--wcss-accent-xs-weight, 500);letter-spacing:var(--wcss-accent-xs-letter-spacing, 0.1em);line-height:var(--wcss-accent-xs-line-height, 1.3)}.accent-2xs{font-family:var(--wcss-accent-2xs-family, "Good OT", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-2xs-font-size, clamp(0.875rem, 1.1666666667vw, 0.875rem));font-weight:var(--wcss-accent-2xs-weight, 450);letter-spacing:var(--wcss-accent-2xs-letter-spacing, 0.1em);line-height:var(--wcss-accent-2xs-line-height, 1.3);text-transform:uppercase}:focus:not(:focus-visible){outline:3px solid transparent}.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock{display:block}.util_displayFlex{display:flex}.util_displayHidden{display:none}.util_displayHiddenVisually{position:absolute;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);width:1px;height:1px;padding:0;border:0}:host{display:block;outline:unset}:host(.focus-visible) .displayFlex .inputGroup:focus-within{width:auto}:host(.focus-visible) .rdoGroup{display:block;padding-right:var(--ds-size-100, 0.5rem);outline:3px solid transparent}:host(.focus-visible) .rdoGroup .label:after{outline-width:1px;outline-style:solid}.rdoGroup{position:relative;padding-right:var(--ds-size-100, 0.5rem);padding-left:var(--ds-size-100, 0.5rem);padding-top:var(--ds-size-50, 0.25rem);padding-bottom:var(--ds-size-75, 0.375rem)}.label{display:block;margin-left:var(--ds-size-300, 1.5rem)}.label:hover{cursor:pointer}.label:after{position:absolute;z-index:1;top:var(--ds-size-50, 0.25rem);left:var(--ds-size-50, 0.25rem);width:calc(var(--ds-size-200, 1rem) + var(--ds-size-50, 0.25rem));height:calc(var(--ds-size-200, 1rem) + var(--ds-size-50, 0.25rem));content:"";border-radius:50%;border:1px solid}.slotContent{display:block;margin-left:var(--ds-size-400, 2rem);padding-left:var(--ds-size-100, 0.5rem)}`;
74
+
75
+ var colorCss$2 = i$5`.label{color:var(--ds-auro-radio-label-color)}.label:after{background-color:var(--ds-auro-radio-btn-fill-color);border-color:var(--ds-auro-radio-btn-border-color);box-shadow:inset 0 0 0 3px var(--ds-auro-radio-btn-inset-color);outline-color:var(--ds-auro-radio-btn-border-color);-webkit-tap-highlight-color:var(--ds-auro-radio-tap-color)}:host([checked]){--ds-auro-radio-btn-inset-color: var(--ds-advanced-color-boolean-indicator, #ffffff);--ds-auro-radio-btn-fill-color: var(--ds-advanced-color-boolean-istrue, #01426a);--ds-auro-radio-btn-border-color: var(--ds-advanced-color-boolean-istrue, #01426a)}:host([error]){--ds-auro-radio-btn-border-color: var(--ds-advanced-color-boolean-error, #e31f26)}:host([checked][error]){--ds-auro-radio-btn-fill-color: var(--ds-advanced-color-boolean-error, #e31f26)}:host([disabled]){--ds-auro-radio-btn-border-color: var(--ds-advanced-color-state-background-disabled, #dddddd);--ds-auro-radio-label-color: var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host([checked][disabled]){--ds-auro-radio-btn-fill-color: var(--ds-advanced-color-state-background-disabled, #dddddd)}:host(.focus-visible){--ds-auro-radio-btn-border-color: var(--ds-advanced-color-state-focused, #01426a)}:host([onDark]){--ds-auro-radio-label-color: var(--ds-basic-color-texticon-inverse, #ffffff);--ds-auro-radio-btn-border-color: var(--ds-basic-color-border-inverse, #ffffff)}:host([onDark][checked]){--ds-auro-radio-btn-inset-color: var(--ds-advanced-color-boolean-indicator-inverse, #00274a);--ds-auro-radio-btn-fill-color: var(--ds-advanced-color-boolean-istrue-inverse, #ffffff);--ds-auro-radio-btn-border-color: var(--ds-advanced-color-boolean-istrue-inverse, #ffffff)}:host([onDark][error]){--ds-auro-radio-btn-border-color: var(--ds-advanced-color-boolean-error-inverse, #f9a4a8)}:host([onDark][checked][error]){--ds-auro-radio-btn-fill-color: var(--ds-advanced-color-boolean-error-inverse, #f9a4a8)}:host([onDark][disabled]){--ds-auro-radio-btn-border-color: var(--ds-advanced-color-state-background-inverse-disabled, #7e8894);--ds-auro-radio-label-color: var(--ds-basic-color-texticon-inverse-disabled, #7e8894)}:host([onDark][checked][disabled]){--ds-auro-radio-btn-fill-color: var(--ds-advanced-color-state-background-inverse-disabled, #7e8894)}:host([onDark].focus-visible){--ds-auro-radio-btn-border-color: var(--ds-advanced-color-state-focused-inverse, #ffffff)}`;
76
+
77
+ var tokenCss = i$5`:host{--ds-auro-radio-group-label-color: inherit;--ds-auro-radio-btn-border-color: var(--ds-basic-color-border-bold, #585e67);--ds-auro-radio-btn-fill-color: transparent;--ds-auro-radio-btn-inset-color: transparent;--ds-auro-radio-label-color: inherit;--ds-auro-radio-tap-color: transparent}`;
78
+
79
+ // Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
80
+ // See LICENSE in the project root for license information.
81
+
82
+ // ---------------------------------------------------------------------
83
+
84
+ /* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
85
+
86
+ let AuroLibraryRuntimeUtils$1 = class AuroLibraryRuntimeUtils {
87
+
88
+ /* eslint-disable jsdoc/require-param */
89
+
90
+ /**
91
+ * This will register a new custom element with the browser.
92
+ * @param {String} name - The name of the custom element.
93
+ * @param {Object} componentClass - The class to register as a custom element.
94
+ * @returns {void}
95
+ */
96
+ registerComponent(name, componentClass) {
97
+ if (!customElements.get(name)) {
98
+ customElements.define(name, class extends componentClass {});
99
+ }
100
+ }
101
+
102
+ /**
103
+ * Finds and returns the closest HTML Element based on a selector.
104
+ * @returns {void}
105
+ */
106
+ closestElement(
107
+ selector, // selector like in .closest()
108
+ base = this, // extra functionality to skip a parent
109
+ __Closest = (el, found = el && el.closest(selector)) =>
110
+ !el || el === document || el === window
111
+ ? null // standard .closest() returns null for non-found selectors also
112
+ : found
113
+ ? found // found a selector INside this element
114
+ : __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
115
+ ) {
116
+ return __Closest(base);
117
+ }
118
+ /* eslint-enable jsdoc/require-param */
119
+
120
+ /**
121
+ * If the element passed is registered with a different tag name than what is passed in, the tag name is added as an attribute to the element.
122
+ * @param {Object} elem - The element to check.
123
+ * @param {String} tagName - The name of the Auro component to check for or add as an attribute.
124
+ * @returns {void}
125
+ */
126
+ handleComponentTagRename(elem, tagName) {
127
+ const tag = tagName.toLowerCase();
128
+ const elemTag = elem.tagName.toLowerCase();
129
+
130
+ if (elemTag !== tag) {
131
+ elem.setAttribute(tag, true);
132
+ }
133
+ }
134
+
135
+ /**
136
+ * Validates if an element is a specific Auro component.
137
+ * @param {Object} elem - The element to validate.
138
+ * @param {String} tagName - The name of the Auro component to check against.
139
+ * @returns {Boolean} - Returns true if the element is the specified Auro component.
140
+ */
141
+ elementMatch(elem, tagName) {
142
+ const tag = tagName.toLowerCase();
143
+ const elemTag = elem.tagName.toLowerCase();
144
+
145
+ return elemTag === tag || elem.hasAttribute(tag);
146
+ }
147
+ };
148
+
149
+ /* eslint-disable max-lines */
150
+ // Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
151
+ // See LICENSE in the project root for license information.
152
+
153
+
154
+ /**
155
+ * @attr {Boolean} checked - If set to true, the radio button will be filled.
156
+ * @attr {Boolean} disabled - If set to true, the radio button will be non-clickable.
157
+ * @attr {Boolean} required - Defines element as required.
158
+ * @attr {Boolean} error - If set to true, sets an error state on the radio button.
159
+ * @attr {Boolean} onDark - If set to true, the component will render with a dark theme.
160
+ * @event toggleSelected - Notifies that the component has toggled the checked/selected state.
161
+ *
162
+ * @prop {string} id - The id global attribute defines an identifier (ID) which must be unique in the whole document.
163
+ * @attr id
164
+ *
165
+ * @event {CustomEvent<any>} change - (Deprecated) Notifies when checked value is changed.
166
+ * @event {InputEvent} input - Notifies when when checked value is changed by user's interface.
167
+ * @event focusSelected - Notifies that the component has gained focus.
168
+ * @event auroRadio-blur - Notifies that the component has lost focus.
169
+ * @event resetRadio - Notifies that the component has reset the checked/selected state.
170
+ * @event auroRadio-selected - Notifies that the component has been marked as checked/selected.
171
+ *
172
+ * @csspart radio - apply css to a specific checkbox.
173
+ * @csspart radio-input - apply css to a specific checkbox's input.
174
+ * @csspart radio-label - apply css to a specific checkbox's label.
175
+ */
176
+
177
+ // build the component class
178
+ class AuroRadio extends i$2 {
179
+ constructor() {
180
+ super();
181
+ this.checked = false;
182
+ this.disabled = false;
183
+ this.required = false;
184
+ this.error = false;
185
+ this.onDark = false;
186
+ this.touched = false;
187
+ this.role = 'radio';
188
+
189
+ /**
190
+ * @private
191
+ */
192
+ this.runtimeUtils = new AuroLibraryRuntimeUtils$1();
193
+ }
194
+
195
+ static get styles() {
196
+ return [
197
+ styleCss$2,
198
+ colorCss$2,
199
+ tokenCss
200
+ ];
201
+ }
202
+
203
+ // function to define props used within the scope of this component
204
+ static get properties() {
205
+ return {
206
+ checked: {
207
+ type: Boolean,
208
+ reflect: true
209
+ },
210
+ disabled: {
211
+ type: Boolean,
212
+ reflect: true
213
+ },
214
+ required: {
215
+ type: Boolean,
216
+ reflect: true
217
+ },
218
+ error: {
219
+ type: Boolean,
220
+ reflect: true
221
+ },
222
+ onDark: {
223
+ type: Boolean,
224
+ reflect: true
225
+ },
226
+ label: { type: String },
227
+ name: { type: String },
228
+ value: { type: String },
229
+
230
+ /**
231
+ * Whether or not the radio button has been touched by the user.
232
+ * @private
233
+ */
234
+ touched: {
235
+ type: Boolean,
236
+ reflect: true,
237
+ attribute: false
238
+ },
239
+
240
+ /**
241
+ * ID for input node.
242
+ * @private
243
+ */
244
+ inputId: {
245
+ type: String,
246
+ reflect: false,
247
+ attribute: false
248
+ },
249
+
250
+ /**
251
+ * Do not add to api doc since changing of this can easily break a11y.
252
+ * @private
253
+ */
254
+ role: {
255
+ type: String,
256
+ reflect: true
257
+ }
258
+ };
259
+ }
260
+
261
+ /**
262
+ * This will register this element with the browser.
263
+ * @param {string} [name="auro-radio"] - The name of element that you want to register to.
264
+ *
265
+ * @example
266
+ * AuroRadio.register("custom-radio") // This will resgiter this element to <custom-radio/>
267
+ *
268
+ */
269
+ static register(name = "auro-radio") {
270
+ AuroLibraryRuntimeUtils$1.prototype.registerComponent(name, AuroRadio);
271
+ }
272
+
273
+ /**
274
+ * Method for handling content when change event is fired.
275
+ * @private
276
+ * @param {Event} event - The trigger event tied to this function.
277
+ * @returns {void}
278
+ */
279
+ handleChange(event) {
280
+ this.checked = event.target.checked;
281
+ const customEvent = new CustomEvent(event.type, event);
282
+ this.dispatchEvent(customEvent);
283
+ }
284
+
285
+ /**
286
+ * Method for handling content when input event is fired.
287
+ * @private
288
+ * @param {Event} event - The trigger event tied to this function.
289
+ * @returns {void}
290
+ */
291
+ handleInput(event) {
292
+ this.checked = event.target.checked;
293
+ this.dispatchEvent(new CustomEvent('toggleSelected', {
294
+ bubbles: true,
295
+ composed: true,
296
+ target: this
297
+ }));
298
+ }
299
+
300
+ /**
301
+ * Method for handling focus event.
302
+ * @private
303
+ * @param {Event} event - The trigger event tied to this function.
304
+ * @returns {void}
305
+ */
306
+ handleFocus(event) {
307
+ this.touched = true;
308
+ this.dispatchEvent(new CustomEvent('focusSelected', {
309
+ bubbles: true,
310
+ composed: true,
311
+ target: event.target
312
+ }));
313
+ }
314
+
315
+ /**
316
+ * Method for handling blur event.
317
+ * @private
318
+ * @param {Event} event - The trigger event tied to this function.
319
+ * @returns {void}
320
+ */
321
+ handleBlur(event) {
322
+ this.dispatchEvent(new CustomEvent('auroRadio-blur', {
323
+ bubbles: true,
324
+ composed: true,
325
+ target: event.target
326
+ }));
327
+ }
328
+
329
+ /**
330
+ * Resets component to initial state.
331
+ * @returns {void}
332
+ */
333
+ reset() {
334
+ this.touched = false;
335
+ this.checked = false;
336
+ this.error = false;
337
+ }
338
+
339
+ updated(changedProperties) {
340
+ if (changedProperties.has('error') || changedProperties.has('validity')) {
341
+ this.setAttribute('aria-invalid', this.error || this.validity !== 'valid' ? 'true' : 'false');
342
+ }
343
+
344
+ if (changedProperties.has('required')) {
345
+ this.setAttribute('aria-required', this.isRequired(this.required));
346
+ }
347
+
348
+ if (changedProperties.has('disabled')) {
349
+ if (this.disabled) {
350
+ this.setAttribute('aria-disabled', '');
351
+ } else {
352
+ this.removeAttribute('aria-disabled');
353
+ }
354
+ }
355
+
356
+ if (changedProperties.has('checked')) {
357
+ this.setAttribute('aria-checked', this.checked ? 'true' : 'false');
358
+ // eslint-disable-next-line no-magic-numbers
359
+ this.setAttribute('tabindex', this.checked ? 0 : -1);
360
+
361
+ this.dispatchEvent(new CustomEvent('resetRadio', {
362
+ bubbles: true,
363
+ composed: true
364
+ }));
365
+
366
+ if (this.checked) {
367
+ this.dispatchEvent(new CustomEvent('auroRadio-selected', {
368
+ bubbles: true,
369
+ composed: true
370
+ }));
371
+ }
372
+ }
373
+ }
374
+
375
+ /**
376
+ * Method for handling passing the required status to aria.
377
+ * @private
378
+ * @param {Boolean} required - The element's required attribute.
379
+ * @returns {void}
380
+ */
381
+ isRequired(required) {
382
+ if (required) {
383
+ return 'true';
384
+ }
385
+
386
+ return 'false';
387
+ }
388
+
389
+ firstUpdated() {
390
+ // Add the tag name as an attribute if it is different than the component name
391
+ this.runtimeUtils.handleComponentTagRename(this, 'auro-radio');
392
+
393
+ this.addEventListener('focus', this.handleFocus);
394
+ this.addEventListener('blur', this.handleBlur);
395
+
396
+ this.input = this.shadowRoot.querySelector('input');
397
+
398
+ this.inputId = this.id ? `${this.id}-input` : window.crypto.randomUUID();
399
+
400
+ this.addEventListener('click', () => {
401
+ this.input.click();
402
+ });
403
+ }
404
+
405
+ // function that renders the HTML and CSS into the scope of the component
406
+ render() {
407
+ const labelClasses = {
408
+ 'ods-inputLabel': true,
409
+ 'ods-inputLabel--radio': true,
410
+ 'label': true,
411
+ 'label--rdo': true,
412
+ 'errorBorder': this.error
413
+ };
414
+
415
+ return x`
416
+ <div class="ods-inputGroup rdoGroup body-default" part="radio">
417
+ <input
418
+ class="util_displayHidden ods-inputOption rdo--input"
419
+ part="radio-input"
420
+ @input="${this.handleInput}"
421
+ @change="${this.handleChange}"
422
+ ?disabled="${this.disabled}"
423
+ .checked="${this.checked}"
424
+ id="${this.inputId}"
425
+ name="${o$1(this.name)}"
426
+ type="radio"
427
+ .value="${this.value}"
428
+ aria-hidden="true"
429
+ tabindex="-1"
430
+ />
431
+
432
+ <label for="${this.inputId}" class="${e(labelClasses)}" part="radio-label">
433
+ <slot>${this.label}</slot>
434
+ </label>
435
+ </div>
436
+ <slot name="content" class="slotContent"></slot>
437
+ `;
438
+ }
439
+ }
440
+
441
+ /**
442
+ * @license
443
+ * Copyright 2020 Google LLC
444
+ * SPDX-License-Identifier: BSD-3-Clause
445
+ */
446
+ const a=Symbol.for(""),o=t=>{if(t?.r===a)return t?._$litStatic$},s=t=>({_$litStatic$:t,r:a}),i=(t,...r)=>({_$litStatic$:r.reduce(((r,e,a)=>r+(t=>{if(void 0!==t._$litStatic$)return t._$litStatic$;throw Error(`Value passed to 'literal' function must be a 'literal' result: ${t}. Use 'unsafeStatic' to pass non-literal values, but\n take care to ensure page security.`)})(e)+t[a+1]),t[0]),r:a}),l=new Map,n=t=>(r,...e)=>{const a=e.length;let s,i;const n=[],u=[];let c,$=0,f=false;for(;$<a;){for(c=r[$];$<a&&void 0!==(i=e[$],s=o(i));)c+=s+r[++$],f=true;$!==a&&u.push(i),n.push(c),$++;}if($===a&&n.push(r[a]),f){const t=n.join("$$lit$$");void 0===(r=l.get(t))&&(n.raw=n,l.set(t,r=n)),e=u;}return t(r,...e)},u=n(x);
447
+
448
+ var styleCss$1 = i$5`:host{display:block;padding-bottom:var(--ds-size-150, 0.75rem)}fieldset{all:unset}.displayFlex legend+slot{display:flex;white-space:nowrap}legend{margin-bottom:var(--ds-size-150, 0.75rem)}[auro-helptext]{margin-top:var(--ds-size-150, 0.75rem)}`;
449
+
450
+ var colorCss$1 = i$5`:host legend{color:var(--ds-auro-radio-group-label-color)}:host([disabled]){--ds-auro-radio-group-label-color: var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host([onDark]){--ds-auro-radio-group-label-color: var(--ds-basic-color-texticon-inverse, #ffffff)}:host([onDark][disabled]){--ds-auro-radio-group-label-color: var(--ds-basic-color-texticon-inverse-disabled, #7e8894)}`;
451
+
452
+ class DateFormatter {
453
+
454
+ constructor() {
455
+
456
+ /**
457
+ * @description Parses a date string into its components.
458
+ * @param {string} dateStr - Date string to parse.
459
+ * @param {string} format - Date format to parse.
460
+ * @returns {Object<key["month" | "day" | "year"]: number>|undefined}
461
+ */
462
+ this.parseDate = (dateStr, format = 'mm/dd/yyyy') => {
463
+
464
+ // Guard Clause: Date string is defined
465
+ if (!dateStr) {
466
+ return undefined;
467
+ }
468
+
469
+ // Assume the separator is a "/" a defined in our code base
470
+ const separator = '/';
471
+
472
+ // Get the parts of the date and format
473
+ const valueParts = dateStr.split(separator);
474
+ const formatParts = format.split(separator);
475
+
476
+ // Check if the value and format have the correct number of parts
477
+ if (valueParts.length !== formatParts.length) {
478
+ throw new Error('AuroDatepickerUtilities | parseDate: Date string and format length do not match');
479
+ }
480
+
481
+ // Holds the result to be returned
482
+ const result = formatParts.reduce((acc, part, index) => {
483
+ const value = valueParts[index];
484
+
485
+ if ((/m/iu).test(part)) {
486
+ acc.month = value;
487
+ } else if ((/d/iu).test(part)) {
488
+ acc.day = value;
489
+ } else if ((/y/iu).test(part)) {
490
+ acc.year = value;
491
+ }
492
+
493
+ return acc;
494
+ }, {});
495
+
496
+ // If we found all the parts, return the result
497
+ if (result.month && result.year) {
498
+ return result;
499
+ }
500
+
501
+ // Throw an error to let the dev know we were unable to parse the date string
502
+ throw new Error('AuroDatepickerUtilities | parseDate: Unable to parse date string');
503
+ };
504
+
505
+ /**
506
+ * Convert a date object to string format.
507
+ * @param {Object} date - Date to convert to string.
508
+ * @param {String} locale - Optional locale to use for the date string. Defaults to user's locale.
509
+ * @returns {String} Returns the date as a string.
510
+ */
511
+ this.getDateAsString = (date, locale = undefined) => date.toLocaleDateString(locale, {
512
+ year: "numeric",
513
+ month: "2-digit",
514
+ day: "2-digit",
515
+ });
516
+
517
+ /**
518
+ * Converts a date string to a North American date format.
519
+ * @param {String} dateStr - Date to validate.
520
+ * @param {String} format - Date format to validate against.
521
+ * @returns {Boolean}
522
+ */
523
+ this.toNorthAmericanFormat = (dateStr, format) => {
524
+
525
+ if (format === 'mm/dd/yyyy') {
526
+ return dateStr;
527
+ }
528
+
529
+ const parsedDate = this.parseDate(dateStr, format);
530
+
531
+ if (!parsedDate) {
532
+ throw new Error('AuroDatepickerUtilities | toNorthAmericanFormat: Unable to parse date string');
533
+ }
534
+
535
+ const { month, day, year } = parsedDate;
536
+
537
+ const dateParts = [];
538
+ if (month) {
539
+ dateParts.push(month);
540
+ }
541
+
542
+ if (day) {
543
+ dateParts.push(day);
544
+ }
545
+
546
+ if (year) {
547
+ dateParts.push(year);
548
+ }
549
+
550
+ return dateParts.join('/');
551
+ };
552
+ }
553
+ }
554
+ const dateFormatter = new DateFormatter();
555
+
556
+ // filepath: dateConstraints.mjs
557
+ const DATE_UTIL_CONSTRAINTS = {
558
+ maxDay: 31,
559
+ maxMonth: 12,
560
+ maxYear: 2400,
561
+ minDay: 1,
562
+ minMonth: 1,
563
+ minYear: 1900,
564
+ };
565
+
566
+ class AuroDateUtilitiesBase {
567
+
568
+ /**
569
+ * @description The maximum day value allowed by the various utilities in this class.
570
+ * @readonly
571
+ * @type {Number}
572
+ */
573
+ get maxDay() {
574
+ return DATE_UTIL_CONSTRAINTS.maxDay;
575
+ }
576
+
577
+ /**
578
+ * @description The maximum month value allowed by the various utilities in this class.
579
+ * @readonly
580
+ * @type {Number}
581
+ */
582
+ get maxMonth() {
583
+ return DATE_UTIL_CONSTRAINTS.maxMonth;
584
+ }
585
+
586
+ /**
587
+ * @description The maximum year value allowed by the various utilities in this class.
588
+ * @readonly
589
+ * @type {Number}
590
+ */
591
+ get maxYear() {
592
+ return DATE_UTIL_CONSTRAINTS.maxYear;
593
+ }
594
+
595
+ /**
596
+ * @description The minimum day value allowed by the various utilities in this class.
597
+ * @readonly
598
+ * @type {Number}
599
+ */
600
+ get minDay() {
601
+ return DATE_UTIL_CONSTRAINTS.minDay;
602
+ }
603
+
604
+ /**
605
+ * @description The minimum month value allowed by the various utilities in this class.
606
+ * @readonly
607
+ * @type {Number}
608
+ */
609
+ get minMonth() {
610
+ return DATE_UTIL_CONSTRAINTS.minMonth;
611
+ }
612
+
613
+ /**
614
+ * @description The minimum year value allowed by the various utilities in this class.
615
+ * @readonly
616
+ * @type {Number}
617
+ */
618
+ get minYear() {
619
+ return DATE_UTIL_CONSTRAINTS.minYear;
620
+ }
621
+ }
622
+
623
+ /* eslint-disable no-magic-numbers */
624
+
625
+ class AuroDateUtilities extends AuroDateUtilitiesBase {
626
+
627
+ /**
628
+ * Returns the current century.
629
+ * @returns {String} The current century.
630
+ */
631
+ getCentury () {
632
+ return String(new Date().getFullYear()).slice(0, 2);
633
+ }
634
+
635
+ /**
636
+ * Returns a four digit year.
637
+ * @param {String} year - The year to convert to four digits.
638
+ * @returns {String} The four digit year.
639
+ */
640
+ getFourDigitYear (year) {
641
+
642
+ const strYear = String(year).trim();
643
+ return strYear.length <= 2 ? this.getCentury() + strYear : strYear;
644
+ }
645
+
646
+ constructor() {
647
+
648
+ super();
649
+
650
+ /**
651
+ * Compares two dates to see if they match.
652
+ * @param {Object} date1 - First date to compare.
653
+ * @param {Object} date2 - Second date to compare.
654
+ * @returns {Boolean} Returns true if the dates match.
655
+ */
656
+ this.datesMatch = (date1, date2) => new Date(date1).getTime() === new Date(date2).getTime();
657
+
658
+ /**
659
+ * Returns true if value passed in is a valid date.
660
+ * @param {String} date - Date to validate.
661
+ * @param {String} format - Date format to validate against.
662
+ * @returns {Boolean}
663
+ */
664
+ this.validDateStr = (date, format) => {
665
+
666
+ // The length we expect the date string to be
667
+ const dateStrLength = format.length;
668
+
669
+ // Guard Clause: Date and format are defined
670
+ if (typeof date === "undefined" || typeof format === "undefined") {
671
+ throw new Error('AuroDatepickerUtilities | validateDateStr: Date and format are required');
672
+ }
673
+
674
+ // Guard Clause: Date should be of type string
675
+ if (typeof date !== "string") {
676
+ throw new Error('AuroDatepickerUtilities | validateDateStr: Date must be a string');
677
+ }
678
+
679
+ // Guard Clause: Format should be of type string
680
+ if (typeof format !== "string") {
681
+ throw new Error('AuroDatepickerUtilities | validateDateStr: Format must be a string');
682
+ }
683
+
684
+ // Guard Clause: Length is what we expect it to be
685
+ if (date.length !== dateStrLength) {
686
+ return false;
687
+ }
688
+ // Get a formatted date string and parse it
689
+ const dateParts = dateFormatter.parseDate(date, format);
690
+
691
+ // Guard Clause: Date parse succeeded
692
+ if (!dateParts) {
693
+ return false;
694
+ }
695
+
696
+ // Create the expected date string based on the date parts
697
+ const expectedDateStr = `${dateParts.month}/${dateParts.day || "01"}/${this.getFourDigitYear(dateParts.year)}`;
698
+
699
+ // Generate a date object that we will extract a string date from to compare to the passed in date string
700
+ const dateObj = new Date(this.getFourDigitYear(dateParts.year), dateParts.month - 1, dateParts.day || 1);
701
+
702
+ // Get the date string of the date object we created from the string date
703
+ const actualDateStr = dateFormatter.getDateAsString(dateObj, "en-US");
704
+
705
+ // Guard Clause: Generated date matches date string input
706
+ if (expectedDateStr !== actualDateStr) {
707
+ return false;
708
+ }
709
+
710
+ // If we passed all other checks, we can assume the date is valid
711
+ return true;
712
+ };
713
+
714
+ /**
715
+ * Determines if a string date value matches the format provided.
716
+ * @param {string} value = The date string value.
717
+ * @param { string} format = The date format to match against.
718
+ * @returns {boolean}
719
+ */
720
+ this.dateAndFormatMatch = (value, format) => {
721
+
722
+ // Ensure we have both values we need to do the comparison
723
+ if (!value || !format) {
724
+ throw new Error('AuroFormValidation | dateFormatMatch: value and format are required');
725
+ }
726
+
727
+ // If the lengths are different, they cannot match
728
+ if (value.length !== format.length) {
729
+ return false;
730
+ }
731
+
732
+ // Get the parts of the date
733
+ const dateParts = dateFormatter.parseDate(value, format);
734
+
735
+ // Validator for day
736
+ const dayValueIsValid = (day) => {
737
+
738
+ // Guard clause: if there is no day in the dateParts, we can ignore this check.
739
+ if (!dateParts.day) {
740
+ return true;
741
+ }
742
+
743
+ // Guard clause: ensure day exists.
744
+ if (!day) {
745
+ return false;
746
+ }
747
+
748
+ // Convert day to number
749
+ const numDay = Number.parseInt(day, 10);
750
+
751
+ // Guard clause: ensure day is a valid integer
752
+ if (Number.isNaN(numDay)) {
753
+ throw new Error('AuroDatepickerUtilities | dayValueIsValid: Unable to parse day value integer');
754
+ }
755
+
756
+ // Guard clause: ensure day is within the valid range
757
+ if (numDay < this.minDay || numDay > this.maxDay) {
758
+ return false;
759
+ }
760
+
761
+ // Default return
762
+ return true;
763
+ };
764
+
765
+ // Validator for month
766
+ const monthValueIsValid = (month) => {
767
+
768
+ // Guard clause: ensure month exists.
769
+ if (!month) {
770
+ return false;
771
+ }
772
+
773
+ // Convert month to number
774
+ const numMonth = Number.parseInt(month, 10);
775
+
776
+ // Guard clause: ensure month is a valid integer
777
+ if (Number.isNaN(numMonth)) {
778
+ throw new Error('AuroDatepickerUtilities | monthValueIsValid: Unable to parse month value integer');
779
+ }
780
+
781
+ // Guard clause: ensure month is within the valid range
782
+ if (numMonth < this.minMonth || numMonth > this.maxMonth) {
783
+ return false;
784
+ }
785
+
786
+ // Default return
787
+ return true;
788
+ };
789
+
790
+ // Validator for year
791
+ const yearIsValid = (_year) => {
792
+
793
+ // Guard clause: ensure year exists.
794
+ if (!_year) {
795
+ return false;
796
+ }
797
+
798
+ // Get the full year
799
+ const year = this.getFourDigitYear(_year);
800
+
801
+ // Convert year to number
802
+ const numYear = Number.parseInt(year, 10);
803
+
804
+ // Guard clause: ensure year is a valid integer
805
+ if (Number.isNaN(numYear)) {
806
+ throw new Error('AuroDatepickerUtilities | yearValueIsValid: Unable to parse year value integer');
807
+ }
808
+
809
+ // Guard clause: ensure year is within the valid range
810
+ if (numYear < this.minYear || numYear > this.maxYear) {
811
+ return false;
812
+ }
813
+
814
+ // Default return
815
+ return true;
816
+ };
817
+
818
+ // Self-contained checks for month, day, and year
819
+ const checks = [
820
+ monthValueIsValid(dateParts.month),
821
+ dayValueIsValid(dateParts.day),
822
+ yearIsValid(dateParts.year)
823
+ ];
824
+
825
+ // If any of the checks failed, the date format does not match and the result is invalid
826
+ const isValid = checks.every((check) => check === true);
827
+
828
+ // If the check is invalid, return false
829
+ if (!isValid) {
830
+ return false;
831
+ }
832
+
833
+ // Default case
834
+ return true;
835
+ };
836
+ }
837
+ }
838
+
839
+ // Export a class instance
840
+ const dateUtilities = new AuroDateUtilities();
841
+
842
+ // Export the class instance methods individually
843
+ const {
844
+ datesMatch,
845
+ validDateStr,
846
+ dateAndFormatMatch,
847
+ minDay,
848
+ minMonth,
849
+ minYear,
850
+ maxDay,
851
+ maxMonth,
852
+ maxYear
853
+ } = dateUtilities;
854
+
855
+ const {
856
+ toNorthAmericanFormat,
857
+ parseDate,
858
+ getDateAsString
859
+ } = dateFormatter;
860
+
861
+ // Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
862
+ // See LICENSE in the project root for license information.
863
+
864
+
865
+ class AuroFormValidation {
866
+
867
+ constructor() {
868
+ this.runtimeUtils = new AuroLibraryRuntimeUtils$1();
869
+ }
870
+
871
+ /**
872
+ * Resets the element to its initial state.
873
+ * @private
874
+ * @param {object} elem - HTML element to reset.
875
+ * @returns {void}
876
+ */
877
+ reset(elem) {
878
+ elem.validity = undefined;
879
+ elem.value = undefined;
880
+ elem.touched = false;
881
+
882
+ // Resets the second value of the datepicker in range state
883
+ if (elem.valueEnd) {
884
+ elem.valueEnd = undefined;
885
+ }
886
+
887
+ // Resets selected option of element
888
+ if (elem.optionSelected) {
889
+ elem.optionSelected = undefined;
890
+ }
891
+
892
+ // Runs validation to handle error attribute
893
+ this.validate(elem);
894
+ }
895
+
896
+ /**
897
+ * Validates the attributes of a given element based on predefined validation rules.
898
+ *
899
+ * @param {HTMLElement} elem - The element to be validated.
900
+ * @returns {void}
901
+ *
902
+ * @example
903
+ * // Assuming `inputElement` is a reference to an input element in the DOM
904
+ * validateElementAttributes(inputElement);
905
+ *
906
+ * The function checks the element's attributes against the validation rules defined for 'input' and 'counter' types.
907
+ * If a validation rule is violated, it sets the element's validity state and error message accordingly.
908
+ *
909
+ * Validation rules:
910
+ * - input:
911
+ * - length:
912
+ * - tooShort: Checks if the value length is less than the minimum length.
913
+ * - tooLong: Checks if the value length exceeds the maximum length.
914
+ * - pattern:
915
+ * - patternMismatch: Checks if the value does not match the specified pattern.
916
+ * - counter:
917
+ * - range:
918
+ * - rangeOverflow: Checks if the value exceeds the maximum value.
919
+ * - rangeUnderflow: Checks if the value is less than the minimum value.
920
+ */
921
+ validateElementAttributes(elem) {
922
+ const validationRules = {
923
+ input: {
924
+ length: [
925
+ {
926
+ check: (e) => e.value?.length > 0 && e.value?.length < e.minLength,
927
+ validity: 'tooShort',
928
+ message: e => e.getAttribute('setCustomValidityTooShort') || e.setCustomValidity || ''
929
+ },
930
+ {
931
+ check: (e) => e.value?.length > e.maxLength,
932
+ validity: 'tooLong',
933
+ message: e => e.getAttribute('setCustomValidityTooLong') || e.setCustomValidity || ''
934
+ }
935
+ ],
936
+ pattern: [
937
+ {
938
+ check: (e) => e.pattern && !new RegExp(`^${e.pattern}$`, 'u').test(e.value),
939
+ validity: 'patternMismatch',
940
+ message: e => e.getAttribute('setCustomValidityPatternMismatch') || e.setCustomValidity || ''
941
+ }
942
+ ]
943
+ },
944
+ counter: {
945
+ range: [
946
+ {
947
+ check: (e) => e.max !== undefined && Number(e.max) < Number(e.value),
948
+ validity: 'rangeOverflow',
949
+ message: e => e.getAttribute('setCustomValidityRangeOverflow') || ''
950
+ },
951
+ {
952
+ check: (e) => e.min !== undefined && Number(e.min) > Number(e.value),
953
+ validity: 'rangeUnderflow',
954
+ message: e => e.getAttribute('setCustomValidityRangeUnderflow') || ''
955
+ }
956
+ ]
957
+ }
958
+ };
959
+
960
+ let elementType;
961
+ if (this.runtimeUtils.elementMatch(elem, 'auro-input')) {
962
+ elementType = 'input';
963
+ } else if (this.runtimeUtils.elementMatch(elem, 'auro-counter') || this.runtimeUtils.elementMatch(elem, 'auro-counter-group')) {
964
+ elementType = 'counter';
965
+ }
966
+
967
+ if (elementType) {
968
+ const rules = validationRules[elementType];
969
+
970
+ if (rules) {
971
+ Object.values(rules).flat().forEach(rule => {
972
+ if (rule.check(elem)) {
973
+ elem.validity = rule.validity;
974
+ elem.errorMessage = rule.message(elem);
975
+ }
976
+ });
977
+ }
978
+ }
979
+ }
980
+
981
+ /**
982
+ * Determines the validity state of the element based on the type attribute.
983
+ * @private
984
+ * @param {object} elem - HTML element to validate.
985
+ * @returns {void}
986
+ */
987
+ validateType(elem) {
988
+ if (elem.hasAttribute('type')) {
989
+ if (elem.type === 'email') {
990
+ const emailRegex = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/; // eslint-disable-line require-unicode-regexp
991
+
992
+ if (!elem.value.match(emailRegex)) {
993
+ elem.validity = 'patternMismatch';
994
+ elem.errorMessage = elem.setCustomValidityForType || elem.setCustomValidity || '';
995
+ return;
996
+ }
997
+ } else if (elem.type === 'credit-card') {
998
+ if (elem.value.length > 0 && elem.value.length < elem.validationCCLength) {
999
+ elem.validity = 'tooShort';
1000
+ elem.errorMessage = elem.setCustomValidityForType || elem.setCustomValidity || '';
1001
+ return;
1002
+ }
1003
+ } else if (elem.type === 'number') {
1004
+ if (elem.max !== undefined && Number(elem.max) < Number(elem.value)) {
1005
+ elem.validity = 'rangeOverflow';
1006
+ elem.errorMessage = elem.setCustomValidityRangeOverflow || elem.setCustomValidity || '';
1007
+ return;
1008
+ }
1009
+
1010
+ if (elem.min !== undefined && elem.value?.length > 0 && Number(elem.min) > Number(elem.value)) {
1011
+ elem.validity = 'rangeUnderflow';
1012
+ elem.errorMessage = elem.setCustomValidityRangeUnderflow || elem.setCustomValidity || '';
1013
+ return;
1014
+ }
1015
+ } else if (elem.type === 'date' && elem.value?.length > 0) {
1016
+
1017
+ // Guard Clause: if the value is too short
1018
+ if (elem.value?.length < elem.lengthForType) {
1019
+
1020
+ elem.validity = 'tooShort';
1021
+ elem.errorMessage = elem.setCustomValidityForType || elem.setCustomValidity || '';
1022
+ return;
1023
+ }
1024
+
1025
+ // Guard Clause: If the value is too long for the type
1026
+ if (elem.value?.length > elem.lengthForType) {
1027
+
1028
+ elem.validity = 'tooLong';
1029
+ elem.errorMessage = elem.setCustomValidityForType || elem.setCustomValidity || '';
1030
+ return;
1031
+ }
1032
+
1033
+ // Validate that the date passed was the correct format
1034
+ if (!dateAndFormatMatch(elem.value, elem.format)) {
1035
+ elem.validity = 'patternMismatch';
1036
+ elem.errorMessage = elem.setCustomValidityForType || elem.setCustomValidity || 'Invalid Date Format Entered';
1037
+ return;
1038
+ }
1039
+
1040
+ // Validate that the date passed was a valid date
1041
+ if (!validDateStr(elem.value, elem.format)) {
1042
+ elem.validity = 'invalidDate';
1043
+ elem.errorMessage = elem.setCustomValidityInvalidDate || elem.setCustomValidity || 'Invalid Date Entered';
1044
+ return;
1045
+ }
1046
+
1047
+ // Perform the rest of the validation
1048
+ const formattedValue = toNorthAmericanFormat(elem.value, elem.format);
1049
+ const valueDate = new Date(formattedValue);
1050
+
1051
+ // // Validate max date
1052
+ if (elem.max?.length === elem.lengthForType) {
1053
+
1054
+ const maxDate = new Date(toNorthAmericanFormat(elem.max, elem.format));
1055
+
1056
+ if (valueDate > maxDate) {
1057
+ elem.validity = 'rangeOverflow';
1058
+ elem.errorMessage = elem.setCustomValidityRangeOverflow || elem.setCustomValidity || '';
1059
+ return;
1060
+ }
1061
+ }
1062
+
1063
+ // Validate min date
1064
+ if (elem.min?.length === elem.lengthForType) {
1065
+ const minDate = new Date(toNorthAmericanFormat(elem.min, elem.format));
1066
+
1067
+ if (valueDate < minDate) {
1068
+ elem.validity = 'rangeUnderflow';
1069
+ elem.errorMessage = elem.setCustomValidityRangeUnderflow || elem.setCustomValidity || '';
1070
+ return;
1071
+ }
1072
+ }
1073
+ }
1074
+ }
1075
+ }
1076
+
1077
+ /**
1078
+ * Determines the validity state of the element.
1079
+ * @param {object} elem - HTML element to validate.
1080
+ * @param {boolean} force - Boolean that forces validation to run.
1081
+ * @returns {void}
1082
+ */
1083
+ validate(elem, force) {
1084
+ this.getInputElements(elem);
1085
+ this.getAuroInputs(elem);
1086
+
1087
+ // Check if validation should run
1088
+ let validationShouldRun =
1089
+
1090
+ // If the validation was forced
1091
+ force ||
1092
+
1093
+ // If the validation should run on input
1094
+ elem.validateOnInput ||
1095
+
1096
+ // State-based checks
1097
+ (
1098
+ // Element is not currently focused
1099
+ !elem.contains(document.activeElement) && // native input is not focused directly
1100
+ !document.activeElement.shadowRoot?.contains(elem) && // native input is not focused in the shadow DOM of another component
1101
+
1102
+ // And element has been touched or is untouched but has a value
1103
+ ( elem.touched || (!elem.touched && typeof elem.value !== "undefined") )
1104
+ );
1105
+
1106
+ if (elem.hasAttribute('error')) {
1107
+ elem.validity = 'customError';
1108
+ elem.errorMessage = elem.setCustomValidityCustomError || elem.error || elem.setCustomValidity || '';
1109
+ validationShouldRun = false;
1110
+ } else if (validationShouldRun) {
1111
+ elem.validity = 'valid';
1112
+ elem.errorMessage = '';
1113
+
1114
+ /**
1115
+ * Only validate once we interact with the datepicker
1116
+ * elem.value === undefined is the initial state pre-interaction.
1117
+ *
1118
+ * The validityState definitions are located at https://developer.mozilla.org/en-US/docs/Web/API/ValidityState.
1119
+ */
1120
+
1121
+ let hasValue = false;
1122
+
1123
+ // Check string for having a value
1124
+ if (typeof elem.value === "string") {
1125
+ hasValue = elem.value && elem.value.length > 0;
1126
+ }
1127
+
1128
+ // Check array value types for having a value
1129
+ if (Array.isArray(elem.value)) {
1130
+ hasValue = Boolean(
1131
+ elem.value.length > 0 &&
1132
+ elem.value.some((value) => typeof value === "string" && value.length > 0)
1133
+ );
1134
+ }
1135
+
1136
+ // If there is a second input in the elem and that value is undefined or an empty string set hasValue to false;
1137
+ if (this.auroInputElements?.length === 2) {
1138
+ if (!this.auroInputElements[1].value || this.auroInputElements[1].length === 0) {
1139
+ hasValue = false;
1140
+ }
1141
+ }
1142
+
1143
+ if (!hasValue && elem.required && elem.touched) {
1144
+ elem.validity = 'valueMissing';
1145
+ elem.errorMessage = elem.setCustomValidityValueMissing || elem.setCustomValidity || '';
1146
+ } else if (hasValue && this.runtimeUtils.elementMatch(elem, 'auro-input')) {
1147
+ this.validateType(elem);
1148
+ this.validateElementAttributes(elem);
1149
+ } else if (hasValue && (this.runtimeUtils.elementMatch(elem, 'auro-counter') || this.runtimeUtils.elementMatch(elem, 'auro-counter-group'))) {
1150
+ this.validateElementAttributes(elem);
1151
+ }
1152
+ }
1153
+
1154
+ if (this.auroInputElements?.length > 0 && elem.validity !== "valueMissing") {
1155
+ elem.validity = this.auroInputElements[0].validity;
1156
+ elem.errorMessage = this.auroInputElements[0].errorMessage;
1157
+
1158
+ // multiple input in one components (datepicker)
1159
+ // combobox has 2 inputs but no need to check validity on the 2nd one which is in fullscreen bib.
1160
+ if (elem.validity === 'valid' && this.auroInputElements.length > 1 && !this.runtimeUtils.elementMatch(elem, 'auro-combobox')) {
1161
+ elem.validity = this.auroInputElements[1].validity;
1162
+ elem.errorMessage = this.auroInputElements[1].errorMessage;
1163
+ }
1164
+ }
1165
+
1166
+ if (validationShouldRun || elem.hasAttribute('error')) {
1167
+ // Use the validity message override if it is declared
1168
+ if (elem.validity && elem.validity !== 'valid' && elem.ValidityMessageOverride) {
1169
+ elem.errorMessage = elem.ValidityMessageOverride;
1170
+ }
1171
+
1172
+ this.getErrorMessage(elem);
1173
+
1174
+ elem.dispatchEvent(new CustomEvent('auroFormElement-validated', {
1175
+ bubbles: true,
1176
+ composed: true,
1177
+ detail: {
1178
+ validity: elem.validity,
1179
+ message: elem.errorMessage
1180
+ }
1181
+ }));
1182
+ }
1183
+ }
1184
+
1185
+ /**
1186
+ * Gets all the HTML5 `inputs` in the element shadow DOM.
1187
+ * @private
1188
+ * @param {object} elem - HTML element to validate.
1189
+ * @returns {void}
1190
+ */
1191
+ getInputElements(elem) {
1192
+ this.inputElements = elem.renderRoot.querySelectorAll('input');
1193
+ }
1194
+
1195
+ /**
1196
+ * Gets all the `auro-inputs` in the element shadow DOM.
1197
+ * @private
1198
+ * @param {object} elem - HTML element to validate.
1199
+ * @returns {void}
1200
+ */
1201
+ getAuroInputs(elem) {
1202
+ this.auroInputElements = elem.shadowRoot.querySelectorAll('auro-input, [auro-input]');
1203
+ }
1204
+
1205
+ /**
1206
+ * Return appropriate error message.
1207
+ * @private
1208
+ * @param {object} elem - HTML element to validate.
1209
+ * @returns {void}
1210
+ */
1211
+ getErrorMessage(elem) {
1212
+ if (elem.validity !== 'valid') {
1213
+ if (elem.setCustomValidity) {
1214
+ elem.errorMessage = elem.setCustomValidity;
1215
+ } else if (this.runtimeUtils.elementMatch(elem, 'auro-input') && elem.errorMessage === '') {
1216
+ const input = elem.renderRoot.querySelector('input');
1217
+
1218
+ if (input.validationMessage.length > 0) {
1219
+ elem.errorMessage = input.validationMessage;
1220
+ }
1221
+ } else if (this.inputElements?.length > 0 && elem.errorMessage === '') {
1222
+ const firstInput = this.inputElements[0];
1223
+
1224
+ if (firstInput.validationMessage.length > 0) {
1225
+ elem.errorMessage = firstInput.validationMessage;
1226
+ } else if (this.inputElements?.length === 2) {
1227
+ const secondInput = this.inputElements[1];
1228
+
1229
+ if (secondInput.validationMessage.length > 0) {
1230
+ elem.errorMessage = secondInput.validationMessage;
1231
+ }
1232
+ }
1233
+ }
1234
+ } else {
1235
+ elem.errorMessage = '';
1236
+ }
1237
+ }
1238
+ }
1239
+
1240
+ // Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
1241
+ // See LICENSE in the project root for license information.
1242
+
1243
+
1244
+ class AuroDependencyVersioning {
1245
+
1246
+ /**
1247
+ * Generates a unique string to be used for child auro element naming.
1248
+ * @private
1249
+ * @param {string} baseName - Defines the first part of the unique element name.
1250
+ * @param {string} version - Version of the component that will be appended to the baseName.
1251
+ * @returns {string} - Unique string to be used for naming.
1252
+ */
1253
+ generateElementName(baseName, version) {
1254
+ let result = baseName;
1255
+
1256
+ result += '-';
1257
+ result += version.replace(/[.]/g, '_');
1258
+
1259
+ return result;
1260
+ }
1261
+
1262
+ /**
1263
+ * Generates a unique string to be used for child auro element naming.
1264
+ * @param {string} baseName - Defines the first part of the unique element name.
1265
+ * @param {string} version - Version of the component that will be appended to the baseName.
1266
+ * @returns {string} - Unique string to be used for naming.
1267
+ */
1268
+ generateTag(baseName, version, tagClass) {
1269
+ const elementName = this.generateElementName(baseName, version);
1270
+ const tag = i`${s(elementName)}`;
1271
+
1272
+ if (!customElements.get(elementName)) {
1273
+ customElements.define(elementName, class extends tagClass {});
1274
+ }
1275
+
1276
+ return tag;
1277
+ }
1278
+ }
1279
+
1280
+ var colorCss = i$5`:host([error]){--ds-auro-helptext-color: var(--ds-basic-color-status-error, #e31f26)}:host([onDark]){--ds-auro-helptext-color: var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([onDark][error]){--ds-auro-helptext-color: var(--ds-advanced-color-state-error-inverse, #f9a4a8)}.helptext-wrapper{color:var(--ds-auro-helptext-color)}`;
1281
+
1282
+ var styleCss = i$5`.body-default{font-size:var(--wcss-body-default-font-size, 1rem);line-height:var(--wcss-body-default-line-height, 1.5rem)}.body-default,.body-lg{font-family:var(--wcss-body-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-weight:var(--wcss-body-weight, 450);letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-lg{font-size:var(--wcss-body-lg-font-size, 1.125rem);line-height:var(--wcss-body-lg-line-height, 1.625rem)}.body-sm{font-size:var(--wcss-body-sm-font-size, 0.875rem);line-height:var(--wcss-body-sm-line-height, 1.25rem)}.body-sm,.body-xs{font-family:var(--wcss-body-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-weight:var(--wcss-body-weight, 450);letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-xs{font-size:var(--wcss-body-xs-font-size, 0.75rem);line-height:var(--wcss-body-xs-line-height, 1rem)}.body-2xs{font-family:var(--wcss-body-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-body-2xs-font-size, 0.625rem);font-weight:var(--wcss-body-weight, 450);letter-spacing:var(--wcss-body-letter-spacing, 0);line-height:var(--wcss-body-2xs-line-height, 0.875rem)}.display-2xl{font-family:var(--wcss-display-2xl-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-2xl-font-size, clamp(3.5rem, 6vw, 5.375rem));font-weight:var(--wcss-display-2xl-weight, 300);letter-spacing:var(--wcss-display-2xl-letter-spacing, 0);line-height:var(--wcss-display-2xl-line-height, 1.3)}.display-xl{font-family:var(--wcss-display-xl-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-xl-font-size, clamp(3rem, 5.3333333333vw, 4.5rem));font-weight:var(--wcss-display-xl-weight, 300);letter-spacing:var(--wcss-display-xl-letter-spacing, 0);line-height:var(--wcss-display-xl-line-height, 1.3)}.display-lg{font-family:var(--wcss-display-lg-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-lg-font-size, clamp(2.75rem, 4.6666666667vw, 4rem));font-weight:var(--wcss-display-lg-weight, 300);letter-spacing:var(--wcss-display-lg-letter-spacing, 0);line-height:var(--wcss-display-lg-line-height, 1.3)}.display-md{font-family:var(--wcss-display-md-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-md-font-size, clamp(2.5rem, 4vw, 3.5rem));font-weight:var(--wcss-display-md-weight, 300);letter-spacing:var(--wcss-display-md-letter-spacing, 0);line-height:var(--wcss-display-md-line-height, 1.3)}.display-sm{font-family:var(--wcss-display-sm-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-sm-font-size, clamp(2rem, 3.6666666667vw, 3rem));font-weight:var(--wcss-display-sm-weight, 300);letter-spacing:var(--wcss-display-sm-letter-spacing, 0);line-height:var(--wcss-display-sm-line-height, 1.3)}.display-xs{font-family:var(--wcss-display-xs-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-xs-font-size, clamp(1.75rem, 3vw, 2.375rem));font-weight:var(--wcss-display-xs-weight, 300);letter-spacing:var(--wcss-display-xs-letter-spacing, 0);line-height:var(--wcss-display-xs-line-height, 1.3)}.heading-xl{font-family:var(--wcss-heading-xl-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-xl-font-size, clamp(2rem, 3vw, 2.5rem));font-weight:var(--wcss-heading-xl-weight, 300);letter-spacing:var(--wcss-heading-xl-letter-spacing, 0);line-height:var(--wcss-heading-xl-line-height, 1.3)}.heading-lg{font-family:var(--wcss-heading-lg-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-lg-font-size, clamp(1.75rem, 2.6666666667vw, 2.25rem));font-weight:var(--wcss-heading-lg-weight, 300);letter-spacing:var(--wcss-heading-lg-letter-spacing, 0);line-height:var(--wcss-heading-lg-line-height, 1.3)}.heading-md{font-family:var(--wcss-heading-md-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-md-font-size, clamp(1.625rem, 2.3333333333vw, 1.75rem));font-weight:var(--wcss-heading-md-weight, 300);letter-spacing:var(--wcss-heading-md-letter-spacing, 0);line-height:var(--wcss-heading-md-line-height, 1.3)}.heading-sm{font-family:var(--wcss-heading-sm-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-sm-font-size, clamp(1.375rem, 2vw, 1.5rem));font-weight:var(--wcss-heading-sm-weight, 300);letter-spacing:var(--wcss-heading-sm-letter-spacing, 0);line-height:var(--wcss-heading-sm-line-height, 1.3)}.heading-xs{font-family:var(--wcss-heading-xs-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-xs-font-size, clamp(1.25rem, 1.6666666667vw, 1.25rem));font-weight:var(--wcss-heading-xs-weight, 450);letter-spacing:var(--wcss-heading-xs-letter-spacing, 0);line-height:var(--wcss-heading-xs-line-height, 1.3)}.heading-2xs{font-family:var(--wcss-heading-2xs-family, "AS Circular", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-2xs-font-size, clamp(1.125rem, 1.5vw, 1.125rem));font-weight:var(--wcss-heading-2xs-weight, 450);letter-spacing:var(--wcss-heading-2xs-letter-spacing, 0);line-height:var(--wcss-heading-2xs-line-height, 1.3)}.accent-2xl{font-family:var(--wcss-accent-2xl-family, "Good OT", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-2xl-font-size, clamp(2rem, 3.1666666667vw, 2.375rem));font-weight:var(--wcss-accent-2xl-weight, 450);letter-spacing:var(--wcss-accent-2xl-letter-spacing, 0.05em);line-height:var(--wcss-accent-2xl-line-height, 1)}.accent-2xl,.accent-xl{text-transform:uppercase}.accent-xl{font-family:var(--wcss-accent-xl-family, "Good OT", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-xl-font-size, clamp(1.625rem, 2.3333333333vw, 2rem));font-weight:var(--wcss-accent-xl-weight, 450);letter-spacing:var(--wcss-accent-xl-letter-spacing, 0.05em);line-height:var(--wcss-accent-xl-line-height, 1.3)}.accent-lg{font-family:var(--wcss-accent-lg-family, "Good OT", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-lg-font-size, clamp(1.5rem, 2.1666666667vw, 1.75rem));font-weight:var(--wcss-accent-lg-weight, 450);letter-spacing:var(--wcss-accent-lg-letter-spacing, 0.05em);line-height:var(--wcss-accent-lg-line-height, 1.3)}.accent-lg,.accent-md{text-transform:uppercase}.accent-md{font-family:var(--wcss-accent-md-family, "Good OT", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-md-font-size, clamp(1.375rem, 1.8333333333vw, 1.5rem));font-weight:var(--wcss-accent-md-weight, 500);letter-spacing:var(--wcss-accent-md-letter-spacing, 0.05em);line-height:var(--wcss-accent-md-line-height, 1.3)}.accent-sm{font-family:var(--wcss-accent-sm-family, "Good OT", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-sm-font-size, clamp(1.125rem, 1.5vw, 1.25rem));font-weight:var(--wcss-accent-sm-weight, 500);letter-spacing:var(--wcss-accent-sm-letter-spacing, 0.05em);line-height:var(--wcss-accent-sm-line-height, 1.3)}.accent-sm,.accent-xs{text-transform:uppercase}.accent-xs{font-family:var(--wcss-accent-xs-family, "Good OT", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-xs-font-size, clamp(1rem, 1.3333333333vw, 1rem));font-weight:var(--wcss-accent-xs-weight, 500);letter-spacing:var(--wcss-accent-xs-letter-spacing, 0.1em);line-height:var(--wcss-accent-xs-line-height, 1.3)}.accent-2xs{font-family:var(--wcss-accent-2xs-family, "Good OT", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-2xs-font-size, clamp(0.875rem, 1.1666666667vw, 0.875rem));font-weight:var(--wcss-accent-2xs-weight, 450);letter-spacing:var(--wcss-accent-2xs-letter-spacing, 0.1em);line-height:var(--wcss-accent-2xs-line-height, 1.3);text-transform:uppercase}:host{position:relative;display:block}.helptext-wrapper{display:none}.helptext-wrapper[visible]{display:block}::slotted(*:not(:empty)){margin-top:var(--ds-size-50, 0.25rem);margin-bottom:0}::slotted(p){margin-block:0}`;
1283
+
1284
+ var tokensCss = i$5`:host{--ds-auro-helptext-color: var(--ds-basic-color-texticon-muted, #676767)}`;
1285
+
1286
+ // Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
1287
+ // See LICENSE in the project root for license information.
1288
+
1289
+ // ---------------------------------------------------------------------
1290
+
1291
+ /* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
1292
+
1293
+ class AuroLibraryRuntimeUtils {
1294
+
1295
+ /* eslint-disable jsdoc/require-param */
1296
+
1297
+ /**
1298
+ * This will register a new custom element with the browser.
1299
+ * @param {String} name - The name of the custom element.
1300
+ * @param {Object} componentClass - The class to register as a custom element.
1301
+ * @returns {void}
1302
+ */
1303
+ registerComponent(name, componentClass) {
1304
+ if (!customElements.get(name)) {
1305
+ customElements.define(name, class extends componentClass {});
1306
+ }
1307
+ }
1308
+
1309
+ /**
1310
+ * Finds and returns the closest HTML Element based on a selector.
1311
+ * @returns {void}
1312
+ */
1313
+ closestElement(
1314
+ selector, // selector like in .closest()
1315
+ base = this, // extra functionality to skip a parent
1316
+ __Closest = (el, found = el && el.closest(selector)) =>
1317
+ !el || el === document || el === window
1318
+ ? null // standard .closest() returns null for non-found selectors also
1319
+ : found
1320
+ ? found // found a selector INside this element
1321
+ : __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
1322
+ ) {
1323
+ return __Closest(base);
1324
+ }
1325
+ /* eslint-enable jsdoc/require-param */
1326
+
1327
+ /**
1328
+ * If the element passed is registered with a different tag name than what is passed in, the tag name is added as an attribute to the element.
1329
+ * @param {Object} elem - The element to check.
1330
+ * @param {String} tagName - The name of the Auro component to check for or add as an attribute.
1331
+ * @returns {void}
1332
+ */
1333
+ handleComponentTagRename(elem, tagName) {
1334
+ const tag = tagName.toLowerCase();
1335
+ const elemTag = elem.tagName.toLowerCase();
1336
+
1337
+ if (elemTag !== tag) {
1338
+ elem.setAttribute(tag, true);
1339
+ }
1340
+ }
1341
+
1342
+ /**
1343
+ * Validates if an element is a specific Auro component.
1344
+ * @param {Object} elem - The element to validate.
1345
+ * @param {String} tagName - The name of the Auro component to check against.
1346
+ * @returns {Boolean} - Returns true if the element is the specified Auro component.
1347
+ */
1348
+ elementMatch(elem, tagName) {
1349
+ const tag = tagName.toLowerCase();
1350
+ const elemTag = elem.tagName.toLowerCase();
1351
+
1352
+ return elemTag === tag || elem.hasAttribute(tag);
1353
+ }
1354
+ }
1355
+
1356
+ // Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
1357
+ // See LICENSE in the project root for license information.
1358
+
1359
+
1360
+ /**
1361
+ * Displays help text or error messages within form elements - Internal Use Only.
1362
+ */
1363
+ class AuroHelpText extends i$2 {
1364
+
1365
+ constructor() {
1366
+ super();
1367
+
1368
+ this.error = false;
1369
+ this.onDark = false;
1370
+ this.hasTextContent = false;
1371
+
1372
+ AuroLibraryRuntimeUtils.prototype.handleComponentTagRename(this, 'auro-helptext');
1373
+ }
1374
+
1375
+ static get styles() {
1376
+ return [
1377
+ colorCss,
1378
+ styleCss,
1379
+ tokensCss
1380
+ ];
1381
+ }
1382
+
1383
+ // function to define props used within the scope of this component
1384
+ static get properties() {
1385
+ return {
1386
+
1387
+ /**
1388
+ * @private
1389
+ */
1390
+ slotNodes: {
1391
+ type: Boolean,
1392
+ },
1393
+
1394
+ /**
1395
+ * @private
1396
+ */
1397
+ hasTextContent: {
1398
+ type: Boolean,
1399
+ },
1400
+
1401
+ /**
1402
+ * If declared, make font color red.
1403
+ */
1404
+ error: {
1405
+ type: Boolean,
1406
+ reflect: true,
1407
+ },
1408
+
1409
+ /**
1410
+ * If declared, will apply onDark styles.
1411
+ */
1412
+ onDark: {
1413
+ type: Boolean,
1414
+ reflect: true
1415
+ }
1416
+ };
1417
+ }
1418
+
1419
+ /**
1420
+ * This will register this element with the browser.
1421
+ * @param {string} [name="auro-helptext"] - The name of element that you want to register to.
1422
+ *
1423
+ * @example
1424
+ * AuroCheckbox.register("custom-helptext") // this will register this element to <custom-helptext/>
1425
+ *
1426
+ */
1427
+ static register(name = "auro-helptext") {
1428
+ AuroLibraryRuntimeUtils.prototype.registerComponent(name, AuroHelpText);
1429
+ }
1430
+
1431
+ updated() {
1432
+ this.handleSlotChange();
1433
+ }
1434
+
1435
+ handleSlotChange(event) {
1436
+ if (event) {
1437
+ this.slotNodes = event.target.assignedNodes();
1438
+ }
1439
+
1440
+ this.hasTextContent = this.checkSlotsForContent(this.slotNodes);
1441
+ }
1442
+
1443
+ /**
1444
+ * Checks if any of the provided nodes or their nested slot nodes contain non-empty text content.
1445
+ *
1446
+ * @param {NodeList|Array} nodes - The list of nodes to check for content.
1447
+ * @returns {boolean} - Returns true if any node or nested slot node contains non-empty text content, otherwise false.
1448
+ * @private
1449
+ */
1450
+ checkSlotsForContent(nodes) {
1451
+ if (!nodes) {
1452
+ return false;
1453
+ }
1454
+
1455
+ return nodes.some((node) => {
1456
+ if (node.textContent.trim()) {
1457
+ return true;
1458
+ }
1459
+
1460
+ if (!node.querySelector) {
1461
+ return false;
1462
+ }
1463
+
1464
+ const nestedSlot = node.tagName === 'SLOT' ? node : node.querySelector('slot');
1465
+ if (!nestedSlot) {
1466
+ return false;
1467
+ }
1468
+
1469
+ const nestedSlotNodes = nestedSlot.assignedNodes();
1470
+ return this.checkSlotsForContent(nestedSlotNodes);
1471
+ });
1472
+ }
1473
+
1474
+ // function that renders the HTML and CSS into the scope of the component
1475
+ render() {
1476
+ return x`
1477
+ <div class="helptext-wrapper body-xs" ?visible="${this.hasTextContent}">
1478
+ <slot @slotchange=${this.handleSlotChange}></slot>
1479
+ </div>
1480
+ `;
1481
+ }
1482
+ }
1483
+
1484
+ var helpTextVersion = '1.0.0';
1485
+
1486
+ // Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
1487
+ // See LICENSE in the project root for license information.
1488
+ // ---------------------------------------------------------------------
1489
+
1490
+
1491
+ /* eslint no-magic-numbers: ["error", { "ignore": [0, 1, -1] }] */
1492
+ /* eslint-disable max-lines, lit/binding-positions, lit/no-invalid-html */
1493
+
1494
+ /**
1495
+ * @attr {String} validity - Specifies the `validityState` this element is in.
1496
+ * @attr {String} setCustomValidity - Sets a custom help text message to display for all validityStates.
1497
+ * @attr {String} setCustomValidityCustomError - Custom help text message to display when validity = `customError`.
1498
+ * @attr {String} setCustomValidityValueMissing - Custom help text message to display when validity = `valueMissing`.
1499
+ * @attr {String} error - When defined, sets persistent validity to `customError` and sets `setCustomValidity` = attribute value.
1500
+ * @attr {Boolean} noValidate - If set, disables auto-validation on blur.
1501
+ * @attr {Boolean} onDark - Applies dark mode styles to the component.
1502
+ * @attr {Boolean} required - Populates the `required` attribute on the element. Used for client-side validation.
1503
+ * @attr {Object} optionSelected - Specifies the current selected radio button.
1504
+ * @csspart radio-group - Apply css to the fieldset element in the shadow DOM
1505
+ * @slot {HTMLSlotElement} legend - Allows for the legend to be overridden.
1506
+ * @slot {HTMLSlotElement} optionalLabel - Allows overriding the optional display text "(optional)", which appears next to the label.
1507
+ * @slot {HTMLSlotElement} helpText - Allows for the helper text to be overridden.
1508
+ * @event auroFormElement-validated - Notifies that the element has been validated.
1509
+ * @event input - Notifies every time the value prop of the element is changed.
1510
+ */
1511
+
1512
+ class AuroRadioGroup extends i$2 {
1513
+ constructor() {
1514
+ super();
1515
+ this.disabled = false;
1516
+ this.horizontal = false;
1517
+ this.required = false;
1518
+ this.validity = undefined;
1519
+ this.value = undefined;
1520
+ this.optionSelected = undefined;
1521
+ this.onDark = false;
1522
+ this.touched = false;
1523
+
1524
+ /**
1525
+ * @private
1526
+ */
1527
+ this.validation = new AuroFormValidation();
1528
+
1529
+ /**
1530
+ * @private
1531
+ */
1532
+ this.index = 0;
1533
+
1534
+ /**
1535
+ * @private
1536
+ */
1537
+ this.max = 3;
1538
+
1539
+ /**
1540
+ * @private
1541
+ */
1542
+ this.runtimeUtils = new AuroLibraryRuntimeUtils$1();
1543
+
1544
+ /**
1545
+ * Generate unique names for dependency components.
1546
+ */
1547
+ const versioning = new AuroDependencyVersioning();
1548
+
1549
+ /**
1550
+ * @private
1551
+ */
1552
+ this.helpTextTag = versioning.generateTag('auro-formkit-radio-helptext', helpTextVersion, AuroHelpText);
1553
+ }
1554
+
1555
+ static get styles() {
1556
+ return [
1557
+ styleCss$1,
1558
+ colorCss$1,
1559
+ tokenCss
1560
+ ];
1561
+ }
1562
+
1563
+ static get properties() {
1564
+ return {
1565
+ disabled: {
1566
+ type: Boolean,
1567
+ reflect: true
1568
+ },
1569
+ horizontal: { type: Boolean },
1570
+ error: {
1571
+ type: String,
1572
+ reflect: true
1573
+ },
1574
+ value: {
1575
+ type: String
1576
+ },
1577
+ noValidate: {
1578
+ type: Boolean,
1579
+ reflect: true
1580
+ },
1581
+ onDark: {
1582
+ type: Boolean,
1583
+ reflect: true
1584
+ },
1585
+ required: {
1586
+ type: Boolean,
1587
+ reflect: true
1588
+ },
1589
+ setCustomValidity: {
1590
+ type: String
1591
+ },
1592
+ setCustomValidityCustomError: {
1593
+ type: String
1594
+ },
1595
+ setCustomValidityValueMissing: {
1596
+ type: String
1597
+ },
1598
+ validity: {
1599
+ type: String,
1600
+ reflect: true
1601
+ },
1602
+ optionSelected: {
1603
+ type: Object
1604
+ },
1605
+
1606
+ /**
1607
+ * Indicates whether the radio group is in a dirty state (has been interacted with).
1608
+ * @type {boolean}
1609
+ * @default false
1610
+ * @private
1611
+ */
1612
+ touched: {
1613
+ type: Boolean,
1614
+ reflect: true,
1615
+ attribute: false
1616
+ }
1617
+ };
1618
+ }
1619
+
1620
+ /**
1621
+ * This will register this element with the browser.
1622
+ * @param {string} [name="auro-radio-group"] - The name of element that you want to register to.
1623
+ *
1624
+ * @example
1625
+ * AuroRadioGroup.register("custom-radio-group") // This will register this element to <custom-radio-group/>
1626
+ *
1627
+ */
1628
+ static register(name = "auro-radio-group") {
1629
+ AuroLibraryRuntimeUtils$1.prototype.registerComponent(name, AuroRadioGroup);
1630
+ }
1631
+
1632
+ connectedCallback() {
1633
+ super.connectedCallback();
1634
+ this.handleItems();
1635
+ this.addEventListener('toggleSelected', this.handleToggleSelected);
1636
+ this.addEventListener('keydown', this.handleKeyDown);
1637
+ this.addEventListener('resetRadio', this.resetRadio);
1638
+ this.addEventListener('auroRadio-blur', this.handleRadioBlur);
1639
+ this.addEventListener('auroRadio-selected', this.handleSelection);
1640
+ }
1641
+
1642
+ firstUpdated() {
1643
+ // Add the tag name as an attribute if it is different than the component name
1644
+ this.runtimeUtils.handleComponentTagRename(this, 'auro-radio-group');
1645
+ }
1646
+
1647
+ /**
1648
+ * Method for handling of selection of a radio element.
1649
+ * @private
1650
+ * @param {Event} event - The trigger event tied to this function.
1651
+ * @returns {void}
1652
+ */
1653
+ handleSelection(event) {
1654
+ if (event.target.value) {
1655
+ this.value = event.target.value;
1656
+ } else {
1657
+ this.value = '';
1658
+ }
1659
+
1660
+ this.optionSelected = event.target;
1661
+
1662
+ this.validation.validate(this, this.optionSelected !== undefined);
1663
+ }
1664
+
1665
+ /**
1666
+ * Method handles radio element blur.
1667
+ * @private
1668
+ * @returns {void}
1669
+ */
1670
+ handleRadioBlur() {
1671
+ this.touched = true;
1672
+ this.validation.validate(this);
1673
+ }
1674
+
1675
+ /**
1676
+ * LitElement lifecycle method. Called after the DOM has been updated.
1677
+ * @param {Map<string, any>} changedProperties - Keys are the names of changed properties, values are the corresponding previous values.
1678
+ * @returns {void}
1679
+ */
1680
+ updated(changedProperties) {
1681
+ if (changedProperties.has('disabled')) {
1682
+ // only change the children if we are making everything disabled, or if we are making everything enabled and there are no individually-disabled radio buttons
1683
+ if (this.disabled || this.items.every((el) => el.disabled)) {
1684
+ this.items.forEach((el) => {
1685
+ el.disabled = this.disabled;
1686
+ });
1687
+ }
1688
+ }
1689
+
1690
+ if (changedProperties.has('value')) {
1691
+ this.dispatchEvent(new CustomEvent('input', {
1692
+ bubbles: true,
1693
+ cancelable: true,
1694
+ composed: true,
1695
+ }));
1696
+ }
1697
+
1698
+ if (changedProperties.has('required')) {
1699
+ this.items.forEach((el) => {
1700
+ el.required = this.required;
1701
+ });
1702
+ }
1703
+
1704
+ if (changedProperties.has('onDark')) {
1705
+ this.items.forEach((el) => {
1706
+ el.onDark = this.onDark;
1707
+ });
1708
+ }
1709
+
1710
+ if (changedProperties.has('error')) {
1711
+ this.validate(true);
1712
+ }
1713
+
1714
+ if (changedProperties.has('validity')) {
1715
+ if (this.validity && this.validity !== 'valid') {
1716
+ this.items.forEach((el) => {
1717
+ el.setAttribute('error', true);
1718
+ });
1719
+ } else {
1720
+ this.items.forEach((el) => {
1721
+ el.removeAttribute('error');
1722
+ });
1723
+ }
1724
+ }
1725
+ }
1726
+
1727
+ /**
1728
+ * Resets component to initial state.
1729
+ * @returns {void}
1730
+ */
1731
+ reset() {
1732
+ // Sets first radio button to receive focus during keyboard navigation
1733
+ this.index = 0;
1734
+
1735
+ const buttons = this.querySelectorAll('auro-radio, [auro-radio]');
1736
+
1737
+ buttons.forEach((button) => {
1738
+ button.reset();
1739
+ });
1740
+
1741
+ this.validation.reset(this);
1742
+ }
1743
+
1744
+ /**
1745
+ * Validates value.
1746
+ * @param {boolean} [force=false] - Whether to force validation.
1747
+ */
1748
+ validate(force = false) {
1749
+ this.validation.validate(this, force);
1750
+ }
1751
+
1752
+ /**
1753
+ * Method handles the reset event from a radio element.
1754
+ * @private
1755
+ * @returns {void}
1756
+ */
1757
+ resetRadio() {
1758
+ if (this.items.length === 0) {
1759
+ this.handleItems();
1760
+ }
1761
+ }
1762
+
1763
+ /**
1764
+ * Method for handling the attributes of each radio input.
1765
+ * @private
1766
+ * @returns {void}
1767
+ */
1768
+ handleItems() {
1769
+ this.items = [...this.querySelectorAll(':scope auro-radio, :scope [auro-radio]')];
1770
+ this.initializeIndex();
1771
+
1772
+ if (this.disabled) {
1773
+ this.items.forEach((el) => {
1774
+ el.disabled = this.disabled;
1775
+ });
1776
+ }
1777
+
1778
+ this.items.forEach((el) => {
1779
+ el.required = this.required;
1780
+ el.error = Boolean(this.error);
1781
+ });
1782
+ }
1783
+
1784
+ /**
1785
+ * Method for handling slot content changes.
1786
+ * @private
1787
+ * @returns {void}
1788
+ */
1789
+ handleSlotChange() {
1790
+ this.handleItems();
1791
+ }
1792
+
1793
+ /**
1794
+ * Method for initializing the tab index of the checked radio input.
1795
+ * @private
1796
+ * @returns {void}
1797
+ */
1798
+ initializeIndex() {
1799
+ if (!this.disabled) {
1800
+ const index = this.items.findIndex((item) => item.hasAttribute('checked') && !item.hasAttribute('disabled'));
1801
+ const nextEnabledIndex = this.items.findIndex((item) => !item.hasAttribute('disabled'));
1802
+
1803
+ this.index = index >= 0 ? index : nextEnabledIndex;
1804
+ this.items[this.index].setAttribute('tabindex', 0);
1805
+ }
1806
+ }
1807
+
1808
+ /**
1809
+ * Method for handling a newly selected radio input.
1810
+ * @private
1811
+ * @param {Event} event - The trigger event tied to this function.
1812
+ * @returns {void}
1813
+ */
1814
+ handleToggleSelected(event) {
1815
+ this.index = this.items.indexOf(event.target);
1816
+
1817
+ this.items.forEach((item) => {
1818
+ item.checked = item === event.target;
1819
+ });
1820
+
1821
+ this.value = event.target.value;
1822
+ this.optionSelected = event.target;
1823
+
1824
+ this.validation.validate(this);
1825
+ }
1826
+
1827
+ /**
1828
+ * Method for selecting a radio input.
1829
+ * @private
1830
+ * @param {Number} index - The value of the element's index attribute.
1831
+ * @returns {void}
1832
+ */
1833
+ selectItem(index) {
1834
+ const sdItem = this.items[index];
1835
+
1836
+ sdItem.click();
1837
+ sdItem.focus();
1838
+ this.index = index;
1839
+ }
1840
+
1841
+ /**
1842
+ * Method for selecting the next radio input.
1843
+ * @private
1844
+ * @param {Number} index - The value of the element's index attribute.
1845
+ * @param {String} moveDirection - Arrow key pressed by user.
1846
+ * @returns {void}
1847
+ */
1848
+ selectNextItem(index, moveDirection) {
1849
+ let currIndex = index;
1850
+
1851
+ for (currIndex; currIndex < this.items.length; moveDirection === "Down" ? currIndex += 1 : currIndex -= 1) {
1852
+ currIndex = currIndex === -1 ? this.items.length - 1 : currIndex;
1853
+ const sdItem = this.items[currIndex];
1854
+ if (sdItem) {
1855
+ if (this.disabled || this.items.every((item) => item.disabled === true)) {
1856
+ sdItem.focus();
1857
+ break;
1858
+ }
1859
+ if (!sdItem.disabled) {
1860
+ sdItem.click();
1861
+ sdItem.focus();
1862
+ this.index = currIndex;
1863
+ break;
1864
+ }
1865
+ }
1866
+ }
1867
+ }
1868
+
1869
+ /**
1870
+ * Method for handling a keydown event.
1871
+ * @private
1872
+ * @param {Event} event - The trigger event tied to this function.
1873
+ * @returns {void}
1874
+ */
1875
+ handleKeyDown(event) {
1876
+ switch (event.key) {
1877
+ case " ":
1878
+ event.preventDefault();
1879
+ this.selectItem(this.index);
1880
+ break;
1881
+
1882
+ case "Down":
1883
+ case "ArrowDown":
1884
+ case "Right":
1885
+ case "ArrowRight":
1886
+ event.preventDefault();
1887
+ this.selectNextItem(this.index === this.items.length - 1 ? 0 : this.index + 1, "Down");
1888
+ break;
1889
+
1890
+ case "Up":
1891
+ case "ArrowUp":
1892
+ case "Left":
1893
+ case "ArrowLeft":
1894
+ event.preventDefault();
1895
+ this.selectNextItem(this.index === 0 ? this.items.length - 1 : this.index - 1, "Up");
1896
+ break;
1897
+ }
1898
+ }
1899
+
1900
+ // function that renders the HTML and CSS into the scope of the component
1901
+ render() {
1902
+ const groupClasses = {
1903
+ 'displayFlex': this.horizontal && this.items.length <= this.max
1904
+ };
1905
+
1906
+ return u`
1907
+ <fieldset class="${e(groupClasses)}" part="radio-group" role="radiogroup">
1908
+ <legend>
1909
+ <slot name="legend"></slot>
1910
+ ${this.required ? undefined : u`<slot name="optionalLabel"> (optional)</slot>`}
1911
+ </legend>
1912
+ <slot @slotchange=${this.handleSlotChange}></slot>
1913
+ </fieldset>
1914
+
1915
+ ${!this.validity || this.validity === undefined || this.validity === 'valid'
1916
+ ? u`
1917
+ <${this.helpTextTag} ?onDark="${this.onDark}" part="helpText">
1918
+ <slot name="helpText"></slot>
1919
+ </${this.helpTextTag}>`
1920
+ : u`
1921
+ <${this.helpTextTag} ?onDark="${this.onDark}" role="alert" error aria-live="assertive" part="helpText">
1922
+ ${this.errorMessage}
1923
+ </${this.helpTextTag}>`
1924
+ }
1925
+ `;
1926
+ }
1927
+ }
1928
+
1929
+ AuroRadio.register();
1930
+ AuroRadioGroup.register();
1931
+
1932
+ AuroRadio.register('custom-radio');
1933
+ AuroRadioGroup.register('custom-radio-group');
1934
+
1935
+ function initExamples(initCount) {
1936
+ initCount = initCount || 0;
1937
+
1938
+ try {
1939
+ dynamicExample();
1940
+ resetStateExample();
1941
+ } catch (error) {
1942
+ if (initCount <= 20) {
1943
+ // setTimeout handles issue where content is sometimes loaded after the functions get called
1944
+ setTimeout(() => {
1945
+ initExamples(initCount + 1);
1946
+ }, 100);
1947
+ }
1948
+ }
1949
+ }
1950
+
1951
+ export { initExamples };